50 float elevation, speed;
51 recvPacket >> elevation;
57 uint8 hasMovementData;
58 recvPacket >> hasMovementData;
64 recvPacket >> movementInfo;
75 uint8 bagIndex, slot, castFlags;
81 recvPacket >> bagIndex >> slot >> castCount >> spellId >> itemGUID >> glyphIndex >> castFlags;
96 if (pItem->
GetGUID() != itemGUID)
102 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());
145 if (!spellInfo->CanBeUsedInCombat())
165 targets.
Read(recvPacket, pUser);
169 if (!
sScriptMgr->OnItemUse(pUser, pItem, targets))
193 uint8 bagIndex, slot;
194 recvPacket >> bagIndex >> slot;
196 TC_LOG_INFO(
"network",
"bagIndex: {}, slot: {}", bagIndex, slot);
216 TC_LOG_ERROR(
"entities.player.cheat",
"Possible hacking attempt: Player {} {} tried to open item [{}, entry: {}] which is not openable!",
267 TC_LOG_ERROR(
"network",
"Wrapped item {} does't have record in character_gifts table and will deleted", itemGuid.
ToString());
274 Field* fields = result->Fetch();
314 if (go->AI()->OnReportUse(
_player))
326 TC_LOG_ERROR(
"network",
"WorldSession::HandleCastSpellOpcode: attempted to cast a non-existing spell (Id: {})", castRequest.
Cast.
SpellID);
345 if (go->GetSpellForLock(
_player) == spellInfo)
364 if (spell->m_spellInfo == spellInfo && spell->m_targets.GetUnitTargetGUID() == targets.
GetUnitTargetGUID())
376 spellInfo = actualSpellInfo;
411 if (curSpell->GetSpellInfo()->Id == cancelAura.
SpellID)
428 if (!auraEffects.empty())
432 std::list<uint32> spellIDs;
434 for (Unit::AuraEffectList::const_iterator auraEffect = auraEffects.begin(); auraEffect != auraEffects.end(); ++auraEffect)
435 spellIDs.push_back((*auraEffect)->GetId());
438 for (std::list<uint32>::iterator it = spellIDs.begin(); it != spellIDs.end(); ++it)
603 data <<
uint8(player->GetSkinId());
604 data <<
uint8(player->GetFaceId());
605 data <<
uint8(player->GetHairStyleId());
606 data <<
uint8(player->GetHairColorId());
607 data <<
uint8(player->GetFacialStyle());
608 data <<
uint32(player->GetGuildId());
634 data <<
uint32(item->GetDisplayId());
663 TC_LOG_DEBUG(
"network",
"WORLD: CMSG_UPDATE_PROJECTILE_POSITION");
670 recvPacket >> casterGuid;
671 recvPacket >> spellId;
672 recvPacket >> castCount;
694 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
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 ReplaceAllItemFlags(ItemFieldFlags flags)
void SetBinding(bool val)
ItemTemplate const * GetTemplate() const
void SetMaxDurability(uint32 maxDurability)
void SetGiftCreator(ObjectGuid guid)
LowType GetCounter() const
static ObjectGuid const Empty
std::string ToString() const
PackedGuidReader ReadAsPacked()
uint32 GetUInt32Value(uint16 index) const
static ObjectGuid GetGUID(Object const *o)
void SetEntry(uint32 entry)
void SetUInt32Value(uint16 index, uint32 value)
static Player * ToPlayer(Object *o)
void SendEquipError(InventoryResult msg, Item const *item1=nullptr, Item const *item2=nullptr, uint32 itemId=0) const
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 misc)
InventoryResult CanUseItem(Item *pItem, bool not_loading=true) const
void setUInt32(uint8 index, uint32 value)
void SetPitch(float pitch)
ObjectGuid GetUnitTargetGUID() const
void ModDst(Position const &pos)
GameObject * GetGOTarget() const
void SetSpeed(float speed)
void Read(ByteBuffer &data, Unit *caster)
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)
QueryCallbackProcessor _queryProcessor
void HandleGameObjectUseOpcode(WorldPackets::GameObject::GameObjUse &packet)
void HandleUpdateProjectilePosition(WorldPacket &recvPacket)
Player * GetPlayer() const
void HandleSelfResOpcode(WorldPacket &recvData)
void HandleMirrorImageDataRequest(WorldPacket &recvData)
void HandleCastSpellOpcode(WorldPackets::Spells::CastSpell &castRequest)
void HandleCancelAutoRepeatSpellOpcode(WorldPackets::Spells::CancelAutoRepeatSpell &cancelAutoRepeatSpell)
void HandleCancelAuraOpcode(WorldPackets::Spells::CancelAura &cancelAura)
void HandleGameobjectReportUse(WorldPackets::GameObject::GameObjReportUse &packet)
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
ItemBondingType GetBonding() const
bool HasFlag(ItemFlags flag) const
::InventoryType GetInventoryType() const
void Relocate(float x, float y)
Optional< MissileTrajectoryRequest > MissileTrajectory