TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Player.cpp File Reference
#include "Player.h"
#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "ArenaTeam.h"
#include "ArenaTeamMgr.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "BattlefieldWG.h"
#include "Battleground.h"
#include "BattlegroundMgr.h"
#include "BattlegroundScore.h"
#include "BattlePetMgr.h"
#include "CellImpl.h"
#include "ChannelMgr.h"
#include "CharacterDatabaseCleaner.h"
#include "CharacterPackets.h"
#include "Chat.h"
#include "ChatPackets.h"
#include "CombatLogPackets.h"
#include "CombatPackets.h"
#include "Common.h"
#include "ConditionMgr.h"
#include "CreatureAI.h"
#include "DB2Stores.h"
#include "DatabaseEnv.h"
#include "DisableMgr.h"
#include "DuelPackets.h"
#include "EquipmentSetPackets.h"
#include "Formulas.h"
#include "GameEventMgr.h"
#include "GameObjectAI.h"
#include "Garrison.h"
#include "GossipDef.h"
#include "GridNotifiers.h"
#include "GridNotifiersImpl.h"
#include "Group.h"
#include "GroupMgr.h"
#include "Guild.h"
#include "GuildMgr.h"
#include "InstancePackets.h"
#include "InstanceSaveMgr.h"
#include "InstanceScript.h"
#include "ItemPackets.h"
#include "KillRewarder.h"
#include "LFGMgr.h"
#include "Language.h"
#include "Log.h"
#include "LootPackets.h"
#include "MailPackets.h"
#include "MapManager.h"
#include "MiscPackets.h"
#include "MovementPackets.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "Opcodes.h"
#include "OutdoorPvP.h"
#include "OutdoorPvPMgr.h"
#include "Pet.h"
#include "PetPackets.h"
#include "QuestDef.h"
#include "QuestPackets.h"
#include "ReputationMgr.h"
#include "GitRevision.h"
#include "SkillDiscovery.h"
#include "SocialMgr.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
#include "SpellAuras.h"
#include "SpellHistory.h"
#include "SpellMgr.h"
#include "SpellPackets.h"
#include "TalentPackets.h"
#include "ToyPackets.h"
#include "Transport.h"
#include "UpdateData.h"
#include "UpdateFieldFlags.h"
#include "UpdateMask.h"
#include "Util.h"
#include "VehiclePackets.h"
#include "Weather.h"
#include "WeatherMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include "WorldStatePackets.h"
#include "DBCStructure.h"

Macros

#define ZONE_UPDATE_INTERVAL   (1*IN_MILLISECONDS)
 
#define DEATH_EXPIRE_STEP   (5*MINUTE)
 
#define MAX_DEATH_COUNT   3
 
#define RelocateToHomebind()   { mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); }
 
#define REMOVE_VIOLATING_FLAGS(check, maskToRemove)
 

Functions

void DeleteSpellFromAllPlayers (uint32 spellId)
 
int SkillGainChance (uint32 SkillValue, uint32 GrayLevel, uint32 GreenLevel, uint32 YellowLevel)
 
template<class T >
void UpdateVisibilityOf_helper (GuidUnorderedSet &s64, T *target, std::set< Unit * > &)
 
template<>
void UpdateVisibilityOf_helper (GuidUnorderedSet &s64, GameObject *target, std::set< Unit * > &)
 
template<>
void UpdateVisibilityOf_helper (GuidUnorderedSet &s64, Creature *target, std::set< Unit * > &v)
 
template<>
void UpdateVisibilityOf_helper (GuidUnorderedSet &s64, Player *target, std::set< Unit * > &v)
 
template<class T >
void BeforeVisibilityDestroy (T *, Player *)
 
template<>
void BeforeVisibilityDestroy< Creature > (Creature *t, Player *p)
 

Variables

static uint32 copseReclaimDelay [MAX_DEATH_COUNT] = { 30, 60, 120 }
 
uint32 const MasterySpells [MAX_CLASSES]
 
uint64 const MAX_MONEY_AMOUNT = 9999999999ULL
 
static RuneType runeSlotTypes [MAX_RUNES]
 

Macro Definition Documentation

