[Cosmetic] Apply codestyle "XXX * " and "XXX *" changed to "XXX* " (with some exceptions)

This commit is contained in:
Spp
2011-09-15 14:12:57 +02:00
parent 9006e4e8dc
commit af05915b9e
431 changed files with 3131 additions and 3131 deletions
+3 -3
View File
@@ -66,14 +66,14 @@ void Corpse::RemoveFromWorld()
Object::RemoveFromWorld();
}
bool Corpse::Create(uint32 guidlow, Map *map)
bool Corpse::Create(uint32 guidlow, Map* map)
{
SetMap(map);
Object::_Create(guidlow, 0, HIGHGUID_CORPSE);
return true;
}
bool Corpse::Create(uint32 guidlow, Player *owner)
bool Corpse::Create(uint32 guidlow, Player* owner)
{
ASSERT(owner);
@@ -162,7 +162,7 @@ void Corpse::DeleteFromDB(SQLTransaction& trans)
trans->Append(stmt);
}
bool Corpse::LoadFromDB(uint32 guid, Field *fields)
bool Corpse::LoadFromDB(uint32 guid, Field* fields)
{
uint32 ownerGuid = fields[17].GetUInt32();
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
+3 -3
View File
@@ -55,11 +55,11 @@ class Corpse : public WorldObject, public GridObject<Corpse>
void AddToWorld();
void RemoveFromWorld();
bool Create(uint32 guidlow, Map *map);
bool Create(uint32 guidlow, Player *owner);
bool Create(uint32 guidlow, Map* map);
bool Create(uint32 guidlow, Player* owner);
void SaveToDB();
bool LoadFromDB(uint32 guid, Field *fields);
bool LoadFromDB(uint32 guid, Field* fields);
void DeleteBonesFromWorld();
void DeleteFromDB(SQLTransaction& trans);
+39 -39
View File
@@ -253,9 +253,9 @@ void Creature::RemoveCorpse(bool setSpawnTime)
/**
* change the entry of creature until respawn
*/
bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data)
bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData* data)
{
CreatureTemplate const *normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
CreatureTemplate const* normalInfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!normalInfo)
{
sLog->outErrorDb("Creature::InitEntry creature entry %u does not exist.", Entry);
@@ -263,7 +263,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
}
// get difficulty 1 mode entry
CreatureTemplate const *cinfo = normalInfo;
CreatureTemplate const* cinfo = normalInfo;
for (uint8 diff = uint8(GetMap()->GetSpawnMode()); diff > 0;)
{
// we already have valid Map pointer for current creature!
@@ -301,7 +301,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
}
uint32 displayID = sObjectMgr->ChooseDisplayId(0, GetCreatureInfo(), data);
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (!minfo) // Cancel load if no model defined
{
sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry);
@@ -343,7 +343,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data
return true;
}
bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data)
bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
{
if (!InitEntry(Entry, team, data))
return false;
@@ -691,7 +691,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
return false;
}
UnitAI *oldAI = i_AI;
UnitAI* oldAI = i_AI;
Motion_Initialize();
@@ -720,13 +720,13 @@ void Creature::Motion_Initialize()
i_motionMaster.Initialize();
}
bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData *data)
bool Creature::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data)
{
ASSERT(map);
SetMap(map);
SetPhaseMask(phaseMask, false);
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(Entry);
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog->outErrorDb("Creature::Create(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
@@ -766,7 +766,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry,
LoadCreaturesAddon();
uint32 displayID = GetNativeDisplayId();
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (minfo && !isTotem()) // Cancel load if no model defined or if totem
{
SetDisplayId(displayID);
@@ -953,21 +953,21 @@ void Creature::AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint3
SendMonsterMove(x, y, z, time);
}
Player *Creature::GetLootRecipient() const
Player* Creature::GetLootRecipient() const
{
if (!m_lootRecipient)
return NULL;
return ObjectAccessor::FindPlayer(m_lootRecipient);
}
Group *Creature::GetLootRecipientGroup() const
Group* Creature::GetLootRecipientGroup() const
{
if (!m_lootRecipientGroup)
return NULL;
return sGroupMgr->GetGroupByGUID(m_lootRecipientGroup);
}
void Creature::SetLootRecipient(Unit *unit)
void Creature::SetLootRecipient(Unit* unit)
{
// set the player whose group should receive the right
// to loot the creature after it dies
@@ -1012,7 +1012,7 @@ void Creature::SaveToDB()
{
// this should only be used when the creature has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
CreatureData const *data = sObjectMgr->GetCreatureData(m_DBTableGuid);
CreatureData const* data = sObjectMgr->GetCreatureData(m_DBTableGuid);
if (!data)
{
sLog->outError("Creature::SaveToDB failed, cannot get creature data!");
@@ -1035,7 +1035,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
uint32 dynamicflags = GetUInt32Value(UNIT_DYNAMIC_FLAGS);
// check if it's a custom model and if not, use 0 for displayId
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
if (cinfo)
{
if (displayId == cinfo->Modelid1 || displayId == cinfo->Modelid2 ||
@@ -1109,7 +1109,7 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabase.CommitTransaction(trans);
}
void Creature::SelectLevel(const CreatureTemplate *cinfo)
void Creature::SelectLevel(const CreatureTemplate* cinfo)
{
uint32 rank = isPet()? 0 : cinfo->rank;
@@ -1214,7 +1214,7 @@ float Creature::GetSpellDamageMod(int32 Rank)
}
}
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData *data)
bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data)
{
SetZoneScript();
if (m_zoneScript && data)
@@ -1224,7 +1224,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
return false;
}
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(Entry);
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(Entry);
if (!cinfo)
{
sLog->outErrorDb("Creature::CreateFromProto(): creature template (guidlow: %u, entry: %u) does not exist.", guidlow, Entry);
@@ -1247,7 +1247,7 @@ bool Creature::CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint3
return true;
}
bool Creature::LoadFromDB(uint32 guid, Map *map)
bool Creature::LoadFromDB(uint32 guid, Map* map)
{
CreatureData const* data = sObjectMgr->GetCreatureData(guid);
@@ -1332,7 +1332,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
return;
}
EquipmentInfo const *einfo = sObjectMgr->GetEquipmentInfo(equip_entry);
EquipmentInfo const* einfo = sObjectMgr->GetEquipmentInfo(equip_entry);
if (!einfo)
return;
@@ -1524,7 +1524,7 @@ void Creature::setDeathState(DeathState s)
SetFullHealth();
SetLootRecipient(NULL);
ResetPlayerDamageReq();
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
AddUnitMovementFlag(MOVEMENTFLAG_WALKING);
if (GetCreatureInfo()->InhabitType & INHABIT_AIR)
AddUnitMovementFlag(MOVEMENTFLAG_CAN_FLY | MOVEMENTFLAG_FLYING);
@@ -1586,13 +1586,13 @@ void Creature::Respawn(bool force)
if (m_originalEntry != GetEntry())
UpdateEntry(m_originalEntry);
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
SelectLevel(cinfo);
setDeathState(JUST_ALIVED);
uint32 displayID = GetNativeDisplayId();
CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
CreatureModelInfo const* minfo = sObjectMgr->GetCreatureModelRandomGender(&displayID);
if (minfo) // Cancel load if no model defined
{
SetDisplayId(displayID);
@@ -1621,7 +1621,7 @@ void Creature::ForcedDespawn(uint32 timeMSToDespawn)
{
if (timeMSToDespawn)
{
ForcedDespawnDelayEvent *pEvent = new ForcedDespawnDelayEvent(*this);
ForcedDespawnDelayEvent* pEvent = new ForcedDespawnDelayEvent(*this);
m_Events.AddEvent(pEvent, m_Events.CalculateTime(timeMSToDespawn));
return;
@@ -1663,7 +1663,7 @@ bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index)
return Unit::IsImmunedToSpellEffect(spellInfo, index);
}
SpellInfo const *Creature::reachWithSpellAttack(Unit *pVictim)
SpellInfo const* Creature::reachWithSpellAttack(Unit* pVictim)
{
if (!pVictim)
return NULL;
@@ -1672,7 +1672,7 @@ SpellInfo const *Creature::reachWithSpellAttack(Unit *pVictim)
{
if (!m_spells[i])
continue;
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
@@ -1710,7 +1710,7 @@ SpellInfo const *Creature::reachWithSpellAttack(Unit *pVictim)
return NULL;
}
SpellInfo const *Creature::reachWithSpellCure(Unit *pVictim)
SpellInfo const* Creature::reachWithSpellCure(Unit* pVictim)
{
if (!pVictim)
return NULL;
@@ -1719,7 +1719,7 @@ SpellInfo const *Creature::reachWithSpellCure(Unit *pVictim)
{
if (!m_spells[i])
continue;
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(m_spells[i]);
if (!spellInfo)
{
sLog->outError("WORLD: unknown spell id %i", m_spells[i]);
@@ -1864,7 +1864,7 @@ void Creature::CallAssistance()
if (!assistList.empty())
{
AssistDelayEvent *e = new AssistDelayEvent(getVictim()->GetGUID(), *this);
AssistDelayEvent* e = new AssistDelayEvent(getVictim()->GetGUID(), *this);
while (!assistList.empty())
{
// Pushing guids because in delay can happen some creature gets despawned => invalid pointer
@@ -1960,7 +1960,7 @@ bool Creature::_IsTargetAcceptable(const Unit* target) const
return false;
}
const Unit *myVictim = getAttackerForHelper();
const Unit* myVictim = getAttackerForHelper();
const Unit* targetVictim = target->getAttackerForHelper();
// if I'm already fighting target, or I'm hostile towards the target, the target is acceptable
@@ -1984,7 +1984,7 @@ void Creature::SaveRespawnTime()
}
// this should not be called by petAI or
bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
bool Creature::canCreatureAttack(Unit const* pVictim, bool force) const
{
if (!pVictim->IsInMap(this))
return false;
@@ -2004,7 +2004,7 @@ bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
//Use AttackDistance in distance check if threat radius is lower. This prevents creature bounce in and out of combat every update tick.
float dist = std::max(GetAttackDistance(pVictim), sWorld->getFloatConfig(CONFIG_THREAT_RADIUS)) + m_CombatDistance;
if (Unit *unit = GetCharmerOrOwner())
if (Unit* unit = GetCharmerOrOwner())
return pVictim->IsWithinDist(unit, dist);
else
return pVictim->IsInDist(&m_homePosition, dist);
@@ -2025,7 +2025,7 @@ CreatureAddon const* Creature::GetCreatureAddon() const
//creature_addon table
bool Creature::LoadCreaturesAddon(bool reload)
{
CreatureAddon const *cainfo = GetCreatureAddon();
CreatureAddon const* cainfo = GetCreatureAddon();
if (!cainfo)
return false;
@@ -2072,7 +2072,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
{
for (std::vector<uint32>::const_iterator itr = cainfo->auras.begin(); itr != cainfo->auras.end(); ++itr)
{
SpellInfo const *AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
SpellInfo const* AdditionalSpellInfo = sSpellMgr->GetSpellInfo(*itr);
if (!AdditionalSpellInfo)
{
sLog->outErrorDb("Creature (GUID: %u Entry: %u) has wrong spell %u defined in `auras` field.", GetGUIDLow(), GetEntry(), *itr);
@@ -2155,12 +2155,12 @@ void Creature::_AddCreatureCategoryCooldown(uint32 category, time_t apply_time)
void Creature::AddCreatureSpellCooldown(uint32 spellid)
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spellid);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
if (!spellInfo)
return;
uint32 cooldown = spellInfo->GetRecoveryTime();
if (Player *modOwner = GetSpellModOwner())
if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod(spellid, SPELLMOD_COOLDOWN, cooldown);
if (cooldown)
@@ -2172,7 +2172,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
bool Creature::HasCategoryCooldown(uint32 spell_id) const
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
if (!spellInfo)
return false;
@@ -2240,7 +2240,7 @@ void Creature::AllLootRemovedFromCorpse()
return;
float decayRate;
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
decayRate = sWorld->getRate(RATE_CORPSE_DECAY_LOOTED);
uint32 diff = uint32((m_corpseRemoveTime - now) * decayRate);
@@ -2371,7 +2371,7 @@ const char* Creature::GetNameForLocaleIdx(LocaleConstant loc_idx) const
if (loc_idx != DEFAULT_LOCALE)
{
uint8 uloc_idx = uint8(loc_idx);
CreatureLocale const *cl = sObjectMgr->GetCreatureLocale(GetEntry());
CreatureLocale const* cl = sObjectMgr->GetCreatureLocale(GetEntry());
if (cl)
{
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
@@ -2401,6 +2401,6 @@ void Creature::FarTeleportTo(Map* map, float X, float Y, float Z, float O)
bool Creature::IsDungeonBoss() const
{
CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
CreatureTemplate const* cinfo = sObjectMgr->GetCreatureTemplate(GetEntry());
return cinfo && (cinfo->flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS);
}
+14 -14
View File
@@ -419,9 +419,9 @@ class Creature : public Unit, public GridObject<Creature>
void DisappearAndDie();
bool Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData *data = NULL);
bool Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData* data = NULL);
bool LoadCreaturesAddon(bool reload = false);
void SelectLevel(const CreatureTemplate *cinfo);
void SelectLevel(const CreatureTemplate* cinfo);
void LoadEquipment(uint32 equip_entry, bool force=false);
uint32 GetDBTableGUIDLow() const { return m_DBTableGuid; }
@@ -457,7 +457,7 @@ class Creature : public Unit, public GridObject<Creature>
bool isCanTrainingOf(Player* player, bool msg) const;
bool isCanInteractWithBattleMaster(Player* player, bool msg) const;
bool isCanTrainingAndResetTalentsOf(Player* pPlayer) const;
bool canCreatureAttack(Unit const *pVictim, bool force = true) const;
bool canCreatureAttack(Unit const* pVictim, bool force = true) const;
bool IsImmunedToSpell(SpellInfo const* spellInfo);
// redefine Unit::IsImmunedToSpell
bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const;
@@ -489,7 +489,7 @@ class Creature : public Unit, public GridObject<Creature>
void Motion_Initialize();
void AI_SendMoveToPacket(float x, float y, float z, uint32 time, uint32 MovementFlags, uint8 type);
CreatureAI * AI() const { return (CreatureAI*)i_AI; }
CreatureAI* AI() const { return (CreatureAI*)i_AI; }
uint32 GetShieldBlockValue() const //dunno mob block value
{
@@ -526,8 +526,8 @@ class Creature : public Unit, public GridObject<Creature>
TrainerSpellData const* GetTrainerSpells() const;
CreatureTemplate const *GetCreatureInfo() const { return m_creatureInfo; }
CreatureData const *GetCreatureData() const { return m_creatureData; }
CreatureTemplate const* GetCreatureInfo() const { return m_creatureInfo; }
CreatureData const* GetCreatureData() const { return m_creatureData; }
CreatureAddon const* GetCreatureAddon() const;
std::string GetAIName() const;
@@ -546,7 +546,7 @@ class Creature : public Unit, public GridObject<Creature>
void setDeathState(DeathState s); // override virtual Unit::setDeathState
bool FallGround();
bool LoadFromDB(uint32 guid, Map *map);
bool LoadFromDB(uint32 guid, Map* map);
void SaveToDB();
// overriden in Pet
virtual void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
@@ -570,8 +570,8 @@ class Creature : public Unit, public GridObject<Creature>
void RemoveLootMode(uint16 lootMode) { m_LootMode &= ~lootMode; }
void ResetLootMode() { m_LootMode = LOOT_MODE_DEFAULT; }
SpellInfo const *reachWithSpellAttack(Unit *pVictim);
SpellInfo const *reachWithSpellCure(Unit *pVictim);
SpellInfo const* reachWithSpellAttack(Unit* pVictim);
SpellInfo const* reachWithSpellCure(Unit* pVictim);
uint32 m_spells[CREATURE_MAX_SPELLS];
CreatureSpellCooldowns m_CreatureSpellCooldowns;
@@ -651,10 +651,10 @@ class Creature : public Unit, public GridObject<Creature>
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
void SearchFormation();
CreatureGroup *GetFormation() {return m_formation;}
void SetFormation(CreatureGroup *formation) {m_formation = formation;}
CreatureGroup* GetFormation() {return m_formation;}
void SetFormation(CreatureGroup* formation) {m_formation = formation;}
Unit *SelectVictim();
Unit* SelectVictim();
void SetDisableReputationGain(bool disable) { DisableReputationGain = disable; }
bool IsReputationGainDisabled() { return DisableReputationGain; }
@@ -679,7 +679,7 @@ class Creature : public Unit, public GridObject<Creature>
void FarTeleportTo(Map* map, float X, float Y, float Z, float O);
protected:
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData *data = NULL);
bool CreateFromProto(uint32 guidlow, uint32 Entry, uint32 vehId, uint32 team, const CreatureData* data = NULL);
bool InitEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData* data=NULL);
// vendor items
@@ -733,7 +733,7 @@ class Creature : public Unit, public GridObject<Creature>
uint32 m_path_id;
//Formation var
CreatureGroup *m_formation;
CreatureGroup* m_formation;
bool TriggerJustRespawned;
};
@@ -28,7 +28,7 @@ CreatureGroupInfoType CreatureGroupMap;
void CreatureGroupManager::AddCreatureToGroup(uint32 groupId, Creature* member)
{
Map *map = member->FindMap();
Map* map = member->FindMap();
if (!map)
return;
@@ -57,7 +57,7 @@ void CreatureGroupManager::RemoveCreatureFromGroup(CreatureGroup* group, Creatur
if (group->isEmpty())
{
Map *map = member->FindMap();
Map* map = member->FindMap();
if (!map)
return;
@@ -92,7 +92,7 @@ void CreatureGroupManager::LoadCreatureFormations()
{
do
{
Field *fields = guidResult->Fetch();
Field* fields = guidResult->Fetch();
uint32 guid = fields[0].GetUInt32();
guidSet.insert(guid);
@@ -101,8 +101,8 @@ void CreatureGroupManager::LoadCreatureFormations()
}
uint32 count = 0;
Field *fields;
FormationInfo *group_member;
Field* fields;
FormationInfo* group_member;
do
{
@@ -35,8 +35,8 @@ class CreatureGroupManager
{
friend class ACE_Singleton<CreatureGroupManager, ACE_Null_Mutex>;
public:
void AddCreatureToGroup(uint32 group_id, Creature *creature);
void RemoveCreatureFromGroup(CreatureGroup* group, Creature *creature);
void AddCreatureToGroup(uint32 group_id, Creature* creature);
void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature);
void LoadCreatureFormations();
};
@@ -49,7 +49,7 @@ extern CreatureGroupInfoType CreatureGroupMap;
class CreatureGroup
{
private:
Creature *m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
Creature* m_leader; //Important do not forget sometimes to work with pointers instead synonims :D:D
typedef std::map<Creature*, FormationInfo*> CreatureGroupMemberType;
CreatureGroupMemberType m_members;
@@ -109,7 +109,7 @@ void GossipMenu::ClearMenu()
_menuItemData.clear();
}
PlayerMenu::PlayerMenu(WorldSession *session) : _session(session)
PlayerMenu::PlayerMenu(WorldSession* session) : _session(session)
{
}
@@ -187,7 +187,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poiId) const
std::string iconText = poi->icon_name;
int32 locale = _session->GetSessionDbLocaleIndex();
if (locale >= 0)
if (PointOfInterestLocale const *localeData = sObjectMgr->GetPointOfInterestLocale(poiId))
if (PointOfInterestLocale const* localeData = sObjectMgr->GetPointOfInterestLocale(poiId))
ObjectMgr::GetLocaleString(localeData->IconName, locale, iconText);
WorldPacket data(SMSG_GOSSIP_POI, 4 + 4 + 4 + 4 + 4 + 10); // guess size
@@ -261,13 +261,13 @@ void PlayerMenu::SendQuestGiverQuestList(QEmote eEmote, const std::string& Title
uint32 questID = qmi.QuestId;
if (Quest const *pQuest = sObjectMgr->GetQuestTemplate(questID))
if (Quest const* pQuest = sObjectMgr->GetQuestTemplate(questID))
{
std::string title = pQuest->GetTitle();
int loc_idx = _session->GetSessionDbLocaleIndex();
if (loc_idx >= 0)
if (QuestLocale const *ql = sObjectMgr->GetQuestLocale(questID))
if (QuestLocale const* ql = sObjectMgr->GetQuestLocale(questID))
ObjectMgr::GetLocaleString(ql->Title, loc_idx, title);
data << uint32(questID);
@@ -294,7 +294,7 @@ void PlayerMenu::SendQuestGiverStatus(uint8 questStatus, uint64 npcGUID) const
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_STATUS NPC Guid=%u, status=%u", GUID_LOPART(npcGUID), questStatus);
}
void PlayerMenu::SendQuestGiverQuestDetails(Quest const *quest, uint64 npcGUID, bool activateAccept) const
void PlayerMenu::SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const
{
std::string questTitle = quest->GetTitle();
std::string questDetails = quest->GetDetails();
@@ -624,7 +624,7 @@ void PlayerMenu::SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, b
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u", GUID_LOPART(npcGUID), quest->GetQuestId());
}
void PlayerMenu::SendQuestGiverRequestItems(Quest const *quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const
void PlayerMenu::SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const
{
// We can always call to RequestItems, but this packet only goes out if there are actually
// items. Otherwise, we'll skip straight to the OfferReward
@@ -272,10 +272,10 @@ class PlayerMenu
void SendQuestGiverQuestList(QEmote eEmote, const std::string& Title, uint64 npcGUID);
void SendQuestQueryResponse(Quest const* quest) const;
void SendQuestGiverQuestDetails(Quest const *quest, uint64 npcGUID, bool activateAccept) const;
void SendQuestGiverQuestDetails(Quest const* quest, uint64 npcGUID, bool activateAccept) const;
void SendQuestGiverOfferReward(Quest const* quest, uint64 npcGUID, bool enableNext) const;
void SendQuestGiverRequestItems(Quest const *quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const;
void SendQuestGiverRequestItems(Quest const* quest, uint64 npcGUID, bool canComplete, bool closeOnCancel) const;
private:
GossipMenu _gossipMenu;
@@ -22,7 +22,7 @@
#include "ObjectMgr.h"
#include "TemporarySummon.h"
TempSummon::TempSummon(SummonPropertiesEntry const *properties, Unit *owner) :
TempSummon::TempSummon(SummonPropertiesEntry const* properties, Unit* owner) :
Creature(), m_Properties(properties), m_type(TEMPSUMMON_MANUAL_DESPAWN),
m_timer(0), m_lifetime(0)
{
@@ -174,7 +174,7 @@ void TempSummon::InitStats(uint32 duration)
if (m_type == TEMPSUMMON_MANUAL_DESPAWN)
m_type = (duration == 0) ? TEMPSUMMON_DEAD_DESPAWN : TEMPSUMMON_TIMED_DESPAWN;
Unit *owner = GetSummoner();
Unit* owner = GetSummoner();
if (owner && isTrigger() && m_spells[0])
{
@@ -193,7 +193,7 @@ void TempSummon::InitStats(uint32 duration)
{
if (owner->m_SummonSlot[slot] && owner->m_SummonSlot[slot] != GetGUID())
{
Creature *oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
Creature* oldSummon = GetMap()->GetCreature(owner->m_SummonSlot[slot]);
if (oldSummon && oldSummon->isSummon())
oldSummon->ToTempSummon()->UnSummon();
}
@@ -228,7 +228,7 @@ void TempSummon::UnSummon(uint32 msTime)
{
if (msTime)
{
ForcedUnsummonDelayEvent *pEvent = new ForcedUnsummonDelayEvent(*this);
ForcedUnsummonDelayEvent* pEvent = new ForcedUnsummonDelayEvent(*this);
m_Events.AddEvent(pEvent, m_Events.CalculateTime(msTime));
return;
@@ -272,7 +272,7 @@ void TempSummon::RemoveFromWorld()
Creature::RemoveFromWorld();
}
Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
Minion::Minion(SummonPropertiesEntry const* properties, Unit* owner) : TempSummon(properties, owner)
, m_owner(owner)
{
ASSERT(m_owner);
@@ -306,7 +306,7 @@ bool Minion::IsGuardianPet() const
return isPet() || (m_Properties && m_Properties->Category == SUMMON_CATEGORY_PET);
}
Guardian::Guardian(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
Guardian::Guardian(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner)
, m_bonusSpellDamage(0)
{
memset(m_statFromOwner, 0, sizeof(float)*MAX_STATS);
@@ -340,7 +340,7 @@ void Guardian::InitSummon()
m_owner->ToPlayer()->CharmSpellInitialize();
}
Puppet::Puppet(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
Puppet::Puppet(SummonPropertiesEntry const* properties, Unit* owner) : Minion(properties, owner)
{
ASSERT(owner->GetTypeId() == TYPEID_PLAYER);
m_owner = (Player*)owner;
@@ -24,7 +24,7 @@
class TempSummon : public Creature
{
public:
explicit TempSummon(SummonPropertiesEntry const *properties, Unit *owner);
explicit TempSummon(SummonPropertiesEntry const* properties, Unit* owner);
virtual ~TempSummon() {}
void Update(uint32 time);
virtual void InitStats(uint32 lifetime);
@@ -37,7 +37,7 @@ class TempSummon : public Creature
uint64 GetSummonerGUID() { return m_summonerGUID; }
TempSummonType const& GetSummonType() { return m_type; }
const SummonPropertiesEntry * const m_Properties;
const SummonPropertiesEntry* const m_Properties;
private:
TempSummonType m_type;
uint32 m_timer;
@@ -48,10 +48,10 @@ class TempSummon : public Creature
class Minion : public TempSummon
{
public:
Minion(SummonPropertiesEntry const *properties, Unit *owner);
Minion(SummonPropertiesEntry const* properties, Unit* owner);
void InitStats(uint32 duration);
void RemoveFromWorld();
Unit *GetOwner() { return m_owner; }
Unit* GetOwner() { return m_owner; }
float GetFollowAngle() const { return m_followAngle; }
void SetFollowAngle(float angle) { m_followAngle = angle; }
bool IsPetGhoul() const {return GetEntry() == 26125;} // Ghoul may be guardian or pet
@@ -64,7 +64,7 @@ class Minion : public TempSummon
class Guardian : public Minion
{
public:
Guardian(SummonPropertiesEntry const *properties, Unit *owner);
Guardian(SummonPropertiesEntry const* properties, Unit* owner);
void InitStats(uint32 duration);
bool InitStatsForLevel(uint8 level);
void InitSummon();
@@ -88,13 +88,13 @@ class Guardian : public Minion
class Puppet : public Minion
{
public:
Puppet(SummonPropertiesEntry const *properties, Unit *owner);
Puppet(SummonPropertiesEntry const* properties, Unit* owner);
void InitStats(uint32 duration);
void InitSummon();
void Update(uint32 time);
void RemoveFromWorld();
protected:
Player *m_owner;
Player* m_owner;
};
class ForcedUnsummonDelayEvent : public BasicEvent
@@ -154,7 +154,7 @@ void GameObject::RemoveFromWorld()
}
}
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit)
bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit)
{
ASSERT(map);
SetMap(map);
@@ -465,7 +465,7 @@ void GameObject::Update(uint32 diff)
{
//Battleground gameobjects case
if (ok->ToPlayer()->InBattleground())
if (Battleground *bg = ok->ToPlayer()->GetBattleground())
if (Battleground* bg = ok->ToPlayer()->GetBattleground())
bg->HandleTriggerBuff(GetGUID());
}
}
@@ -629,7 +629,7 @@ void GameObject::Delete()
AddObjectToRemoveList();
}
void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner)
void GameObject::getFishLoot(Loot* fishloot, Player* loot_owner)
{
fishloot->clear();
@@ -646,7 +646,7 @@ void GameObject::SaveToDB()
{
// this should only be used when the gameobject has already been loaded
// preferably after adding to map, because mapid may not be valid otherwise
GameObjectData const *data = sObjectMgr->GetGOData(m_DBTableGuid);
GameObjectData const* data = sObjectMgr->GetGOData(m_DBTableGuid);
if (!data)
{
sLog->outError("GameObject::SaveToDB failed, cannot get gameobject data!");
@@ -658,7 +658,7 @@ void GameObject::SaveToDB()
void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
{
const GameObjectTemplate *goI = GetGOInfo();
const GameObjectTemplate* goI = GetGOInfo();
if (!goI)
return;
@@ -712,7 +712,7 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask)
WorldDatabase.CommitTransaction(trans);
}
bool GameObject::LoadFromDB(uint32 guid, Map *map)
bool GameObject::LoadFromDB(uint32 guid, Map* map)
{
GameObjectData const* data = sObjectMgr->GetGOData(guid);
@@ -878,7 +878,7 @@ void GameObject::Respawn()
}
}
bool GameObject::ActivateToQuest(Player *pTarget) const
bool GameObject::ActivateToQuest(Player* pTarget) const
{
if (pTarget->HasQuestForGO(GetEntry()))
return true;
@@ -896,7 +896,7 @@ bool GameObject::ActivateToQuest(Player *pTarget) const
//TODO: fix this hack
//look for battlegroundAV for some objects which are only activated after mine gots captured by own team
if (GetEntry() == BG_AV_OBJECTID_MINE_N || GetEntry() == BG_AV_OBJECTID_MINE_S)
if (Battleground *bg = pTarget->GetBattleground())
if (Battleground* bg = pTarget->GetBattleground())
if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam())))
return false;
return true;
@@ -997,14 +997,14 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f
void GameObject::SetGoArtKit(uint8 kit)
{
SetByteValue(GAMEOBJECT_BYTES_1, 2, kit);
GameObjectData *data = const_cast<GameObjectData*>(sObjectMgr->GetGOData(m_DBTableGuid));
GameObjectData* data = const_cast<GameObjectData*>(sObjectMgr->GetGOData(m_DBTableGuid));
if (data)
data->artKit = kit;
}
void GameObject::SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid)
void GameObject::SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid)
{
const GameObjectData *data = NULL;
const GameObjectData* data = NULL;
if (go)
{
go->SetGoArtKit(artkit);
@@ -1477,7 +1477,7 @@ void GameObject::Use(Unit* user)
if (player->CanUseBattlegroundObject())
{
// in battleground check
Battleground *bg = player->GetBattleground();
Battleground* bg = player->GetBattleground();
if (!bg)
return;
if (player->GetVehicle())
@@ -1685,7 +1685,7 @@ const char* GameObject::GetNameForLocaleIdx(LocaleConstant loc_idx) const
if (loc_idx != DEFAULT_LOCALE)
{
uint8 uloc_idx = uint8(loc_idx);
if (GameObjectLocale const *cl = sObjectMgr->GetGameObjectLocale(GetEntry()))
if (GameObjectLocale const* cl = sObjectMgr->GetGameObjectLocale(GetEntry()))
if (cl->Name.size() > uloc_idx && !cl->Name[uloc_idx].empty())
return cl->Name[uloc_idx].c_str();
}
@@ -623,7 +623,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void RemoveFromWorld();
void CleanupsBeforeDelete(bool finalCleanup = true);
bool Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
bool Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMask, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 animprogress, GOState go_state, uint32 artKit = 0);
void Update(uint32 p_time);
static GameObject* GetGameObject(WorldObject& object, uint64 guid);
GameObjectTemplate const* GetGOInfo() const { return m_goInfo; }
@@ -648,7 +648,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void SaveToDB();
void SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask);
bool LoadFromDB(uint32 guid, Map *map);
bool LoadFromDB(uint32 guid, Map* map);
void DeleteFromDB();
void SetOwnerGUID(uint64 owner)
@@ -698,7 +698,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
uint32 GetRespawnDelay() const { return m_respawnDelayTime; }
void Refresh();
void Delete();
void getFishLoot(Loot *loot, Player* loot_owner);
void getFishLoot(Loot* loot, Player* loot_owner);
GameobjectTypes GetGoType() const { return GameobjectTypes(GetByteValue(GAMEOBJECT_BYTES_1, 1)); }
void SetGoType(GameobjectTypes type) { SetByteValue(GAMEOBJECT_BYTES_1, 1, type); }
GOState GetGoState() const { return GOState(GetByteValue(GAMEOBJECT_BYTES_1, 0)); }
@@ -707,7 +707,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
void SetGoArtKit(uint8 artkit);
uint8 GetGoAnimProgress() const { return GetByteValue(GAMEOBJECT_BYTES_1, 3); }
void SetGoAnimProgress(uint8 animprogress) { SetByteValue(GAMEOBJECT_BYTES_1, 3, animprogress); }
static void SetGoArtKit(uint8 artkit, GameObject *go, uint32 lowguid = 0);
static void SetGoArtKit(uint8 artkit, GameObject* go, uint32 lowguid = 0);
void Use(Unit* user);
@@ -745,7 +745,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
bool hasQuest(uint32 quest_id) const;
bool hasInvolvedQuest(uint32 quest_id) const;
bool ActivateToQuest(Player *pTarget) const;
bool ActivateToQuest(Player* pTarget) const;
void UseDoorOrButton(uint32 time_to_restore = 0, bool alternative = false);
// 0 = use `gameobject`.`spawntimesecs`
void ResetDoorOrButton();
@@ -31,13 +31,13 @@ Bag::Bag(): Item()
m_valuesCount = CONTAINER_END;
memset(m_bagslot, 0, sizeof(Item *) * MAX_BAG_SIZE);
memset(m_bagslot, 0, sizeof(Item* ) * MAX_BAG_SIZE);
}
Bag::~Bag()
{
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
if (Item *item = m_bagslot[i])
if (Item* item = m_bagslot[i])
{
if (item->IsInWorld())
{
@@ -153,7 +153,7 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/)
SetUInt64Value(CONTAINER_FIELD_SLOT_1 + (slot * 2), 0);
}
void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
void Bag::StoreItem(uint8 slot, Item* pItem, bool /*update*/)
{
ASSERT(slot < MAX_BAG_SIZE);
@@ -168,7 +168,7 @@ void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
}
}
void Bag::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
void Bag::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
Item::BuildCreateUpdateBlockForPlayer(data, target);
@@ -189,7 +189,7 @@ bool Bag::IsEmpty() const
uint32 Bag::GetItemCount(uint32 item, Item* eItem) const
{
Item *pItem;
Item* pItem;
uint32 count = 0;
for (uint32 i=0; i < GetBagSize(); ++i)
{
@@ -215,9 +215,9 @@ uint32 Bag::GetItemCountWithLimitCategory(uint32 limitCategory, Item* skipItem)
{
uint32 count = 0;
for (uint32 i = 0; i < GetBagSize(); ++i)
if (Item *pItem = m_bagslot[i])
if (Item* pItem = m_bagslot[i])
if (pItem != skipItem)
if (ItemTemplate const *pProto = pItem->GetTemplate())
if (ItemTemplate const* pProto = pItem->GetTemplate())
if (pProto->ItemLimitCategory == limitCategory)
count += m_bagslot[i]->GetCount();
@@ -38,7 +38,7 @@ class Bag : public Item
bool Create(uint32 guidlow, uint32 itemid, Player const* owner);
void Clear();
void StoreItem(uint8 slot, Item *pItem, bool update);
void StoreItem(uint8 slot, Item* pItem, bool update);
void RemoveItem(uint8 slot, bool update);
Item* GetItemByPos(uint8 slot) const;
@@ -58,7 +58,7 @@ class Bag : public Item
// overwrite virtual Item::DeleteFromDB
void DeleteFromDB(SQLTransaction& trans);
void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const;
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
protected:
+18 -18
View File
@@ -110,11 +110,11 @@ void AddItemsSetItem(Player* player, Item* item)
}
}
void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
void RemoveItemsSetItem(Player*player, ItemTemplate const* proto)
{
uint32 setid = proto->ItemSet;
ItemSetEntry const *set = sItemSetStore.LookupEntry(setid);
ItemSetEntry const* set = sItemSetStore.LookupEntry(setid);
if (!set)
{
@@ -122,7 +122,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
return;
}
ItemSetEffect *eff = NULL;
ItemSetEffect* eff = NULL;
size_t setindex = 0;
for (; setindex < player->ItemSetEff.size(); setindex++)
{
@@ -168,7 +168,7 @@ void RemoveItemsSetItem(Player*player, ItemTemplate const *proto)
}
}
bool ItemCanGoIntoBag(ItemTemplate const *pProto, ItemTemplate const *pBagProto)
bool ItemCanGoIntoBag(ItemTemplate const* pProto, ItemTemplate const* pBagProto)
{
if (!pProto || !pBagProto)
return false;
@@ -264,7 +264,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner)
SetUInt64Value(ITEM_FIELD_OWNER, owner ? owner->GetGUID() : 0);
SetUInt64Value(ITEM_FIELD_CONTAINED, owner ? owner->GetGUID() : 0);
ItemTemplate const *itemProto = sObjectMgr->GetItemTemplate(itemid);
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemid);
if (!itemProto)
return false;
@@ -497,7 +497,7 @@ void Item::DeleteFromInventoryDB(SQLTransaction& trans)
DeleteFromInventoryDB(trans, GetGUIDLow());
}
ItemTemplate const *Item::GetTemplate() const
ItemTemplate const* Item::GetTemplate() const
{
return sObjectMgr->GetItemTemplate(GetEntry());
}
@@ -586,7 +586,7 @@ uint32 Item::GetSpell()
int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
{
ItemTemplate const *itemProto = sObjectMgr->GetItemTemplate(item_id);
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
if (!itemProto)
return 0;
@@ -606,7 +606,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
if (itemProto->RandomProperty)
{
uint32 randomPropId = GetItemEnchantMod(itemProto->RandomProperty);
ItemRandomPropertiesEntry const *random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
ItemRandomPropertiesEntry const* random_id = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId);
@@ -619,7 +619,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id)
else
{
uint32 randomPropId = GetItemEnchantMod(itemProto->RandomSuffix);
ItemRandomSuffixEntry const *random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
ItemRandomSuffixEntry const* random_id = sItemRandomSuffixStore.LookupEntry(randomPropId);
if (!random_id)
{
sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId);
@@ -637,7 +637,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
if (randomPropId > 0)
{
ItemRandomPropertiesEntry const *item_rand = sItemRandomPropertiesStore.LookupEntry(randomPropId);
ItemRandomPropertiesEntry const* item_rand = sItemRandomPropertiesStore.LookupEntry(randomPropId);
if (item_rand)
{
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != int32(item_rand->ID))
@@ -651,7 +651,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
}
else
{
ItemRandomSuffixEntry const *item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId);
ItemRandomSuffixEntry const* item_rand = sItemRandomSuffixStore.LookupEntry(-randomPropId);
if (item_rand)
{
if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != -int32(item_rand->ID) ||
@@ -676,7 +676,7 @@ void Item::UpdateItemSuffixFactor()
SetUInt32Value(ITEM_FIELD_PROPERTY_SEED, suffixFactor);
}
void Item::SetState(ItemUpdateState state, Player *forplayer)
void Item::SetState(ItemUpdateState state, Player* forplayer)
{
if (uState == ITEM_NEW && state == ITEM_REMOVED)
{
@@ -778,7 +778,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const
return true;
}
bool Item::HasEnchantRequiredSkill(const Player *pPlayer) const
bool Item::HasEnchantRequiredSkill(const Player* pPlayer) const
{
// Check all enchants for required skill
@@ -1036,7 +1036,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
if (count < 1)
return NULL; //don't create item at zero count
ItemTemplate const *pProto = sObjectMgr->GetItemTemplate(item);
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(item);
if (pProto)
{
if (count > pProto->GetMaxStackSize())
@@ -1044,7 +1044,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
Item *pItem = NewItemOrBag(pProto);
Item* pItem = NewItemOrBag(pProto);
if (pItem->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), item, player))
{
pItem->SetCount(count);
@@ -1116,7 +1116,7 @@ bool ItemRequiredTarget::IsFitToRequirements(Unit* pUnitTarget) const
void Item::BuildUpdate(UpdateDataMapType& data_map)
{
if (Player *owner = GetOwner())
if (Player* owner = GetOwner())
BuildFieldsUpdate(owner, data_map);
ClearUpdateMask(false);
}
@@ -1136,7 +1136,7 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
(*trans)->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow());
}
void Item::SetNotRefundable(Player *owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/)
{
if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE))
return;
@@ -1154,7 +1154,7 @@ void Item::SetNotRefundable(Player *owner, bool changestate /*=true*/, SQLTransa
owner->DeleteRefundReference(GetGUIDLow());
}
void Item::UpdatePlayedTime(Player *owner)
void Item::UpdatePlayedTime(Player* owner)
{
/* Here we update our played time
We simply add a number to the current played time,
+9 -9
View File
@@ -33,7 +33,7 @@ struct ItemSetEffect
{
uint32 setid;
uint32 item_count;
SpellInfo const *spells[8];
SpellInfo const* spells[8];
};
enum InventoryResult
@@ -221,7 +221,7 @@ struct ItemRequiredTarget
bool IsFitToRequirements(Unit* pUnitTarget) const;
};
bool ItemCanGoIntoBag(ItemTemplate const *proto, ItemTemplate const *pBagProto);
bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
class Item : public Object
{
@@ -264,7 +264,7 @@ class Item : public Object
void SetInTrade(bool b = true) { mb_in_trade = b; }
bool IsInTrade() const { return mb_in_trade; }
bool HasEnchantRequiredSkill(const Player *pPlayer) const;
bool HasEnchantRequiredSkill(const Player* pPlayer) const;
uint32 GetEnchantRequiredLevel() const;
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
@@ -280,11 +280,11 @@ class Item : public Object
InventoryResult CanBeMergedPartlyWith(ItemTemplate const* proto) const;
uint8 GetSlot() const {return m_slot;}
Bag *GetContainer() { return m_container; }
Bag* GetContainer() { return m_container; }
uint8 GetBagSlot() const;
void SetSlot(uint8 slot) { m_slot = slot; }
uint16 GetPos() const { return uint16(GetBagSlot()) << 8 | GetSlot(); }
void SetContainer(Bag *container) { m_container = container; }
void SetContainer(Bag* container) { m_container = container; }
bool IsInBag() const { return m_container != NULL; }
bool IsEquipped() const;
@@ -321,7 +321,7 @@ class Item : public Object
// Update States
ItemUpdateState GetState() const { return uState; }
void SetState(ItemUpdateState state, Player *forplayer = NULL);
void SetState(ItemUpdateState state, Player* forplayer = NULL);
void AddToUpdateQueueOf(Player* player);
void RemoveFromUpdateQueueOf(Player* player);
bool IsInUpdateQueue() const { return uQueuePos != -1; }
@@ -339,7 +339,7 @@ class Item : public Object
bool IsConjuredConsumable() const { return GetTemplate()->IsConjuredConsumable(); }
// Item Refund system
void SetNotRefundable(Player *owner, bool changestate = true, SQLTransaction* trans = NULL);
void SetNotRefundable(Player* owner, bool changestate = true, SQLTransaction* trans = NULL);
void SetRefundRecipient(uint32 pGuidLow) { m_refundRecipient = pGuidLow; }
void SetPaidMoney(uint32 money) { m_paidMoney = money; }
void SetPaidExtendedCost(uint32 iece) { m_paidExtendedCost = iece; }
@@ -347,7 +347,7 @@ class Item : public Object
uint32 GetPaidMoney() { return m_paidMoney; }
uint32 GetPaidExtendedCost() { return m_paidExtendedCost; }
void UpdatePlayedTime(Player *owner);
void UpdatePlayedTime(Player* owner);
uint32 GetPlayedTime();
bool IsRefundExpired();
@@ -361,7 +361,7 @@ class Item : public Object
private:
std::string m_text;
uint8 m_slot;
Bag *m_container;
Bag* m_container;
ItemUpdateState uState;
int16 uQueuePos;
bool mb_in_trade; // true if item is currently in trade-window
@@ -57,7 +57,7 @@ void LoadRandomEnchantmentsTable()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
uint32 ench = fields[1].GetUInt32();
@@ -120,14 +120,14 @@ uint32 GetItemEnchantMod(int32 entry)
uint32 GenerateEnchSuffixFactor(uint32 item_id)
{
ItemTemplate const *itemProto = sObjectMgr->GetItemTemplate(item_id);
ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(item_id);
if (!itemProto)
return 0;
if (!itemProto->RandomSuffix)
return 0;
RandomPropertiesPointsEntry const *randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel);
RandomPropertiesPointsEntry const* randomProperty = sRandomPropertiesPointsStore.LookupEntry(itemProto->ItemLevel);
if (!randomProperty)
return 0;
+33 -33
View File
@@ -183,7 +183,7 @@ void Object::RemoveFromWorld()
ClearUpdateMask(true);
}
void Object::BuildMovementUpdateBlock(UpdateData * data, uint32 flags) const
void Object::BuildMovementUpdateBlock(UpdateData* data, uint32 flags) const
{
ByteBuffer buf(500);
@@ -195,7 +195,7 @@ void Object::BuildMovementUpdateBlock(UpdateData * data, uint32 flags) const
data->AddUpdateBlock(buf);
}
void Object::BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const
void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
if (!target)
return;
@@ -270,7 +270,7 @@ void Object::SendUpdateToPlayer(Player* player)
player->GetSession()->SendPacket(&packet);
}
void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const
void Object::BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const
{
ByteBuffer buf(500);
@@ -286,12 +286,12 @@ void Object::BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) c
data->AddUpdateBlock(buf);
}
void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const
void Object::BuildOutOfRangeUpdateBlock(UpdateData* data) const
{
data->AddOutOfRangeGUID(GetGUID());
}
void Object::DestroyForPlayer(Player *target, bool anim) const
void Object::DestroyForPlayer(Player* target, bool anim) const
{
ASSERT(target);
@@ -414,14 +414,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
*data << (float)0;
*data << (float)0;
*data << (float)0;
*data << ((WorldObject *)this)->GetOrientation();
*data << ((WorldObject* )this)->GetOrientation();
}
else
{
*data << ((WorldObject *)this)->GetPositionX();
*data << ((WorldObject *)this)->GetPositionY();
*data << ((WorldObject *)this)->GetPositionZ();
*data << ((WorldObject *)this)->GetOrientation();
*data << ((WorldObject* )this)->GetPositionX();
*data << ((WorldObject* )this)->GetPositionY();
*data << ((WorldObject* )this)->GetPositionZ();
*data << ((WorldObject* )this)->GetOrientation();
}
}
}
@@ -491,7 +491,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
}
}
void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *updateMask, Player *target) const
void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask* updateMask, Player* target) const
{
if (!target)
return;
@@ -1251,7 +1251,7 @@ void WorldObject::setActive(bool on)
if (!IsInWorld())
return;
Map *map = FindMap();
Map* map = FindMap();
if (!map)
return;
@@ -1298,7 +1298,7 @@ void WorldObject::GetZoneAndAreaId(uint32& zoneid, uint32& areaid) const
InstanceScript* WorldObject::GetInstanceScript()
{
Map *map = GetMap();
Map* map = GetMap();
return map->IsDungeon() ? ((InstanceMap*)map)->GetInstanceScript() : NULL;
}
@@ -1354,7 +1354,7 @@ bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const
{
float x, y, z;
GetPosition(x, y, z);
VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager();
return vMapManager->isInLineOfSight(GetMapId(), x, y, z+2.0f, ox, oy, oz+2.0f);
}
@@ -1466,7 +1466,7 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset
retOffset.m_orientation = endPos.GetOrientation() - GetOrientation();
}
float Position::GetAngle(const Position *obj) const
float Position::GetAngle(const Position* obj) const
{
if (!obj) return 0;
return GetAngle(obj->GetPositionX(), obj->GetPositionY());
@@ -1502,7 +1502,7 @@ void Position::GetSinCos(const float x, const float y, float &vsin, float &vcos)
}
}
bool Position::HasInArc(float arc, const Position *obj) const
bool Position::HasInArc(float arc, const Position* obj) const
{
// always have self in arc
if (obj == this)
@@ -1524,7 +1524,7 @@ bool Position::HasInArc(float arc, const Position *obj) const
return ((angle >= lborder) && (angle <= rborder));
}
bool WorldObject::IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size) const
bool WorldObject::IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size) const
{
if (GetPositionX() > std::max(obj1->GetPositionX(), obj2->GetPositionX())
|| GetPositionX() < std::min(obj1->GetPositionX(), obj2->GetPositionX())
@@ -2002,7 +2002,7 @@ void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisp
player->GetSession()->SendPacket(&data);
}
void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 targetGuid) const
void WorldObject::BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 targetGuid) const
{
*data << (uint8)msgtype;
*data << (uint32)language;
@@ -2021,26 +2021,26 @@ void WorldObject::BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const*
*data << (uint8)0; // ChatTag
}
void Unit::BuildHeartBeatMsg(WorldPacket *data) const
void Unit::BuildHeartBeatMsg(WorldPacket* data) const
{
data->Initialize(MSG_MOVE_HEARTBEAT, 32);
data->append(GetPackGUID());
BuildMovementPacket(data);
}
void WorldObject::SendMessageToSet(WorldPacket *data, bool self)
void WorldObject::SendMessageToSet(WorldPacket* data, bool self)
{
SendMessageToSetInRange(data, GetVisibilityRange(), self);
}
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*self*/)
void WorldObject::SendMessageToSetInRange(WorldPacket* data, float dist, bool /*self*/)
{
Trinity::MessageDistDeliverer notifier(this, data, dist);
VisitNearbyWorldObject(dist, notifier);
}
void WorldObject::SendMessageToSet(WorldPacket *data, Player const* skipped_rcvr)
void WorldObject::SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr)
{
Trinity::MessageDistDeliverer notifier(this, data, GetVisibilityRange(), false, skipped_rcvr);
VisitNearbyWorldObject(GetVisibilityRange(), notifier);
@@ -2053,7 +2053,7 @@ void WorldObject::SendObjectDeSpawnAnim(uint64 guid)
SendMessageToSet(&data, true);
}
void WorldObject::SetMap(Map * map)
void WorldObject::SetMap(Map* map)
{
ASSERT(map);
ASSERT(!IsInWorld() || GetTypeId() == TYPEID_CORPSE);
@@ -2204,7 +2204,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
void WorldObject::SetZoneScript()
{
if (Map *map = FindMap())
if (Map* map = FindMap())
{
if (map->IsDungeon())
m_zoneScript = (ZoneScript*)((InstanceMap*)map)->GetInstanceScript();
@@ -2215,9 +2215,9 @@ void WorldObject::SetZoneScript()
TempSummon* WorldObject::SummonCreature(uint32 entry, const Position &pos, TempSummonType spwtype, uint32 duration, uint32 /*vehId*/) const
{
if (Map *map = FindMap())
if (Map* map = FindMap())
{
if (TempSummon *summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL))
if (TempSummon* summon = map->SummonCreature(entry, pos, NULL, duration, isType(TYPEMASK_UNIT) ? (Unit*)this : NULL))
{
summon->SetTempSummonType(spwtype);
return summon;
@@ -2267,7 +2267,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
return NULL;
}
Map *map = GetMap();
Map* map = GetMap();
uint32 pet_number = sObjectMgr->GeneratePetNumber();
if (!pet->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_PET), map, GetPhaseMask(), entry, pet_number))
{
@@ -2351,8 +2351,8 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
sLog->outErrorDb("Gameobject template %u not found in database!", entry);
return NULL;
}
Map *map = GetMap();
GameObject *go = new GameObject();
Map* map = GetMap();
GameObject* go = new GameObject();
if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY))
{
delete go;
@@ -2389,7 +2389,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
{
Creature *creature = NULL;
Creature* creature = NULL;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
Trinity::CreatureLastSearcher<Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(this, creature, checker);
VisitNearbyObject(range, searcher);
@@ -2398,7 +2398,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
{
GameObject *go = NULL;
GameObject* go = NULL;
Trinity::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> searcher(this, go, checker);
VisitNearbyGridObject(range, searcher);
@@ -2743,7 +2743,7 @@ void WorldObject::DestroyForNearbyPlayers()
VisitNearbyWorldObject(GetVisibilityRange(), searcher);
for (std::list<Player*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
{
Player *plr = (*iter);
Player* plr = (*iter);
if (plr == this)
continue;
@@ -2816,7 +2816,7 @@ struct WorldObjectChangeAccumulator
if (IS_PLAYER_GUID(guid))
{
//Caster may be NULL if DynObj is in removelist
if (Player *caster = ObjectAccessor::FindPlayer(guid))
if (Player* caster = ObjectAccessor::FindPlayer(guid))
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == source->GetGUID())
BuildPacket(caster);
}
+40 -40
View File
@@ -140,14 +140,14 @@ class Object
TypeID GetTypeId() const { return m_objectTypeId; }
bool isType(uint16 mask) const { return (mask & m_objectType); }
virtual void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const;
virtual void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void SendUpdateToPlayer(Player* player);
void BuildValuesUpdateBlockForPlayer(UpdateData *data, Player *target) const;
void BuildOutOfRangeUpdateBlock(UpdateData *data) const;
void BuildMovementUpdateBlock(UpdateData * data, uint32 flags = 0) const;
void BuildValuesUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void BuildOutOfRangeUpdateBlock(UpdateData* data) const;
void BuildMovementUpdateBlock(UpdateData* data, uint32 flags = 0) const;
virtual void DestroyForPlayer(Player *target, bool anim = false) const;
virtual void DestroyForPlayer(Player* target, bool anim = false) const;
int32 GetInt32Value(uint16 index) const
{
@@ -294,7 +294,7 @@ class Object
virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
virtual void BuildUpdate(UpdateDataMapType&) {}
void BuildFieldsUpdate(Player *, UpdateDataMapType &) const;
void BuildFieldsUpdate(Player* , UpdateDataMapType &) const;
// FG: some hacky helpers
void ForceValuesUpdateAtIndex(uint32);
@@ -320,11 +320,11 @@ class Object
std::string _ConcatFields(uint16 startIndex, uint16 size) const;
void _LoadIntoDataField(const char* data, uint32 startOffset, uint32 count);
virtual void _SetUpdateBits(UpdateMask *updateMask, Player *target) const;
virtual void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
virtual void _SetCreateBits(UpdateMask *updateMask, Player *target) const;
virtual void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
void _BuildMovementUpdate(ByteBuffer * data, uint16 flags) const;
void _BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask *updateMask, Player *target) const;
void _BuildValuesUpdate(uint8 updatetype, ByteBuffer *data, UpdateMask* updateMask, Player* target) const;
uint16 m_objectType;
@@ -382,7 +382,7 @@ struct Position
{ m_positionX = x; m_positionY = y; m_positionZ = z; m_orientation = orientation; }
void Relocate(const Position &pos)
{ m_positionX = pos.m_positionX; m_positionY = pos.m_positionY; m_positionZ = pos.m_positionZ; m_orientation = pos.m_orientation; }
void Relocate(const Position *pos)
void Relocate(const Position* pos)
{ m_positionX = pos->m_positionX; m_positionY = pos->m_positionY; m_positionZ = pos->m_positionZ; m_orientation = pos->m_orientation; }
void RelocateOffset(const Position &offset);
void SetOrientation(float orientation)
@@ -399,7 +399,7 @@ struct Position
{ x = m_positionX; y = m_positionY; z = m_positionZ; }
void GetPosition(float &x, float &y, float &z, float &o) const
{ x = m_positionX; y = m_positionY; z = m_positionZ; o = m_orientation; }
void GetPosition(Position *pos) const
void GetPosition(Position* pos) const
{
if (pos)
pos->Relocate(m_positionX, m_positionY, m_positionZ, m_orientation);
@@ -420,37 +420,37 @@ struct Position
{ float dx = m_positionX - x; float dy = m_positionY - y; return dx*dx + dy*dy; }
float GetExactDist2d(const float x, const float y) const
{ return sqrt(GetExactDist2dSq(x, y)); }
float GetExactDist2dSq(const Position *pos) const
float GetExactDist2dSq(const Position* pos) const
{ float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; return dx*dx + dy*dy; }
float GetExactDist2d(const Position *pos) const
float GetExactDist2d(const Position* pos) const
{ return sqrt(GetExactDist2dSq(pos)); }
float GetExactDistSq(float x, float y, float z) const
{ float dz = m_positionZ - z; return GetExactDist2dSq(x, y) + dz*dz; }
float GetExactDist(float x, float y, float z) const
{ return sqrt(GetExactDistSq(x, y, z)); }
float GetExactDistSq(const Position *pos) const
float GetExactDistSq(const Position* pos) const
{ float dx = m_positionX - pos->m_positionX; float dy = m_positionY - pos->m_positionY; float dz = m_positionZ - pos->m_positionZ; return dx*dx + dy*dy + dz*dz; }
float GetExactDist(const Position *pos) const
float GetExactDist(const Position* pos) const
{ return sqrt(GetExactDistSq(pos)); }
void GetPositionOffsetTo(const Position & endPos, Position & retOffset) const;
float GetAngle(const Position *pos) const;
float GetAngle(const Position* pos) const;
float GetAngle(float x, float y) const;
float GetRelativeAngle(const Position *pos) const
float GetRelativeAngle(const Position* pos) const
{ return GetAngle(pos) - m_orientation; }
float GetRelativeAngle(float x, float y) const { return GetAngle(x, y) - m_orientation; }
void GetSinCos(float x, float y, float &vsin, float &vcos) const;
bool IsInDist2d(float x, float y, float dist) const
{ return GetExactDist2dSq(x, y) < dist * dist; }
bool IsInDist2d(const Position *pos, float dist) const
bool IsInDist2d(const Position* pos, float dist) const
{ return GetExactDist2dSq(pos) < dist * dist; }
bool IsInDist(float x, float y, float z, float dist) const
{ return GetExactDistSq(x, y, z) < dist * dist; }
bool IsInDist(const Position *pos, float dist) const
bool IsInDist(const Position* pos, float dist) const
{ return GetExactDistSq(pos) < dist * dist; }
bool HasInArc(float arcangle, const Position *pos) const;
bool HasInArc(float arcangle, const Position* pos) const;
bool HasInLine(Unit const* target, float distance, float width) const;
std::string ToString() const;
};
@@ -640,7 +640,7 @@ class WorldObject : public Object, public WorldLocation
virtual const char* GetNameForLocaleIdx(LocaleConstant /*locale_idx*/) const { return GetName(); }
float GetDistance(const WorldObject *obj) const
float GetDistance(const WorldObject* obj) const
{
float d = GetExactDist(obj) - GetObjectSize() - obj->GetObjectSize();
return d > 0.0f ? d : 0.0f;
@@ -676,11 +676,11 @@ class WorldObject : public Object, public WorldLocation
}
bool IsWithinDist3d(float x, float y, float z, float dist) const
{ return IsInDist(x, y, z, dist + GetObjectSize()); }
bool IsWithinDist3d(const Position *pos, float dist) const
bool IsWithinDist3d(const Position* pos, float dist) const
{ return IsInDist(pos, dist + GetObjectSize()); }
bool IsWithinDist2d(float x, float y, float dist) const
{ return IsInDist2d(x, y, dist + GetObjectSize()); }
bool IsWithinDist2d(const Position *pos, float dist) const
bool IsWithinDist2d(const Position* pos, float dist) const
{ return IsInDist2d(pos, dist + GetObjectSize()); }
virtual bool _IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D) const;
// use only if you will sure about placing both object at same map
@@ -701,13 +701,13 @@ class WorldObject : public Object, public WorldLocation
bool isInFront(WorldObject const* target, float distance, float arc = M_PI) const;
bool isInBack(WorldObject const* target, float distance, float arc = M_PI) const;
bool IsInBetween(const WorldObject *obj1, const WorldObject *obj2, float size = 0) const;
bool IsInBetween(const WorldObject* obj1, const WorldObject* obj2, float size = 0) const;
virtual void CleanupsBeforeDelete(bool finalCleanup = true); // used in destructor or explicitly before mass creature delete to remove cross-references to already deleted units
virtual void SendMessageToSet(WorldPacket *data, bool self);
virtual void SendMessageToSetInRange(WorldPacket *data, float dist, bool self);
virtual void SendMessageToSet(WorldPacket *data, Player const* skipped_rcvr);
virtual void SendMessageToSet(WorldPacket* data, bool self);
virtual void SendMessageToSetInRange(WorldPacket* data, float dist, bool self);
virtual void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr);
virtual uint8 getLevelForTarget(WorldObject const* /*target*/) const { return 1; }
@@ -720,7 +720,7 @@ class WorldObject : public Object, public WorldLocation
void MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false);
void MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisper = false);
void MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid);
void BuildMonsterChat(WorldPacket *data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
void BuildMonsterChat(WorldPacket* data, uint8 msgtype, char const* text, uint32 language, char const* name, uint64 TargetGuid) const;
void PlayDistanceSound(uint32 sound_id, Player* target = NULL);
void PlayDirectSound(uint32 sound_id, Player* target = NULL);
@@ -760,17 +760,17 @@ class WorldObject : public Object, public WorldLocation
// Low Level Packets
void SendPlaySound(uint32 Sound, bool OnlySelf);
virtual void SetMap(Map * map);
virtual void SetMap(Map* map);
virtual void ResetMap();
Map * GetMap() const { ASSERT(m_currMap); return m_currMap; }
Map * FindMap() const { return m_currMap; }
Map* GetMap() const { ASSERT(m_currMap); return m_currMap; }
Map* FindMap() const { return m_currMap; }
//used to check all object's GetMap() calls when object is not in world!
//this function should be removed in nearest time...
Map const* GetBaseMap() const;
void SetZoneScript();
ZoneScript * GetZoneScript() const { return m_zoneScript; }
ZoneScript* GetZoneScript() const { return m_zoneScript; }
TempSummon* SummonCreature(uint32 id, const Position &pos, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0, uint32 vehId = 0) const;
TempSummon* SummonCreature(uint32 id, float x, float y, float z, float ang = 0, TempSummonType spwtype = TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime = 0)
@@ -823,7 +823,7 @@ class WorldObject : public Object, public WorldLocation
uint32 LastUsedScriptID;
// Transports
Transport *GetTransport() const { return m_transport; }
Transport* GetTransport() const { return m_transport; }
virtual float GetTransOffsetX() const { return 0; }
virtual float GetTransOffsetY() const { return 0; }
virtual float GetTransOffsetZ() const { return 0; }
@@ -831,16 +831,16 @@ class WorldObject : public Object, public WorldLocation
virtual uint32 GetTransTime() const { return 0; }
virtual int8 GetTransSeat() const { return -1; }
virtual uint64 GetTransGUID() const;
void SetTransport(Transport *t) { m_transport = t; }
void SetTransport(Transport* t) { m_transport = t; }
MovementInfo m_movementInfo;
protected:
std::string m_name;
bool m_isActive;
ZoneScript *m_zoneScript;
ZoneScript* m_zoneScript;
// transports
Transport *m_transport;
Transport* m_transport;
//these functions are used mostly for Relocate() and Corpse/Player specific stuff...
//use them ONLY in LoadFromDB()/Create() funcs and nowhere else!
@@ -849,7 +849,7 @@ class WorldObject : public Object, public WorldLocation
void SetLocationInstanceId(uint32 _instanceId) { m_InstanceId = _instanceId; }
private:
Map * m_currMap; //current object's Map location
Map* m_currMap; //current object's Map location
//uint32 m_mapId; // object at map with map_id
uint32 m_InstanceId; // in map copy with instance id
@@ -879,13 +879,13 @@ namespace Trinity
class ObjectDistanceOrderPred
{
public:
ObjectDistanceOrderPred(const WorldObject *pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {}
bool operator()(const WorldObject *pLeft, const WorldObject *pRight) const
ObjectDistanceOrderPred(const WorldObject* pRefObj, bool ascending = true) : m_refObj(pRefObj), m_ascending(ascending) {}
bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const
{
return m_ascending ? m_refObj->GetDistanceOrder(pLeft, pRight) : !m_refObj->GetDistanceOrder(pLeft, pRight);
}
private:
const WorldObject *m_refObj;
const WorldObject* m_refObj;
const bool m_ascending;
};
}
+25 -25
View File
@@ -33,7 +33,7 @@
#define PET_XP_FACTOR 0.05f
Pet::Pet(Player *owner, PetType type) : Guardian(NULL, owner),
Pet::Pet(Player* owner, PetType type) : Guardian(NULL, owner),
m_usedTalentCount(0), m_removed(false), m_owner(owner),
m_happinessTimer(7500), m_petType(type), m_duration(0),
m_auraRaidUpdateMask(0), m_loading(false), m_declinedname(NULL)
@@ -130,7 +130,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
return false;
}
Field *fields = result->Fetch();
Field* fields = result->Fetch();
// update for case of current pet "slot = 0"
petentry = fields[1].GetUInt32();
@@ -162,7 +162,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
return false;
}
Map *map = owner->GetMap();
Map* map = owner->GetMap();
uint32 guid = sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
if (!Create(guid, map, owner->GetPhaseMask(), petentry, pet_number))
return false;
@@ -182,7 +182,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
if (cinfo->type == CREATURE_TYPE_CRITTER)
{
map->Add(this->ToCreature());
@@ -318,7 +318,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
{
delete m_declinedname;
m_declinedname = new DeclinedName;
Field *fields2 = result->Fetch();
Field* fields2 = result->Fetch();
for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{
m_declinedname->name[i] = fields2[i].GetString();
@@ -706,7 +706,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
return false;
}
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
if (!cinfo)
{
sLog->outError("CreateBaseAtCreature() failed, creatureInfo is missing!");
@@ -736,7 +736,7 @@ bool Pet::CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner)
return true;
}
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map * map, uint32 phaseMask)
bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask)
{
sLog->outDebug(LOG_FILTER_PETS, "Pet::CreateBaseForTamed");
uint32 guid=sObjectMgr->GenerateLowGuid(HIGHGUID_PET);
@@ -765,7 +765,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map * map, uint32 pha
// TODO: Move stat mods code to pet passive auras
bool Guardian::InitStatsForLevel(uint8 petlevel)
{
CreatureTemplate const *cinfo = GetCreatureInfo();
CreatureTemplate const* cinfo = GetCreatureInfo();
ASSERT(cinfo);
SetLevel(petlevel);
@@ -1044,7 +1044,7 @@ void Pet::_LoadSpellCooldowns()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 spell_id = fields[0].GetUInt32();
time_t db_time = time_t(fields[1].GetUInt32());
@@ -1100,7 +1100,7 @@ void Pet::_LoadSpells()
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
addSpell(fields[0].GetUInt32(), ActiveStates(fields[1].GetUInt8()), PETSPELL_UNCHANGED);
}
@@ -1150,7 +1150,7 @@ void Pet::_LoadAuras(uint32 timediff)
{
int32 damage[3];
int32 baseDamage[3];
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
uint32 spellid = fields[1].GetUInt32();
uint8 effmask = fields[2].GetUInt8();
@@ -1217,7 +1217,7 @@ void Pet::_SaveAuras(SQLTransaction& trans)
if (!itr->second->CanBeSaved() || IsPetAura(itr->second))
continue;
Aura * aura = itr->second;
Aura* aura = itr->second;
int32 damage[MAX_SPELL_EFFECTS];
int32 baseDamage[MAX_SPELL_EFFECTS];
@@ -1250,7 +1250,7 @@ void Pet::_SaveAuras(SQLTransaction& trans)
bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpellState state /*= PETSPELL_NEW*/, PetSpellType type /*= PETSPELL_NORMAL*/)
{
SpellInfo const *spellInfo = sSpellMgr->GetSpellInfo(spell_id);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spell_id);
if (!spellInfo)
{
// do pet spell book cleanup
@@ -1306,7 +1306,7 @@ bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpe
// talent: unlearn all other talent ranks (high and low)
if (TalentSpellPos const* talentPos = GetTalentSpellPos(spell_id))
{
if (TalentEntry const *talentInfo = sTalentStore.LookupEntry(talentPos->talent_id))
if (TalentEntry const* talentInfo = sTalentStore.LookupEntry(talentPos->talent_id))
{
for (uint8 i = 0; i < MAX_TALENT_RANK; ++i)
{
@@ -1395,7 +1395,7 @@ void Pet::InitLevelupSpellsForLevel()
{
uint8 level = getLevel();
if (PetLevelupSpellSet const *levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
if (PetLevelupSpellSet const* levelupSpells = GetCreatureInfo()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureInfo()->family) : NULL)
{
// PetLevelupSpellSet ordered by levels, process in reversed order
for (PetLevelupSpellSet::const_reverse_iterator itr = levelupSpells->rbegin(); itr != levelupSpells->rend(); ++itr)
@@ -1412,7 +1412,7 @@ void Pet::InitLevelupSpellsForLevel()
int32 petSpellsId = GetCreatureInfo()->PetSpellDataId ? -(int32)GetCreatureInfo()->PetSpellDataId : GetEntry();
// default spells (can be not learned if pet level (as owner level decrease result for example) less first possible in normal game)
if (PetDefaultSpellsEntry const *defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
if (PetDefaultSpellsEntry const* defSpells = sSpellMgr->GetPetDefaultSpellsEntry(petSpellsId))
{
for (uint8 i = 0; i < MAX_CREATURE_SPELL_DATA_SLOT; ++i)
{
@@ -1525,7 +1525,7 @@ void Pet::InitPetCreateSpells()
bool Pet::resetTalents()
{
Unit *owner = GetOwner();
Unit* owner = GetOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return false;
@@ -1537,7 +1537,7 @@ bool Pet::resetTalents()
if (!ci)
return false;
// Check pet talent type
CreatureFamilyEntry const *pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
CreatureFamilyEntry const* pet_family = sCreatureFamilyStore.LookupEntry(ci->family);
if (!pet_family || pet_family->petTalentType < 0)
return false;
@@ -1554,12 +1554,12 @@ bool Pet::resetTalents()
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
{
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
TalentEntry const* talentInfo = sTalentStore.LookupEntry(i);
if (!talentInfo)
continue;
TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
TalentTabEntry const* talentTabInfo = sTalentTabStore.LookupEntry(talentInfo->TalentTab);
if (!talentTabInfo)
continue;
@@ -1635,7 +1635,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
do
{
Field *fields = resultPets->Fetch();
Field* fields = resultPets->Fetch();
uint32 id = fields[0].GetUInt32();
@@ -1653,7 +1653,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/)
bool need_execute = false;
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 spell = fields[0].GetUInt32();
@@ -1687,7 +1687,7 @@ void Pet::InitTalentForLevel()
SetFreeTalentPoints(talentPointsForLevel - m_usedTalentCount);
Unit *owner = GetOwner();
Unit* owner = GetOwner();
if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
return;
@@ -1699,7 +1699,7 @@ uint8 Pet::GetMaxTalentPointsForLevel(uint8 level)
{
uint8 points = (level >= 20) ? ((level - 16) / 4) : 0;
// Mod points from owner SPELL_AURA_MOD_PET_TALENT_POINTS
if (Unit *owner = GetOwner())
if (Unit* owner = GetOwner())
points+=owner->GetTotalAuraModifier(SPELL_AURA_MOD_PET_TALENT_POINTS);
return points;
}
@@ -1774,7 +1774,7 @@ bool Pet::IsPermanentPetFor(Player* owner)
}
}
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
bool Pet::Create(uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
{
ASSERT(map);
SetMap(map);
+5 -5
View File
@@ -121,7 +121,7 @@ class Player;
class Pet : public Guardian
{
public:
explicit Pet(Player *owner, PetType type = MAX_PET_TYPE);
explicit Pet(Player* owner, PetType type = MAX_PET_TYPE);
virtual ~Pet();
void AddToWorld();
@@ -134,10 +134,10 @@ class Pet : public Guardian
bool IsPermanentPetFor(Player* owner); // pet have tab in character windows and set UNIT_FIELD_PETNUMBER
bool Create (uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool Create (uint32 guidlow, Map* map, uint32 phaseMask, uint32 Entry, uint32 pet_number);
bool CreateBaseAtCreature(Creature* creature);
bool CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit* owner);
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map * map, uint32 phaseMask);
bool CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map, uint32 phaseMask);
bool LoadPetFromDB(Player* owner, uint32 petentry = 0, uint32 petnumber = 0, bool current = false);
bool isBeingLoaded() const { return m_loading;}
void SavePetToDB(PetSaveMode mode);
@@ -223,9 +223,9 @@ class Pet : public Guardian
bool m_removed; // prevent overwrite pet state in DB at next Pet::Update if pet already removed(saved)
Player *GetOwner() { return m_owner; }
Player* GetOwner() { return m_owner; }
protected:
Player *m_owner;
Player* m_owner;
uint32 m_happinessTimer;
PetType m_petType;
int32 m_duration; // time until unsummon (used mostly for summoned guardians and not used for controlled pets)
File diff suppressed because it is too large Load Diff
+99 -99
View File
@@ -114,14 +114,14 @@ struct PlayerTalent
// Spell modifier (used for modify other spells)
struct SpellModifier
{
SpellModifier(Aura * _ownerAura = NULL) : charges(0), ownerAura(_ownerAura) {}
SpellModifier(Aura* _ownerAura = NULL) : charges(0), ownerAura(_ownerAura) {}
SpellModOp op : 8;
SpellModType type : 8;
int16 charges : 16;
int32 value;
flag96 mask;
uint32 spellId;
Aura * const ownerAura;
Aura* const ownerAura;
};
typedef UNORDERED_MAP<uint32, PlayerTalent*> PlayerTalentMap;
@@ -276,8 +276,8 @@ struct DuelInfo
{
DuelInfo() : initiator(NULL), opponent(NULL), startTimer(0), startTime(0), outOfBound(0) {}
Player *initiator;
Player *opponent;
Player* initiator;
Player* opponent;
time_t startTimer;
time_t startTime;
time_t outOfBound;
@@ -824,7 +824,7 @@ enum PlayerDelayedOperations
struct InstancePlayerBind
{
InstanceSave *save;
InstanceSave* save;
bool perm;
/* permanent PlayerInstanceBinds are created in Raid/Heroic instances for players
that aren't already permanently bound when they are inside when a boss is killed
@@ -1063,7 +1063,7 @@ class Player : public Unit, public GridObject<Player>
friend void Item::AddToUpdateQueueOf(Player* player);
friend void Item::RemoveFromUpdateQueueOf(Player* player);
public:
explicit Player (WorldSession *session);
explicit Player (WorldSession* session);
~Player ();
void CleanupsBeforeDelete(bool finalCleanup = true);
@@ -1075,7 +1075,7 @@ class Player : public Unit, public GridObject<Player>
void RemoveFromWorld();
bool TeleportTo(uint32 mapid, float x, float y, float z, float orientation, uint32 options = 0);
void TeleportOutOfMap(Map *oldMap);
void TeleportOutOfMap(Map* oldMap);
bool TeleportTo(WorldLocation const &loc, uint32 options = 0)
{
@@ -1194,7 +1194,7 @@ class Player : public Unit, public GridObject<Player>
void Yell(const std::string& text, const uint32 language);
void TextEmote(const std::string& text);
void Whisper(const std::string& text, const uint32 language, uint64 receiver);
void BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const;
void BuildPlayerChat(WorldPacket* data, uint8 msgtype, const std::string& text, uint32 language) const;
/*********************************************************/
/*** STORAGE SYSTEM ***/
@@ -1219,7 +1219,7 @@ class Player : public Unit, public GridObject<Player>
Item* GetWeaponForAttack(WeaponAttackType attackType, bool useable = false) const;
Item* GetShield(bool useable = false) const;
static uint8 GetAttackBySlot(uint8 slot); // MAX_ATTACK if not weapon slot
std::vector<Item *> &GetItemUpdateQueue() { return m_itemUpdateQueue; }
std::vector<Item*> &GetItemUpdateQueue() { return m_itemUpdateQueue; }
static bool IsInventoryPos(uint16 pos) { return IsInventoryPos(pos >> 8, pos & 255); }
static bool IsInventoryPos(uint8 bag, uint8 slot);
static bool IsEquipmentPos(uint16 pos) { return IsEquipmentPos(pos >> 8, pos & 255); }
@@ -1252,7 +1252,7 @@ class Player : public Unit, public GridObject<Player>
}
InventoryResult CanStoreItems(Item** pItem, int count) const;
InventoryResult CanEquipNewItem(uint8 slot, uint16& dest, uint32 item, bool swap) const;
InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item *pItem, bool swap, bool not_loading = true) const;
InventoryResult CanEquipItem(uint8 slot, uint16& dest, Item* pItem, bool swap, bool not_loading = true) const;
InventoryResult CanEquipUniqueItem(Item* pItem, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const;
InventoryResult CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot = NULL_SLOT, uint32 limit_count = 1) const;
@@ -1265,9 +1265,9 @@ class Player : public Unit, public GridObject<Player>
InventoryResult CanUseAmmo(uint32 item) const;
Item* StoreNewItem(ItemPosCountVec const& pos, uint32 item, bool update, int32 randomPropertyId = 0, AllowedLooterSet* allowedLooters = NULL);
Item* StoreItem(ItemPosCountVec const& pos, Item *pItem, bool update);
Item* StoreItem(ItemPosCountVec const& pos, Item* pItem, bool update);
Item* EquipNewItem(uint16 pos, uint32 item, bool update);
Item* EquipItem(uint16 pos, Item *pItem, bool update);
Item* EquipItem(uint16 pos, Item* pItem, bool update);
void AutoUnequipOffhandIfNeed(bool force = false);
bool StoreNewItemInBestSlots(uint32 item_id, uint32 item_count);
void AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast = false);
@@ -1275,7 +1275,7 @@ class Player : public Unit, public GridObject<Player>
void StoreLootItem(uint8 lootSlot, Loot* loot);
InventoryResult _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const;
InventoryResult _CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item *pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const;
InventoryResult _CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 entry, uint32 count, Item* pItem = NULL, bool swap = false, uint32* no_space_count = NULL) const;
void AddRefundReference(uint32 it);
void DeleteRefundReference(uint32 it);
@@ -1284,15 +1284,15 @@ class Player : public Unit, public GridObject<Player>
void SetAmmo(uint32 item);
void RemoveAmmo();
float GetAmmoDPS() const { return m_ammoDPS; }
bool CheckAmmoCompatibility(const ItemTemplate *ammo_proto) const;
void QuickEquipItem(uint16 pos, Item *pItem);
void VisualizeItem(uint8 slot, Item *pItem);
void SetVisibleItemSlot(uint8 slot, Item *pItem);
Item* BankItem(ItemPosCountVec const& dest, Item *pItem, bool update)
bool CheckAmmoCompatibility(const ItemTemplate* ammo_proto) const;
void QuickEquipItem(uint16 pos, Item* pItem);
void VisualizeItem(uint8 slot, Item* pItem);
void SetVisibleItemSlot(uint8 slot, Item* pItem);
Item* BankItem(ItemPosCountVec const& dest, Item* pItem, bool update)
{
return StoreItem(dest, pItem, update);
}
Item* BankItem(uint16 pos, Item *pItem, bool update);
Item* BankItem(uint16 pos, Item* pItem, bool update);
void RemoveItem(uint8 bag, uint8 slot, bool update);
void MoveItemFromInventory(uint8 bag, uint8 slot, bool update);
// in trade, auction, guild bank, mail....
@@ -1306,7 +1306,7 @@ class Player : public Unit, public GridObject<Player>
void DestroyZoneLimitedItem(bool update, uint32 new_zone);
void SplitItem(uint16 src, uint16 dst, uint32 count);
void SwapItem(uint16 src, uint16 dst);
void AddItemToBuyBackSlot(Item *pItem);
void AddItemToBuyBackSlot(Item* pItem);
Item* GetItemFromBuyBackSlot(uint32 slot);
void RemoveItemFromBuyBackSlot(uint32 slot, bool del);
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
@@ -1327,9 +1327,9 @@ class Player : public Unit, public GridObject<Player>
Item* mainItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND);
return mainItem && mainItem->GetTemplate()->InventoryType == INVTYPE_2HWEAPON && !CanTitanGrip();
}
void SendNewItem(Item *item, uint32 count, bool received, bool created, bool broadcast = false);
void SendNewItem(Item* item, uint32 count, bool received, bool created, bool broadcast = false);
bool BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot);
bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const *pProto, Creature *pVendor, VendorItem const* crItem, bool bStore);
bool _StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 count, uint8 bag, uint8 slot, int32 price, ItemTemplate const* pProto, Creature* pVendor, VendorItem const* crItem, bool bStore);
float GetReputationPriceDiscount(Creature const* pCreature) const;
@@ -1341,17 +1341,17 @@ class Player : public Unit, public GridObject<Player>
void UpdateSoulboundTradeItems();
void RemoveTradeableItem(Item* item);
void UpdateItemDuration(uint32 time, bool realtimeonly = false);
void AddEnchantmentDurations(Item *item);
void RemoveEnchantmentDurations(Item *item);
void AddEnchantmentDurations(Item* item);
void RemoveEnchantmentDurations(Item* item);
void RemoveArenaEnchantments(EnchantmentSlot slot);
void AddEnchantmentDuration(Item *item, EnchantmentSlot slot, uint32 duration);
void ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool apply_dur = true, bool ignore_condition = false);
void ApplyEnchantment(Item *item, bool apply);
void AddEnchantmentDuration(Item* item, EnchantmentSlot slot, uint32 duration);
void ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool apply_dur = true, bool ignore_condition = false);
void ApplyEnchantment(Item* item, bool apply);
void UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16 new_value);
void SendEnchantmentDurations();
void BuildEnchantmentsInfoData(WorldPacket *data);
void AddItemDurations(Item *item);
void RemoveItemDurations(Item *item);
void BuildEnchantmentsInfoData(WorldPacket* data);
void AddItemDurations(Item* item);
void RemoveItemDurations(Item* item);
void SendItemDurations();
void LoadCorpse();
void LoadPet();
@@ -1381,18 +1381,18 @@ class Player : public Unit, public GridObject<Player>
void PrepareQuestMenu(uint64 guid);
void SendPreparedQuest(uint64 guid);
bool IsActiveQuest(uint32 quest_id) const;
Quest const *GetNextQuest(uint64 guid, Quest const *pQuest);
bool CanSeeStartQuest(Quest const *pQuest);
bool CanTakeQuest(Quest const *pQuest, bool msg);
bool CanAddQuest(Quest const *pQuest, bool msg);
Quest const* GetNextQuest(uint64 guid, Quest const* pQuest);
bool CanSeeStartQuest(Quest const* pQuest);
bool CanTakeQuest(Quest const* pQuest, bool msg);
bool CanAddQuest(Quest const* pQuest, bool msg);
bool CanCompleteQuest(uint32 quest_id);
bool CanCompleteRepeatableQuest(Quest const *pQuest);
bool CanRewardQuest(Quest const *pQuest, bool msg);
bool CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg);
void AddQuest(Quest const *pQuest, Object *questGiver);
bool CanCompleteRepeatableQuest(Quest const* pQuest);
bool CanRewardQuest(Quest const* pQuest, bool msg);
bool CanRewardQuest(Quest const* pQuest, uint32 reward, bool msg);
void AddQuest(Quest const* pQuest, Object* questGiver);
void CompleteQuest(uint32 quest_id);
void IncompleteQuest(uint32 quest_id);
void RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, bool announce = true);
void RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver, bool announce = true);
void FailQuest(uint32 quest_id);
bool SatisfyQuestSkillOrClass(Quest const* qInfo, bool msg);
bool SatisfyQuestLevel(Quest const* qInfo, bool msg);
@@ -1408,7 +1408,7 @@ class Player : public Unit, public GridObject<Player>
bool SatisfyQuestPrevChain(Quest const* qInfo, bool msg);
bool SatisfyQuestDay(Quest const* qInfo, bool msg);
bool SatisfyQuestWeek(Quest const* qInfo, bool msg);
bool GiveQuestSourceItem(Quest const *pQuest);
bool GiveQuestSourceItem(Quest const* pQuest);
bool TakeQuestSourceItem(uint32 questId, bool msg);
bool GetQuestRewardStatus(uint32 quest_id) const;
QuestStatus GetQuestStatus(uint32 quest_id) const;
@@ -1474,12 +1474,12 @@ class Player : public Unit, public GridObject<Player>
bool CanShareQuest(uint32 quest_id) const;
void SendQuestComplete(uint32 quest_id);
void SendQuestReward(Quest const *pQuest, uint32 XP, Object* questGiver);
void SendQuestReward(Quest const* pQuest, uint32 XP, Object* questGiver);
void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);
void SendQuestTimerFailed(uint32 quest_id);
void SendCanTakeQuestResponse(uint32 msg);
void SendQuestConfirmAccept(Quest const* pQuest, Player* pReceiver);
void SendPushToPartyResponse(Player *pPlayer, uint32 msg);
void SendPushToPartyResponse(Player* pPlayer, uint32 msg);
void SendQuestUpdateAddItem(Quest const* pQuest, uint32 item_idx, uint16 count);
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint16 old_count, uint16 add_count);
void SendQuestUpdateAddPlayer(Quest const* pQuest, uint16 old_count, uint16 add_count);
@@ -1567,8 +1567,8 @@ class Player : public Unit, public GridObject<Player>
}
uint64 GetSelection() const { return m_curSelection; }
Unit *GetSelectedUnit() const;
Player *GetSelectedPlayer() const;
Unit* GetSelectedUnit() const;
Player* GetSelectedPlayer() const;
void SetSelection(uint64 guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); }
uint8 GetComboPoints() { return m_comboPoints; }
@@ -1654,8 +1654,8 @@ class Player : public Unit, public GridObject<Player>
bool resetTalents(bool no_cost = false);
uint32 resetTalentsCost() const;
void InitTalentForLevel();
void BuildPlayerTalentsInfoData(WorldPacket *data);
void BuildPetTalentsInfoData(WorldPacket *data);
void BuildPlayerTalentsInfoData(WorldPacket* data);
void BuildPetTalentsInfoData(WorldPacket* data);
void SendTalentsInfoData(bool pet);
void LearnTalent(uint32 talentId, uint32 talentRank);
void LearnPetTalent(uint64 petGuid, uint32 talentId, uint32 talentRank);
@@ -1693,7 +1693,7 @@ class Player : public Unit, public GridObject<Player>
SpellCooldowns const& GetSpellCooldownMap() const { return m_spellCooldowns; }
void AddSpellMod(SpellModifier* mod, bool apply);
bool IsAffectedBySpellmod(SpellInfo const *spellInfo, SpellModifier *mod, Spell* spell = NULL);
bool IsAffectedBySpellmod(SpellInfo const* spellInfo, SpellModifier* mod, Spell* spell = NULL);
template <class T> T ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell = NULL);
void RemoveSpellMods(Spell* spell);
void RestoreSpellMods(Spell* spell, uint32 ownerAuraId = 0, Aura* aura = NULL);
@@ -1790,7 +1790,7 @@ class Player : public Unit, public GridObject<Player>
}
/** todo: -maybe move UpdateDuelFlag+DuelComplete to independent DuelHandler.. **/
DuelInfo *duel;
DuelInfo* duel;
void UpdateDuelFlag(time_t currTime);
void CheckDuelDistance(time_t currTime);
void DuelComplete(DuelCompleteType type);
@@ -1849,7 +1849,7 @@ class Player : public Unit, public GridObject<Player>
uint32 GetBaseDefenseSkillValue() const { return GetBaseSkillValue(SKILL_DEFENSE); }
uint32 GetBaseWeaponSkillValue(WeaponAttackType attType) const;
uint32 GetSpellByProto(ItemTemplate *proto);
uint32 GetSpellByProto(ItemTemplate* proto);
float GetHealthBonusFromStamina();
float GetManaBonusFromIntellect();
@@ -1911,8 +1911,8 @@ class Player : public Unit, public GridObject<Player>
WorldSession* GetSession() const { return m_session; }
void BuildCreateUpdateBlockForPlayer(UpdateData *data, Player *target) const;
void DestroyForPlayer(Player *target, bool anim = false) const;
void BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) const;
void DestroyForPlayer(Player* target, bool anim = false) const;
void SendLogXPGain(uint32 GivenXP, Unit* victim, uint32 BonusXP, bool recruitAFriend = false, float group_rate=1.0f);
// notifiers
@@ -1933,17 +1933,17 @@ class Player : public Unit, public GridObject<Player>
virtual bool SetPosition(float x, float y, float z, float orientation, bool teleport = false);
bool SetPosition(const Position &pos, bool teleport = false) { return SetPosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
void UpdateUnderwaterState(Map * m, float x, float y, float z);
void UpdateUnderwaterState(Map* m, float x, float y, float z);
void SendMessageToSet(WorldPacket *data, bool self) {SendMessageToSetInRange(data, GetVisibilityRange(), self); };// overwrite Object::SendMessageToSet
void SendMessageToSetInRange(WorldPacket *data, float fist, bool self);// overwrite Object::SendMessageToSetInRange
void SendMessageToSetInRange(WorldPacket *data, float dist, bool self, bool own_team_only);
void SendMessageToSet(WorldPacket *data, Player const* skipped_rcvr);
void SendMessageToSet(WorldPacket* data, bool self) {SendMessageToSetInRange(data, GetVisibilityRange(), self); };// overwrite Object::SendMessageToSet
void SendMessageToSetInRange(WorldPacket* data, float fist, bool self);// overwrite Object::SendMessageToSetInRange
void SendMessageToSetInRange(WorldPacket* data, float dist, bool self, bool own_team_only);
void SendMessageToSet(WorldPacket* data, Player const* skipped_rcvr);
void SendTeleportPacket(Position &oldPos);
void SendTeleportAckPacket();
Corpse *GetCorpse() const;
Corpse* GetCorpse() const;
void SpawnCorpseBones();
void CreateCorpse();
bool FallGround(uint8 FallMode = 0);
@@ -1973,15 +1973,15 @@ class Player : public Unit, public GridObject<Player>
bool CanJoinConstantChannelInZone(ChatChannelsEntry const* channel, AreaTableEntry const* zone);
void JoinedChannel(Channel *c);
void LeftChannel(Channel *c);
void JoinedChannel(Channel* c);
void LeftChannel(Channel* c);
void CleanupChannels();
void UpdateLocalChannels(uint32 newZone);
void LeaveLFGChannel();
void UpdateDefense();
void UpdateWeaponSkill (WeaponAttackType attType);
void UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool defence);
void UpdateCombatSkills(Unit* pVictim, WeaponAttackType attType, bool defence);
void SetSkill(uint16 id, uint16 step, uint16 currVal, uint16 maxVal);
uint16 GetMaxSkillValue(uint32 skill) const; // max + perm. bonus + temp bonus
@@ -2025,8 +2025,8 @@ class Player : public Unit, public GridObject<Player>
ReputationMgr& GetReputationMgr() { return m_reputationMgr; }
ReputationMgr const& GetReputationMgr() const { return m_reputationMgr; }
ReputationRank GetReputationRank(uint32 faction_id) const;
void RewardReputation(Unit *pVictim, float rate);
void RewardReputation(Quest const *pQuest);
void RewardReputation(Unit* pVictim, float rate);
void RewardReputation(Quest const* pQuest);
void UpdateSkillsForLevel();
void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
@@ -2036,7 +2036,7 @@ class Player : public Unit, public GridObject<Player>
/*** PVP SYSTEM ***/
/*********************************************************/
void UpdateHonorFields();
bool RewardHonor(Unit *pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false);
bool RewardHonor(Unit* pVictim, uint32 groupsize, int32 honor = -1, bool pvptoken = false);
uint32 GetHonorPoints() const { return GetUInt32Value(PLAYER_FIELD_HONOR_CURRENCY); }
uint32 GetArenaPoints() const { return GetUInt32Value(PLAYER_FIELD_ARENA_CURRENCY); }
void ModifyHonorPoints(int32 value, SQLTransaction* trans = NULL); //! If trans is specified, honor save query will be added to trans
@@ -2078,28 +2078,28 @@ class Player : public Unit, public GridObject<Player>
void ResetAllPowers();
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
void _ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackType, bool apply);
void _ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
void _ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
void _ApplyItemMods(Item *item, uint8 slot, bool apply);
void _ApplyItemMods(Item* item, uint8 slot, bool apply);
void _RemoveAllItemMods();
void _ApplyAllItemMods();
void _ApplyAllLevelScaleItemMods(bool apply);
void _ApplyItemBonuses(ItemTemplate const *proto, uint8 slot, bool apply, bool only_level_scale = false);
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingStatValuesEntry const *ssv, bool apply);
void _ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply, bool only_level_scale = false);
void _ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingStatValuesEntry const* ssv, bool apply);
void _ApplyAmmoBonuses();
bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot);
void ToggleMetaGemsActive(uint8 exceptslot, bool apply);
void CorrectMetaGemEnchants(uint8 slot, bool apply);
void InitDataForForm(bool reapplyMods = false);
void ApplyItemEquipSpell(Item *item, bool apply, bool form_change = false);
void ApplyItemEquipSpell(Item* item, bool apply, bool form_change = false);
void ApplyEquipSpell(SpellInfo const* spellInfo, Item* item, bool apply, bool form_change = false);
void UpdateEquipSpellsAtFormChange();
void CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx);
void CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex);
void CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item *item, ItemTemplate const* proto);
void CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex);
void CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32 procVictim, uint32 procEx, Item* item, ItemTemplate const* proto);
void SendEquipmentSetList();
void SetEquipmentSet(uint32 index, EquipmentSet eqset);
@@ -2107,13 +2107,13 @@ class Player : public Unit, public GridObject<Player>
void SendInitWorldStates(uint32 zone, uint32 area);
void SendUpdateWorldState(uint32 Field, uint32 Value);
void SendDirectMessage(WorldPacket *data);
void SendDirectMessage(WorldPacket* data);
void SendBGWeekendWorldStates();
void SendAurasForTarget(Unit* target);
PlayerMenu* PlayerTalkClass;
std::vector<ItemSetEffect *> ItemSetEff;
std::vector<ItemSetEffect*> ItemSetEff;
void SendLoot(uint64 guid, LootType loot_type);
void SendLootRelease(uint64 guid);
@@ -2233,7 +2233,7 @@ class Player : public Unit, public GridObject<Player>
/*** OUTDOOR PVP SYSTEM ***/
/*********************************************************/
OutdoorPvP * GetOutdoorPvP() const;
OutdoorPvP* GetOutdoorPvP() const;
// returns true if the player is in active state for outdoor pvp objective capturing, false otherwise
bool IsOutdoorPvPActive();
@@ -2265,8 +2265,8 @@ class Player : public Unit, public GridObject<Player>
/*** VARIOUS SYSTEMS ***/
/*********************************************************/
void UpdateFallInformationIfNeed(MovementInfo const& minfo, uint16 opcode);
Unit *m_mover;
WorldObject *m_seer;
Unit* m_mover;
WorldObject* m_seer;
void SetFallInformation(uint32 time, float z)
{
m_lastFallTime = time;
@@ -2284,8 +2284,8 @@ class Player : public Unit, public GridObject<Player>
m_mover = target;
m_mover->m_movedPlayer = this;
}
void SetSeer(WorldObject *target) { m_seer = target; }
void SetViewpoint(WorldObject *target, bool apply);
void SetSeer(WorldObject* target) { m_seer = target; }
void SetViewpoint(WorldObject* target, bool apply);
WorldObject* GetViewpoint() const;
void StopCastingCharm();
void StopCastingBindSight();
@@ -2368,10 +2368,10 @@ class Player : public Unit, public GridObject<Player>
BoundInstancesMap m_boundInstances[MAX_DIFFICULTY];
InstancePlayerBind* GetBoundInstance(uint32 mapid, Difficulty difficulty);
BoundInstancesMap& GetBoundInstances(Difficulty difficulty) { return m_boundInstances[difficulty]; }
InstanceSave * GetInstanceSave(uint32 mapid, bool raid);
InstanceSave* GetInstanceSave(uint32 mapid, bool raid);
void UnbindInstance(uint32 mapid, Difficulty difficulty, bool unload = false);
void UnbindInstance(BoundInstancesMap::iterator &itr, Difficulty difficulty, bool unload = false);
InstancePlayerBind* BindToInstance(InstanceSave *save, bool permanent, bool load = false);
InstancePlayerBind* BindToInstance(InstanceSave* save, bool permanent, bool load = false);
void BindToInstance();
void SetPendingBind(InstanceSave* save, uint32 bindTimer) { _pendingBind = save; _pendingBindTimer = bindTimer; }
bool HasPendingBind() const { return _pendingBind != NULL; }
@@ -2401,10 +2401,10 @@ class Player : public Unit, public GridObject<Player>
/*** GROUP SYSTEM ***/
/*********************************************************/
Group * GetGroupInvite() { return m_groupInvite; }
Group* GetGroupInvite() { return m_groupInvite; }
void SetGroupInvite(Group* group) { m_groupInvite = group; }
Group * GetGroup() { return m_group.getTarget(); }
const Group * GetGroup() const { return (const Group*)m_group.getTarget(); }
Group* GetGroup() { return m_group.getTarget(); }
const Group* GetGroup() const { return (const Group*)m_group.getTarget(); }
GroupReference& GetGroupRef() { return m_group; }
void SetGroup(Group* group, int8 subgroup = -1);
uint8 GetSubGroup() const { return m_group.getSubGroup(); }
@@ -2417,7 +2417,7 @@ class Player : public Unit, public GridObject<Player>
// Battleground Group System
void SetBattlegroundRaid(Group* group, int8 subgroup = -1);
void RemoveFromBattlegroundRaid();
Group * GetOriginalGroup() { return m_originalGroup.getTarget(); }
Group* GetOriginalGroup() { return m_originalGroup.getTarget(); }
GroupReference& GetOriginalGroupRef() { return m_originalGroup; }
uint8 GetOriginalSubGroup() const { return m_originalGroup.getSubGroup(); }
void SetOriginalGroup(Group* group, int8 subgroup = -1);
@@ -2428,7 +2428,7 @@ class Player : public Unit, public GridObject<Player>
MapReference &GetMapRef() { return m_mapRef; }
// Set map to player and add reference
void SetMap(Map * map);
void SetMap(Map* map);
void ResetMap();
bool isAllowedToLoot(const Creature* creature);
@@ -2525,7 +2525,7 @@ class Player : public Unit, public GridObject<Player>
void _LoadInventory(PreparedQueryResult result, uint32 timeDiff);
void _LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult resultDelivery);
void _LoadMail();
void _LoadMailedItems(Mail *mail);
void _LoadMailedItems(Mail* mail);
void _LoadQuestStatus(PreparedQueryResult result);
void _LoadQuestStatusRewarded(PreparedQueryResult result);
void _LoadDailyQuestStatus(PreparedQueryResult result);
@@ -2564,8 +2564,8 @@ class Player : public Unit, public GridObject<Player>
void _SaveStats(SQLTransaction& trans);
void _SaveInstanceTimeRestrictions(SQLTransaction& trans);
void _SetCreateBits(UpdateMask *updateMask, Player *target) const;
void _SetUpdateBits(UpdateMask *updateMask, Player *target) const;
void _SetCreateBits(UpdateMask* updateMask, Player* target) const;
void _SetUpdateBits(UpdateMask* updateMask, Player* target) const;
/*********************************************************/
/*** ENVIRONMENTAL SYSTEM ***/
@@ -2619,7 +2619,7 @@ class Player : public Unit, public GridObject<Player>
PlayerMails m_mail;
PlayerSpellMap m_spells;
PlayerTalentMap *m_talents[MAX_TALENT_SPECS];
PlayerTalentMap* m_talents[MAX_TALENT_SPECS];
uint32 m_lastPotionId; // last used health/mana potion in combat, that block next potion use
GlobalCooldownMgr m_GlobalCooldownMgr;
@@ -2655,7 +2655,7 @@ class Player : public Unit, public GridObject<Player>
float m_resurrectX, m_resurrectY, m_resurrectZ;
uint32 m_resurrectHealth, m_resurrectMana;
WorldSession *m_session;
WorldSession* m_session;
typedef std::list<Channel*> JoinedChannelsList;
JoinedChannelsList m_channels;
@@ -2709,7 +2709,7 @@ class Player : public Unit, public GridObject<Player>
// Groups
GroupReference m_group;
GroupReference m_originalGroup;
Group *m_groupInvite;
Group* m_groupInvite;
uint32 m_groupUpdateMask;
uint64 m_auraRaidUpdateMask;
bool m_bPassOnGroupLoot;
@@ -2736,10 +2736,10 @@ class Player : public Unit, public GridObject<Player>
private:
// internal common parts for CanStore/StoreItem functions
InventoryResult _CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool swap, Item *pSrcItem) const;
InventoryResult _CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool merge, bool non_specialized, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
InventoryResult _CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const *pProto, uint32& count, bool merge, Item *pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
Item* _StoreItem(uint16 pos, Item *pItem, uint32 count, bool clone, bool update);
InventoryResult _CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool swap, Item* pSrcItem) const;
InventoryResult _CanStoreItem_InBag(uint8 bag, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, bool non_specialized, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
InventoryResult _CanStoreItem_InInventorySlots(uint8 slot_begin, uint8 slot_end, ItemPosCountVec& dest, ItemTemplate const* pProto, uint32& count, bool merge, Item* pSrcItem, uint8 skip_bag, uint8 skip_slot) const;
Item* _StoreItem(uint16 pos, Item* pItem, uint32 count, bool clone, bool update);
Item* _LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, Field* fields);
std::set<uint32> m_refundableItems;
@@ -2806,8 +2806,8 @@ class Player : public Unit, public GridObject<Player>
uint32 _pendingBindTimer;
};
void AddItemsSetItem(Player*player, Item *item);
void RemoveItemsSetItem(Player*player, ItemTemplate const *proto);
void AddItemsSetItem(Player*player, Item* item);
void RemoveItemsSetItem(Player*player, ItemTemplate const* proto);
// "the bodies of template functions must be made available in a header file"
template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &basevalue, Spell* spell)
@@ -2824,7 +2824,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
for (SpellModList::iterator itr = m_spellMods[op].begin(); itr != m_spellMods[op].end(); ++itr)
{
SpellModifier *mod = *itr;
SpellModifier* mod = *itr;
// Charges can be set only for mods with auras
if (!mod->ownerAura)
@@ -182,7 +182,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
friendInfo.Level = 0;
friendInfo.Class = 0;
Player *pFriend = ObjectAccessor::FindPlayer(friendGUID);
Player* pFriend = ObjectAccessor::FindPlayer(friendGUID);
if (!pFriend)
return;
@@ -213,7 +213,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
}
}
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket *data)
void SocialMgr::MakeFriendStatusPacket(FriendsResult result, uint32 guid, WorldPacket* data)
{
data->Initialize(SMSG_FRIEND_STATUS, 5);
*data << uint8(result);
@@ -272,7 +272,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
PlayerSocialMap::const_iterator itr2 = itr->second.m_playerSocialMap.find(guid);
if (itr2 != itr->second.m_playerSocialMap.end() && (itr2->second.Flags & SOCIAL_FLAG_FRIEND))
{
Player *pFriend = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER));
Player* pFriend = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER));
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
+1 -1
View File
@@ -147,7 +147,7 @@ class SocialMgr
void GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo);
// Packet management
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket *data);
void MakeFriendStatusPacket(FriendsResult result, uint32 friend_guid, WorldPacket* data);
void SendFriendStatus(Player* player, FriendsResult result, uint32 friend_guid, bool broadcast);
void BroadcastToFriendListers(Player* player, WorldPacket* packet);
// Loading
@@ -45,14 +45,14 @@ void MapManager::LoadTransports()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 lowguid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
std::string name = fields[2].GetString();
uint32 period = fields[3].GetUInt32();
uint32 scriptId = sObjectMgr->GetScriptId(fields[4].GetCString());
const GameObjectTemplate *goinfo = sObjectMgr->GetGameObjectTemplate(entry);
const GameObjectTemplate* goinfo = sObjectMgr->GetGameObjectTemplate(entry);
if (!goinfo)
{
@@ -70,7 +70,7 @@ void MapManager::LoadTransports()
std::set<uint32> mapsUsed;
Transport *t = new Transport(period, scriptId);
Transport* t = new Transport(period, scriptId);
if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed))
// skip transports with empty waypoints list
{
@@ -111,7 +111,7 @@ void MapManager::LoadTransports()
{
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
@@ -143,7 +143,7 @@ void MapManager::LoadTransportNPCs()
do
{
Field *fields = result->Fetch();
Field* fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
uint32 entry = fields[1].GetUInt32();
uint32 transportEntry = fields[2].GetUInt32();
@@ -489,7 +489,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
for (PlayerSet::const_iterator itr = m_passengers.begin(); itr != m_passengers.end();)
{
Player *plr = *itr;
Player* plr = *itr;
++itr;
if (plr->isDead() && !plr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
@@ -503,7 +503,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
RemoveFromWorld();
ResetMap();
Map * newMap = sMapMgr->CreateMap(newMapid, this, 0);
Map* newMap = sMapMgr->CreateMap(newMapid, this, 0);
SetMap(newMap);
ASSERT (GetMap());
AddToWorld();
@@ -45,10 +45,10 @@ class Transport : public GameObject
typedef std::set<Creature*> CreatureSet;
CreatureSet m_NPCPassengerSet;
uint32 AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, float z, float o, uint32 anim=0);
void UpdatePosition(MovementInfo *mi);
void UpdatePosition(MovementInfo* mi);
void UpdateNPCPositions();
void BuildStartMovePacket(Map const *targetMap);
void BuildStopMovePacket(Map const *targetMap);
void BuildStartMovePacket(Map const* targetMap);
void BuildStopMovePacket(Map const* targetMap);
uint32 GetScriptId() const { return ScriptId; }
private:
struct WayPoint
+8 -8
View File
@@ -63,7 +63,7 @@ bool Player::UpdateStats(Stats stat)
if (stat == STAT_STAMINA || stat == STAT_INTELLECT || stat == STAT_STRENGTH)
{
Pet *pet = GetPet();
Pet* pet = GetPet();
if (pet)
pet->UpdateStats(stat);
}
@@ -190,7 +190,7 @@ void Player::UpdateResistances(uint32 school)
float value = GetTotalAuraModValue(UnitMods(UNIT_MOD_RESISTANCE_START + school));
SetResistance(SpellSchools(school), int32(value));
Pet *pet = GetPet();
Pet* pet = GetPet();
if (pet)
pet->UpdateResistances(school);
}
@@ -220,7 +220,7 @@ void Player::UpdateArmor()
SetArmor(int32(value));
Pet *pet = GetPet();
Pet* pet = GetPet();
if (pet)
pet->UpdateArmor();
@@ -365,7 +365,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
if (Item* mainHand = m_items[EQUIPMENT_SLOT_MAINHAND])
{
// also gains % attack power from equipped weapon
ItemTemplate const *proto = mainHand->GetTemplate();
ItemTemplate const* proto = mainHand->GetTemplate();
if (!proto)
continue;
@@ -442,7 +442,7 @@ void Player::UpdateAttackPowerAndDamage(bool ranged)
SetInt32Value(index_mod, (uint32)attPowerMod); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MODS field
SetFloatValue(index_mult, attPowerMultiplier); //UNIT_FIELD_(RANGED)_ATTACK_POWER_MULTIPLIER field
Pet *pet = GetPet(); //update pet's AP
Pet* pet = GetPet(); //update pet's AP
//automatically update weapon damage after attack power modification
if (ranged)
{
@@ -798,7 +798,7 @@ void Player::UpdateExpertise(WeaponAttackType attack)
int32 expertise = int32(GetRatingBonusValue(CR_EXPERTISE));
Item *weapon = GetWeaponForAttack(attack, true);
Item* weapon = GetWeaponForAttack(attack, true);
AuraEffectList const& expAuras = GetAuraEffectsByType(SPELL_AURA_MOD_EXPERTISE);
for (AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
@@ -1078,7 +1078,7 @@ bool Guardian::UpdateStats(Stats stat)
ApplyStatBuffMod(stat, m_statFromOwner[stat], false);
float ownersBonus = 0.0f;
Unit *owner = GetOwner();
Unit* owner = GetOwner();
// Handle Death Knight Glyphs and Talents
float mod = 0.75f;
if (IsPetGhoul() && (stat == STAT_STAMINA || stat == STAT_STRENGTH))
@@ -1090,7 +1090,7 @@ bool Guardian::UpdateStats(Stats stat)
default: break;
}
// Ravenous Dead
AuraEffect const *aurEff = NULL;
AuraEffect const* aurEff = NULL;
// Check just if owner has Ravenous Dead since it's effect is not an aura
aurEff = owner->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DEATHKNIGHT, 3010, 0);
if (aurEff)
+27 -27
View File
@@ -745,7 +745,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
// in bg, count dmg if victim is also a player
if (victim->GetTypeId() == TYPEID_PLAYER)
if (Battleground *bg = killer->GetBattleground())
if (Battleground* bg = killer->GetBattleground())
bg->UpdatePlayerScore(killer, SCORE_DAMAGE_DONE, damage);
killer->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DAMAGE_DONE, damage, 0, victim);
@@ -892,7 +892,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags
CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item *castItem/*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, uint64 originalCaster /*= 0*/)
void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem/*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, uint64 originalCaster /*= 0*/)
{
CastSpell(victim, spellInfo, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
@@ -998,7 +998,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
}
// used for scripting
void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item* castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{
if (!go)
return;
@@ -1038,7 +1038,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage)
return damageInfo.damage;
}
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit)
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit)
{
if (damage < 0)
return;
@@ -1144,7 +1144,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 dama
damageInfo->damage = damage;
}
void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss)
{
if (damageInfo == 0)
return;
@@ -1170,7 +1170,7 @@ void Unit::DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss)
}
// TODO for melee need create structure as in
void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType)
void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType)
{
damageInfo->attacker = this;
damageInfo->target = victim;
@@ -1367,7 +1367,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo *dam
damageInfo->damage = 0;
}
void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
{
Unit* victim = damageInfo->target;
@@ -1883,7 +1883,7 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
*absorb = dmgInfo.GetAbsorb();
}
void Unit::CalcHealAbsorb(Unit* victim, const SpellInfo *healSpell, uint32 &healAmount, uint32 &absorb)
void Unit::CalcHealAbsorb(Unit* victim, const SpellInfo* healSpell, uint32 &healAmount, uint32 &absorb)
{
if (!healAmount)
return;
@@ -2296,7 +2296,7 @@ bool Unit::isBlockCritical()
return false;
}
int32 Unit::GetMechanicResistChance(const SpellInfo *spell)
int32 Unit::GetMechanicResistChance(const SpellInfo* spell)
{
if (!spell)
return 0;
@@ -4613,7 +4613,7 @@ void Unit::_UnregisterDynObject(DynamicObject* dynObj)
m_dynObj.remove(dynObj);
}
DynamicObject * Unit::GetDynObject(uint32 spellId)
DynamicObject* Unit::GetDynObject(uint32 spellId)
{
if (m_dynObj.empty())
return NULL;
@@ -4749,7 +4749,7 @@ void Unit::RemoveAllGameObjects()
}
}
void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log)
void Unit::SendSpellNonMeleeDamageLog(SpellNonMeleeDamage* log)
{
WorldPacket data(SMSG_SPELLNONMELEEDAMAGELOG, (16+4+4+4+1+4+4+1+1+4+4+1)); // we guess size
data.append(log->target->GetPackGUID());
@@ -4794,7 +4794,7 @@ void Unit::ProcDamageAndSpell(Unit* victim, uint32 procAttacker, uint32 procVict
victim->ProcDamageAndSpellFor(true, this, procVictim, procExtra, attType, procSpell, amount, procAura);
}
void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo)
void Unit::SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo)
{
AuraEffect const* aura = pInfo->auraEff;
@@ -4874,7 +4874,7 @@ void Unit::SendSpellDamageImmune(Unit* target, uint32 spellId)
SendMessageToSet(&data, true);
}
void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo)
void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo)
{
sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Sending SMSG_ATTACKERSTATEUPDATE");
@@ -10238,7 +10238,7 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius)
// reserve place for players and pets because resizing vector every unit push is unefficient (vector is reallocated then)
nearMembers.reserve(pGroup->GetMembersCount() * 2);
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
if (Player* Target = itr->getSource())
{
// IsHostileTo check duel and controlled by enemy
@@ -11954,7 +11954,7 @@ void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
}
}
void Unit::ApplySpellDispelImmunity(const SpellInfo * spellProto, DispelType type, bool apply)
void Unit::ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply)
{
ApplySpellImmune(spellProto->Id, IMMUNITY_DISPEL, type, apply);
@@ -11989,7 +11989,7 @@ float Unit::GetWeaponProcChance() const
return 0;
}
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo * spellProto) const
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const
{
// proc per minute chance calculation
if (PPM <= 0) return 0.0f;
@@ -12035,7 +12035,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry)
Pet* pet = plr->GetPet();
if (pet)
{
Battleground *bg = ToPlayer()->GetBattleground();
Battleground* bg = ToPlayer()->GetBattleground();
// don't unsummon pet in arena but SetFlag UNIT_FLAG_STUNNED to disable pet's interface
if (bg && bg->isArena())
pet->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
@@ -14102,7 +14102,7 @@ bool InitTriggerAuraData()
return true;
}
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition)
uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition)
{
uint32 procEx = PROC_EX_NONE;
// Check victim state
@@ -14945,7 +14945,7 @@ void Unit::UpdateAuraForGroup(uint8 slot)
}
else if (GetTypeId() == TYPEID_UNIT && ToCreature()->isPet())
{
Pet *pet = ((Pet*)this);
Pet* pet = ((Pet*)this);
if (pet->isControlled())
{
Unit* owner = GetOwner();
@@ -15071,7 +15071,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id)
return pet;
}
bool Unit::InitTamedPet(Pet * pet, uint8 level, uint32 spell_id)
bool Unit::InitTamedPet(Pet* pet, uint8 level, uint32 spell_id)
{
pet->SetCreatorGUID(GetGUID());
pet->setFaction(getFaction());
@@ -15507,7 +15507,7 @@ void Unit::Kill(Unit* victim, bool durabilityLoss)
// the reset time is set but not added to the scheduler
// until the players leave the instance
time_t resettime = creature->GetRespawnTimeEx() + 2 * HOUR;
if (InstanceSave *save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId()))
if (InstanceSave* save = sInstanceSaveMgr->GetInstanceSave(creature->GetInstanceId()))
if (save->GetResetTime() < resettime) save->SetResetTime(resettime);
}
}
@@ -16179,7 +16179,7 @@ void Unit::GetRaidMember(std::list<Unit*> &nearMembers, float radius)
Group* pGroup = owner->GetGroup();
if (pGroup)
{
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -16215,7 +16215,7 @@ void Unit::GetPartyMemberInDist(std::list<Unit*> &TagUnitMap, float radius)
{
uint8 subgroup = owner->ToPlayer()->GetSubGroup();
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -16252,7 +16252,7 @@ void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
{
uint8 subgroup = owner->ToPlayer()->GetSubGroup();
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
for (GroupReference* itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
{
Player* Target = itr->getSource();
@@ -16836,7 +16836,7 @@ void Unit::JumpTo(float speedXY, float speedZ, bool forward)
}
}
void Unit::JumpTo(WorldObject *obj, float speedZ)
void Unit::JumpTo(WorldObject* obj, float speedZ)
{
float x, y, z;
obj->GetContactPoint(this, x, y, z);
@@ -16951,7 +16951,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
RemoveAurasByType(SPELL_AURA_MOUNTED);
// drop flag at invisible in bg
if (Battleground *bg = plr->GetBattleground())
if (Battleground* bg = plr->GetBattleground())
bg->EventPlayerDroppedFlag(plr);
WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0);
@@ -17006,7 +17006,7 @@ void Unit::_ExitVehicle(Position const* exitPosition)
m_vehicle->RemovePassenger(this);
// This should be done before dismiss, because there may be some aura removal
Vehicle *vehicle = m_vehicle;
Vehicle* vehicle = m_vehicle;
m_vehicle = NULL;
SetControlled(false, UNIT_STAT_ROOT); // SMSG_MOVE_FORCE_UNROOT, ~MOVEMENTFLAG_ROOT
+113 -113
View File
@@ -939,7 +939,7 @@ struct CalcDamageInfo
// Spell damage info structure based on structure sending in SMSG_SPELLNONMELEEDAMAGELOG opcode
struct SpellNonMeleeDamage{
SpellNonMeleeDamage(Unit *_attacker, Unit *_target, uint32 _SpellID, uint32 _schoolMask)
SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _schoolMask)
: target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask),
absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0)
{}
@@ -962,7 +962,7 @@ struct SpellNonMeleeDamage{
struct SpellPeriodicAuraLogInfo
{
SpellPeriodicAuraLogInfo(AuraEffect const *_auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
SpellPeriodicAuraLogInfo(AuraEffect const* _auraEff, uint32 _damage, uint32 _overDamage, uint32 _absorb, uint32 _resist, float _multiplier, bool _critical)
: auraEff(_auraEff), damage(_damage), overDamage(_overDamage), absorb(_absorb), resist(_resist), multiplier(_multiplier), critical(_critical){}
AuraEffect const* auraEff;
@@ -974,7 +974,7 @@ struct SpellPeriodicAuraLogInfo
bool critical;
};
uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missCondition);
uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition);
enum UnitAnimationState
{
@@ -1229,8 +1229,8 @@ class Unit : public WorldObject
typedef std::multimap<uint32, Aura*> AuraMap;
typedef std::multimap<uint32, AuraApplication*> AuraApplicationMap;
typedef std::multimap<AuraStateType, AuraApplication*> AuraStateAurasMap;
typedef std::list<AuraEffect *> AuraEffectList;
typedef std::list<Aura *> AuraList;
typedef std::list<AuraEffect*> AuraEffectList;
typedef std::list<Aura*> AuraList;
typedef std::list<AuraApplication *> AuraApplicationList;
typedef std::list<DiminishingReturn> Diminishing;
typedef std::set<uint32> ComboPointHolderSet;
@@ -1268,17 +1268,17 @@ class Unit : public WorldObject
void SetCanDualWield(bool value) { m_canDualWield = value; }
float GetCombatReach() const { return m_floatValues[UNIT_FIELD_COMBATREACH]; }
float GetMeleeReach() const { float reach = m_floatValues[UNIT_FIELD_COMBATREACH]; return reach > MIN_MELEE_REACH ? reach : MIN_MELEE_REACH; }
bool IsWithinCombatRange(const Unit *obj, float dist2compare) const;
bool IsWithinMeleeRange(const Unit *obj, float dist = MELEE_RANGE) const;
bool IsWithinCombatRange(const Unit* obj, float dist2compare) const;
bool IsWithinMeleeRange(const Unit* obj, float dist = MELEE_RANGE) const;
void GetRandomContactPoint(const Unit* target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const;
uint32 m_extraAttacks;
bool m_canDualWield;
void _addAttacker(Unit *pAttacker) // must be called only from Unit::Attack(Unit*)
void _addAttacker(Unit* pAttacker) // must be called only from Unit::Attack(Unit*)
{
m_attackers.insert(pAttacker);
}
void _removeAttacker(Unit *pAttacker) // must be called only from Unit::AttackStop()
void _removeAttacker(Unit* pAttacker) // must be called only from Unit::AttackStop()
{
m_attackers.erase(pAttacker);
}
@@ -1432,12 +1432,12 @@ class Unit : public WorldObject
void Unmount();
uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
void DealDamageMods(Unit *pVictim, uint32 &damage, uint32* absorb);
uint32 DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *spellProto = NULL, bool durabilityLoss = true);
void Kill(Unit *pVictim, bool durabilityLoss = true);
int32 DealHeal(Unit *pVictim, uint32 addhealth);
void DealDamageMods(Unit* pVictim, uint32 &damage, uint32* absorb);
uint32 DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true);
void Kill(Unit* pVictim, bool durabilityLoss = true);
int32 DealHeal(Unit* pVictim, uint32 addhealth);
void ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const *procSpell = NULL, SpellInfo const* procAura = NULL);
void ProcDamageAndSpell(Unit* pVictim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpell = NULL, SpellInfo const* procAura = NULL);
void ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellInfo const* procSpell, uint32 damage , SpellInfo const* procAura = NULL);
void GetProcAurasTriggeredOnEvent(std::list<AuraApplication*>& aurasTriggeringProc, std::list<AuraApplication*>* procAuras, ProcEventInfo eventInfo);
@@ -1446,13 +1446,13 @@ class Unit : public WorldObject
void TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, std::list<AuraApplication*>& procAuras);
void HandleEmoteCommand(uint32 anim_id);
void AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false);
void AttackerStateUpdate (Unit* pVictim, WeaponAttackType attType = BASE_ATTACK, bool extra = false);
void CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *damageInfo, WeaponAttackType attackType = BASE_ATTACK);
void DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss);
void CalculateMeleeDamage(Unit* pVictim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK);
void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss);
void CalculateSpellDamageTaken(SpellNonMeleeDamage *damageInfo, int32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false);
void DealSpellDamage(SpellNonMeleeDamage *damageInfo, bool durabilityLoss);
void CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = BASE_ATTACK, bool crit = false);
void DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss);
// player or player's pet resilience (-1%)
float GetMeleeCritChanceReduction() const { return GetCombatRatingReduction(CR_CRIT_TAKEN_MELEE); }
@@ -1471,17 +1471,17 @@ class Unit : public WorldObject
void ApplyResilience(const Unit* pVictim, float * crit, int32 * damage, bool isCrit, CombatRating type) const;
float MeleeSpellMissChance(const Unit *pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
SpellMissInfo MeleeSpellHitResult(Unit *pVictim, SpellInfo const *spell);
SpellMissInfo MagicSpellHitResult(Unit *pVictim, SpellInfo const *spell);
SpellMissInfo SpellHitResult(Unit *pVictim, SpellInfo const *spell, bool canReflect = false);
float MeleeSpellMissChance(const Unit* pVictim, WeaponAttackType attType, int32 skillDiff, uint32 spellId) const;
SpellMissInfo MeleeSpellHitResult(Unit* pVictim, SpellInfo const* spell);
SpellMissInfo MagicSpellHitResult(Unit* pVictim, SpellInfo const* spell);
SpellMissInfo SpellHitResult(Unit* pVictim, SpellInfo const* spell, bool canReflect = false);
float GetUnitDodgeChance() const;
float GetUnitParryChance() const;
float GetUnitBlockChance() const;
float GetUnitMissChance(WeaponAttackType attType) const;
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit *pVictim) const;
int32 GetMechanicResistChance(const SpellInfo *spell);
float GetUnitCriticalChance(WeaponAttackType attackType, const Unit* pVictim) const;
int32 GetMechanicResistChance(const SpellInfo* spell);
bool CanUseAttackType(uint8 attacktype) const
{
switch(attacktype)
@@ -1498,10 +1498,10 @@ class Unit : public WorldObject
uint32 GetDefenseSkillValue(Unit const* target = NULL) const;
uint32 GetWeaponSkillValue(WeaponAttackType attType, Unit const* target = NULL) const;
float GetWeaponProcChance() const;
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo * spellProto) const;
float GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* pVictim, WeaponAttackType attType) const;
MeleeHitOutcome RollMeleeOutcomeAgainst (const Unit* pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const;
bool isVendor() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR); }
bool isTrainer() const { return HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_TRAINER); }
@@ -1553,33 +1553,33 @@ class Unit : public WorldObject
virtual bool IsUnderWater() const;
bool isInAccessiblePlaceFor(Creature const* c) const;
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false);
void SendHealSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false);
int32 HealBySpell(Unit* pVictim, SpellInfo const* spellInfo, uint32 addHealth, bool critical = false);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void SendEnergizeSpellLog(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
void EnergizeBySpell(Unit* pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit* pVictim, uint32 spellID, uint32 damage);
void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* victim, SpellInfo const *spellInfo, bool triggered, Item *castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* victim, SpellInfo const *spellInfo, TriggerCastFlags triggerFlags, Item *castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* Victim = NULL, bool triggered = true, Item *castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* Victim = NULL, bool triggered = true, Item *castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
Aura * AddAura(uint32 spellId, Unit* target);
Aura * AddAura(SpellInfo const *spellInfo, uint8 effMask, Unit* target);
void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem= NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* Victim = NULL, bool triggered = true, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* Victim = NULL, bool triggered = true, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
Aura* AddAura(uint32 spellId, Unit* target);
Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target);
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
void SendPlaySpellVisual(uint32 id);
void SendPlaySpellImpact(uint64 guid, uint32 id);
void DeMorph();
void SendAttackStateUpdate(CalcDamageInfo *damageInfo);
void SendAttackStateUpdate(CalcDamageInfo* damageInfo);
void SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 SwingType, SpellSchoolMask damageSchoolMask, uint32 Damage, uint32 AbsorbDamage, uint32 Resist, VictimState TargetState, uint32 BlockedAmount);
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage *log);
void SendSpellNonMeleeDamageLog(SpellNonMeleeDamage* log);
void SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false);
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo *pInfo);
void SendPeriodicAuraLog(SpellPeriodicAuraLogInfo* pInfo);
void SendSpellMiss(Unit* target, uint32 spellID, SpellMissInfo missInfo);
void SendSpellDamageResist(Unit* target, uint32 spellId);
void SendSpellDamageImmune(Unit* target, uint32 spellId);
@@ -1591,7 +1591,7 @@ class Unit : public WorldObject
void KnockbackFrom(float x, float y, float speedXY, float speedZ);
void JumpTo(float speedXY, float speedZ, bool forward = true);
void JumpTo(WorldObject *obj, float speedZ);
void JumpTo(WorldObject* obj, float speedZ);
void SetFacing(float ori, WorldObject* obj = NULL);
void SendMonsterStop(bool on_death = false);
@@ -1600,7 +1600,7 @@ class Unit : public WorldObject
void SendMonsterMove(MonsterMoveData const& moveData, Player* receiver = NULL);
void SendMonsterMoveExitVehicle(Position const* newPos);
//void SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 type, uint32 MovementFlags, uint32 Time, Player* player = NULL);
void SendMonsterMoveTransport(Unit *vehicleOwner);
void SendMonsterMoveTransport(Unit* vehicleOwner);
void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);
void SendMonsterMoveWithSpeedToCurrentDestination(Player* player = NULL);
void SendMovementFlagUpdate();
@@ -1615,7 +1615,7 @@ class Unit : public WorldObject
void SendClearTarget();
void BuildHeartBeatMsg(WorldPacket *data) const;
void BuildHeartBeatMsg(WorldPacket* data) const;
bool isAlive() const { return (m_deathState == ALIVE); };
bool isDying() const { return (m_deathState == JUST_DIED); };
@@ -1656,7 +1656,7 @@ class Unit : public WorldObject
Unit* GetCharmerOrOwner() const { return GetCharmerGUID() ? GetCharmer() : GetOwner(); }
Unit* GetCharmerOrOwnerOrSelf() const
{
if (Unit *u = GetCharmerOrOwner())
if (Unit* u = GetCharmerOrOwner())
return u;
return (Unit*)this;
@@ -1681,7 +1681,7 @@ class Unit : public WorldObject
bool isPossessedByPlayer() const { return HasUnitState(UNIT_STAT_POSSESSED) && IS_PLAYER_GUID(GetCharmerGUID()); }
bool isPossessing() const
{
if (Unit *u = GetCharm())
if (Unit* u = GetCharm())
return u->isPossessed();
else
return false;
@@ -1703,20 +1703,20 @@ class Unit : public WorldObject
Pet* CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id = 0);
Pet* CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id = 0);
bool InitTamedPet(Pet * pet, uint8 level, uint32 spell_id);
bool InitTamedPet(Pet* pet, uint8 level, uint32 spell_id);
// aura apply/remove helpers - you should better not use these
Aura* _TryStackingOrRefreshingExistingAura(SpellInfo const* newAura, uint8 effMask, Unit* caster, int32* baseAmount = NULL, Item* castItem = NULL, uint64 casterGUID = 0);
void _AddAura(UnitAura* aura, Unit* caster);
AuraApplication * _CreateAuraApplication(Aura * aura, uint8 effMask);
void _ApplyAuraEffect(Aura * aura, uint8 effIndex);
AuraApplication * _CreateAuraApplication(Aura* aura, uint8 effMask);
void _ApplyAuraEffect(Aura* aura, uint8 effIndex);
void _ApplyAura(AuraApplication * aurApp, uint8 effMask);
void _UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode);
void _UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode);
void _RemoveNoStackAuraApplicationsDueToAura(Aura * aura);
void _RemoveNoStackAurasDueToAura(Aura * aura);
bool _IsNoStackAuraDueToAura(Aura * appliedAura, Aura * existingAura) const;
void _RegisterAuraEffect(AuraEffect * aurEff, bool apply);
void _RemoveNoStackAuraApplicationsDueToAura(Aura* aura);
void _RemoveNoStackAurasDueToAura(Aura* aura);
bool _IsNoStackAuraDueToAura(Aura* appliedAura, Aura* existingAura) const;
void _RegisterAuraEffect(AuraEffect* aurEff, bool apply);
// m_ownedAuras container management
AuraMap & GetOwnedAuras() { return m_ownedAuras; }
@@ -1724,9 +1724,9 @@ class Unit : public WorldObject
void RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveOwnedAura(uint32 spellId, uint64 caster = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
Aura * GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = NULL) const;
Aura* GetOwnedAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, Aura* except = NULL) const;
// m_appliedAuras container management
AuraApplicationMap & GetAppliedAuras() { return m_appliedAuras; }
@@ -1735,14 +1735,14 @@ class Unit : public WorldObject
void RemoveAura(AuraApplicationMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(uint32 spellId, uint64 caster = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(Aura * aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(Aura* aur, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasDueToSpell(uint32 spellId, uint64 caster = 0, uint8 reqEffMask = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAuraFromStack(uint32 spellId, uint64 caster = 0, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller, uint8 chargesRemoved = 1);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit* dispeller, uint8 chargesRemoved = 1);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit* stealer);
void RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId);
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except = NULL, bool negative = true, bool positive = true);
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura* except = NULL, bool negative = true, bool positive = true);
void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0);
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = 0);
void RemoveAurasWithAttribute(uint32 flags);
@@ -1765,17 +1765,17 @@ class Unit : public WorldObject
AuraList & GetSingleCastAuras() { return m_scAuras; }
AuraList const& GetSingleCastAuras() const { return m_scAuras; }
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
AuraEffect * GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
AuraEffect * GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const; // spell mustn't have familyflags
AuraEffect * GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 familyFlag1 , uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID =0);
AuraEffect* GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
AuraEffect* GetAuraEffectOfRankedSpell(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames name, uint32 iconId, uint8 effIndex) const; // spell mustn't have familyflags
AuraEffect* GetAuraEffect(AuraType type, SpellFamilyNames family, uint32 familyFlag1 , uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID =0);
inline AuraEffect* GetDummyAuraEffect(SpellFamilyNames name, uint32 iconId, uint8 effIndex) const { return GetAuraEffect(SPELL_AURA_DUMMY, name, iconId, effIndex);}
AuraApplication * GetAuraApplication(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const;
Aura * GetAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
Aura* GetAura(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
AuraApplication * GetAuraApplicationOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0, AuraApplication * except = NULL) const;
Aura * GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
Aura* GetAuraOfRankedSpell(uint32 spellId, uint64 casterGUID = 0, uint64 itemCasterGUID = 0, uint8 reqEffMask = 0) const;
bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
uint32 GetAuraCount(uint32 spellId) const;
@@ -1789,7 +1789,7 @@ class Unit : public WorldObject
bool HasNegativeAuraWithAttribute(uint32 flag, uint64 guid = 0);
bool HasAuraWithMechanic(uint32 mechanicMask);
AuraEffect * IsScriptOverriden(SpellInfo const* spell, int32 script) const;
AuraEffect* IsScriptOverriden(SpellInfo const* spell, int32 script) const;
uint32 GetDiseasesByCaster(uint64 casterGUID, bool remove = false);
uint32 GetDoTsByCaster(uint64 casterGUID) const;
@@ -1939,17 +1939,17 @@ class Unit : public WorldObject
// Threat related methods
bool CanHaveThreatList() const;
void AddThreat(Unit* pVictim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const *threatSpell = NULL);
void AddThreat(Unit* pVictim, float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL);
float ApplyTotalThreatModifier(float fThreat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL);
void DeleteThreatList();
void TauntApply(Unit* pVictim);
void TauntFadeOut(Unit *taunter);
void TauntFadeOut(Unit* taunter);
ThreatManager& getThreatManager() { return m_ThreatManager; }
void addHatedBy(HostileReference* pHostileReference) { m_HostileRefManager.insertFirst(pHostileReference); };
void removeHatedBy(HostileReference* /*pHostileReference*/) { /* nothing to do yet */ }
HostileRefManager& getHostileRefManager() { return m_HostileRefManager; }
VisibleAuraMap const *GetVisibleAuras() { return &m_visibleAuras; }
VisibleAuraMap const* GetVisibleAuras() { return &m_visibleAuras; }
AuraApplication * GetVisibleAura(uint8 slot)
{
VisibleAuraMap::iterator itr = m_visibleAuras.find(slot);
@@ -1989,43 +1989,43 @@ class Unit : public WorldObject
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
void ModifyAuraState(AuraStateType flag, bool apply);
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
bool HasAuraState(AuraStateType flag, SpellInfo const *spellProto = NULL, Unit const* Caster = NULL) const ;
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const ;
void UnsummonAllTotems();
Unit* SelectMagnetTarget(Unit* victim, SpellInfo const *spellInfo = NULL);
Unit* SelectMagnetTarget(Unit* victim, SpellInfo const* spellInfo = NULL);
int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask);
int32 SpellBaseHealingBonus(SpellSchoolMask schoolMask);
int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit *pVictim);
int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit *pVictim);
uint32 SpellDamageBonus(Unit *pVictim, SpellInfo const *spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1);
uint32 SpellHealingBonus(Unit *pVictim, SpellInfo const *spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
bool isSpellBlocked(Unit *pVictim, SpellInfo const *spellProto, WeaponAttackType attackType = BASE_ATTACK);
int32 SpellBaseDamageBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim);
int32 SpellBaseHealingBonusForVictim(SpellSchoolMask schoolMask, Unit* pVictim);
uint32 SpellDamageBonus(Unit* pVictim, SpellInfo const* spellProto, uint32 damage, DamageEffectType damagetype, uint32 stack = 1);
uint32 SpellHealingBonus(Unit* pVictim, SpellInfo const* spellProto, uint32 healamount, DamageEffectType damagetype, uint32 stack = 1);
bool isSpellBlocked(Unit* pVictim, SpellInfo const* spellProto, WeaponAttackType attackType = BASE_ATTACK);
bool isBlockCritical();
bool isSpellCrit(Unit *pVictim, SpellInfo const *spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const;
uint32 SpellCriticalDamageBonus(SpellInfo const *spellProto, uint32 damage, Unit *pVictim);
uint32 SpellCriticalHealingBonus(SpellInfo const *spellProto, uint32 damage, Unit *pVictim);
bool isSpellCrit(Unit* pVictim, SpellInfo const* spellProto, SpellSchoolMask schoolMask, WeaponAttackType attackType = BASE_ATTACK) const;
uint32 SpellCriticalDamageBonus(SpellInfo const* spellProto, uint32 damage, Unit* pVictim);
uint32 SpellCriticalHealingBonus(SpellInfo const* spellProto, uint32 damage, Unit* pVictim);
void SetLastManaUse(uint32 spellCastTime) { m_lastManaUse = spellCastTime; }
bool IsUnderLastManaUseEffect() const;
void SetContestedPvP(Player *attackedPlayer = NULL);
void SetContestedPvP(Player* attackedPlayer = NULL);
void MeleeDamageBonus(Unit *pVictim, uint32 *damage, WeaponAttackType attType, SpellInfo const *spellProto = NULL);
uint32 GetCastingTimeForBonus(SpellInfo const *spellProto, DamageEffectType damagetype, uint32 CastingTime);
void MeleeDamageBonus(Unit* pVictim, uint32 *damage, WeaponAttackType attType, SpellInfo const* spellProto = NULL);
uint32 GetCastingTimeForBonus(SpellInfo const* spellProto, DamageEffectType damagetype, uint32 CastingTime);
uint32 GetRemainingPeriodicAmount(uint64 caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const;
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply);
void ApplySpellDispelImmunity(const SpellInfo * spellProto, DispelType type, bool apply);
void ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply);
virtual bool IsImmunedToSpell(SpellInfo const* spellInfo);
// redefined in Creature
bool IsImmunedToDamage(SpellSchoolMask meleeSchoolMask);
bool IsImmunedToDamage(SpellInfo const* spellInfo);
virtual bool IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) const;
// redefined in Creature
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const *spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellInfo const *spellInfo, WeaponAttackType attackType=MAX_ATTACK);
void CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const *spellInfo = NULL);
void CalcHealAbsorb(Unit *pVictim, const SpellInfo *spellProto, uint32 &healAmount, uint32 &absorb);
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
uint32 CalcArmorReducedDamage(Unit* pVictim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType=MAX_ATTACK);
void CalcAbsorbResist(Unit* pVictim, SpellSchoolMask schoolMask, DamageEffectType damagetype, const uint32 damage, uint32 *absorb, uint32 *resist, SpellInfo const* spellInfo = NULL);
void CalcHealAbsorb(Unit* pVictim, const SpellInfo* spellProto, uint32 &healAmount, uint32 &absorb);
void UpdateSpeed(UnitMoveType mtype, bool forced);
float GetSpeed(UnitMoveType mtype) const;
@@ -2118,16 +2118,16 @@ class Unit : public WorldObject
m_misdirectionTargetGUID = guid;
}
uint32 GetReducedThreatPercent() { return m_reducedThreatPercent; }
Unit *GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; }
Unit* GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; }
bool IsAIEnabled, NeedChangeAI;
bool CreateVehicleKit(uint32 id, uint32 creatureEntry);
void RemoveVehicleKit();
Vehicle *GetVehicleKit()const { return m_vehicleKit; }
Vehicle *GetVehicle() const { return m_vehicle; }
bool IsOnVehicle(const Unit *vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); }
Unit *GetVehicleBase() const;
Creature *GetVehicleCreatureBase() const;
Vehicle* GetVehicleKit()const { return m_vehicleKit; }
Vehicle* GetVehicle() const { return m_vehicle; }
bool IsOnVehicle(const Unit* vehicle) const { return m_vehicle && m_vehicle == vehicle->GetVehicleKit(); }
Unit* GetVehicleBase() const;
Creature* GetVehicleCreatureBase() const;
float GetTransOffsetX() const { return m_movementInfo.t_pos.GetPositionX(); }
float GetTransOffsetY() const { return m_movementInfo.t_pos.GetPositionY(); }
float GetTransOffsetZ() const { return m_movementInfo.t_pos.GetPositionZ(); }
@@ -2139,7 +2139,7 @@ class Unit : public WorldObject
bool m_ControlledByPlayer;
bool HandleSpellClick(Unit* clicker, int8 seatId = -1);
void EnterVehicle(Unit *base, int8 seatId = -1);
void EnterVehicle(Unit* base, int8 seatId = -1);
void ExitVehicle(Position const* exitPosition = NULL);
void ChangeSeat(int8 seatId, bool next = true);
@@ -2202,7 +2202,7 @@ class Unit : public WorldObject
protected:
explicit Unit ();
UnitAI *i_AI, *i_disabledAI;
UnitAI* i_AI, *i_disabledAI;
void _UpdateSpells(uint32 time);
void _DeleteRemovedAuras();
@@ -2251,7 +2251,7 @@ class Unit : public WorldObject
float m_speed_rate[MAX_MOVE_TYPE];
CharmInfo *m_charmInfo;
CharmInfo* m_charmInfo;
SharedVisionList m_sharedVision;
virtual SpellSchoolMask GetMeleeDamageSchoolMask() const;
@@ -2263,8 +2263,8 @@ class Unit : public WorldObject
ThreatManager m_ThreatManager;
Vehicle *m_vehicle;
Vehicle *m_vehicleKit;
Vehicle* m_vehicle;
Vehicle* m_vehicleKit;
uint32 m_unitTypeMask;
@@ -2275,15 +2275,15 @@ class Unit : public WorldObject
bool isAlwaysDetectableFor(WorldObject const* seer) const;
private:
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const *& spellProcEvent);
bool HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleObsModEnergyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled);
bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const *procSpell, uint32 cooldown);
bool IsTriggeredAtSpellProcEvent(Unit* pVictim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent);
bool HandleDummyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleHasteAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleSpellCritChanceAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleObsModEnergyAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleModDamagePctTakenAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleAuraProc(Unit* pVictim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled);
bool HandleProcTriggerSpell(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleOverrideClassScriptAuraProc(Unit* pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown);
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
@@ -2327,7 +2327,7 @@ namespace Trinity
{
public:
PowerPctOrderPred(Powers power, bool ascending = true) : m_power(power), m_ascending(ascending) {}
bool operator() (const Unit *a, const Unit *b) const
bool operator() (const Unit* a, const Unit* b) const
{
float rA = a->GetMaxPower(m_power) ? float(a->GetPower(m_power)) / float(a->GetMaxPower(m_power)) : 0.0f;
float rB = b->GetMaxPower(m_power) ? float(b->GetPower(m_power)) / float(b->GetMaxPower(m_power)) : 0.0f;
@@ -2343,7 +2343,7 @@ namespace Trinity
{
public:
HealthPctOrderPred(bool ascending = true) : m_ascending(ascending) {}
bool operator() (const Unit *a, const Unit *b) const
bool operator() (const Unit* a, const Unit* b) const
{
float rA = a->GetMaxHealth() ? float(a->GetHealth()) / float(a->GetMaxHealth()) : 0.0f;
float rB = b->GetMaxHealth() ? float(b->GetHealth()) / float(b->GetMaxHealth()) : 0.0f;
+1 -1
View File
@@ -48,7 +48,7 @@ class Vehicle
bool AddPassenger(Unit* passenger, int8 seatId = -1);
void EjectPassenger(Unit* passenger, Unit* controller);
void RemovePassenger(Unit *passenger);
void RemovePassenger(Unit* passenger);
void RelocatePassengers(float x, float y, float z, float ang);
void RemoveAllPassengers();
void Dismiss();
@@ -55,8 +55,8 @@ enum VehicleSpells
struct VehicleSeat
{
explicit VehicleSeat(VehicleSeatEntry const *seatInfo) : SeatInfo(seatInfo), Passenger(0) {}
VehicleSeatEntry const *SeatInfo;
explicit VehicleSeat(VehicleSeatEntry const* seatInfo) : SeatInfo(seatInfo), Passenger(0) {}
VehicleSeatEntry const* SeatInfo;
uint64 Passenger;
};