Core: Crash fix (TemporarySummon), remove some warnings and some other minor changes

- "const uint64" and "uint64 const" --> uint64
 - Add some info in LFGDungeonEntry
 - Move some definitions from ".h" files and move to ".cpp"
This commit is contained in:
Spp-
2011-08-30 13:46:36 +02:00
parent fcf58e7062
commit aa85553bfd
50 changed files with 455 additions and 500 deletions
+1 -1
View File
@@ -120,7 +120,7 @@ class UnitAI
virtual void DoAction(int32 const /*param*/) {}
virtual uint32 GetData(uint32 /*id = 0*/) { return 0; }
virtual void SetData(uint32 /*id*/, uint32 /*value*/) {}
virtual void SetGUID(uint64 const /*guid*/, int32 /*id*/ = 0) {}
virtual void SetGUID(uint64 /*guid*/, int32 /*id*/ = 0) {}
virtual uint64 GetGUID(int32 /*id*/ = 0) { return 0; }
Unit* SelectTarget(SelectAggroTarget targetType, uint32 position = 0, float dist = 0.0f, bool playerOnly = false, int32 aura = 0);
+1 -1
View File
@@ -687,7 +687,7 @@ void SmartAI::SetData(uint32 id, uint32 value)
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, NULL, id, value);
}
void SmartAI::SetGUID(const uint64 /*guid*/, int32 /*id*/)
void SmartAI::SetGUID(uint64 /*guid*/, int32 /*id*/)
{
}
+1 -1
View File
@@ -157,7 +157,7 @@ class SmartAI : public CreatureAI
void SetData(uint32 id, uint32 value);
// Used in scripts to share variables
void SetGUID(const uint64 guid, int32 id = 0);
void SetGUID(uint64 guid, int32 id = 0);
// Used in scripts to share variables
uint64 GetGUID(int32 id = 0);
@@ -2846,7 +2846,7 @@ void SmartScript::SetData(uint32 id, uint32 value)
{
}
void SmartScript::SetGUID(const uint64 guid, int32 id)
void SmartScript::SetGUID(uint64 guid, int32 id)
{
}
+4 -4
View File
@@ -93,7 +93,7 @@ bool ArenaTeam::Create(uint32 captainGuid, uint8 type, std::string teamName, uin
return true;
}
bool ArenaTeam::AddMember(const uint64 playerGuid)
bool ArenaTeam::AddMember(uint64 playerGuid)
{
std::string playerName;
uint8 playerClass;
@@ -276,7 +276,7 @@ bool ArenaTeam::LoadMembersFromDB(QueryResult result)
return true;
}
void ArenaTeam::SetCaptain(const uint64 guid)
void ArenaTeam::SetCaptain(uint64 guid)
{
// Disable remove/promote buttons
Player* oldCaptain = ObjectAccessor::FindPlayer(GetCaptain());
@@ -537,7 +537,7 @@ uint8 ArenaTeam::GetSlotByType(uint32 type)
return 0xFF;
}
bool ArenaTeam::IsMember(const uint64 guid) const
bool ArenaTeam::IsMember(uint64 guid) const
{
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
if (itr->Guid == guid)
@@ -901,7 +901,7 @@ ArenaTeamMember* ArenaTeam::GetMember(const std::string& name)
return NULL;
}
ArenaTeamMember* ArenaTeam::GetMember(const uint64 guid)
ArenaTeamMember* ArenaTeam::GetMember(uint64 guid)
{
for (MemberList::iterator itr = Members.begin(); itr != Members.end(); ++itr)
if (itr->Guid == guid)
+5 -5
View File
@@ -131,10 +131,10 @@ class ArenaTeam
uint32 GetRating() const { return Stats.Rating; }
uint32 GetAverageMMR(Group* group) const;
void SetCaptain(const uint64 guid);
bool AddMember(const uint64 PlayerGuid);
void SetCaptain(uint64 guid);
bool AddMember(uint64 PlayerGuid);
// Shouldn't be const uint64 ed, because than can reference guid from members on Disband
// Shouldn't be uint64 ed, because than can reference guid from members on Disband
// and this method removes given record from list. So invalid reference can happen.
void DelMember(uint64 guid, bool cleanDb);
@@ -142,9 +142,9 @@ class ArenaTeam
bool Empty() const { return Members.empty(); }
MemberList::iterator m_membersBegin() { return Members.begin(); }
MemberList::iterator m_membersEnd() { return Members.end(); }
bool IsMember(const uint64 guid) const;
bool IsMember(uint64 guid) const;
ArenaTeamMember* GetMember(const uint64 guid);
ArenaTeamMember* GetMember(uint64 guid);
ArenaTeamMember* GetMember(const std::string& name);
bool IsFighting() const;
@@ -53,7 +53,7 @@ ArenaTeam* ArenaTeamMgr::GetArenaTeamByName(const std::string& arenaTeamName) co
return NULL;
}
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 const guid) const
ArenaTeam* ArenaTeamMgr::GetArenaTeamByCaptain(uint64 guid) const
{
for (ArenaTeamContainer::const_iterator itr = ArenaTeamStore.begin(); itr != ArenaTeamStore.end(); ++itr)
if (itr->second->GetCaptain() == guid)
+2 -2
View File
@@ -30,8 +30,8 @@ public:
typedef UNORDERED_MAP<uint32, ArenaTeam*> ArenaTeamContainer;
ArenaTeam* GetArenaTeamById(uint32 arenaTeamId) const;
ArenaTeam* GetArenaTeamByName(const std::string& arenaTeamName) const;
ArenaTeam* GetArenaTeamByCaptain(uint64 const guid) const;
ArenaTeam* GetArenaTeamByName(std::string const& arenaTeamName) const;
ArenaTeam* GetArenaTeamByCaptain(uint64 guid) const;
void LoadArenaTeams();
void AddArenaTeam(ArenaTeam* arenaTeam);
+1 -1
View File
@@ -18,7 +18,7 @@
#include "DBCStores.h"
#include "Logging/Log.h"
#include "Log.h"
#include "SharedDefines.h"
#include "SpellMgr.h"
+5 -5
View File
@@ -1172,12 +1172,12 @@ struct LFGDungeonEntry
uint32 reclevel; // 20
uint32 recminlevel; // 21
uint32 recmaxlevel; // 22
int32 map; // 23
int32 map; // 23
uint32 difficulty; // 24
//uint32 unk; // 25
//uint32 flags; // 25
uint32 type; // 26
//uint32 unk2; // 27
//char* unk3; // 28
//uint32 unk; // 27
//char* iconname; // 28
uint32 expansion; // 29
//uint32 unk4; // 30
uint32 grouptype; // 31
@@ -1538,7 +1538,7 @@ struct SpellEntry
uint32 Effect[MAX_SPELL_EFFECTS]; // 71-73 m_effect
int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 74-76 m_effectDieSides
float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 77-79 m_effectRealPointsPerLevel
int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 80-82 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 80-82 m_effectBasePoints (must not be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 83-85 m_effectMechanic
uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]; // 86-88 m_implicitTargetA
uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]; // 89-91 m_implicitTargetB
+39 -27
View File
@@ -308,7 +308,7 @@ void LFGMgr::Update(uint32 diff)
@param[in] guid Player or group guid to add to queue
@param[in] queueId Queue Id to add player/group to
*/
void LFGMgr::AddToQueue(const uint64 guid, uint8 queueId)
void LFGMgr::AddToQueue(uint64 guid, uint8 queueId)
{
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP))
queueId = 0;
@@ -329,7 +329,7 @@ void LFGMgr::AddToQueue(const uint64 guid, uint8 queueId)
@param[in] guid Player or group guid to add to queue
@return true if guid was found in main queue.
*/
bool LFGMgr::RemoveFromQueue(const uint64 guid)
bool LFGMgr::RemoveFromQueue(uint64 guid)
{
for (LfgGuidListMap::iterator it = m_currentQueue.begin(); it != m_currentQueue.end(); ++it)
it->second.remove(guid);
@@ -1250,7 +1250,7 @@ bool LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true
@param[in] guid Player guid to update answer
@param[in] accept Player answer
*/
void LFGMgr::UpdateProposal(uint32 proposalId, const uint64 guid, bool accept)
void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept)
{
// Check if the proposal exists
LfgProposalMap::iterator itProposal = m_Proposals.find(proposalId);
@@ -1364,17 +1364,29 @@ void LFGMgr::UpdateProposal(uint32 proposalId, const uint64 guid, bool accept)
switch(role)
{
case ROLE_DAMAGE:
m_WaitTimeDps = int32((m_WaitTimeDps * m_NumWaitTimeDps + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeDps);
{
uint32 old_number = m_NumWaitTimeDps++;
m_WaitTimeDps = int32((m_WaitTimeDps * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeDps);
break;
}
case ROLE_HEALER:
m_WaitTimeHealer = int32((m_WaitTimeHealer * m_NumWaitTimeHealer + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeHealer);
{
uint32 old_number = m_NumWaitTimeHealer++;
m_WaitTimeHealer = int32((m_WaitTimeHealer * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeHealer);
break;
}
case ROLE_TANK:
m_WaitTimeTank = int32((m_WaitTimeTank * m_NumWaitTimeTank + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeTank);
{
uint32 old_number = m_NumWaitTimeTank++;
m_WaitTimeTank = int32((m_WaitTimeTank * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeTank);
break;
}
default:
m_WaitTimeAvg = int32((m_WaitTimeAvg * m_NumWaitTimeAvg + waitTimesMap[plr->GetGUID()]) / ++m_NumWaitTimeAvg);
{
uint32 old_number = m_NumWaitTimeAvg++;
m_WaitTimeAvg = int32((m_WaitTimeAvg * old_number + waitTimesMap[plr->GetGUID()]) / m_NumWaitTimeAvg);
break;
}
}
grp->SetLfgRoles(pguid, pProposal->players[pguid]->role);
SetState(pguid, LFG_STATE_DUNGEON);
@@ -1519,7 +1531,7 @@ void LFGMgr::RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType t
@param[in] victim Victim guid
@param[in] reason Kick reason
*/
void LFGMgr::InitBoot(Group* grp, const uint64 kicker, const uint64 victim, std::string reason)
void LFGMgr::InitBoot(Group* grp, uint64 kicker, uint64 victim, std::string reason)
{
if (!grp)
return;
@@ -1889,7 +1901,7 @@ std::string LFGMgr::ConcatenateGuids(LfgGuidList check)
return o.str();
}
LfgState LFGMgr::GetState(const uint64 guid)
LfgState LFGMgr::GetState(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetState: [" UI64FMTD "]", guid);
if (IS_GROUP(guid))
@@ -1898,61 +1910,61 @@ LfgState LFGMgr::GetState(const uint64 guid)
return m_Players[guid].GetState();
}
uint32 LFGMgr::GetDungeon(const uint64 guid, bool asId /*= true*/)
uint32 LFGMgr::GetDungeon(uint64 guid, bool asId /*= true*/)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetDungeon: [" UI64FMTD "] asId: %u", guid, asId);
return m_Groups[guid].GetDungeon(asId);
}
uint8 LFGMgr::GetRoles(const uint64 guid)
uint8 LFGMgr::GetRoles(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetRoles: [" UI64FMTD "]", guid);
return m_Players[guid].GetRoles();
}
const std::string& LFGMgr::GetComment(const uint64 guid)
const std::string& LFGMgr::GetComment(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetComment: [" UI64FMTD "]", guid);
return m_Players[guid].GetComment();
}
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(const uint64 guid)
const LfgDungeonSet& LFGMgr::GetSelectedDungeons(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid);
return m_Players[guid].GetSelectedDungeons();
}
const LfgLockMap& LFGMgr::GetLockedDungeons(const uint64 guid)
const LfgLockMap& LFGMgr::GetLockedDungeons(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetLockedDungeons: [" UI64FMTD "]", guid);
return m_Players[guid].GetLockedDungeons();
}
uint8 LFGMgr::GetKicksLeft(const uint64 guid)
uint8 LFGMgr::GetKicksLeft(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetKicksLeft: [" UI64FMTD "]", guid);
return m_Groups[guid].GetKicksLeft();
}
uint8 LFGMgr::GetVotesNeeded(const uint64 guid)
uint8 LFGMgr::GetVotesNeeded(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::GetVotesNeeded: [" UI64FMTD "]", guid);
return m_Groups[guid].GetVotesNeeded();
}
void LFGMgr::RestoreState(const uint64 guid)
void LFGMgr::RestoreState(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RestoreState: [" UI64FMTD "]", guid);
m_Groups[guid].RestoreState();
}
void LFGMgr::ClearState(const uint64 guid)
void LFGMgr::ClearState(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::ClearState: [" UI64FMTD "]", guid);
m_Players[guid].ClearState();
}
void LFGMgr::SetState(const uint64 guid, LfgState state)
void LFGMgr::SetState(uint64 guid, LfgState state)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetState: [" UI64FMTD "] state %u", guid, state);
if (IS_GROUP(guid))
@@ -1961,43 +1973,43 @@ void LFGMgr::SetState(const uint64 guid, LfgState state)
m_Players[guid].SetState(state);
}
void LFGMgr::SetDungeon(const uint64 guid, uint32 dungeon)
void LFGMgr::SetDungeon(uint64 guid, uint32 dungeon)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetDungeon: [" UI64FMTD "] dungeon %u", guid, dungeon);
m_Groups[guid].SetDungeon(dungeon);
}
void LFGMgr::SetRoles(const uint64 guid, uint8 roles)
void LFGMgr::SetRoles(uint64 guid, uint8 roles)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetRoles: [" UI64FMTD "] roles: %u", guid, roles);
m_Players[guid].SetRoles(roles);
}
void LFGMgr::SetComment(const uint64 guid, const std::string& comment)
void LFGMgr::SetComment(uint64 guid, const std::string& comment)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetComment: [" UI64FMTD "] comment: %s", guid, comment.c_str());
m_Players[guid].SetComment(comment);
}
void LFGMgr::SetSelectedDungeons(const uint64 guid, const LfgDungeonSet& dungeons)
void LFGMgr::SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetSelectedDungeons: [" UI64FMTD "]", guid);
m_Players[guid].SetSelectedDungeons(dungeons);
}
void LFGMgr::SetLockedDungeons(const uint64 guid, const LfgLockMap& lock)
void LFGMgr::SetLockedDungeons(uint64 guid, const LfgLockMap& lock)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::SetLockedDungeons: [" UI64FMTD "]", guid);
m_Players[guid].SetLockedDungeons(lock);
}
void LFGMgr::DecreaseKicksLeft(const uint64 guid)
void LFGMgr::DecreaseKicksLeft(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::DecreaseKicksLeft: [" UI64FMTD "]", guid);
m_Groups[guid].DecreaseKicksLeft();
}
void LFGMgr::RemovePlayerData(const uint64 guid)
void LFGMgr::RemovePlayerData(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemovePlayerData: [" UI64FMTD "]", guid);
LfgPlayerDataMap::iterator it = m_Players.find(guid);
@@ -2005,7 +2017,7 @@ void LFGMgr::RemovePlayerData(const uint64 guid)
m_Players.erase(it);
}
void LFGMgr::RemoveGroupData(const uint64 guid)
void LFGMgr::RemoveGroupData(uint64 guid)
{
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RemoveGroupData: [" UI64FMTD "]", guid);
LfgGroupDataMap::iterator it = m_Groups.find(guid);
+23 -23
View File
@@ -272,45 +272,45 @@ class LFGMgr
void UpdateRoleCheck(uint64 gguid, uint64 guid = 0, uint8 roles = ROLE_NONE);
// Proposals
void UpdateProposal(uint32 proposalId, const uint64 guid, bool accept);
void UpdateProposal(uint32 proposalId, uint64 guid, bool accept);
// Teleportation
void TeleportPlayer(Player* plr, bool out, bool fromOpcode = false);
// Vote kick
void InitBoot(Group* grp, const uint64 kguid, const uint64 vguid, std::string reason);
void InitBoot(Group* grp, uint64 kguid, uint64 vguid, std::string reason);
void UpdateBoot(Player* plr, bool accept);
void OfferContinue(Group* grp);
void InitializeLockedDungeons(Player* plr);
void SetComment(const uint64 guid, const std::string& comment);
const LfgLockMap& GetLockedDungeons(const uint64 guid);
LfgState GetState(const uint64 guid);
const LfgDungeonSet& GetSelectedDungeons(const uint64 guid);
uint32 GetDungeon(const uint64 guid, bool asId = true);
void ClearState(const uint64 guid);
void RemovePlayerData(const uint64 guid);
void RemoveGroupData(const uint64 guid);
uint8 GetKicksLeft(const uint64 gguid);
uint8 GetVotesNeeded(const uint64 gguid);
void SetRoles(const uint64 guid, uint8 roles);
void SetComment(uint64 guid, const std::string& comment);
const LfgLockMap& GetLockedDungeons(uint64 guid);
LfgState GetState(uint64 guid);
const LfgDungeonSet& GetSelectedDungeons(uint64 guid);
uint32 GetDungeon(uint64 guid, bool asId = true);
void ClearState(uint64 guid);
void RemovePlayerData(uint64 guid);
void RemoveGroupData(uint64 guid);
uint8 GetKicksLeft(uint64 gguid);
uint8 GetVotesNeeded(uint64 gguid);
void SetRoles(uint64 guid, uint8 roles);
private:
uint8 GetRoles(const uint64 guid);
const std::string& GetComment(const uint64 gguid);
void RestoreState(const uint64 guid);
void SetState(const uint64 guid, LfgState state);
void SetDungeon(const uint64 guid, uint32 dungeon);
void SetSelectedDungeons(const uint64 guid, const LfgDungeonSet& dungeons);
void SetLockedDungeons(const uint64 guid, const LfgLockMap& lock);
void DecreaseKicksLeft(const uint64 guid);
uint8 GetRoles(uint64 guid);
const std::string& GetComment(uint64 gguid);
void RestoreState(uint64 guid);
void SetState(uint64 guid, LfgState state);
void SetDungeon(uint64 guid, uint32 dungeon);
void SetSelectedDungeons(uint64 guid, const LfgDungeonSet& dungeons);
void SetLockedDungeons(uint64 guid, const LfgLockMap& lock);
void DecreaseKicksLeft(uint64 guid);
void NoExiste(uint8 lala);
// Queue
void AddToQueue(const uint64 guid, uint8 queueId);
bool RemoveFromQueue(const uint64 guid);
void AddToQueue(uint64 guid, uint8 queueId);
bool RemoveFromQueue(uint64 guid);
// Proposals
void RemoveProposal(LfgProposalMap::iterator itProposal, LfgUpdateType type);
+2 -2
View File
@@ -740,10 +740,10 @@ class Creature : public Unit, public GridObject<Creature>
class AssistDelayEvent : public BasicEvent
{
public:
AssistDelayEvent(const uint64 victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
AssistDelayEvent(uint64 victim, Unit& owner) : BasicEvent(), m_victim(victim), m_owner(owner) { }
bool Execute(uint64 e_time, uint32 p_time);
void AddAssistant(const uint64 guid) { m_assistants.push_back(guid); }
void AddAssistant(uint64 guid) { m_assistants.push_back(guid); }
private:
AssistDelayEvent();
@@ -203,7 +203,7 @@ void TempSummon::InitStats(uint32 duration)
if (m_Properties->Faction)
setFaction(m_Properties->Faction);
else if (IsVehicle()) // properties should be vehicle
else if (IsVehicle() && owner) // properties should be vehicle
setFaction(owner->getFaction());
}
+113 -111
View File
@@ -159,6 +159,30 @@ std::string Object::_ConcatFields(uint16 startIndex, uint16 size) const
return ss.str();
}
void Object::AddToWorld()
{
if (m_inWorld)
return;
ASSERT(m_uint32Values);
m_inWorld = true;
// synchronize values mirror with values array (changes will send in updatecreate opcode any way
ClearUpdateMask(true);
}
void Object::RemoveFromWorld()
{
if (!m_inWorld)
return;
m_inWorld = false;
// if we remove from world then sending changes not required
ClearUpdateMask(true);
}
void Object::BuildMovementUpdateBlock(UpdateData * data, uint32 flags) const
{
ByteBuffer buf(500);
@@ -296,17 +320,11 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
*data << ((Unit*)this)->GetSpeed(MOVE_TURN_RATE);
*data << ((Unit*)this)->GetSpeed(MOVE_PITCH_RATE);
const Player* player = ToPlayer();
// 0x08000000
if (GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->isInFlight())
if (player && player->isInFlight())
{
//WPAssert(this->ToPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType() == FLIGHT_MOTION_TYPE);
Player* player = const_cast<Object*>(this)->ToPlayer();
if (!player)
return;
FlightPathMovementGenerator *fmg = (FlightPathMovementGenerator*)(player->GetMotionMaster()->top());
uint32 flags3 = SPLINEFLAG_GLIDE;
*data << uint32(flags3); // splines flag?
@@ -330,7 +348,9 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
}
}
TaxiPathNodeList& path = const_cast<TaxiPathNodeList&>(fmg->GetPath());
FlightPathMovementGenerator *fmg =
(FlightPathMovementGenerator*)(player->GetMotionMaster()->top());
TaxiPathNodeList const& path = fmg->GetPath();
float x, y, z;
player->GetPosition(x, y, z);
@@ -822,13 +842,10 @@ void Object::SetInt32Value(uint16 index, int32 value)
m_int32Values[index] = value;
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -842,13 +859,10 @@ void Object::SetUInt32Value(uint16 index, uint32 value)
m_uint32Values[index] = value;
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -861,51 +875,47 @@ void Object::UpdateUInt32Value(uint16 index, uint32 value)
_changedFields[index] = true;
}
void Object::SetUInt64Value(uint16 index, uint64 const value)
void Object::SetUInt64Value(uint16 index, uint64 value)
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index, true));
if (*((uint64*)&(m_uint32Values[index])) != value)
{
m_uint32Values[index] = *((uint32*)&value);
m_uint32Values[index + 1] = *(((uint32*)&value) + 1);
m_uint32Values[index] = PAIR64_LOPART(value);
m_uint32Values[index + 1] = PAIR64_HIPART(value);
_changedFields[index] = true;
_changedFields[index + 1] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
bool Object::AddUInt64Value(uint16 index, uint64 const value)
bool Object::AddUInt64Value(uint16 index, uint64 value)
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index , true));
if (value && !*((uint64*)&(m_uint32Values[index])))
{
m_uint32Values[index] = *((uint32*)&value);
m_uint32Values[index + 1] = *(((uint32*)&value) + 1);
m_uint32Values[index] = PAIR64_LOPART(value);
m_uint32Values[index + 1] = PAIR64_HIPART(value);
_changedFields[index] = true;
_changedFields[index + 1] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
return true;
}
return false;
}
bool Object::RemoveUInt64Value(uint16 index, const uint64 value)
bool Object::RemoveUInt64Value(uint16 index, uint64 value)
{
ASSERT(index + 1 < m_valuesCount || PrintIndexError(index , true));
if (value && *((uint64*)&(m_uint32Values[index])) == value)
@@ -915,13 +925,10 @@ bool Object::RemoveUInt64Value(uint16 index, const uint64 value)
_changedFields[index] = true;
_changedFields[index + 1] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
return true;
@@ -939,13 +946,10 @@ void Object::SetFloatValue(uint16 index, float value)
m_floatValues[index] = value;
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -966,13 +970,10 @@ void Object::SetByteValue(uint16 index, uint8 offset, uint8 value)
m_uint32Values[index] |= uint32(uint32(value) << (offset * 8));
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -993,13 +994,10 @@ void Object::SetUInt16Value(uint16 index, uint8 offset, uint16 value)
m_uint32Values[index] |= uint32(uint32(value) << (offset * 16));
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -1063,13 +1061,10 @@ void Object::SetFlag(uint16 index, uint32 newFlag)
m_uint32Values[index] = newval;
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -1087,13 +1082,10 @@ void Object::RemoveFlag(uint16 index, uint32 oldFlag)
m_uint32Values[index] = newval;
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -1113,13 +1105,10 @@ void Object::SetByteFlag(uint16 index, uint8 offset, uint8 newFlag)
m_uint32Values[index] |= uint32(uint32(newFlag) << (offset * 8));
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -1139,13 +1128,10 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag)
m_uint32Values[index] &= ~uint32(uint32(oldFlag) << (offset * 8));
_changedFields[index] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
}
@@ -1356,7 +1342,9 @@ bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool
bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const
{
if (!IsInMap(obj)) return false;
if (!IsInMap(obj))
return false;
float ox, oy, oz;
obj->GetPosition(ox, oy, oz);
return(IsWithinLOS(ox, oy, oz));
@@ -1840,13 +1828,10 @@ void WorldObject::SendPlaySound(uint32 Sound, bool OnlySelf)
void Object::ForceValuesUpdateAtIndex(uint32 i)
{
_changedFields[i] = true;
if (m_inWorld)
if (m_inWorld && !m_objectUpdated)
{
if (!m_objectUpdated)
{
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
sObjectAccessor->AddUpdateObject(this);
m_objectUpdated = true;
}
}
@@ -2043,6 +2028,12 @@ void Unit::BuildHeartBeatMsg(WorldPacket *data) const
BuildMovementPacket(data);
}
void WorldObject::SendMessageToSet(WorldPacket *data, bool self)
{
SendMessageToSetInRange(data, GetVisibilityRange(), self);
}
void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /*self*/)
{
Trinity::MessageDistDeliverer notifier(this, data, dist);
@@ -2396,7 +2387,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
return summon;
}
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive)
Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive) const
{
Creature *creature = NULL;
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck checker(*this, entry, alive, range);
@@ -2405,7 +2396,7 @@ Creature* WorldObject::FindNearestCreature(uint32 entry, float range, bool alive
return creature;
}
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range)
GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range) const
{
GameObject *go = NULL;
Trinity::NearestGameObjectEntryInObjectRangeCheck checker(*this, entry, range);
@@ -2414,7 +2405,7 @@ GameObject* WorldObject::FindNearestGameObject(uint32 entry, float range)
return go;
}
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange)
void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const
{
CellPair pair(Trinity::ComputeCellPair(this->GetPositionX(), this->GetPositionY()));
Cell cell(pair);
@@ -2428,7 +2419,7 @@ void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList
cell.Visit(pair, visitor, *(this->GetMap()));
}
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange)
void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const
{
CellPair pair(Trinity::ComputeCellPair(this->GetPositionX(), this->GetPositionY()));
Cell cell(pair);
@@ -2777,19 +2768,23 @@ void WorldObject::UpdateObjectVisibility(bool /*forced*/)
struct WorldObjectChangeAccumulator
{
UpdateDataMapType &i_updateDatas;
WorldObject &i_object;
UpdateDataMapType& i_updateDatas;
WorldObject& i_object;
std::set<uint64> plr_list;
WorldObjectChangeAccumulator(WorldObject &obj, UpdateDataMapType &d) : i_updateDatas(d), i_object(obj) {}
void Visit(PlayerMapType &m)
{
Player* source = NULL;
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
BuildPacket(iter->getSource());
if (!iter->getSource()->GetSharedVisionList().empty())
source = iter->getSource();
BuildPacket(source);
if (!source->GetSharedVisionList().empty())
{
SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
for (; it != iter->getSource()->GetSharedVisionList().end(); ++it)
SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
for (; it != source->GetSharedVisionList().end(); ++it)
BuildPacket(*it);
}
}
@@ -2797,30 +2792,37 @@ struct WorldObjectChangeAccumulator
void Visit(CreatureMapType &m)
{
Creature* source = NULL;
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
if (!iter->getSource()->GetSharedVisionList().empty())
source = iter->getSource();
if (!source->GetSharedVisionList().empty())
{
SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
for (; it != iter->getSource()->GetSharedVisionList().end(); ++it)
SharedVisionList::const_iterator it = source->GetSharedVisionList().begin();
for (; it != source->GetSharedVisionList().end(); ++it)
BuildPacket(*it);
}
}
}
void Visit(DynamicObjectMapType &m)
{
DynamicObject* source = NULL;
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
{
uint64 guid = iter->getSource()->GetCasterGUID();
source = iter->getSource();
uint64 guid = source->GetCasterGUID();
if (IS_PLAYER_GUID(guid))
{
//Caster may be NULL if DynObj is in removelist
if (Player *caster = ObjectAccessor::FindPlayer(guid))
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == iter->getSource()->GetGUID())
if (caster->GetUInt64Value(PLAYER_FARSIGHT) == source->GetGUID())
BuildPacket(caster);
}
}
}
void BuildPacket(Player* plr)
{
// Only send update once to a player
+15 -32
View File
@@ -125,29 +125,9 @@ class Object
virtual ~Object ();
bool IsInWorld() const { return m_inWorld; }
virtual void AddToWorld()
{
if (m_inWorld)
return;
ASSERT(m_uint32Values);
m_inWorld = true;
// synchronize values mirror with values array (changes will send in updatecreate opcode any way
ClearUpdateMask(true);
}
virtual void RemoveFromWorld()
{
if (!m_inWorld)
return;
m_inWorld = false;
// if we remove from world then sending changes not required
ClearUpdateMask(true);
}
virtual void AddToWorld();
virtual void RemoveFromWorld();
uint64 GetGUID() const { return GetUInt64Value(0); }
uint32 GetGUIDLow() const { return GUID_LOPART(GetUInt64Value(0)); }
@@ -210,7 +190,7 @@ class Object
void SetInt32Value(uint16 index, int32 value);
void SetUInt32Value(uint16 index, uint32 value);
void UpdateUInt32Value(uint16 index, uint32 value);
void SetUInt64Value(uint16 index, uint64 const value);
void SetUInt64Value(uint16 index, uint64 value);
void SetFloatValue(uint16 index, float value);
void SetByteValue(uint16 index, uint8 offset, uint8 value);
void SetUInt16Value(uint16 index, uint8 offset, uint16 value);
@@ -218,8 +198,8 @@ class Object
void SetStatFloatValue(uint16 index, float value);
void SetStatInt32Value(uint16 index, int32 value);
bool AddUInt64Value(uint16 index, uint64 const value);
bool RemoveUInt64Value(uint16 index, uint64 const value);
bool AddUInt64Value(uint16 index, uint64 value);
bool RemoveUInt64Value(uint16 index, uint64 value);
void ApplyModUInt32Value(uint16 index, int32 val, bool apply);
void ApplyModInt32Value(uint16 index, int32 val, bool apply);
@@ -725,7 +705,7 @@ class WorldObject : public Object, public WorldLocation
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) { SendMessageToSetInRange(data, GetVisibilityRange(), self); }
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);
@@ -806,11 +786,11 @@ class WorldObject : public Object, public WorldLocation
GameObject* SummonGameObject(uint32 entry, float x, float y, float z, float ang, float rotation0, float rotation1, float rotation2, float rotation3, uint32 respawnTime);
Creature* SummonTrigger(float x, float y, float z, float ang, uint32 dur, CreatureAI* (*GetAI)(Creature*) = NULL);
Creature* FindNearestCreature(uint32 entry, float range, bool alive = true);
GameObject* FindNearestGameObject(uint32 entry, float range);
Creature* FindNearestCreature(uint32 entry, float range, bool alive = true) const;
GameObject* FindNearestGameObject(uint32 entry, float range) const;
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange);
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange);
void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry, float fMaxSearchRange) const;
void DestroyForNearbyPlayers();
virtual void UpdateObjectVisibility(bool forced = true);
@@ -884,11 +864,14 @@ namespace Trinity
template<class T>
void RandomResizeList(std::list<T> &_list, uint32 _size)
{
while (_list.size() > _size)
size_t list_size = _list.size();
while (list_size > _size)
{
typename std::list<T>::iterator itr = _list.begin();
advance(itr, urand(0, _list.size() - 1));
std::advance(itr, urand(0, list_size - 1));
_list.erase(itr);
--list_size;
}
}
@@ -78,7 +78,7 @@ enum HighGuid
#define _GUID_LOPART_2(x) (uint32)(uint64(x) & UI64LIT(0x00000000FFFFFFFF))
#define _GUID_LOPART_3(x) (uint32)(uint64(x) & UI64LIT(0x0000000000FFFFFF))
inline bool IsGuidHaveEnPart(uint64 const guid)
inline bool IsGuidHaveEnPart(uint64 guid)
{
switch(GUID_HIPART(guid))
{
@@ -34,7 +34,7 @@ void UpdateData::AddOutOfRangeGUID(std::set<uint64>& guids)
m_outOfRangeGUIDs.insert(guids.begin(), guids.end());
}
void UpdateData::AddOutOfRangeGUID(const uint64 guid)
void UpdateData::AddOutOfRangeGUID(uint64 guid)
{
m_outOfRangeGUIDs.insert(guid);
}
@@ -53,7 +53,7 @@ class UpdateData
UpdateData();
void AddOutOfRangeGUID(std::set<uint64>& guids);
void AddOutOfRangeGUID(const uint64 guid);
void AddOutOfRangeGUID(uint64 guid);
void AddUpdateBlock(const ByteBuffer &block);
bool BuildPacket(WorldPacket* packet);
bool HasData() { return m_blockCount > 0 || !m_outOfRangeGUIDs.empty(); }
+2 -2
View File
@@ -19610,8 +19610,8 @@ void Player::SendRemoveControlBar()
bool Player::IsAffectedBySpellmod(SpellInfo const *spellInfo, SpellModifier *mod, Spell* spell)
{
if (!mod || !spellInfo)
return false;
if (!mod || !spellInfo)
return false;
// Mod out of charges
if (spell && mod->charges == -1 && spell->m_appliedMods.find(mod->ownerAura) == spell->m_appliedMods.end())
+2 -2
View File
@@ -1567,7 +1567,7 @@ class Player : public Unit, public GridObject<Player>
uint64 GetSelection() const { return m_curSelection; }
Unit *GetSelectedUnit() const;
Player *GetSelectedPlayer() const;
void SetSelection(const uint64 guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); }
void SetSelection(uint64 guid) { m_curSelection = guid; SetUInt64Value(UNIT_FIELD_TARGET, guid); }
uint8 GetComboPoints() { return m_comboPoints; }
uint64 GetComboTarget() const { return m_comboTarget; }
@@ -1902,7 +1902,7 @@ class Player : public Unit, public GridObject<Player>
void UpdateRuneRegen(RuneType rune);
uint64 GetLootGUID() const { return m_lootGuid; }
void SetLootGUID(const uint64 guid) { m_lootGuid = guid; }
void SetLootGUID(uint64 guid) { m_lootGuid = guid; }
void RemovedInsignia(Player* looterPlr);
+137 -173
View File
@@ -6457,16 +6457,14 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
}
case SPELLFAMILY_ROGUE:
{
switch(dummySpell->Id)
switch (dummySpell->Id)
{
// Glyph of Backstab
case 56800:
case 56800: // Glyph of Backstab
{
triggered_spell_id = 63975;
break;
}
// Deadly Throw Interrupt
case 32748:
case 32748: // Deadly Throw Interrupt
{
// Prevent cast Deadly Throw Interrupt on self from last effect (apply dummy) of Deadly Throw
if (this == victim)
@@ -6476,124 +6474,126 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
break;
}
}
// Cut to the Chase
if (dummySpell->SpellIconID == 2909)
switch (dummySpell->SpellIconID)
{
// "refresh your Slice and Dice duration to its 5 combo point maximum"
// lookup Slice and Dice
if (AuraEffect const* aur = GetAuraEffect(SPELL_AURA_MOD_MELEE_HASTE, SPELLFAMILY_ROGUE, 0x40000, 0, 0))
case 2116: // Quick Recovery
{
aur->GetBase()->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true);
return true;
if (!procSpell)
return false;
// energy cost save
basepoints0 = CalculatePctN(int32(procSpell->ManaCost), triggerAmount);
if (basepoints0 <= 0)
return false;
target = this;
triggered_spell_id = 31663;
break;
}
return false;
}
// Deadly Brew
else if (dummySpell->SpellIconID == 2963)
{
triggered_spell_id = 3409;
break;
}
// Quick Recovery
else if (dummySpell->SpellIconID == 2116)
{
if (!procSpell)
case 2909: // Cut to the Chase
{
// "refresh your Slice and Dice duration to its 5 combo point maximum"
// lookup Slice and Dice
if (AuraEffect const* aur = GetAuraEffect(SPELL_AURA_MOD_MELEE_HASTE, SPELLFAMILY_ROGUE, 0x40000, 0, 0))
{
aur->GetBase()->SetDuration(aur->GetSpellInfo()->GetMaxDuration(), true);
return true;
}
return false;
// energy cost save
basepoints0 = CalculatePctN(int32(procSpell->ManaCost), triggerAmount);
if (basepoints0 <= 0)
return false;
target = this;
triggered_spell_id = 31663;
break;
}
case 2963: // Deadly Brew
{
triggered_spell_id = 3409;
break;
}
}
break;
}
case SPELLFAMILY_HUNTER:
{
// Thrill of the Hunt
if (dummySpell->SpellIconID == 2236)
switch (dummySpell->SpellIconID)
{
if (!procSpell)
return false;
Spell* spell = ToPlayer()->m_spellModTakingSpell;
// Disable charge drop because of Lock and Load
ToPlayer()->SetSpellModTakingSpell(spell, false);
// Explosive Shot
if (procSpell->SpellFamilyFlags[2] & 0x200)
case 267: // Improved Mend Pet
{
if (AuraEffect const* pEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_HUNTER, 0x0, 0x80000000, 0x0, GetGUID()))
basepoints0 = pEff->GetSpellInfo()->CalcPowerCost(this, SpellSchoolMask(pEff->GetSpellInfo()->SchoolMask)) * 4/10/3;
int32 chance = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcValue();
if (!roll_chance_i(chance))
return false;
triggered_spell_id = 24406;
break;
}
else
basepoints0 = procSpell->CalcPowerCost(this, SpellSchoolMask(procSpell->SchoolMask)) * 4/10;
ToPlayer()->SetSpellModTakingSpell(spell, true);
if (basepoints0 <= 0)
return false;
target = this;
triggered_spell_id = 34720;
break;
}
// Hunting Party
if (dummySpell->SpellIconID == 3406)
{
triggered_spell_id = 57669;
target = this;
break;
}
// Improved Mend Pet
if (dummySpell->SpellIconID == 267)
{
int32 chance = triggeredByAura->GetSpellInfo()->Effects[triggeredByAura->GetEffIndex()].CalcValue();
if (!roll_chance_i(chance))
return false;
triggered_spell_id = 24406;
break;
}
// Lock and Load
if (dummySpell->SpellIconID == 3579)
{
// Proc only from periodic (from trap activation proc another aura of this spell)
if (!(procFlag & PROC_FLAG_DONE_PERIODIC) || !roll_chance_i(triggerAmount))
return false;
triggered_spell_id = 56453;
target = this;
break;
}
// Rapid Recuperation
if (dummySpell->SpellIconID == 3560)
{
// This effect only from Rapid Killing (mana regen)
if (!(procSpell->SpellFamilyFlags[1] & 0x01000000))
return false;
target = this;
switch(dummySpell->Id)
case 2236: // Thrill of the Hunt
{
case 53228: // Rank 1
triggered_spell_id = 56654;
break;
case 53232: // Rank 2
triggered_spell_id = 58882;
break;
if (!procSpell)
return false;
Spell* spell = ToPlayer()->m_spellModTakingSpell;
// Disable charge drop because of Lock and Load
ToPlayer()->SetSpellModTakingSpell(spell, false);
// Explosive Shot
if (procSpell->SpellFamilyFlags[2] & 0x200)
{
if (AuraEffect const* pEff = victim->GetAuraEffect(SPELL_AURA_PERIODIC_DUMMY, SPELLFAMILY_HUNTER, 0x0, 0x80000000, 0x0, GetGUID()))
basepoints0 = pEff->GetSpellInfo()->CalcPowerCost(this, SpellSchoolMask(pEff->GetSpellInfo()->SchoolMask)) * 4/10/3;
}
else
basepoints0 = procSpell->CalcPowerCost(this, SpellSchoolMask(procSpell->SchoolMask)) * 4/10;
ToPlayer()->SetSpellModTakingSpell(spell, true);
if (basepoints0 <= 0)
return false;
target = this;
triggered_spell_id = 34720;
break;
}
case 3406: // Hunting Party
{
triggered_spell_id = 57669;
target = this;
break;
}
case 3560: // Rapid Recuperation
{
// This effect only from Rapid Killing (mana regen)
if (!(procSpell->SpellFamilyFlags[1] & 0x01000000))
return false;
target = this;
switch (dummySpell->Id)
{
case 53228: // Rank 1
triggered_spell_id = 56654;
break;
case 53232: // Rank 2
triggered_spell_id = 58882;
break;
}
break;
}
case 3579: // Lock and Load
{
// Proc only from periodic (from trap activation proc another aura of this spell)
if (!(procFlag & PROC_FLAG_DONE_PERIODIC) || !roll_chance_i(triggerAmount))
return false;
triggered_spell_id = 56453;
target = this;
break;
}
break;
}
// Glyph of Mend Pet
if (dummySpell->Id == 57870)
switch (dummySpell->Id)
{
victim->CastSpell(victim, 57894, true, NULL, NULL, GetGUID());
return true;
case 57870: // Glyph of Mend Pet
{
victim->CastSpell(victim, 57894, true, NULL, NULL, GetGUID());
return true;
}
}
break;
}
@@ -8411,76 +8411,42 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
target = this;
break;
}
// Lightning Capacitor
case 37657:
case 37657: // Lightning Capacitor
case 54841: // Thunder Capacitor
case 67712: // Item - Coliseum 25 Normal Caster Trinket
case 67758: // Item - Coliseum 25 Heroic Caster Trinket
{
if (!victim || !victim->isAlive())
if (!victim || !victim->isAlive() || GetTypeId() != TYPEID_PLAYER)
return false;
// stacking
CastSpell(this, 37658, true, NULL, triggeredByAura);
Aura* dummy = GetAura(37658);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
uint32 stack_spell_id = 0;
switch (auraSpellInfo->Id)
{
case 37657:
stack_spell_id = 37658;
trigger_spell_id = 37661;
break;
case 54841:
stack_spell_id = 54842;
trigger_spell_id = 54843;
break;
case 67712:
stack_spell_id = 67713;
trigger_spell_id = 67714;
break;
case 67758:
stack_spell_id = 67759;
trigger_spell_id = 67760;
break;
}
CastSpell(this, stack_spell_id, true, NULL, triggeredByAura);
Aura* dummy = GetAura(stack_spell_id);
if (!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(37658);
trigger_spell_id = 37661;
target = victim;
break;
}
// Thunder Capacitor
case 54841:
{
if (!victim || !victim->isAlive())
return false;
// stacking
CastSpell(this, 54842, true, NULL, triggeredByAura);
// counting
Aura* dummy = GetAura(54842);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if (!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(54842);
trigger_spell_id = 54843;
target = victim;
break;
}
//Item - Coliseum 25 Normal Caster Trinket
case 67712:
{
if (!victim || !victim->isAlive())
return false;
// stacking
CastSpell(this, 67713, true, NULL, triggeredByAura);
Aura* dummy = GetAura(67713);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if (!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(67713);
trigger_spell_id = 67714;
target = victim;
break;
}
//Item - Coliseum 25 Heroic Caster Trinket
case 67758:
{
if (!victim || !victim->isAlive())
return false;
// stacking
CastSpell(this, 67759, true, NULL, triggeredByAura);
Aura* dummy = GetAura(67759);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if (!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(67759);
trigger_spell_id = 67760;
RemoveAurasDueToSpell(stack_spell_id);
target = victim;
break;
}
@@ -11743,8 +11709,6 @@ void Unit::MeleeDamageBonus(Unit* victim, uint32 *pdamage, WeaponAttackType attT
else
TakenFlatBenefit += victim->GetTotalAuraModifier(SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN);
Player* player = ToPlayer();
// Done/Taken total percent damage auras
float DoneTotalMod = 1.0f;
float TakenTotalMod = 1.0f;
+2 -1
View File
@@ -2050,7 +2050,8 @@ class Unit : public WorldObject
static Player* GetPlayer(WorldObject& object, uint64 guid);
static Creature* GetCreature(WorldObject& object, uint64 guid);
MotionMaster* GetMotionMaster(){ return &i_motionMaster; }
MotionMaster* GetMotionMaster() { return &i_motionMaster; }
const MotionMaster* GetMotionMaster() const { return &i_motionMaster; }
bool IsStopped() const { return !(HasUnitState(UNIT_STAT_MOVING)); }
void StopMoving();
+12 -12
View File
@@ -270,7 +270,7 @@ void Group::RemoveAllInvites()
m_invitees.clear();
}
Player* Group::GetInvited(const uint64 guid) const
Player* Group::GetInvited(uint64 guid) const
{
for (InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
{
@@ -387,7 +387,7 @@ bool Group::AddMember(Player* player)
return true;
}
bool Group::RemoveMember(const uint64 guid, const RemoveMethod &method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/)
bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/)
{
BroadcastGroupUpdate();
@@ -498,7 +498,7 @@ bool Group::RemoveMember(const uint64 guid, const RemoveMethod &method /*= GROUP
}
}
void Group::ChangeLeader(const uint64 guid)
void Group::ChangeLeader(uint64 guid)
{
member_witerator slot = _getMemberWSlot(guid);
@@ -652,7 +652,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
}
}
void Group::SendLootRoll(const uint64 SourceGuid, const uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
void Group::SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
{
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1));
data << uint64(SourceGuid); // guid of the item rolled
@@ -676,7 +676,7 @@ void Group::SendLootRoll(const uint64 SourceGuid, const uint64 TargetGuid, uint8
}
}
void Group::SendLootRollWon(const uint64 SourceGuid, const uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
void Group::SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r)
{
WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1));
data << uint64(SourceGuid); // guid of the item rolled
@@ -949,7 +949,7 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject)
}
}
void Group::CountRollVote(const uint64 playerGUID, const uint64 Guid, uint32 NumberOfPlayers, uint8 Choice)
void Group::CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choice)
{
Rolls::iterator rollI = GetRoll(Guid);
if (rollI == RollId.end())
@@ -1295,7 +1295,7 @@ void Group::OfflineReadyCheck()
}
}
bool Group::_setMembersGroup(const uint64 guid, uint8 group)
bool Group::_setMembersGroup(uint64 guid, uint8 group)
{
member_witerator slot = _getMemberWSlot(guid);
if (slot == m_memberSlots.end())
@@ -1322,7 +1322,7 @@ bool Group::SameSubGroup(Player const* member1, Player const* member2) const
}
// Allows setting sub groups both for online or offline members
void Group::ChangeMembersGroup(const uint64 guid, uint8 group)
void Group::ChangeMembersGroup(uint64 guid, uint8 group)
{
// Only raid groups have sub groups
if (!isRaidGroup())
@@ -1767,7 +1767,7 @@ void Group::SetLootMethod(LootMethod method)
m_lootMethod = method;
}
void Group::SetLooterGuid(const uint64 guid)
void Group::SetLooterGuid(uint64 guid)
{
m_looterGuid = guid;
}
@@ -1847,12 +1847,12 @@ ItemQualities Group::GetLootThreshold() const
return m_lootThreshold;
}
bool Group::IsMember(const uint64 guid) const
bool Group::IsMember(uint64 guid) const
{
return _getMemberCSlot(guid) != m_memberSlots.end();
}
bool Group::IsLeader(const uint64 guid) const
bool Group::IsLeader(uint64 guid) const
{
return (GetLeaderGUID() == guid);
}
@@ -1873,7 +1873,7 @@ bool Group::IsAssistant(uint64 guid) const
return mslot->flags & MEMBER_FLAG_ASSISTANT;
}
bool Group::SameSubGroup(uint64 guid1, const uint64 guid2) const
bool Group::SameSubGroup(uint64 guid1, uint64 guid2) const
{
member_citerator mslot2 = _getMemberCSlot(guid2);
if (mslot2 == m_memberSlots.end())
+12 -12
View File
@@ -191,10 +191,10 @@ class Group
void RemoveAllInvites();
bool AddLeaderInvite(Player* player);
bool AddMember(Player* player);
bool RemoveMember(const uint64 guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL);
void ChangeLeader(const uint64 guid);
bool RemoveMember(uint64 guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = NULL);
void ChangeLeader(uint64 guid);
void SetLootMethod(LootMethod method);
void SetLooterGuid(const uint64 guid);
void SetLooterGuid(uint64 guid);
void UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed = false);
void SetLootThreshold(ItemQualities threshold);
void Disband(bool hideDestroy=false);
@@ -217,15 +217,15 @@ class Group
uint32 GetDbStoreId() { return m_dbStoreId; };
// member manipulation methods
bool IsMember(const uint64 guid) const;
bool IsLeader(const uint64 guid) const;
bool IsMember(uint64 guid) const;
bool IsLeader(uint64 guid) const;
uint64 GetMemberGUID(const std::string& name);
bool IsAssistant(uint64 guid) const;
Player* GetInvited(const uint64 guid) const;
Player* GetInvited(uint64 guid) const;
Player* GetInvited(const std::string& name) const;
bool SameSubGroup(uint64 guid1, const uint64 guid2) const;
bool SameSubGroup(uint64 guid1, uint64 guid2) const;
bool SameSubGroup(uint64 guid1, MemberSlot const* slot2) const;
bool SameSubGroup(Player const* member1, Player const* member2) const;
bool HasFreeSlotSubGroup(uint8 subgroup) const;
@@ -241,7 +241,7 @@ class Group
void SetBattlegroundGroup(Battleground *bg);
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgOrTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
void ChangeMembersGroup(const uint64 guid, uint8 group);
void ChangeMembersGroup(uint64 guid, uint8 group);
void ChangeMembersGroup(Player* player, uint8 group);
void SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid);
void SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag);
@@ -272,8 +272,8 @@ class Group
bool isRollLootActive() const;
void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r);
void SendLootRoll(const uint64 SourceGuid, const uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootRollWon(const uint64 SourceGuid, const uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r);
void SendLooter(Creature *pCreature, Player *pLooter);
void GroupLoot(Loot *loot, WorldObject* pLootedObject);
@@ -281,7 +281,7 @@ class Group
void MasterLoot(Loot *loot, WorldObject* pLootedObject);
Rolls::iterator GetRoll(uint64 Guid);
void CountTheRoll(Rolls::iterator roll, uint32 NumberOfPlayers);
void CountRollVote(const uint64 playerGUID, const uint64 Guid, uint32 NumberOfPlayers, uint8 Choise);
void CountRollVote(uint64 playerGUID, uint64 Guid, uint32 NumberOfPlayers, uint8 Choise);
void EndRoll(Loot *loot);
// related to disenchant rolls
@@ -301,7 +301,7 @@ class Group
void BroadcastGroupUpdate(void);
protected:
bool _setMembersGroup(const uint64 guid, uint8 group);
bool _setMembersGroup(uint64 guid, uint8 group);
void _homebindIfInstance(Player* player);
void _initRaidSubGroupsCounter();
+12 -12
View File
@@ -1508,7 +1508,7 @@ void Guild::HandleRemoveMember(WorldSession* session, const std::string& name)
SendCommandResult(session, GUILD_QUIT_S, ERR_GUILD_RANK_TOO_HIGH_S, name);
else
{
const uint64 guid = pMember->GetGUID();
uint64 guid = pMember->GetGUID();
// After call to DeleteMember pointer to member becomes invalid
DeleteMember(guid, false, true);
_LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUIDLow(), GUID_LOPART(guid));
@@ -1790,7 +1790,7 @@ void Guild::SendBankTabText(WorldSession *session, uint8 tabId) const
void Guild::SendPermissions(WorldSession *session) const
{
const uint64 guid = session->GetPlayer()->GetGUID();
uint64 guid = session->GetPlayer()->GetGUID();
uint8 rankId = session->GetPlayer()->GetRank();
WorldPacket data(MSG_GUILD_PERMISSIONS, 4 * 15 + 1);
@@ -2063,7 +2063,7 @@ void Guild::BroadcastPacket(WorldPacket* packet) const
///////////////////////////////////////////////////////////////////////////////
// Members handling
bool Guild::AddMember(const uint64 guid, uint8 rankId)
bool Guild::AddMember(uint64 guid, uint8 rankId)
{
Player* player = ObjectAccessor::FindPlayer(guid);
// Player cannot be in guild
@@ -2132,7 +2132,7 @@ bool Guild::AddMember(const uint64 guid, uint8 rankId)
return true;
}
void Guild::DeleteMember(const uint64 guid, bool isDisbanding, bool isKicked)
void Guild::DeleteMember(uint64 guid, bool isDisbanding, bool isKicked)
{
uint32 lowguid = GUID_LOPART(guid);
Player* player = ObjectAccessor::FindPlayer(guid);
@@ -2188,7 +2188,7 @@ void Guild::DeleteMember(const uint64 guid, bool isDisbanding, bool isKicked)
_UpdateAccountsNumber();
}
bool Guild::ChangeMemberRank(const uint64 guid, uint8 newRank)
bool Guild::ChangeMemberRank(uint64 guid, uint8 newRank)
{
if (newRank <= _GetLowestRankId()) // Validate rank (allow only existing ranks)
if (Member* pMember = GetMember(guid))
@@ -2352,7 +2352,7 @@ void Guild::_DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB)
m_bankTabs.clear();
}
bool Guild::_ModifyBankMoney(SQLTransaction& trans, const uint64 amount, bool add)
bool Guild::_ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add)
{
if (add)
m_bankMoney += amount;
@@ -2448,21 +2448,21 @@ inline uint8 Guild::_GetRankBankTabRights(uint8 rankId, uint8 tabId) const
return 0;
}
inline uint32 Guild::_GetMemberRemainingSlots(const uint64 guid, uint8 tabId) const
inline uint32 Guild::_GetMemberRemainingSlots(uint64 guid, uint8 tabId) const
{
if (const Member* pMember = GetMember(guid))
return pMember->GetBankRemainingValue(tabId, this);
return 0;
}
inline uint32 Guild::_GetMemberRemainingMoney(const uint64 guid) const
inline uint32 Guild::_GetMemberRemainingMoney(uint64 guid) const
{
if (const Member* pMember = GetMember(guid))
return pMember->GetBankRemainingValue(GUILD_BANK_MAX_TABS, this);
return 0;
}
inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, const uint64 guid, uint8 tabId)
inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 guid, uint8 tabId)
{
// Remaining slots must be more then 0
if (uint32 remainingSlots = _GetMemberRemainingSlots(guid, tabId))
@@ -2472,7 +2472,7 @@ inline void Guild::_DecreaseMemberRemainingSlots(SQLTransaction& trans, const ui
pMember->DecreaseBankRemainingValue(trans, tabId, 1);
}
inline bool Guild::_MemberHasTabRights(const uint64 guid, uint8 tabId, uint32 rights) const
inline bool Guild::_MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const
{
if (const Member* pMember = GetMember(guid))
{
@@ -2632,7 +2632,7 @@ bool Guild::_DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError
void Guild::_SendBankContent(WorldSession *session, uint8 tabId) const
{
const uint64 guid = session->GetPlayer()->GetGUID();
uint64 guid = session->GetPlayer()->GetGUID();
if (_MemberHasTabRights(guid, tabId, GUILD_BANK_RIGHT_VIEW_TAB))
if (const BankTab* pTab = GetBankTab(tabId))
{
@@ -2726,7 +2726,7 @@ void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
}
}
void Guild::_BroadcastEvent(GuildEvents guildEvent, const uint64 guid, const char* param1, const char* param2, const char* param3) const
void Guild::_BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1, const char* param2, const char* param3) const
{
uint8 count = !param3 ? (!param2 ? (!param1 ? 0 : 1) : 2) : 3;
+13 -13
View File
@@ -257,7 +257,7 @@ private:
};
public:
Member(uint32 guildId, const uint64 guid, uint8 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { }
Member(uint32 guildId, uint64 guid, uint8 rankId) : m_guildId(guildId), m_guid(guid), m_logoutTime(::time(NULL)), m_rankId(rankId) { }
void SetStats(Player* player);
void SetStats(const std::string& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId);
@@ -280,7 +280,7 @@ private:
inline void UpdateLogoutTime() { m_logoutTime = ::time(NULL); }
inline bool IsRank(uint8 rankId) const { return m_rankId == rankId; }
inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
inline bool IsSamePlayer(const uint64 guid) const { return m_guid == guid; }
inline bool IsSamePlayer(uint64 guid) const { return m_guid == guid; }
void DecreaseBankRemainingValue(SQLTransaction& trans, uint8 tabId, uint32 amount);
uint32 GetBankRemainingValue(uint8 tabId, const Guild* guild) const;
@@ -656,9 +656,9 @@ public:
// Members
// Adds member to guild. If rankId == GUILD_RANK_NONE, lowest rank is assigned.
bool AddMember(const uint64 guid, uint8 rankId = GUILD_RANK_NONE);
void DeleteMember(const uint64 guid, bool isDisbanding = false, bool isKicked = false);
bool ChangeMemberRank(const uint64 guid, uint8 newRank);
bool AddMember(uint64 guid, uint8 rankId = GUILD_RANK_NONE);
void DeleteMember(uint64 guid, bool isDisbanding = false, bool isKicked = false);
bool ChangeMemberRank(uint64 guid, uint8 newRank);
// Bank
void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount);
@@ -698,12 +698,12 @@ private:
inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
inline const BankTab* GetBankTab(uint8 tabId) const { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
inline const Member* GetMember(const uint64 guid) const
inline const Member* GetMember(uint64 guid) const
{
Members::const_iterator itr = m_members.find(GUID_LOPART(guid));
return itr != m_members.end() ? itr->second : NULL;
}
inline Member* GetMember(const uint64 guid)
inline Member* GetMember(uint64 guid)
{
Members::iterator itr = m_members.find(GUID_LOPART(guid));
return itr != m_members.end() ? itr->second : NULL;
@@ -736,7 +736,7 @@ private:
void _UpdateAccountsNumber();
bool _IsLeader(Player* player) const;
void _DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB = false);
bool _ModifyBankMoney(SQLTransaction& trans, const uint64 amount, bool add);
bool _ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add);
void _SetLeaderGUID(Member* pLeader);
void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay);
@@ -747,10 +747,10 @@ private:
uint32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const;
std::string _GetRankName(uint8 rankId) const;
uint32 _GetMemberRemainingSlots(const uint64 guid, uint8 tabId) const;
uint32 _GetMemberRemainingMoney(const uint64 guid) const;
void _DecreaseMemberRemainingSlots(SQLTransaction& trans, const uint64 guid, uint8 tabId);
bool _MemberHasTabRights(const uint64 guid, uint8 tabId, uint32 rights) const;
uint32 _GetMemberRemainingSlots(uint64 guid, uint8 tabId) const;
uint32 _GetMemberRemainingMoney(uint64 guid) const;
void _DecreaseMemberRemainingSlots(SQLTransaction& trans, uint64 guid, uint8 tabId);
bool _MemberHasTabRights(uint64 guid, uint8 tabId, uint32 rights) const;
void _LogEvent(GuildEventLogTypes eventType, uint32 playerGuid1, uint32 playerGuid2 = 0, uint8 newRank = 0);
void _LogBankEvent(SQLTransaction& trans, GuildBankEventLogTypes eventType, uint8 tabId, uint32 playerGuid, uint32 itemOrMoney, uint16 itemStackCount = 0, uint8 destTabId = 0);
@@ -765,6 +765,6 @@ private:
void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
void _BroadcastEvent(GuildEvents guildEvent, const uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
void _BroadcastEvent(GuildEvents guildEvent, uint64 guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
};
#endif
+1 -1
View File
@@ -81,7 +81,7 @@ std::string GuildMgr::GetGuildNameById(uint32 guildId) const
return "";
}
Guild* GuildMgr::GetGuildByLeader(const uint64 guid) const
Guild* GuildMgr::GetGuildByLeader(uint64 guid) const
{
for (GuildContainer::const_iterator itr = GuildStore.begin(); itr != GuildStore.end(); ++itr)
if (itr->second->GetLeaderGUID() == guid)
+2 -1
View File
@@ -23,13 +23,14 @@
class GuildMgr
{
friend class ACE_Singleton<GuildMgr, ACE_Null_Mutex>;
private:
GuildMgr();
~GuildMgr();
public:
typedef UNORDERED_MAP<uint32, Guild*> GuildContainer;
Guild* GetGuildByLeader(uint64 const guid) const;
Guild* GetGuildByLeader(uint64 guid) const;
Guild* GetGuildById(uint32 guildId) const;
Guild* GetGuildByName(const std::string& guildName) const;
std::string GetGuildNameById(uint32 guildId) const;
@@ -770,7 +770,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
if (mask & GROUP_UPDATE_FLAG_AURAS)
{
const uint64 auramask = player->GetAuraUpdateMaskForRaid();
uint64 auramask = player->GetAuraUpdateMaskForRaid();
*data << uint64(auramask);
for (uint32 i = 0; i < MAX_AURAS; ++i)
{
@@ -860,7 +860,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
{
if (pet)
{
const uint64 auramask = pet->GetAuraUpdateMaskForRaid();
uint64 auramask = pet->GetAuraUpdateMaskForRaid();
*data << uint64(auramask);
for (uint32 i = 0; i < MAX_AURAS; ++i)
{
@@ -576,7 +576,6 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data)
for (Unit::ControlList::iterator itr = GetPlayer()->m_Controlled.begin(); itr != GetPlayer()->m_Controlled.end(); ++itr)
if ((*itr)->GetEntry() == pet->GetEntry())
(*itr)->GetCharmInfo()->ToggleCreatureAutocast(spellInfo, false);
}
}
@@ -295,12 +295,8 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data)
if (_player->m_mover != _player)
return;
GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid);
if (!obj)
return;
obj->Use(_player);
if (GameObject *obj = GetPlayer()->GetMap()->GetGameObject(guid))
obj->Use(_player);
}
void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket)
@@ -372,7 +372,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic
};
AuraEffect::AuraEffect(Aura * base, uint8 effIndex, int32 *baseAmount, Unit* caster):
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster):
m_base(base), m_spellInfo(base->GetSpellInfo()), m_effIndex(effIndex),
m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[m_effIndex].BasePoints),
m_canBeRecalculated(true), m_spellmod(NULL), m_isPeriodic(false),
+1 -1
View File
@@ -2319,7 +2319,7 @@ void UnitAura::FillTargetMap(std::map<Unit *, uint8> & targets, Unit* caster)
if (!GetUnitOwner()->HasUnitState(UNIT_STAT_ISOLATED))
{
switch(GetSpellInfo()->Effects[effIndex].Effect)
switch (GetSpellInfo()->Effects[effIndex].Effect)
{
case SPELL_EFFECT_APPLY_AREA_AURA_PARTY:
targetList.push_back(GetUnitOwner());
+3 -3
View File
@@ -175,9 +175,9 @@ class Aura
// Helpers for targets
ApplicationMap const & GetApplicationMap() {return m_applications;}
void GetApplicationList(std::list<AuraApplication*> & applicationList) const;
const AuraApplication * GetApplicationOfTarget (uint64 const guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
AuraApplication * GetApplicationOfTarget (uint64 const guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
bool IsAppliedOnTarget(uint64 const guid) const { return m_applications.find(guid) != m_applications.end(); }
const AuraApplication * GetApplicationOfTarget (uint64 guid) const { ApplicationMap::const_iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
AuraApplication * GetApplicationOfTarget (uint64 guid) { ApplicationMap::iterator itr = m_applications.find(guid); if (itr != m_applications.end()) return itr->second; return NULL; }
bool IsAppliedOnTarget(uint64 guid) const { return m_applications.find(guid) != m_applications.end(); }
void SetNeedClientUpdateForTargets() const;
void HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, bool apply, bool onReapply);
+13 -16
View File
@@ -551,8 +551,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
m_autoRepeat = m_spellInfo->IsAutoRepeatRangedSpell();
m_runesState = 0;
m_powerCost = 0; // setup to correct value in Spell::prepare, don't must be used before.
m_casttime = 0; // setup to correct value in Spell::prepare, don't must be used before.
m_powerCost = 0; // setup to correct value in Spell::prepare, must not be used before.
m_casttime = 0; // setup to correct value in Spell::prepare, must not be used before.
m_timer = 0; // will set to castime in prepare
m_channelTargetEffectMask = 0;
@@ -1237,18 +1237,16 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
}
// Do not take combo points on dodge and miss
if (m_needComboPoints && m_targets.GetUnitTargetGUID() == target->targetGUID)
if (missInfo != SPELL_MISS_NONE)
{
m_needComboPoints = false;
// Restore spell mods for a miss/dodge/parry Cold Blood
// TODO: check how broad this rule should be
if (m_caster->GetTypeId() == TYPEID_PLAYER)
if ((missInfo == SPELL_MISS_MISS) ||
(missInfo == SPELL_MISS_DODGE) ||
(missInfo == SPELL_MISS_PARRY))
m_caster->ToPlayer()->RestoreSpellMods(this, 14177);
}
if (missInfo != SPELL_MISS_NONE && m_needComboPoints &&
m_targets.GetUnitTargetGUID() == target->targetGUID)
{
m_needComboPoints = false;
// Restore spell mods for a miss/dodge/parry Cold Blood
// TODO: check how broad this rule should be
if (m_caster->GetTypeId() == TYPEID_PLAYER && (missInfo == SPELL_MISS_MISS ||
missInfo == SPELL_MISS_DODGE || missInfo == SPELL_MISS_PARRY))
m_caster->ToPlayer()->RestoreSpellMods(this, 14177);
}
// Trigger info was not filled in spell::preparedatafortriggersystem - we do it now
if (canEffectTrigger && !procAttacker && !procVictim)
@@ -1546,8 +1544,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool
((UnitAura*)m_spellAura)->SetDiminishGroup(m_diminishGroup);
bool positive = m_spellAura->GetSpellInfo()->IsPositive();
AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID());
if (aurApp)
if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID()))
positive = aurApp->IsPositive();
duration = m_originalCaster->ModSpellDuration(aurSpellInfo, unit, duration, positive);
+5 -5
View File
@@ -84,10 +84,10 @@ public:
bool IsClosed() const { return _closedBy; }
bool IsCompleted() const { return _completed; }
bool IsFromPlayer(const uint64 guid) const { return guid == _playerGuid; }
bool IsFromPlayer(uint64 guid) const { return guid == _playerGuid; }
bool IsAssigned() const { return _assignedTo != 0; }
bool IsAssignedTo(const uint64 guid) const { return guid == _assignedTo; }
bool IsAssignedNotTo(const uint64 guid) const { return IsAssigned() && !IsAssignedTo(guid); }
bool IsAssignedTo(uint64 guid) const { return guid == _assignedTo; }
bool IsAssignedNotTo(uint64 guid) const { return IsAssigned() && !IsAssignedTo(guid); }
uint32 GetId() const { return _id; }
Player* GetPlayer() const { return ObjectAccessor::FindPlayer(_playerGuid); }
@@ -108,7 +108,7 @@ public:
GMTicketEscalationStatus GetEscalatedStatus() const { return _escalatedStatus; }
void SetEscalatedStatus(GMTicketEscalationStatus escalatedStatus) { _escalatedStatus = escalatedStatus; }
void SetAssignedTo(const uint64 guid, bool isAdmin)
void SetAssignedTo(uint64 guid, bool isAdmin)
{
_assignedTo = guid;
if (isAdmin && _escalatedStatus == TICKET_IN_ESCALATION_QUEUE)
@@ -178,7 +178,7 @@ public:
return NULL;
}
GmTicket* GetTicketByPlayer(const uint64 playerGuid)
GmTicket* GetTicketByPlayer(uint64 playerGuid)
{
for (GmTicketList::const_iterator itr = _ticketList.begin(); itr != _ticketList.end(); ++itr)
if (itr->second && itr->second->IsFromPlayer(playerGuid) && !itr->second->IsClosed())
@@ -297,7 +297,7 @@ public:
uint64 prisonerGUID;
void SetGUID(const uint64 guid, int32 /*id*/)
void SetGUID(uint64 guid, int32 /*id*/)
{
if (!prisonerGUID)
prisonerGUID = guid;
@@ -883,7 +883,7 @@ public:
uint64 minerGUID;
void SetGUID(const uint64 guid, int32 /*id*/)
void SetGUID(uint64 guid, int32 /*id*/)
{
minerGUID = guid;
}
@@ -318,7 +318,7 @@ class boss_rimefang : public CreatureScript
_EnterEvadeMode();
}
void SetGUID(const uint64 guid, int32 type)
void SetGUID(uint64 guid, int32 type)
{
if (type == GUID_HOARFROST)
{
@@ -384,7 +384,7 @@ class player_overlord_brandAI : public PlayerAI
tyrannus = NULL;
}
void SetGUID(const uint64 guid, int32 /*type*/)
void SetGUID(uint64 guid, int32 /*type*/)
{
tyrannus = ObjectAccessor::GetCreature(*me, guid);
if (!tyrannus)
@@ -1176,7 +1176,7 @@ class npc_ball_of_flame : public CreatureScript
}
}
void SetGUID(uint64 const guid, int32 /*type*/)
void SetGUID(uint64 guid, int32 /*type*/)
{
_chaseGUID = guid;
}
@@ -257,7 +257,7 @@ class boss_blood_queen_lana_thel : public CreatureScript
Talk(SAY_KILL);
}
void SetGUID(uint64 const guid, int32 type = 0)
void SetGUID(uint64 guid, int32 type = 0)
{
switch (type)
{
@@ -549,7 +549,7 @@ class boss_lady_deathwhisper : public CreatureScript
summon->AI()->DoCast(summon, SPELL_TELEPORT_VISUAL);
}
void SetGUID(uint64 const guid, int32 id/* = 0*/)
void SetGUID(uint64 guid, int32 id/* = 0*/)
{
if (id != GUID_CULTIST)
return;
@@ -252,7 +252,7 @@ class boss_lord_marrowgar : public CreatureScript
return 0LL;
}
void SetGUID(uint64 const guid, int32 type/* = 0 */)
void SetGUID(uint64 guid, int32 type/* = 0 */)
{
if (type != DATA_COLDFLAME_GUID)
return;
@@ -523,7 +523,7 @@ class npc_ice_tomb : public CreatureScript
me->SetReactState(REACT_PASSIVE);
}
void SetGUID(uint64 const guid, int32 type/* = 0 */)
void SetGUID(uint64 guid, int32 type/* = 0 */)
{
if (type == DATA_TRAPPED_PLAYER)
{
@@ -971,7 +971,7 @@ class npc_crok_scourgebane : public CreatureScript
}
}
void SetGUID(uint64 const guid, int32 type/* = 0*/)
void SetGUID(uint64 guid, int32 type/* = 0*/)
{
if (type == ACTION_VRYKUL_DEATH)
{
@@ -163,7 +163,7 @@ public:
uint64 victimGUID;
void SetGUID(const uint64 guid, int32 /*param*/)
void SetGUID(uint64 guid, int32 /*param*/)
{
victimGUID = guid;
if (me->m_spells[0] && victimGUID)
@@ -157,7 +157,7 @@ public:
}
}
void SetGUID(uint64 const guid, int32 id/* = 0 */)
void SetGUID(uint64 guid, int32 id/* = 0 */)
{
if (id == DATA_INTENSE_COLD)
intenseColdList.push_back(guid);
@@ -2431,7 +2431,7 @@ public:
uiEventPhase = 1;
}
void SetGUID(const uint64 uiGuid, int32 /*iId*/)
void SetGUID(uint64 uiGuid, int32 /*iId*/)
{
uiPlayerGUID = uiGuid;
}
+1 -1
View File
@@ -361,7 +361,7 @@ public:
bRemoveFlag = false;
}
void SetGUID(const uint64 guid, int32 /*id*/)
void SetGUID(uint64 guid, int32 /*id*/)
{
uiPlayerGUID = guid;
}
+1 -1
View File
@@ -1088,7 +1088,7 @@ class spell_magic_eater_food : public SpellScriptLoader
{
PrepareAuraScript(spell_magic_eater_food_AuraScript);
void HandleTriggerSpell(AuraEffect const* aurEff)
void HandleTriggerSpell(AuraEffect const* /*aurEff*/)
{
PreventDefaultAction();
Unit* target = GetTarget();