60 #define PLAYER_MAX_SKILLS 128
72 #define PLAYER_EXPLORED_ZONES_SIZE 200
202 #define MAX_CUF_PROFILES 5
333 #define ACTION_BUTTON_ACTION(X) (uint64(X) & 0x00000000FFFFFFFF)
334 #define ACTION_BUTTON_TYPE(X) ((uint64(X) & 0xFFFFFFFF00000000) >> 56)
335 #define MAX_ACTION_BUTTON_ACTION_VALUE (0xFFFFFFFF)
352 packedData = newData;
359 #define MAX_ACTION_BUTTONS 132
485 runeState |= (1 << index);
487 runeState &= ~(1 << index);
513 #define MAX_DRUNKEN 4
609 #define PLAYER_BYTES_2_OVERRIDE_SPELLS_UINT16_OFFSET (PLAYER_FIELD_BYTES_2_OFFSET_OVERRIDE_SPELLS_ID / 2)
611 #define KNOWN_TITLES_SIZE 6
612 #define MAX_TITLE_INDEX (KNOWN_TITLES_SIZE * 64) // 4 uint64 fields
615 enum PlayerFieldByte2Flags
617 PLAYER_FIELD_BYTE2_NONE = 0x00,
618 PLAYER_FIELD_BYTE2_STEALTH = 0x20,
619 PLAYER_FIELD_BYTE2_INVISIBILITY_GLOW = 0x40
622 enum PlayerFieldKillsOffsets
624 PLAYER_FIELD_KILLS_OFFSET_TODAY_KILLS = 0,
625 PLAYER_FIELD_KILLS_OFFSET_YESTERDAY_KILLS = 1
635 #define DISABLED_MIRROR_TIMER -1
638 enum PlayerExtraFlags
641 PLAYER_EXTRA_GM_ON = 0x0001,
642 PLAYER_EXTRA_ACCEPT_WHISPERS = 0x0004,
643 PLAYER_EXTRA_TAXICHEAT = 0x0008,
644 PLAYER_EXTRA_GM_INVISIBLE = 0x0010,
645 PLAYER_EXTRA_GM_CHAT = 0x0020,
648 PLAYER_EXTRA_PVP_DEATH = 0x0100
654 AT_LOGIN_NONE = 0x000,
655 AT_LOGIN_RENAME = 0x001,
656 AT_LOGIN_RESET_SPELLS = 0x002,
657 AT_LOGIN_RESET_TALENTS = 0x004,
658 AT_LOGIN_CUSTOMIZE = 0x008,
659 AT_LOGIN_RESET_PET_TALENTS = 0x010,
660 AT_LOGIN_FIRST = 0x020,
661 AT_LOGIN_CHANGE_FACTION = 0x040,
662 AT_LOGIN_CHANGE_RACE = 0x080,
663 AT_LOGIN_RESURRECT = 0x100,
666 typedef std::map<uint32, QuestStatusData> QuestStatusMap;
667 typedef std::set<uint32> RewardedQuestSet;
671 QUEST_DEFAULT_SAVE_TYPE = 0,
672 QUEST_DELETE_SAVE_TYPE,
673 QUEST_FORCE_DELETE_SAVE_TYPE
677 typedef std::map<uint32, QuestSaveType> QuestStatusSaveMap;
680 #define QUESTS_COMPLETED_BITS_SIZE 875
682 enum QuestSlotOffsets
685 QUEST_STATE_OFFSET = 1,
686 QUEST_COUNTS_OFFSET = 2,
687 QUEST_TIME_OFFSET = 4
690 #define MAX_QUEST_OFFSET 15
692 enum QuestSlotStateMask
694 QUEST_STATE_NONE = 0x0000,
695 QUEST_STATE_COMPLETE = 0x0001,
696 QUEST_STATE_FAIL = 0x0002
699 enum SkillUpdateState
707 struct SkillStatusData
709 SkillStatusData(
uint8 _pos, SkillUpdateState _uState) : pos(_pos), uState(_uState)
713 SkillUpdateState uState;
716 typedef std::unordered_map<uint32, SkillStatusData> SkillStatusMap;
720 ATTACKSWINGERR_CANT_ATTACK = 0,
721 ATTACKSWINGERR_NOTINRANGE = 1,
722 ATTACKSWINGERR_BADFACING = 2,
723 ATTACKSWINGERR_DEADTARGET = 3
734 PLAYER_SLOT_START = 0,
736 PLAYER_SLOT_END = 184,
737 PLAYER_SLOTS_COUNT = (PLAYER_SLOT_END - PLAYER_SLOT_START)
740 #define INVENTORY_SLOT_BAG_0 255
744 EQUIPMENT_SLOT_START = 0,
745 EQUIPMENT_SLOT_HEAD = 0,
746 EQUIPMENT_SLOT_NECK = 1,
747 EQUIPMENT_SLOT_SHOULDERS = 2,
748 EQUIPMENT_SLOT_BODY = 3,
749 EQUIPMENT_SLOT_CHEST = 4,
750 EQUIPMENT_SLOT_WAIST = 5,
751 EQUIPMENT_SLOT_LEGS = 6,
752 EQUIPMENT_SLOT_FEET = 7,
753 EQUIPMENT_SLOT_WRISTS = 8,
754 EQUIPMENT_SLOT_HANDS = 9,
755 EQUIPMENT_SLOT_FINGER1 = 10,
756 EQUIPMENT_SLOT_FINGER2 = 11,
757 EQUIPMENT_SLOT_TRINKET1 = 12,
758 EQUIPMENT_SLOT_TRINKET2 = 13,
759 EQUIPMENT_SLOT_BACK = 14,
760 EQUIPMENT_SLOT_MAINHAND = 15,
761 EQUIPMENT_SLOT_OFFHAND = 16,
762 EQUIPMENT_SLOT_RANGED = 17,
763 EQUIPMENT_SLOT_TABARD = 18,
764 EQUIPMENT_SLOT_END = 19
767 #define VISIBLE_ITEM_ENTRY_OFFSET 0
768 #define VISIBLE_ITEM_ENCHANTMENT_OFFSET 1
772 INVENTORY_SLOT_BAG_START = 19,
773 INVENTORY_SLOT_BAG_END = 23
776 enum InventoryPackSlots
778 INVENTORY_SLOT_ITEM_START = 23,
779 INVENTORY_SLOT_ITEM_END = 39
784 BANK_SLOT_ITEM_START = 39,
785 BANK_SLOT_ITEM_END = 67
790 BANK_SLOT_BAG_START = 67,
791 BANK_SLOT_BAG_END = 74
797 BUYBACK_SLOT_START = 74,
798 BUYBACK_SLOT_END = 86
803 REAGENT_SLOT_START = 87,
804 REAGENT_SLOT_END = 184,
807 enum EquipmentSetUpdateState
809 EQUIPMENT_SET_UNCHANGED = 0,
810 EQUIPMENT_SET_CHANGED = 1,
811 EQUIPMENT_SET_NEW = 2,
812 EQUIPMENT_SET_DELETED = 3
815 struct EquipmentSetInfo
818 struct EquipmentSetData
829 EquipmentSetUpdateState State = EQUIPMENT_SET_NEW;
832 #define MAX_EQUIPMENT_SET_INDEX 10 // client limit
834 typedef std::map<uint32, EquipmentSetInfo> EquipmentSetContainer;
838 ItemPosCount(
uint16 _pos,
uint32 _count) : pos(_pos), count(_count) { }
839 bool isContainedIn(std::vector<ItemPosCount>
const&
vec)
const;
843 typedef std::vector<ItemPosCount> ItemPosCountVec;
845 enum TransferAbortReason
847 TRANSFER_ABORT_NONE = 0,
848 TRANSFER_ABORT_ERROR = 1,
849 TRANSFER_ABORT_MAX_PLAYERS = 2,
850 TRANSFER_ABORT_NOT_FOUND = 3,
851 TRANSFER_ABORT_TOO_MANY_INSTANCES = 4,
852 TRANSFER_ABORT_ZONE_IN_COMBAT = 6,
853 TRANSFER_ABORT_INSUF_EXPAN_LVL = 7,
854 TRANSFER_ABORT_DIFFICULTY = 8,
855 TRANSFER_ABORT_UNIQUE_MESSAGE = 9,
856 TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 10,
857 TRANSFER_ABORT_NEED_GROUP = 11,
858 TRANSFER_ABORT_NOT_FOUND_2 = 12,
859 TRANSFER_ABORT_NOT_FOUND_3 = 13,
860 TRANSFER_ABORT_NOT_FOUND_4 = 14,
861 TRANSFER_ABORT_REALM_ONLY = 15,
862 TRANSFER_ABORT_MAP_NOT_ALLOWED = 16,
863 TRANSFER_ABORT_LOCKED_TO_DIFFERENT_INSTANCE = 18,
864 TRANSFER_ABORT_ALREADY_COMPLETED_ENCOUNTER = 19,
865 TRANSFER_ABORT_DIFFICULTY_NOT_FOUND = 22,
866 TRANSFER_ABORT_XREALM_ZONE_DOWN = 24,
867 TRANSFER_ABORT_SOLO_PLAYER_SWITCH_DIFFICULTY = 26,
872 NEW_WORLD_NORMAL = 16,
873 NEW_WORLD_SEAMLESS = 21,
876 enum InstanceResetWarningType
878 RAID_INSTANCE_WARNING_HOURS = 1,
879 RAID_INSTANCE_WARNING_MIN = 2,
880 RAID_INSTANCE_WARNING_MIN_SOON = 3,
881 RAID_INSTANCE_WELCOME = 4,
882 RAID_INSTANCE_EXPIRED = 5
886 enum ArenaTeamInfoType
890 ARENA_TEAM_MEMBER = 2,
891 ARENA_TEAM_GAMES_WEEK = 3,
892 ARENA_TEAM_GAMES_SEASON = 4,
893 ARENA_TEAM_WINS_SEASON = 5,
894 ARENA_TEAM_PERSONAL_RATING = 6,
902 REST_FLAG_IN_TAVERN = 0x1,
903 REST_FLAG_IN_CITY = 0x2,
904 REST_FLAG_IN_FACTION_AREA = 0x4,
907 enum TeleportToOptions
909 TELE_TO_GM_MODE = 0x01,
910 TELE_TO_NOT_LEAVE_TRANSPORT = 0x02,
911 TELE_TO_NOT_LEAVE_COMBAT = 0x04,
912 TELE_TO_NOT_UNSUMMON_PET = 0x08,
913 TELE_TO_SPELL = 0x10,
914 TELE_TO_SEAMLESS = 0x20
918 enum EnviromentalDamage
920 DAMAGE_EXHAUSTED = 0,
926 DAMAGE_FALL_TO_VOID = 6
931 PLAYED_TIME_TOTAL = 0,
932 PLAYED_TIME_LEVEL = 1
935 #define MAX_PLAYED_TIME_INDEX 2
938 enum PlayerLoginQueryIndex
940 PLAYER_LOGIN_QUERY_LOAD_FROM,
941 PLAYER_LOGIN_QUERY_LOAD_GROUP,
942 PLAYER_LOGIN_QUERY_LOAD_BOUND_INSTANCES,
943 PLAYER_LOGIN_QUERY_LOAD_AURAS,
944 PLAYER_LOGIN_QUERY_LOAD_AURA_EFFECTS,
945 PLAYER_LOGIN_QUERY_LOAD_SPELLS,
946 PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS,
947 PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS_OBJECTIVES,
948 PLAYER_LOGIN_QUERY_LOAD_DAILY_QUEST_STATUS,
949 PLAYER_LOGIN_QUERY_LOAD_REPUTATION,
950 PLAYER_LOGIN_QUERY_LOAD_INVENTORY,
951 PLAYER_LOGIN_QUERY_LOAD_ACTIONS,
952 PLAYER_LOGIN_QUERY_LOAD_MAIL_COUNT,
953 PLAYER_LOGIN_QUERY_LOAD_MAIL_DATE,
954 PLAYER_LOGIN_QUERY_LOAD_SOCIAL_LIST,
955 PLAYER_LOGIN_QUERY_LOAD_HOME_BIND,
956 PLAYER_LOGIN_QUERY_LOAD_SPELL_COOLDOWNS,
957 PLAYER_LOGIN_QUERY_LOAD_SPELL_CHARGES,
958 PLAYER_LOGIN_QUERY_LOAD_DECLINED_NAMES,
959 PLAYER_LOGIN_QUERY_LOAD_GUILD,
960 PLAYER_LOGIN_QUERY_LOAD_ARENA_INFO,
961 PLAYER_LOGIN_QUERY_LOAD_ACHIEVEMENTS,
962 PLAYER_LOGIN_QUERY_LOAD_CRITERIA_PROGRESS,
963 PLAYER_LOGIN_QUERY_LOAD_EQUIPMENT_SETS,
964 PLAYER_LOGIN_QUERY_LOAD_BG_DATA,
965 PLAYER_LOGIN_QUERY_LOAD_GLYPHS,
966 PLAYER_LOGIN_QUERY_LOAD_TALENTS,
967 PLAYER_LOGIN_QUERY_LOAD_ACCOUNT_DATA,
968 PLAYER_LOGIN_QUERY_LOAD_SKILLS,
969 PLAYER_LOGIN_QUERY_LOAD_WEEKLY_QUEST_STATUS,
970 PLAYER_LOGIN_QUERY_LOAD_RANDOM_BG,
971 PLAYER_LOGIN_QUERY_LOAD_BANNED,
972 PLAYER_LOGIN_QUERY_LOAD_QUEST_STATUS_REW,
973 PLAYER_LOGIN_QUERY_LOAD_INSTANCE_LOCK_TIMES,
974 PLAYER_LOGIN_QUERY_LOAD_SEASONAL_QUEST_STATUS,
975 PLAYER_LOGIN_QUERY_LOAD_MONTHLY_QUEST_STATUS,
976 PLAYER_LOGIN_QUERY_LOAD_VOID_STORAGE,
977 PLAYER_LOGIN_QUERY_LOAD_CURRENCY,
978 PLAYER_LOGIN_QUERY_LOAD_CUF_PROFILES,
979 PLAYER_LOGIN_QUERY_LOAD_CORPSE_LOCATION,
980 PLAYER_LOGIN_QUERY_LOAD_GARRISON,
981 PLAYER_LOGIN_QUERY_LOAD_GARRISON_BLUEPRINTS,
982 PLAYER_LOGIN_QUERY_LOAD_GARRISON_BUILDINGS,
983 PLAYER_LOGIN_QUERY_LOAD_GARRISON_FOLLOWERS,
984 PLAYER_LOGIN_QUERY_LOAD_GARRISON_FOLLOWER_ABILITIES,
985 MAX_PLAYER_LOGIN_QUERY
988 enum PlayerDelayedOperations
990 DELAYED_SAVE_PLAYER = 0x01,
991 DELAYED_RESURRECT_PLAYER = 0x02,
992 DELAYED_SPELL_CAST_DESERTER = 0x04,
993 DELAYED_BG_MOUNT_RESTORE = 0x08,
994 DELAYED_BG_TAXI_RESTORE = 0x10,
995 DELAYED_BG_GROUP_RESTORE = 0x20,
1000 #define MAX_PLAYER_SUMMON_DELAY (2*MINUTE)
1004 enum BindExtensionState
1006 EXTEND_STATE_EXPIRED = 0,
1007 EXTEND_STATE_NORMAL = 1,
1008 EXTEND_STATE_EXTENDED = 2,
1009 EXTEND_STATE_KEEP = 255
1011 struct InstancePlayerBind
1022 BindExtensionState extendState;
1024 InstancePlayerBind() : save(
NULL), perm(
false), extendState(EXTEND_STATE_NORMAL) { }
1027 struct AccessRequirement
1036 std::string questFailedText;
1039 enum CharDeleteMethod
1041 CHAR_DELETE_REMOVE = 0,
1042 CHAR_DELETE_UNLINK = 1
1046 enum ReferAFriendError
1048 ERR_REFER_A_FRIEND_NONE = 0,
1049 ERR_REFER_A_FRIEND_NOT_REFERRED_BY = 1,
1050 ERR_REFER_A_FRIEND_TARGET_TOO_HIGH = 2,
1051 ERR_REFER_A_FRIEND_INSUFFICIENT_GRANTABLE_LEVELS = 3,
1052 ERR_REFER_A_FRIEND_TOO_FAR = 4,
1053 ERR_REFER_A_FRIEND_DIFFERENT_FACTION = 5,
1054 ERR_REFER_A_FRIEND_NOT_NOW = 6,
1055 ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I = 7,
1056 ERR_REFER_A_FRIEND_NO_TARGET = 8,
1057 ERR_REFER_A_FRIEND_NOT_IN_GROUP = 9,
1058 ERR_REFER_A_FRIEND_SUMMON_LEVEL_MAX_I = 10,
1059 ERR_REFER_A_FRIEND_SUMMON_COOLDOWN = 11,
1060 ERR_REFER_A_FRIEND_INSUF_EXPAN_LVL = 12,
1061 ERR_REFER_A_FRIEND_SUMMON_OFFLINE_S = 13,
1062 ERR_REFER_A_FRIEND_NO_XREALM = 14,
1063 ERR_REFER_A_FRIEND_MAP_INCOMING_TRANSFER_NOT_ALLOWED = 15
1066 enum PlayerRestState
1068 REST_STATE_RESTED = 0x01,
1069 REST_STATE_NOT_RAF_LINKED = 0x02,
1070 REST_STATE_RAF_LINKED = 0x06
1073 enum PlayerCommandStates
1077 CHEAT_CASTTIME = 0x02,
1078 CHEAT_COOLDOWN = 0x04,
1080 CHEAT_WATERWALK = 0x10
1083 enum PlayerLogXPReason
1085 LOG_XP_REASON_KILL = 0,
1086 LOG_XP_REASON_NO_KILL = 1
1094 BGData() : bgInstanceID(0), bgTypeID(
BATTLEGROUND_TYPE_NONE), bgAfkReportedCount(0), bgAfkReportedTimer(0),
1095 bgTeam(0), mountSpell(0) { ClearTaxiPath(); }
1102 uint8 bgAfkReportedCount;
1103 time_t bgAfkReportedTimer;
1112 void ClearTaxiPath() { taxiPath[0] = taxiPath[1] = 0; }
1113 bool HasTaxiPath()
const {
return taxiPath[0] && taxiPath[1]; }
1116 struct VoidStorageItem
1118 VoidStorageItem() : ItemId(0),
ItemEntry(0), ItemRandomPropertyId(0), ItemSuffixFactor(0), ItemUpgradeId(0) { }
1120 : ItemId(id),
ItemEntry(entry), CreatorGuid(creator), ItemRandomPropertyId(randomPropertyId),
1121 ItemSuffixFactor(suffixFactor), ItemUpgradeId(upgradeId)
1123 BonusListIDs.insert(BonusListIDs.end(), bonuses.begin(), bonuses.end());
1125 VoidStorageItem(VoidStorageItem&& vsi) : ItemId(vsi.ItemId),
ItemEntry(vsi.
ItemEntry), CreatorGuid(vsi.CreatorGuid), ItemRandomPropertyId(vsi.ItemRandomPropertyId),
1126 ItemSuffixFactor(vsi.ItemSuffixFactor), ItemUpgradeId(vsi.ItemUpgradeId), BonusListIDs(
std::move(vsi.BonusListIDs)) { }
1131 uint32 ItemRandomPropertyId;
1134 std::vector<int32> BonusListIDs;
1137 struct ResurrectionData
1151 PlayerTalentInfo() :
1152 ResetTalentsCost(0), ResetTalentsTime(0),
1153 ActiveGroup(0), GroupsCount(1)
1159 GroupInfo[i].SpecId = 0;
1166 delete GroupInfo[i].Talents;
1169 struct TalentGroupInfo
1177 time_t ResetTalentsTime;
1182 PlayerTalentInfo(PlayerTalentInfo
const&);
1206 bool TeleportTo(
uint32 mapid,
float x,
float y,
float z,
float orientation,
uint32 options = 0);
1208 bool TeleportToBGEntryPoint();
1210 void SetSummonPoint(
uint32 mapid,
float x,
float y,
float z);
1211 void SummonIfPossible(
bool agree);
1219 void SetInWater(
bool apply);
1221 bool IsInWater()
const override {
return m_isInWater; }
1225 void SendInitialPacketsBeforeAddToMap();
1226 void SendInitialPacketsAfterAddToMap();
1227 void SendSupercededSpell(
uint32 oldSpell,
uint32 newSpell)
const;
1228 void SendTransferAborted(
uint32 mapid, TransferAbortReason reason,
uint8 arg = 0)
const;
1231 bool CanInteractWithQuestGiver(
Object* questGiver)
const;
1240 uint8 GetChatFlags()
const;
1241 std::string autoReplyMsg;
1246 void RemoveSocial();
1250 bool ActivateTaxiPathTo(std::vector<uint32>
const& nodes,
Creature* npc =
nullptr,
uint32 spellid = 0);
1251 bool ActivateTaxiPathTo(
uint32 taxi_path_id,
uint32 spellid = 0);
1252 void CleanupAfterTaxiFlight();
1253 void ContinueTaxiFlight()
const;
1255 bool isAcceptWhispers()
const {
return (m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS) != 0; }
1256 void SetAcceptWhispers(
bool on) {
if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS;
else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
1257 bool IsGameMaster()
const {
return (m_ExtraFlags & PLAYER_EXTRA_GM_ON) != 0; }
1258 bool CanBeGameMaster()
const;
1259 void SetGameMaster(
bool on);
1260 bool isGMChat()
const {
return (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT) != 0; }
1261 void SetGMChat(
bool on) {
if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT;
else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
1262 bool isTaxiCheater()
const {
return (m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT) != 0; }
1263 void SetTaxiCheater(
bool on) {
if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT;
else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; }
1264 bool isGMVisible()
const {
return !(m_ExtraFlags & PLAYER_EXTRA_GM_INVISIBLE); }
1265 void SetGMVisible(
bool on);
1266 void SetPvPDeath(
bool on) {
if (on) m_ExtraFlags |= PLAYER_EXTRA_PVP_DEATH;
else m_ExtraFlags &= ~PLAYER_EXTRA_PVP_DEATH; }
1268 void GiveXP(
uint32 xp,
Unit* victim,
float group_rate=1.0f);
1269 void GiveLevel(
uint8 level);
1271 void InitStatsForLevel(
bool reapplyMods =
false);
1274 bool GetCommandStatus(
uint32 command)
const {
return (_activeCheats & command) != 0; }
1275 void SetCommandStatusOn(
uint32 command) { _activeCheats |= command; }
1276 void SetCommandStatusOff(
uint32 command) { _activeCheats &= ~command; }
1282 uint32 GetTotalPlayedTime()
const {
return m_Played_time[PLAYED_TIME_TOTAL]; }
1283 uint32 GetLevelPlayedTime()
const {
return m_Played_time[PLAYED_TIME_LEVEL]; }
1287 float GetRestBonus()
const {
return m_rest_bonus; }
1288 void SetRestBonus(
float rest_bonus_new);
1290 bool HasRestFlag(RestFlag restFlag)
const {
return (_restFlagMask & restFlag) != 0; }
1291 void SetRestFlag(RestFlag restFlag,
uint32 triggerId = 0);
1292 void RemoveRestFlag(RestFlag restFlag);
1295 uint32 GetInnTriggerId()
const {
return inn_triggerId; }
1299 void RemovePet(
Pet* pet,
PetSaveMode mode,
bool returnreagent =
false);
1309 void WhisperAddon(std::string
const& text, std::string
const& prefix,
Player* receiver);
1315 void SetVirtualItemSlot(
uint8 i,
Item* item);
1318 uint32 GetItemCount(
uint32 item,
bool inBankAlso =
false,
Item* skipItem =
nullptr)
const;
1319 uint32 GetItemCountWithLimitCategory(
uint32 limitCategory,
Item* skipItem =
nullptr)
const;
1322 std::vector<Item*> GetItemListByEntry(
uint32 entry,
bool inBankAlso =
false)
const;
1326 Bag* GetBagByPos(
uint8 slot)
const;
1328 Item* GetShield(
bool useable =
false)
const;
1330 std::vector<Item*> &GetItemUpdateQueue() {
return m_itemUpdateQueue; }
1331 static bool IsInventoryPos(
uint16 pos) {
return IsInventoryPos(pos >> 8, pos & 255); }
1332 static bool IsInventoryPos(
uint8 bag,
uint8 slot);
1333 static bool IsEquipmentPos(
uint16 pos) {
return IsEquipmentPos(pos >> 8, pos & 255); }
1334 static bool IsEquipmentPos(
uint8 bag,
uint8 slot);
1335 static bool IsBagPos(
uint16 pos);
1336 static bool IsBankPos(
uint16 pos) {
return IsBankPos(pos >> 8, pos & 255); }
1337 static bool IsBankPos(
uint8 bag,
uint8 slot);
1338 bool IsValidPos(
uint16 pos,
bool explicit_pos)
const {
return IsValidPos(pos >> 8, pos & 255, explicit_pos); }
1339 bool IsValidPos(
uint8 bag,
uint8 slot,
bool explicit_pos)
const;
1342 bool HasItemCount(
uint32 item,
uint32 count = 1,
bool inBankAlso =
false)
const;
1343 bool HasItemFitToSpellRequirements(
SpellInfo const* spellInfo,
Item const* ignoreItem =
nullptr)
const;
1344 bool CanNoReagentCast(
SpellInfo const* spellInfo)
const;
1347 InventoryResult CanTakeMoreSimilarItems(
Item* pItem,
uint32* offendingItemId =
nullptr)
const {
return CanTakeMoreSimilarItems(pItem->
GetEntry(), pItem->
GetCount(), pItem,
nullptr, offendingItemId); }
1348 InventoryResult CanTakeMoreSimilarItems(
uint32 entry,
uint32 count,
uint32* offendingItemId =
nullptr)
const {
return CanTakeMoreSimilarItems(entry, count,
nullptr,
nullptr, offendingItemId); }
1364 Item* StoreNewItem(ItemPosCountVec
const& pos,
uint32 itemId,
bool update,
int32 randomPropertyId = 0,
GuidSet const& allowedLooters =
GuidSet(), std::vector<int32>
const& bonusListIDs = std::vector<int32>());
1365 Item* StoreItem(ItemPosCountVec
const& pos,
Item* pItem,
bool update);
1368 void AutoUnequipOffhandIfNeed(
bool force =
false);
1369 bool StoreNewItemInBestSlots(
uint32 item_id,
uint32 item_count);
1372 void StoreLootItem(
uint8 lootSlot,
Loot* loot);
1381 void SendNewCurrency(
uint32 id)
const;
1383 void SendCurrencies()
const;
1385 void SendPvpRewards()
const;
1395 void SetCurrency(
uint32 id,
uint32 count,
bool printLog =
true);
1396 void ResetCurrencyWeekCap();
1407 void ModifyCurrency(
uint32 id,
int32 count,
bool printLog =
true,
bool ignoreMultipliers =
false);
1409 void ApplyEquipCooldown(
Item* pItem);
1410 void QuickEquipItem(
uint16 pos,
Item* pItem);
1411 void VisualizeItem(
uint8 slot,
Item* pItem);
1412 void SetVisibleItemSlot(
uint8 slot,
Item* pItem);
1413 Item* BankItem(ItemPosCountVec
const& dest,
Item* pItem,
bool update);
1414 void RemoveItem(
uint8 bag,
uint8 slot,
bool update);
1415 void MoveItemFromInventory(
uint8 bag,
uint8 slot,
bool update);
1417 void MoveItemToInventory(ItemPosCountVec
const& dest,
Item* pItem,
bool update,
bool in_characterInventoryDB =
false);
1419 void RemoveItemDependentAurasAndCasts(
Item* pItem);
1420 void DestroyItem(
uint8 bag,
uint8 slot,
bool update);
1421 void DestroyItemCount(
uint32 item,
uint32 count,
bool update,
bool unequip_check =
false);
1422 void DestroyItemCount(
Item* item,
uint32& count,
bool update);
1423 void DestroyConjuredItems(
bool update);
1424 void DestroyZoneLimitedItem(
bool update,
uint32 new_zone);
1427 void AddItemToBuyBackSlot(
Item* pItem);
1429 void RemoveItemFromBuyBackSlot(
uint32 slot,
bool del);
1433 void AddWeaponProficiency(
uint32 newflag) { m_WeaponProficiency |= newflag; }
1434 void AddArmorProficiency(
uint32 newflag) { m_ArmorProficiency |= newflag; }
1435 uint32 GetWeaponProficiency()
const {
return m_WeaponProficiency; }
1436 uint32 GetArmorProficiency()
const {
return m_ArmorProficiency; }
1437 bool IsUseEquipedWeapon(
bool mainhand)
const;
1438 bool IsTwoHandUsed()
const;
1439 void SendNewItem(
Item* item,
uint32 quantity,
bool received,
bool created,
bool broadcast =
false);
1444 float GetReputationPriceDiscount(
Creature const* creature)
const;
1446 Player* GetTrader()
const {
return m_trade ? m_trade->GetTrader() :
nullptr; }
1447 TradeData* GetTradeData()
const {
return m_trade; }
1448 void TradeCancel(
bool sendback);
1450 void UpdateEnchantTime(
uint32 time);
1451 void UpdateSoulboundTradeItems();
1452 void AddTradeableItem(
Item* item);
1453 void RemoveTradeableItem(
Item* item);
1454 void UpdateItemDuration(
uint32 time,
bool realtimeonly =
false);
1455 void AddEnchantmentDurations(
Item* item);
1456 void RemoveEnchantmentDurations(
Item* item);
1459 void ApplyEnchantment(
Item* item,
EnchantmentSlot slot,
bool apply,
bool apply_dur =
true,
bool ignore_condition =
false);
1460 void ApplyEnchantment(
Item* item,
bool apply);
1462 void SendEnchantmentDurations();
1463 void AddItemDurations(
Item* item);
1464 void RemoveItemDurations(
Item* item);
1465 void SendItemDurations();
1477 void PrepareGossipMenu(
WorldObject* source,
uint32 menuId = 0,
bool showQuests =
false);
1493 bool IsActiveQuest(
uint32 quest_id)
const;
1495 bool CanSeeStartQuest(
Quest const* quest);
1496 bool CanTakeQuest(
Quest const* quest,
bool msg);
1497 bool CanAddQuest(
Quest const* quest,
bool msg)
const;
1498 bool CanCompleteQuest(
uint32 quest_id);
1499 bool CanCompleteRepeatableQuest(
Quest const* quest);
1500 bool CanRewardQuest(
Quest const* quest,
bool msg);
1501 bool CanRewardQuest(
Quest const* quest,
uint32 reward,
bool msg);
1502 void AddQuestAndCheckCompletion(
Quest const* quest,
Object* questGiver);
1503 void AddQuest(
Quest const* quest,
Object* questGiver);
1504 void CompleteQuest(
uint32 quest_id);
1505 void IncompleteQuest(
uint32 quest_id);
1506 uint32 GetQuestMoneyReward(
Quest const* quest)
const;
1508 void RewardQuest(
Quest const* quest,
uint32 reward,
Object* questGiver,
bool announce =
true);
1509 void FailQuest(
uint32 quest_id);
1510 bool SatisfyQuestSkill(
Quest const* qInfo,
bool msg)
const;
1511 bool SatisfyQuestLevel(
Quest const* qInfo,
bool msg)
const;
1512 bool SatisfyQuestLog(
bool msg)
const;
1513 bool SatisfyQuestPreviousQuest(
Quest const* qInfo,
bool msg);
1514 bool SatisfyQuestClass(
Quest const* qInfo,
bool msg)
const;
1515 bool SatisfyQuestRace(
Quest const* qInfo,
bool msg)
const;
1516 bool SatisfyQuestReputation(
Quest const* qInfo,
bool msg);
1517 bool SatisfyQuestStatus(
Quest const* qInfo,
bool msg)
const;
1518 bool SatisfyQuestConditions(
Quest const* qInfo,
bool msg);
1519 bool SatisfyQuestTimed(
Quest const* qInfo,
bool msg)
const;
1520 bool SatisfyQuestExclusiveGroup(
Quest const* qInfo,
bool msg);
1521 bool SatisfyQuestNextChain(
Quest const* qInfo,
bool msg)
const;
1522 bool SatisfyQuestPrevChain(
Quest const* qInfo,
bool msg);
1523 bool SatisfyQuestDay(
Quest const* qInfo,
bool msg)
const;
1524 bool SatisfyQuestWeek(
Quest const* qInfo,
bool msg);
1525 bool SatisfyQuestMonth(
Quest const* qInfo,
bool msg);
1526 bool SatisfyQuestSeasonal(
Quest const* qInfo,
bool msg);
1527 bool GiveQuestSourceItem(
Quest const* quest);
1528 bool TakeQuestSourceItem(
uint32 questId,
bool msg);
1529 bool GetQuestRewardStatus(
uint32 quest_id)
const;
1532 void RemoveActiveQuest(
uint32 questId,
bool update =
true);
1533 void RemoveRewardedQuest(
uint32 questId,
bool update =
true);
1534 void SendQuestUpdate(
uint32 questId);
1537 void SetDailyQuestStatus(
uint32 quest_id);
1538 void SetWeeklyQuestStatus(
uint32 quest_id);
1539 void SetMonthlyQuestStatus(
uint32 quest_id);
1540 void SetSeasonalQuestStatus(
uint32 quest_id);
1542 void ResetWeeklyQuestStatus();
1543 void ResetMonthlyQuestStatus();
1544 void ResetSeasonalQuestStatus(
uint16 event_id);
1556 void SetQuestCompletedBit(
uint32 questBit,
bool completed);
1559 void AreaExploredOrEventHappens(
uint32 questId);
1562 void ItemRemovedQuestCheck(
uint32 entry,
uint32 count);
1565 void KilledPlayerCredit();
1569 void ReputationChanged(
FactionEntry const* factionEntry);
1570 void CurrencyChanged(
uint32 currencyId,
int32 change);
1571 bool HasQuestForItem(
uint32 itemId)
const;
1572 bool HasQuestForGO(
int32 goId)
const;
1573 void UpdateForQuestWorldObjects();
1574 bool CanShareQuest(
uint32 questId)
const;
1576 int32 GetQuestObjectiveData(
Quest const* quest,
int8 storageIndex)
const;
1577 void SetQuestObjectiveData(
Quest const* quest,
int8 storageIndex,
int32 data);
1578 void SendQuestComplete(
Quest const* quest)
const;
1579 void SendQuestReward(
Quest const* quest,
uint32 XP)
const;
1581 void SendQuestTimerFailed(
uint32 questID)
const;
1582 void SendCanTakeQuestResponse(
QuestFailedReason reason,
bool sendErrorMessage =
true, std::string reasonText =
"")
const;
1583 void SendQuestConfirmAccept(
Quest const* quest,
Player* receiver)
const;
1586 void SendQuestUpdateAddPlayer(
Quest const* quest,
uint16 newCount,
uint32 required)
const;
1588 ObjectGuid GetDivider()
const {
return m_divider; }
1589 void SetDivider(
ObjectGuid guid) { m_divider = guid; }
1591 uint32 GetInGameTime()
const {
return m_ingametime; }
1592 void SetInGameTime(
uint32 time) { m_ingametime = time; }
1594 void AddTimedQuest(
uint32 questId) { m_timedquests.insert(questId); }
1595 void RemoveTimedQuest(
uint32 questId) { m_timedquests.erase(questId); }
1597 void SaveCUFProfile(
uint8 id, std::nullptr_t) { _CUFProfiles[id] =
nullptr; }
1598 void SaveCUFProfile(
uint8 id, std::unique_ptr<CUFProfile> profile) { _CUFProfiles[id] = std::move(profile); }
1599 CUFProfile* GetCUFProfile(
uint8 id)
const {
return _CUFProfiles[id].get(); }
1600 uint8 GetCUFProfilesCount()
const
1604 if (_CUFProfiles[i])
1609 bool HasPvPForcingQuest()
const;
1619 static float GetFloatValueFromArray(
Tokenizer const& data,
uint16 index);
1622 static bool LoadPositionFromDB(
uint32& mapid,
float&
x,
float&
y,
float&
z,
float& o,
bool& in_flight,
ObjectGuid guid);
1633 void SaveToDB(
bool create =
false);
1640 static void DeleteFromDB(
ObjectGuid playerguid,
uint32 accountId,
bool updateRealmChars =
true,
bool deleteFinally =
false);
1641 static void DeleteOldCharacters();
1642 static void DeleteOldCharacters(
uint32 keepDays);
1645 bool m_mailsUpdated;
1649 void ResetPetTalents();
1650 void RegenerateAll();
1651 void Regenerate(
Powers power);
1652 void RegenerateHealth();
1653 void setRegenTimerCount(
uint32 time) {m_regenTimerCount = time;}
1654 void setWeaponChangeTimer(
uint32 time) {m_weaponChangeTimer = time;}
1657 bool ModifyMoney(
int64 amount,
bool sendError =
true);
1658 bool HasEnoughMoney(
uint64 amount)
const {
return (GetMoney() >= amount); }
1659 bool HasEnoughMoney(
int64 amount)
const;
1662 RewardedQuestSet
const& getRewardedQuests()
const {
return m_RewardedQuests; }
1663 QuestStatusMap& getQuestStatusMap() {
return m_QuestStatus; }
1665 size_t GetRewardedQuestCount()
const {
return m_RewardedQuests.size(); }
1666 bool IsQuestRewarded(
uint32 quest_id)
const;
1668 Unit* GetSelectedUnit()
const;
1669 Player* GetSelectedPlayer()
const;
1675 void AddComboPoints(
int8 count,
Spell* spell =
nullptr);
1676 void GainSpellComboPoints(
int8 count);
1677 void ClearComboPoints();
1680 void SendNewMail()
const;
1681 void UpdateNextMailTimeAndUnreads();
1682 void AddNewMailDeliverTime(time_t deliver_time);
1683 bool IsMailsLoaded()
const {
return m_mailsLoaded; }
1685 void RemoveMail(
uint32 id);
1687 void AddMail(
Mail* mail) { m_mail.push_front(mail);}
1688 uint32 GetMailSize()
const {
return uint32(m_mail.size()); }
1691 PlayerMails const& GetMails()
const {
return m_mail; }
1693 void SendItemRetrievalMail(
uint32 itemEntry,
uint32 count);
1700 time_t m_nextMailDelivereTime;
1702 typedef std::unordered_map<ObjectGuid::LowType, Item*> ItemMap;
1707 void AddMItem(
Item* it);
1710 void SendOnCancelExpectedVehicleRideAura()
const;
1711 void PetSpellInitialize();
1712 void CharmSpellInitialize();
1713 void PossessSpellInitialize();
1714 void VehicleSpellInitialize();
1715 void SendRemoveControlBar()
const;
1717 bool HasActiveSpell(
uint32 spell)
const;
1720 bool IsSpellFitByClassAndRace(
uint32 spell_id)
const;
1721 bool IsNeedCastPassiveSpellAtLearn(
SpellInfo const* spellInfo)
const;
1722 bool IsCurrentSpecMasterySpell(
SpellInfo const* spellInfo)
const;
1724 void SendProficiency(
ItemClass itemClass,
uint32 itemSubclassMask)
const;
1725 void SendKnownSpells();
1726 bool AddSpell(
uint32 spellId,
bool active,
bool learning,
bool dependent,
bool disabled,
bool loading =
false,
uint32 fromSkill = 0);
1727 void LearnSpell(
uint32 spell_id,
bool dependent,
uint32 fromSkill = 0);
1728 void RemoveSpell(
uint32 spell_id,
bool disabled =
false,
bool learn_low_rank =
true);
1729 void ResetSpells(
bool myClassOnly =
false);
1730 void LearnCustomSpells();
1731 void LearnDefaultSkills();
1733 void LearnQuestRewardedSpells();
1734 void LearnQuestRewardedSpells(
Quest const* quest);
1735 void LearnSpellHighestRank(
uint32 spellid);
1736 void AddTemporarySpell(
uint32 spellId);
1737 void RemoveTemporarySpell(
uint32 spellId);
1738 void AddOverrideSpell(
uint32 overridenSpellId,
uint32 newSpellId);
1739 void RemoveOverrideSpell(
uint32 overridenSpellId,
uint32 newSpellId);
1740 void LearnSpecializationSpells();
1741 void RemoveSpecializationSpells();
1742 void SendSpellCategoryCooldowns()
const;
1746 std::string GetGuildName()
const;
1753 uint32 GetTalentResetCost()
const {
return _talentMgr->ResetTalentsCost; }
1754 void SetTalentResetCost(
uint32 cost) { _talentMgr->ResetTalentsCost = cost; }
1755 time_t GetTalentResetTime()
const {
return _talentMgr->ResetTalentsTime; }
1756 void SetTalentResetTime(time_t time_) { _talentMgr->ResetTalentsTime = time_; }
1757 uint32 GetSpecId(
uint8 group)
const {
return _talentMgr->GroupInfo[group].SpecId; }
1758 void SetSpecId(
uint8 group,
uint32 tree) { _talentMgr->GroupInfo[group].SpecId = tree; }
1759 uint8 GetActiveTalentGroup()
const {
return _talentMgr->ActiveGroup; }
1760 void SetActiveTalentGroup(
uint8 group){ _talentMgr->ActiveGroup = group; }
1761 uint8 GetTalentGroupsCount()
const {
return _talentMgr->GroupsCount; }
1762 void SetTalentGroupsCount(
uint8 count) { _talentMgr->GroupsCount = count; }
1763 uint32 GetDefaultSpecId()
const;
1765 bool ResetTalents(
bool noCost =
false);
1766 uint32 GetNextResetTalentsCost()
const;
1767 void InitTalentForLevel();
1768 void SendTalentsInfoData();
1769 bool LearnTalent(
uint32 talentId);
1771 bool HasTalent(
uint32 spell_id,
uint8 spec)
const;
1773 uint32 CalculateTalentsTiers()
const;
1774 void LearnTalentSpecialization(
uint32 talentSpec);
1775 void ResetTalentSpecialization();
1778 void UpdateTalentGroupCount(
uint8 count);
1779 void ActivateTalentGroup(
uint8 group);
1781 void InitGlyphsForLevel();
1786 uint32 GetGlyph(
uint8 group,
uint8 slot)
const {
return _talentMgr->GroupInfo[group].Glyphs[slot]; }
1788 PlayerTalentMap const* GetTalentMap(
uint8 spec)
const {
return _talentMgr->GroupInfo[spec].Talents; }
1790 ActionButtonList const& GetActionButtons()
const {
return m_actionButtons; }
1794 void InitPrimaryProfessions();
1801 template <
class T> T ApplySpellMod(
uint32 spellId,
SpellModOp op, T &basevalue,
Spell* spell =
nullptr);
1802 void RemoveSpellMods(
Spell* spell);
1803 void RestoreSpellMods(
Spell* spell,
uint32 ownerAuraId = 0,
Aura* aura =
nullptr);
1804 void RestoreAllSpellMods(
uint32 ownerAuraId = 0,
Aura* aura =
nullptr);
1806 void SetSpellModTakingSpell(
Spell* spell,
bool apply);
1808 void RemoveArenaSpellCooldowns(
bool removeActivePetCooldowns =
false);
1809 uint32 GetLastPotionId()
const {
return m_lastPotionId; }
1810 void SetLastPotionId(
uint32 item_id) { m_lastPotionId = item_id; }
1811 void UpdatePotionCooldown(
Spell* spell =
nullptr);
1814 void ClearResurrectRequestData()
1816 _resurrectionData.reset();
1819 bool IsResurrectRequestedBy(
ObjectGuid const& guid)
const
1821 if (!IsResurrectRequested())
1824 return !_resurrectionData->GUID.IsEmpty() && _resurrectionData->GUID == guid;
1827 bool IsResurrectRequested()
const {
return _resurrectionData.get() !=
nullptr; }
1828 void ResurrectUsingRequestData();
1829 void ResurrectUsingRequestDataImpl();
1831 uint8 getCinematic()
const {
return m_cinematic; }
1832 void setCinematic(
uint8 cine) { m_cinematic = cine; }
1835 void RemoveActionButton(
uint8 button);
1837 void SendInitialActionButtons()
const { SendActionButtons(0); }
1838 void SendActionButtons(
uint32 state)
const;
1839 bool IsActionButtonDataValid(
uint8 button,
uint32 action,
uint8 type)
const;
1842 void UpdatePvPState(
bool onlyFFA =
false);
1843 void SetPvP(
bool state)
override;
1844 void UpdatePvP(
bool state,
bool override=
false);
1846 void UpdateArea(
uint32 newArea);
1847 void UpdateZoneDependentAuras(
uint32 zone_id);
1848 void UpdateAreaDependentAuras(
uint32 area_id);
1850 void UpdateAfkReport(time_t currTime);
1851 void UpdatePvPFlag(time_t currTime);
1852 void UpdateContestedPvP(
uint32 currTime);
1853 void SetContestedPvPTimer(
uint32 newTime) {m_contestedPvPTimer = newTime;}
1854 void ResetContestedPvP();
1858 void UpdateDuelFlag(time_t currTime);
1859 void CheckDuelDistance(time_t currTime);
1862 bool IsGroupVisibleFor(
Player const* p)
const;
1863 bool IsInSameGroupWith(
Player const* p)
const;
1864 bool IsInSameRaidWith(
Player const* p)
const;
1865 void UninviteFromGroup();
1868 void SendUpdateToOutOfRangeGroupMembers();
1878 Guild const* GetGuild()
const;
1882 static void RemovePetitionsAndSigns(
ObjectGuid guid);
1886 void SetArenaTeamInfoField(
uint8 slot, ArenaTeamInfoType type,
uint32 value);
1888 static void LeaveAllArenaTeams(
ObjectGuid guid);
1891 void SetArenaTeamIdInvited(
uint32 ArenaTeamId) { m_ArenaTeamIdInvited = ArenaTeamId; }
1892 uint32 GetArenaTeamIdInvited()
const {
return m_ArenaTeamIdInvited; }
1893 uint32 GetRBGPersonalRating()
const {
return 0; }
1896 Difficulty GetDungeonDifficultyID()
const {
return m_dungeonDifficulty; }
1897 Difficulty GetRaidDifficultyID()
const {
return m_raidDifficulty; }
1898 Difficulty GetLegacyRaidDifficultyID()
const {
return m_legacyRaidDifficulty; }
1899 void SetDungeonDifficultyID(
Difficulty dungeon_difficulty) { m_dungeonDifficulty = dungeon_difficulty; }
1900 void SetRaidDifficultyID(
Difficulty raid_difficulty) { m_raidDifficulty = raid_difficulty; }
1901 void SetLegacyRaidDifficultyID(
Difficulty raid_difficulty) { m_legacyRaidDifficulty = raid_difficulty; }
1910 bool UpdateCraftSkill(
uint32 spellid);
1912 bool UpdateFishingSkill();
1914 float GetHealthBonusFromStamina();
1918 void ApplySpellPenetrationBonus(
int32 amount,
bool apply);
1924 void ApplySpellPowerBonus(
int32 amount,
bool apply);
1925 void UpdateSpellDamageAndHealingBonus();
1928 void UpdateAllRatings();
1929 void UpdateMastery();
1930 bool CanUseMastery()
const;
1934 void RecalculateRating(
CombatRating cr) { ApplyRatingMod(cr, 0,
true);}
1935 float GetMeleeCritFromAgility()
const;
1936 void GetDodgeFromAgility(
float &diminishing,
float &nondiminishing)
const;
1937 float GetSpellCritFromIntellect()
const;
1938 float OCTRegenMPPerSpirit()
const;
1943 uint32 GetBaseSpellPowerBonus()
const {
return m_baseSpellPower; }
1944 int32 GetSpellPenetrationItemMod()
const {
return m_spellPenetrationItemMod; }
1947 void UpdateBlockPercentage();
1949 void UpdateAllCritPercentages();
1950 void UpdateParryPercentage();
1951 void UpdateDodgePercentage();
1952 void UpdateMeleeHitChances();
1953 void UpdateRangedHitChances();
1954 void UpdateSpellHitChances();
1956 void UpdateAllSpellCritChances();
1957 void UpdateSpellCritChance(
uint32 school);
1958 void UpdateArmorPenetration(
int32 amount);
1960 void ApplyManaRegenBonus(
int32 amount,
bool apply);
1961 void ApplyHealthRegenBonus(
int32 amount,
bool apply);
1962 void UpdateManaRegen();
1963 void UpdateRuneRegen(
RuneType rune);
1964 uint32 GetRuneTimer(
uint8 index)
const {
return m_runeGraceCooldown[index]; }
1965 void SetRuneTimer(
uint8 index,
uint32 timer) { m_runeGraceCooldown[index] = timer; }
1966 uint32 GetLastRuneGraceTimer(
uint8 index)
const {
return m_lastRuneGraceTimers[index]; }
1967 void SetLastRuneGraceTimer(
uint8 index,
uint32 timer) { m_lastRuneGraceTimers[index] = timer; }
1968 void UpdateAllRunesRegen();
1973 void RemovedInsignia(
Player* looterPlr);
1981 void SendAttackSwingCantAttack()
const;
1982 void SendAttackSwingCancelAttack()
const;
1983 void SendAttackSwingDeadTarget()
const;
1984 void SendAttackSwingNotInRange()
const;
1985 void SendAttackSwingBadFacingAttack()
const;
1986 void SendAutoRepeatCancel(
Unit* target);
1987 void SendExplorationExperience(
uint32 Area,
uint32 Experience)
const;
1989 void SendDungeonDifficulty(
int32 forcedDifficulty = -1)
const;
1990 void SendRaidDifficulty(
bool legacy,
int32 forcedDifficulty = -1)
const;
1991 void ResetInstances(
uint8 method,
bool isRaid,
bool isLegacy);
1992 void SendResetInstanceSuccess(
uint32 MapId)
const;
1994 void SendResetFailedNotify(
uint32 mapid)
const;
1996 bool UpdatePosition(
float x,
float y,
float z,
float orientation,
bool teleport =
false)
override;
2006 void SpawnCorpseBones(
bool triggerSave =
true);
2010 bool HasCorpse()
const {
return _corpseLocation.GetMapId() !=
MAPID_INVALID; }
2011 WorldLocation GetCorpseLocation()
const {
return _corpseLocation; }
2012 uint32 GetResurrectionSpellId()
const;
2013 void ResurrectPlayer(
float restore_percent,
bool applySickness =
false);
2014 void BuildPlayerRepop();
2015 void RepopAtGraveyard();
2017 void DurabilityLossAll(
double percent,
bool inventory);
2018 void DurabilityLoss(
Item* item,
double percent);
2019 void DurabilityPointsLossAll(
int32 points,
bool inventory);
2020 void DurabilityPointsLoss(
Item* item,
int32 points);
2021 void DurabilityPointLossForEquipSlot(EquipmentSlots slot);
2022 uint32 DurabilityRepairAll(
bool cost,
float discountMod,
bool guildBank);
2023 uint32 DurabilityRepair(
uint16 pos,
bool cost,
float discountMod,
bool guildBank);
2025 void UpdateMirrorTimers();
2026 void StopMirrorTimers();
2027 bool IsMirrorTimerActive(MirrorTimerType type)
const;
2031 void JoinedChannel(
Channel* c);
2033 void CleanupChannels();
2034 void UpdateLocalChannels(
uint32 newZone);
2035 void LeaveLFGChannel();
2046 bool HasSkill(
uint32 skill)
const;
2047 void LearnSkillRewardedSpells(
uint32 skillId,
uint32 skillValue);
2049 WorldLocation& GetTeleportDest() {
return m_teleport_dest; }
2050 bool IsBeingTeleported()
const {
return mSemaphoreTeleport_Near || mSemaphoreTeleport_Far; }
2051 bool IsBeingTeleportedNear()
const {
return mSemaphoreTeleport_Near; }
2052 bool IsBeingTeleportedFar()
const {
return mSemaphoreTeleport_Far; }
2053 bool IsBeingTeleportedSeamlessly()
const {
return IsBeingTeleportedFar() && m_teleport_options & TELE_TO_SEAMLESS; }
2054 void SetSemaphoreTeleportNear(
bool semphsetting) { mSemaphoreTeleport_Near = semphsetting; }
2055 void SetSemaphoreTeleportFar(
bool semphsetting) { mSemaphoreTeleport_Far = semphsetting; }
2056 void ProcessDelayedOperations();
2058 void CheckAreaExploreAndOutdoor(
void);
2062 uint32 GetTeam()
const {
return m_team; }
2064 void setFactionForRace(
uint8 race);
2066 void InitDisplayIds();
2068 bool IsAtGroupRewardDistance(
WorldObject const* pRewardSource)
const;
2069 bool IsAtRecruitAFriendDistance(
WorldObject const* pOther)
const;
2070 void RewardPlayerAndGroupAtKill(
Unit* victim,
bool isBattleGround);
2071 void RewardPlayerAndGroupAtEvent(
uint32 creature_id,
WorldObject* pRewardSource);
2072 bool isHonorOrXPTarget(
Unit const* victim)
const;
2074 bool GetsRecruitAFriendBonus(
bool forXP);
2075 uint8 GetGrantableLevels()
const {
return m_grantableLevels; }
2076 void SetGrantableLevels(
uint8 val) { m_grantableLevels = val; }
2078 ReputationMgr& GetReputationMgr() {
return *m_reputationMgr; }
2079 ReputationMgr const& GetReputationMgr()
const {
return *m_reputationMgr; }
2081 void RewardReputation(
Unit* victim,
float rate);
2082 void RewardReputation(
Quest const* quest);
2086 void UpdateSkillsForLevel();
2087 void UpdateSkillsToMaxSkillsForLevel();
2088 void ModifySkillBonus(
uint32 skillid,
int32 val,
bool talent);
2094 void UpdateHonorFields();
2095 bool RewardHonor(
Unit* victim,
uint32 groupsize,
int32 honor = -1,
bool pvptoken =
false);
2096 uint32 GetMaxPersonalArenaRatingRequirement(
uint32 minarenaslot)
const;
2099 void SaveHealthBeforeDuel() { healthBeforeDuel =
GetHealth(); }
2101 void RestoreHealthAfterDuel() {
SetHealth(healthBeforeDuel); }
2106 void SetDrunkValue(
uint8 newDrunkValue,
uint32 itemId = 0);
2110 uint32 GetDeathTimer()
const {
return m_deathTimer; }
2111 uint32 GetCorpseReclaimDelay(
bool pvp)
const;
2112 void UpdateCorpseReclaimDelay();
2113 int32 CalculateCorpseReclaimDelay(
bool load =
false)
const;
2114 void SendCorpseReclaimDelay(
uint32 delay)
const;
2117 bool CanParry()
const {
return m_canParry; }
2118 void SetCanParry(
bool value);
2119 bool CanBlock()
const {
return m_canBlock; }
2120 void SetCanBlock(
bool value);
2121 bool CanTitanGrip()
const {
return m_canTitanGrip; }
2122 void SetCanTitanGrip(
bool value) { m_canTitanGrip =
value; }
2125 void SetRegularAttackTime();
2129 float GetTotalBaseModValue(
BaseModGroup modGroup)
const;
2130 float GetTotalPercentageModValue(
BaseModGroup modGroup)
const {
return m_auraBaseMod[modGroup][
FLAT_MOD] + m_auraBaseMod[modGroup][
PCT_MOD]; }
2131 void _ApplyAllStatBonuses();
2132 void _RemoveAllStatBonuses();
2134 void ResetAllPowers();
2141 void _RemoveAllItemMods();
2142 void _ApplyAllItemMods();
2143 void _ApplyAllLevelScaleItemMods(
bool apply);
2146 bool EnchantmentFitsRequirements(
uint32 enchantmentcondition,
int8 slot)
const;
2147 void ToggleMetaGemsActive(
uint8 exceptslot,
bool apply);
2148 void CorrectMetaGemEnchants(
uint8 slot,
bool apply);
2149 void InitDataForForm(
bool reapplyMods =
false);
2151 void ApplyItemEquipSpell(
Item* item,
bool apply,
bool formChange =
false);
2152 void ApplyEquipSpell(
SpellInfo const* spellInfo,
Item* item,
bool apply,
bool formChange =
false);
2153 void UpdateEquipSpellsAtFormChange();
2154 void UpdateItemSetAuras(
bool formChange =
false);
2160 void SendEquipmentSetList();
2161 void SetEquipmentSet(EquipmentSetInfo::EquipmentSetData&& newEqSet);
2162 void DeleteEquipmentSet(
uint64 id);
2165 void SendUpdateWorldState(
uint32 variable,
uint32 value,
bool hidden =
false)
const;
2166 void SendDirectMessage(
WorldPacket const* data)
const;
2167 void SendBGWeekendWorldStates()
const;
2168 void SendBattlefieldWorldStates()
const;
2170 void SendAurasForTarget(
Unit* target)
const;
2173 std::vector<ItemSetEffect*> ItemSetEff;
2179 void SendNotifyLootMoneyRemoved(
ObjectGuid lootObj)
const;
2185 bool InBattleground()
const {
return m_bgData.bgInstanceID != 0; }
2186 bool InArena()
const;
2187 uint32 GetBattlegroundId()
const {
return m_bgData.bgInstanceID; }
2192 bool InBattlegroundQueue()
const;
2200 bool HasFreeBattlegroundQueueId()
const;
2203 bool IsInvitedForBattlegroundInstance(
uint32 instanceId)
const;
2204 WorldLocation const& GetBattlegroundEntryPoint()
const {
return m_bgData.joinPos; }
2205 void SetBattlegroundEntryPoint();
2207 void SetBGTeam(
uint32 team);
2208 uint32 GetBGTeam()
const;
2210 void LeaveBattleground(
bool teleportToEntryPoint =
true);
2211 bool CanJoinToBattleground(
Battleground const* bg)
const;
2212 bool CanReportAfkDueToLimit();
2213 void ReportedAfkBy(
Player* reporter);
2214 void ClearAfkReports() { m_bgData.bgAfkReporter.clear(); }
2217 bool isTotalImmunity()
const;
2218 bool CanUseBattlegroundObject(
GameObject* gameobject)
const;
2219 bool isTotalImmune()
const;
2220 bool CanCaptureTowerPoint()
const;
2222 bool GetRandomWinner()
const {
return m_IsBGRandomWinner; }
2223 void SetRandomWinner(
bool isWinner);
2231 bool IsOutdoorPvPActive()
const;
2237 bool IsImmuneToEnvironmentalDamage()
const;
2238 uint32 EnvironmentalDamage(EnviromentalDamage type,
uint32 damage);
2244 void UpdateSpeakTime();
2245 bool CanSpeak()
const;
2253 void SetFallInformation(
uint32 time,
float z);
2258 void SetClientControl(
Unit* target,
bool allowMove);
2260 void SetMover(
Unit* target);
2262 void SetSeer(
WorldObject* target) { m_seer = target; }
2265 void StopCastingCharm();
2266 void StopCastingBindSight()
const;
2268 uint32 GetSaveTimer()
const {
return m_nextSave; }
2269 void SetSaveTimer(
uint32 timer) { m_nextSave = timer; }
2277 void SaveRecallPosition();
2280 void SendBindPointUpdate()
const;
2294 bool HaveAtClient(
Object const* u)
const;
2298 bool IsVisibleGloballyFor(
Player const* player)
const;
2300 void SendInitialVisiblePackets(
Unit* target)
const;
2302 void UpdateVisibilityForPlayer();
2304 void UpdateTriggerVisibility();
2306 void SendUpdatePhasing();
2309 void UpdateVisibilityOf(T* target,
UpdateData& data, std::set<Unit*>& visibleNow);
2313 bool HasAtLoginFlag(AtLoginFlags f)
const {
return (m_atLoginFlags & f) != 0; }
2314 void SetAtLoginFlag(AtLoginFlags f) { m_atLoginFlags |= f; }
2315 void RemoveAtLoginFlag(AtLoginFlags
flags,
bool persist =
false);
2317 bool isUsingLfg()
const;
2318 bool inRandomLfgDungeon()
const;
2320 typedef std::set<uint32> DFQuestsDoneList;
2321 DFQuestsDoneList m_DFQuests;
2324 uint32 GetTemporaryUnsummonedPetNumber()
const {
return m_temporaryUnsummonedPetNumber; }
2325 void SetTemporaryUnsummonedPetNumber(
uint32 petnumber) { m_temporaryUnsummonedPetNumber = petnumber; }
2326 void UnsummonPetTemporaryIfAny();
2327 void ResummonPetTemporaryUnSummonedIfAny();
2328 bool IsPetNeedBeTemporaryUnsummoned()
const;
2330 void SendCinematicStart(
uint32 CinematicSequenceId)
const;
2331 void SendMovieStart(
uint32 MovieId)
const;
2337 typedef std::unordered_map<
uint32 , InstancePlayerBind > BoundInstancesMap;
2339 void UpdateHomebindTime(uint32 time);
2341 uint32 m_HomebindTimer;
2342 bool m_InstanceValid;
2345 InstancePlayerBind* GetBoundInstance(uint32 mapid,
Difficulty difficulty,
bool withExpired =
false);
2346 InstancePlayerBind
const* GetBoundInstance(uint32 mapid,
Difficulty difficulty)
const;
2347 BoundInstancesMap& GetBoundInstances(
Difficulty difficulty) {
return m_boundInstances[difficulty]; }
2349 void UnbindInstance(uint32 mapid,
Difficulty difficulty,
bool unload =
false);
2350 void UnbindInstance(BoundInstancesMap::iterator &itr,
Difficulty difficulty,
bool unload =
false);
2351 InstancePlayerBind* BindToInstance(
InstanceSave* save,
bool permanent, BindExtensionState extendState = EXTEND_STATE_NORMAL,
bool load =
false);
2352 void BindToInstance();
2353 void SetPendingBind(uint32 instanceId, uint32 bindTimer);
2354 bool HasPendingBind()
const {
return _pendingBindId > 0; }
2355 void SendRaidInfo();
2356 bool Satisfy(AccessRequirement
const* ar, uint32 target_map,
bool report =
false);
2357 bool CheckInstanceValidity(
bool );
2358 bool CheckInstanceCount(uint32 instanceId)
const;
2359 void AddInstanceEnterTime(uint32 instanceId, time_t enterTime);
2362 uint32 GetLastPetNumber()
const {
return m_lastpetnumber; }
2363 void SetLastPetNumber(uint32 petnumber) { m_lastpetnumber = petnumber; }
2369 Group* GetGroupInvite()
const {
return m_groupInvite; }
2370 void SetGroupInvite(
Group* group) { m_groupInvite = group; }
2371 Group* GetGroup() {
return m_group.getTarget(); }
2372 Group const* GetGroup()
const {
return const_cast<Group const*
>(m_group.getTarget()); }
2374 void SetGroup(
Group* group,
int8 subgroup = -1);
2375 uint8 GetSubGroup()
const {
return m_group.getSubGroup(); }
2376 uint32 GetGroupUpdateFlag()
const {
return m_groupUpdateMask; }
2377 void SetGroupUpdateFlag(uint32 flag) { m_groupUpdateMask |= flag; }
2378 void RemoveGroupUpdateFlag(uint32 flag) { m_groupUpdateMask &= ~flag; }
2379 Player* GetNextRandomRaidMember(
float radius);
2383 void SetBattlegroundOrBattlefieldRaid(
Group* group,
int8 subgroup = -1);
2384 void RemoveFromBattlegroundOrBattlefieldRaid();
2385 Group* GetOriginalGroup()
const {
return m_originalGroup.getTarget(); }
2386 GroupReference& GetOriginalGroupRef() {
return m_originalGroup; }
2387 uint8 GetOriginalSubGroup()
const {
return m_originalGroup.
getSubGroup(); }
2388 void SetOriginalGroup(
Group* group,
int8 subgroup = -1);
2390 void SetPassOnGroupLoot(
bool bPassOnGroupLoot) { m_bPassOnGroupLoot = bPassOnGroupLoot; }
2391 bool GetPassOnGroupLoot()
const {
return m_bPassOnGroupLoot; }
2399 bool isAllowedToLoot(
const Creature* creature);
2401 DeclinedName const* GetDeclinedNames()
const {
return m_declinedname; }
2402 uint8 GetRunesState()
const {
return m_runes->runeState; }
2405 uint32 GetRuneCooldown(
uint8 index)
const {
return m_runes->runes[index].Cooldown; }
2406 uint32 GetRuneBaseCooldown(
uint8 index)
const {
return GetRuneTypeBaseCooldown(GetBaseRune(index)); }
2407 uint32 GetRuneTypeBaseCooldown(
RuneType runeType)
const;
2408 bool IsBaseRuneSlotsOnCooldown(
RuneType runeType)
const;
2409 RuneType GetLastUsedRune()
const {
return m_runes->lastUsedRune; }
2410 void SetLastUsedRune(
RuneType type) { m_runes->lastUsedRune = type; }
2411 void SetBaseRune(
uint8 index,
RuneType baseRune) { m_runes->runes[index].BaseRune = baseRune; }
2412 void SetCurrentRune(
uint8 index,
RuneType currentRune) { m_runes->runes[index].CurrentRune = currentRune; }
2413 void SetRuneCooldown(
uint8 index, uint32 cooldown,
bool casted =
false);
2416 void RemoveRunesByAuraEffect(
AuraEffect const* aura);
2417 void RestoreBaseRune(
uint8 index);
2419 void ResyncRunes(
uint8 count)
const;
2420 void AddRunePower(
uint8 index)
const;
2423 void SendRespondInspectAchievements(
Player* player)
const;
2424 uint32 GetAchievementPoints()
const;
2425 bool HasAchieved(uint32 achievementId)
const;
2426 void ResetAchievements();
2433 bool HasTitle(uint32 bitIndex)
const;
2438 bool CanSeeSpellClickOn(
Creature const* creature)
const;
2440 uint32 GetChampioningFaction()
const {
return m_ChampioningFaction; }
2441 void SetChampioningFaction(uint32 faction) { m_ChampioningFaction = faction; }
2442 Spell* m_spellModTakingSpell;
2444 float GetAverageItemLevel()
const;
2445 bool isDebugAreaTriggers;
2447 void ClearWhisperWhiteList() { WhisperList.clear(); }
2448 void AddWhisperWhiteList(
ObjectGuid guid) { WhisperList.push_back(guid); }
2450 void RemoveFromWhisperWhiteList(
ObjectGuid guid) { WhisperList.remove(guid); }
2457 void SendMovementSetCanTransitionBetweenSwimAndFly(
bool apply);
2458 void SendMovementSetCollisionHeight(
float height);
2463 float GetCollisionHeight(
bool mounted)
const;
2465 std::string GetMapAreaAndZoneString()
const;
2466 std::string GetCoordsMapAreaAndZoneString()
const;
2472 uint8 GetNextVoidStorageFreeSlot()
const;
2473 uint8 GetNumOfVoidStorageFreeSlots()
const;
2474 uint8 AddVoidStorageItem(VoidStorageItem&& item);
2475 void DeleteVoidStorageItem(
uint8 slot);
2476 bool SwapVoidStorageItem(
uint8 oldSlot,
uint8 newSlot);
2477 VoidStorageItem* GetVoidStorageItem(
uint8 slot)
const;
2478 VoidStorageItem* GetVoidStorageItem(
uint64 id,
uint8& slot)
const;
2480 void OnCombatExit();
2482 void CreateGarrison(uint32 garrSiteId);
2483 void DeleteGarrison();
2484 Garrison* GetGarrison()
const {
return _garrison.get(); }
2486 bool IsAdvancedCombatLoggingEnabled()
const {
return _advancedCombatLoggingEnabled; }
2487 void SetAdvancedCombatLogging(
bool enabled) { _advancedCombatLoggingEnabled = enabled; }
2492 uint32 m_regenTimerCount;
2493 uint32 m_holyPowerRegenTimerCount;
2494 uint32 m_focusRegenTimerCount;
2496 uint32 m_contestedPvPTimer;
2505 struct BgBattlegroundQueueID_Rec
2508 uint32 invitedToInstance;
2515 bool m_IsBGRandomWinner;
2522 typedef std::set<uint32> QuestSet;
2523 typedef std::set<uint32> SeasonalQuestSet;
2524 typedef std::unordered_map<uint32, SeasonalQuestSet> SeasonalEventQuestMap;
2525 QuestSet m_timedquests;
2526 QuestSet m_weeklyquests;
2527 QuestSet m_monthlyquests;
2528 SeasonalEventQuestMap m_seasonalquests;
2531 uint32 m_ingametime;
2539 void _LoadGlyphAuras();
2545 void _LoadMailedItems(
Mail* mail);
2596 void HandleSobering();
2597 void SendMirrorTimer(MirrorTimerType
Type, uint32 MaxValue, uint32 CurrentValue,
int32 Regen);
2598 void StopMirrorTimer(MirrorTimerType
Type);
2599 void HandleDrowning(uint32 time_diff);
2600 int32 getMaxTimer(MirrorTimerType timer)
const;
2605 time_t m_lastHonorUpdateTime;
2607 void outDebugValues()
const;
2612 uint32 m_speakCount;
2618 uint32 m_atLoginFlags;
2620 Item* m_items[PLAYER_SLOTS_COUNT];
2621 uint32 m_currentBuybackSlot;
2642 void UpdateConquestCurrencyCap(uint32 currency)
const;
2646 std::vector<Item*> m_itemUpdateQueue;
2647 bool m_itemUpdateQueueBlocked;
2649 uint32 m_ExtraFlags;
2651 QuestStatusMap m_QuestStatus;
2652 QuestStatusSaveMap m_QuestStatusSave;
2654 RewardedQuestSet m_RewardedQuests;
2655 QuestStatusSaveMap m_RewardedQuestsSave;
2657 SkillStatusMap mSkillStatus;
2660 uint32 m_ArenaTeamIdInvited;
2664 std::unordered_map<uint32 , std::unordered_set<uint32> > m_overrideSpells;
2665 uint32 m_lastPotionId;
2667 PlayerTalentInfo* _talentMgr;
2673 uint32 m_baseSpellPower;
2674 uint32 m_baseManaRegen;
2675 uint32 m_baseHealthRegen;
2676 int32 m_spellPenetrationItemMod;
2684 void ResetTimeSync();
2685 void SendTimeSync();
2687 std::unique_ptr<ResurrectionData> _resurrectionData;
2691 typedef std::list<Channel*> JoinedChannelsList;
2692 JoinedChannelsList m_channels;
2698 bool m_DailyQuestChanged;
2699 bool m_WeeklyQuestChanged;
2700 bool m_MonthlyQuestChanged;
2701 bool m_SeasonalQuestChanged;
2702 time_t m_lastDailyQuestTime;
2704 uint32 m_drunkTimer;
2705 uint32 m_weaponChangeTimer;
2707 uint32 m_zoneUpdateId;
2708 uint32 m_zoneUpdateTimer;
2709 uint32 m_areaUpdateId;
2711 uint32 m_deathTimer;
2712 time_t m_deathExpireTime;
2714 uint32 m_WeaponProficiency;
2715 uint32 m_ArmorProficiency;
2718 bool m_canTitanGrip;
2719 uint8 m_swingErrorMsg;
2723 uint32 inn_triggerId;
2725 uint32 _restFlagMask;
2734 Group* m_groupInvite;
2735 uint32 m_groupUpdateMask;
2736 bool m_bPassOnGroupLoot;
2739 uint32 m_lastpetnumber;
2742 time_t m_summon_expire;
2743 uint32 m_summon_mapid;
2750 EquipmentSetContainer _equipmentSets;
2756 uint8 m_grantableLevels;
2758 std::array<std::unique_ptr<CUFProfile>, MAX_CUF_PROFILES> _CUFProfiles;
2765 Item* _StoreItem(
uint16 pos,
Item* pItem, uint32 count,
bool clone,
bool update);
2769 void SendRefundInfo(
Item* item);
2770 void RefundItem(
Item* item);
2773 void AdjustQuestReqItemCount(
Quest const* quest);
2775 bool IsCanDelayTeleport()
const {
return m_bCanDelayTeleport; }
2776 void SetCanDelayTeleport(
bool setting) { m_bCanDelayTeleport = setting; }
2777 bool IsHasDelayedTeleport()
const {
return m_bHasDelayedTeleport; }
2778 void SetDelayedTeleportFlag(
bool setting) { m_bHasDelayedTeleport = setting; }
2779 void ScheduleDelayedOperation(uint32 operation) {
if (operation < DELAYED_END) m_DelayedOperations |= operation; }
2781 bool IsInstanceLoginGameMasterException()
const;
2785 void UpdateCharmedAI();
2786 uint32 m_lastFallTime;
2790 uint8 m_MirrorTimerFlags;
2791 uint8 m_MirrorTimerFlagsLast;
2796 uint32 m_lastRuneGraceTimers[
MAX_RUNES];
2800 uint32 m_teleport_options;
2801 bool mSemaphoreTeleport_Near;
2802 bool mSemaphoreTeleport_Far;
2804 uint32 m_DelayedOperations;
2805 bool m_bCanDelayTeleport;
2806 bool m_bHasDelayedTeleport;
2809 uint32 m_temporaryUnsummonedPetNumber;
2810 uint32 m_oldpetspell;
2815 uint32 m_ChampioningFaction;
2817 std::queue<uint32> m_timeSyncQueue;
2818 uint32 m_timeSyncTimer;
2819 uint32 m_timeSyncClient;
2820 uint32 m_timeSyncServer;
2823 uint32 _pendingBindId;
2824 uint32 _pendingBindTimer;
2826 uint32 _activeCheats;
2827 uint32 _maxPersonalArenaRate;
2829 std::unique_ptr<Garrison> _garrison;
2831 bool _advancedCombatLoggingEnabled;
2834 uint32 healthBeforeDuel;
2835 uint32 manaBeforeDuel;
2844 template <
class T> T Player::ApplySpellMod(uint32 spellId,
SpellModOp op, T &basevalue,
Spell* spell)
2849 float totalmul = 1.0f;
2850 int32 totalflat = 0;
2853 if (m_spellModTakingSpell)
2854 spell = m_spellModTakingSpell;
2856 for (SpellModList::iterator itr = m_spellMods[op].begin(); itr != m_spellMods[op].end(); ++itr)
2864 if (!IsAffectedBySpellmod(spellInfo, mod, spell))
2868 totalflat += mod->
value;
2872 if (basevalue == T(0))
2882 DropModCharge(mod, spell);
2884 float diff = (float)basevalue * (totalmul - 1.0f) + (float)totalflat;
2885 basevalue = T((
float)basevalue + diff);
EnchantmentSlot slot
Definition: Player.h:498
void RemoveFromWorld() override
Definition: Unit.cpp:11733
TC_GAME_API Pet * GetPet(WorldObject const &, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:179
SpellModOp op
Definition: Player.h:170
uint8 SortBy
Definition: Player.h:274
Definition: SpellAuraEffects.h:30
void CleanupsBeforeDelete(bool finalCleanup=true) override
Definition: Unit.cpp:11802
virtual void ResetMap()
Definition: Object.cpp:2187
Definition: SharedDefines.h:252
Definition: DBCStructure.h:37
PlayerCreateInfoActions action
Definition: Player.h:412
virtual void UpdateResistances(uint32 school)=0
uint32 GetCount() const
Definition: Item.h:322
BaseModGroup
Definition: Unit.h:523
std::list< Item * > ItemDurationList
Definition: Player.h:503
bool IsHostile
Definition: Player.h:422
Difficulty
Definition: DBCEnums.h:402
virtual void UpdateMaxPower(Powers power)=0
virtual bool IsNeverVisible() const
Definition: Object.h:638
Definition: UpdateMask.h:26
Definition: Position.h:228
#define MAX_CUF_PROFILES
Maximum number of CompactUnitFrames profiles.
Definition: Player.h:202
uint32 GetUInt32Value(uint16 index) const
Definition: Object.cpp:300
uint64 const MAX_MONEY_AMOUNT
Definition: Player.cpp:130
BattlegroundTypeId
Definition: SharedDefines.h:4558
Definition: UpdateFields.h:89
SellResult
Definition: Item.h:161
#define MAX_MOVE_TYPE
Definition: Unit.h:610
PlayerLevelInfo()
Definition: Player.h:375
TalentSpecialization
Definition: Player.h:120
time_t startTime
Definition: Player.h:436
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
int8_t int8
Definition: Define.h:148
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
PlayerFieldBytes2Offsets
Definition: Player.h:601
BuyBankSlotResult
Definition: Player.h:93
uint32 areaID
Definition: Player.h:443
virtual bool IsImmunedToSpellEffect(SpellInfo const *spellInfo, uint32 index) const
Definition: Unit.cpp:9339
SpellModOp
Definition: Unit.h:84
Definition: QueryHolder.h:23
Definition: QuestDef.h:279
ReputationRank
Definition: SharedDefines.h:211
virtual void TextEmote(std::string const &text, WorldObject const *target=nullptr, bool isBossEmote=false)
Definition: Unit.cpp:16403
std::list< EnchantDuration > EnchantDurationList
Definition: Player.h:502
Definition: ReputationMgr.h:64
virtual bool IsLoading() const
Definition: Unit.h:2197
int64_t int64
Definition: Define.h:145
Definition: SpellInfo.h:326
RuneType CurrentRune
Definition: Player.h:471
DuelCompleteType
Definition: SharedDefines.h:4724
float x2
Definition: Player.h:446
uint8 type
Definition: Player.h:388
Definition: DBCStructure.h:162
bool isMounted
Definition: Player.h:438
TrainerSpellState
Definition: Player.h:294
ReputationSource
Definition: Player.h:322
Definition: QuestDef.h:261
BuyResult
Definition: Item.h:148
Class used to access individual fields of database query result.
Definition: Field.h:56
EnchantmentSlot
Definition: Item.h:172
std::list< PlayerCreateInfoItem > PlayerCreateInfoItems
Definition: Player.h:371
#define PLAYER_MAX_BATTLEGROUND_QUEUES
Definition: SharedDefines.h:209
void LoadFromDB()
Definition: AddonMgr.cpp:40
Definition: UpdateFields.h:293
float positionZ
Definition: Player.h:405
uint32 Quantity
Definition: Player.h:190
void SetRuneState(uint8 index, bool set=true)
Definition: Player.h:482
uint32 item_amount
Definition: Player.h:368
PlayerCreateInfoAction(uint8 _button, uint32 _action, uint8 _type)
Definition: Player.h:385
PlayerCurrencyState state
Definition: Player.h:189
ResetFailedReason
Definition: SharedDefines.h:4906
std::map< uint8, ActionButton > ActionButtonList
Definition: Player.h:361
uint32 areaId
Definition: Player.h:402
void AddToUpdateQueueOf(Player *player)
Definition: Item.cpp:717
virtual void SetMap(Map *map)
Definition: Object.cpp:2169
#define MAX_RUNES
Definition: Player.h:451
QuestStatus
Definition: QuestDef.h:108
float orientation
Definition: Player.h:406
Definition: DBCEnums.h:426
Definition: UpdateFields.h:276
bool active
Definition: Player.h:113
PlayerFieldBytesOffsets
Definition: Player.h:593
#define UI64LIT(N)
Definition: Define.h:138
virtual bool HasSpell(uint32) const
Definition: Unit.h:1593
Definition: DBCStructure.h:830
std::unordered_map< uint32, PlayerCurrency > PlayerCurrenciesMap
Definition: Player.h:199
Stats
Definition: SharedDefines.h:235
float GetVisibilityRange() const
Definition: Object.cpp:1912
virtual void UpdateArmor()=0
Definition: Garrison.h:83
virtual void SendMessageToSetInRange(WorldPacket const *data, float dist, bool self)
Definition: Object.cpp:2150
arena_t NULL
Definition: jemalloc_internal.h:624
CUFProfile(const std::string &name, uint16 frameHeight, uint16 frameWidth, uint8 sortBy, uint8 healthText, uint32 boolOptions, uint8 topPoint, uint8 bottomPoint, uint8 leftPoint, uint16 topOffset, uint16 bottomOffset, uint16 leftOffset)
Definition: Player.h:255
void AddToWorld() override
Definition: Unit.cpp:11724
void SetUInt32Value(uint16 index, uint32 value)
Definition: Object.cpp:996
#define false
Definition: CascPort.h:18
void UpdateObjectVisibility(bool forced=true) override
Definition: Unit.cpp:14630
PlayerLevelInfo * levelInfo
Definition: Player.h:415
std::list< PlayerCreateInfoAction > PlayerCreateInfoActions
Definition: Player.h:392
uint32 action
Definition: Player.h:389
Aura *const ownerAura
Definition: Player.h:176
Definition: UpdateFields.h:214
bool dependent
Definition: Player.h:114
uint64_t uint64
Definition: g3dmath.h:170
virtual SpellInfo const * GetCastSpellInfo(SpellInfo const *spellInfo) const
Definition: Unit.cpp:16483
Definition: Creature.h:467
PlayerSpellState
Definition: Player.h:101
float positionY
Definition: Player.h:404
std::list< SkillRaceClassInfoEntry const * > PlayerCreateInfoSkills
Definition: Player.h:394
Definition: SharedDefines.h:4822
RuneCooldowns
Definition: Player.h:453
#define ACTION_BUTTON_ACTION(X)
Definition: Player.h:333
void SetGuidValue(uint16 index, ObjectGuid const &value)
Definition: Object.cpp:1120
#define MAX_TALENT_GROUPS
Definition: SharedDefines.h:853
uint8 runeState
Definition: Player.h:479
time_t startTimer
Definition: Player.h:435
float positionX
Definition: Player.h:403
SpellModType type
Definition: Player.h:171
void SetFlag(uint16 index, uint32 newFlag)
Definition: Object.cpp:1199
TotemCategory
Definition: SharedDefines.h:4156
uint32 item_id
Definition: Player.h:367
int32 GetPower(Powers power) const
Definition: Unit.cpp:11589
uint64 LowType
Definition: ObjectGuid.h:199
void apply(T *val)
Definition: ByteConverter.h:41
bool IsInHostileArea
Definition: Player.h:423
InventoryType
Definition: ItemTemplate.h:330
uint16 LeftOffset
Definition: Player.h:285
uint32 MaskID
Definition: DBCStructure.h:168
Definition: Channel.h:126
RuneType BaseRune
Definition: Player.h:470
Definition: UpdateData.h:59
Definition: UpdateFields.h:280
void RemoveItemsSetItem(Player *player, ItemTemplate const *proto)
Definition: Item.cpp:106
uint16 stats[MAX_STATS]
Definition: Player.h:377
Definition: UpdateFields.h:193
Definition: Creature.h:367
std::list< ObjectGuid > GuidList
Definition: ObjectGuid.h:333
GameobjectTypes
Definition: SharedDefines.h:2063
PlayerCreateInfoSpells customSpells
Definition: Player.h:410
RemoveMethod
Definition: SharedDefines.h:4685
DrunkenState
Definition: Player.h:505
uint8 getSubGroup() const
Definition: GroupReference.h:39
#define MAX_POWERS_PER_CLASS
Definition: SharedDefines.h:270
virtual bool IsUnderWater() const
Definition: Unit.cpp:2969
uint8 getLevel() const
Definition: Unit.h:1408
uint16 TopOffset
Definition: Player.h:283
Definition: DB2Structure.h:330
RaidGroupReason
Definition: SharedDefines.h:4897
time_t outOfBound
Definition: Player.h:437
Definition: SharedDefines.h:1000
PvPInfo()
Definition: Player.h:420
#define MAX_STATS
Definition: SharedDefines.h:244
Definition: UpdateFields.h:198
Player * initiator
Definition: Player.h:433
Definition: DynamicObject.h:35
PlayerUnderwaterState
Definition: Player.h:82
uint16 FrameWidth
Definition: Player.h:273
virtual void CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bool addTotalPct, float &minDamage, float &maxDamage)=0
Definition: UpdateFields.h:195
Definition: UpdateFields.h:115
std::list< uint32 > PlayerCreateInfoSpells
Definition: Player.h:380
ActionButtonUpdateState
Definition: Player.h:302
PetSaveMode
Definition: PetDefines.h:32
Definition: SharedDefines.h:94
AuraEffect const * ConvertAura
Definition: Player.h:473
void InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level)
Definition: PlayerTaxi.cpp:7
QuestFailedReason
Definition: QuestDef.h:53
Powers
Definition: SharedDefines.h:246
float GetOrientation() const
Definition: Position.h:107
Definition: Creature.h:424
#define MAX_GLYPH_SLOT_INDEX
Definition: SharedDefines.h:854
PlayerSpellState state
Definition: Player.h:112
virtual bool UpdateStats(Stats stat)=0
std::bitset< CUF_BOOL_OPTIONS_COUNT > BoolOptions
Definition: Player.h:287
uint8 button
Definition: Player.h:387
Language
Definition: SharedDefines.h:959
std::list< SpellModifier * > SpellModList
Definition: Player.h:198
Definition: UpdateFields.h:197
RuneInfo runes[MAX_RUNES]
Definition: Player.h:478
float y2
Definition: Player.h:448
Definition: DB2Structure.h:27
PartyResult
Definition: SharedDefines.h:4841
PlayerFlagsEx
Definition: Player.h:551
bool IsInFFAPvPArea
Marks if player is in a sanctuary or friendly capital city
Definition: Player.h:425
PlayerBytes3Offsets
Definition: Player.h:585
bool disabled
Definition: Player.h:115
uint32 leftduration
Definition: Player.h:499
Gender
Definition: SharedDefines.h:90
Definition: DB2Structure.h:62
uint16 BottomOffset
Definition: Player.h:284
Definition: TradeData.h:34
LootType
Definition: LootMgr.h:86
SheathState
Definition: Unit.h:296
Definition: LootMgr.h:314
CUFProfile()
Definition: Player.h:241
BaseModType
Definition: Unit.h:532
AchievementCriteriaTimedTypes
Definition: DBCEnums.h:181
float GetPositionY() const
Definition: Position.h:105
void SetByteValue(uint16 index, uint8 offset, uint8 value)
Definition: Object.cpp:1080
G3D::int16 z
Definition: Vector3int16.h:46
std::unordered_map< uint32, PlayerSpell * > PlayerSpellMap
Definition: Player.h:197
Definition: SocialMgr.h:103
AchievementCriteriaTypes
Definition: DBCEnums.h:196
uint32 WeeklyQuantity
Definition: Player.h:191
#define MAX_COMBAT_RATING
Definition: Unit.h:658
virtual void UpdateUnderwaterState(Map *m, float x, float y, float z)
Definition: Unit.cpp:2974
#define sSpellMgr
Definition: SpellMgr.h:756
RuneType lastUsedRune
Definition: Player.h:480
Definition: DB2Structure.h:726
float GetPositionZ() const
Definition: Position.h:106
int32_t int32
Definition: Define.h:146
SpellModifier(Aura *_ownerAura=nullptr)
Definition: Player.h:169
Definition: UpdateFields.h:218
float x1
Definition: Player.h:445
#define CLASSMASK_ALL_PLAYABLE
Definition: SharedDefines.h:183
uint32_t uint32
Definition: Define.h:150
Definition: UpdateFields.h:190
TC_GAME_API Corpse * GetCorpse(WorldObject const &u, ObjectGuid const &guid)
Definition: ObjectAccessor.cpp:138
uint32 areaFlag
Definition: Player.h:444
uint64_t uint64
Definition: Define.h:149
uint32 spellId
Definition: Player.h:175
std::unordered_map< uint32, PlayerSpellState > PlayerTalentMap
Definition: Player.h:196
G3D::int16 y
Definition: Vector2int16.h:38
void RemoveFromUpdateQueueOf(Player *player)
Definition: Item.cpp:738
ObjectGuid const & GetGuidValue(uint16 index) const
Definition: Object.cpp:332
uint16_t uint16
Definition: Define.h:151
Definition: SharedDefines.h:992
PlayerBytes2Offsets
Definition: Player.h:577
PlayerCreateInfoItems item
Definition: Player.h:409
#define DEFAULT_WORLD_OBJECT_SIZE
Definition: Object.h:44
bool IsAlwaysDetectableFor(WorldObject const *seer) const override
Definition: Unit.cpp:10352
virtual bool CanAlwaysSee(WorldObject const *) const
Definition: Object.h:659
Definition: GameObject.h:880
void AddItemsSetItem(Player *player, Item *item)
Definition: Item.cpp:35
Definition: DBCStructure.h:982
Definition: SpellAuraDefines.h:206
uint16 displayId_m
Definition: Player.h:407
ItemClass
Definition: ItemTemplate.h:365
Definition: UpdateFields.h:233
QuestGiverStatus
Definition: QuestDef.h:120
virtual void SetSheath(SheathState sheathed)
Definition: Unit.h:1463
Definition: AchievementMgr.h:312
Definition: InstanceSaveMgr.h:44
TeamId
Definition: SharedDefines.h:990
DuelInfo()
Definition: Player.h:431
T CalculatePct(T base, U pct)
Definition: Util.h:92
uint32 mapId
Definition: Player.h:401
Definition: UpdateFields.h:116
#define MAX_CLASSES
Definition: SharedDefines.h:181
MailResponseType
Definition: SharedDefines.h:4593
PlayerCreateInfoSkills skills
Definition: Player.h:413
ActionButtonType
Definition: Player.h:310
virtual void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
Definition: Object.cpp:167
virtual uint32 GetBlockPercent() const
Definition: Unit.h:1557
PlayerCurrencyState
Definition: Player.h:179
Definition: DBCStructure.h:405
flag128 mask
Definition: Player.h:174
SpecResetType
Definition: Player.h:158
DeathState
Definition: Unit.h:539
void RemoveFlag(uint16 index, uint32 oldFlag)
Definition: Object.cpp:1214
virtual void Whisper(std::string const &text, Language language, Player *target, bool isBossWhisper=false)
Definition: Unit.cpp:16408
void SetPower(Powers power, int32 val)
Definition: Unit.cpp:11607
TC_GAME_API uint32 const MasterySpells[MAX_CLASSES]
Definition: Player.cpp:114
internal::NamedArg< char > arg(StringRef name, const T &arg)
Definition: format.h:3248
virtual void Yell(std::string const &text, Language language, WorldObject const *target=nullptr)
Definition: Unit.cpp:16398
uint8_t uint8
Definition: g3dmath.h:164
ObjectGuid const & GetGUID() const
Definition: Object.h:105
static Position Location[]
Definition: boss_skadi.cpp:46
MailResponseResult
Definition: SharedDefines.h:4603
uint8 getRace() const
Definition: Unit.h:1411
bool IsInNoPvPArea
Marks if player is in an area which forces PvP flag
Definition: Player.h:424
Definition: OutdoorPvP.h:188
void DestroyForPlayer(Player *target) const override
Definition: Unit.cpp:16301
Definition: ItemTemplate.h:647
BattlegroundQueueTypeId
Definition: SharedDefines.h:4732
Definition: CharacterPackets.h:40
Definition: PlayerTaxi.h:9
virtual void setDeathState(DeathState s)
Definition: Unit.cpp:10593
QuestPushReason
Definition: QuestDef.h:71
Definition: DB2Structure.h:710
uint8 BottomPoint
Definition: Player.h:279
Item * item
Definition: Player.h:497
Definition: LootMgr.h:213
PlayerBytesOffsets
Definition: Player.h:569
uint8 HealthText
Definition: Player.h:275
EnchantDuration(Item *_item, EnchantmentSlot _slot, uint32 _leftduration)
Definition: Player.h:494
std::set< ObjectGuid > GuidSet
Definition: ObjectGuid.h:332
virtual void SetObjectScale(float scale)
Definition: Object.h:111
Definition: UpdateFields.h:27
#define TC_GAME_API
Definition: Define.h:134
Player * opponent
Definition: Player.h:434
time_t EndTimer
Marks if player is in an FFAPvP area (such as Gurubashi Arena)
Definition: Player.h:426
uint8 TopPoint
Definition: Player.h:278
Definition: DBCStructure.h:172
void SetFloatValue(uint16 index, float value)
Definition: Object.cpp:1067
PlayerFlags
Definition: Player.h:515
#define RACEMASK_ALL_PLAYABLE
Definition: SharedDefines.h:133
virtual void SetTarget(ObjectGuid const &)=0
Definition: SharedDefines.h:4687
uint8 getClass() const
Definition: Unit.h:1413
virtual bool IsInWater() const
Definition: Unit.cpp:2964
#define MAX_SPELLMOD
Definition: Unit.h:125
virtual void SetPvP(bool state)
Definition: Unit.cpp:14455
uint8_t uint8
Definition: Define.h:152
uint8 Flags
Definition: Player.h:193
Definition: Position.h:27
#define MAPID_INVALID
Definition: Position.h:226
#define ASSERT
Definition: Errors.h:55
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport=false)
Definition: Unit.cpp:15454
Definition: SharedDefines.h:4560
Definition: Battleground.h:235
#define ACTION_BUTTON_TYPE(X)
Definition: Player.h:334
Definition: DBCStructure.h:74
bool HasAuraType(AuraType auraType) const
Definition: Unit.cpp:4247
Definition: UpdateFields.h:191
int32 value
Definition: Player.h:173
SpellModType
Definition: Player.h:75
uint16 FrameHeight
Definition: Player.h:272
const FieldDescriptor value
Definition: descriptor.h:1522
std::unordered_set< ObjectGuid > GuidUnorderedSet
Definition: ObjectGuid.h:336
uint32 GetEntry() const
Definition: Object.h:107
int16_t int16
Definition: Define.h:147
Player session in the World.
Definition: WorldSession.h:882
Definition: ObjectGuid.h:189
uint8 LeftPoint
Definition: Player.h:280
uint8 flags
Definition: DisableMgr.cpp:44
uint32_t uint32
Definition: g3dmath.h:168
virtual void SendMessageToSet(WorldPacket const *data, bool self)
Definition: Object.cpp:2144
#define const
Definition: zconf.h:217
int32 GetQuestLevel() const
Definition: QuestDef.h:310
void SetHealth(uint32 val)
Definition: Unit.cpp:11537
EnchantDuration()
Definition: Player.h:493
G3D::int16 x
Definition: Vector2int16.h:37
PlayerCreateInfoItem(uint32 id, uint32 amount)
Definition: Player.h:365
virtual bool CanFly() const =0
InventoryResult
Definition: Item.h:46
bool HasFlag(uint16 index, uint32 flag) const
Definition: Object.cpp:1239
PlayerLocalFlags
Definition: Player.h:557
RuneType
Definition: Player.h:459
Definition: SpellAuras.h:116
float GetPositionX() const
Definition: Position.h:104
virtual void UpdateMaxHealth()=0
uint32 GetHealth() const
Definition: Unit.h:1426
WeaponAttackType
Definition: Unit.h:615
float y1
Definition: Player.h:447
Type
Type of JSON value.
Definition: rapidjson.h:642
Definition: SharedDefines.h:993
PlayerCreateInfoSpells castSpells
Definition: Player.h:411
Definition: DBCStructure.h:1255
#define MAX_PLAYED_TIME_INDEX
CUFBoolOptions
Bit index used in the many bool options of CompactUnitFrames.
Definition: Player.h:205
CombatRating
Definition: Unit.h:623
Say
Definition: boss_broodlord_lashlayer.cpp:23
std::deque< Mail * > PlayerMails
Definition: Player.h:56
int16 charges
Definition: Player.h:172
PlayerInfo()
Definition: Player.h:399
virtual bool UpdateAllStats()=0
uint16 displayId_f
Definition: Player.h:408
uint64 GetUInt64Value(uint16 index) const
Definition: Object.cpp:306
std::string ProfileName
Definition: Player.h:271
Definition: WorldPacket.h:26
PlayerCreateInfoAction()
Definition: Player.h:384
PetType
Definition: PetDefines.h:22
Definition: Creature.h:79
SkillFieldOffset
Definition: Player.h:61
uint32 TrackedQuantity
Definition: Player.h:192
uint8 GetByteValue(uint16 index, uint8 offset) const
Definition: Object.cpp:318
Data
Definition: molten_core.h:69
#define MAX_TALENT_TIERS
Definition: DBCStructure.h:1252
#define DEFAULT_COMBAT_REACH
Definition: Object.h:45
std::unordered_map< uint32, time_t > InstanceTimeMap
Definition: Player.h:292
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
LootError
Definition: LootMgr.h:104
Definition: GroupReference.h:27
Definition: SharedDefines.h:248
uint32 Cooldown
Definition: Player.h:472
virtual void UpdateAttackPowerAndDamage(bool ranged=false)=0
Represents a CompactUnitFrame profile.
Definition: Player.h:239
std::shared_ptr< Transaction > SQLTransaction
Definition: Transaction.h:58
Definition: MapReference.h:25