[1018] Converted to Unix LF. (Windows users should use dos2unix from http://www.cygwi...
[mangos-git.git] / src / game / Player.h
bloba94cc46bfc7106090de335d6f10f945a62e8b96b
1 /*
2 * Copyright (C) 2005,2006 MaNGOS <http://www.mangosproject.org/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef _PLAYER_H
20 #define _PLAYER_H
22 #include "ItemPrototype.h"
23 #include "Unit.h"
24 #include "Item.h"
26 #include "Database/DatabaseEnv.h"
27 #include "NPCHandler.h"
28 #include "QuestDef.h"
29 #include "Bag.h"
31 struct Mail;
32 class Channel;
33 class DynamicObject;
34 class Creature;
35 class PlayerMenu;
38 enum Team
40 ALLIANCE = 469,
41 HORDE = 67,
44 enum Classes
46 WARRIOR = 1,
47 PALADIN = 2,
48 HUNTER = 3,
49 ROGUE = 4,
50 PRIEST = 5,
51 SHAMAN = 7,
52 MAGE = 8,
53 WARLOCK = 9,
54 DRUID = 11,
57 enum Races
59 HUMAN = 1,
60 ORC = 2,
61 DWARF = 3,
62 NIGHTELF = 4,
63 // if it needs be to official, it's actually SCOURGE acording to the story/.dbc
64 UNDEAD_PLAYER = 5,
65 TAUREN = 6,
66 GNOME = 7,
67 TROLL = 8,
68 // officialy, this exists but was never taken into use.. neutral faction which could
69 // learn some skills/spells from horde/alliance. maybe it'll be of some use later on.
70 GOBLIN = 9,
73 struct Playerspell
75 uint16 spellId;
76 uint16 slotId;
79 struct actions
81 uint8 button;
82 uint8 type;
83 uint8 misc;
84 uint16 action;
88 struct PlayerCreateInfo
90 uint8 createId;
91 uint8 race;
92 uint8 class_;
93 uint32 mapId;
94 uint32 zoneId;
95 float positionX;
96 float positionY;
97 float positionZ;
98 uint16 displayId;
99 uint8 strength;
100 uint8 ability;
101 uint8 stamina;
102 uint8 intellect;
103 uint8 spirit;
104 uint32 basearmor;
105 uint32 health;
106 uint32 mana;
107 uint32 rage;
108 uint32 focus;
109 uint32 energy;
110 uint32 attackpower;
111 float mindmg;
112 float maxdmg;
113 float ranmindmg;
114 float ranmaxdmg;
115 std::list<uint32> item_id;
116 std::list<uint8> item_bagIndex;
117 std::list<uint8> item_slot;
118 std::list<uint32> item_amount;
119 std::list<uint16> spell;
120 std::list<uint16> skill[3];
121 std::list<uint16> action[4];
124 struct Areas
126 uint32 areaID;
127 uint32 areaFlag;
128 float x1;
129 float x2;
130 float y1;
131 float y2;
134 struct Factions
136 uint32 ID;
137 uint32 ReputationListID;
138 uint32 Flags;
139 uint32 Standing;
142 enum PlayerMovementType
144 MOVE_ROOT = 1,
145 MOVE_UNROOT = 2,
146 MOVE_WATER_WALK = 3,
147 MOVE_LAND_WALK = 4,
150 enum PlayerStateType
153 PLAYER_STATE_DANCE
154 PLAYER_STATE_SLEEP
155 PLAYER_STATE_SIT
156 PLAYER_STATE_STAND
157 PLAYER_STATE_READYUNARMED
158 PLAYER_STATE_WORK
159 PLAYER_STATE_POINT(DNR)
160 PLAYER_STATE_NONE // not used or just no state, just standing there?
161 PLAYER_STATE_STUN
162 PLAYER_STATE_DEAD
163 PLAYER_STATE_KNEEL
164 PLAYER_STATE_USESTANDING
165 PLAYER_STATE_STUN_NOSHEATHE
166 PLAYER_STATE_USESTANDING_NOSHEATHE
167 PLAYER_STATE_WORK_NOSHEATHE
168 PLAYER_STATE_SPELLPRECAST
169 PLAYER_STATE_READYRIFLE
170 PLAYER_STATE_WORK_NOSHEATHE_MINING
171 PLAYER_STATE_WORK_NOSHEATHE_CHOPWOOD
172 PLAYER_STATE_AT_EASE
173 PLAYER_STATE_READY1H
174 PLAYER_STATE_SPELLKNEELSTART
175 PLAYER_STATE_SUBMERGED
178 PLAYER_STATE_NONE = 0,
179 PLAYER_STATE_SIT = 1,
180 PLAYER_STATE_SIT_CHAIR = 2,
181 PLAYER_STATE_SLEEP = 3,
182 PLAYER_STATE_SIT_LOW_CHAIR = 4,
183 PLAYER_STATE_SIT_MEDIUM_CHAIR = 5,
184 PLAYER_STATE_SIT_HIGH_CHAIR = 6,
185 PLAYER_STATE_DEAD = 7,
186 PLAYER_STATE_KNEEL = 8
189 enum PlayerSpeedType
191 RUN = 1,
192 RUNBACK = 2,
193 SWIM = 3,
194 SWIMBACK = 4,
195 WALK = 5,
198 enum PlayerState
200 PLAYER_STOPPED = 0,
201 /* Note.. 1 and 2 is reserved in Units.h for UF_TARGET_DIED and UF_ATTACKING */
202 PLAYER_ATTACKING = (1L << 1), // player is attacking someone
203 PLAYER_ATTACK_BY = (1L << 2), // player is attack by someone
204 PLAYER_IN_COMBAT = (PLAYER_ATTACKING | PLAYER_ATTACK_BY), // player is in combat mode
205 PLAYER_IN_FLIGHT = (1L << 3) // player is i n flight mode
208 enum CLIENT_CONTAINER_SLOT //add by vendy
210 CLIENT_SLOT_BACK = 0xFF,
211 CLIENT_SLOT_01 = 0x13,
212 CLIENT_SLOT_02 = 0x14,
213 CLIENT_SLOT_03 = 0x15,
214 CLIENT_SLOT_04 = 0x16,
217 enum TYPE_OF_KILL
219 HONORABLE_KILL = 1,
220 DISHONORABLE_KILL = 2,
223 #define IS_BACK_SLOT(s) (s == 0xFF)
225 class Quest;
226 class Spell;
227 class Item;
228 class WorldSession;
230 #define EQUIPMENT_SLOT_START 0
231 #define EQUIPMENT_SLOT_HEAD 0
232 #define EQUIPMENT_SLOT_NECK 1
233 #define EQUIPMENT_SLOT_SHOULDERS 2
234 #define EQUIPMENT_SLOT_BODY 3
235 #define EQUIPMENT_SLOT_CHEST 4
236 #define EQUIPMENT_SLOT_WAIST 5
237 #define EQUIPMENT_SLOT_LEGS 6
238 #define EQUIPMENT_SLOT_FEET 7
239 #define EQUIPMENT_SLOT_WRISTS 8
240 #define EQUIPMENT_SLOT_HANDS 9
241 #define EQUIPMENT_SLOT_FINGER1 10
242 #define EQUIPMENT_SLOT_FINGER2 11
243 #define EQUIPMENT_SLOT_TRINKET1 12
244 #define EQUIPMENT_SLOT_TRINKET2 13
245 #define EQUIPMENT_SLOT_BACK 14
246 #define EQUIPMENT_SLOT_MAINHAND 15
247 #define EQUIPMENT_SLOT_OFFHAND 16
248 #define EQUIPMENT_SLOT_RANGED 17
249 #define EQUIPMENT_SLOT_TABARD 18
250 #define EQUIPMENT_SLOT_END 19
252 #define INVENTORY_SLOT_BAG_START 19
253 #define INVENTORY_SLOT_BAG_1 19
254 #define INVENTORY_SLOT_BAG_2 20
255 #define INVENTORY_SLOT_BAG_3 21
256 #define INVENTORY_SLOT_BAG_4 22
257 #define INVENTORY_SLOT_BAG_END 23
259 #define INVENTORY_SLOT_ITEM_START 23
260 #define INVENTORY_SLOT_ITEM_1 23
261 #define INVENTORY_SLOT_ITEM_2 24
262 #define INVENTORY_SLOT_ITEM_3 25
263 #define INVENTORY_SLOT_ITEM_4 26
264 #define INVENTORY_SLOT_ITEM_5 27
265 #define INVENTORY_SLOT_ITEM_6 28
266 #define INVENTORY_SLOT_ITEM_7 29
267 #define INVENTORY_SLOT_ITEM_8 30
268 #define INVENTORY_SLOT_ITEM_9 31
269 #define INVENTORY_SLOT_ITEM_10 32
270 #define INVENTORY_SLOT_ITEM_11 33
271 #define INVENTORY_SLOT_ITEM_12 34
272 #define INVENTORY_SLOT_ITEM_13 35
273 #define INVENTORY_SLOT_ITEM_14 36
274 #define INVENTORY_SLOT_ITEM_15 37
275 #define INVENTORY_SLOT_ITEM_16 38
276 #define INVENTORY_SLOT_ITEM_END 39
278 #define BANK_SLOT_ITEM_START 39
279 #define BANK_SLOT_ITEM_1 39
280 #define BANK_SLOT_ITEM_2 40
281 #define BANK_SLOT_ITEM_3 41
282 #define BANK_SLOT_ITEM_4 42
283 #define BANK_SLOT_ITEM_5 43
284 #define BANK_SLOT_ITEM_6 44
285 #define BANK_SLOT_ITEM_7 45
286 #define BANK_SLOT_ITEM_8 46
287 #define BANK_SLOT_ITEM_9 47
288 #define BANK_SLOT_ITEM_10 48
289 #define BANK_SLOT_ITEM_11 49
290 #define BANK_SLOT_ITEM_12 50
291 #define BANK_SLOT_ITEM_13 51
292 #define BANK_SLOT_ITEM_14 52
293 #define BANK_SLOT_ITEM_15 53
294 #define BANK_SLOT_ITEM_16 54
295 #define BANK_SLOT_ITEM_17 55
296 #define BANK_SLOT_ITEM_18 56
297 #define BANK_SLOT_ITEM_19 57
298 #define BANK_SLOT_ITEM_20 58
299 #define BANK_SLOT_ITEM_21 59
300 #define BANK_SLOT_ITEM_22 60
301 #define BANK_SLOT_ITEM_23 61
302 #define BANK_SLOT_ITEM_24 62
303 #define BANK_SLOT_ITEM_END 63
305 #define BANK_SLOT_BAG_START 63
306 #define BANK_SLOT_BAG_1 63
307 #define BANK_SLOT_BAG_2 64
308 #define BANK_SLOT_BAG_3 65
309 #define BANK_SLOT_BAG_4 66
310 #define BANK_SLOT_BAG_5 67
311 #define BANK_SLOT_BAG_6 68
312 #define BANK_SLOT_BAG_END 69
314 #define BUYBACK_SLOT_END 12
316 class Player : public Unit {
317 friend class WorldSession;
318 public:
319 Player (WorldSession *session);
320 ~Player ( );
322 void AddToWorld();
323 void RemoveFromWorld();
325 void smsg_NewWorld(uint32 mapid, float x, float y, float z, float orientation);
327 bool Create ( uint32 guidlow, WorldPacket &data );
329 void Update( uint32 time );
331 void BuildEnumData( WorldPacket * p_data );
333 uint8 ToggleAFK() { m_afk = !m_afk; return m_afk; };
334 const char* GetName() { return m_name.c_str(); };
335 PlayerCreateInfo* GetPlayerInfo(){return info;}
337 void Die();
338 void GiveXP(uint32 xp, const uint64 &guid);
339 void BuildLvlUpStats(uint32 *HP,uint32 *MP,uint32 *STR,uint32 *STA,uint32 *AGI,uint32 *INT,uint32 *SPI);
341 void setDismountCost(uint32 money) { m_dismountCost = money; };
343 uint32 getQuestStatus(uint32 quest_id);
344 bool getQuestRewardStatus(uint32 quest_id);
345 uint32 addNewQuest(Quest *quest, uint32 status = QUEST_STATUS_AVAILABLE);
346 void loadExistingQuest(struct quest_status qs);
347 void setQuestStatus(uint32 quest_id, uint32 new_status, bool new_rewarded);
348 bool checkQuestStatus(Quest *pQuest);
349 quest_status getQuestStatusStruct(uint32 quest_id);
351 bool isQuestComplete(Quest *pQuest, Creature *pCreature);
352 bool isQuestTakable(Quest *pQuest);
354 void finishExplorationQuest( Quest *pQuest );
355 void sendPreparedGossip( uint32 textid, QEmote em, std::string QTitle, uint64 guid);
357 uint16 getOpenQuestSlot();
358 uint16 getQuestSlot(uint32 quest_id);
359 uint16 getQuestSlotById(uint32 slot_id);
361 void RemovedItemFromBackpack(uint32 entry);
362 void AddedItemToBackpack(uint32 entry, uint32 count);
363 void KilledMonster(uint32 entry, uint64 guid);
364 void SetBindPoint(uint64 guid);
365 void CalcRage( uint32 damage,bool attacker );
366 void RegenerateAll();
367 void Regenerate(uint16 field_cur, uint16 field_max);
368 void setRegenTimer(uint32 time) {m_regenTimer = time;}
371 inline uint32 GetMoney() { return GetUInt32Value (PLAYER_FIELD_COINAGE); }
372 inline void ModifyMoney (int32 d) { SetMoney (GetMoney() + d); }
373 void SetMoney (uint32 value) { SetUInt32Value (PLAYER_FIELD_COINAGE, value); }
375 uint32 GetTutorialInt(uint32 intId )
377 ASSERT( (intId < 8) );
378 return m_Tutorials[intId];
381 void SetTutorialInt(uint32 intId, uint32 value)
383 ASSERT( (intId < 8) );
384 m_Tutorials[intId] = value;
387 bool AddItemToBackpack (uint32 itemId, uint32 count = 1) { return false; }
388 bool RemoveItemFromBackpack (uint32 itemId, uint32 count = 1) { return false; }
389 bool HasItemInBackpack (uint32 itemId, uint32 count = 1) { return false; }
390 bool HasSpaceForItemInBackpack (uint32 itemId, uint32 count = 1) { return false; }
392 void AddMail(Mail *m);
394 std::map<uint32, struct quest_status> getQuestStatusMap() { return mQuestStatus; };
396 const uint64& GetSelection( ) const { return m_curSelection; }
397 const uint64& GetTarget( ) const { return m_curTarget; }
399 void SetSelection(const uint64 &guid) { m_curSelection = guid; }
400 void SetTarget(const uint64 &guid) { m_curTarget = guid; }
402 uint32 GetMailSize() { return m_mail.size();};
403 Mail* GetMail(uint32 id);
404 void RemoveMail(uint32 id);
405 std::list<Mail*>::iterator GetmailBegin() { return m_mail.begin();};
406 std::list<Mail*>::iterator GetmailEnd() { return m_mail.end();};
407 void AddBid(bidentry *be);
408 bidentry* GetBid(uint32 id);
409 std::list<bidentry*>::iterator GetBidBegin() { return m_bids.begin();};
410 std::list<bidentry*>::iterator GetBidEnd() { return m_bids.end();};
412 bool HasSpell(uint32 spell);
413 void smsg_InitialSpells();
414 void addSpell(uint16 spell_id, uint16 slot_id=0xffff);
415 bool removeSpell(uint16 spell_id);
416 void DealWithSpellDamage(DynamicObject &);
417 inline std::list<Playerspell*> getSpellList() { return m_spells; };
418 void setResurrect(uint64 guid,float X, float Y, float Z, uint32 health, uint32 mana) {
419 m_resurrectGUID = guid;
420 m_resurrectX = X;
421 m_resurrectY = Y;
422 m_resurrectZ = Z;
423 m_resurrectHealth = health;
424 m_resurrectMana = mana;
427 int getCinematic()
429 return m_cinematic;
431 void setCinematic(int cine)
433 m_cinematic = cine;
436 uint32 getFaction() {
437 return m_faction;
440 void SetPvP(bool b) {
441 pvpOn = b;
444 bool GetPvP() {
445 return pvpOn;
448 void setGold(int gold) {
449 uint32 moneyuser = GetUInt32Value(PLAYER_FIELD_COINAGE);
450 SetUInt32Value( PLAYER_FIELD_COINAGE, moneyuser + gold );
453 void setFaction(uint8 race, uint32 faction);
455 inline std::list<struct actions> getActionList() { return m_actions; };
456 void addAction(uint8 button, uint16 action, uint8 type, uint8 misc);
457 void removeAction(uint8 button);
458 void smsg_InitialActions();
460 void SetInvited() { m_isInvited = true; }
461 void SetInGroup() { m_isInGroup = true; }
462 void SetLeader(const uint64 &guid) { m_groupLeader = guid; }
464 int IsInGroup() { return m_isInGroup; }
465 int IsInvited() { return m_isInvited; }
466 const uint64& GetGroupLeader() const { return m_groupLeader; }
468 void UnSetInvited() { m_isInvited = false; }
469 void UnSetInGroup() { m_isInGroup = false; }
471 void SetGuildIdInvited(uint32 GuildId) { m_GuildIdInvited = GuildId; }
472 void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); }
473 void SetRank(uint32 rankId){ SetUInt32Value(PLAYER_GUILDRANK, rankId); }
475 uint32 GetGuildId() { return GetUInt32Value(PLAYER_GUILDID); }
476 uint32 GetRank(){ return GetUInt32Value(PLAYER_GUILDRANK); }
477 int GetGuildIdInvited() { return m_GuildIdInvited; }
479 void SetDuelVs(Player *plyr) { m_pDuel = plyr; }
480 void SetInDuel(const bool &val) { m_isInDuel = val; }
481 void SetDuelSender(Player *plyr) { m_pDuelSender = plyr; }
483 uint32 GetCurrentBuybackSlot() { return m_currentBuybackSlot; }
484 void SetCurrentBuybackSlot(uint32 Slot) { Slot=Slot%12; m_currentBuybackSlot=Slot; }
486 bool IsGroupMember(Player *plyr);
488 void UpdateSlot(uint8 slot) {
489 Item* Up = RemoveItemFromSlot(0, slot);
490 if (Up != NULL) AddItem(0, slot, Up, false, false, false);
492 void UpdateSlot(uint8 bagindex,uint8 slot) {
493 Item* Up = RemoveItemFromSlot(bagindex, slot);
494 if (Up != NULL) AddItem(bagindex,slot, Up, false, false, false);
497 Item* GetItemBySlot(uint8 bagIndex,uint8 slot) const;
498 Item* GetItemBySlot(uint8 slot) const {
499 ASSERT(slot < BANK_SLOT_BAG_END);
500 return m_items[slot];
502 Item* GetItemByGUID(uint64 guid) const {
503 for (int i=0; i < BANK_SLOT_BAG_END; i++) {
504 if (m_items[i])
505 if (m_items[i]->GetGUID() == guid) return m_items[i];
507 return NULL;
509 uint32 GetSlotByItemID(uint32 ID);
510 uint32 GetSlotByItemGUID(uint64 guid);
511 bool GetSlotByItemGUID(uint64 guid,uint8 &bagIndex,uint8 &slot);
513 Bag* GetBagBySlot(uint8 slot) const {
514 return (Bag *)m_items[slot];
516 void UpdateSkill(uint32 skill_id);
517 uint32 GetSkillByProto(ItemPrototype *proto);
518 uint32 GetSpellByProto(ItemPrototype *proto);
519 void GetSlotByItem(uint32 type, uint8 slots[4]);
520 uint8 FindEquipSlot(uint32 type);
521 uint8 FindFreeItemSlot(uint32 type);
523 uint8 CanEquipItemInSlot(uint8 bag, uint8 slot, Item* item, Item* swapitem);
524 bool CanUseItem (ItemPrototype* proto);
525 bool SplitItem(uint8 srcBag, uint8 srcSlot, uint8 dstBag, uint8 dstSlot, uint8 count);
526 bool SwapItem(uint8 dstBag,uint8 dstSlot,uint8 srcBag,uint8 srcSlot);
528 bool CreateObjectItem (uint8 bagIndex, uint8 slot, uint32 itemId, uint8 count);
529 int GetItemCount(uint32 itemId);
530 uint32 AddNewItem(uint8 bagIndex, uint8 slot, uint32 itemId, uint32 count, bool addmaxpossible, bool dontadd);
531 uint8 AddItem(uint8 bagIndex, uint8 slot, Item *item, bool allowstack, bool dontadd, bool dontsave);
532 uint8 AddItemToInventory(uint8 bagIndex, uint8 slot, Item *item, bool allowstack, bool dontadd, bool dontsave);
533 uint8 AddItemToBank(uint8 bagIndex, uint8 slot, Item *item, bool allowstack, bool dontadd, bool dontsave);
534 uint8 AddItemToBag(uint8 bagIndex, Item *item, bool allowstack, bool dontadd, bool dontsave);
536 Item* RemoveItemFromSlot(uint8 bagIndex, uint8 slot, bool client_remove=true);
537 int CountFreeBagSlot();
539 void AddItemToBuyBackSlot(uint32 slot,Item *item);
540 Item* GetItemFromBuyBackSlot(uint32 slot);
541 Item* RemoveItemFromBuyBackSlot(uint32 slot);
543 const uint64& GetLootGUID() const { return m_lootGuid; }
544 void SetLootGUID(const uint64 &guid) { m_lootGuid = guid; }
546 WorldSession* GetSession() const { return m_session; }
547 void SetSession(WorldSession *s) { m_session = s; }
549 void CreateYourself( );
550 void DestroyYourself( );
552 void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const;
553 void DestroyForPlayer( Player *target ) const;
554 void SendDelayResponse(const uint32);
556 void smsg_AttackStart(Unit* pVictim);
558 bool SetPosition(const float &x, const float &y, const float &z, const float &orientation);
559 void SendMessageToSet(WorldPacket *data, bool self);
560 void SetSheath (uint32 sheathed);
562 void SaveToDB();
563 void LoadFromDB(uint32 guid);
564 void DeleteFromDB();
565 void DeleteCorpse();
567 void SpawnCorpseBones();
568 void CreateCorpse();
569 void KillPlayer();
570 void ResurrectPlayer();
571 void BuildPlayerRepop();
572 void DeathDurabilityLoss(double percent);
573 void RepopAtGraveyard();
574 void DuelComplete();
576 void SetMovement(uint8 pType);
577 void SetPlayerSpeed(uint8 SpeedType, float value, bool forced=false);
579 void JoinedChannel(Channel *c);
580 void LeftChannel(Channel *c);
581 void CleanupChannels();
583 void BroadcastToFriends(std::string msg);
585 void UpdateDefense();
586 void UpdateSkillWeapon();
588 void SetSkill(uint32 id, uint16 currVal, uint16 maxVal);
589 uint16 GetSkillValue(uint32 skill);
591 void SetDontMove(bool dontMove);
592 bool GetDontMove() { return m_dontMove; }
594 void CheckExploreSystem(void);
596 uint32 GetTeam() {
597 return m_team;
599 uint32 GetLevel() {
600 return (GetUInt32Value(UNIT_FIELD_LEVEL));
603 bool SetStanding(uint32 FTemplate, int standing);
604 void LoadReputationFromDBC(void);
605 void UpdateReputation(void);
606 void UpdateMaxSkills();
607 void ModifySkillBonus(uint32 skillid,int32 val);
609 //Honor System
610 void UpdateHonor(void);
611 void CalculateHonor(Unit *pVictim);
612 int CalculateHonorRank(float honor);
613 int CalculateTotalKills(Player *pVictim);
614 float GetTotalHonor(void) { return m_total_honor_points; };
615 int GetHonorHighestRank(void) { return m_highest_rank; };
616 int GetHonorLastWeekRank(void) { return m_last_week_rank; };
617 //End of Honor System
619 void ApplyItemMods(Item *item,uint8 slot,bool apply) {
620 _ApplyItemMods(item, slot, apply);
622 void _ApplyItemMods(Item *item,uint8 slot,bool apply);
623 void _RemoveAllItemMods();
624 void _ApplyAllItemMods();
626 void CastItemSpell(Item *item,Unit* Target);
627 bool IsItemSpellToEquip(SpellEntry *spellInfo);
628 bool IsItemSpellToCombat(SpellEntry *spellInfo);
630 PlayerMenu* PlayerTalkClass;
631 ItemsSetEffect * ItemsSetEff[3];
632 void FlightComplete(void);
633 void SendLoot(uint64 guid,uint8 loot_type);
634 protected:
636 void _SetCreateBits(UpdateMask *updateMask, Player *target) const;
637 void _SetUpdateBits(UpdateMask *updateMask, Player *target) const;
638 void _SetVisibleBits(UpdateMask *updateMask, Player *target) const;
640 void _SaveMail();
641 void _SaveInventory();
642 void _SaveSpells();
643 void _SaveActions();
644 void _SaveTutorials();
645 void _SaveQuestStatus();
646 void _SaveAuras();
647 void _SaveBids();
648 void _SaveAuctions();
649 void _SaveReputation();
651 void _LoadMail();
652 void _LoadInventory();
653 void _LoadSpells();
654 void _LoadActions();
655 void _LoadTutorials();
656 void _LoadQuestStatus();
657 void _LoadAuras();
658 void _LoadBids();
659 void _LoadReputation();
660 void _LoadCorpse();
662 bool FactionIsInTheList(uint32 faction);
664 void HandleDrowing (uint32 UnderWaterTime);
665 void HandleLava();
667 void StartMirrorTimer(uint8 Type, uint32 MaxValue);
668 void ModifyMirrorTimer(uint8 Type, uint32 MaxValue, uint32 CurrentValue, uint32 Regen);
669 void StopMirrorTimer(uint8 Type);
670 void EnvironmentalDamage(uint64 Guid, uint8 Type, uint32 Amount);
674 uint64 m_lootGuid;
676 std::string m_name;
677 std::string m_rank_name;
679 PlayerCreateInfo *info;
681 uint32 m_race;
682 uint32 m_class;
683 uint32 m_faction;
684 uint32 m_team;
685 uint8 m_outfitId;
686 uint16 m_petInfoId;
687 uint16 m_petLevel;
688 uint16 m_petFamilyId;
689 uint32 m_dismountCost;
690 uint32 m_nextSave;
692 Item* m_items[BANK_SLOT_BAG_END];
693 Item* m_buybackitems[BUYBACK_SLOT_END];
695 uint8 m_afk;
696 uint64 m_curTarget;
697 uint64 m_curSelection;
699 typedef std::map<uint32, struct quest_status> StatusMap;
700 StatusMap mQuestStatus;
702 uint64 m_groupLeader;
703 bool m_isInGroup;
704 bool m_isInvited;
706 uint32 m_GuildIdInvited;
708 uint32 m_currentBuybackSlot; //0~11
710 bool inCombat;
712 std::list<struct Factions> factions;
713 std::list<bidentry*> m_bids;
714 std::list<Mail*> m_mail;
715 std::list<Playerspell*> m_spells;
716 std::list<struct actions> m_actions;
718 uint64 m_resurrectGUID;
719 float m_resurrectX, m_resurrectY, m_resurrectZ;
720 uint32 m_resurrectHealth, m_resurrectMana;
722 Corpse *m_pCorpse;
724 WorldSession *m_session;
726 std::list<Channel*> m_channels;
728 bool m_dontMove;
730 float m_total_honor_points;
731 int m_highest_rank;
732 int m_last_week_rank;
734 int m_cinematic;
736 Player *pTrader;
737 bool acceptTrade;
738 int tradeItems[7];
739 uint32 tradeGold;
741 bool pvpOn;
742 Player *m_pDuel;
743 bool m_isInDuel;
744 Player *m_pDuelSender;
746 time_t m_nextThinkTime;
747 uint32 m_timedQuest;
748 uint32 m_Tutorials[8];
749 uint32 m_regenTimer;
750 uint32 m_breathTimer;
751 uint8 m_isunderwater;
755 int irand(int min, int max);
756 uint32 urand(uint32 min, uint32 max);
757 void AddItemsSetItem(Player*player,uint32 setid);
758 void RemoveItemsSetItem(Player*player,uint32 setid);
759 #endif