49 float elevation, speed;
50 recvPacket >> elevation;
56 uint8 hasMovementData;
57 recvPacket >> hasMovementData;
63 recvPacket >> movementInfo;
74 uint8 bagIndex, slot, castFlags;
80 recvPacket >> bagIndex >> slot >> castCount >> spellId >> itemGUID >> glyphIndex >> castFlags;
95 if (pItem->
GetGUID() != itemGUID)
101 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_USE_ITEM packet, bagIndex: {}, slot: {}, castCount: {}, spellId: {}, Item: {}, glyphIndex: {}, data length = {}", bagIndex, slot, castCount, spellId, pItem->
GetEntry(), glyphIndex, (
uint32)recvPacket.
size());
144 if (!spellInfo->CanBeUsedInCombat())
164 targets.
Read(recvPacket, pUser);
168 if (!
sScriptMgr->OnItemUse(pUser, pItem, targets))
192 uint8 bagIndex, slot;
193 recvPacket >> bagIndex >> slot;
195 TC_LOG_INFO(
"network",
"bagIndex: {}, slot: {}", bagIndex, slot);
215 TC_LOG_ERROR(
"entities.player.cheat",
"Possible hacking attempt: Player {} {} tried to open item [{}, entry: {}] which is not openable!",
266 TC_LOG_ERROR(
"network",
"Wrapped item {} does't have record in character_gifts table and will deleted", itemGuid.
ToString());
273 Field* fields = result->Fetch();
323 if (go->AI()->OnReportUse(
_player))
333 uint8 castCount, castFlags;
334 recvPacket >> castCount >> spellId >> castFlags;
337 TC_LOG_DEBUG(
"network",
"WORLD: got cast spell packet, castCount: {}, spellId: {}, castFlags: {}, data length = {}", castCount, spellId, castFlags, (
uint32)recvPacket.
size());
342 TC_LOG_ERROR(
"network",
"WORLD: unknown spell id {}", spellId);
365 if (go->GetSpellForLock(
_player) == spellInfo)
386 if (spell->m_spellInfo == spellInfo && spell->m_targets.GetUnitTargetGUID() == targets.
GetUnitTargetGUID())
403 spellInfo = actualSpellInfo;
435 if (curSpell->m_spellInfo->Id == cancelAura.
SpellID)
453 if (!auraEffects.empty())
457 std::list<uint32> spellIDs;
459 for (Unit::AuraEffectList::const_iterator auraEffect = auraEffects.begin(); auraEffect != auraEffects.end(); ++auraEffect)
460 spellIDs.push_back((*auraEffect)->GetId());
463 for (std::list<uint32>::iterator it = spellIDs.begin(); it != spellIDs.end(); ++it)
603 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_GET_MIRRORIMAGE_DATA");
629 data <<
uint8(player->GetSkinId());
630 data <<
uint8(player->GetFaceId());
631 data <<
uint8(player->GetHairStyleId());
632 data <<
uint8(player->GetHairColorId());
633 data <<
uint8(player->GetFacialStyle());
634 data <<
uint32(player->GetGuildId());
660 data <<
uint32(item->GetTemplate()->DisplayInfoID);
689 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_UPDATE_PROJECTILE_POSITION");
696 recvPacket >> casterGuid;
697 recvPacket >> spellId;
698 recvPacket >> castCount;
720 data <<
uint8(castCount);
@ CHAR_SEL_CHARACTER_GIFT_BY_ITEM
@ ACHIEVEMENT_CRITERIA_TYPE_USE_GAMEOBJECT
DBCStorage< LockEntry > sLockStore(LockEntryfmt)
SQLTransaction< CharacterDatabaseConnection > CharacterDatabaseTransaction
std::shared_ptr< PreparedResultSet > PreparedQueryResult
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
@ EQUIP_ERR_NOT_DURING_ARENA_MATCH
@ EQUIP_ERR_CLIENT_LOCKED_OUT
@ EQUIP_ERR_NOT_IN_COMBAT
@ EQUIP_ERR_ITEM_NOT_FOUND
@ ITEM_FLAG_IGNORE_DEFAULT_ARENA_RESTRICTIONS
@ ITEM_FLAG_NOT_USEABLE_IN_ARENA
#define TC_LOG_DEBUG(filterType__,...)
#define TC_LOG_ERROR(filterType__,...)
#define TC_LOG_INFO(filterType__,...)
@ EQUIPMENT_SLOT_SHOULDERS
@ PLAYER_FLAGS_HIDE_CLOAK
#define INVENTORY_SLOT_BAG_0
@ SPELL_ATTR7_BYPASS_NO_RESURRECT_AURA
#define MAX_GLYPH_SLOT_INDEX
@ SPELL_ATTR0_CANT_CANCEL
@ SPELL_AURA_PREVENT_RESURRECTION
@ SPELL_AURA_CLONE_CASTER
@ SPELL_AURA_TRACK_RESOURCES
@ SPELL_AURA_PERIODIC_TRIGGER_SPELL_FROM_CLIENT
@ TRIGGERED_FULL_MASK
Will return SPELL_FAILED_DONT_REPORT in CheckCast functions.
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ ITEM_FIELD_MAXDURABILITY
T & AddCallback(T &&query)
Class used to access individual fields of database query result.
Unit * GetActivelyMovedUnit() const
void SetState(ItemUpdateState state, Player *forplayer=nullptr)
void SetBinding(bool val)
ItemTemplate const * GetTemplate() const
LowType GetCounter() const
static ObjectGuid const Empty
std::string ToString() const
PackedGuidReader ReadAsPacked()
uint32 GetUInt32Value(uint16 index) const
void SetGuidValue(uint16 index, ObjectGuid value)
static ObjectGuid GetGUID(Object const *o)
void SetEntry(uint32 entry)
void SetUInt32Value(uint16 index, uint32 value)
static Player * ToPlayer(Object *o)
Item * GetUseableItemByPos(uint8 bag, uint8 slot) const
void SaveInventoryAndGoldToDB(CharacterDatabaseTransaction trans)
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1=0, uint32 miscValue2=0, WorldObject *ref=nullptr)
bool HasActiveSpell(uint32 spell) const
Item * GetItemByPos(uint16 pos) const
void DestroyItem(uint8 bag, uint8 slot, bool update)
void SendLoot(ObjectGuid guid, LootType loot_type)
void CastItemUseSpell(Item *item, uint32 spellId, SpellCastTargets const &targets, uint8 cast_count, uint32 glyphIndex)
void SendEquipError(InventoryResult msg, Item *pItem, Item *pItem2=nullptr, uint32 itemid=0) const
InventoryResult CanUseItem(Item *pItem, bool not_loading=true) const
void setUInt32(uint8 index, uint32 value)
ObjectGuid GetUnitTargetGUID() const
void ModDst(Position const &pos)
GameObject * GetGOTarget() const
void SetSpeed(float speed)
void Read(ByteBuffer &data, Unit *caster)
void SetElevation(float elevation)
Unit * GetUnitTarget() const
WorldLocation const * GetDstPos() const
SpellInfo const * GetAuraRankForLevel(uint8 level) const
bool HasAttribute(SpellAttr0 attribute) const
bool IsAutoRepeatRangedSpell() const
bool HasAura(AuraType aura) const
SpellInfo const * GetSpellInfo() const
SpellCastTargets m_targets
SpellCastResult prepare(SpellCastTargets const &targets, AuraEffect const *triggeredByAura=nullptr)
void RecalculateDelayMomentForDst()
void UnSummon(uint32 msTime=0) override
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
void RemoveAurasByType(AuraType auraType, std::function< bool(AuraApplication const *)> const &check, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT)
AuraEffectList const & GetAuraEffectsByType(AuraType type) const
void HandleSpellClick(Unit *clicker, int8 seatId=-1)
Spell * FindCurrentSpellBySpellId(uint32 spell_id) const
void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid=0, bool withInstant=true)
bool IsNonMeleeSpellCast(bool withDelayed, bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false, bool skipInstant=true) const
uint32 GetDisplayId() const
void InterruptSpell(CurrentSpellTypes spellType, bool withDelayed=true, bool withInstant=true, SpellCastResult result=SPELL_FAILED_INTERRUPTED, Optional< SpellCastResult > resultOther={})
bool HasAuraType(AuraType auraType) const
bool HasAuraTypeWithTriggerSpell(AuraType auratype, uint32 triggerSpell) const
std::list< AuraEffect * > AuraEffectList
void SendPetActionFeedback(PetActionFeedback msg, uint32 spellId) const
-------—Pet responses methods--------------—
ObjectGuid m_SummonSlot[MAX_SUMMON_SLOT]
Spell * GetCurrentSpell(CurrentSpellTypes spellType) const
virtual void SendMessageToSet(WorldPacket const *data, bool self) const
SpellCastResult CastSpell(CastSpellTargetArg const &targets, uint32 spellId, CastSpellExtraArgs const &args={ })
std::string const & GetName() const
void HandleMovementOpcode(OpcodeClient opcode, MovementInfo &movementInfo)
void HandleCancelChanneling(WorldPackets::Spells::CancelChannelling &cancelChanneling)
void SendPacket(WorldPacket const *packet)
Send a packet to the client.
void HandleOpenItemOpcode(WorldPacket &recvPacket)
void HandleGameObjectUseOpcode(WorldPacket &recPacket)
QueryCallbackProcessor _queryProcessor
void HandleUpdateProjectilePosition(WorldPacket &recvPacket)
Player * GetPlayer() const
void HandleSelfResOpcode(WorldPacket &recvData)
void HandleCastSpellOpcode(WorldPacket &recvPacket)
void HandleMirrorImageDataRequest(WorldPacket &recvData)
void HandleGameobjectReportUse(WorldPacket &recvPacket)
void HandleCancelAutoRepeatSpellOpcode(WorldPackets::Spells::CancelAutoRepeatSpell &cancelAutoRepeatSpell)
void HandleCancelAuraOpcode(WorldPackets::Spells::CancelAura &cancelAura)
void HandleOpenWrappedItemCallback(uint16 pos, ObjectGuid itemGuid, PreparedQueryResult result)
void HandleCancelMountAuraOpcode(WorldPackets::Spells::CancelMountAura &cancelMountAura)
void HandleTotemDestroyed(WorldPackets::Totem::TotemDestroyed &totemDestroyed)
void HandleUseItemOpcode(WorldPacket &recvPacket)
void HandleClientCastFlags(WorldPacket &recvPacket, uint8 castFlags, SpellCastTargets &targets)
GameClient * GetGameClient() const
void HandleSpellClick(WorldPacket &recvData)
void HandleCancelGrowthAuraOpcode(WorldPackets::Spells::CancelGrowthAura &cancelGrowthAura)
void HandleCancelCastOpcode(WorldPackets::Spells::CancelCast &cancelCast)
void HandlePetCancelAuraOpcode(WorldPackets::Spells::PetCancelAura &packet)
@ SMSG_SET_PROJECTILE_POSITION
@ CONFIG_ALLOW_TRACK_BOTH_RESOURCES
TC_GAME_API Unit * GetUnit(WorldObject const &, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreature(WorldObject const &u, ObjectGuid const &guid)
TC_GAME_API Creature * GetCreatureOrPetOrVehicle(WorldObject const &, ObjectGuid const &)
std::array< ItemEffect, MAX_ITEM_PROTO_SPELLS > Effects
bool HasFlag(ItemFlags flag) const
void Relocate(float x, float y)