#define DEATH_EXPIRE_STEP   (5*MINUTE)
#define MAX_DEATH_COUNT   3
#define RelocateToHomebind ( )    { mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); }
#define REMOVE_VIOLATING_FLAGS (   check,
  maskToRemove 
)
Value:
if (check) \
mi->RemoveMovementFlag((maskToRemove));
T check(T value)
Definition: format.h:305
#define ZONE_UPDATE_INTERVAL   (1*IN_MILLISECONDS)

Function Documentation

template<class T >
void BeforeVisibilityDestroy ( T *  ,
Player *   
)
inline
21953 { }
template<>
void BeforeVisibilityDestroy< Creature > ( Creature t,
Player *  p 
)
inline
21957 {
21958  if (p->GetPetGUID() == t->GetGUID() && t->IsPet())
21959  t->ToPet()->Remove(PET_SAVE_NOT_IN_SLOT, true);
21960 }
Pet * ToPet()
Definition: Unit.h:2200
bool IsPet() const
Definition: Unit.h:1403
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: PetDefines.h:38
void Remove(PetSaveMode mode, bool returnreagent=false)
Definition: Pet.cpp:672
void DeleteSpellFromAllPlayers ( uint32  spellId)
2821 {
2823  for (uint8 i = 0; i < 2; i++)
2824  {
2826 
2827  stmt->setUInt32(0, spellId);
2828 
2829  CharacterDatabase.Execute(stmt);
2830  }
2831 }
CharacterDatabaseStatements
Definition: CharacterDatabase.h:24
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
Definition: CharacterDatabase.h:340
Definition: PreparedStatement.h:74
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
Definition: CharacterDatabase.h:341
uint8_t uint8
Definition: Define.h:152
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21

+ Here is the call graph for this function:

int SkillGainChance ( uint32  SkillValue,
uint32  GrayLevel,
uint32  GreenLevel,
uint32  YellowLevel 
)
inline
5169 {
5170  if (SkillValue >= GrayLevel)
5171  return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_GREY)*10;
5172  if (SkillValue >= GreenLevel)
5173  return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_GREEN)*10;
5174  if (SkillValue >= YellowLevel)
5175  return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_YELLOW)*10;
5176  return sWorld->getIntConfig(CONFIG_SKILL_CHANCE_ORANGE)*10;
5177 }
Definition: World.h:271
#define sWorld
Definition: World.h:887
Definition: World.h:270
Definition: World.h:269
Definition: World.h:272
template<class T >
void UpdateVisibilityOf_helper ( GuidUnorderedSet s64,
T *  target,
std::set< Unit * > &   
)
inline
21923 {
21924  s64.insert(target->GetGUID());
21925 }
template<>
void UpdateVisibilityOf_helper ( GuidUnorderedSet s64,
GameObject target,
std::set< Unit * > &   
)
inline
21929 {
21930  // @HACK: This is to prevent objects like deeprun tram from disappearing when player moves far from its spawn point while riding it
21931  // But exclude stoppable elevators from this hack - they would be teleporting from one end to another
21932  // if affected transports move so far horizontally that it causes them to run out of visibility range then you are out of luck
21933  // fix visibility instead of adding hacks here
21934  if (!target->IsDynTransport())
21935  s64.insert(target->GetGUID());
21936 }
ObjectGuid const & GetGUID() const
Definition: Object.h:105
bool IsDynTransport() const
Definition: GameObject.cpp:990

+ Here is the call graph for this function:

template<>
void UpdateVisibilityOf_helper ( GuidUnorderedSet s64,
Creature target,
std::set< Unit * > &  v 
)
inline
21940 {
21941  s64.insert(target->GetGUID());
21942  v.insert(target);
21943 }
ObjectGuid const & GetGUID() const
Definition: Object.h:105

+ Here is the call graph for this function:

template<>
void UpdateVisibilityOf_helper ( GuidUnorderedSet s64,
Player *  target,
std::set< Unit * > &  v 
)
inline
21947 {
21948  s64.insert(target->GetGUID());
21949  v.insert(target);
21950 }

Variable Documentation

uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 }
static
uint32 const MasterySpells[MAX_CLASSES]
Initial value:
=
{
0,
87500,
87494,
87493,
87496,
87495,
87492,
87497,
86467,
87498,
0,
87491,
}
uint64 const MAX_MONEY_AMOUNT = 9999999999ULL
RuneType runeSlotTypes[MAX_RUNES]
static
Initial value:
=
{
RUNE_FROST
}
Definition: Player.h:462
Definition: Player.h:463
Definition: Player.h:461