OregonCore  revision fb2a440-git
Your Favourite TBC server
SpellHandler.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of the OregonCore Project. See AUTHORS file for Copyright information
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License as published by the
6  * Free Software Foundation; either version 2 of the License, or (at your
7  * option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include "Common.h"
19 #include "DBCStores.h"
20 #include "WorldPacket.h"
21 #include "WorldSession.h"
22 #include "World.h"
23 #include "ObjectMgr.h"
24 #include "SpellMgr.h"
25 #include "Log.h"
26 #include "Opcodes.h"
27 #include "Spell.h"
28 #include "SpellAuras.h"
29 #include "Battleground.h"
30 #include "MapManager.h"
31 #include "Totem.h"
32 #include "ScriptMgr.h"
33 #include "CreatureAI.h"
34 
36 {
37  Player* pUser = _player;
38 
39  // ignore for remote control state
40  if (pUser->m_mover != pUser)
41  return;
42 
43  uint8 bagIndex, slot;
44  uint8 spellCount; // number of spells at item, not used
45  uint8 castCount; // next cast if exists (single or not)
46  uint64 itemGUID;
47 
48  recvPacket >> bagIndex >> slot >> spellCount >> castCount >> itemGUID;
49 
50  Item* pItem = pUser->GetItemByPos(bagIndex, slot);
51  if (!pItem)
52  {
53  pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
54  return;
55  }
56 
57  if (pItem->GetGUID() != itemGUID)
58  {
59  pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
60  return;
61  }
62 
63  sLog.outDetail("WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, spell_count: %u , cast_count: %u, Item: %u, data length = %i", bagIndex, slot, spellCount, castCount, pItem->GetEntry(), recvPacket.size());
64 
65  ItemTemplate const* proto = pItem->GetProto();
66  if (!proto)
67  {
68  pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL);
69  return;
70  }
71 
72  // some item classes can be used only in equipped state
73  if (proto->InventoryType != INVTYPE_NON_EQUIP && !pItem->IsEquipped())
74  {
75  pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL);
76  return;
77  }
78 
79  uint8 msg = pUser->CanUseItem(pItem);
80  if (msg != EQUIP_ERR_OK)
81  {
82  pUser->SendEquipError(msg, pItem, NULL);
83  return;
84  }
85 
86  // only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB)
87  if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena())
88  {
90  return;
91  }
92 
93  // don't allow items banned in arena
94  if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena())
95  {
97  return;
98  }
99 
100  if (pUser->IsInCombat())
101  {
102  for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
103  {
104  if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[i].SpellId))
105  {
106  if (IsNonCombatSpell(spellInfo))
107  {
108  pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL);
109  return;
110  }
111  }
112  }
113  }
114 
115  // check also BIND_WHEN_PICKED_UP and BIND_QUEST_ITEM for .additem or .additemset case by GM (not binded at adding to inventory)
116  if (pItem->GetProto()->Bonding == BIND_WHEN_USE || pItem->GetProto()->Bonding == BIND_WHEN_PICKED_UP || pItem->GetProto()->Bonding == BIND_QUEST_ITEM)
117  {
118  if (!pItem->IsSoulBound())
119  {
120  pItem->SetState(ITEM_CHANGED, pUser);
121  pItem->SetBinding(true);
122  }
123  }
124 
125  SpellCastTargets targets;
126  recvPacket >> targets.ReadForCaster(pUser);
127 
128  //Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state.
129  if (!sScriptMgr.ItemUse(pUser, pItem, targets))
130  {
131  // no script or script not process request by self
132 
133  // special learning case
134  if (pItem->GetProto()->Spells[0].SpellId == SPELL_GENERIC_LEARN)
135  {
136  uint32 learning_spell_id = pItem->GetProto()->Spells[1].SpellId;
137 
138  SpellEntry const* spellInfo = sSpellStore.LookupEntry(SPELL_GENERIC_LEARN);
139  if (!spellInfo)
140  {
141  sLog.outError("Item (Entry: %u) has invalid spell id %u, ignoring ", proto->ItemId, SPELL_GENERIC_LEARN);
142  pUser->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
143  return;
144  }
145 
146  Spell* spell = new Spell(pUser, spellInfo, false);
147  spell->m_CastItem = pItem;
148  spell->m_cast_count = castCount; //set count of casts
149  spell->m_currentBasePoints[0] = learning_spell_id;
150  spell->prepare(&targets);
151  return;
152  }
153 
154  // use triggered flag only for items with many spell casts and for not first cast
155  int count = 0;
156 
157  for (int i = 0; i < 5; ++i)
158  {
159  _Spell const& spellData = pItem->GetProto()->Spells[i];
160 
161  // no spell
162  if (!spellData.SpellId)
163  continue;
164 
165  // wrong triggering type
167  continue;
168 
169  SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellData.SpellId);
170  if (!spellInfo)
171  {
172  sLog.outError("Item (Entry: %u) has invalid spell id %u, ignoring ", proto->ItemId, spellData.SpellId);
173  continue;
174  }
175 
176  Spell* spell = new Spell(pUser, spellInfo, (count > 0));
177  spell->m_CastItem = pItem;
178  spell->m_cast_count = castCount; //set count of casts
179  spell->prepare(&targets);
180 
181  ++count;
182  }
183  }
184 }
185 
187 {
188  sLog.outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", recvPacket.size());
189 
190  Player* pUser = _player;
191  uint8 bagIndex, slot;
192 
193  recvPacket >> bagIndex >> slot;
194 
195  sLog.outDetail("bagIndex: %u, slot: %u", bagIndex, slot);
196 
197  Item* pItem = pUser->GetItemByPos(bagIndex, slot);
198  if (!pItem)
199  {
200  pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, NULL, NULL);
201  return;
202  }
203 
204  ItemTemplate const* proto = pItem->GetProto();
205  if (!proto)
206  {
207  pUser->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, pItem, NULL);
208  return;
209  }
210 
211  // locked item
212  uint32 lockId = proto->LockID;
213  if (lockId)
214  {
215  LockEntry const* lockInfo = sLockStore.LookupEntry(lockId);
216 
217  if (!lockInfo)
218  {
219  pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, pItem, NULL);
220  sLog.outError("WORLD::OpenItem: item [guid = %u] has an unknown lockId: %u!", pItem->GetGUIDLow(), lockId);
221  return;
222  }
223 
224  // was not unlocked yet
225  if (pItem->IsLocked())
226  {
227  pUser->SendEquipError(EQUIP_ERR_ITEM_LOCKED, pItem, NULL);
228  return;
229  }
230  }
231 
232  if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped?
233  {
234  QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT entry, flags FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow());
235  if (result)
236  {
237  Field* fields = result->Fetch();
238  uint32 entry = fields[0].GetUInt32();
239  uint32 flags = fields[1].GetUInt32();
240 
242  pItem->SetEntry(entry);
243  pItem->SetUInt32Value(ITEM_FIELD_FLAGS, flags);
244  pItem->SetState(ITEM_CHANGED, pUser);
245  }
246  else
247  {
248  sLog.outError("Wrapped item %u does not have record in character_gifts table and will be deleted", pItem->GetGUIDLow());
249  pUser->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
250  return;
251  }
252  CharacterDatabase.PExecute("DELETE FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow());
253  }
254  else
255  pUser->SendLoot(pItem->GetGUID(), LOOT_CORPSE);
256 }
257 
259 {
260  uint64 guid;
261 
262  recv_data >> guid;
263 
264  DEBUG_LOG("WORLD: Recvd CMSG_GAMEOBJ_USE Message [guid=%u]", GUID_LOPART(guid));
265 
266  GameObject* obj = GetPlayer()->GetMap()->GetGameObject(guid);
267  if (!obj)
268  return;
269 
270  FactionTemplateEntry const* faction = sFactionTemplateStore.LookupEntry(obj->GetGOInfo()->faction);
271  if (faction &&
272  !_player->IsGameMaster() &&
273  faction->IsHostileTo(*sFactionTemplateStore.LookupEntry(_player->GetFaction())) &&
274  !faction->IsNeutralToAll() &&
275  !obj->GetOwner())
276  return;
277 
278  obj->Use(_player);
279 }
280 
282 {
283  uint32 spellId;
284  uint8 cast_count;
285  recvPacket >> spellId;
286  recvPacket >> cast_count;
287 
288  DEBUG_LOG("WORLD: got cast spell packet, spellId - %u, cast_count: %u data length = %i",
289  spellId, cast_count, recvPacket.size());
290 
291  SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
292 
293  if (!spellInfo)
294  {
295  sLog.outError("WORLD: unknown spell id %u", spellId);
296  return;
297  }
298 
299  // not have spell or spell passive and not casted by client
300  if (!_player->HasSpell (spellId) || IsPassiveSpell(spellId))
301  {
302  //cheater? kick? ban?
303  return;
304  }
305 
306  // can't use our own spells when we're in possession of another unit,
307  if (_player->isPossessing())
308  return;
309 
310  // client provided targets
311  SpellCastTargets targets;
312 
313  recvPacket >> targets.ReadForCaster(_player);
314 
315  Unit* target = targets.getUnitTarget();
316  if (target) // auto-selection buff level base at target level (in spellInfo)
317  {
318  // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message
319  if (SpellEntry const* actualSpellInfo = sSpellMgr.SelectAuraRankForPlayerLevel(spellInfo, target->getLevel()))
320  spellInfo = actualSpellInfo;
321  }
322 
323  if (spellInfo->AttributesEx2 & SPELL_ATTR2_AUTOREPEAT_FLAG)
324  {
326  return;
327  }
328 
329  // When casting a combat spell the unit has to be flagged as initiating combat
330  // No need to check if spell is self-cast because combat spells can only be cast on self with commands
331  if (target && !IsNonCombatSpell(spellInfo))
333 
334  Spell* spell = new Spell(_player, spellInfo, false);
335  spell->m_cast_count = cast_count; // set count of casts
336  spell->prepare(&targets);
337 }
338 
340 {
341  uint32 spellId;
342  recvPacket >> spellId;
343 
344  if (_player->IsNonMeleeSpellCast(false))
345  _player->InterruptNonMeleeSpells(false, spellId, false);
346 }
347 
349 {
350  uint32 spellId;
351  recvPacket >> spellId;
352 
353  SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
354  if (!spellInfo)
355  return;
356 
357  // not allow remove non positive spells and spells with attr SPELL_ATTR_CANT_CANCEL
358  if (spellInfo->Attributes & SPELL_ATTR0_CANT_CANCEL)
359  return;
360 
361  // channeled spell case (it currently casted then)
362  if (IsChanneledSpell(spellInfo))
363  {
365  {
366  if (spell->m_spellInfo->Id == spellId)
367  spell->cancel();
368  }
369  return;
370  }
371 
372  // non channeled case:
373  // don't allow remove non positive spells
374  // don't allow cancelling passive auras (some of them are visible)
375  if (!IsPositiveSpell(spellId) || IsPassiveSpell(spellId))
376  return;
377 
378  // non channeled case
379  if (!IsPositiveSpell(spellId))
380  return;
381 
383 }
384 
386 {
387  uint64 guid;
388  uint32 spellId;
389 
390  recvPacket >> guid;
391  recvPacket >> spellId;
392 
393  SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
394  if (!spellInfo)
395  {
396  sLog.outError("WORLD: unknown PET spell id %u", spellId);
397  return;
398  }
399 
401 
402  if (!pet)
403  {
404  sLog.outError("Pet %u not exist.", uint32(GUID_LOPART(guid)));
405  return;
406  }
407 
408  if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharm())
409  {
410  sLog.outError("HandlePetCancelAura.Pet %u isn't pet of player %s", uint32(GUID_LOPART(guid)), GetPlayer()->GetName());
411  return;
412  }
413 
414  if (!pet->IsAlive())
415  {
417  return;
418  }
419 
420  pet->RemoveAurasDueToSpell(spellId);
421 
422  pet->AddCreatureSpellCooldown(spellId);
423 }
424 
426 {
427 }
428 
430 {
431  // may be better send SMSG_CANCEL_AUTO_REPEAT?
432  // cancel and prepare for deleting
434 }
435 
437 {
438  uint32 spellId;
439 
440  recv_data >> spellId;
442 }
443 
445 {
446  uint8 slotId;
447 
448  recvPacket >> slotId;
449 
450  ++slotId;
451  if (slotId >= MAX_TOTEM_SLOT)
452  return;
453 
454  if (!_player->m_SummonSlot[slotId])
455  return;
456 
457  Creature* totem = GetPlayer()->GetMap()->GetCreature(_player->m_SummonSlot[slotId]);
458  // Don't unsummon sentry totem
459  if (totem && totem->IsTotem() && totem->GetEntry() != SENTRY_TOTEM_ENTRY)
460  ((Totem*)totem)->UnSummon();
461 }
462 
464 {
465  DEBUG_LOG("WORLD: CMSG_SELF_RES"); // empty opcode
466 
468  {
469  SpellEntry const* spellInfo = sSpellStore.LookupEntry(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL));
470  if (spellInfo)
471  _player->CastSpell(_player, spellInfo, false, 0);
472 
474  }
475 }
476 
478 {
479  DEBUG_LOG("WORLD: Recvd CMSG_GET_MIRRORIMAGE_DATA Message");
480 
481  uint64 guid;
482  recvData >> guid;
483 
484  // Get unit for which data is needed by client
485  Unit* unit = ObjectAccessor::GetObjectInWorld(guid, (Unit*)NULL);
486  if (!unit)
487  return;
488 
490  return;
491 
492  // Get creator of the unit (SPELL_AURA_CLONE_CASTER does not stack)
493  Unit* creator = unit->GetAurasByType(SPELL_AURA_CLONE_CASTER).front()->GetCaster();
494  if (!creator)
495  return;
496 
498  data << uint64(guid);
499  data << uint32(creator->GetDisplayId());
500  data << uint8(creator->getRace());
501  data << uint8(creator->getGender());
502 
503  if (creator->GetTypeId() == TYPEID_PLAYER)
504  {
505  Player* player = creator->ToPlayer();
506  data << uint8(player->GetByteValue(PLAYER_BYTES, 0)); // skin
507  data << uint8(player->GetByteValue(PLAYER_BYTES, 1)); // face
508  data << uint8(player->GetByteValue(PLAYER_BYTES, 2)); // hair
509  data << uint8(player->GetByteValue(PLAYER_BYTES, 3)); // haircolor
510  data << uint8(player->GetByteValue(PLAYER_BYTES_2, 0)); // facialhair
511  data << uint32(player->GetGuildId()); // guildId
512 
513  static EquipmentSlots const itemSlots[] =
514  {
527  };
528 
529  // Display items in visible slots
530  for (EquipmentSlots const* itr = &itemSlots[0]; *itr != EQUIPMENT_SLOT_END; ++itr)
531  {
533  data << uint32(0);
534  else if (*itr == EQUIPMENT_SLOT_BACK && player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_HIDE_CLOAK))
535  data << uint32(0);
536  else if (Item const* item = player->GetItemByPos(INVENTORY_SLOT_BAG_0, *itr))
537  data << uint32(item->GetProto()->DisplayInfoID);
538  else
539  data << uint32(0);
540  }
541  }
542  else
543  {
544  // Skip player data for creatures
545  data << uint8(0);
546  data << uint32(0);
547  data << uint32(0);
548  data << uint32(0);
549  data << uint32(0);
550  data << uint32(0);
551  data << uint32(0);
552  data << uint32(0);
553  data << uint32(0);
554  data << uint32(0);
555  data << uint32(0);
556  data << uint32(0);
557  data << uint32(0);
558  data << uint32(0);
559  }
560 
561  SendPacket(&data);
562 }
563 
565 {
566  DEBUG_LOG("WORLD: Recvd CMSG_SPELLCLICK Message");
567 
568  uint64 guid;
569  recvData >> guid;
570 
571  // this will get something not in world. crash
573 
574  if (!unit)
575  return;
576 
578  if (!unit->IsInWorld())
579  return;
580 
581  Creature* creature = unit->ToCreature();
582  if (creature && creature->IsAIEnabled)
583  creature->AI()->OnSpellClick(_player);
584 }
void SendLoot(uint64 guid, LootType loot_type)
Definition: Player.cpp:7299
void HandleSelfResOpcode(WorldPacket &recv_data)
ItemTemplate const * GetProto() const
Definition: Item.cpp:460
SpellCastTargetsReader ReadForCaster(Unit *caster)
Definition: Spell.h:86
void SetState(ItemUpdateState state, Player *forplayer=NULL)
Definition: Item.cpp:661
uint32 InventoryType
const uint32 & GetUInt32Value(uint16 index) const
Definition: Object.h:234
Unit * GetOwner() const
Definition: GameObject.cpp:783
#define GUID_LOPART(x)
Definition: ObjectGuid.h:110
void HandlePetCancelAuraOpcode(WorldPacket &recvPacket)
void SetBinding(bool val)
Definition: Item.h:218
int32 m_currentBasePoints[3]
Definition: Spell.h:439
Map * GetMap() const
Definition: Object.h:841
bool IsPassiveSpell(uint32 spellId)
Definition: SpellMgr.cpp:278
uint32 GetFaction() const
Definition: Unit.h:1116
bool IsSoulBound() const
Definition: Item.h:219
_Spell Spells[5]
void HandleSpellClick(WorldPacket &recvData)
bool IsNeutralToAll() const
Definition: DBCStructure.h:334
QueryResult_AutoPtr PQuery(const char *format,...) ATTR_PRINTF(2
Definition: Database.cpp:400
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false) const
Definition: Unit.cpp:3547
void HandleUseItemOpcode(WorldPacket &recvPacket)
Definition: Field.h:24
void SetInitiatingCombat(bool flag)
Definition: Unit.h:1248
bool InArena() const
Definition: Player.cpp:19421
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
bool IsInCombat() const
Definition: Unit.h:1243
bool IsLocked() const
Definition: Item.h:228
bool IsEquipped() const
Definition: Item.cpp:733
#define SENTRY_TOTEM_ENTRY
Definition: Totem.h:29
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
#define sLog
Log class singleton.
Definition: Log.h:187
void HandleMirrorImageDataRequest(WorldPacket &recvData)
Unit * getUnitTarget() const
Definition: Spell.h:118
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:779
void prepare(SpellCastTargets *targets, Aura *triggeredByAura=NULL)
Definition: Spell.cpp:2222
void HandleTotemDestroy(WorldPacket &recv_data)
uint32 SpellId
static Creature * GetCreatureOrPet(WorldObject const &, uint64)
bool IsGameMaster() const
Definition: Player.h:1009
uint32 SpellTrigger
Player * GetPlayer() const
Definition: WorldSession.h:104
uint32 GetGUIDLow() const
Definition: Object.h:166
void SetEntry(uint32 entry)
Definition: Object.h:196
Item * m_CastItem
Definition: Spell.h:440
void HandleCancelAutoRepeatSpellOpcode(WorldPacket &recvPacket)
bool IsAIEnabled
Definition: Unit.h:1990
void SendPacket(WorldPacket const *packet)
uint64 m_SummonSlot[MAX_SUMMON_SLOT]
Definition: Unit.h:1607
DBCStorage< SpellEntry > sSpellStore(SpellEntryfmt)
Player * ToPlayer()
Definition: Object.h:392
void DestroyItem(uint8 bag, uint8 slot, bool update)
Definition: Player.cpp:10668
uint8 getLevel() const
Definition: Unit.h:1057
bool HasSpell(uint32 spell) const override
Definition: Player.cpp:3755
void RemoveAurasDueToSpell(uint32 spellId, Aura *except=NULL)
Definition: Unit.cpp:4371
Definition: Totem.h:31
EquipmentSlots
Definition: Player.h:535
uint32 Attributes
Definition: DBCStructure.h:679
uint8 GetTypeId() const
Definition: Object.h:210
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true)
Definition: Unit.cpp:3507
const SpellEntry *const m_spellInfo
Definition: Spell.h:438
void HandleOpenItemOpcode(WorldPacket &recvPacket)
Creature * GetCreature(uint64 guid)
Definition: Map.cpp:2630
ACE_UINT8 uint8
Definition: Define.h:73
void HandleGameObjectUseOpcode(WorldPacket &recPacket)
uint32 GetDisplayId()
Definition: Unit.h:1782
static T * GetObjectInWorld(uint64 guid, T *)
const bool & IsInWorld() const
Definition: Object.h:135
virtual void OnSpellClick(Unit *)
Definition: CreatureAI.h:200
void HandleCancelChanneling(WorldPacket &recv_data)
size_t size() const
Definition: ByteBuffer.h:336
bool IsAlive() const
Definition: Unit.h:1336
Definition: Item.h:196
void CastSpell(Unit *Victim, uint32 spellId, bool triggered, Item *castItem=NULL, Aura *triggeredByAura=NULL, uint64 originalCaster=0)
Definition: Unit.cpp:1223
CreatureAI * AI() const
Definition: Creature.h:517
#define sSpellMgr
Definition: SpellMgr.h:1239
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
Definition: Unit.h:1593
void SendEquipError(uint8 msg, Item *pItem, Item *pItem2)
Definition: Player.cpp:11515
#define DEBUG_LOG(...)
Definition: Log.h:194
void HandleCastSpellOpcode(WorldPacket &recvPacket)
bool IsChanneledSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:471
bool PExecute(const char *format,...) ATTR_PRINTF(2
Definition: Database.cpp:441
void SendPetActionFeedback(uint8 msg)
Definition: Unit.cpp:11854
#define MAX_ITEM_PROTO_SPELLS
void SetUInt64Value(uint16 index, const uint64 &value)
Definition: Object.cpp:798
bool IsPositiveSpell(uint32 spellId)
Definition: SpellMgr.cpp:773
uint32 GetGuildId()
Definition: Player.h:1823
uint8 GetSlot() const
Definition: Item.h:266
void Use(Unit *user)
Definition: GameObject.cpp:990
void HandleCancelGrowthAuraOpcode(WorldPacket &recvPacket)
ACE_UINT64 uint64
Definition: Define.h:70
uint8 getRace() const
Definition: Unit.h:1060
Player * _player
Definition: WorldSession.h:730
ACE_Refcounted_Auto_Ptr< QueryResult, ACE_Null_Mutex > QueryResult_AutoPtr
Definition: QueryResult.h:113
bool IsTotem() const
Definition: Unit.h:1050
Creature * ToCreature()
Definition: Object.h:395
GameObjectInfo const * GetGOInfo() const
Definition: GameObject.h:592
bool IsNonCombatSpell(SpellEntry const *spellInfo)
Definition: SpellMgr.h:315
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
Definition: Unit.cpp:3576
void HandleCancelCastOpcode(WorldPacket &recvPacket)
uint8 getGender() const
Definition: Unit.h:1064
#define sScriptMgr
Definition: Group.h:526
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:832
void HandleCancelAuraOpcode(WorldPacket &recvPacket)
uint32 GetEntry() const
Definition: Object.h:192
AuraList const & GetAurasByType(AuraType type) const
Definition: Unit.h:1747
uint8 CanUseItem(Item *pItem, bool not_loading=true) const
Definition: Player.cpp:10072
DatabaseType CharacterDatabase
Accessor to the character database.
Definition: Main.cpp:54
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.h:305
ACE_UINT32 uint32
Definition: Define.h:71
uint8 m_cast_count
Definition: Spell.h:442
uint32 faction
Definition: GameObject.h:43
Unit * m_mover
Definition: Player.h:2350
bool isPossessing() const
Definition: Unit.h:1446
GameObject * GetGameObject(uint64 guid)
Definition: Map.cpp:2636
void AddCreatureSpellCooldown(uint32 spellid)
Definition: Creature.cpp:2247
Definition: Unit.h:908
Item * GetItemByPos(uint16 pos) const
Definition: Player.cpp:8556
uint8 GetBagSlot() const
Definition: Item.cpp:728
Definition: Player.h:922
bool IsHostileTo(FactionTemplateEntry const &entry) const
Definition: DBCStructure.h:322
uint8 GetByteValue(uint16 index, uint8 offset) const
Definition: Object.h:252
#define MAX_TOTEM_SLOT
Definition: Unit.h:897
const uint64 & GetGUID() const
Definition: Object.h:162
void RemoveAurasDueToSpellByCancel(uint32 spellId)
Definition: Unit.cpp:4284
Definition: Spell.h:249