diff options
| author | Shocker <shocker@freakz.ro> | 2011-04-29 22:24:26 +0300 |
|---|---|---|
| committer | Shocker <shocker@freakz.ro> | 2011-04-29 22:24:26 +0300 |
| commit | 0fb8f057974cdf3107084be65005956efb5191dc (patch) | |
| tree | 8fe211ecee643625c01ec3970038e345ec44c5f0 /src/server/game | |
| parent | f96e1ce1d7b10074750da761ff9b219a24d0f09f (diff) | |
| parent | 1b1d7507f1c3ea768f3fdaf4e1729b66fe590a68 (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore
Diffstat (limited to 'src/server/game')
195 files changed, 4567 insertions, 4567 deletions
diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 020c7819460..5cc6423698d 100755 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -269,7 +269,7 @@ AOEAI::AOEAI(Creature *c) : CreatureAI(c) me->SetVisible(true);//visible to see all spell anims me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//can't be targeted me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1);//can't be damaged - me->SetDisplayId(11686);//invisible model,around a size of a player + me->SetDisplayId(11686);//invisible model, around a size of a player } bool AOEAI::CanAIAttack(const Unit * /*who*/) const @@ -284,7 +284,7 @@ void AOEAI::AttackStart(Unit * /*who*/) void AOEAI::UpdateAI(const uint32 /*diff*/) { if (!me->HasAura(me->m_spells[0])) - me->CastSpell(me, me->m_spells[0],false); + me->CastSpell(me, me->m_spells[0], false); } ////////////// diff --git a/src/server/game/AI/CoreAI/GuardAI.cpp b/src/server/game/AI/CoreAI/GuardAI.cpp index ecff2d2a031..1ebc9e69078 100755 --- a/src/server/game/AI/CoreAI/GuardAI.cpp +++ b/src/server/game/AI/CoreAI/GuardAI.cpp @@ -62,7 +62,7 @@ void GuardAI::MoveInLineOfSight(Unit* unit) unit->isInAccessiblePlaceFor(me)) { float attackRadius = me->GetAttackDistance(unit); - if (me->IsWithinDistInMap(unit,attackRadius)) + if (me->IsWithinDistInMap(unit, attackRadius)) { //Need add code to let guard support player AttackStart(unit); diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index db6aa16910b..c43c1e143ae 100755 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -116,7 +116,7 @@ void PetAI::UpdateAI(const uint32 diff) HandleReturnMovement(); } else if (owner && !me->HasUnitState(UNIT_STAT_FOLLOW)) // no charm info and no victim - me->GetMotionMaster()->MoveFollow(owner,PET_FOLLOW_DIST, me->GetFollowAngle()); + me->GetMotionMaster()->MoveFollow(owner, PET_FOLLOW_DIST, me->GetFollowAngle()); if (!me->GetCharmInfo()) return; @@ -183,7 +183,7 @@ void PetAI::UpdateAI(const uint32 diff) bool spellUsed = false; for (std::set<uint64>::const_iterator tar = m_AllySet.begin(); tar != m_AllySet.end(); ++tar) { - Unit* Target = ObjectAccessor::GetUnit(*me,*tar); + Unit* Target = ObjectAccessor::GetUnit(*me, *tar); //only buff targets that are in combat, unless the spell can only be cast while out of combat if (!Target) @@ -352,12 +352,12 @@ void PetAI::HandleReturnMovement() // Return to previous position where stay was clicked if (!me->GetCharmInfo()->IsCommandAttack()) { - float x,y,z; + float x, y, z; me->GetCharmInfo()->GetStayPosition(x, y, z); me->GetCharmInfo()->SetIsReturning(true); me->GetMotionMaster()->Clear(); - me->GetMotionMaster()->MovePoint(me->GetGUIDLow(),x,y,z); + me->GetMotionMaster()->MovePoint(me->GetGUIDLow(), x, y, z); } } } @@ -389,7 +389,7 @@ void PetAI::DoAttack(Unit *target, bool chase) if (chase) { - if (me->Attack(target,true)) + if (me->Attack(target, true)) { me->GetCharmInfo()->SetIsAtStay(false); me->GetCharmInfo()->SetIsFollowing(false); @@ -403,7 +403,7 @@ void PetAI::DoAttack(Unit *target, bool chase) me->GetCharmInfo()->SetIsAtStay(true); me->GetCharmInfo()->SetIsFollowing(false); me->GetCharmInfo()->SetIsReturning(false); - me->Attack(target,true); + me->Attack(target, true); } } diff --git a/src/server/game/AI/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index 8d95a0260e4..6598ec7707a 100755 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -102,7 +102,7 @@ void UnitAI::DoAddAuraToAllHostilePlayers(uint32 spellid) std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) { - if (Unit *pTemp = Unit::GetUnit(*me,(*itr)->getUnitGuid())) + if (Unit *pTemp = Unit::GetUnit(*me, (*itr)->getUnitGuid())) if (pTemp->GetTypeId() == TYPEID_PLAYER) me->AddAura(spellid, pTemp); } @@ -117,7 +117,7 @@ void UnitAI::DoCastToAllHostilePlayers(uint32 spellid, bool triggered) std::list<HostileReference*>& threatlist = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) { - if (Unit *pTemp = Unit::GetUnit(*me,(*itr)->getUnitGuid())) + if (Unit *pTemp = Unit::GetUnit(*me, (*itr)->getUnitGuid())) if (pTemp->GetTypeId() == TYPEID_PLAYER) me->CastSpell(pTemp, spellid, triggered); } diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index e641c4fca6b..30a981cfef2 100755 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -27,14 +27,14 @@ template<class T> inline const T& RAND(const T& v1, const T& v2) { - return (urand(0,1)) ? v1 : v2; + return (urand(0, 1)) ? v1 : v2; } template<class T> inline const T& RAND(const T& v1, const T& v2, const T& v3) { - switch (urand(0,2)) + switch (urand(0, 2)) { default: case 0: return v1; @@ -47,7 +47,7 @@ template<class T> inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4) { - switch (urand(0,3)) + switch (urand(0, 3)) { default: case 0: return v1; @@ -61,7 +61,7 @@ template<class T> inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5) { - switch (urand(0,4)) + switch (urand(0, 4)) { default: case 0: return v1; @@ -76,7 +76,7 @@ template<class T> inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6) { - switch (urand(0,5)) + switch (urand(0, 5)) { default: case 0: return v1; @@ -92,7 +92,7 @@ template<class T> inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7) { - switch (urand(0,6)) + switch (urand(0, 6)) { default: case 0: return v1; @@ -109,7 +109,7 @@ template<class T> inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8) { - switch (urand(0,7)) + switch (urand(0, 7)) { default: case 0: return v1; @@ -128,7 +128,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9) { - switch (urand(0,8)) + switch (urand(0, 8)) { default: case 0: return v1; @@ -148,7 +148,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10) { - switch (urand(0,9)) + switch (urand(0, 9)) { default: case 0: return v1; @@ -169,7 +169,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10, const T& v11) { - switch (urand(0,10)) + switch (urand(0, 10)) { default: case 0: return v1; @@ -191,7 +191,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10, const T& v11, const T& v12) { - switch (urand(0,11)) + switch (urand(0, 11)) { default: case 0: return v1; @@ -214,7 +214,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10, const T& v11, const T& v12, const T& v13) { - switch (urand(0,12)) + switch (urand(0, 12)) { default: case 0: return v1; @@ -238,7 +238,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10, const T& v11, const T& v12, const T& v13, const T& v14) { - switch (urand(0,13)) + switch (urand(0, 13)) { default: case 0: return v1; @@ -263,7 +263,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10, const T& v11, const T& v12, const T& v13, const T& v14, const T& v15) { - switch (urand(0,14)) + switch (urand(0, 14)) { default: case 0: return v1; @@ -289,7 +289,7 @@ inline const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, const T& v6, const T& v7, const T& v8, const T& v9, const T& v10, const T& v11, const T& v12, const T& v13, const T& v14, const T& v15, const T& v16) { - switch (urand(0,15)) + switch (urand(0, 15)) { default: case 0: return v1; diff --git a/src/server/game/AI/EventAI/CreatureEventAI.cpp b/src/server/game/AI/EventAI/CreatureEventAI.cpp index 26adbe60c76..f201fb9eb31 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAI.cpp @@ -125,14 +125,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.timer.repeatMin,event.timer.repeatMax); + pHolder.UpdateRepeatTimer(me, event.timer.repeatMin, event.timer.repeatMax); break; case EVENT_T_TIMER_OOC: if (me->isInCombat()) return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.timer.repeatMin,event.timer.repeatMax); + pHolder.UpdateRepeatTimer(me, event.timer.repeatMin, event.timer.repeatMax); break; case EVENT_T_HP: { @@ -145,7 +145,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax); + pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } case EVENT_T_MANA: @@ -159,14 +159,14 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax); + pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } case EVENT_T_AGGRO: break; case EVENT_T_KILL: //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.kill.repeatMin,event.kill.repeatMax); + pHolder.UpdateRepeatTimer(me, event.kill.repeatMin, event.kill.repeatMax); break; case EVENT_T_DEATH: case EVENT_T_EVADE: @@ -175,15 +175,15 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction //Spell hit is special case, param1 and param2 handled within CreatureEventAI::SpellHit //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.spell_hit.repeatMin,event.spell_hit.repeatMax); + pHolder.UpdateRepeatTimer(me, event.spell_hit.repeatMin, event.spell_hit.repeatMax); break; case EVENT_T_RANGE: //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.range.repeatMin,event.range.repeatMax); + pHolder.UpdateRepeatTimer(me, event.range.repeatMin, event.range.repeatMax); break; case EVENT_T_OOC_LOS: //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.ooc_los.repeatMin,event.ooc_los.repeatMax); + pHolder.UpdateRepeatTimer(me, event.ooc_los.repeatMin, event.ooc_los.repeatMax); break; case EVENT_T_RESET: case EVENT_T_SPAWNED: @@ -199,7 +199,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax); + pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } case EVENT_T_TARGET_CASTING: @@ -207,7 +207,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.target_casting.repeatMin,event.target_casting.repeatMax); + pHolder.UpdateRepeatTimer(me, event.target_casting.repeatMin, event.target_casting.repeatMax); break; case EVENT_T_FRIENDLY_HP: { @@ -221,7 +221,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction pActionInvoker = pUnit; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.friendly_hp.repeatMin,event.friendly_hp.repeatMax); + pHolder.UpdateRepeatTimer(me, event.friendly_hp.repeatMin, event.friendly_hp.repeatMax); break; } case EVENT_T_FRIENDLY_IS_CC: @@ -240,7 +240,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction pActionInvoker = *(pList.begin()); //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.friendly_is_cc.repeatMin,event.friendly_is_cc.repeatMax); + pHolder.UpdateRepeatTimer(me, event.friendly_is_cc.repeatMin, event.friendly_is_cc.repeatMax); break; } case EVENT_T_FRIENDLY_MISSING_BUFF: @@ -256,7 +256,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction pActionInvoker = *(pList.begin()); //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.friendly_buff.repeatMin,event.friendly_buff.repeatMax); + pHolder.UpdateRepeatTimer(me, event.friendly_buff.repeatMin, event.friendly_buff.repeatMax); break; } case EVENT_T_SUMMONED_UNIT: @@ -270,7 +270,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.summon_unit.repeatMin,event.summon_unit.repeatMax); + pHolder.UpdateRepeatTimer(me, event.summon_unit.repeatMin, event.summon_unit.repeatMax); break; } case EVENT_T_TARGET_MANA: @@ -284,7 +284,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.percent_range.repeatMin,event.percent_range.repeatMax); + pHolder.UpdateRepeatTimer(me, event.percent_range.repeatMin, event.percent_range.repeatMax); break; } case EVENT_T_REACHED_HOME: @@ -299,7 +299,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.buffed.repeatMin,event.buffed.repeatMax); + pHolder.UpdateRepeatTimer(me, event.buffed.repeatMin, event.buffed.repeatMax); break; } case EVENT_T_TARGET_BUFFED: @@ -315,7 +315,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction return false; //Repeat Timers - pHolder.UpdateRepeatTimer(me,event.buffed.repeatMin,event.buffed.repeatMax); + pHolder.UpdateRepeatTimer(me, event.buffed.repeatMin, event.buffed.repeatMax); break; } default: @@ -353,8 +353,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 int32 temp = 0; if (action.text.TextId2 && action.text.TextId3) - temp = RAND(action.text.TextId1,action.text.TextId2,action.text.TextId3); - else if (action.text.TextId2 && urand(0,1)) + temp = RAND(action.text.TextId1, action.text.TextId2, action.text.TextId3); + else if (action.text.TextId2 && urand(0, 1)) temp = action.text.TextId2; else temp = action.text.TextId1; @@ -410,7 +410,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(action.morph.creatureId)) { - uint32 display_id = sObjectMgr->ChooseDisplayId(0,ci); + uint32 display_id = sObjectMgr->ChooseDisplayId(0, ci); me->SetDisplayId(display_id); } } @@ -527,7 +527,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid())) + if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid())) me->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent); break; } @@ -632,16 +632,16 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 case ACTION_T_QUEST_EVENT_ALL: if (pActionInvoker && pActionInvoker->GetTypeId() == TYPEID_PLAYER) { - if (Unit* Temp = Unit::GetUnit(*me,pActionInvoker->GetGUID())) + if (Unit* Temp = Unit::GetUnit(*me, pActionInvoker->GetGUID())) if (Temp->GetTypeId() == TYPEID_PLAYER) - Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId,me); + Temp->ToPlayer()->GroupEventHappens(action.quest_event_all.questId, me); } break; case ACTION_T_CAST_EVENT_ALL: { std::list<HostileReference*>& threatList = me->getThreatManager().getThreatList(); for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i) - if (Unit* Temp = Unit::GetUnit(*me,(*i)->getUnitGuid())) + if (Unit* Temp = Unit::GetUnit(*me, (*i)->getUnitGuid())) if (Temp->GetTypeId() == TYPEID_PLAYER) Temp->ToPlayer()->CastedCreatureOrGO(action.cast_event_all.creatureId, me->GetGUID(), action.cast_event_all.spellId); break; @@ -769,9 +769,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 // TRINITY ONLY case ACTION_T_MOVE_RANDOM_POINT: //dosen't work in combat { - float x,y,z; + float x, y, z; me->GetClosePoint(x, y, z, me->GetObjectSize() / 3, (float)action.raw.param1); - me->GetMotionMaster()->MovePoint(0,x,y,z); + me->GetMotionMaster()->MovePoint(0, x, y, z); break; } case ACTION_T_SET_STAND_STATE: @@ -796,8 +796,8 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { GameObject* pObject = NULL; - float x,y,z; - me->GetPosition(x,y,z); + float x, y, z; + me->GetPosition(x, y, z); pObject = me->SummonGameObject(action.raw.param1, x, y, z, 0, 0, 0, 0, 0, action.raw.param2); if (!pObject) { @@ -885,7 +885,7 @@ void CreatureEventAI::Reset() //Reset all out of combat timers case EVENT_T_TIMER_OOC: { - if ((*i).UpdateRepeatTimer(me,event.timer.initialMin,event.timer.initialMax)) + if ((*i).UpdateRepeatTimer(me, event.timer.initialMin, event.timer.initialMax)) (*i).Enabled = true; break; } @@ -985,7 +985,7 @@ void CreatureEventAI::EnterCombat(Unit *enemy) break; //Reset all in combat timers case EVENT_T_TIMER: - if ((*i).UpdateRepeatTimer(me,event.timer.initialMin,event.timer.initialMax)) + if ((*i).UpdateRepeatTimer(me, event.timer.initialMin, event.timer.initialMax)) (*i).Enabled = true; break; //All normal events need to be re-enabled and their time set to 0 @@ -1111,7 +1111,7 @@ void CreatureEventAI::UpdateAI(const uint32 diff) case EVENT_T_RANGE: if (me->getVictim()) if (me->IsInMap(me->getVictim())) - if (me->IsInRange(me->getVictim(),(float)(*i).Event.range.minDist,(float)(*i).Event.range.maxDist)) + if (me->IsInRange(me->getVictim(), (float)(*i).Event.range.minDist, (float)(*i).Event.range.maxDist)) ProcessEvent(*i); break; } @@ -1163,13 +1163,13 @@ inline Unit* CreatureEventAI::GetTargetByType(uint32 Target, Unit* pActionInvoke case TARGET_T_HOSTILE: return me->getVictim(); case TARGET_T_HOSTILE_SECOND_AGGRO: - return SelectTarget(SELECT_TARGET_TOPAGGRO,1); + return SelectTarget(SELECT_TARGET_TOPAGGRO, 1); case TARGET_T_HOSTILE_LAST_AGGRO: - return SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); + return SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); case TARGET_T_HOSTILE_RANDOM: - return SelectTarget(SELECT_TARGET_RANDOM,0); + return SelectTarget(SELECT_TARGET_RANDOM, 0); case TARGET_T_HOSTILE_RANDOM_NOT_TOP: - return SelectTarget(SELECT_TARGET_RANDOM,1); + return SelectTarget(SELECT_TARGET_RANDOM, 1); case TARGET_T_ACTION_INVOKER: return pActionInvoker; default: @@ -1236,13 +1236,13 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* { if (!pSource) { - sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.",textEntry); + sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i, invalid Source pointer.", textEntry); return; } if (textEntry >= 0) { - sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); + sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), textEntry); return; } @@ -1250,18 +1250,18 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* if (i == sEventAIMgr->GetCreatureEventAITextMap().end()) { - sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); + sLog->outErrorDb("CreatureEventAI: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), textEntry); return; } - sLog->outDebug(LOG_FILTER_DATABASE_AI, "CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); + sLog->outDebug(LOG_FILTER_DATABASE_AI, "CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", textEntry, (*i).second.SoundId, (*i).second.Type, (*i).second.Language, (*i).second.Emote); if ((*i).second.SoundId) { if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) pSource->PlayDirectSound((*i).second.SoundId); else - sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId); + sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.", textEntry, (*i).second.SoundId); } if ((*i).second.Emote) @@ -1271,7 +1271,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote); } else - sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry,pSource->GetTypeId()); + sLog->outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", textEntry, pSource->GetTypeId()); } switch((*i).second.Type) @@ -1329,7 +1329,7 @@ bool CreatureEventAI::CanCast(Unit* Target, SpellEntry const *Spell, bool Trigge return false; //Unit is out of range of this spell - if (!me->IsInRange(Target,TempRange->minRangeHostile,TempRange->maxRangeHostile)) + if (!me->IsInRange(Target, TempRange->minRangeHostile, TempRange->maxRangeHostile)) return false; return true; @@ -1389,7 +1389,7 @@ bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& e { // zone ID check uint32 zone, area; - me->GetZoneAndAreaId(zone,area); + me->GetZoneAndAreaId(zone, area); return zone == event.spawned.conditionValue1 || area == event.spawned.conditionValue1; } default: diff --git a/src/server/game/AI/EventAI/CreatureEventAI.h b/src/server/game/AI/EventAI/CreatureEventAI.h index 2f580f23f0e..7b8d3e04e9f 100755 --- a/src/server/game/AI/EventAI/CreatureEventAI.h +++ b/src/server/game/AI/EventAI/CreatureEventAI.h @@ -36,7 +36,7 @@ enum EventAI_Type EVENT_T_TIMER = 0, // InitialMin, InitialMax, RepeatMin, RepeatMax EVENT_T_TIMER_OOC = 1, // InitialMin, InitialMax, RepeatMin, RepeatMax EVENT_T_HP = 2, // HPMax%, HPMin%, RepeatMin, RepeatMax - EVENT_T_MANA = 3, // ManaMax%,ManaMin% RepeatMin, RepeatMax + EVENT_T_MANA = 3, // ManaMax%, ManaMin% RepeatMin, RepeatMax EVENT_T_AGGRO = 4, // NONE EVENT_T_KILL = 5, // RepeatMin, RepeatMax EVENT_T_DEATH = 6, // NONE @@ -105,9 +105,9 @@ enum EventAI_ActionType ACTION_T_DIE = 37, // No Params ACTION_T_ZONE_COMBAT_PULSE = 38, // No Params ACTION_T_CALL_FOR_HELP = 39, // Radius - ACTION_T_SET_SHEATH = 40, // Sheath (0-passive,1-melee,2-ranged) + ACTION_T_SET_SHEATH = 40, // Sheath (0-passive, 1-melee, 2-ranged) ACTION_T_FORCE_DESPAWN = 41, // No Params - ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat,1-percent from max health) + ACTION_T_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue, format(0-flat, 1-percent from max health) ACTION_T_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to unmount) ACTION_T_SET_PHASE_MASK = 97, diff --git a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp index 175fee02317..a4bb08bf905 100755 --- a/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp +++ b/src/server/game/AI/EventAI/CreatureEventAIMgr.cpp @@ -34,7 +34,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() m_CreatureEventAI_TextMap.clear(); // Load EventAI Text - sObjectMgr->LoadTrinityStrings("creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID); + sObjectMgr->LoadTrinityStrings("creature_ai_texts", MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID); // Gather Additional data from EventAI Texts QueryResult result = WorldDatabase.Query("SELECT entry, sound, type, language, emote FROM creature_ai_texts"); @@ -62,33 +62,33 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts() // range negative if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID) { - sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)",i,MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID); + sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)", i, MIN_CREATURE_AI_TEXT_STRING_ID, MAX_CREATURE_AI_TEXT_STRING_ID); continue; } // range negative (don't must be happen, loaded from same table) if (!sObjectMgr->GetTrinityStringLocale(i)) { - sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i); + sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found", i); continue; } if (temp.SoundId) { if (!sSoundEntriesStore.LookupEntry(temp.SoundId)) - sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.",i,temp.SoundId); + sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Sound %u but sound does not exist.", i, temp.SoundId); } if (!GetLanguageDescByID(temp.Language)) - sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.",i,temp.Language); + sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.", i, temp.Language); if (temp.Type > CHAT_TYPE_ZONE_YELL) - sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type); + sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.", i, temp.Type); if (temp.Emote) { if (!sEmotesStore.LookupEntry(temp.Emote)) - sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.",i,temp.Emote); + sLog->outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` has Emote %u but emote does not exist.", i, temp.Emote); } m_CreatureEventAI_TextMap[i] = temp; @@ -133,9 +133,9 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Summons() temp.orientation = fields[4].GetFloat(); temp.SpawnTimeSecs = fields[5].GetUInt32(); - if (!Trinity::IsValidMapCoord(temp.position_x,temp.position_y,temp.position_z,temp.orientation)) + if (!Trinity::IsValidMapCoord(temp.position_x, temp.position_y, temp.position_z, temp.orientation)) { - sLog->outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f,%f,%f,%f), skipping.", i,temp.position_x,temp.position_y,temp.position_z,temp.orientation); + sLog->outErrorDb("CreatureEventAI: Summon id %u have wrong coordinates (%f, %f, %f, %f), skipping.", i, temp.position_x, temp.position_y, temp.position_z, temp.orientation); continue; } @@ -189,7 +189,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() //Report any errors in event if (e_type >= EVENT_T_END) { - sLog->outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i,e_type); + sLog->outErrorDb("CreatureEventAI: Event %u have wrong type (%u), skipping.", i, e_type); continue; } temp.event_type = EventAI_Type(e_type); @@ -351,7 +351,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { if (!sEmotesTextStore.LookupEntry(temp.receive_emote.emoteId)) { - sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.",temp.creature_id, i, temp.receive_emote.emoteId); + sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param1 (EmoteTextId: %u) are not valid.", temp.creature_id, i, temp.receive_emote.emoteId); continue; } if (temp.receive_emote.condition) @@ -362,7 +362,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() cond.mConditionValue2 = temp.receive_emote.conditionValue2; if (!sConditionMgr->isConditionTypeValid(&cond)) { - sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition); + sLog->outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.", temp.creature_id, i, temp.receive_emote.condition); continue; } } @@ -462,7 +462,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { if (action.morph.creatureId) { - sLog->outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId,action.morph.creatureId); + sLog->outErrorDb("CreatureEventAI: Event %u Action %u have unused ModelId %u with also set creature id %u.", i, j+1, action.morph.modelId, action.morph.creatureId); action.morph.modelId = 0; } else if (!sCreatureDisplayInfoStore.LookupEntry(action.morph.modelId)) @@ -509,7 +509,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() { //output as debug for now, also because there's no general rule all spells have RecoveryTime if (temp.event_param3 < spell->RecoveryTime) - sLog->outDebug("CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1,action.cast.spellId, spell->RecoveryTime, temp.event_param3); + sLog->outDebug("CreatureEventAI: Event %u Action %u uses SpellID %u but cooldown is longer(%u) than minumum defined in event param3(%u).", i, j+1, action.cast.spellId, spell->RecoveryTime, temp.event_param3); } } */ @@ -618,7 +618,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() if (action.random_phase_range.phaseMin >= action.random_phase_range.phaseMax) { sLog->outErrorDb("CreatureEventAI: Event %u Action %u attempts to set phaseMax <= phaseMin.", i, j+1); - std::swap(action.random_phase_range.phaseMin,action.random_phase_range.phaseMax); + std::swap(action.random_phase_range.phaseMin, action.random_phase_range.phaseMax); // equal case processed at call } break; diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index d60e5defa33..55d340164ca 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -19,8 +19,8 @@ #define CAST_CRE(a) (SCRIPT_CAST_TYPE<Creature*>(a)) #define CAST_SUM(a) (SCRIPT_CAST_TYPE<TempSummon*>(a)) #define CAST_PET(a) (SCRIPT_CAST_TYPE<Pet*>(a)) -#define CAST_AI(a,b) (SCRIPT_CAST_TYPE<a*>(b)) -#define CAST_INST(a,b) (SCRIPT_CAST_TYPE<a*>(b)) +#define CAST_AI(a, b) (SCRIPT_CAST_TYPE<a*>(b)) +#define CAST_INST(a, b) (SCRIPT_CAST_TYPE<a*>(b)) #define GET_SPELL(a) (const_cast<SpellEntry*>(GetSpellStore()->LookupEntry(a))) diff --git a/src/server/game/AI/ScriptedAI/ScriptedGossip.h b/src/server/game/AI/ScriptedAI/ScriptedGossip.h index 3d05775c642..59943fa2c9c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedGossip.h +++ b/src/server/game/AI/ScriptedAI/ScriptedGossip.h @@ -79,11 +79,11 @@ enum eTradeskill // d - Action (identifys this Menu Item) // e - Text to be displayed in pop up box // f - Money value in pop up box -#define ADD_GOSSIP_ITEM(a,b,c,d) PlayerTalkClass->GetGossipMenu().AddMenuItem(a,b,c,d,"",0) -#define ADD_GOSSIP_ITEM_EXTENDED(a,b,c,d,e,f,g) PlayerTalkClass->GetGossipMenu().AddMenuItem(a,b,c,d,e,f,g) +#define ADD_GOSSIP_ITEM(a, b, c, d) PlayerTalkClass->GetGossipMenu().AddMenuItem(a, b, c, d, "", 0) +#define ADD_GOSSIP_ITEM_EXTENDED(a, b, c, d, e, f, g) PlayerTalkClass->GetGossipMenu().AddMenuItem(a, b, c, d, e, f, g) // This fuction Sends the current menu to show to client, a - NPCTEXTID(uint32) , b - npc guid(uint64) -#define SEND_GOSSIP_MENU(a,b) PlayerTalkClass->SendGossipMenu(a,b) +#define SEND_GOSSIP_MENU(a, b) PlayerTalkClass->SendGossipMenu(a, b) // Closes the Menu #define CLOSE_GOSSIP_MENU() PlayerTalkClass->CloseGossip() diff --git a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp index 5614d9f84e6..cb3f9aa8346 100755 --- a/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedSimpleAI.cpp @@ -54,7 +54,7 @@ SimpleAI::SimpleAI(Creature *c) : ScriptedAI(c) Kill_Spell = 0; Kill_Target_Type = 0; - memset(Spell,0,sizeof(Spell)); + memset(Spell, 0, sizeof(Spell)); EnterEvadeMode(); } @@ -97,7 +97,7 @@ void SimpleAI::EnterCombat(Unit *who) Spell_Timer[9] = Spell[9].First_Cast; else Spell_Timer[9] = 1000; - uint8 random_text = urand(0,2); + uint8 random_text = urand(0, 2); //Random text if (Aggro_TextId[random_text]) @@ -110,7 +110,7 @@ void SimpleAI::EnterCombat(Unit *who) void SimpleAI::KilledUnit(Unit *victim) { - uint8 random_text = urand(0,2); + uint8 random_text = urand(0, 2); //Random yell if (Kill_TextId[random_text]) @@ -134,13 +134,13 @@ void SimpleAI::KilledUnit(Unit *victim) pTarget = me->getVictim(); break; case CAST_HOSTILE_SECOND_AGGRO: - pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); break; case CAST_HOSTILE_LAST_AGGRO: - pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); + pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); break; case CAST_HOSTILE_RANDOM: - pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); break; case CAST_KILLEDUNIT_VICTIM: pTarget = victim; @@ -158,7 +158,7 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage) if (me->GetHealth() > damage) return; - uint8 random_text = urand(0,2); + uint8 random_text = urand(0, 2); //Random yell if (Death_TextId[random_text]) @@ -182,13 +182,13 @@ void SimpleAI::DamageTaken(Unit *killer, uint32 &damage) pTarget = me->getVictim(); break; case CAST_HOSTILE_SECOND_AGGRO: - pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); break; case CAST_HOSTILE_LAST_AGGRO: - pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); + pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); break; case CAST_HOSTILE_RANDOM: - pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); break; case CAST_JUSTDIED_KILLER: pTarget = killer; @@ -233,13 +233,13 @@ void SimpleAI::UpdateAI(const uint32 diff) pTarget = me->getVictim(); break; case CAST_HOSTILE_SECOND_AGGRO: - pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO,1); + pTarget = SelectTarget(SELECT_TARGET_TOPAGGRO, 1); break; case CAST_HOSTILE_LAST_AGGRO: - pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO,0); + pTarget = SelectTarget(SELECT_TARGET_BOTTOMAGGRO, 0); break; case CAST_HOSTILE_RANDOM: - pTarget = SelectTarget(SELECT_TARGET_RANDOM,0); + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0); break; } @@ -253,7 +253,7 @@ void SimpleAI::UpdateAI(const uint32 diff) //Yell and sound use the same number so that you can make //the Creature yell with the correct sound effect attached - uint8 random_text = urand(0,2); + uint8 random_text = urand(0, 2); //Random yell if (Spell[i].TextId[random_text]) diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index f6eea40eb4b..4221daeb821 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -344,7 +344,7 @@ void SmartAI::UpdateAI(const uint32 diff) { if (mFollowArrivedTimer < diff) { - if (me->FindNearestCreature(mFollowArrivedEntry,INTERACTION_DISTANCE, true)) + if (me->FindNearestCreature(mFollowArrivedEntry, INTERACTION_DISTANCE, true)) { if (Player* plr = me->GetPlayer(*me, mFollowGuid)) { @@ -744,7 +744,7 @@ void SmartAI::sQuestReward(Player* player, Quest const* quest, uint32 opt) bool SmartAI::sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex) { - GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT,caster,spellId,(uint32)effIndex); + GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT, caster, spellId, (uint32)effIndex); return true; } @@ -843,7 +843,7 @@ void SmartGameObjectAI::Reset() bool SmartGameObjectAI::GossipHello(Player* player) { sLog->outDebug(LOG_FILTER_DATABASE_AI, "SmartGameObjectAI::GossipHello"); - GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0 ,0 , false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_GOSSIP_HELLO, player, 0 , 0 , false, NULL, go); return false; } @@ -863,14 +863,14 @@ bool SmartGameObjectAI::GossipSelectCode(Player* /*player*/, uint32 /*sender*/, // Called when a player accepts a quest from the gameobject. bool SmartGameObjectAI::QuestAccept(Player* player, Quest const* quest) { - GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId() ,0 , false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_ACCEPTED_QUEST, player, quest->GetQuestId() , 0 , false, NULL, go); return false; } // Called when a player selects a quest reward. bool SmartGameObjectAI::QuestReward(Player* player, Quest const* quest, uint32 opt) { - GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId() ,opt , false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId() , opt , false, NULL, go); return false; } @@ -880,7 +880,7 @@ uint32 SmartGameObjectAI::GetDialogStatus(Player* /*player*/) { return 100; } // Called when the gameobject is destroyed (destructible buildings only). void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId) { - GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId ,0 , false, NULL, go); + GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId , 0 , false, NULL, go); } void SmartGameObjectAI::SetData(uint32 id, uint32 value) diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp index a9e0e03ebae..f63d433c278 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp @@ -56,7 +56,7 @@ void SmartWaypointMgr::LoadFromDB() Field* fields = result->Fetch(); uint32 entry = fields[0].GetUInt32(); uint32 id = fields[1].GetUInt32(); - float x,y,z; + float x, y, z; x = fields[2].GetFloat(); y = fields[3].GetFloat(); z = fields[4].GetFloat(); diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index bbd38df61d6..21cfb92a75a 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -88,13 +88,13 @@ enum SMART_EVENT SMART_EVENT_HEALT_PCT = 2, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax SMART_EVENT_MANA_PCT = 3, //1 // ManaMin%, ManaMax%, RepeatMin, RepeatMax SMART_EVENT_AGGRO = 4, //1 // NONE - SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1,playerOnly2,else creature entry3 + SMART_EVENT_KILL = 5, //1 // CooldownMin0, CooldownMax1, playerOnly2, else creature entry3 SMART_EVENT_DEATH = 6, //1 // NONE SMART_EVENT_EVADE = 7, //1 // NONE SMART_EVENT_SPELLHIT = 8, //1 // SpellID, School, CooldownMin, CooldownMax SMART_EVENT_RANGE = 9, //1 // MinDist, MaxDist, RepeatMin, RepeatMax SMART_EVENT_OOC_LOS = 10, //1 // NoHostile, MaxRnage, CooldownMin, CooldownMax - SMART_EVENT_RESPAWN = 11, //1 // type, MapId,ZoneId + SMART_EVENT_RESPAWN = 11, //1 // type, MapId, ZoneId SMART_EVENT_TARGET_HEALTH_PCT = 12, //1 // HPMin%, HPMax%, RepeatMin, RepeatMax SMART_EVENT_TARGET_CASTING = 13, //1 // RepeatMin, RepeatMax SMART_EVENT_FRIENDLY_HEALTH = 14, //1 // HPDeficit, Radius, RepeatMin, RepeatMax @@ -105,7 +105,7 @@ enum SMART_EVENT SMART_EVENT_ACCEPTED_QUEST = 19, //1 // QuestID(0any) SMART_EVENT_REWARD_QUEST = 20, //1 // QuestID(0any) SMART_EVENT_REACHED_HOME = 21, //1 // NONE - SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1,val2,val3 + SMART_EVENT_RECEIVE_EMOTE = 22, //1 // EmoteId, CooldownMin, CooldownMax, condition, val1, val2, val3 SMART_EVENT_HAS_AURA = 23, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax SMART_EVENT_TARGET_BUFFED = 24, //1 // Param1 = SpellID, Param2 = Number of Time STacked, Param3/4 RepeatMin, RepeatMax SMART_EVENT_RESET = 25, //1 // Called after combat, when the creature respawn and spawn. @@ -370,7 +370,7 @@ enum SMART_ACTION SMART_ACTION_ACTIVATE_GOBJECT = 9, // SMART_ACTION_RANDOM_EMOTE = 10, // EmoteId1, EmoteId2, EmoteId3... SMART_ACTION_CAST = 11, // SpellId, CastFlags - SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID,summonType, duration in ms, storageID, attackInvoker, + SMART_ACTION_SUMMON_CREATURE = 12, // CreatureID, summonType, duration in ms, storageID, attackInvoker, SMART_ACTION_THREAT_SINGLE_PCT = 13, // Threat% SMART_ACTION_THREAT_ALL_PCT = 14, // Threat% SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS = 15, // QuestID @@ -387,7 +387,7 @@ enum SMART_ACTION SMART_ACTION_CALL_GROUPEVENTHAPPENS = 26, // QuestID SMART_ACTION_CALL_CASTEDCREATUREORGO = 27, // CreatureId, SpellId SMART_ACTION_REMOVEAURASFROMSPELL = 28, // Spellid - SMART_ACTION_FOLLOW = 29, // Distance, Angle, EndCreatureEntry, credit, creditType (0monsterkill,1event) + SMART_ACTION_FOLLOW = 29, // Distance, Angle, EndCreatureEntry, credit, creditType (0monsterkill, 1event) SMART_ACTION_RANDOM_PHASE = 30, // PhaseId1, PhaseId2, PhaseId3... SMART_ACTION_RANDOM_PHASE_RANGE = 31, // PhaseMin, PhaseMax SMART_ACTION_RESET_GOBJECT = 32, // @@ -398,7 +398,7 @@ enum SMART_ACTION SMART_ACTION_DIE = 37, // No Params SMART_ACTION_SET_IN_COMBAT_WITH_ZONE = 38, // No Params SMART_ACTION_CALL_FOR_HELP = 39, // Radius - SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed,1-melee,2-ranged) + SMART_ACTION_SET_SHEATH = 40, // Sheath (0-unarmed, 1-melee, 2-ranged) SMART_ACTION_FORCE_DESPAWN = 41, // timer SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL = 42, // MinHpValue(+pct, -flat) SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL = 43, // Creature_template entry(param1) OR ModelId (param2) (or 0 for both to unmount) @@ -431,7 +431,7 @@ enum SMART_ACTION SMART_ACTION_PLAYMOVIE = 68, // entry SMART_ACTION_MOVE_TO_POS = 69, // xyz SMART_ACTION_RESPAWN_TARGET = 70, // - SMART_ACTION_EQUIP = 71, // entry, slotmask slot1,slot2,slot3 ,only slots with mask set will be sent to client, bits are 1,2,4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set + SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set SMART_ACTION_CLOSE_GOSSIP = 72, // none SMART_ACTION_TRIGGER_TIMED_EVENT = 73, // id(>1) SMART_ACTION_REMOVE_TIMED_EVENT = 74, // id(>1) @@ -903,7 +903,7 @@ struct SmartTarget raw.param3 = p3; } SMARTAI_TARGETS type; - float x,y,z,o; + float x, y, z, o; union { struct @@ -993,16 +993,16 @@ enum eSmartAI enum SmartScriptType { - SMART_SCRIPT_TYPE_CREATURE = 0,//done - SMART_SCRIPT_TYPE_GAMEOBJECT = 1,//done - SMART_SCRIPT_TYPE_AREATRIGGER = 2,//done - SMART_SCRIPT_TYPE_EVENT = 3,// - SMART_SCRIPT_TYPE_GOSSIP = 4,// - SMART_SCRIPT_TYPE_QUEST = 5,// - SMART_SCRIPT_TYPE_SPELL = 6,// - SMART_SCRIPT_TYPE_TRANSPORT = 7,// - SMART_SCRIPT_TYPE_INSTANCE = 8,// - SMART_SCRIPT_TYPE_TIMED_ACTIONLIST = 9,// + SMART_SCRIPT_TYPE_CREATURE = 0, //done + SMART_SCRIPT_TYPE_GAMEOBJECT = 1, //done + SMART_SCRIPT_TYPE_AREATRIGGER = 2, //done + SMART_SCRIPT_TYPE_EVENT = 3, // + SMART_SCRIPT_TYPE_GOSSIP = 4, // + SMART_SCRIPT_TYPE_QUEST = 5, // + SMART_SCRIPT_TYPE_SPELL = 6, // + SMART_SCRIPT_TYPE_TRANSPORT = 7, // + SMART_SCRIPT_TYPE_INSTANCE = 8, // + SMART_SCRIPT_TYPE_TIMED_ACTIONLIST = 9, // SMART_SCRIPT_TYPE_MAX = 10 }; diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index cf1fb265c30..614400af21f 100755 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -39,8 +39,8 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass return AOR_NAME_ALREDY_EXIST; // username does already exist } - LoginDatabase.PExecute("INSERT INTO account(username,sha_pass_hash,joindate) VALUES('%s','%s',NOW())", username.c_str(), CalculateShaPassHash(username, password).c_str()); - LoginDatabase.Execute("INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist,account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL"); + LoginDatabase.PExecute("INSERT INTO account(username, sha_pass_hash, joindate) VALUES('%s', '%s', NOW())", username.c_str(), CalculateShaPassHash(username, password).c_str()); + LoginDatabase.Execute("INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL"); return AOR_OK; // everything's fine } @@ -52,7 +52,7 @@ AccountOpResult AccountMgr::DeleteAccount(uint32 accid) return AOR_NAME_NOT_EXIST; // account doesn't exist // existed characters list - result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'",accid); + result = CharacterDatabase.PQuery("SELECT guid FROM characters WHERE account='%d'", accid); if (result) { do @@ -110,7 +110,7 @@ AccountOpResult AccountMgr::ChangeUsername(uint32 accid, std::string new_uname, std::string safe_new_uname = new_uname; LoginDatabase.escape_string(safe_new_uname); - LoginDatabase.PExecute("UPDATE account SET v='0',s='0',username='%s',sha_pass_hash='%s' WHERE id='%d'", safe_new_uname.c_str(), + LoginDatabase.PExecute("UPDATE account SET v='0', s='0', username='%s', sha_pass_hash='%s' WHERE id='%d'", safe_new_uname.c_str(), CalculateShaPassHash(new_uname, new_passwd).c_str(), accid); return AOR_OK; @@ -221,7 +221,7 @@ bool AccountMgr::normalizeString(std::string& utf8str) wchar_t wstr_buf[MAX_ACCOUNT_STR+1]; size_t wstr_len = MAX_ACCOUNT_STR; - if (!Utf8toWStr(utf8str,wstr_buf,wstr_len)) + if (!Utf8toWStr(utf8str, wstr_buf, wstr_len)) return false; #ifdef _MSC_VER #pragma warning(disable: 4996) @@ -231,7 +231,7 @@ bool AccountMgr::normalizeString(std::string& utf8str) #pragma warning(default: 4996) #endif - return WStrToUtf8(wstr_buf,wstr_len,utf8str); + return WStrToUtf8(wstr_buf, wstr_len, utf8str); } std::string AccountMgr::CalculateShaPassHash(std::string& name, std::string& password) diff --git a/src/server/game/Achievements/AchievementMgr.cpp b/src/server/game/Achievements/AchievementMgr.cpp index 1c12b88ab3d..4a8b2cf14aa 100755 --- a/src/server/game/Achievements/AchievementMgr.cpp +++ b/src/server/game/Achievements/AchievementMgr.cpp @@ -48,7 +48,7 @@ namespace Trinity : i_player(pl), i_msgtype(msgtype), i_textId(textId), i_achievementId(ach_id) {} void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx); data << uint8(i_msgtype); data << uint32(LANG_UNIVERSAL); @@ -73,7 +73,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) { if (dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE) { - sLog->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID,dataType); + sLog->outErrorDb("Table `achievement_criteria_data` for criteria (Entry: %u) has wrong data type (%u), ignored.", criteria->ID, dataType); return false; } @@ -113,7 +113,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!creature.id || !sObjectMgr->GetCreatureTemplate(creature.id)) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing creature id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,creature.id); + criteria->ID, criteria->requiredType, dataType, creature.id); return false; } return true; @@ -121,19 +121,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!classRace.class_id && !classRace.race_id) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_CLASS_RACE (%u) must not have 0 in either value field, ignored.", - criteria->ID, criteria->requiredType,dataType); + criteria->ID, criteria->requiredType, dataType); return false; } if (classRace.class_id && ((1 << (classRace.class_id-1)) & CLASSMASK_ALL_PLAYABLE) == 0) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing class in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,classRace.class_id); + criteria->ID, criteria->requiredType, dataType, classRace.class_id); return false; } if (classRace.race_id && ((1 << (classRace.race_id-1)) & RACEMASK_ALL_PLAYABLE) == 0) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_CREATURE (%u) has non-existing race in value2 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,classRace.race_id); + criteria->ID, criteria->requiredType, dataType, classRace.race_id); return false; } return true; @@ -141,7 +141,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (health.percent < 1 || health.percent > 100) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_PLAYER_LESS_HEALTH (%u) has wrong percent value in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,health.percent); + criteria->ID, criteria->requiredType, dataType, health.percent); return false; } return true; @@ -149,7 +149,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (player_dead.own_team_flag > 1) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_PLAYER_DEAD (%u) has wrong boolean value1 (%u).", - criteria->ID, criteria->requiredType,dataType,player_dead.own_team_flag); + criteria->ID, criteria->requiredType, dataType, player_dead.own_team_flag); return false; } return true; @@ -160,19 +160,19 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!spellEntry) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id); + criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id); return false; } if (aura.effect_idx >= 3) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has wrong spell effect index in value2 (%u), ignored.", - criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.effect_idx); + criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.effect_idx); return false; } if (!spellEntry->EffectApplyAuraName[aura.effect_idx]) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type %s (%u) has non-aura spell effect (ID: %u Effect: %u), ignores.", - criteria->ID, criteria->requiredType,(dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"),dataType,aura.spell_id,aura.effect_idx); + criteria->ID, criteria->requiredType, (dataType == ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA?"ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA":"ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA"), dataType, aura.spell_id, aura.effect_idx); return false; } return true; @@ -181,7 +181,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!GetAreaEntryByAreaID(area.id)) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA (%u) has wrong area id in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,area.id); + criteria->ID, criteria->requiredType, dataType, area.id); return false; } return true; @@ -189,7 +189,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (level.minlevel > STRONG_MAX_LEVEL) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL (%u) has wrong minlevel in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,level.minlevel); + criteria->ID, criteria->requiredType, dataType, level.minlevel); return false; } return true; @@ -197,7 +197,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (gender.gender > GENDER_NONE) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER (%u) has wrong gender in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,gender.gender); + criteria->ID, criteria->requiredType, dataType, gender.gender); return false; } return true; @@ -213,7 +213,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (difficulty.difficulty >= MAX_DIFFICULTY) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY (%u) has wrong difficulty in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,difficulty.difficulty); + criteria->ID, criteria->requiredType, dataType, difficulty.difficulty); return false; } return true; @@ -221,7 +221,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (map_players.maxcount <= 0) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT (%u) has wrong max players count in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,map_players.maxcount); + criteria->ID, criteria->requiredType, dataType, map_players.maxcount); return false; } return true; @@ -229,7 +229,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (team.team != ALLIANCE && team.team != HORDE) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM (%u) has unknown team in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,team.team); + criteria->ID, criteria->requiredType, dataType, team.team); return false; } return true; @@ -237,7 +237,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (drunk.state >= MAX_DRUNKEN) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK (%u) has unknown drunken state in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,drunk.state); + criteria->ID, criteria->requiredType, dataType, drunk.state); return false; } return true; @@ -245,7 +245,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (!sHolidaysStore.LookupEntry(holiday.id)) { sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) for data type ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY (%u) has unknown holiday in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,holiday.id); + criteria->ID, criteria->requiredType, dataType, holiday.id); return false; } return true; @@ -255,7 +255,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) if (equipped_item.item_quality >= MAX_ITEM_QUALITY) { sLog->outErrorDb("Table `achievement_criteria_requirement` (Entry: %u Type: %u) for requirement ACHIEVEMENT_CRITERIA_REQUIRE_S_EQUIPED_ITEM (%u) has unknown quality state in value1 (%u), ignored.", - criteria->ID, criteria->requiredType,dataType,equipped_item.item_quality); + criteria->ID, criteria->requiredType, dataType, equipped_item.item_quality); return false; } return true; @@ -268,7 +268,7 @@ bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria) } return true; default: - sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType,dataType); + sLog->outErrorDb("Table `achievement_criteria_data` (Entry: %u Type: %u) has data for non-supported data type (%u), ignored.", criteria->ID, criteria->requiredType, dataType); return false; } } @@ -303,15 +303,15 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un return (player->GetTeam() == source->GetTeam()) == (player_dead.own_team_flag != 0); return false; case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AURA: - return source->HasAuraEffect(aura.spell_id,aura.effect_idx); + return source->HasAuraEffect(aura.spell_id, aura.effect_idx); case ACHIEVEMENT_CRITERIA_DATA_TYPE_S_AREA: { - uint32 zone_id,area_id; - source->GetZoneAndAreaId(zone_id,area_id); + uint32 zone_id, area_id; + source->GetZoneAndAreaId(zone_id, area_id); return area.id == zone_id || area.id == area_id; } case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA: - return target && target->HasAuraEffect(aura.spell_id,aura.effect_idx); + return target && target->HasAuraEffect(aura.spell_id, aura.effect_idx); case ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE: return miscvalue1 >= value.minvalue; case ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL: @@ -341,7 +341,7 @@ bool AchievementCriteriaData::Meets(uint32 criteria_id, Player const* source, Un Battleground* bg = source->GetBattleground(); if (!bg) return false; - return bg->IsTeamScoreInRange(source->GetTeam() == ALLIANCE ? HORDE : ALLIANCE,bg_loss_team_score.min_score,bg_loss_team_score.max_score); + return bg->IsTeamScoreInRange(source->GetTeam() == ALLIANCE ? HORDE : ALLIANCE, bg_loss_team_score.min_score, bg_loss_team_score.max_score); } case ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT: { @@ -400,14 +400,14 @@ void AchievementMgr::Reset() { for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter != m_completedAchievements.end(); ++iter) { - WorldPacket data(SMSG_ACHIEVEMENT_DELETED,4); + WorldPacket data(SMSG_ACHIEVEMENT_DELETED, 4); data << uint32(iter->first); m_player->SendDirectMessage(&data); } for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter != m_criteriaProgress.end(); ++iter) { - WorldPacket data(SMSG_CRITERIA_DELETED,4); + WorldPacket data(SMSG_CRITERIA_DELETED, 4); data << uint32(iter->first); m_player->SendDirectMessage(&data); } @@ -454,8 +454,8 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin void AchievementMgr::DeleteFromDB(uint32 lowguid) { SQLTransaction trans = CharacterDatabase.BeginTransaction(); - trans->PAppend("DELETE FROM character_achievement WHERE guid = %u",lowguid); - trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u",lowguid); + trans->PAppend("DELETE FROM character_achievement WHERE guid = %u", lowguid); + trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u", lowguid); CharacterDatabase.CommitTransaction(trans); } @@ -606,8 +606,8 @@ void AchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, PreparedQ if (!criteria) { // we will remove not existed criteria for all characters - sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.",id); - CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u",id); + sLog->outError("Non-existing achievement criteria %u data removed from table `character_achievement_progress`.", id); + CharacterDatabase.PExecute("DELETE FROM character_achievement_progress WHERE criteria = %u", id); continue; } @@ -637,9 +637,9 @@ void AchievementMgr::SendAchievementEarned(AchievementEntry const* achievement) if (Guild* guild = sObjectMgr->GetGuildById(GetPlayer()->GetGuildId())) { - Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED,achievement->ID); + Trinity::AchievementChatBuilder say_builder(*GetPlayer(), CHAT_MSG_GUILD_ACHIEVEMENT, LANG_ACHIEVEMENT_EARNED, achievement->ID); Trinity::LocalizedPacketDo<Trinity::AchievementChatBuilder> say_do(say_builder); - guild->BroadcastWorker(say_do,GetPlayer()); + guild->BroadcastWorker(say_do, GetPlayer()); } if (achievement->flags & (ACHIEVEMENT_FLAG_REALM_FIRST_KILL|ACHIEVEMENT_FLAG_REALM_FIRST_REACH)) @@ -708,7 +708,7 @@ void AchievementMgr::CheckAllAchievementCriteria() static const uint32 achievIdByArenaSlot[MAX_ARENA_SLOT] = { 1057, 1107, 1108 }; static const uint32 achievIdForDungeon[][4] = { - // ach_cr_id,is_dungeon,is_raid,is_heroic_dungeon + // ach_cr_id, is_dungeon, is_raid, is_heroic_dungeon { 321, true, true, true }, { 916, false, true, false }, { 917, false, true, false }, @@ -798,7 +798,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit)) + if (!data || !data->Meets(GetPlayer(), unit)) continue; SetCriteriaProgress(achievementCriteria, miscValue1, PROGRESS_ACCUMULATE); @@ -814,7 +814,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit)) + if (!data || !data->Meets(GetPlayer(), unit)) continue; SetCriteriaProgress(achievementCriteria, miscValue2, PROGRESS_ACCUMULATE); @@ -1008,7 +1008,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit)) + if (!data || !data->Meets(GetPlayer(), unit)) continue; // miscvalue1 is the ingame fallheight*100 as stored in dbc @@ -1050,7 +1050,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit)) + if (!data || !data->Meets(GetPlayer(), unit)) continue; break; } @@ -1072,7 +1072,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!data) continue; - if (!data->Meets(GetPlayer(),unit)) + if (!data->Meets(GetPlayer(), unit)) continue; SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); @@ -1089,7 +1089,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!data) continue; - if (!data->Meets(GetPlayer(),unit)) + if (!data->Meets(GetPlayer(), unit)) continue; SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE); @@ -1116,7 +1116,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit)) + if (!data || !data->Meets(GetPlayer(), unit)) continue; } @@ -1139,7 +1139,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit,miscValue1)) + if (!data || !data->Meets(GetPlayer(), unit, miscValue1)) { // reset the progress as we have a win without the requirement. SetCriteriaProgress(achievementCriteria, 0); @@ -1275,7 +1275,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui { // those requirements couldn't be found in the dbc AchievementCriteriaDataSet const* data = sAchievementMgr->GetCriteriaDataSet(achievementCriteria); - if (!data || !data->Meets(GetPlayer(),unit)) + if (!data || !data->Meets(GetPlayer(), unit)) continue; } @@ -1359,7 +1359,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if (!data) continue; - if (!data->Meets(GetPlayer(),unit)) + if (!data->Meets(GetPlayer(), unit)) continue; } @@ -1763,7 +1763,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) { AchievementCriteriaEntry const* criteria = *itr; - bool completed = IsCompletedCriteria(criteria,entry); + bool completed = IsCompletedCriteria(criteria, entry); // found an uncompleted criteria, but DONT return false yet - there might be a completed criteria with ACHIEVEMENT_CRITERIA_COMPLETE_FLAG_ALL if (completed) @@ -1867,7 +1867,7 @@ void AchievementMgr::RemoveCriteriaProgress(const AchievementCriteriaEntry *entr if (criteriaProgress == m_criteriaProgress.end()) return; - WorldPacket data(SMSG_CRITERIA_DELETED,4); + WorldPacket data(SMSG_CRITERIA_DELETED, 4); data << uint32(entry->ID); m_player->SendDirectMessage(&data); @@ -1978,7 +1978,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, b // mail if (reward->sender) { - Item* item = reward->itemId ? Item::CreateItem(reward->itemId,1,GetPlayer ()) : NULL; + Item* item = reward->itemId ? Item::CreateItem(reward->itemId, 1, GetPlayer ()) : NULL; int loc_idx = GetPlayer()->GetSession()->GetSessionDbLocaleIndex(); @@ -2128,7 +2128,7 @@ void AchievementGlobalMgr::LoadAchievementCriteriaList() m_AchievementCriteriasByTimedType[criteria->timedType].push_back(criteria); } - sLog->outString(">> Loaded %lu achievement criteria in %u ms",(unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %lu achievement criteria in %u ms", (unsigned long)m_AchievementCriteriasByType->size(), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -2156,7 +2156,7 @@ void AchievementGlobalMgr::LoadAchievementReferenceList() ++count; } - sLog->outString(">> Loaded %u achievement references in %u ms",count, GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %u achievement references in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -2323,15 +2323,15 @@ void AchievementGlobalMgr::LoadCompletedAchievements() if (!sAchievementStore.LookupEntry(achievement_id)) { // we will remove not existed achievement for all characters - sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.",achievement_id); - CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u",achievement_id); + sLog->outError("Non-existing achievement %u data removed from table `character_achievement`.", achievement_id); + CharacterDatabase.PExecute("DELETE FROM character_achievement WHERE achievement = %u", achievement_id); continue; } m_allCompletedAchievements.insert(achievement_id); } while (result->NextRow()); - sLog->outString(">> Loaded %lu completed achievements in %u ms",(unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); + sLog->outString(">> Loaded %lu completed achievements in %u ms", (unsigned long)m_allCompletedAchievements.size(), GetMSTimeDiffToNow(oldMSTime)); sLog->outString(); } @@ -2449,8 +2449,8 @@ void AchievementGlobalMgr::LoadRewardLocales() m_achievementRewardLocales.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry,subject_loc1,text_loc1,subject_loc2,text_loc2,subject_loc3,text_loc3,subject_loc4,text_loc4," - "subject_loc5,text_loc5,subject_loc6,text_loc6,subject_loc7,text_loc7,subject_loc8,text_loc8" + QueryResult result = WorldDatabase.Query("SELECT entry, subject_loc1, text_loc1, subject_loc2, text_loc2, subject_loc3, text_loc3, subject_loc4, text_loc4, " + "subject_loc5, text_loc5, subject_loc6, text_loc6, subject_loc7, text_loc7, subject_loc8, text_loc8" " FROM locales_achievement_reward"); if (!result) diff --git a/src/server/game/Achievements/AchievementMgr.h b/src/server/game/Achievements/AchievementMgr.h index 92a4d2e3b74..3456e31d86c 100755 --- a/src/server/game/Achievements/AchievementMgr.h +++ b/src/server/game/Achievements/AchievementMgr.h @@ -30,8 +30,8 @@ typedef std::list<AchievementCriteriaEntry const*> AchievementCriteriaEntryList; typedef std::list<AchievementEntry const*> AchievementEntryList; -typedef std::map<uint32,AchievementCriteriaEntryList> AchievementCriteriaListByAchievement; -typedef std::map<uint32,AchievementEntryList> AchievementListByReferencedId; +typedef std::map<uint32, AchievementCriteriaEntryList> AchievementCriteriaListByAchievement; +typedef std::map<uint32, AchievementEntryList> AchievementListByReferencedId; struct CriteriaProgress { @@ -52,17 +52,17 @@ enum AchievementCriteriaDataType ACHIEVEMENT_CRITERIA_DATA_TYPE_T_AURA = 7, // spell_id effect_idx ACHIEVEMENT_CRITERIA_DATA_TYPE_VALUE = 8, // minvalue value provided with achievement update must be not less that limit ACHIEVEMENT_CRITERIA_DATA_TYPE_T_LEVEL = 9, // minlevel minlevel of target - ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10,// gender 0=male; 1=female - ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11,// scripted requirement - ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12,// difficulty normal/heroic difficulty for current event map - ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13,// count "with less than %u people in the zone" - ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14,// team HORDE(67), ALLIANCE(469) - ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15,// drunken_state 0 (enum DrunkenState) of player - ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16,// holiday_id 0 event in holiday time - ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17,// min_score max_score player's team win bg and opposition team have team score in range - ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18,// 0 0 maker instance script call for check current criteria requirements fit - ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19,// item_level item_quality for equipped item in slot to check item level and quality - ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20,// map_id 0 player must be on map with id in map_id + ACHIEVEMENT_CRITERIA_DATA_TYPE_T_GENDER = 10, // gender 0=male; 1=female + ACHIEVEMENT_CRITERIA_DATA_TYPE_SCRIPT = 11, // scripted requirement + ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_DIFFICULTY = 12, // difficulty normal/heroic difficulty for current event map + ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_PLAYER_COUNT = 13, // count "with less than %u people in the zone" + ACHIEVEMENT_CRITERIA_DATA_TYPE_T_TEAM = 14, // team HORDE(67), ALLIANCE(469) + ACHIEVEMENT_CRITERIA_DATA_TYPE_S_DRUNK = 15, // drunken_state 0 (enum DrunkenState) of player + ACHIEVEMENT_CRITERIA_DATA_TYPE_HOLIDAY = 16, // holiday_id 0 event in holiday time + ACHIEVEMENT_CRITERIA_DATA_TYPE_BG_LOSS_TEAM_SCORE = 17, // min_score max_score player's team win bg and opposition team have team score in range + ACHIEVEMENT_CRITERIA_DATA_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check current criteria requirements fit + ACHIEVEMENT_CRITERIA_DATA_TYPE_S_EQUIPED_ITEM = 19, // item_level item_quality for equipped item in slot to check item level and quality + ACHIEVEMENT_CRITERIA_DATA_TYPE_MAP_ID = 20, // map_id 0 player must be on map with id in map_id }; #define MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE 21 // maximum value in AchievementCriteriaDataType enum @@ -207,7 +207,7 @@ struct AchievementCriteriaDataSet Storage storage; }; -typedef std::map<uint32,AchievementCriteriaDataSet> AchievementCriteriaDataMap; +typedef std::map<uint32, AchievementCriteriaDataSet> AchievementCriteriaDataMap; struct AchievementReward { @@ -218,7 +218,7 @@ struct AchievementReward std::string text; }; -typedef std::map<uint32,AchievementReward> AchievementRewards; +typedef std::map<uint32, AchievementReward> AchievementRewards; struct AchievementRewardLocale { @@ -226,7 +226,7 @@ struct AchievementRewardLocale StringVector text; }; -typedef std::map<uint32,AchievementRewardLocale> AchievementRewardLocales; +typedef std::map<uint32, AchievementRewardLocale> AchievementRewardLocales; struct CompletedAchievementData { diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index ef3db81758c..ffffeaeac43 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -114,20 +114,20 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& if (bidder_security > SEC_PLAYER) // not do redundant DB requests { - if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid,bidder_name)) + if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid, bidder_name)) bidder_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } } if (bidder_security > SEC_PLAYER) { std::string owner_name; - if (!sObjectMgr->GetPlayerNameByGUID(auction->owner,owner_name)) + if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, owner_name)) owner_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); uint32 owner_accid = sObjectMgr->GetPlayerAccountIdByGUID(auction->owner); - sLog->outCommand(bidder_accId,"GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", - bidder_name.c_str(),bidder_accId,pItem->GetTemplate()->Name1.c_str(),pItem->GetEntry(),pItem->GetCount(),auction->bid,owner_name.c_str(),owner_accid); + sLog->outCommand(bidder_accId, "GM %s (Account: %u) won item in auction: %s (Entry: %u Count: %u) and pay money: %u. Original owner %s (Account: %u)", + bidder_name.c_str(), bidder_accId, pItem->GetTemplate()->Name1.c_str(), pItem->GetEntry(), pItem->GetCount(), auction->bid, owner_name.c_str(), owner_accid); } } @@ -159,7 +159,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction& MailDraft(msgAuctionWonSubject.str(), msgAuctionWonBody.str()) .AddItem(pItem) - .SendMailTo(trans, MailReceiver(bidder,auction->bidder), auction, MAIL_CHECK_MASK_COPIED); + .SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED); } } @@ -188,7 +188,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry * auction, SQLTran sLog->outDebug(LOG_FILTER_AUCTIONHOUSE, "AuctionSalePending body string : %s", msgAuctionSalePendingBody.str().c_str()); MailDraft(msgAuctionSalePendingSubject.str(), msgAuctionSalePendingBody.str()) - .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED); + .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED); } } @@ -226,7 +226,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry * auction, SQLTrans } MailDraft(msgAuctionSuccessfulSubject.str(), auctionSuccessfulBody.str()) .AddMoney(profit) - .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY)); + .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY)); } } @@ -252,14 +252,14 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry * auction, SQLTransact MailDraft(subject.str(), "") // TODO: fix body .AddItem(pItem) - .SendMailTo(trans, MailReceiver(owner,auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0); + .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0); } } //this function sends mail to old bidder void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry *auction, uint32 newPrice, Player* newBidder, SQLTransaction& trans) { - uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder,0, HIGHGUID_PLAYER); + uint64 oldBidder_guid = MAKE_NEW_GUID(auction->bidder, 0, HIGHGUID_PLAYER); Player *oldBidder = sObjectMgr->GetPlayer(oldBidder_guid); uint32 oldBidder_accId = 0; @@ -331,7 +331,7 @@ void AuctionHouseMgr::LoadAuctionItems() ItemTemplate const *proto = sObjectMgr->GetItemTemplate(item_template); if (!proto) { - sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid,item_template); + sLog->outError("AuctionHouseMgr::LoadAuctionItems: Unknown item (GUID: %u id: #%u) in auction, skipped.", item_guid, item_template); continue; } diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index dbb99218b1d..b09aa8d101a 100755 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -777,7 +777,7 @@ void Battleground::EndBattleground(uint32 winner) if (member) plr->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_WIN_RATED_ARENA, member->PersonalRating); - winner_arena_team->MemberWon(plr,loser_matchmaker_rating, winner_change); + winner_arena_team->MemberWon(plr, loser_matchmaker_rating, winner_change); } else { @@ -1081,16 +1081,16 @@ void Battleground::AddPlayer(Player* plr) if (team == ALLIANCE) // gold { if (plr->GetTeam() == HORDE) - plr->CastSpell(plr, SPELL_HORDE_GOLD_FLAG,true); + plr->CastSpell(plr, SPELL_HORDE_GOLD_FLAG, true); else - plr->CastSpell(plr, SPELL_ALLIANCE_GOLD_FLAG,true); + plr->CastSpell(plr, SPELL_ALLIANCE_GOLD_FLAG, true); } else // green { if (plr->GetTeam() == HORDE) - plr->CastSpell(plr, SPELL_HORDE_GREEN_FLAG,true); + plr->CastSpell(plr, SPELL_HORDE_GREEN_FLAG, true); else - plr->CastSpell(plr, SPELL_ALLIANCE_GREEN_FLAG,true); + plr->CastSpell(plr, SPELL_ALLIANCE_GREEN_FLAG, true); } plr->DestroyConjuredItems(true); diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 237c427b04e..2dea23a573d 100755 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -683,7 +683,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds() uint32 scriptId = 0; // 0 1 2 3 4 5 6 7 8 9 10 - QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam,MaxPlayersPerTeam,MinLvl,MaxLvl,AllianceStartLoc,AllianceStartO,HordeStartLoc,HordeStartO,Weight,ScriptName FROM battleground_template"); + QueryResult result = WorldDatabase.Query("SELECT id, MinPlayersPerTeam, MaxPlayersPerTeam, MinLvl, MaxLvl, AllianceStartLoc, AllianceStartO, HordeStartLoc, HordeStartO, Weight, ScriptName FROM battleground_template"); if (!result) { @@ -911,7 +911,7 @@ void BattlegroundMgr::BuildBattlegroundListPacket(WorldPacket *data, const uint6 if (Battleground* bgTemplate = sBattlegroundMgr->GetBattlegroundTemplate(bgTypeId)) { // expected bracket entry - if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(),plr->getLevel())) + if (PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgTemplate->GetMapId(), plr->getLevel())) { uint32 count = 0; BattlegroundBracketId bracketId = bracketEntry->GetBracketId(); @@ -943,7 +943,7 @@ void BattlegroundMgr::SendToBattleground(Player *pl, uint32 instanceId, Battlegr } else { - sLog->outError("player %u is trying to port to non-existent bg instance %u",pl->GetGUIDLow(), instanceId); + sLog->outError("player %u is trying to port to non-existent bg instance %u", pl->GetGUIDLow(), instanceId); } } @@ -1143,7 +1143,7 @@ void BattlegroundMgr::LoadBattleMastersEntry() uint32 bgTypeId = fields[1].GetUInt32(); if (!sBattlemasterListStore.LookupEntry(bgTypeId)) { - sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.",entry,bgTypeId); + sLog->outErrorDb("Table `battlemaster_entry` contain entry %u for not existed battleground type %u, ignored.", entry, bgTypeId); continue; } diff --git a/src/server/game/Battlegrounds/BattlegroundQueue.cpp b/src/server/game/Battlegrounds/BattlegroundQueue.cpp index 9611fb00ea6..eef8c941f8a 100755 --- a/src/server/game/Battlegrounds/BattlegroundQueue.cpp +++ b/src/server/game/Battlegrounds/BattlegroundQueue.cpp @@ -443,7 +443,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b ginfo->RemoveInviteTime = getMSTime() + INVITE_ACCEPT_WAIT_TIME; // loop through the players - for (std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr) + for (std::map<uint64, PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr) { // get the player Player* plr = sObjectMgr->GetPlayer(itr->first); @@ -471,7 +471,7 @@ bool BattlegroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, Battleground * b uint32 queueSlot = plr->GetBattlegroundQueueIndex(bgQueueTypeId); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.",plr->GetName(),plr->GetGUIDLow(),bg->GetInstanceID(),queueSlot,bg->GetTypeID()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: invited plr %s (%u) to BG instance %u queueindex %u bgtype %u, I can't help it if they don't press the enter battle button.", plr->GetName(), plr->GetGUIDLow(), bg->GetInstanceID(), queueSlot, bg->GetTypeID()); // send status packet sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_JOIN, INVITE_ACCEPT_WAIT_TIME, 0, ginfo->ArenaType); @@ -783,7 +783,7 @@ void BattlegroundQueue::Update(BattlegroundTypeId bgTypeId, BattlegroundBracketI return; } - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(),bracket_id); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketById(bg_template->GetMapId(), bracket_id); if (!bracketEntry) { sLog->outError("Battleground: Update: bg bracket entry not found for map %u bracket id %u", bg_template->GetMapId(), bracket_id); @@ -1080,7 +1080,7 @@ bool BGQueueRemoveEvent::Execute(uint64 /*e_time*/, uint32 /*p_time*/) BattlegroundQueue &bgQueue = sBattlegroundMgr->m_BattlegroundQueues[m_BgQueueTypeId]; if (bgQueue.IsPlayerInvited(m_PlayerGuid, m_BgInstanceGUID, m_RemoveTime)) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.",plr->GetGUIDLow(),m_BgInstanceGUID); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: removing player %u from bg queue for instance %u because of not pressing enter battle in time.", plr->GetGUIDLow(), m_BgInstanceGUID); plr->RemoveBattlegroundQueueId(m_BgQueueTypeId); bgQueue.RemovePlayer(m_PlayerGuid, true); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp index 92cc37dd28c..6b56f2a14a6 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp @@ -94,19 +94,19 @@ void BattlegroundAB::Update(uint32 diff) // create new occupied banner _CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true); _SendNodeUpdate(node); - _NodeOccupied(node,(teamIndex == 0) ? ALLIANCE:HORDE); + _NodeOccupied(node, (teamIndex == 0) ? ALLIANCE:HORDE); // Message to chatlog if (teamIndex == 0) { // FIXME: team and node names not localized - SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE,NULL,LANG_BG_AB_ALLY,_GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node)); PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_ALLIANCE); } else { // FIXME: team and node names not localized - SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE,NULL,LANG_BG_AB_HORDE,_GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node)); PlaySoundToAll(BG_AB_SOUND_NODE_CAPTURED_HORDE); } } @@ -187,8 +187,8 @@ void BattlegroundAB::StartingEventCloseDoors() SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY); // Starting base spirit guides - _NodeOccupied(BG_AB_SPIRIT_ALIANCE,ALLIANCE); - _NodeOccupied(BG_AB_SPIRIT_HORDE,HORDE); + _NodeOccupied(BG_AB_SPIRIT_ALIANCE, ALLIANCE); + _NodeOccupied(BG_AB_SPIRIT_HORDE, HORDE); } void BattlegroundAB::StartingEventOpenDoors() @@ -363,10 +363,10 @@ void BattlegroundAB::_SendNodeUpdate(uint8 node) UpdateWorldState(BG_AB_OP_OCCUPIED_BASES_HORDE, horde); } -void BattlegroundAB::_NodeOccupied(uint8 node,Team team) +void BattlegroundAB::_NodeOccupied(uint8 node, Team team) { if (!AddSpiritGuide(node, BG_AB_SpiritGuidePos[node][0], BG_AB_SpiritGuidePos[node][1], BG_AB_SpiritGuidePos[node][2], BG_AB_SpiritGuidePos[node][3], team)) - sLog->outError("Failed to spawn spirit guide! point: %u, team: %u,", node, team); + sLog->outError("Failed to spawn spirit guide! point: %u, team: %u, ", node, team); uint8 capturedNodes = 0; for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) @@ -383,7 +383,7 @@ void BattlegroundAB::_NodeOccupied(uint8 node,Team team) return; Creature* trigger = GetBGCreature(node+7);//0-6 spirit guides if (!trigger) - trigger = AddCreature(WORLD_TRIGGER,node+7,team,BG_AB_NodePositions[node][0],BG_AB_NodePositions[node][1],BG_AB_NodePositions[node][2],BG_AB_NodePositions[node][3]); + trigger = AddCreature(WORLD_TRIGGER, node+7, team, BG_AB_NodePositions[node][0], BG_AB_NodePositions[node][1], BG_AB_NodePositions[node][2], BG_AB_NodePositions[node][3]); //add bonus honor aura trigger creature when node is accupied //cast bonus aura (+50% honor in 25yards) @@ -437,7 +437,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ uint8 node = BG_AB_NODE_STABLES; GameObject* obj=GetBgMap()->GetGameObject(m_BgObjects[node*8+7]); - while ((node < BG_AB_DYNAMIC_NODES_COUNT) && ((!obj) || (!source->IsWithinDistInMap(obj,10)))) + while ((node < BG_AB_DYNAMIC_NODES_COUNT) && ((!obj) || (!source->IsWithinDistInMap(obj, 10)))) { ++node; obj=GetBgMap()->GetGameObject(m_BgObjects[node*8+BG_AB_OBJECT_AURA_CONTESTED]); @@ -472,9 +472,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ // FIXME: team and node names not localized if (teamIndex == 0) - SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_AB_ALLY); + SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node), LANG_BG_AB_ALLY); else - SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_AB_HORDE); + SendMessage2ToAll(LANG_BG_AB_NODE_CLAIMED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node), LANG_BG_AB_HORDE); sound = BG_AB_SOUND_NODE_CLAIMED; } @@ -496,9 +496,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ // FIXME: node names not localized if (teamIndex == BG_TEAM_ALLIANCE) - SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node)); else - SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node)); } // If contested, change back to occupied else @@ -512,13 +512,13 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ _CreateBanner(node, BG_AB_NODE_TYPE_OCCUPIED, teamIndex, true); _SendNodeUpdate(node); m_NodeTimers[node] = 0; - _NodeOccupied(node,(teamIndex == BG_TEAM_ALLIANCE) ? ALLIANCE:HORDE); + _NodeOccupied(node, (teamIndex == BG_TEAM_ALLIANCE) ? ALLIANCE:HORDE); // FIXME: node names not localized if (teamIndex == BG_TEAM_ALLIANCE) - SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node)); else - SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_DEFENDED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node)); } sound = (teamIndex == BG_TEAM_ALLIANCE) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE; } @@ -538,9 +538,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ // FIXME: node names not localized if (teamIndex == BG_TEAM_ALLIANCE) - SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_ALLIANCE, source, _GetNodeNameId(node)); else - SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED,CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_ASSAULTED, CHAT_MSG_BG_SYSTEM_HORDE, source, _GetNodeNameId(node)); sound = (teamIndex == BG_TEAM_ALLIANCE) ? BG_AB_SOUND_NODE_ASSAULTED_ALLIANCE : BG_AB_SOUND_NODE_ASSAULTED_HORDE; } @@ -550,9 +550,9 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player *source, GameObject* /*targ { // FIXME: team and node names not localized if (teamIndex == BG_TEAM_ALLIANCE) - SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_ALLIANCE, NULL, LANG_BG_AB_ALLY, _GetNodeNameId(node)); else - SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN,CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node)); + SendMessage2ToAll(LANG_BG_AB_NODE_TAKEN, CHAT_MSG_BG_SYSTEM_HORDE, NULL, LANG_BG_AB_HORDE, _GetNodeNameId(node)); } PlaySoundToAll(sound); } @@ -561,22 +561,22 @@ bool BattlegroundAB::SetupBattleground() { for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i) { - if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i,BG_AB_OBJECTID_NODE_BANNER_0 + i,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i,BG_AB_OBJECTID_BANNER_CONT_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_BANNER_CONT_H + 8*i,BG_AB_OBJECTID_BANNER_CONT_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_BANNER_ALLY + 8*i,BG_AB_OBJECTID_BANNER_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_BANNER_HORDE + 8*i,BG_AB_OBJECTID_BANNER_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_AURA_ALLY + 8*i,BG_AB_OBJECTID_AURA_A,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_AURA_HORDE + 8*i,BG_AB_OBJECTID_AURA_H,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i,BG_AB_OBJECTID_AURA_C,BG_AB_NodePositions[i][0],BG_AB_NodePositions[i][1],BG_AB_NodePositions[i][2],BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2),RESPAWN_ONE_DAY) + if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_BANNER_CONT_H + 8*i, BG_AB_OBJECTID_BANNER_CONT_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_BANNER_ALLY + 8*i, BG_AB_OBJECTID_BANNER_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_BANNER_HORDE + 8*i, BG_AB_OBJECTID_BANNER_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_AURA_ALLY + 8*i, BG_AB_OBJECTID_AURA_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_AURA_HORDE + 8*i, BG_AB_OBJECTID_AURA_H, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AB_OBJECT_AURA_CONTESTED + 8*i, BG_AB_OBJECTID_AURA_C, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY) ) { sLog->outErrorDb("BatteGroundAB: Failed to spawn some object Battleground not created!"); return false; } } - if (!AddObject(BG_AB_OBJECT_GATE_A,BG_AB_OBJECTID_GATE_A,BG_AB_DoorPositions[0][0],BG_AB_DoorPositions[0][1],BG_AB_DoorPositions[0][2],BG_AB_DoorPositions[0][3],BG_AB_DoorPositions[0][4],BG_AB_DoorPositions[0][5],BG_AB_DoorPositions[0][6],BG_AB_DoorPositions[0][7],RESPAWN_IMMEDIATELY) - || !AddObject(BG_AB_OBJECT_GATE_H,BG_AB_OBJECTID_GATE_H,BG_AB_DoorPositions[1][0],BG_AB_DoorPositions[1][1],BG_AB_DoorPositions[1][2],BG_AB_DoorPositions[1][3],BG_AB_DoorPositions[1][4],BG_AB_DoorPositions[1][5],BG_AB_DoorPositions[1][6],BG_AB_DoorPositions[1][7],RESPAWN_IMMEDIATELY) + if (!AddObject(BG_AB_OBJECT_GATE_A, BG_AB_OBJECTID_GATE_A, BG_AB_DoorPositions[0][0], BG_AB_DoorPositions[0][1], BG_AB_DoorPositions[0][2], BG_AB_DoorPositions[0][3], BG_AB_DoorPositions[0][4], BG_AB_DoorPositions[0][5], BG_AB_DoorPositions[0][6], BG_AB_DoorPositions[0][7], RESPAWN_IMMEDIATELY) + || !AddObject(BG_AB_OBJECT_GATE_H, BG_AB_OBJECTID_GATE_H, BG_AB_DoorPositions[1][0], BG_AB_DoorPositions[1][1], BG_AB_DoorPositions[1][2], BG_AB_DoorPositions[1][3], BG_AB_DoorPositions[1][4], BG_AB_DoorPositions[1][5], BG_AB_DoorPositions[1][6], BG_AB_DoorPositions[1][7], RESPAWN_IMMEDIATELY) ) { sLog->outErrorDb("BatteGroundAB: Failed to spawn door object Battleground not created!"); @@ -698,7 +698,7 @@ void BattlegroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value Source->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BG_OBJECTIVE_CAPTURE, AB_OBJECTIVE_DEFEND_BASE); break; default: - Battleground::UpdatePlayerScore(Source,type,value, doAddHonor); + Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); break; } } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h index 6d8d25f5bd5..151b8009243 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h @@ -196,7 +196,7 @@ const float BG_AB_DoorPositions[2][8] = { {708.0903f, 708.4479f, -17.8342f, -2.391099f, 0.050291f, 0.015127f, 0.929217f, -0.365784f} }; -// Tick intervals and given points: case 0,1,2,3,4,5 captured nodes +// Tick intervals and given points: case 0, 1, 2, 3, 4, 5 captured nodes const uint32 BG_AB_TickIntervals[6] = {0, 12000, 9000, 6000, 3000, 1000}; const uint32 BG_AB_TickPoints[6] = {0, 10, 10, 10, 10, 30}; @@ -251,7 +251,7 @@ class BattlegroundAB : public Battleground void AddPlayer(Player *plr); virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr,uint64 guid); + void RemovePlayer(Player *plr, uint64 guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); virtual bool SetupBattleground(); virtual void Reset(); @@ -277,7 +277,7 @@ class BattlegroundAB : public Battleground /* Creature spawning/despawning */ // TODO: working, scripted peons spawning - void _NodeOccupied(uint8 node,Team team); + void _NodeOccupied(uint8 node, Team team); void _NodeDeOccupied(uint8 node); int32 _GetNodeNameId(uint8 node); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp index f15a58f74d5..1f920ff68da 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp @@ -53,12 +53,12 @@ void BattlegroundAV::HandleKillPlayer(Player *player, Player *killer) return; Battleground::HandleKillPlayer(player, killer); - UpdateScore(player->GetTeam(),-1); + UpdateScore(player->GetTeam(), -1); } void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i",unit->GetEntry()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av HandleKillUnit %i", unit->GetEntry()); if (GetStatus() != STATUS_IN_PROGRESS) return; uint32 entry = unit->GetEntry(); @@ -75,17 +75,17 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer) */ if (entry == BG_AV_CreatureInfo[AV_NPC_A_BOSS][0]) { - CastSpellOnTeam(23658,HORDE); //this is a spell which finishes a quest where a player has to kill the boss - RewardReputationToTeam(729,BG_AV_REP_BOSS,HORDE); - RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),HORDE); + CastSpellOnTeam(23658, HORDE); //this is a spell which finishes a quest where a player has to kill the boss + RewardReputationToTeam(729, BG_AV_REP_BOSS, HORDE); + RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS), HORDE); EndBattleground(HORDE); DelCreature(AV_CPLACE_TRIGGER17); } else if (entry == BG_AV_CreatureInfo[AV_NPC_H_BOSS][0]) { - CastSpellOnTeam(23658,ALLIANCE); //this is a spell which finishes a quest where a player has to kill the boss - RewardReputationToTeam(730,BG_AV_REP_BOSS,ALLIANCE); - RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS),ALLIANCE); + CastSpellOnTeam(23658, ALLIANCE); //this is a spell which finishes a quest where a player has to kill the boss + RewardReputationToTeam(730, BG_AV_REP_BOSS, ALLIANCE); + RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_BOSS), ALLIANCE); EndBattleground(ALLIANCE); DelCreature(AV_CPLACE_TRIGGER19); } @@ -97,15 +97,15 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer) return; } m_CaptainAlive[0]=false; - RewardReputationToTeam(729,BG_AV_REP_CAPTAIN,HORDE); - RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN),HORDE); - UpdateScore(ALLIANCE,(-1)*BG_AV_RES_CAPTAIN); + RewardReputationToTeam(729, BG_AV_REP_CAPTAIN, HORDE); + RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN), HORDE); + UpdateScore(ALLIANCE, (-1)*BG_AV_RES_CAPTAIN); //spawn destroyed aura for (uint8 i=0; i <= 9; i++) - SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+i,RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+i, RESPAWN_IMMEDIATELY); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if (creature) - YellToAll(creature,GetTrinityString(LANG_BG_AV_A_CAPTAIN_DEAD),LANG_UNIVERSAL); + YellToAll(creature, GetTrinityString(LANG_BG_AV_A_CAPTAIN_DEAD), LANG_UNIVERSAL); DelCreature(AV_CPLACE_TRIGGER16); } else if (entry == BG_AV_CreatureInfo[AV_NPC_H_CAPTAIN][0]) @@ -116,21 +116,21 @@ void BattlegroundAV::HandleKillUnit(Creature *unit, Player *killer) return; } m_CaptainAlive[1]=false; - RewardReputationToTeam(730,BG_AV_REP_CAPTAIN,ALLIANCE); - RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN),ALLIANCE); - UpdateScore(HORDE,(-1)*BG_AV_RES_CAPTAIN); + RewardReputationToTeam(730, BG_AV_REP_CAPTAIN, ALLIANCE); + RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN), ALLIANCE); + UpdateScore(HORDE, (-1)*BG_AV_RES_CAPTAIN); //spawn destroyed aura for (uint8 i=0; i <= 9; i++) - SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE+i,RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE+i, RESPAWN_IMMEDIATELY); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if (creature) - YellToAll(creature,GetTrinityString(LANG_BG_AV_H_CAPTAIN_DEAD),LANG_UNIVERSAL); + YellToAll(creature, GetTrinityString(LANG_BG_AV_H_CAPTAIN_DEAD), LANG_UNIVERSAL); DelCreature(AV_CPLACE_TRIGGER18); } else if (entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_N_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_A_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_N_MINE_H_4][0]) - ChangeMineOwner(AV_NORTH_MINE,killer->GetTeam()); + ChangeMineOwner(AV_NORTH_MINE, killer->GetTeam()); else if (entry == BG_AV_CreatureInfo[AV_NPC_S_MINE_N_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_S_MINE_A_4][0] || entry == BG_AV_CreatureInfo[AV_NPC_S_MINE_H_4][0]) - ChangeMineOwner(AV_SOUTH_MINE,killer->GetTeam()); + ChangeMineOwner(AV_SOUTH_MINE, killer->GetTeam()); } void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) @@ -139,7 +139,7 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) return;//maybe we should log this, cause this must be a cheater or a big bug uint8 team = GetTeamIndexByTeamId(player->GetTeam()); //TODO add reputation, events (including quest not available anymore, next quest availabe, go/npc de/spawning)and maybe honor - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed", questid); switch(questid) { case AV_QUEST_A_SCRAPS1: @@ -147,9 +147,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) case AV_QUEST_H_SCRAPS1: case AV_QUEST_H_SCRAPS2: m_Team_QuestStatus[team][0]+=20; - if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25,50,75 turn ins + if (m_Team_QuestStatus[team][0] == 500 || m_Team_QuestStatus[team][0] == 1000 || m_Team_QuestStatus[team][0] == 1500) //25, 50, 75 turn ins { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed starting with unit upgrading..", questid); for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) if (m_Nodes[i].Owner == player->GetTeam() && m_Nodes[i].State == POINT_CONTROLED) { @@ -162,23 +162,23 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) case AV_QUEST_A_COMMANDER1: case AV_QUEST_H_COMMANDER1: m_Team_QuestStatus[team][1]++; - RewardReputationToTeam(team,1,player->GetTeam()); + RewardReputationToTeam(team, 1, player->GetTeam()); if (m_Team_QuestStatus[team][1] == 30) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); break; case AV_QUEST_A_COMMANDER2: case AV_QUEST_H_COMMANDER2: m_Team_QuestStatus[team][2]++; - RewardReputationToTeam(team,1,player->GetTeam()); + RewardReputationToTeam(team, 1, player->GetTeam()); if (m_Team_QuestStatus[team][2] == 60) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); break; case AV_QUEST_A_COMMANDER3: case AV_QUEST_H_COMMANDER3: m_Team_QuestStatus[team][3]++; - RewardReputationToTeam(team,1,player->GetTeam()); + RewardReputationToTeam(team, 1, player->GetTeam()); if (m_Team_QuestStatus[team][1] == 120) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); break; case AV_QUEST_A_BOSS1: case AV_QUEST_H_BOSS1: @@ -187,16 +187,16 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) case AV_QUEST_H_BOSS2: m_Team_QuestStatus[team][4]++; if (m_Team_QuestStatus[team][4] >= 200) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); break; case AV_QUEST_A_NEAR_MINE: case AV_QUEST_H_NEAR_MINE: m_Team_QuestStatus[team][5]++; if (m_Team_QuestStatus[team][5] == 28) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); if (m_Team_QuestStatus[team][6] == 7) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); } break; case AV_QUEST_A_OTHER_MINE: @@ -204,9 +204,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][6]++; if (m_Team_QuestStatus[team][6] == 7) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); if (m_Team_QuestStatus[team][5] == 20) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - ground assault ready", questid); } break; case AV_QUEST_A_RIDER_HIDE: @@ -214,9 +214,9 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][7]++; if (m_Team_QuestStatus[team][7] == 25) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); if (m_Team_QuestStatus[team][8] == 25) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); } break; case AV_QUEST_A_RIDER_TAME: @@ -224,13 +224,13 @@ void BattlegroundAV::HandleQuestComplete(uint32 questid, Player *player) m_Team_QuestStatus[team][8]++; if (m_Team_QuestStatus[team][8] == 25) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here", questid); if (m_Team_QuestStatus[team][7] == 25) - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed (need to implement some events here - rider assault ready", questid); } break; default: - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all",questid); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV Quest %i completed but is not interesting at all", questid); return; //was no interesting quest at all break; } @@ -269,14 +269,14 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type) { type -= AV_CPLACE_MAX; cinfoid=uint16(BG_AV_StaticCreaturePos[type][4]); - creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid][0],(type+AV_CPLACE_MAX),BG_AV_StaticCreatureInfo[cinfoid][1],BG_AV_StaticCreaturePos[type][0],BG_AV_StaticCreaturePos[type][1],BG_AV_StaticCreaturePos[type][2],BG_AV_StaticCreaturePos[type][3]); - level = (BG_AV_StaticCreatureInfo[cinfoid][2] == BG_AV_StaticCreatureInfo[cinfoid][3]) ? BG_AV_StaticCreatureInfo[cinfoid][2] : urand(BG_AV_StaticCreatureInfo[cinfoid][2],BG_AV_StaticCreatureInfo[cinfoid][3]); + creature = AddCreature(BG_AV_StaticCreatureInfo[cinfoid][0], (type+AV_CPLACE_MAX), BG_AV_StaticCreatureInfo[cinfoid][1], BG_AV_StaticCreaturePos[type][0], BG_AV_StaticCreaturePos[type][1], BG_AV_StaticCreaturePos[type][2], BG_AV_StaticCreaturePos[type][3]); + level = (BG_AV_StaticCreatureInfo[cinfoid][2] == BG_AV_StaticCreatureInfo[cinfoid][3]) ? BG_AV_StaticCreatureInfo[cinfoid][2] : urand(BG_AV_StaticCreatureInfo[cinfoid][2], BG_AV_StaticCreatureInfo[cinfoid][3]); isStatic = true; } else { - creature = AddCreature(BG_AV_CreatureInfo[cinfoid][0],type,BG_AV_CreatureInfo[cinfoid][1],BG_AV_CreaturePos[type][0],BG_AV_CreaturePos[type][1],BG_AV_CreaturePos[type][2],BG_AV_CreaturePos[type][3]); - level = (BG_AV_CreatureInfo[cinfoid][2] == BG_AV_CreatureInfo[cinfoid][3]) ? BG_AV_CreatureInfo[cinfoid][2] : urand(BG_AV_CreatureInfo[cinfoid][2],BG_AV_CreatureInfo[cinfoid][3]); + creature = AddCreature(BG_AV_CreatureInfo[cinfoid][0], type, BG_AV_CreatureInfo[cinfoid][1], BG_AV_CreaturePos[type][0], BG_AV_CreaturePos[type][1], BG_AV_CreaturePos[type][2], BG_AV_CreaturePos[type][3]); + level = (BG_AV_CreatureInfo[cinfoid][2] == BG_AV_CreatureInfo[cinfoid][3]) ? BG_AV_CreatureInfo[cinfoid][2] : urand(BG_AV_CreatureInfo[cinfoid][2], BG_AV_CreatureInfo[cinfoid][3]); } if (!creature) return NULL; @@ -329,7 +329,7 @@ Creature* BattlegroundAV::AddAVCreature(uint16 cinfoid, uint16 type) } if (triggerSpawnID && newFaction) { - if (Creature* trigger = AddCreature(WORLD_TRIGGER,triggerSpawnID,BG_AV_CreatureInfo[creature->GetEntry()][1],BG_AV_CreaturePos[triggerSpawnID][0],BG_AV_CreaturePos[triggerSpawnID][1],BG_AV_CreaturePos[triggerSpawnID][2],BG_AV_CreaturePos[triggerSpawnID][3])) + if (Creature* trigger = AddCreature(WORLD_TRIGGER, triggerSpawnID, BG_AV_CreatureInfo[creature->GetEntry()][1], BG_AV_CreaturePos[triggerSpawnID][0], BG_AV_CreaturePos[triggerSpawnID][1], BG_AV_CreaturePos[triggerSpawnID][2], BG_AV_CreaturePos[triggerSpawnID][3])) { trigger->setFaction(newFaction); trigger->CastSpell(trigger, SPELL_HONORABLE_DEFENDER_25Y, false); @@ -355,19 +355,19 @@ void BattlegroundAV::Update(uint32 diff) { if (i == 0) { - CastSpellOnTeam(AV_BUFF_A_CAPTAIN,ALLIANCE); + CastSpellOnTeam(AV_BUFF_A_CAPTAIN, ALLIANCE); Creature* creature = GetBGCreature(AV_CPLACE_MAX + 61); if (creature) - YellToAll(creature,LANG_BG_AV_A_CAPTAIN_BUFF,LANG_COMMON); + YellToAll(creature, LANG_BG_AV_A_CAPTAIN_BUFF, LANG_COMMON); } else { - CastSpellOnTeam(AV_BUFF_H_CAPTAIN,HORDE); + CastSpellOnTeam(AV_BUFF_H_CAPTAIN, HORDE); Creature* creature = GetBGCreature(AV_CPLACE_MAX + 59); //TODO: make the captains a dynamic creature if (creature) - YellToAll(creature,LANG_BG_AV_H_CAPTAIN_BUFF,LANG_ORCISH); + YellToAll(creature, LANG_BG_AV_H_CAPTAIN_BUFF, LANG_ORCISH); } - m_CaptainBuffTimer[i] = 120000 + urand(0,4)* 60000; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times + m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60000; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times } } //add points from mine owning, and look if he neutral team wanrts to reclaim the mine @@ -377,12 +377,12 @@ void BattlegroundAV::Update(uint32 diff) if (m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE) { if (m_Mine_Timer <= 0) - UpdateScore(m_Mine_Owner[mine],1); + UpdateScore(m_Mine_Owner[mine], 1); if (m_Mine_Reclaim_Timer[mine] > diff) m_Mine_Reclaim_Timer[mine] -= diff; else{ //we don't need to set this timer to 0 cause this codepart wont get called when this thing is 0 - ChangeMineOwner(mine,AV_NEUTRAL_TEAM); + ChangeMineOwner(mine, AV_NEUTRAL_TEAM); } } } @@ -411,11 +411,11 @@ void BattlegroundAV::StartingEventOpenDoors() { sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning mine stuff"); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++) - SpawnBGObject(i,RESPAWN_IMMEDIATELY); + SpawnBGObject(i, RESPAWN_IMMEDIATELY); for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i <= BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++) - SpawnBGObject(i,RESPAWN_IMMEDIATELY); + SpawnBGObject(i, RESPAWN_IMMEDIATELY); for (uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population - ChangeMineOwner(mine, AV_NEUTRAL_TEAM,true); + ChangeMineOwner(mine, AV_NEUTRAL_TEAM, true); UpdateWorldState(AV_SHOW_H_SCORE, 1); UpdateWorldState(AV_SHOW_A_SCORE, 1); @@ -439,8 +439,8 @@ void BattlegroundAV::EndBattleground(uint32 winner) { //calculate bonuskills for both teams: //first towers: - uint8 kills[2]={0,0}; //0=ally 1=horde - uint8 rep[2]={0,0}; //0=ally 1=horde + uint8 kills[2]={0, 0}; //0=ally 1=horde + uint8 rep[2]={0, 0}; //0=ally 1=horde for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) { if (m_Nodes[i].State == POINT_CONTROLED) @@ -466,16 +466,16 @@ void BattlegroundAV::EndBattleground(uint32 winner) rep[i] += BG_AV_REP_SURVIVING_CAPTAIN; } if (rep[i] != 0) - RewardReputationToTeam((i == 0)?730:729,rep[i],(i == 0)?ALLIANCE:HORDE); + RewardReputationToTeam((i == 0)?730:729, rep[i], (i == 0)?ALLIANCE:HORDE); if (kills[i] != 0) - RewardHonorToTeam(GetBonusHonor(kills[i]),(i == 0)?ALLIANCE:HORDE); + RewardHonorToTeam(GetBonusHonor(kills[i]), (i == 0)?ALLIANCE:HORDE); } //TODO add enterevademode for all attacking creatures Battleground::EndBattleground(winner); } -void BattlegroundAV::RemovePlayer(Player* plr,uint64 /*guid*/) +void BattlegroundAV::RemovePlayer(Player* plr, uint64 /*guid*/) { if (!plr) { @@ -563,7 +563,7 @@ void BattlegroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value ((BattlegroundAVScore*)itr->second)->SecondaryObjectives += value; break; default: - Battleground::UpdatePlayerScore(Source,type,value, doAddHonor); + Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); break; } } @@ -572,7 +572,7 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) { uint32 object = GetObjectThroughNode(node); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i",node,object); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player destroyed point node %i object %i", node, object); //despawn banner SpawnBGObject(object, RESPAWN_ONE_DAY); @@ -587,17 +587,17 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) if (m_BgCreatures[AV_CPLACE_A_MARSHAL_SOUTH + tmp]) DelCreature(AV_CPLACE_A_MARSHAL_SOUTH + tmp); else - sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist",AV_CPLACE_A_MARSHAL_SOUTH + tmp); + sLog->outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist", AV_CPLACE_A_MARSHAL_SOUTH + tmp); //spawn destroyed aura for (uint8 i=0; i <= 9; i++) - SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10),RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10), RESPAWN_IMMEDIATELY); UpdateScore((owner == ALLIANCE) ? HORDE : ALLIANCE, (-1)*BG_AV_RES_TOWER); - RewardReputationToTeam((owner == ALLIANCE)?730:729,BG_AV_REP_TOWER,owner); - RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_TOWER),owner); + RewardReputationToTeam((owner == ALLIANCE)?730:729, BG_AV_REP_TOWER, owner); + RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_TOWER), owner); - SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp),RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp),RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp), RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+GetTeamIndexByTeamId(owner)+(2*tmp), RESPAWN_ONE_DAY); } else { @@ -605,28 +605,28 @@ void BattlegroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node) SpawnBGObject(object-11, RESPAWN_IMMEDIATELY); else SpawnBGObject(object+11, RESPAWN_IMMEDIATELY); - SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node,RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_IMMEDIATELY); PopulateNode(node); if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy { for (uint8 i = 0; i < 4; i++) { - SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY); - SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY); + SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i, RESPAWN_ONE_DAY); + SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i, RESPAWN_IMMEDIATELY); } } } //send a nice message to all :) char buf[256]; if (IsTower(node)) - sprintf(buf, GetTrinityString(LANG_BG_AV_TOWER_TAKEN) , GetNodeName(node),(owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); + sprintf(buf, GetTrinityString(LANG_BG_AV_TOWER_TAKEN) , GetNodeName(node), (owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); else - sprintf(buf, GetTrinityString(LANG_BG_AV_GRAVE_TAKEN) , GetNodeName(node),(owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) :GetTrinityString(LANG_BG_AV_HORDE)); + sprintf(buf, GetTrinityString(LANG_BG_AV_GRAVE_TAKEN) , GetNodeName(node), (owner == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) :GetTrinityString(LANG_BG_AV_HORDE)); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if (creature) - YellToAll(creature,buf,LANG_UNIVERSAL); + YellToAll(creature, buf, LANG_UNIVERSAL); } void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) @@ -645,7 +645,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) if (!initial) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north,1=south)",mine); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av depopulating mine %i (0=north, 1=south)", mine); if (mine == AV_SOUTH_MINE) for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++) if (m_BgCreatures[i]) @@ -656,7 +656,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) } SendMineWorldStates(mine); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north,1=south)",mine); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av populating mine %i (0=north, 1=south)", mine); uint16 miner; //also neutral team exists.. after a big time, the neutral team tries to conquer the mine if (mine == AV_NORTH_MINE) @@ -686,14 +686,14 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) else cinfo = AV_NPC_S_MINE_N_S; for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++) - AddAVCreature(cinfo,i); + AddAVCreature(cinfo, i); } for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++) - AddAVCreature(miner,i); + AddAVCreature(miner, i); //the next chooses randomly between 2 cretures for (uint16 i=((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MIN:AV_CPLACE_MINE_S_2_MIN); i <= ((mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MAX:AV_CPLACE_MINE_S_2_MAX); i++) - AddAVCreature(miner+(urand(1,2)),i); - AddAVCreature(miner+3,(mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); + AddAVCreature(miner+(urand(1, 2)), i); + AddAVCreature(miner+3, (mine == AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); //because the gameobjects in this mine have changed, update all surrounding players: // for (uint16 i = ((mine == AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MIN:BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i <= ((mine == AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MAX:BG_AV_OBJECT_MINE_SUPPLY_N_MAX); i++) // { @@ -706,7 +706,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) sprintf(buf, GetTrinityString(LANG_BG_AV_MINE_TAKEN), GetTrinityString((mine == AV_NORTH_MINE) ? LANG_BG_AV_MINE_NORTH : LANG_BG_AV_MINE_SOUTH), (team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if (creature) - YellToAll(creature,buf,LANG_UNIVERSAL); + YellToAll(creature, buf, LANG_UNIVERSAL); } else { @@ -719,7 +719,7 @@ void BattlegroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial) return; } -bool BattlegroundAV::PlayerCanDoMineQuest(int32 GOId,uint32 team) +bool BattlegroundAV::PlayerCanDoMineQuest(int32 GOId, uint32 team) { if (GOId == BG_AV_OBJECTID_MINE_N) return (m_Mine_Owner[AV_NORTH_MINE] == team); @@ -752,17 +752,17 @@ void BattlegroundAV::PopulateNode(BG_AV_Nodes node) if (m_BgCreatures[node]) DelCreature(node); if (!AddSpiritGuide(node, BG_AV_CreaturePos[node][0], BG_AV_CreaturePos[node][1], BG_AV_CreaturePos[node][2], BG_AV_CreaturePos[node][3], owner)) - sLog->outError("AV: couldn't spawn spiritguide at node %i",node); + sLog->outError("AV: couldn't spawn spiritguide at node %i", node); } for (uint8 i=0; i<4; i++) - AddAVCreature(creatureid,c_place+i); + AddAVCreature(creatureid, c_place+i); if (node >= BG_AV_NODES_MAX)//fail safe return; Creature* trigger = GetBGCreature(node + 302);//0-302 other creatures if (!trigger) - trigger = AddCreature(WORLD_TRIGGER,node + 302,owner,BG_AV_CreaturePos[node + 302][0],BG_AV_CreaturePos[node + 302][1],BG_AV_CreaturePos[node + 302][2],BG_AV_CreaturePos[node + 302][3]); + trigger = AddCreature(WORLD_TRIGGER, node + 302, owner, BG_AV_CreaturePos[node + 302][0], BG_AV_CreaturePos[node + 302][1], BG_AV_CreaturePos[node + 302][2], BG_AV_CreaturePos[node + 302][3]); //add bonus honor aura trigger creature when node is accupied //cast bonus aura (+50% honor in 25yards) @@ -795,7 +795,7 @@ void BattlegroundAV::DePopulateNode(BG_AV_Nodes node) BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i",object); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV getnodethroughobject %i", object); if (object <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER) return BG_AV_Nodes(object); if (object <= BG_AV_OBJECT_FLAG_C_A_FROSTWOLF_HUT) @@ -817,7 +817,7 @@ BG_AV_Nodes BattlegroundAV::GetNodeThroughObject(uint32 object) uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node) { //this function is the counterpart to GetNodeThroughObject() - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i",node); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_AV GetObjectThroughNode %i", node); if (m_Nodes[node].Owner == ALLIANCE) { if (m_Nodes[node].State == POINT_ASSAULTED) @@ -848,7 +848,7 @@ uint32 BattlegroundAV::GetObjectThroughNode(BG_AV_Nodes node) } else if (m_Nodes[node].Owner == AV_NEUTRAL_TEAM) return BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; - sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i",node); + sLog->outError("BattlegroundAV: Error! GetPlaceNode couldn't resolve node %i", node); ASSERT(false); return 0; } @@ -860,7 +860,7 @@ void BattlegroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target if (GetStatus() != STATUS_IN_PROGRESS) return; int32 object = GetObjectType(target_obj->GetGUID()); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV using gameobject %i with type %i",target_obj->GetEntry(),object); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV using gameobject %i with type %i", target_obj->GetEntry(), object); if (object < 0) return; switch(target_obj->GetEntry()) @@ -896,13 +896,13 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) { //until snowfall doesn't belong to anyone it is better handled in assault-code ASSERT(node == BG_AV_NODES_SNOWFALL_GRAVE); //currently the only neutral grave - EventPlayerAssaultsPoint(player,object); + EventPlayerAssaultsPoint(player, object); return; } - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i",object,node); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "player defends point object: %i node: %i", object, node); if (m_Nodes[node].PrevOwner != team) { - sLog->outError("BG_AV: player defends point which doesn't belong to his team %i",node); + sLog->outError("BG_AV: player defends point which doesn't belong to his team %i", node); return; } @@ -914,38 +914,38 @@ void BattlegroundAV::EventPlayerDefendsPoint(Player* player, uint32 object) if (!IsTower(node)) { - SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(team)+3*node,RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(team)+3*node, RESPAWN_IMMEDIATELY); } // despawn old go SpawnBGObject(object, RESPAWN_ONE_DAY); - DefendNode(node,team); + DefendNode(node, team); PopulateNode(node); UpdateNodeWorldState(node); if (IsTower(node)) { //spawn big flag+aura on top of tower - SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); } else if (node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy { for (uint8 i = 0; i < 4; i++) { - SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY); - SpawnBGObject(((team == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY); + SpawnBGObject(((owner == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i, RESPAWN_ONE_DAY); + SpawnBGObject(((team == ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i, RESPAWN_IMMEDIATELY); } } //send a nice message to all :) char buf[256]; - sprintf(buf, GetTrinityString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node),(team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); + sprintf(buf, GetTrinityString((IsTower(node)) ? LANG_BG_AV_TOWER_DEFENDED : LANG_BG_AV_GRAVE_DEFENDED), GetNodeName(node), (team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if (creature) - YellToAll(creature,buf,LANG_UNIVERSAL); + YellToAll(creature, buf, LANG_UNIVERSAL); //update the statistic for the defending player UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_DEFENDED : SCORE_GRAVEYARDS_DEFENDED, 1); if (IsTower(node)) @@ -961,7 +961,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) BG_AV_Nodes node = GetNodeThroughObject(object); uint32 owner = m_Nodes[node].Owner; //maybe name it prevowner uint32 team = player->GetTeam(); - sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i",object,node); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "bg_av: player assaults point object %i node %i", object, node); if (owner == team || team == m_Nodes[node].TotalOwner) return; //surely a gm used this object @@ -974,7 +974,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) SpawnBGObject(BG_AV_OBJECT_FLAG_C_A_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); else SpawnBGObject(BG_AV_OBJECT_FLAG_C_H_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); - SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_IMMEDIATELY); //neutral aura spawn + SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_IMMEDIATELY); //neutral aura spawn } else if (m_Nodes[node].TotalOwner == AV_NEUTRAL_TEAM) //recapping, when no team owns this node realy { @@ -985,7 +985,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) SpawnBGObject(object+11, RESPAWN_IMMEDIATELY); } //eyecandy - uint32 spawn,despawn; + uint32 spawn, despawn; if (team == ALLIANCE) { despawn = (m_Nodes[node].State == POINT_ASSAULTED)?BG_AV_OBJECT_SNOW_EYECANDY_PH : BG_AV_OBJECT_SNOW_EYECANDY_H; @@ -998,8 +998,8 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) } for (uint8 i = 0; i < 4; i++) { - SpawnBGObject(despawn+i,RESPAWN_ONE_DAY); - SpawnBGObject(spawn+i,RESPAWN_IMMEDIATELY); + SpawnBGObject(despawn+i, RESPAWN_ONE_DAY); + SpawnBGObject(spawn+i, RESPAWN_IMMEDIATELY); } } @@ -1013,16 +1013,16 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) SpawnBGObject(object+22, RESPAWN_IMMEDIATELY); if (IsTower(node)) { //spawning/despawning of bigflag+aura - SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); - SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)),(team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == ALLIANCE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); + SpawnBGObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(node-BG_AV_NODES_DUNBALDAR_SOUTH)), (team == HORDE)? RESPAWN_IMMEDIATELY : RESPAWN_ONE_DAY); } else { //spawning/despawning of aura - SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node,RESPAWN_IMMEDIATELY); //neutral aura spawn - SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node,RESPAWN_ONE_DAY); //teeamaura despawn + SpawnBGObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+3*node, RESPAWN_IMMEDIATELY); //neutral aura spawn + SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+GetTeamIndexByTeamId(owner)+3*node, RESPAWN_ONE_DAY); //teeamaura despawn // Those who are waiting to resurrect at this object are taken to the closest own object's graveyard std::vector<uint64> ghost_list = m_ReviveQueue[m_BgCreatures[node]]; if (!ghost_list.empty()) @@ -1046,7 +1046,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) } SpawnBGObject(object, RESPAWN_ONE_DAY); //delete old banner - AssaultNode(node,team); + AssaultNode(node, team); UpdateNodeWorldState(node); //send a nice message to all :) @@ -1054,7 +1054,7 @@ void BattlegroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object) sprintf(buf, (IsTower(node)) ? GetTrinityString(LANG_BG_AV_TOWER_ASSAULTED) : GetTrinityString(LANG_BG_AV_GRAVE_ASSAULTED), GetNodeName(node), (team == ALLIANCE) ? GetTrinityString(LANG_BG_AV_ALLY) : GetTrinityString(LANG_BG_AV_HORDE)); Creature* creature = GetBGCreature(AV_CPLACE_HERALD); if (creature) - YellToAll(creature,buf,LANG_UNIVERSAL); + YellToAll(creature, buf, LANG_UNIVERSAL); //update the statistic for the assaulting player UpdatePlayerScore(player, (IsTower(node)) ? SCORE_TOWERS_ASSAULTED : SCORE_GRAVEYARDS_ASSAULTED, 1); PlaySoundToAll((team == ALLIANCE)?AV_SOUND_ALLIANCE_ASSAULTS:AV_SOUND_HORDE_ASSAULTS); @@ -1069,8 +1069,8 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data) for (uint8 j =1; j <= 3; j+=2) {//j=1=assaulted j=3=controled stateok = (m_Nodes[i].State == j); - data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0); - data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0); + data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0); + data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0); } } @@ -1079,8 +1079,8 @@ void BattlegroundAV::FillInitialWorldStates(WorldPacket& data) for (uint8 j =1; j <= 3; j+=2) {//j=1=assaulted j=3=controled //i dont have j=2=destroyed cause destroyed is the same like enemy-team controll stateok = (m_Nodes[i].State == j || (m_Nodes[i].State == POINT_DESTROYED && j == 3)); - data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0); - data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j,HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0); + data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, ALLIANCE)]) << uint32((m_Nodes[i].Owner == ALLIANCE && stateok)?1:0); + data << uint32(BG_AV_NodeWorldStates[i][GetWorldStateType(j, HORDE)]) << uint32((m_Nodes[i].Owner == HORDE && stateok)?1:0); } if (m_Nodes[BG_AV_NODES_SNOWFALL_GRAVE].Owner == AV_NEUTRAL_TEAM) //cause neutral teams aren't handled generic data << uint32(AV_SNOWFALL_N) << uint32(1); @@ -1118,17 +1118,17 @@ uint8 BattlegroundAV::GetWorldStateType(uint8 state, uint16 team) //this is used if (state == POINT_ASSAULTED) return 3; } - sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i",state,team); + sLog->outError("BG_AV: should update a strange worldstate state:%i team:%i", state, team); return 5; //this will crash the game, but i want to know if something is wrong here } void BattlegroundAV::UpdateNodeWorldState(BG_AV_Nodes node) { - UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State,m_Nodes[node].Owner)],1); + UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].State, m_Nodes[node].Owner)], 1); if (m_Nodes[node].PrevOwner == AV_NEUTRAL_TEAM) //currently only snowfall is supported as neutral node (i don't want to make an extra row (neutral states) in worldstatesarray just for one node - UpdateWorldState(AV_SNOWFALL_N,0); + UpdateWorldState(AV_SNOWFALL_N, 0); else - UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState,m_Nodes[node].PrevOwner)],0); + UpdateWorldState(BG_AV_NodeWorldStates[node][GetWorldStateType(m_Nodes[node].PrevState, m_Nodes[node].PrevOwner)], 0); } void BattlegroundAV::SendMineWorldStates(uint32 mine) @@ -1138,7 +1138,7 @@ void BattlegroundAV::SendMineWorldStates(uint32 mine) // ASSERT(m_Mine_PrevOwner[mine] == ALLIANCE || m_Mine_PrevOwner[mine] == HORDE || m_Mine_PrevOwner[mine] == AV_NEUTRAL_TEAM); // ASSERT(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE || m_Mine_Owner[mine] == AV_NEUTRAL_TEAM); - uint8 owner,prevowner,mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array + uint8 owner, prevowner, mine2; //those variables are needed to access the right worldstate in the BG_AV_MineWorldStates array mine2 = (mine == AV_NORTH_MINE)?0:1; if (m_Mine_PrevOwner[mine] == ALLIANCE) prevowner = 0; @@ -1153,9 +1153,9 @@ void BattlegroundAV::SendMineWorldStates(uint32 mine) else owner = 1; - UpdateWorldState(BG_AV_MineWorldStates[mine2][owner],1); + UpdateWorldState(BG_AV_MineWorldStates[mine2][owner], 1); if (prevowner != owner) - UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner],0); + UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner], 0); } WorldSafeLocsEntry const* BattlegroundAV::GetClosestGraveYard(Player* player) @@ -1193,9 +1193,9 @@ bool BattlegroundAV::SetupBattleground() // Create starting objects if ( // alliance gates - !AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0][0],BG_AV_DoorPositons[0][1],BG_AV_DoorPositons[0][2],BG_AV_DoorPositons[0][3],0,0,sin(BG_AV_DoorPositons[0][3]/2),cos(BG_AV_DoorPositons[0][3]/2),RESPAWN_IMMEDIATELY) + !AddObject(BG_AV_OBJECT_DOOR_A, BG_AV_OBJECTID_GATE_A, BG_AV_DoorPositons[0][0], BG_AV_DoorPositons[0][1], BG_AV_DoorPositons[0][2], BG_AV_DoorPositons[0][3], 0, 0, sin(BG_AV_DoorPositons[0][3]/2), cos(BG_AV_DoorPositons[0][3]/2), RESPAWN_IMMEDIATELY) // horde gates - || !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0],BG_AV_DoorPositons[1][1],BG_AV_DoorPositons[1][2],BG_AV_DoorPositons[1][3],0,0,sin(BG_AV_DoorPositons[1][3]/2),cos(BG_AV_DoorPositons[1][3]/2),RESPAWN_IMMEDIATELY)) + || !AddObject(BG_AV_OBJECT_DOOR_H, BG_AV_OBJECTID_GATE_H, BG_AV_DoorPositons[1][0], BG_AV_DoorPositons[1][1], BG_AV_DoorPositons[1][2], BG_AV_DoorPositons[1][3], 0, 0, sin(BG_AV_DoorPositons[1][3]/2), cos(BG_AV_DoorPositons[1][3]/2), RESPAWN_IMMEDIATELY)) { sLog->outErrorDb("BatteGroundAV: Failed to spawn some object Battleground not created!1"); return false; @@ -1206,14 +1206,14 @@ bool BattlegroundAV::SetupBattleground() { if (i <= BG_AV_NODES_FROSTWOLF_HUT) { - if (!AddObject(i,BG_AV_OBJECTID_BANNER_A_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(i+11,BG_AV_OBJECTID_BANNER_CONT_A_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(i+33,BG_AV_OBJECTID_BANNER_H_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(i+22,BG_AV_OBJECTID_BANNER_CONT_H_B,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) + if (!AddObject(i, BG_AV_OBJECTID_BANNER_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(i+11, BG_AV_OBJECTID_BANNER_CONT_A_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(i+33, BG_AV_OBJECTID_BANNER_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(i+22, BG_AV_OBJECTID_BANNER_CONT_H_B, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) //aura - || !AddObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_N,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3,BG_AV_OBJECTID_AURA_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY)) + || !AddObject(BG_AV_OBJECT_AURA_N_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+i*3, BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY)) { sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!2"); return false; @@ -1223,12 +1223,12 @@ bool BattlegroundAV::SetupBattleground() { if (i <= BG_AV_NODES_STONEHEART_BUNKER) //alliance towers { - if (!AddObject(i,BG_AV_OBJECTID_BANNER_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(i+22,BG_AV_OBJECTID_BANNER_CONT_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_A,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_N,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_A,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PH,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(i, BG_AV_OBJECTID_BANNER_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(i+22, BG_AV_OBJECTID_BANNER_CONT_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_A, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_A, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PH, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)) { sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!3"); return false; @@ -1236,12 +1236,12 @@ bool BattlegroundAV::SetupBattleground() } else //horde towers { - if (!AddObject(i+7,BG_AV_OBJECTID_BANNER_CONT_A,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(i+29,BG_AV_OBJECTID_BANNER_H,BG_AV_ObjectPos[i][0],BG_AV_ObjectPos[i][1],BG_AV_ObjectPos[i][2],BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_N,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_AURA_H,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_PA,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)),BG_AV_OBJECTID_TOWER_BANNER_H,BG_AV_ObjectPos[i+8][0],BG_AV_ObjectPos[i+8][1],BG_AV_ObjectPos[i+8][2],BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(i+7, BG_AV_OBJECTID_BANNER_CONT_A, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(i+29, BG_AV_OBJECTID_BANNER_H, BG_AV_ObjectPos[i][0], BG_AV_ObjectPos[i][1], BG_AV_ObjectPos[i][2], BG_AV_ObjectPos[i][3], 0, 0, sin(BG_AV_ObjectPos[i][3]/2), cos(BG_AV_ObjectPos[i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TAURA_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_N, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TAURA_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_AURA_H, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_PA, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH+(2*(i-BG_AV_NODES_DUNBALDAR_SOUTH)), BG_AV_OBJECTID_TOWER_BANNER_H, BG_AV_ObjectPos[i+8][0], BG_AV_ObjectPos[i+8][1], BG_AV_ObjectPos[i+8][2], BG_AV_ObjectPos[i+8][3], 0, 0, sin(BG_AV_ObjectPos[i+8][3]/2), cos(BG_AV_ObjectPos[i+8][3]/2), RESPAWN_ONE_DAY)) { sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!4"); return false; @@ -1249,9 +1249,9 @@ bool BattlegroundAV::SetupBattleground() } for (uint8 j=0; j <= 9; j++) //burning aura { - if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), RESPAWN_ONE_DAY)) { - sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i",i); + sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!5.%i", i); return false; } } @@ -1263,17 +1263,17 @@ bool BattlegroundAV::SetupBattleground() { if (j<5) { - if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_SMOKE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_SMOKE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY)) { - sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i",i); + sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!6.%i", i); return false; } } else { - if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+(i*10)+j, BG_AV_OBJECTID_FIRE, BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][0], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][1], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][2], BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_BUILDING_A+(i*10)+j][3]/2), RESPAWN_ONE_DAY)) { - sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i",i); + sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!7.%i", i); return false; } } @@ -1281,34 +1281,34 @@ bool BattlegroundAV::SetupBattleground() } for (uint16 i= 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_N_MAX-BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i++) { - if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i,BG_AV_OBJECTID_MINE_N,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i, BG_AV_OBJECTID_MINE_N, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), RESPAWN_ONE_DAY)) { - sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i",i); + sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.5.%i", i); return false; } } for (uint16 i= 0 ; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++) { - if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i,BG_AV_OBJECTID_MINE_S,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2),RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY)) { - sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i",i); + sLog->outError("BatteGroundAV: Failed to spawn some mine supplies Battleground not created!7.6.%i", i); return false; } } - if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N ,BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2],BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3],0,0,sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE, BG_AV_OBJECTID_BANNER_SNOWFALL_N , BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][0], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][1], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][2], BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3], 0, 0, sin(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), cos(BG_AV_ObjectPos[BG_AV_NODES_SNOWFALL_GRAVE][3]/2), RESPAWN_ONE_DAY)) { sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!8"); return false; } for (uint8 i = 0; i < 4; i++) { - if (!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A+i, BG_AV_OBJECTID_SNOWFALL_CANDY_A ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY) - || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)) + if (!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A+i, BG_AV_OBJECTID_SNOWFALL_CANDY_A , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_H+i, BG_AV_OBJECTID_SNOWFALL_CANDY_H , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY) + || !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PH+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PH , BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2], BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)) { - sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i",i); + sLog->outError("BatteGroundAV: Failed to spawn some object Battleground not created!9.%i", i); return false; } } @@ -1319,7 +1319,7 @@ bool BattlegroundAV::SetupBattleground() for (i = 0; i < BG_AV_OBJECT_MAX; i++) SpawnBGObject(i, RESPAWN_ONE_DAY); for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){ - SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i,RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i, RESPAWN_IMMEDIATELY); SpawnBGObject(i, RESPAWN_IMMEDIATELY); } for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++) @@ -1327,7 +1327,7 @@ bool BattlegroundAV::SetupBattleground() for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){ SpawnBGObject(i, RESPAWN_IMMEDIATELY); if (i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT) - SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i),RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i), RESPAWN_IMMEDIATELY); } for (i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2) { @@ -1342,7 +1342,7 @@ bool BattlegroundAV::SetupBattleground() //snowfall and the doors for (i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++) SpawnBGObject(i, RESPAWN_IMMEDIATELY); - SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY); + SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY); //creatures sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV start poputlating nodes"); @@ -1354,7 +1354,7 @@ bool BattlegroundAV::SetupBattleground() //all creatures which don't get despawned through the script are static sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning static creatures"); for (i=0; i < AV_STATICCPLACE_MAX; i++) - AddAVCreature(0,i+AV_CPLACE_MAX); + AddAVCreature(0, i+AV_CPLACE_MAX); //mainspiritguides: sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning spiritguides creatures"); AddSpiritGuide(7, BG_AV_CreaturePos[7][0], BG_AV_CreaturePos[7][1], BG_AV_CreaturePos[7][2], BG_AV_CreaturePos[7][3], ALLIANCE); @@ -1362,8 +1362,8 @@ bool BattlegroundAV::SetupBattleground() //spawn the marshals (those who get deleted, if a tower gets destroyed) sLog->outDebug(LOG_FILTER_BATTLEGROUND, "BG_AV: start spawning marshal creatures"); for (i=AV_NPC_A_MARSHAL_SOUTH; i <= AV_NPC_H_MARSHAL_WTOWER; i++) - AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH)); - AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD); + AddAVCreature(i, AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH)); + AddAVCreature(AV_NPC_HERALD, AV_CPLACE_HERALD); return true; } @@ -1387,7 +1387,7 @@ const char* BattlegroundAV::GetNodeName(BG_AV_Nodes node) case BG_AV_NODES_FROSTWOLF_WTOWER: return GetTrinityString(LANG_BG_AV_NODE_TOWER_FROST_W); case BG_AV_NODES_FROSTWOLF_HUT: return GetTrinityString(LANG_BG_AV_NODE_GRAVE_FROST_HUT); default: - sLog->outError("tried to get name for node %u",node); + sLog->outError("tried to get name for node %u", node); break; } @@ -1469,19 +1469,19 @@ void BattlegroundAV::ResetBGSubclass() m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS; m_IsInformedNearVictory[i]=false; m_CaptainAlive[i] = true; - m_CaptainBuffTimer[i] = 120000 + urand(0,4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times + m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times m_Mine_Owner[i] = AV_NEUTRAL_TEAM; m_Mine_PrevOwner[i] = m_Mine_Owner[i]; } for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_STONEHEART_GRAVE; ++i) //alliance graves - InitNode(i,ALLIANCE,false); + InitNode(i, ALLIANCE, false); for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers - InitNode(i,ALLIANCE,true); + InitNode(i, ALLIANCE, true); for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_GRAVE; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) //horde graves - InitNode(i,HORDE,false); + InitNode(i, HORDE, false); for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) //horde towers - InitNode(i,HORDE,true); - InitNode(BG_AV_NODES_SNOWFALL_GRAVE,AV_NEUTRAL_TEAM,false); //give snowfall neutral owner + InitNode(i, HORDE, true); + InitNode(BG_AV_NODES_SNOWFALL_GRAVE, AV_NEUTRAL_TEAM, false); //give snowfall neutral owner m_Mine_Timer=AV_MINE_TICK_TIMER; for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h index e6ec18aa04e..c50ee1c2a80 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h @@ -86,7 +86,7 @@ horde: AV_SOUND_NEAR_VICTORY = 8456, //not confirmed yet - AV_SOUND_ALLIANCE_ASSAULTS = 8212, //tower,grave + enemy boss if someone tries to attack him + AV_SOUND_ALLIANCE_ASSAULTS = 8212, //tower, grave + enemy boss if someone tries to attack him AV_SOUND_HORDE_ASSAULTS = 8174, AV_SOUND_ALLIANCE_GOOD = 8173, //if something good happens for the team: wins(maybe only through killing the boss), captures mine or grave, destroys tower and defends grave AV_SOUND_HORDE_GOOD = 8213, @@ -228,7 +228,7 @@ enum BG_AV_ObjectTypes BG_AV_OBJECT_DOOR_H = 45, BG_AV_OBJECT_DOOR_A = 46, -//auras for graveyards (3auras per graveyard neutral,alliance,horde) +//auras for graveyards (3auras per graveyard neutral, alliance, horde) BG_AV_OBJECT_AURA_N_FIRSTAID_STATION = 47, BG_AV_OBJECT_AURA_A_FIRSTAID_STATION = 48, BG_AV_OBJECT_AURA_H_FIRSTAID_STATION = 49, @@ -251,7 +251,7 @@ enum BG_AV_ObjectTypes BG_AV_OBJECT_AURA_A_FROSTWOLF_HUT = 66, BG_AV_OBJECT_AURA_H_FROSTWOLF_HUT = 67, - //big flags on top of towers 2 flags on each (contested,(alliance | horde)) + 2 auras + //big flags on top of towers 2 flags on each (contested, (alliance | horde)) + 2 auras BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH = 67, BG_AV_OBJECT_TFLAG_H_DUNBALDAR_SOUTH = 68, BG_AV_OBJECT_TFLAG_A_DUNBALDAR_NORTH = 69, @@ -355,174 +355,174 @@ enum BG_AV_OBJECTS AV_OPLACE_MAX = 149 }; const float BG_AV_ObjectPos[AV_OPLACE_MAX][4] = { - {638.592f,-32.422f,46.0608f,-1.62316f },//firstaid station - {669.007f,-294.078f,30.2909f,2.77507f },//stormpike - {77.8013f,-404.7f,46.7549f,-0.872665f },//stone grave - {-202.581f,-112.73f,78.4876f,-0.715585f },//snowfall - {-611.962f,-396.17f,60.8351f,2.53682f}, //iceblood grave - {-1082.45f,-346.823f,54.9219f,-1.53589f },//frostwolf grave - {-1402.21f,-307.431f,89.4424f,0.191986f },//frostwolf hut - {553.779f,-78.6566f,51.9378f,-1.22173f }, //dunnbaldar south - {674.001f,-143.125f,63.6615f,0.994838f }, //dunbaldar north - {203.281f,-360.366f,56.3869f,-0.925024f }, //icew - {-152.437f,-441.758f,40.3982f,-1.95477f }, //stone - {-571.88f,-262.777f,75.0087f,-0.802851f }, //ice tower - {-768.907f,-363.71f,90.8949f,1.07991f}, //tower point - {-1302.9f,-316.981f,113.867f,2.00713f }, //frostwolf etower - {-1297.5f,-266.767f,114.15f,3.31044f}, //frostwolf wtower + {638.592f, -32.422f, 46.0608f, -1.62316f }, //firstaid station + {669.007f, -294.078f, 30.2909f, 2.77507f }, //stormpike + {77.8013f, -404.7f, 46.7549f, -0.872665f }, //stone grave + {-202.581f, -112.73f, 78.4876f, -0.715585f }, //snowfall + {-611.962f, -396.17f, 60.8351f, 2.53682f}, //iceblood grave + {-1082.45f, -346.823f, 54.9219f, -1.53589f }, //frostwolf grave + {-1402.21f, -307.431f, 89.4424f, 0.191986f }, //frostwolf hut + {553.779f, -78.6566f, 51.9378f, -1.22173f }, //dunnbaldar south + {674.001f, -143.125f, 63.6615f, 0.994838f }, //dunbaldar north + {203.281f, -360.366f, 56.3869f, -0.925024f }, //icew + {-152.437f, -441.758f, 40.3982f, -1.95477f }, //stone + {-571.88f, -262.777f, 75.0087f, -0.802851f }, //ice tower + {-768.907f, -363.71f, 90.8949f, 1.07991f}, //tower point + {-1302.9f, -316.981f, 113.867f, 2.00713f }, //frostwolf etower + {-1297.5f, -266.767f, 114.15f, 3.31044f}, //frostwolf wtower //bigbanner: - {555.848f,-84.4151f,64.4397f,3.12414f }, //duns - {679.339f,-136.468f,73.9626f,-2.16421f }, //dunn - {208.973f,-365.971f,66.7409f,-0.244346f }, //icew - {-155.832f,-449.401f,52.7306f,0.610865f }, //stone - {-572.329f,-262.476f,88.6496f,-0.575959f }, //icetower - {-768.199f,-363.105f,104.537f,0.10472f }, //towerp - {-1302.84f,-316.582f,127.516f,0.122173f }, //etower - {-1297.87f,-266.762f,127.796f,0.0698132f }, //wtower + {555.848f, -84.4151f, 64.4397f, 3.12414f }, //duns + {679.339f, -136.468f, 73.9626f, -2.16421f }, //dunn + {208.973f, -365.971f, 66.7409f, -0.244346f }, //icew + {-155.832f, -449.401f, 52.7306f, 0.610865f }, //stone + {-572.329f, -262.476f, 88.6496f, -0.575959f }, //icetower + {-768.199f, -363.105f, 104.537f, 0.10472f }, //towerp + {-1302.84f, -316.582f, 127.516f, 0.122173f }, //etower + {-1297.87f, -266.762f, 127.796f, 0.0698132f }, //wtower //burning auras towers have 9*179065 captain-buildings have 5*179066+5*179065 //dunns - {562.632f,-88.1815f,61.993f,0.383972f }, - {562.523f,-74.5028f,37.9474f,-0.0523599f }, - {558.097f,-70.9842f,52.4876f,0.820305f }, - {578.167f,-71.8191f,38.1514f,2.72271f }, - {556.028f,-94.9242f,44.8191f,3.05433f }, - {572.451f,-94.3655f,37.9443f,-1.72788f }, - {549.263f,-79.3645f,44.8191f,0.436332f }, - {543.513f,-94.4006f,52.4819f,0.0349066f }, - {572.149f,-93.7862f,52.5726f,0.541052f }, - {582.162f,-81.2375f,37.9216f,0.0872665f }, + {562.632f, -88.1815f, 61.993f, 0.383972f }, + {562.523f, -74.5028f, 37.9474f, -0.0523599f }, + {558.097f, -70.9842f, 52.4876f, 0.820305f }, + {578.167f, -71.8191f, 38.1514f, 2.72271f }, + {556.028f, -94.9242f, 44.8191f, 3.05433f }, + {572.451f, -94.3655f, 37.9443f, -1.72788f }, + {549.263f, -79.3645f, 44.8191f, 0.436332f }, + {543.513f, -94.4006f, 52.4819f, 0.0349066f }, + {572.149f, -93.7862f, 52.5726f, 0.541052f }, + {582.162f, -81.2375f, 37.9216f, 0.0872665f }, //dunn - {664.797f,-143.65f,64.1784f,-0.453786f}, - {664.505f,-139.452f,49.6696f,-0.0349067f}, - {676.067f,-124.319f,49.6726f,-1.01229f}, - {693.004f,-144.025f,64.1755f,2.44346f}, - {661.175f,-117.691f,49.645f,1.91986f}, - {684.423f,-146.582f,63.6662f,0.994838f}, - {682.791f,-127.769f,62.4155f,1.09956f}, - {674.576f,-147.101f,56.5425f,-1.6057f}, - {655.719f,-126.673f,49.8138f,2.80998f}, - {0,0,0,0}, + {664.797f, -143.65f, 64.1784f, -0.453786f}, + {664.505f, -139.452f, 49.6696f, -0.0349067f}, + {676.067f, -124.319f, 49.6726f, -1.01229f}, + {693.004f, -144.025f, 64.1755f, 2.44346f}, + {661.175f, -117.691f, 49.645f, 1.91986f}, + {684.423f, -146.582f, 63.6662f, 0.994838f}, + {682.791f, -127.769f, 62.4155f, 1.09956f}, + {674.576f, -147.101f, 56.5425f, -1.6057f}, + {655.719f, -126.673f, 49.8138f, 2.80998f}, + {0, 0, 0, 0}, //icew - {231.503f,-356.688f,42.3704f,0.296706f}, - {224.989f,-348.175f,42.5607f,1.50098f}, - {205.782f,-351.335f,56.8998f,1.01229f}, - {196.605f,-369.187f,56.3914f,2.46091f}, - {210.619f,-376.938f,49.2677f,2.86234f}, - {209.647f,-352.632f,42.3959f,-0.698132f}, - {220.65f,-368.132f,42.3978f,-0.2618f}, - {224.682f,-374.031f,57.0679f,0.541052f}, - {200.26f,-359.968f,49.2677f,-2.89725f}, - {196.619f,-378.016f,56.9131f,1.01229f}, + {231.503f, -356.688f, 42.3704f, 0.296706f}, + {224.989f, -348.175f, 42.5607f, 1.50098f}, + {205.782f, -351.335f, 56.8998f, 1.01229f}, + {196.605f, -369.187f, 56.3914f, 2.46091f}, + {210.619f, -376.938f, 49.2677f, 2.86234f}, + {209.647f, -352.632f, 42.3959f, -0.698132f}, + {220.65f, -368.132f, 42.3978f, -0.2618f}, + {224.682f, -374.031f, 57.0679f, 0.541052f}, + {200.26f, -359.968f, 49.2677f, -2.89725f}, + {196.619f, -378.016f, 56.9131f, 1.01229f}, //stone - {-155.488f,-437.356f,33.2796f,2.60054f}, - {-163.441f,-454.188f,33.2796f,1.93732f}, - {-143.977f,-445.148f,26.4097f,-1.8675f}, - {-135.764f,-464.708f,26.3823f,2.25147f}, - {-154.076f,-466.929f,41.0636f,-1.8675f}, - {-149.908f,-460.332f,26.4083f,-2.09439f}, - {-151.638f,-439.521f,40.3797f,0.436332f}, - {-131.301f,-454.905f,26.5771f,2.93215f}, - {-171.291f,-444.684f,40.9211f,2.30383f}, - {-143.591f,-439.75f,40.9275f,-1.72788f}, + {-155.488f, -437.356f, 33.2796f, 2.60054f}, + {-163.441f, -454.188f, 33.2796f, 1.93732f}, + {-143.977f, -445.148f, 26.4097f, -1.8675f}, + {-135.764f, -464.708f, 26.3823f, 2.25147f}, + {-154.076f, -466.929f, 41.0636f, -1.8675f}, + {-149.908f, -460.332f, 26.4083f, -2.09439f}, + {-151.638f, -439.521f, 40.3797f, 0.436332f}, + {-131.301f, -454.905f, 26.5771f, 2.93215f}, + {-171.291f, -444.684f, 40.9211f, 2.30383f}, + {-143.591f, -439.75f, 40.9275f, -1.72788f}, //iceblood - {-572.667f,-267.923f,56.8542f,2.35619f}, - {-561.021f,-262.689f,68.4589f,1.37881f}, - {-572.538f,-262.649f,88.6197f,1.8326f}, - {-574.77f,-251.45f,74.9422f,-1.18682f}, - {-578.625f,-267.571f,68.4696f,0.506145f}, - {-571.476f,-257.234f,63.3223f,3.10669f}, - {-566.035f,-273.907f,52.9582f,-0.890118f}, - {-580.948f,-259.77f,68.4696f,1.46608f}, - {-568.318f,-267.1f,75.0008f,1.01229f}, - {-559.621f,-268.597f,52.8986f,0.0523599f}, + {-572.667f, -267.923f, 56.8542f, 2.35619f}, + {-561.021f, -262.689f, 68.4589f, 1.37881f}, + {-572.538f, -262.649f, 88.6197f, 1.8326f}, + {-574.77f, -251.45f, 74.9422f, -1.18682f}, + {-578.625f, -267.571f, 68.4696f, 0.506145f}, + {-571.476f, -257.234f, 63.3223f, 3.10669f}, + {-566.035f, -273.907f, 52.9582f, -0.890118f}, + {-580.948f, -259.77f, 68.4696f, 1.46608f}, + {-568.318f, -267.1f, 75.0008f, 1.01229f}, + {-559.621f, -268.597f, 52.8986f, 0.0523599f}, //towerp - {-776.072f,-368.046f,84.3558f,2.63545f}, - {-777.564f,-368.521f,90.6701f,1.72788f}, - {-765.461f,-357.711f,90.888f,0.314159f}, - {-768.763f,-362.735f,104.612f,1.81514f}, - {-760.356f,-358.896f,84.3558f,2.1293f}, - {-771.967f,-352.838f,84.3484f,1.74533f}, - {-773.333f,-364.653f,79.2351f,-1.64061f}, - {-764.109f,-366.069f,70.0934f,0.383972f}, - {-767.103f,-350.737f,68.7933f,2.80998f}, - {-760.115f,-353.845f,68.8633f,1.79769f}, + {-776.072f, -368.046f, 84.3558f, 2.63545f}, + {-777.564f, -368.521f, 90.6701f, 1.72788f}, + {-765.461f, -357.711f, 90.888f, 0.314159f}, + {-768.763f, -362.735f, 104.612f, 1.81514f}, + {-760.356f, -358.896f, 84.3558f, 2.1293f}, + {-771.967f, -352.838f, 84.3484f, 1.74533f}, + {-773.333f, -364.653f, 79.2351f, -1.64061f}, + {-764.109f, -366.069f, 70.0934f, 0.383972f}, + {-767.103f, -350.737f, 68.7933f, 2.80998f}, + {-760.115f, -353.845f, 68.8633f, 1.79769f}, //froste - {-1304.87f,-304.525f,91.8366f,-0.680679f}, - {-1301.77f,-310.974f,95.8252f,0.907571f}, - {-1305.58f,-320.625f,102.166f,-0.558505f}, - {-1294.27f,-323.468f,113.893f,-1.67552f}, - {-1302.65f,-317.192f,127.487f,2.30383f}, - {-1293.89f,-313.478f,107.328f,1.6057f}, - {-1312.41f,-312.999f,107.328f,1.5708f}, - {-1311.57f,-308.08f,91.7666f,-1.85005f}, - {-1314.7f,-322.131f,107.36f,0.645772f}, - {-1304.6f,-310.754f,113.859f,-0.401426f}, + {-1304.87f, -304.525f, 91.8366f, -0.680679f}, + {-1301.77f, -310.974f, 95.8252f, 0.907571f}, + {-1305.58f, -320.625f, 102.166f, -0.558505f}, + {-1294.27f, -323.468f, 113.893f, -1.67552f}, + {-1302.65f, -317.192f, 127.487f, 2.30383f}, + {-1293.89f, -313.478f, 107.328f, 1.6057f}, + {-1312.41f, -312.999f, 107.328f, 1.5708f}, + {-1311.57f, -308.08f, 91.7666f, -1.85005f}, + {-1314.7f, -322.131f, 107.36f, 0.645772f}, + {-1304.6f, -310.754f, 113.859f, -0.401426f}, //frostw - {-1308.24f,-273.26f,92.0514f,-0.139626f}, - {-1302.26f,-262.858f,95.9269f,0.418879f}, - {-1297.28f,-267.773f,126.756f,2.23402f}, - {-1299.08f,-256.89f,114.108f,-2.44346f}, - {-1303.41f,-268.237f,114.151f,-1.23918f}, - {-1304.43f,-273.682f,107.612f,0.244346f}, - {-1309.53f,-265.951f,92.1418f,-2.49582f}, - {-1295.55f,-263.865f,105.033f,0.925024f}, - {-1294.71f,-281.466f,107.664f,-1.50098f}, - {-1289.69f,-259.521f,107.612f,-2.19912f}, + {-1308.24f, -273.26f, 92.0514f, -0.139626f}, + {-1302.26f, -262.858f, 95.9269f, 0.418879f}, + {-1297.28f, -267.773f, 126.756f, 2.23402f}, + {-1299.08f, -256.89f, 114.108f, -2.44346f}, + {-1303.41f, -268.237f, 114.151f, -1.23918f}, + {-1304.43f, -273.682f, 107.612f, 0.244346f}, + {-1309.53f, -265.951f, 92.1418f, -2.49582f}, + {-1295.55f, -263.865f, 105.033f, 0.925024f}, + {-1294.71f, -281.466f, 107.664f, -1.50098f}, + {-1289.69f, -259.521f, 107.612f, -2.19912f}, //the two buildings of the captains //alliance - {-64.4987f,-289.33f,33.4616f,-2.82743f}, - {-5.98025f,-326.144f,38.8538f,0}, - {-2.67893f,-306.998f,33.4165f,0}, - {-60.25f,-309.232f,50.2408f,-1.46608f}, - {-48.7941f,-266.533f,47.7916f,2.44346f}, - {-3.40929f,-306.288f,33.34f,0}, - {-48.619f,-266.917f,47.8168f,0}, - {-62.9474f,-286.212f,66.7288f,0}, - {-5.05132f,-325.323f,38.8536f,0}, - {-64.2677f,-289.412f,33.469f,0}, + {-64.4987f, -289.33f, 33.4616f, -2.82743f}, + {-5.98025f, -326.144f, 38.8538f, 0}, + {-2.67893f, -306.998f, 33.4165f, 0}, + {-60.25f, -309.232f, 50.2408f, -1.46608f}, + {-48.7941f, -266.533f, 47.7916f, 2.44346f}, + {-3.40929f, -306.288f, 33.34f, 0}, + {-48.619f, -266.917f, 47.8168f, 0}, + {-62.9474f, -286.212f, 66.7288f, 0}, + {-5.05132f, -325.323f, 38.8536f, 0}, + {-64.2677f, -289.412f, 33.469f, 0}, //horde - {-524.276f,-199.6f,82.8733f,-1.46608f}, - {-518.196f,-173.085f,102.43f,0}, - {-500.732f,-145.358f,88.5337f,2.44346f}, - {-501.084f,-150.784f,80.8506f,0}, - {-518.309f,-163.963f,102.521f,2.96706f}, - {-517.053f,-200.429f,80.759f,0}, - {-514.361f,-163.864f,104.163f,0}, - {-568.04f,-188.707f,81.55f,0}, - {-501.775f,-151.581f,81.2027f,0}, - {-509.975f,-191.652f,83.2978f,0}, + {-524.276f, -199.6f, 82.8733f, -1.46608f}, + {-518.196f, -173.085f, 102.43f, 0}, + {-500.732f, -145.358f, 88.5337f, 2.44346f}, + {-501.084f, -150.784f, 80.8506f, 0}, + {-518.309f, -163.963f, 102.521f, 2.96706f}, + {-517.053f, -200.429f, 80.759f, 0}, + {-514.361f, -163.864f, 104.163f, 0}, + {-568.04f, -188.707f, 81.55f, 0}, + {-501.775f, -151.581f, 81.2027f, 0}, + {-509.975f, -191.652f, 83.2978f, 0}, //snowfall eyecandy - {-191.153f,-129.868f,78.5595f,-1.25664f }, - {-201.282f,-134.319f,78.6753f,-0.942478f }, - {-215.981f,-91.4101f,80.8702f,-1.74533f }, - {-200.465f,-96.418f,79.7587f,1.36136f }, + {-191.153f, -129.868f, 78.5595f, -1.25664f }, + {-201.282f, -134.319f, 78.6753f, -0.942478f }, + {-215.981f, -91.4101f, 80.8702f, -1.74533f }, + {-200.465f, -96.418f, 79.7587f, 1.36136f }, //mine supplies //irondeep - {870.899f,-388.434f,61.6406f,-1.22173f}, - {825.214f,-320.174f,63.712f,-2.82743f}, - {837.117f,-452.556f,47.2331f,-3.12414f}, - {869.755f,-448.867f,52.5448f,-0.855212f}, - {949.877f,-458.198f,56.4874f,0.314159f}, - {900.35f,-479.024f,58.3553f,0.122173f}, - {854.449f,-442.255f,50.6589f,0.401426f}, - {886.685f,-442.358f,54.6962f,-1.22173f}, - {817.509f,-457.331f,48.4666f,2.07694f}, - {793.411f,-326.281f,63.1117f,-2.79253f}, + {870.899f, -388.434f, 61.6406f, -1.22173f}, + {825.214f, -320.174f, 63.712f, -2.82743f}, + {837.117f, -452.556f, 47.2331f, -3.12414f}, + {869.755f, -448.867f, 52.5448f, -0.855212f}, + {949.877f, -458.198f, 56.4874f, 0.314159f}, + {900.35f, -479.024f, 58.3553f, 0.122173f}, + {854.449f, -442.255f, 50.6589f, 0.401426f}, + {886.685f, -442.358f, 54.6962f, -1.22173f}, + {817.509f, -457.331f, 48.4666f, 2.07694f}, + {793.411f, -326.281f, 63.1117f, -2.79253f}, //coldtooth - {-934.212f,-57.3517f,80.277f,-0.0174535f}, - {-916.281f,-36.8579f,77.0227f,0.122173f}, - {-902.73f,-103.868f,75.4378f,-1.58825f}, - {-900.514f,-143.527f,75.9686f,1.8675f}, - {-862.882f,-0.353299f,72.1526f,-2.51327f}, - {-854.932f,-85.9184f,68.6056f,-2.04204f}, - {-851.833f,-118.959f,63.8672f,-0.0698131f}, - {-849.832f,-20.8421f,70.4672f,-1.81514f}, - {-844.25f,-60.0374f,72.1031f,-2.19912f}, - {-820.644f,-136.043f,63.1977f,2.40855f}, - {-947.642f,-208.807f,77.0101f,1.36136f}, - {-951.394f,-193.695f,67.634f,0.802851f} + {-934.212f, -57.3517f, 80.277f, -0.0174535f}, + {-916.281f, -36.8579f, 77.0227f, 0.122173f}, + {-902.73f, -103.868f, 75.4378f, -1.58825f}, + {-900.514f, -143.527f, 75.9686f, 1.8675f}, + {-862.882f, -0.353299f, 72.1526f, -2.51327f}, + {-854.932f, -85.9184f, 68.6056f, -2.04204f}, + {-851.833f, -118.959f, 63.8672f, -0.0698131f}, + {-849.832f, -20.8421f, 70.4672f, -1.81514f}, + {-844.25f, -60.0374f, 72.1031f, -2.19912f}, + {-820.644f, -136.043f, 63.1977f, 2.40855f}, + {-947.642f, -208.807f, 77.0101f, 1.36136f}, + {-951.394f, -193.695f, 67.634f, 0.802851f} }; const float BG_AV_DoorPositons[2][4] = { @@ -611,7 +611,7 @@ enum BG_AV_CreaturePlace AV_CPLACE_TRIGGER14 = 315, AV_CPLACE_TRIGGER15 = 316, - //boss,captain triggers + //boss, captain triggers AV_CPLACE_TRIGGER16 = 317, AV_CPLACE_TRIGGER17 = 318, AV_CPLACE_TRIGGER18 = 319, @@ -623,359 +623,359 @@ enum BG_AV_CreaturePlace //x, y, z, o const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = { //spiritguides - {643.000000f,44.000000f,69.740196f,-0.001854f}, - {676.000000f,-374.000000f,30.000000f,-0.001854f}, - {73.417755f,-496.433105f,48.731918f,-0.001854f}, - {-157.409195f,31.206272f,77.050598f,-0.001854f}, - {-531.217834f,-405.231384f,49.551376f,-0.001854f}, - {-1090.476807f,-253.308670f,57.672371f,-0.001854f}, - {-1496.065063f,-333.338409f,101.134804f,-0.001854f}, - {873.001770f,-491.283630f,96.541931f,-0.001854f}, - {-1437.670044f,-610.088989f,51.161900f,-0.001854f}, + {643.000000f, 44.000000f, 69.740196f, -0.001854f}, + {676.000000f, -374.000000f, 30.000000f, -0.001854f}, + {73.417755f, -496.433105f, 48.731918f, -0.001854f}, + {-157.409195f, 31.206272f, 77.050598f, -0.001854f}, + {-531.217834f, -405.231384f, 49.551376f, -0.001854f}, + {-1090.476807f, -253.308670f, 57.672371f, -0.001854f}, + {-1496.065063f, -333.338409f, 101.134804f, -0.001854f}, + {873.001770f, -491.283630f, 96.541931f, -0.001854f}, + {-1437.670044f, -610.088989f, 51.161900f, -0.001854f}, //grave //firstaid - {635.17f,-29.5594f,46.5056f,4.81711f}, - {642.488f,-32.9437f,46.365f,4.67748f}, - {642.326f,-27.9442f,46.9211f,4.59022f}, - {635.945f,-33.6171f,45.7164f,4.97419f}, + {635.17f, -29.5594f, 46.5056f, 4.81711f}, + {642.488f, -32.9437f, 46.365f, 4.67748f}, + {642.326f, -27.9442f, 46.9211f, 4.59022f}, + {635.945f, -33.6171f, 45.7164f, 4.97419f}, //stormpike - {669.272f,-297.304f,30.291f,4.66604f}, - {674.08f,-292.328f,30.4817f,0.0918785f}, - {667.01f,-288.532f,29.8809f,1.81583f}, - {664.153f,-294.042f,30.2851f,3.28531f}, + {669.272f, -297.304f, 30.291f, 4.66604f}, + {674.08f, -292.328f, 30.4817f, 0.0918785f}, + {667.01f, -288.532f, 29.8809f, 1.81583f}, + {664.153f, -294.042f, 30.2851f, 3.28531f}, //stone - {81.7027f,-406.135f,47.7843f,0.598464f}, - {78.1431f,-409.215f,48.0401f,5.05953f}, - {73.4135f,-407.035f,46.7527f,3.34736f}, - {78.2258f,-401.859f,46.4202f,2.05852f}, + {81.7027f, -406.135f, 47.7843f, 0.598464f}, + {78.1431f, -409.215f, 48.0401f, 5.05953f}, + {73.4135f, -407.035f, 46.7527f, 3.34736f}, + {78.2258f, -401.859f, 46.4202f, 2.05852f}, //snowfall - {-207.412f,-110.616f,78.7959f,2.43251f}, - {-197.95f,-112.205f,78.5686f,6.22441f}, - {-202.709f,-116.829f,78.4358f,5.13742f}, - {-202.059f,-108.314f,78.5783f,5.91968f}, + {-207.412f, -110.616f, 78.7959f, 2.43251f}, + {-197.95f, -112.205f, 78.5686f, 6.22441f}, + {-202.709f, -116.829f, 78.4358f, 5.13742f}, + {-202.059f, -108.314f, 78.5783f, 5.91968f}, //ice - {-615.501f,-393.802f,60.4299f,3.06147f}, - {-608.513f,-392.717f,62.5724f,2.06323f}, - {-609.769f,-400.072f,60.7174f,5.22367f}, - {-616.093f,-398.293f,60.5628f,3.73613f}, + {-615.501f, -393.802f, 60.4299f, 3.06147f}, + {-608.513f, -392.717f, 62.5724f, 2.06323f}, + {-609.769f, -400.072f, 60.7174f, 5.22367f}, + {-616.093f, -398.293f, 60.5628f, 3.73613f}, //frost - {-1077.7f,-340.21f,55.4682f,6.25569f}, - {-1082.74f,-333.821f,54.7962f,2.05459f}, - {-1090.66f,-341.267f,54.6768f,3.27746f}, - {-1081.58f,-344.63f,55.256f,4.75636f}, + {-1077.7f, -340.21f, 55.4682f, 6.25569f}, + {-1082.74f, -333.821f, 54.7962f, 2.05459f}, + {-1090.66f, -341.267f, 54.6768f, 3.27746f}, + {-1081.58f, -344.63f, 55.256f, 4.75636f}, //frost hut - {-1408.95f,-311.69f,89.2536f,4.49954f}, - {-1407.15f,-305.323f,89.1993f,2.86827f}, - {-1400.64f,-304.3f,89.7008f,1.0595f}, - {-1400.4f,-311.35f,89.3028f,4.99434f}, + {-1408.95f, -311.69f, 89.2536f, 4.49954f}, + {-1407.15f, -305.323f, 89.1993f, 2.86827f}, + {-1400.64f, -304.3f, 89.7008f, 1.0595f}, + {-1400.4f, -311.35f, 89.3028f, 4.99434f}, //towers //dun south - OK - {569.395f,-101.064f,52.8296f,2.34974f}, - {574.85f,-92.9842f,52.5869f,3.09325f}, - {575.411f,-83.597f,52.3626f,6.26573f}, - {571.352f,-75.6582f,52.479f,0.523599f}, + {569.395f, -101.064f, 52.8296f, 2.34974f}, + {574.85f, -92.9842f, 52.5869f, 3.09325f}, + {575.411f, -83.597f, 52.3626f, 6.26573f}, + {571.352f, -75.6582f, 52.479f, 0.523599f}, //dun north - OK - {668.60f,-122.53f,64.12f,2.34f}, //not 100% ok - {662.253f,-129.105f,64.1794f,2.77507f}, - {661.209f,-138.877f,64.2251f,3.38594f}, - {665.481f,-146.857f,64.1271f,3.75246f}, + {668.60f, -122.53f, 64.12f, 2.34f}, //not 100% ok + {662.253f, -129.105f, 64.1794f, 2.77507f}, + {661.209f, -138.877f, 64.2251f, 3.38594f}, + {665.481f, -146.857f, 64.1271f, 3.75246f}, //icewing - OK - {225.228f,-368.909f,56.9983f,6.23806f}, - {191.36f,-369.899f,57.1524f,3.24631f}, - {215.518f,-384.019f,56.9889f,5.09636f}, - {199.625f,-382.177f,56.8691f,4.08407f}, + {225.228f, -368.909f, 56.9983f, 6.23806f}, + {191.36f, -369.899f, 57.1524f, 3.24631f}, + {215.518f, -384.019f, 56.9889f, 5.09636f}, + {199.625f, -382.177f, 56.8691f, 4.08407f}, //stone - {-172.851f,-452.366f,40.8725f,3.31829f}, - {-147.147f,-435.053f,40.8022f,0.599238f}, - {-169.456f,-440.325f,40.985f,2.59101f}, - {-163.494f,-434.904f,41.0725f,1.84174f}, + {-172.851f, -452.366f, 40.8725f, 3.31829f}, + {-147.147f, -435.053f, 40.8022f, 0.599238f}, + {-169.456f, -440.325f, 40.985f, 2.59101f}, + {-163.494f, -434.904f, 41.0725f, 1.84174f}, //ice - OK - {-573.522f,-271.854f,75.0078f,3.9619f}, - {-565.616f,-269.051f,74.9952f,5.02655f}, - {-562.825f,-261.087f,74.9898f,5.95157f}, - {-569.176f,-254.446f,74.8771f,0.820305f}, + {-573.522f, -271.854f, 75.0078f, 3.9619f}, + {-565.616f, -269.051f, 74.9952f, 5.02655f}, + {-562.825f, -261.087f, 74.9898f, 5.95157f}, + {-569.176f, -254.446f, 74.8771f, 0.820305f}, //towerpoint - {-763.04f,-371.032f,90.7933f,5.25979f}, - {-759.764f,-358.264f,90.8681f,0.289795f}, - {-768.808f,-353.056f,90.8811f,1.52601f}, - {-775.944f,-362.639f,90.8949f,2.59573f}, + {-763.04f, -371.032f, 90.7933f, 5.25979f}, + {-759.764f, -358.264f, 90.8681f, 0.289795f}, + {-768.808f, -353.056f, 90.8811f, 1.52601f}, + {-775.944f, -362.639f, 90.8949f, 2.59573f}, //frost etower - {-1294.13f,-313.045f,107.328f,0.270162f}, - {-1306.5f,-308.105f,113.767f,1.78755f}, - {-1294.78f,-319.966f,113.79f,5.94545f}, - {-1294.83f,-312.241f,113.799f,0.295293f}, + {-1294.13f, -313.045f, 107.328f, 0.270162f}, + {-1306.5f, -308.105f, 113.767f, 1.78755f}, + {-1294.78f, -319.966f, 113.79f, 5.94545f}, + {-1294.83f, -312.241f, 113.799f, 0.295293f}, //frost wtower - {-1300.96f,-275.111f,114.058f,4.12804f}, - {-1302.41f,-259.256f,114.065f,1.67602f}, - {-1287.97f,-262.087f,114.165f,6.18264f}, - {-1291.59f,-271.166f,114.151f,5.28257f}, + {-1300.96f, -275.111f, 114.058f, 4.12804f}, + {-1302.41f, -259.256f, 114.065f, 1.67602f}, + {-1287.97f, -262.087f, 114.165f, 6.18264f}, + {-1291.59f, -271.166f, 114.151f, 5.28257f}, //alliance marshall - {721.104f,-7.64155f,50.7046f,3.45575f},// south - {723.058f,-14.1548f,50.7046f,3.40339f},// north - {715.691f,-4.72233f,50.2187f,3.47321f},// icewing - {720.046f,-19.9413f,50.2187f,3.36849f},// stone + {721.104f, -7.64155f, 50.7046f, 3.45575f}, // south + {723.058f, -14.1548f, 50.7046f, 3.40339f}, // north + {715.691f, -4.72233f, 50.2187f, 3.47321f}, // icewing + {720.046f, -19.9413f, 50.2187f, 3.36849f}, // stone //horde (coords not 100% ok) - {-1363.99f,-221.99f,98.4053f,4.93012f}, - {-1370.96f,-223.532f,98.4266f,4.93012f}, - {-1378.37f,-228.614f,99.3546f,5.38565f}, - {-1358.02f,-228.998f,98.868f,3.87768f}, + {-1363.99f, -221.99f, 98.4053f, 4.93012f}, + {-1370.96f, -223.532f, 98.4266f, 4.93012f}, + {-1378.37f, -228.614f, 99.3546f, 5.38565f}, + {-1358.02f, -228.998f, 98.868f, 3.87768f}, //irondeep mine //Irondeep Trogg - {971.671f,-442.657f,57.6951f,3.1765f}, - {969.979f,-457.148f,58.1119f,4.5204f}, - {958.692f,-333.477f,63.2276f,5.77704f}, - {957.113f,-325.92f,61.7589f,1.13446f}, - {948.25f,-448.268f,56.9009f,5.60251f}, - {934.727f,-385.802f,63.0344f,3.75246f}, - {931.751f,-403.458f,59.6737f,5.63741f}, - {931.146f,-359.666f,66.0294f,3.9619f}, - {929.702f,-412.401f,56.8776f,5.89921f}, - {926.849f,-379.074f,63.5286f,2.0944f}, - {921.972f,-358.597f,66.4313f,2.93215f}, - {921.449f,-341.981f,67.1264f,3.4383f}, - {921.1f,-395.812f,60.4615f,2.71695f}, - {919.274f,-394.986f,60.3478f,2.71696f}, - {916.852f,-393.891f,60.1726f,2.71695f}, - {914.568f,-326.21f,66.1733f,2.25147f}, - {913.064f,-395.773f,60.1364f,4.41568f}, - {909.246f,-474.576f,58.2067f,0.226893f}, - {909.246f,-474.576f,58.2901f,0.226893f}, - {907.209f,-428.267f,59.8065f,1.8675f}, - {905.973f,-459.528f,58.7594f,1.37189f}, - {905.067f,-396.074f,60.2085f,5.07891f}, - {901.809f,-457.709f,59.0116f,3.52557f}, - {900.962f,-427.44f,59.0842f,1.50098f}, - {897.929f,-471.742f,59.7729f,2.54818f}, - {893.376f,-343.171f,68.1499f,5.35816f}, - {890.584f,-406.049f,61.1925f,5.67232f}, - {888.208f,-332.564f,68.148f,1.93732f}, - {887.647f,-391.537f,61.8734f,1.37881f}, - {885.109f,-343.338f,67.0867f,3.78979f}, - {881.618f,-419.948f,53.5228f,0.593412f}, - {878.675f,-345.36f,66.1052f,3.45651f}, - {877.127f,-351.8f,66.5296f,5.74213f}, - {876.778f,-345.97f,65.7724f,3.45262f}, - {874.577f,-414.786f,52.7817f,1.67552f}, - {868.247f,-343.136f,64.9894f,1.6057f}, - {859.03f,-367.231f,47.4655f,0.0174533f}, - {857.513f,-351.817f,65.1867f,4.39823f}, - {852.632f,-372.416f,48.1657f,3.66519f}, - {849.86f,-340.944f,66.2447f,0.401426f}, - {847.99f,-386.287f,60.9277f,2.32374f}, - {847.601f,-423.072f,50.0852f,4.57276f}, - {847.135f,-411.307f,50.2106f,1.5708f}, - {835.077f,-379.418f,48.2755f,5.93412f}, - {834.87f,-453.304f,47.9075f,0.226893f}, - {834.634f,-365.981f,62.8801f,1.32645f}, - {834.354f,-355.526f,48.1491f,6.07375f}, - {833.702f,-327.506f,65.0439f,0.331613f}, - {833.151f,-374.228f,63.0938f,3.66519f}, - {831.711f,-346.785f,47.2975f,0.226893f}, - {827.874f,-413.624f,48.5818f,1.49241f}, - {827.728f,-415.483f,48.5593f,1.49238f}, - {827.016f,-424.543f,48.2856f,1.49236f}, - {823.222f,-334.283f,65.6306f,4.88692f}, - {821.892f,-464.723f,48.9451f,4.66003f}, - {821.006f,-387.635f,49.0728f,3.15905f}, - {817.26f,-447.432f,49.4308f,2.18166f}, - {805.399f,-320.146f,52.7712f,0.296706f}, - {801.405f,-328.055f,53.0195f,4.31096f}, + {971.671f, -442.657f, 57.6951f, 3.1765f}, + {969.979f, -457.148f, 58.1119f, 4.5204f}, + {958.692f, -333.477f, 63.2276f, 5.77704f}, + {957.113f, -325.92f, 61.7589f, 1.13446f}, + {948.25f, -448.268f, 56.9009f, 5.60251f}, + {934.727f, -385.802f, 63.0344f, 3.75246f}, + {931.751f, -403.458f, 59.6737f, 5.63741f}, + {931.146f, -359.666f, 66.0294f, 3.9619f}, + {929.702f, -412.401f, 56.8776f, 5.89921f}, + {926.849f, -379.074f, 63.5286f, 2.0944f}, + {921.972f, -358.597f, 66.4313f, 2.93215f}, + {921.449f, -341.981f, 67.1264f, 3.4383f}, + {921.1f, -395.812f, 60.4615f, 2.71695f}, + {919.274f, -394.986f, 60.3478f, 2.71696f}, + {916.852f, -393.891f, 60.1726f, 2.71695f}, + {914.568f, -326.21f, 66.1733f, 2.25147f}, + {913.064f, -395.773f, 60.1364f, 4.41568f}, + {909.246f, -474.576f, 58.2067f, 0.226893f}, + {909.246f, -474.576f, 58.2901f, 0.226893f}, + {907.209f, -428.267f, 59.8065f, 1.8675f}, + {905.973f, -459.528f, 58.7594f, 1.37189f}, + {905.067f, -396.074f, 60.2085f, 5.07891f}, + {901.809f, -457.709f, 59.0116f, 3.52557f}, + {900.962f, -427.44f, 59.0842f, 1.50098f}, + {897.929f, -471.742f, 59.7729f, 2.54818f}, + {893.376f, -343.171f, 68.1499f, 5.35816f}, + {890.584f, -406.049f, 61.1925f, 5.67232f}, + {888.208f, -332.564f, 68.148f, 1.93732f}, + {887.647f, -391.537f, 61.8734f, 1.37881f}, + {885.109f, -343.338f, 67.0867f, 3.78979f}, + {881.618f, -419.948f, 53.5228f, 0.593412f}, + {878.675f, -345.36f, 66.1052f, 3.45651f}, + {877.127f, -351.8f, 66.5296f, 5.74213f}, + {876.778f, -345.97f, 65.7724f, 3.45262f}, + {874.577f, -414.786f, 52.7817f, 1.67552f}, + {868.247f, -343.136f, 64.9894f, 1.6057f}, + {859.03f, -367.231f, 47.4655f, 0.0174533f}, + {857.513f, -351.817f, 65.1867f, 4.39823f}, + {852.632f, -372.416f, 48.1657f, 3.66519f}, + {849.86f, -340.944f, 66.2447f, 0.401426f}, + {847.99f, -386.287f, 60.9277f, 2.32374f}, + {847.601f, -423.072f, 50.0852f, 4.57276f}, + {847.135f, -411.307f, 50.2106f, 1.5708f}, + {835.077f, -379.418f, 48.2755f, 5.93412f}, + {834.87f, -453.304f, 47.9075f, 0.226893f}, + {834.634f, -365.981f, 62.8801f, 1.32645f}, + {834.354f, -355.526f, 48.1491f, 6.07375f}, + {833.702f, -327.506f, 65.0439f, 0.331613f}, + {833.151f, -374.228f, 63.0938f, 3.66519f}, + {831.711f, -346.785f, 47.2975f, 0.226893f}, + {827.874f, -413.624f, 48.5818f, 1.49241f}, + {827.728f, -415.483f, 48.5593f, 1.49238f}, + {827.016f, -424.543f, 48.2856f, 1.49236f}, + {823.222f, -334.283f, 65.6306f, 4.88692f}, + {821.892f, -464.723f, 48.9451f, 4.66003f}, + {821.006f, -387.635f, 49.0728f, 3.15905f}, + {817.26f, -447.432f, 49.4308f, 2.18166f}, + {805.399f, -320.146f, 52.7712f, 0.296706f}, + {801.405f, -328.055f, 53.0195f, 4.31096f}, //irondeep skullthumber irondeep shaman - {955.812f,-440.302f,55.3411f,3.19395f}, - {937.378f,-377.816f,65.3919f,3.56047f}, - {925.059f,-331.347f,65.7564f,3.66519f}, - {922.918f,-396.634f,60.3942f,2.71695f}, - {909.99f,-462.154f,59.0811f,3.7001f}, - {907.893f,-388.787f,61.7923f,5.74213f}, - {898.801f,-437.105f,58.5266f,0.959931f}, - {884.237f,-407.597f,61.566f,0.820305f}, - {880.744f,-344.683f,66.4086f,3.4644f}, - {876.047f,-341.857f,65.8743f,4.45059f}, - {874.674f,-402.077f,61.7573f,0.26341f}, - {871.914f,-404.209f,62.1269f,6.06163f}, - {871.606f,-403.665f,62.0795f,0.765774f}, - {871.561f,-404.114f,62.1297f,0.00981727f}, - {871.528f,-404.248f,62.1455f,0.498032f}, - {871.493f,-404.122f,62.1331f,5.65727f}, - {871.282f,-403.843f,62.1108f,0.788382f}, - {868.294f,-392.395f,61.4772f,4.38685f}, - {868.256f,-392.363f,61.4803f,0.732738f}, - {867.804f,-392.51f,61.5089f,2.30167f}, - {867.612f,-392.371f,61.524f,2.86149f}, - {858.593f,-439.614f,50.2184f,0.872665f}, - {851.471f,-362.52f,47.314f,4.06662f}, - {846.939f,-347.279f,66.2876f,0.942478f}, - {842.08f,-421.775f,48.2659f,1.0821f}, - {838.358f,-371.212f,63.3299f,4.04916f}, - {827.57f,-417.483f,48.4538f,1.49237f}, - {827.012f,-457.397f,48.9331f,2.35619f}, - {825.535f,-322.373f,63.9357f,4.76475f}, - {867.635f,-443.605f,51.3347f,1.38626f}, - {957.293f,-455.039f,56.7395f,5.79449f}, - {950.077f,-326.672f,61.6552f,5.48033f}, - {936.692f,-356.78f,65.9835f,2.75762f}, - {926.475f,-419.345f,56.1833f,2.0944f}, - {924.729f,-397.453f,60.213f,2.71695f}, - {902.195f,-475.891f,58.312f,1.39626f}, - {897.464f,-338.758f,68.1715f,2.94961f}, - {884.237f,-407.597f,61.566f,0.820305f}, - {882.517f,-344.111f,66.7887f,3.46962f}, - {881.437f,-400.254f,61.2028f,0.263427f}, - {880.156f,-400.678f,61.3113f,3.41373f}, - {877.989f,-418.051f,52.9753f,4.46804f}, - {871.212f,-404.12f,62.1433f,3.6554f}, - {871.036f,-404.119f,62.2237f,4.50295f}, - {857.396f,-395.766f,61.263f,4.78684f}, - {857.276f,-395.395f,61.2418f,0.0845553f}, - {857.231f,-394.577f,61.2174f,1.96817f}, - {857.108f,-395.682f,61.2317f,4.87022f}, - {856.709f,-395.28f,61.1814f,2.54913f}, - {850.922f,-390.399f,60.8771f,2.85405f}, - {847.556f,-388.228f,60.9438f,2.56872f}, - {842.031f,-384.663f,61.6028f,2.56871f}, - {832.035f,-389.301f,47.5567f,2.11185f}, - {827.415f,-419.468f,48.3322f,1.49232f}, - {826.402f,-349.454f,47.2722f,1.51844f}, - {817.83f,-455.715f,48.4207f,0.925025f}, - {808.953f,-325.964f,52.4043f,3.01942f}, + {955.812f, -440.302f, 55.3411f, 3.19395f}, + {937.378f, -377.816f, 65.3919f, 3.56047f}, + {925.059f, -331.347f, 65.7564f, 3.66519f}, + {922.918f, -396.634f, 60.3942f, 2.71695f}, + {909.99f, -462.154f, 59.0811f, 3.7001f}, + {907.893f, -388.787f, 61.7923f, 5.74213f}, + {898.801f, -437.105f, 58.5266f, 0.959931f}, + {884.237f, -407.597f, 61.566f, 0.820305f}, + {880.744f, -344.683f, 66.4086f, 3.4644f}, + {876.047f, -341.857f, 65.8743f, 4.45059f}, + {874.674f, -402.077f, 61.7573f, 0.26341f}, + {871.914f, -404.209f, 62.1269f, 6.06163f}, + {871.606f, -403.665f, 62.0795f, 0.765774f}, + {871.561f, -404.114f, 62.1297f, 0.00981727f}, + {871.528f, -404.248f, 62.1455f, 0.498032f}, + {871.493f, -404.122f, 62.1331f, 5.65727f}, + {871.282f, -403.843f, 62.1108f, 0.788382f}, + {868.294f, -392.395f, 61.4772f, 4.38685f}, + {868.256f, -392.363f, 61.4803f, 0.732738f}, + {867.804f, -392.51f, 61.5089f, 2.30167f}, + {867.612f, -392.371f, 61.524f, 2.86149f}, + {858.593f, -439.614f, 50.2184f, 0.872665f}, + {851.471f, -362.52f, 47.314f, 4.06662f}, + {846.939f, -347.279f, 66.2876f, 0.942478f}, + {842.08f, -421.775f, 48.2659f, 1.0821f}, + {838.358f, -371.212f, 63.3299f, 4.04916f}, + {827.57f, -417.483f, 48.4538f, 1.49237f}, + {827.012f, -457.397f, 48.9331f, 2.35619f}, + {825.535f, -322.373f, 63.9357f, 4.76475f}, + {867.635f, -443.605f, 51.3347f, 1.38626f}, + {957.293f, -455.039f, 56.7395f, 5.79449f}, + {950.077f, -326.672f, 61.6552f, 5.48033f}, + {936.692f, -356.78f, 65.9835f, 2.75762f}, + {926.475f, -419.345f, 56.1833f, 2.0944f}, + {924.729f, -397.453f, 60.213f, 2.71695f}, + {902.195f, -475.891f, 58.312f, 1.39626f}, + {897.464f, -338.758f, 68.1715f, 2.94961f}, + {884.237f, -407.597f, 61.566f, 0.820305f}, + {882.517f, -344.111f, 66.7887f, 3.46962f}, + {881.437f, -400.254f, 61.2028f, 0.263427f}, + {880.156f, -400.678f, 61.3113f, 3.41373f}, + {877.989f, -418.051f, 52.9753f, 4.46804f}, + {871.212f, -404.12f, 62.1433f, 3.6554f}, + {871.036f, -404.119f, 62.2237f, 4.50295f}, + {857.396f, -395.766f, 61.263f, 4.78684f}, + {857.276f, -395.395f, 61.2418f, 0.0845553f}, + {857.231f, -394.577f, 61.2174f, 1.96817f}, + {857.108f, -395.682f, 61.2317f, 4.87022f}, + {856.709f, -395.28f, 61.1814f, 2.54913f}, + {850.922f, -390.399f, 60.8771f, 2.85405f}, + {847.556f, -388.228f, 60.9438f, 2.56872f}, + {842.031f, -384.663f, 61.6028f, 2.56871f}, + {832.035f, -389.301f, 47.5567f, 2.11185f}, + {827.415f, -419.468f, 48.3322f, 1.49232f}, + {826.402f, -349.454f, 47.2722f, 1.51844f}, + {817.83f, -455.715f, 48.4207f, 0.925025f}, + {808.953f, -325.964f, 52.4043f, 3.01942f}, // Morloch - {865.554f,-438.735f,50.7333f,2.12431f}, + {865.554f, -438.735f, 50.7333f, 2.12431f}, //coldtooth mine //miner/digger - {-917.648f,-46.8922f,77.0872f,5.27089f}, - {-912.689f,-45.4494f,76.2277f,4.60767f}, - {-905.455f,-84.5179f,75.3642f,3.29867f}, - {-904.332f,-111.509f,75.5925f,2.47837f}, - {-904.27f,-160.419f,61.9876f,3.61192f}, - {-904.023f,-90.4558f,75.3706f,3.40339f}, - {-978.678f,-37.3136f,75.8364f,2.84489f}, - {-973.076f,-36.5013f,77.5047f,1.0821f}, - {-963.951f,-87.734f,81.5555f,0.575959f}, - {-961.941f,-90.7252f,81.6629f,0.820305f}, - {-957.623f,-186.582f,66.6021f,1.95477f}, - {-952.476f,-179.778f,78.6771f,4.5204f}, - {-950.427f,-115.007f,79.6127f,3.68264f}, - {-950.25f,-151.95f,79.4598f,-1.81423f}, - {-950.169f,-188.099f,66.6184f,5.55015f}, - {-949.944f,-142.977f,80.5382f,2.70526f}, - {-947.854f,-170.5f,79.7618f,0.942478f}, - {-946.738f,-139.567f,80.0904f,2.3911f}, - {-945.503f,-65.0654f,79.7907f,5.02655f}, - {-943.678f,-110.986f,80.2557f,0.959931f}, - {-942.993f,-56.9881f,79.8915f,5.65487f}, - {-938.197f,-155.838f,61.3111f,1.65806f}, - {-930.488f,-214.524f,72.1431f,2.1236f}, - {-929.947f,-154.449f,61.5084f,1.67552f}, - {-927.412f,-135.313f,61.1987f,3.29867f}, - {-920.677f,-156.859f,62.8033f,3.15306f}, - {-916.75f,-136.094f,62.2357f,0.0698132f}, - {-915.319f,-132.718f,62.562f,1.16984f}, - {-913.589f,-146.794f,76.9366f,1.8675f}, - {-907.572f,-148.937f,76.6898f,4.76475f}, - {-902.02f,-64.6174f,73.9707f,1.19169f}, - {-899.489f,-61.7252f,73.2498f,5.09636f}, - {-894.792f,-127.141f,75.3834f,6.14356f}, - {-892.408f,-162.525f,64.1212f,2.69884f}, - {-892.326f,-123.158f,76.0318f,5.5676f}, - {-888.468f,-148.462f,61.8012f,1.65806f}, - {-883.268f,-159.738f,63.5311f,5.20108f}, - {-877.76f,-118.07f,65.215f,2.94961f}, - {-876.792f,-128.646f,64.1045f,3.40339f}, - {-874.901f,-36.6579f,69.4246f,2.00713f}, - {-874.856f,-151.351f,62.7537f,3.57875f}, - {-872.135f,-150.08f,62.7513f,3.57201f}, - {-870.288f,-149.217f,62.5413f,3.56624f}, - {-870.03f,-6.27443f,70.3867f,2.3911f}, - {-869.023f,-82.2118f,69.5848f,3.22886f}, - {-866.354f,-40.2455f,70.842f,0.0698132f}, - {-865.305f,-152.302f,63.5044f,4.86947f}, - {-861.926f,-79.0519f,71.4178f,0.20944f}, - {-857.292f,-152.277f,63.2114f,4.18879f}, - {-853.357f,-0.696194f,72.0655f,0.994838f}, - {-850.685f,-14.2596f,70.2298f,0.20944f}, - {-839.987f,-67.7695f,72.7916f,4.93928f}, - {-839.199f,-57.0558f,73.4891f,1.67552f}, - {-836.963f,-153.224f,63.3821f,4.46804f}, - {-832.721f,-67.7555f,72.9062f,4.99164f}, - {-821.496f,-143.095f,63.1292f,0.541052f}, - {-818.829f,-153.004f,62.1757f,6.12611f}, + {-917.648f, -46.8922f, 77.0872f, 5.27089f}, + {-912.689f, -45.4494f, 76.2277f, 4.60767f}, + {-905.455f, -84.5179f, 75.3642f, 3.29867f}, + {-904.332f, -111.509f, 75.5925f, 2.47837f}, + {-904.27f, -160.419f, 61.9876f, 3.61192f}, + {-904.023f, -90.4558f, 75.3706f, 3.40339f}, + {-978.678f, -37.3136f, 75.8364f, 2.84489f}, + {-973.076f, -36.5013f, 77.5047f, 1.0821f}, + {-963.951f, -87.734f, 81.5555f, 0.575959f}, + {-961.941f, -90.7252f, 81.6629f, 0.820305f}, + {-957.623f, -186.582f, 66.6021f, 1.95477f}, + {-952.476f, -179.778f, 78.6771f, 4.5204f}, + {-950.427f, -115.007f, 79.6127f, 3.68264f}, + {-950.25f, -151.95f, 79.4598f, -1.81423f}, + {-950.169f, -188.099f, 66.6184f, 5.55015f}, + {-949.944f, -142.977f, 80.5382f, 2.70526f}, + {-947.854f, -170.5f, 79.7618f, 0.942478f}, + {-946.738f, -139.567f, 80.0904f, 2.3911f}, + {-945.503f, -65.0654f, 79.7907f, 5.02655f}, + {-943.678f, -110.986f, 80.2557f, 0.959931f}, + {-942.993f, -56.9881f, 79.8915f, 5.65487f}, + {-938.197f, -155.838f, 61.3111f, 1.65806f}, + {-930.488f, -214.524f, 72.1431f, 2.1236f}, + {-929.947f, -154.449f, 61.5084f, 1.67552f}, + {-927.412f, -135.313f, 61.1987f, 3.29867f}, + {-920.677f, -156.859f, 62.8033f, 3.15306f}, + {-916.75f, -136.094f, 62.2357f, 0.0698132f}, + {-915.319f, -132.718f, 62.562f, 1.16984f}, + {-913.589f, -146.794f, 76.9366f, 1.8675f}, + {-907.572f, -148.937f, 76.6898f, 4.76475f}, + {-902.02f, -64.6174f, 73.9707f, 1.19169f}, + {-899.489f, -61.7252f, 73.2498f, 5.09636f}, + {-894.792f, -127.141f, 75.3834f, 6.14356f}, + {-892.408f, -162.525f, 64.1212f, 2.69884f}, + {-892.326f, -123.158f, 76.0318f, 5.5676f}, + {-888.468f, -148.462f, 61.8012f, 1.65806f}, + {-883.268f, -159.738f, 63.5311f, 5.20108f}, + {-877.76f, -118.07f, 65.215f, 2.94961f}, + {-876.792f, -128.646f, 64.1045f, 3.40339f}, + {-874.901f, -36.6579f, 69.4246f, 2.00713f}, + {-874.856f, -151.351f, 62.7537f, 3.57875f}, + {-872.135f, -150.08f, 62.7513f, 3.57201f}, + {-870.288f, -149.217f, 62.5413f, 3.56624f}, + {-870.03f, -6.27443f, 70.3867f, 2.3911f}, + {-869.023f, -82.2118f, 69.5848f, 3.22886f}, + {-866.354f, -40.2455f, 70.842f, 0.0698132f}, + {-865.305f, -152.302f, 63.5044f, 4.86947f}, + {-861.926f, -79.0519f, 71.4178f, 0.20944f}, + {-857.292f, -152.277f, 63.2114f, 4.18879f}, + {-853.357f, -0.696194f, 72.0655f, 0.994838f}, + {-850.685f, -14.2596f, 70.2298f, 0.20944f}, + {-839.987f, -67.7695f, 72.7916f, 4.93928f}, + {-839.199f, -57.0558f, 73.4891f, 1.67552f}, + {-836.963f, -153.224f, 63.3821f, 4.46804f}, + {-832.721f, -67.7555f, 72.9062f, 4.99164f}, + {-821.496f, -143.095f, 63.1292f, 0.541052f}, + {-818.829f, -153.004f, 62.1757f, 6.12611f}, //special - {-954.622f,-110.958f,80.7911f,6.24828f}, - {-951.477f,-53.9647f,80.0235f,5.32325f}, - {-946.812f,-126.04f,78.8601f,5.15265f}, - {-940.689f,-140.707f,79.9225f,2.79253f}, - {-933.954f,-159.632f,60.778f,2.56563f}, - {-922.537f,-130.291f,61.3756f,4.95674f}, - {-915.862f,-151.74f,76.9427f,0.942478f}, - {-888.321f,-159.831f,62.5303f,1.20428f}, - {-874.361f,-42.4751f,69.4316f,0.785398f}, - {-873.19f,-50.4899f,70.0568f,-2.41288f}, - {-868.511f,-148.386f,62.3547f,3.57875f}, - {-868.44f,-121.649f,64.5056f,3.33358f}, - {-868.324f,-77.7196f,71.4768f,5.41052f}, - {-859.846f,-19.6549f,70.7304f,1.97222f}, - {-828.05f,-150.508f,62.2019f,2.14675f}, - {-826.254f,-58.6911f,72.0041f,3.68264f}, - {-976.086f,-44.1775f,76.029f,1.46608f}, - {-971.864f,-87.4223f,81.4954f,5.8294f}, - {-966.551f,-74.1111f,80.0243f,4.2129f}, - {-958.509f,-173.652f,77.9013f,6.24828f}, - {-951.511f,-181.242f,65.529f,4.39823f}, - {-940.967f,-186.243f,77.698f,1.28164f}, - {-930.004f,-65.0898f,79.077f,0.0581657f}, - {-920.864f,-40.2009f,78.256f,5.16617f}, - {-919.089f,-148.021f,62.0317f,2.59327f}, - {-901.516f,-116.329f,75.6876f,0.471239f}, - {-897.864f,-84.4348f,74.083f,3.00197f}, - {-897.617f,-52.0457f,71.9503f,4.36332f}, - {-894.891f,-153.951f,61.6827f,3.23569f}, - {-893.933f,-111.625f,75.6591f,4.22536f}, - {-883.265f,-152.854f,61.8384f,0.0941087f}, - {-868.293f,-147.243f,62.1097f,3.2056f}, - {-867.501f,-11.8709f,70.018f,6.14356f}, - {-866.699f,-147.54f,62.1646f,3.57878f}, - {-866.566f,-91.1916f,67.4414f,4.56707f}, - {-857.272f,-141.142f,61.7356f,4.17134f}, - {-847.446f,-98.0061f,68.5131f,3.24631f}, - {-837.026f,-140.729f,62.5141f,5.51524f}, - {-824.204f,-65.053f,72.3381f,3.01942f}, + {-954.622f, -110.958f, 80.7911f, 6.24828f}, + {-951.477f, -53.9647f, 80.0235f, 5.32325f}, + {-946.812f, -126.04f, 78.8601f, 5.15265f}, + {-940.689f, -140.707f, 79.9225f, 2.79253f}, + {-933.954f, -159.632f, 60.778f, 2.56563f}, + {-922.537f, -130.291f, 61.3756f, 4.95674f}, + {-915.862f, -151.74f, 76.9427f, 0.942478f}, + {-888.321f, -159.831f, 62.5303f, 1.20428f}, + {-874.361f, -42.4751f, 69.4316f, 0.785398f}, + {-873.19f, -50.4899f, 70.0568f, -2.41288f}, + {-868.511f, -148.386f, 62.3547f, 3.57875f}, + {-868.44f, -121.649f, 64.5056f, 3.33358f}, + {-868.324f, -77.7196f, 71.4768f, 5.41052f}, + {-859.846f, -19.6549f, 70.7304f, 1.97222f}, + {-828.05f, -150.508f, 62.2019f, 2.14675f}, + {-826.254f, -58.6911f, 72.0041f, 3.68264f}, + {-976.086f, -44.1775f, 76.029f, 1.46608f}, + {-971.864f, -87.4223f, 81.4954f, 5.8294f}, + {-966.551f, -74.1111f, 80.0243f, 4.2129f}, + {-958.509f, -173.652f, 77.9013f, 6.24828f}, + {-951.511f, -181.242f, 65.529f, 4.39823f}, + {-940.967f, -186.243f, 77.698f, 1.28164f}, + {-930.004f, -65.0898f, 79.077f, 0.0581657f}, + {-920.864f, -40.2009f, 78.256f, 5.16617f}, + {-919.089f, -148.021f, 62.0317f, 2.59327f}, + {-901.516f, -116.329f, 75.6876f, 0.471239f}, + {-897.864f, -84.4348f, 74.083f, 3.00197f}, + {-897.617f, -52.0457f, 71.9503f, 4.36332f}, + {-894.891f, -153.951f, 61.6827f, 3.23569f}, + {-893.933f, -111.625f, 75.6591f, 4.22536f}, + {-883.265f, -152.854f, 61.8384f, 0.0941087f}, + {-868.293f, -147.243f, 62.1097f, 3.2056f}, + {-867.501f, -11.8709f, 70.018f, 6.14356f}, + {-866.699f, -147.54f, 62.1646f, 3.57878f}, + {-866.566f, -91.1916f, 67.4414f, 4.56707f}, + {-857.272f, -141.142f, 61.7356f, 4.17134f}, + {-847.446f, -98.0061f, 68.5131f, 3.24631f}, + {-837.026f, -140.729f, 62.5141f, 5.51524f}, + {-824.204f, -65.053f, 72.3381f, 3.01942f}, //vermin (s.th special for this mine) - {-951.955f,-197.5f,77.212f,5.63741f}, - {-944.837f,-199.608f,77.0737f,4.97419f}, - {-933.494f,-209.063f,73.7803f,5.88176f}, - {-929.666f,-201.308f,73.7032f,5.02655f}, - {-978.997f,-249.356f,65.4345f,5.05464f}, - {-974.565f,-224.828f,69.5858f,4.88846f}, - {-946.514f,-259.239f,66.0874f,3.78132f}, - {-918.402f,-250.439f,69.5271f,2.21352f}, - {-910.14f,-229.959f,72.9279f,0.27677f}, - {-851.563f,-88.6527f,68.5983f,3.61896f}, + {-951.955f, -197.5f, 77.212f, 5.63741f}, + {-944.837f, -199.608f, 77.0737f, 4.97419f}, + {-933.494f, -209.063f, 73.7803f, 5.88176f}, + {-929.666f, -201.308f, 73.7032f, 5.02655f}, + {-978.997f, -249.356f, 65.4345f, 5.05464f}, + {-974.565f, -224.828f, 69.5858f, 4.88846f}, + {-946.514f, -259.239f, 66.0874f, 3.78132f}, + {-918.402f, -250.439f, 69.5271f, 2.21352f}, + {-910.14f, -229.959f, 72.9279f, 0.27677f}, + {-851.563f, -88.6527f, 68.5983f, 3.61896f}, //boss - {-848.902f,-92.931f,68.6325f,3.33350f}, + {-848.902f, -92.931f, 68.6325f, 3.33350f}, //herald - {-48.459f,-288.802f,55.47f,1.0f}, + {-48.459f, -288.802f, 55.47f, 1.0f}, //triggers - {637.083f,-32.6603f,45.9715f,1.14353f}, //firstaid_station - {669.007f,-294.078f,30.2909f,2.77507f}, //stormpike_grave - {77.8013f,-404.7f,46.7549f,-0.872665f}, //stoneheart_grave - {-202.581f,-112.73f,78.4876f,-0.715585f}, //snowfall_grave - {-611.962f,-396.17f,60.8351f,2.53682f}, //iceblood_grave - {-1082.45f,-346.823f,54.9219f,-1.53589f}, //frostwolf_grave - {-1402.21f,-307.431f,89.4424f,0.191986f}, //frostwolf_hut - {553.779f,-78.6566f,51.9378f,-1.22173f}, //dunbaldar_south - {674.001f,-143.125f,63.6615f,0.994838f}, //dunbaldar_north - {203.281f,-360.366f,56.3869f,-0.925024f}, //icewing_bunker - {-152.437f,-441.758f,40.3982f,-1.95477f}, //stoneheart_bunker - {-571.88f,-262.777f,75.0087f,-0.802851f}, //iceblood_tower - {-768.907f,-363.71f,90.8949f,1.07991f}, //tower_point - {-1302.9f,-316.981f,113.867f,2.00713f}, //frostwolf_etower - {-1297.5f,-266.767f,114.15f,3.31044f}, //frostwolf_wtower - {-57.7891f,-286.597f,15.6479f,6.02139f}, //AV_NPC_A_CAPTAIN balinda - {722.43f,-10.9982f,50.7046f,3.42085f}, //AV_NPC_A_BOSS vanndar - {-545.23f,-165.35f,57.7886f,3.01145f}, //AV_NPC_H_CAPTAIN galvangar - {-1370.9f,-219.793f,98.4258f,5.04381f} //AV_NPC_H_BOSS drek thar + {637.083f, -32.6603f, 45.9715f, 1.14353f}, //firstaid_station + {669.007f, -294.078f, 30.2909f, 2.77507f}, //stormpike_grave + {77.8013f, -404.7f, 46.7549f, -0.872665f}, //stoneheart_grave + {-202.581f, -112.73f, 78.4876f, -0.715585f}, //snowfall_grave + {-611.962f, -396.17f, 60.8351f, 2.53682f}, //iceblood_grave + {-1082.45f, -346.823f, 54.9219f, -1.53589f}, //frostwolf_grave + {-1402.21f, -307.431f, 89.4424f, 0.191986f}, //frostwolf_hut + {553.779f, -78.6566f, 51.9378f, -1.22173f}, //dunbaldar_south + {674.001f, -143.125f, 63.6615f, 0.994838f}, //dunbaldar_north + {203.281f, -360.366f, 56.3869f, -0.925024f}, //icewing_bunker + {-152.437f, -441.758f, 40.3982f, -1.95477f}, //stoneheart_bunker + {-571.88f, -262.777f, 75.0087f, -0.802851f}, //iceblood_tower + {-768.907f, -363.71f, 90.8949f, 1.07991f}, //tower_point + {-1302.9f, -316.981f, 113.867f, 2.00713f}, //frostwolf_etower + {-1297.5f, -266.767f, 114.15f, 3.31044f}, //frostwolf_wtower + {-57.7891f, -286.597f, 15.6479f, 6.02139f}, //AV_NPC_A_CAPTAIN balinda + {722.43f, -10.9982f, 50.7046f, 3.42085f}, //AV_NPC_A_BOSS vanndar + {-545.23f, -165.35f, 57.7886f, 3.01145f}, //AV_NPC_H_CAPTAIN galvangar + {-1370.9f, -219.793f, 98.4258f, 5.04381f} //AV_NPC_H_BOSS drek thar }; enum BG_AV_CreatureIds @@ -1042,16 +1042,16 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { { 13326, 1216, 59, 59 }, //Seasoned Defender { 13331, 1216, 60, 60 }, //Veteran Defender { 13422, 1216, 61, 61 }, //Champion Defender - { 13358, 1216, 59, 60 }, //Stormpike Bowman //i think its 60,61 and 69,70.. but this is until now not possible TODO look if this is ok - { 11949,469,0,0},//not spawned with this data, but used for handlekillunit - { 11948,469,0,0},//not spawned with this data, but used for handlekillunit + { 13358, 1216, 59, 60 }, //Stormpike Bowman //i think its 60, 61 and 69, 70.. but this is until now not possible TODO look if this is ok + { 11949, 469, 0, 0}, //not spawned with this data, but used for handlekillunit + { 11948, 469, 0, 0}, //not spawned with this data, but used for handlekillunit { 12053, 1214, 58, 58 }, //Frostwolf Guardian { 13328, 1214, 59, 59 }, //Seasoned Guardian { 13332, 1214, 60, 60 }, //Veteran Guardian { 13421, 1214, 61, 61 }, //Champion Guardian { 13359, 1214, 59, 60 }, //Frostwolf Bowman - { 11947,67,0,0}, //not spawned with this data, but used for handlekillunit - { 11946,67,0,0}, //not spawned with this data, but used for handlekillunit + { 11947, 67, 0, 0}, //not spawned with this data, but used for handlekillunit + { 11946, 67, 0, 0}, //not spawned with this data, but used for handlekillunit { 14763, 1534, 60, 60 }, //Dun Baldar South Marshal { 14762, 1534, 60, 60 }, //Dun Baldar North Marshal { 14764, 1534, 60, 60 }, //Icewing Marshal @@ -1067,15 +1067,15 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { { 11602, 59, 54, 55 }, //Irondeep Skullthumper { 11657, 59, 58, 58 }, //Morloch - {13396,469,52,53}, //irondeep alliance TODO: get the right ids - {13080,469,53,54}, - {13098,469,54,55}, - {13078,469,58,58}, + {13396, 469, 52, 53}, //irondeep alliance TODO: get the right ids + {13080, 469, 53, 54}, + {13098, 469, 54, 55}, + {13078, 469, 58, 58}, - {13397,67,52,53}, //irondeep horde - {13099,67,53,54}, - {13081,67,54,55}, - {13079,67,58,58}, + {13397, 67, 52, 53}, //irondeep horde + {13099, 67, 53, 54}, + {13081, 67, 54, 55}, + {13079, 67, 58, 58}, { 11603, 59, 52, 53 }, //south mine neutral { 11604, 59, 53, 54 }, @@ -1083,144 +1083,144 @@ const uint32 BG_AV_CreatureInfo[AV_NPC_INFO_MAX][4] = { { 11677, 59, 58, 58 }, { 10982, 59, 52, 53 }, //vermin - {13317,469,52,53}, //alliance - {13096,469,54,55}, //explorer - {13087,469,54,55}, //invader - {13086,469,58,58}, + {13317, 469, 52, 53}, //alliance + {13096, 469, 54, 55}, //explorer + {13087, 469, 54, 55}, //invader + {13086, 469, 58, 58}, - {13316,67,52,53}, //horde - {13097,67,54,55}, //surveypr - {13089,67,54,55}, //guard - {13088,67,58,58}, - {14848,67,58,58} //Herald + {13316, 67, 52, 53}, //horde + {13097, 67, 54, 55}, //surveypr + {13089, 67, 54, 55}, //guard + {13088, 67, 58, 58}, + {14848, 67, 58, 58} //Herald }; -//x,y,z,o,static_creature_info-id +//x, y, z, o, static_creature_info-id const float BG_AV_StaticCreaturePos[AV_STATICCPLACE_MAX][5] = { //static creatures - {-1235.31f,-340.777f,60.5088f,3.31613f,0 },//2225 - Zora Guthrek - {-1244.02f,-323.795f,61.0485f,5.21853f,1 },//3343 - Grelkor - {-1235.16f,-332.302f,60.2985f,2.96706f,2 },//3625 - Rarck - {587.303f,-42.8257f,37.5615f,5.23599f,3 },//4255 - Brogus Thunderbrew - {643.635f,-58.3987f,41.7405f,4.72984f,4 },//4257 - Lana Thunderbrew - {591.464f,-44.452f,37.6166f,5.65487f,5 },//5134 - Jonivera Farmountain - {608.515f,-33.3935f,42.0003f,5.41052f,6 },//5135 - Svalbrad Farmountain - {617.656f,-32.0701f,42.7168f,4.06662f,7 },//5139 - Kurdrum Barleybeard - {-1183.76f,-268.295f,72.8233f,3.28122f,8 },//10364 - Yaelika Farclaw - {-1187.86f,-275.31f,73.0481f,3.63028f,9 },//10367 - Shrye Ragefist - {-1008.42f,-368.006f,55.3426f,5.95647f,10 },//10981 - Frostwolf - {-1091.92f,-424.28f,53.0139f,2.93958f,10 },//10981 - Frostwolf - {-558.455f,-198.768f,58.1755f,4.97946f,10 },//10981 - Frostwolf - {-861.247f,-312.51f,55.1427f,3.35382f,10 },//10981 - Frostwolf - {-1003.81f,-395.913f,50.4736f,2.85631f,10 },//10981 - Frostwolf - {-904.5f,-289.815f,65.1222f,5.7847f,10 },//10981 - Frostwolf - {-1064.41f,-438.839f,51.3614f,1.88857f,10 },//10981 - Frostwolf - {258.814f,76.2017f,18.6468f,6.19052f,11 },//10986 - Snowblind Harpy - {265.838f,-315.846f,-16.5429f,3.15917f,11 },//10986 - Snowblind Harpy - {426.485f,-51.1927f,-5.66286f,1.60347f,11 },//10986 - Snowblind Harpy - {452.044f,-33.9594f,-0.044651f,2.72815f,11 },//10986 - Snowblind Harpy - {266.032f,-315.639f,-16.5429f,4.67962f,11 },//10986 - Snowblind Harpy - {532.64f,-54.5863f,20.7024f,2.93215f,11 },//10986 - Snowblind Harpy - {295.183f,-299.908f,-34.6123f,0.135851f,12 },//10990 - Alterac Ram - {421.08f,-225.006f,-23.73f,0.166754f,12 },//10990 - Alterac Ram - {-55.7766f,-192.498f,20.4352f,6.12221f,12 },//10990 - Alterac Ram - {527.887f,-477.223f,62.3559f,0.170935f,12 },//10990 - Alterac Ram - {389.144f,-346.508f,-30.334f,4.14117f,12 },//10990 - Alterac Ram - {108.121f,-322.248f,37.5655f,4.46788f,12 },//10990 - Alterac Ram - {507.479f,-67.9403f,10.3571f,3.26304f,12 },//10990 - Alterac Ram - {329.071f,-185.016f,-29.1542f,0.356943f,12 },//10990 - Alterac Ram - {252.449f,-422.313f,35.1404f,4.53771f,12 },//10990 - Alterac Ram - {358.882f,-118.061f,-24.9119f,2.29257f,12 },//10990 - Alterac Ram - {487.151f,-174.229f,14.7558f,4.73192f,12 },//10990 - Alterac Ram - {449.652f,-123.561f,6.14273f,6.12029f,12 },//10990 - Alterac Ram - {272.419f,-261.802f,-41.8835f,3.66559f,12 },//10990 - Alterac Ram - {359.021f,-210.954f,-29.3483f,4.31339f,12 },//10990 - Alterac Ram - {450.598f,-318.048f,-37.7548f,0.655219f,12 },//10990 - Alterac Ram - {509.333f,-218.2f,3.05439f,3.66292f,12 },//10990 - Alterac Ram - {485.771f,-223.613f,-1.53f,2.04862f,12 },//10990 - Alterac Ram - {486.636f,-452.172f,39.6592f,2.3341f,12 },//10990 - Alterac Ram - {702.783f,-257.494f,25.9777f,1.68329f,12 },//10990 - Alterac Ram - {460.942f,-199.263f,-6.0149f,0.380506f,12 },//10990 - Alterac Ram - {483.108f,-115.307f,10.1056f,3.69701f,12 },//10990 - Alterac Ram - {471.601f,-154.174f,14.0702f,5.5807f,12 },//10990 - Alterac Ram - {213.938f,-420.793f,41.2549f,5.71394f,12 },//10990 - Alterac Ram - {289.387f,-294.685f,-33.9073f,0.555494f,12 },//10990 - Alterac Ram - {155.649f,-402.891f,43.3915f,5.94838f,12 },//10990 - Alterac Ram - {517.184f,-295.105f,-9.78195f,6.05668f,12 },//10990 - Alterac Ram - {102.334f,-332.165f,38.9812f,3.31445f,12 },//10990 - Alterac Ram - {320.244f,-107.793f,-42.6357f,-1.00311f,12 },//10990 - Alterac Ram - {217.976f,110.774f,15.7603f,4.56793f,13 },//11675 - Snowblind Windcaller - {269.872f,6.66684f,20.7592f,0.381212f,13 },//11675 - Snowblind Windcaller - {313.528f,-319.041f,-27.2373f,0.554098f,13 },//11675 - Snowblind Windcaller - {435.441f,-39.9289f,-0.169651f,0.549454f,13 },//11675 - Snowblind Windcaller - {315.115f,-317.62f,-29.1123f,0.90111f,13 },//11675 - Snowblind Windcaller - {428.091f,-122.731f,3.40332f,6.05901f,14 },//11678 - Snowblind Ambusher - {235.05f,85.5705f,18.3079f,-0.914255f,14 },//11678 - Snowblind Ambusher - {-1553.04f,-344.342f,64.4163f,6.09933f,15 },//11839 - Wildpaw Brute - {-545.23f,-165.35f,57.7886f,3.01145f,16 },//11947 - Captain Galvangar - {722.43f,-10.9982f,50.7046f,3.42085f,17 },//11948 - Vanndar Stormpike - {-57.7891f,-286.597f,15.6479f,6.02139f,18 },//11949 - Captain Balinda Stonehearth - {930.498f,-520.755f,93.7334f,1.8326f,19 },//11997 - Stormpike Herald - {-776.092f,-345.161f,67.4092f,1.89257f,20 },//12051 - Frostwolf Legionnaire - {-1224.63f,-308.144f,65.0087f,4.01139f,20 },//12051 - Frostwolf Legionnaire - {-713.039f,-442.515f,82.8638f,0.68724f,20 },//12051 - Frostwolf Legionnaire - {-711.783f,-444.061f,82.7039f,0.683494f,20 },//12051 - Frostwolf Legionnaire - {587.633f,-45.9816f,37.5438f,5.81195f,21 },//12096 - Stormpike Quartermaster - {-1293.79f,-194.407f,72.4398f,5.84685f,22 },//12097 - Frostwolf Quartermaster - {446.163f,-377.119f,-1.12725f,0.209526f,23 },//12127 - Stormpike Guardsman - {549.348f,-399.254f,53.3537f,3.24729f,23 },//12127 - Stormpike Guardsman - {549.801f,-401.217f,53.8305f,3.24729f,23 },//12127 - Stormpike Guardsman - {192.704f,-406.874f,42.9183f,6.10696f,23 },//12127 - Stormpike Guardsman - {441.305f,-435.765f,28.2385f,2.14472f,23 },//12127 - Stormpike Guardsman - {192.982f,-404.891f,43.0132f,6.1061f,23 },//12127 - Stormpike Guardsman - {355.342f,-391.989f,-0.486707f,3.00643f,23 },//12127 - Stormpike Guardsman - {446.035f,-375.104f,-1.12725f,0.21033f,23 },//12127 - Stormpike Guardsman - {697.864f,-433.238f,62.7914f,1.65776f,23 },//12127 - Stormpike Guardsman - {610.74f,-331.585f,30.8021f,5.14253f,23 },//12127 - Stormpike Guardsman - {609.815f,-329.775f,30.9271f,-2.38829f,23 },//12127 - Stormpike Guardsman - {695.874f,-433.434f,62.8543f,1.65776f,23 },//12127 - Stormpike Guardsman - {443.337f,-435.283f,28.6842f,2.13768f,23 },//12127 - Stormpike Guardsman - {-1251.5f,-316.327f,62.6565f,5.02655f,24 },//13176 - Smith Regzar - {-1332.0f,-331.243f,91.2631f,1.50098f,25 },//13179 - Wing Commander Guse - {569.983f,-94.9992f,38.0325f,1.39626f,26 },//13216 - Gaelden Hammersmith - {-1244.92f,-308.916f,63.2525f,1.62316f,27 },//13218 - Grunnda Wolfheart - {-1319.56f,-342.675f,60.3404f,1.20428f,28 },//13236 - Primalist Thurloga - {647.61f,-61.1548f,41.7405f,4.24115f,29 },//13257 - Murgot Deepforge - {-1321.64f,-343.73f,60.4833f,1.01229f,30 },//13284 - Frostwolf Shaman - {-1317.61f,-342.853f,60.3726f,2.47837f,30 },//13284 - Frostwolf Shaman - {-1319.31f,-344.475f,60.3825f,1.72788f,30 },//13284 - Frostwolf Shaman - {569.963f,-42.0218f,37.7581f,4.27606f,31 },//13438 - Wing Commander Slidore - {729.2f,-78.812f,51.6335f,3.97935f,32 },//13442 - Arch Druid Renferal - {729.118f,-82.8713f,51.6335f,2.53073f,33 },//13443 - Druid of the Grove - {725.554f,-79.4973f,51.6335f,5.27089f,33 },//13443 - Druid of the Grove - {724.768f,-84.1642f,51.6335f,0.733038f,33 },//13443 - Druid of the Grove - {596.68f,-83.0633f,39.0051f,6.24828f,34 },//13447 - Corporal Noreg Stormpike - {600.032f,-2.92475f,42.0788f,5.00909f,35 },//13577 - Stormpike Ram Rider Commander - {610.239f,-21.8454f,43.272f,4.90438f,36 },//13617 - Stormpike Stable Master - {613.422f,-150.764f,33.4517f,5.55015f,37 },//13797 - Mountaineer Boombellow - {-1213.91f,-370.619f,56.4455f,0.837758f,38 },//13798 - Jotek - {704.35f,-22.9071f,50.2187f,0.785398f,39 },//13816 - Prospector Stonehewer - {-1271.24f,-335.766f,62.3971f,5.75959f,40 },//14185 - Najak Hexxen - {-1268.64f,-332.688f,62.6171f,5.28835f,41 },//14186 - Ravak Grimtotem - {648.363f,-65.2233f,41.7405f,3.12414f,42 },//14187 - Athramanis - {648.238f,-67.8931f,41.7405f,2.60054f,43 },//14188 - Dirk Swindle - {-1223.44f,-309.833f,64.9331f,4.0131f,44 },//14282 - Frostwolf Bloodhound - {-1226.4f,-307.136f,64.9706f,4.0145f,44 },//14282 - Frostwolf Bloodhound - {356.001f,-389.969f,-0.438796f,3.0334f,45 },//14283 - Stormpike Owl - {355.835f,-394.005f,-0.60149f,3.02498f,45 },//14283 - Stormpike Owl - {882.266f,-496.378f,96.7707f,4.83248f,45 },//14283 - Stormpike Owl - {878.649f,-495.917f,96.6171f,4.67693f,45 },//14283 - Stormpike Owl - {932.851f,-511.017f,93.6748f,3.61004f,45 },//14283 - Stormpike Owl - {935.806f,-513.983f,93.7436f,3.61788f,45 },//14283 - Stormpike Owl - {947.412f,-509.982f,95.1098f,2.82743f,46 },//14284 - Stormpike Battleguard - {934.557f,-512.395f,93.662f,3.61004f,46 },//14284 - Stormpike Battleguard - {939.42f,-502.777f,94.5887f,5.14872f,46 },//14284 - Stormpike Battleguard - {854.276f,-494.241f,96.8017f,5.44543f,46 },//14284 - Stormpike Battleguard - {776.621f,-487.775f,99.4049f,3.50811f,46 },//14284 - Stormpike Battleguard - {880.169f,-495.699f,96.6204f,4.8325f,46 },//14284 - Stormpike Battleguard - {773.651f,-497.482f,99.0408f,2.11185f,46 },//14284 - Stormpike Battleguard - {949.1f,-506.913f,95.4237f,3.31613f,46 },//14284 - Stormpike Battleguard - {-1370.9f,-219.793f,98.4258f,5.04381f,47}, //drek thar + {-1235.31f, -340.777f, 60.5088f, 3.31613f, 0 }, //2225 - Zora Guthrek + {-1244.02f, -323.795f, 61.0485f, 5.21853f, 1 }, //3343 - Grelkor + {-1235.16f, -332.302f, 60.2985f, 2.96706f, 2 }, //3625 - Rarck + {587.303f, -42.8257f, 37.5615f, 5.23599f, 3 }, //4255 - Brogus Thunderbrew + {643.635f, -58.3987f, 41.7405f, 4.72984f, 4 }, //4257 - Lana Thunderbrew + {591.464f, -44.452f, 37.6166f, 5.65487f, 5 }, //5134 - Jonivera Farmountain + {608.515f, -33.3935f, 42.0003f, 5.41052f, 6 }, //5135 - Svalbrad Farmountain + {617.656f, -32.0701f, 42.7168f, 4.06662f, 7 }, //5139 - Kurdrum Barleybeard + {-1183.76f, -268.295f, 72.8233f, 3.28122f, 8 }, //10364 - Yaelika Farclaw + {-1187.86f, -275.31f, 73.0481f, 3.63028f, 9 }, //10367 - Shrye Ragefist + {-1008.42f, -368.006f, 55.3426f, 5.95647f, 10 }, //10981 - Frostwolf + {-1091.92f, -424.28f, 53.0139f, 2.93958f, 10 }, //10981 - Frostwolf + {-558.455f, -198.768f, 58.1755f, 4.97946f, 10 }, //10981 - Frostwolf + {-861.247f, -312.51f, 55.1427f, 3.35382f, 10 }, //10981 - Frostwolf + {-1003.81f, -395.913f, 50.4736f, 2.85631f, 10 }, //10981 - Frostwolf + {-904.5f, -289.815f, 65.1222f, 5.7847f, 10 }, //10981 - Frostwolf + {-1064.41f, -438.839f, 51.3614f, 1.88857f, 10 }, //10981 - Frostwolf + {258.814f, 76.2017f, 18.6468f, 6.19052f, 11 }, //10986 - Snowblind Harpy + {265.838f, -315.846f, -16.5429f, 3.15917f, 11 }, //10986 - Snowblind Harpy + {426.485f, -51.1927f, -5.66286f, 1.60347f, 11 }, //10986 - Snowblind Harpy + {452.044f, -33.9594f, -0.044651f, 2.72815f, 11 }, //10986 - Snowblind Harpy + {266.032f, -315.639f, -16.5429f, 4.67962f, 11 }, //10986 - Snowblind Harpy + {532.64f, -54.5863f, 20.7024f, 2.93215f, 11 }, //10986 - Snowblind Harpy + {295.183f, -299.908f, -34.6123f, 0.135851f, 12 }, //10990 - Alterac Ram + {421.08f, -225.006f, -23.73f, 0.166754f, 12 }, //10990 - Alterac Ram + {-55.7766f, -192.498f, 20.4352f, 6.12221f, 12 }, //10990 - Alterac Ram + {527.887f, -477.223f, 62.3559f, 0.170935f, 12 }, //10990 - Alterac Ram + {389.144f, -346.508f, -30.334f, 4.14117f, 12 }, //10990 - Alterac Ram + {108.121f, -322.248f, 37.5655f, 4.46788f, 12 }, //10990 - Alterac Ram + {507.479f, -67.9403f, 10.3571f, 3.26304f, 12 }, //10990 - Alterac Ram + {329.071f, -185.016f, -29.1542f, 0.356943f, 12 }, //10990 - Alterac Ram + {252.449f, -422.313f, 35.1404f, 4.53771f, 12 }, //10990 - Alterac Ram + {358.882f, -118.061f, -24.9119f, 2.29257f, 12 }, //10990 - Alterac Ram + {487.151f, -174.229f, 14.7558f, 4.73192f, 12 }, //10990 - Alterac Ram + {449.652f, -123.561f, 6.14273f, 6.12029f, 12 }, //10990 - Alterac Ram + {272.419f, -261.802f, -41.8835f, 3.66559f, 12 }, //10990 - Alterac Ram + {359.021f, -210.954f, -29.3483f, 4.31339f, 12 }, //10990 - Alterac Ram + {450.598f, -318.048f, -37.7548f, 0.655219f, 12 }, //10990 - Alterac Ram + {509.333f, -218.2f, 3.05439f, 3.66292f, 12 }, //10990 - Alterac Ram + {485.771f, -223.613f, -1.53f, 2.04862f, 12 }, //10990 - Alterac Ram + {486.636f, -452.172f, 39.6592f, 2.3341f, 12 }, //10990 - Alterac Ram + {702.783f, -257.494f, 25.9777f, 1.68329f, 12 }, //10990 - Alterac Ram + {460.942f, -199.263f, -6.0149f, 0.380506f, 12 }, //10990 - Alterac Ram + {483.108f, -115.307f, 10.1056f, 3.69701f, 12 }, //10990 - Alterac Ram + {471.601f, -154.174f, 14.0702f, 5.5807f, 12 }, //10990 - Alterac Ram + {213.938f, -420.793f, 41.2549f, 5.71394f, 12 }, //10990 - Alterac Ram + {289.387f, -294.685f, -33.9073f, 0.555494f, 12 }, //10990 - Alterac Ram + {155.649f, -402.891f, 43.3915f, 5.94838f, 12 }, //10990 - Alterac Ram + {517.184f, -295.105f, -9.78195f, 6.05668f, 12 }, //10990 - Alterac Ram + {102.334f, -332.165f, 38.9812f, 3.31445f, 12 }, //10990 - Alterac Ram + {320.244f, -107.793f, -42.6357f, -1.00311f, 12 }, //10990 - Alterac Ram + {217.976f, 110.774f, 15.7603f, 4.56793f, 13 }, //11675 - Snowblind Windcaller + {269.872f, 6.66684f, 20.7592f, 0.381212f, 13 }, //11675 - Snowblind Windcaller + {313.528f, -319.041f, -27.2373f, 0.554098f, 13 }, //11675 - Snowblind Windcaller + {435.441f, -39.9289f, -0.169651f, 0.549454f, 13 }, //11675 - Snowblind Windcaller + {315.115f, -317.62f, -29.1123f, 0.90111f, 13 }, //11675 - Snowblind Windcaller + {428.091f, -122.731f, 3.40332f, 6.05901f, 14 }, //11678 - Snowblind Ambusher + {235.05f, 85.5705f, 18.3079f, -0.914255f, 14 }, //11678 - Snowblind Ambusher + {-1553.04f, -344.342f, 64.4163f, 6.09933f, 15 }, //11839 - Wildpaw Brute + {-545.23f, -165.35f, 57.7886f, 3.01145f, 16 }, //11947 - Captain Galvangar + {722.43f, -10.9982f, 50.7046f, 3.42085f, 17 }, //11948 - Vanndar Stormpike + {-57.7891f, -286.597f, 15.6479f, 6.02139f, 18 }, //11949 - Captain Balinda Stonehearth + {930.498f, -520.755f, 93.7334f, 1.8326f, 19 }, //11997 - Stormpike Herald + {-776.092f, -345.161f, 67.4092f, 1.89257f, 20 }, //12051 - Frostwolf Legionnaire + {-1224.63f, -308.144f, 65.0087f, 4.01139f, 20 }, //12051 - Frostwolf Legionnaire + {-713.039f, -442.515f, 82.8638f, 0.68724f, 20 }, //12051 - Frostwolf Legionnaire + {-711.783f, -444.061f, 82.7039f, 0.683494f, 20 }, //12051 - Frostwolf Legionnaire + {587.633f, -45.9816f, 37.5438f, 5.81195f, 21 }, //12096 - Stormpike Quartermaster + {-1293.79f, -194.407f, 72.4398f, 5.84685f, 22 }, //12097 - Frostwolf Quartermaster + {446.163f, -377.119f, -1.12725f, 0.209526f, 23 }, //12127 - Stormpike Guardsman + {549.348f, -399.254f, 53.3537f, 3.24729f, 23 }, //12127 - Stormpike Guardsman + {549.801f, -401.217f, 53.8305f, 3.24729f, 23 }, //12127 - Stormpike Guardsman + {192.704f, -406.874f, 42.9183f, 6.10696f, 23 }, //12127 - Stormpike Guardsman + {441.305f, -435.765f, 28.2385f, 2.14472f, 23 }, //12127 - Stormpike Guardsman + {192.982f, -404.891f, 43.0132f, 6.1061f, 23 }, //12127 - Stormpike Guardsman + {355.342f, -391.989f, -0.486707f, 3.00643f, 23 }, //12127 - Stormpike Guardsman + {446.035f, -375.104f, -1.12725f, 0.21033f, 23 }, //12127 - Stormpike Guardsman + {697.864f, -433.238f, 62.7914f, 1.65776f, 23 }, //12127 - Stormpike Guardsman + {610.74f, -331.585f, 30.8021f, 5.14253f, 23 }, //12127 - Stormpike Guardsman + {609.815f, -329.775f, 30.9271f, -2.38829f, 23 }, //12127 - Stormpike Guardsman + {695.874f, -433.434f, 62.8543f, 1.65776f, 23 }, //12127 - Stormpike Guardsman + {443.337f, -435.283f, 28.6842f, 2.13768f, 23 }, //12127 - Stormpike Guardsman + {-1251.5f, -316.327f, 62.6565f, 5.02655f, 24 }, //13176 - Smith Regzar + {-1332.0f, -331.243f, 91.2631f, 1.50098f, 25 }, //13179 - Wing Commander Guse + {569.983f, -94.9992f, 38.0325f, 1.39626f, 26 }, //13216 - Gaelden Hammersmith + {-1244.92f, -308.916f, 63.2525f, 1.62316f, 27 }, //13218 - Grunnda Wolfheart + {-1319.56f, -342.675f, 60.3404f, 1.20428f, 28 }, //13236 - Primalist Thurloga + {647.61f, -61.1548f, 41.7405f, 4.24115f, 29 }, //13257 - Murgot Deepforge + {-1321.64f, -343.73f, 60.4833f, 1.01229f, 30 }, //13284 - Frostwolf Shaman + {-1317.61f, -342.853f, 60.3726f, 2.47837f, 30 }, //13284 - Frostwolf Shaman + {-1319.31f, -344.475f, 60.3825f, 1.72788f, 30 }, //13284 - Frostwolf Shaman + {569.963f, -42.0218f, 37.7581f, 4.27606f, 31 }, //13438 - Wing Commander Slidore + {729.2f, -78.812f, 51.6335f, 3.97935f, 32 }, //13442 - Arch Druid Renferal + {729.118f, -82.8713f, 51.6335f, 2.53073f, 33 }, //13443 - Druid of the Grove + {725.554f, -79.4973f, 51.6335f, 5.27089f, 33 }, //13443 - Druid of the Grove + {724.768f, -84.1642f, 51.6335f, 0.733038f, 33 }, //13443 - Druid of the Grove + {596.68f, -83.0633f, 39.0051f, 6.24828f, 34 }, //13447 - Corporal Noreg Stormpike + {600.032f, -2.92475f, 42.0788f, 5.00909f, 35 }, //13577 - Stormpike Ram Rider Commander + {610.239f, -21.8454f, 43.272f, 4.90438f, 36 }, //13617 - Stormpike Stable Master + {613.422f, -150.764f, 33.4517f, 5.55015f, 37 }, //13797 - Mountaineer Boombellow + {-1213.91f, -370.619f, 56.4455f, 0.837758f, 38 }, //13798 - Jotek + {704.35f, -22.9071f, 50.2187f, 0.785398f, 39 }, //13816 - Prospector Stonehewer + {-1271.24f, -335.766f, 62.3971f, 5.75959f, 40 }, //14185 - Najak Hexxen + {-1268.64f, -332.688f, 62.6171f, 5.28835f, 41 }, //14186 - Ravak Grimtotem + {648.363f, -65.2233f, 41.7405f, 3.12414f, 42 }, //14187 - Athramanis + {648.238f, -67.8931f, 41.7405f, 2.60054f, 43 }, //14188 - Dirk Swindle + {-1223.44f, -309.833f, 64.9331f, 4.0131f, 44 }, //14282 - Frostwolf Bloodhound + {-1226.4f, -307.136f, 64.9706f, 4.0145f, 44 }, //14282 - Frostwolf Bloodhound + {356.001f, -389.969f, -0.438796f, 3.0334f, 45 }, //14283 - Stormpike Owl + {355.835f, -394.005f, -0.60149f, 3.02498f, 45 }, //14283 - Stormpike Owl + {882.266f, -496.378f, 96.7707f, 4.83248f, 45 }, //14283 - Stormpike Owl + {878.649f, -495.917f, 96.6171f, 4.67693f, 45 }, //14283 - Stormpike Owl + {932.851f, -511.017f, 93.6748f, 3.61004f, 45 }, //14283 - Stormpike Owl + {935.806f, -513.983f, 93.7436f, 3.61788f, 45 }, //14283 - Stormpike Owl + {947.412f, -509.982f, 95.1098f, 2.82743f, 46 }, //14284 - Stormpike Battleguard + {934.557f, -512.395f, 93.662f, 3.61004f, 46 }, //14284 - Stormpike Battleguard + {939.42f, -502.777f, 94.5887f, 5.14872f, 46 }, //14284 - Stormpike Battleguard + {854.276f, -494.241f, 96.8017f, 5.44543f, 46 }, //14284 - Stormpike Battleguard + {776.621f, -487.775f, 99.4049f, 3.50811f, 46 }, //14284 - Stormpike Battleguard + {880.169f, -495.699f, 96.6204f, 4.8325f, 46 }, //14284 - Stormpike Battleguard + {773.651f, -497.482f, 99.0408f, 2.11185f, 46 }, //14284 - Stormpike Battleguard + {949.1f, -506.913f, 95.4237f, 3.31613f, 46 }, //14284 - Stormpike Battleguard + {-1370.9f, -219.793f, 98.4258f, 5.04381f, 47}, //drek thar }; @@ -1433,42 +1433,42 @@ enum BG_AV_WorldStates //alliance_control neutral_control horde_control const uint32 BG_AV_MineWorldStates[2][3] = { - {1358, 1360,1359}, - {1355, 1357,1356} + {1358, 1360, 1359}, + {1355, 1357, 1356} }; //alliance_control alliance_assault h_control h_assault const uint32 BG_AV_NodeWorldStates[16][4] = { //Stormpike first aid station - {1325, 1326,1327,1328}, + {1325, 1326, 1327, 1328}, //Stormpike Graveyard - {1333,1335,1334,1336}, + {1333, 1335, 1334, 1336}, //Stoneheart Grave - {1302,1304,1301,1303}, + {1302, 1304, 1301, 1303}, //Snowfall Grave - {1341,1343,1342,1344}, + {1341, 1343, 1342, 1344}, //Iceblood grave - {1346,1348,1347,1349}, + {1346, 1348, 1347, 1349}, //Frostwolf Grave - {1337,1339,1338,1340}, + {1337, 1339, 1338, 1340}, //Frostwolf Hut - {1329,1331,1330,1332}, + {1329, 1331, 1330, 1332}, //Dunbaldar South Bunker - {1361,1375,1370,1378}, + {1361, 1375, 1370, 1378}, //Dunbaldar North Bunker - {1362,1374,1371,1379}, + {1362, 1374, 1371, 1379}, //Icewing Bunker - {1363,1376,1372,1380}, + {1363, 1376, 1372, 1380}, //Stoneheart Bunker - {1364,1377,1373,1381}, + {1364, 1377, 1373, 1381}, //Iceblood Tower - {1368,1390,1385,1395}, + {1368, 1390, 1385, 1395}, //Tower Point - {1367,1389,1384,1394}, + {1367, 1389, 1384, 1394}, //Frostwolf East - {1366,1388,1383,1393}, + {1366, 1388, 1383, 1393}, //Frostwolf West - {1365,1387,1382,1392}, + {1365, 1387, 1382, 1392}, }; enum BG_AV_QuestIds @@ -1546,7 +1546,7 @@ class BattlegroundAV : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr,uint64 guid); + void RemovePlayer(Player *plr, uint64 guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); virtual void ResetBGSubclass(); @@ -1560,7 +1560,7 @@ class BattlegroundAV : public Battleground void HandleKillPlayer(Player* player, Player *killer); void HandleKillUnit(Creature *unit, Player *killer); void HandleQuestComplete(uint32 questid, Player *player); - bool PlayerCanDoMineQuest(int32 GOId,uint32 team); + bool PlayerCanDoMineQuest(int32 GOId, uint32 team); void EndBattleground(uint32 winner); @@ -1572,7 +1572,7 @@ class BattlegroundAV : public Battleground void EventPlayerDefendsPoint(Player* player, uint32 object); void EventPlayerDestroyedPoint(BG_AV_Nodes node); - void AssaultNode(BG_AV_Nodes node,uint16 team); + void AssaultNode(BG_AV_Nodes node, uint16 team); void DestroyNode(BG_AV_Nodes node); void InitNode(BG_AV_Nodes node, uint16 team, bool tower); void DefendNode(BG_AV_Nodes node, uint16 team); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp index 57be71c1d21..35ff312d663 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundBE.cpp @@ -107,7 +107,7 @@ void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer) return; } - Battleground::HandleKillPlayer(player,killer); + Battleground::HandleKillPlayer(player, killer); UpdateArenaWorldState(); CheckArenaWinConditions(); @@ -115,7 +115,7 @@ void BattlegroundBE::HandleKillPlayer(Player *player, Player *killer) bool BattlegroundBE::HandlePlayerUnderMap(Player *player) { - player->TeleportTo(GetMapId(),6238.930176f,262.963470f,0.889519f,player->GetOrientation(),false); + player->TeleportTo(GetMapId(), 6238.930176f, 262.963470f, 0.889519f, player->GetOrientation(), false); return true; } @@ -142,7 +142,7 @@ void BattlegroundBE::HandleAreaTrigger(Player *Source, uint32 Trigger) } //if (buff_guid) - // HandleTriggerBuff(buff_guid,Source); + // HandleTriggerBuff(buff_guid, Source); } void BattlegroundBE::FillInitialWorldStates(WorldPacket &data) @@ -183,7 +183,7 @@ void BattlegroundBE::UpdatePlayerScore(Player* Source, uint32 type, uint32 value return; //there is nothing special in this score - Battleground::UpdatePlayerScore(Source,type,value, doAddHonor); + Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp index c4e5189998e..7ad258449d3 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundDS.cpp @@ -130,7 +130,7 @@ void BattlegroundDS::HandleKillPlayer(Player* player, Player* killer) return; } - Battleground::HandleKillPlayer(player,killer); + Battleground::HandleKillPlayer(player, killer); UpdateArenaWorldState(); CheckArenaWinConditions(); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp index 06f8e6d840f..ce8b2ae1857 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp @@ -569,7 +569,7 @@ void BattlegroundEY::RespawnFlagAfterDrop() if (obj) obj->Delete(); else - sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u",GUID_LOPART(GetDroppedFlagGUID())); + sLog->outError("BattlegroundEY: Unknown dropped flag guid: %u", GUID_LOPART(GetDroppedFlagGUID())); SetDroppedFlagGUID(0); } @@ -687,9 +687,9 @@ void BattlegroundEY::EventTeamLostPoint(Player *Source, uint32 Point) m_PointState[Point] = EY_POINT_NO_OWNER; if (Team == ALLIANCE) - SendMessageToAll(m_LosingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + SendMessageToAll(m_LosingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); else - SendMessageToAll(m_LosingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(m_LosingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source); UpdatePointsIcons(Team, Point); UpdatePointsCount(Team); @@ -731,9 +731,9 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point) m_PointState[Point] = EY_POINT_UNDER_CONTROL; if (Team == ALLIANCE) - SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance,CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); + SendMessageToAll(m_CapturingPointTypes[Point].MessageIdAlliance, CHAT_MSG_BG_SYSTEM_ALLIANCE, Source); else - SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde,CHAT_MSG_BG_SYSTEM_HORDE, Source); + SendMessageToAll(m_CapturingPointTypes[Point].MessageIdHorde, CHAT_MSG_BG_SYSTEM_HORDE, Source); if (m_BgCreatures[Point]) DelCreature(Point); @@ -744,7 +744,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point) sLog->outError("BatteGroundEY: Failed to spawn spirit guide! point: %u, team: %u, graveyard_id: %u", Point, Team, m_CapturingPointTypes[Point].GraveYardId); -// SpawnBGCreature(Point,RESPAWN_IMMEDIATELY); +// SpawnBGCreature(Point, RESPAWN_IMMEDIATELY); UpdatePointsIcons(Team, Point); UpdatePointsCount(Team); @@ -754,7 +754,7 @@ void BattlegroundEY::EventTeamCapturedPoint(Player *Source, uint32 Point) Creature* trigger = GetBGCreature(Point + 6);//0-5 spirit guides if (!trigger) - trigger = AddCreature(WORLD_TRIGGER,Point+6,Team,BG_EY_TriggerPositions[Point][0],BG_EY_TriggerPositions[Point][1],BG_EY_TriggerPositions[Point][2],BG_EY_TriggerPositions[Point][3]); + trigger = AddCreature(WORLD_TRIGGER, Point+6, Team, BG_EY_TriggerPositions[Point][0], BG_EY_TriggerPositions[Point][1], BG_EY_TriggerPositions[Point][2], BG_EY_TriggerPositions[Point][3]); //add bonus honor aura trigger creature when node is accupied //cast bonus aura (+50% honor in 25yards) @@ -910,7 +910,7 @@ WorldSafeLocsEntry const *BattlegroundEY::GetClosestGraveYard(Player* player) { entry = sWorldSafeLocsStore.LookupEntry(m_CapturingPointTypes[i].GraveYardId); if (!entry) - sLog->outError("BattlegroundEY: Not found graveyard: %u",m_CapturingPointTypes[i].GraveYardId); + sLog->outError("BattlegroundEY: Not found graveyard: %u", m_CapturingPointTypes[i].GraveYardId); else { distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h index 86d9569ae43..5a86767f286 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h @@ -348,7 +348,7 @@ class BattlegroundEY : public Battleground void RespawnFlag(bool send_message); void RespawnFlagAfterDrop(); - void RemovePlayer(Player *plr,uint64 guid); + void RemovePlayer(Player *plr, uint64 guid); void HandleBuffUse(uint64 const& buff_guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); void HandleKillPlayer(Player *player, Player *killer); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp index 0487b0bce79..9876bb05607 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.cpp @@ -63,10 +63,10 @@ BattlegroundIC::~BattlegroundIC() void BattlegroundIC::HandlePlayerResurrect(Player* player) { if (nodePoint[NODE_TYPE_QUARRY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H)) - player->CastSpell(player,SPELL_QUARRY,true); + player->CastSpell(player, SPELL_QUARRY, true); if (nodePoint[NODE_TYPE_REFINERY].nodeState == (player->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H)) - player->CastSpell(player,SPELL_OIL_REFINERY,true); + player->CastSpell(player, SPELL_OIL_REFINERY, true); } void BattlegroundIC::SendTransportInit(Player* player) @@ -95,8 +95,8 @@ void BattlegroundIC::DoAction(uint32 action, uint64 var) if (!plr || !gunshipAlliance || !gunshipHorde) return; - plr->CastSpell(plr,SPELL_PARACHUTE,true); // this must be changed, there is a trigger in each transport that casts the spell. - plr->CastSpell(plr,SPELL_SLOW_FALL,true); + plr->CastSpell(plr, SPELL_PARACHUTE, true); // this must be changed, there is a trigger in each transport that casts the spell. + plr->CastSpell(plr, SPELL_SLOW_FALL, true); plr->SetTransport(plr->GetTeamId() == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde); @@ -105,7 +105,7 @@ void BattlegroundIC::DoAction(uint32 action, uint64 var) plr->m_movementInfo.t_pos.m_positionZ = TransportMovementInfo.GetPositionZ(); plr->m_movementInfo.t_guid = (plr->GetTeamId() == TEAM_ALLIANCE ? gunshipAlliance : gunshipHorde)->GetGUID(); - plr->TeleportTo(GetMapId(),TeleportToTransportPosition.GetPositionX(),TeleportToTransportPosition.GetPositionY(),TeleportToTransportPosition.GetPositionZ(),TeleportToTransportPosition.GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT); + plr->TeleportTo(GetMapId(), TeleportToTransportPosition.GetPositionX(), TeleportToTransportPosition.GetPositionY(), TeleportToTransportPosition.GetPositionZ(), TeleportToTransportPosition.GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT); } void BattlegroundIC::Update(uint32 diff) @@ -148,7 +148,7 @@ void BattlegroundIC::Update(uint32 diff) } } - // we need to confirm this is blizzlike,not sure if it is every 3 minutes + // we need to confirm this is blizzlike, not sure if it is every 3 minutes for (uint8 u = (nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_1_A : BG_IC_NPC_GLAIVE_THROWER_1_H); u < (nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_NPC_GLAIVE_THROWER_2_A : BG_IC_NPC_GLAIVE_THROWER_2_H); u++) { if (Creature* glaiveThrower = GetBGCreature(u)) @@ -176,9 +176,9 @@ void BattlegroundIC::Update(uint32 diff) { if (siege->isAlive()) { - if (siege->HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE)) + if (siege->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE)) // following sniffs the vehicle always has UNIT_FLAG_UNK_14 - siege->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_OOC_NOT_ATTACKABLE); + siege->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_OOC_NOT_ATTACKABLE); else siege->SetHealth(siege->GetMaxHealth()); } @@ -205,7 +205,7 @@ void BattlegroundIC::Update(uint32 diff) { if (nodePoint[i].timer <= diff) { - uint32 nextBanner = GetNextBanner(&nodePoint[i],nodePoint[i].faction,true); + uint32 nextBanner = GetNextBanner(&nodePoint[i], nodePoint[i].faction, true); nodePoint[i].last_entry = nodePoint[i].gameobject_entry; nodePoint[i].gameobject_entry = nextBanner; @@ -219,14 +219,14 @@ void BattlegroundIC::Update(uint32 diff) float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() }; DelObject(nodePoint[i].gameobject_type); - AddObject(nodePoint[i].gameobject_type,nodePoint[i].gameobject_entry,cords[0],cords[1],cords[2],cords[3],0,0,0,0,RESPAWN_ONE_DAY); + AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY); GetBGObject(nodePoint[i].gameobject_type)->SetUInt32Value(GAMEOBJECT_FACTION, nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]); UpdateNodeWorldState(&nodePoint[i]); - HandleCapturedNodes(&nodePoint[i],false); + HandleCapturedNodes(&nodePoint[i], false); - SendMessage2ToAll(LANG_BG_IC_TEAM_HAS_TAKEN_NODE,CHAT_MSG_BG_SYSTEM_NEUTRAL,NULL,(nodePoint[i].faction == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE),nodePoint[i].string); + SendMessage2ToAll(LANG_BG_IC_TEAM_HAS_TAKEN_NODE, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (nodePoint[i].faction == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE), nodePoint[i].string); nodePoint[i].needChange = false; nodePoint[i].timer = BANNER_STATE_CHANGE_TIME; @@ -242,7 +242,7 @@ void BattlegroundIC::Update(uint32 diff) nodePoint[i].nodeState == NODE_STATE_CONTROLLED_H) { factionReinforcements[nodePoint[i].faction] += 1; - RewardHonorToTeam(RESOURCE_HONOR_AMOUNT,nodePoint[i].faction == TEAM_ALLIANCE ? ALLIANCE : HORDE); + RewardHonorToTeam(RESOURCE_HONOR_AMOUNT, nodePoint[i].faction == TEAM_ALLIANCE ? ALLIANCE : HORDE); UpdateWorldState((nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_ALLIANCE_RENFORT : BG_IC_HORDE_RENFORT), factionReinforcements[nodePoint[i].faction]); } } @@ -272,11 +272,11 @@ void BattlegroundIC::StartingEventOpenDoors() for (uint8 i = 0; i < MAX_FORTRESS_TELEPORTERS_SPAWNS; i++) { - if (!AddObject(BG_IC_Teleporters[i].type,BG_IC_Teleporters[i].entry, - BG_IC_Teleporters[i].x,BG_IC_Teleporters[i].y, - BG_IC_Teleporters[i].z,BG_IC_Teleporters[i].o, - 0,0,0,0,RESPAWN_ONE_DAY)) - sLog->outError("Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u",BG_IC_Teleporters[i].entry); + if (!AddObject(BG_IC_Teleporters[i].type, BG_IC_Teleporters[i].entry, + BG_IC_Teleporters[i].x, BG_IC_Teleporters[i].y, + BG_IC_Teleporters[i].z, BG_IC_Teleporters[i].o, + 0, 0, 0, 0, RESPAWN_ONE_DAY)) + sLog->outError("Isle of Conquest | Starting Event Open Doors: There was an error spawning gameobject %u", BG_IC_Teleporters[i].entry); } } @@ -302,10 +302,10 @@ void BattlegroundIC::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; if (nodePoint[NODE_TYPE_QUARRY].nodeState == (plr->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H)) - plr->CastSpell(plr,SPELL_QUARRY,true); + plr->CastSpell(plr, SPELL_QUARRY, true); if (nodePoint[NODE_TYPE_REFINERY].nodeState == (plr->GetTeamId() == TEAM_ALLIANCE ? NODE_STATE_CONTROLLED_A : NODE_STATE_CONTROLLED_H)) - plr->CastSpell(plr,SPELL_OIL_REFINERY,true); + plr->CastSpell(plr, SPELL_OIL_REFINERY, true); SendTransportInit(plr); } @@ -339,7 +339,7 @@ void BattlegroundIC::UpdatePlayerScore(Player* Source, uint32 type, uint32 value ((BattlegroundICScore*)itr->second)->BasesDefended += value; break; default: - Battleground::UpdatePlayerScore(Source,type,value, doAddHonor); + Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); break; } } @@ -353,7 +353,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPacket& data) for (uint8 i = 0; i < MAX_FORTRESS_GATES_SPAWNS; i++) { - uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry,(GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED ? true : false)); + uint32 uws = GetWorldStateFromGateEntry(BG_IC_ObjSpawnlocs[i].entry, (GateStatus[GetGateIDFromEntry(BG_IC_ObjSpawnlocs[i].entry)] == BG_IC_GATE_DESTROYED ? true : false)); data << uint32(uws) << uint32(1); } @@ -365,39 +365,39 @@ bool BattlegroundIC::SetupBattleground() { for (uint8 i = 0; i < MAX_NORMAL_GAMEOBJECTS_SPAWNS; i++) { - if (!AddObject(BG_IC_ObjSpawnlocs[i].type,BG_IC_ObjSpawnlocs[i].entry, - BG_IC_ObjSpawnlocs[i].x,BG_IC_ObjSpawnlocs[i].y, - BG_IC_ObjSpawnlocs[i].z,BG_IC_ObjSpawnlocs[i].o, - 0,0,0,0,RESPAWN_ONE_DAY)) + if (!AddObject(BG_IC_ObjSpawnlocs[i].type, BG_IC_ObjSpawnlocs[i].entry, + BG_IC_ObjSpawnlocs[i].x, BG_IC_ObjSpawnlocs[i].y, + BG_IC_ObjSpawnlocs[i].z, BG_IC_ObjSpawnlocs[i].o, + 0, 0, 0, 0, RESPAWN_ONE_DAY)) { - sLog->outError("Isle of Conquest: There was an error spawning gameobject %u",BG_IC_ObjSpawnlocs[i].entry); + sLog->outError("Isle of Conquest: There was an error spawning gameobject %u", BG_IC_ObjSpawnlocs[i].entry); return false; } } for (uint8 i = 0; i < MAX_NORMAL_NPCS_SPAWNS; i++) { - if (!AddCreature(BG_IC_NpcSpawnlocs[i].entry,BG_IC_NpcSpawnlocs[i].type,BG_IC_NpcSpawnlocs[i].team, - BG_IC_NpcSpawnlocs[i].x,BG_IC_NpcSpawnlocs[i].y, - BG_IC_NpcSpawnlocs[i].z,BG_IC_NpcSpawnlocs[i].o, + if (!AddCreature(BG_IC_NpcSpawnlocs[i].entry, BG_IC_NpcSpawnlocs[i].type, BG_IC_NpcSpawnlocs[i].team, + BG_IC_NpcSpawnlocs[i].x, BG_IC_NpcSpawnlocs[i].y, + BG_IC_NpcSpawnlocs[i].z, BG_IC_NpcSpawnlocs[i].o, RESPAWN_ONE_DAY)) { - sLog->outError("Isle of Conquest: There was an error spawning creature %u",BG_IC_NpcSpawnlocs[i].entry); + sLog->outError("Isle of Conquest: There was an error spawning creature %u", BG_IC_NpcSpawnlocs[i].entry); return false; } } - if (!AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+5,BG_IC_SpiritGuidePos[5][0], BG_IC_SpiritGuidePos[5][1],BG_IC_SpiritGuidePos[5][2], BG_IC_SpiritGuidePos[5][3],ALLIANCE) - || !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+6,BG_IC_SpiritGuidePos[6][0], BG_IC_SpiritGuidePos[6][1],BG_IC_SpiritGuidePos[6][2], BG_IC_SpiritGuidePos[6][3],HORDE) - || !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+3,BG_IC_SpiritGuidePos[7][0], BG_IC_SpiritGuidePos[7][1],BG_IC_SpiritGuidePos[7][2], BG_IC_SpiritGuidePos[7][3],ALLIANCE) - || !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+4,BG_IC_SpiritGuidePos[8][0], BG_IC_SpiritGuidePos[8][1],BG_IC_SpiritGuidePos[8][2], BG_IC_SpiritGuidePos[8][3],HORDE)) + if (!AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+5, BG_IC_SpiritGuidePos[5][0], BG_IC_SpiritGuidePos[5][1], BG_IC_SpiritGuidePos[5][2], BG_IC_SpiritGuidePos[5][3], ALLIANCE) + || !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+6, BG_IC_SpiritGuidePos[6][0], BG_IC_SpiritGuidePos[6][1], BG_IC_SpiritGuidePos[6][2], BG_IC_SpiritGuidePos[6][3], HORDE) + || !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+3, BG_IC_SpiritGuidePos[7][0], BG_IC_SpiritGuidePos[7][1], BG_IC_SpiritGuidePos[7][2], BG_IC_SpiritGuidePos[7][3], ALLIANCE) + || !AddSpiritGuide(BG_IC_NPC_SPIRIT_GUIDE_1+4, BG_IC_SpiritGuidePos[8][0], BG_IC_SpiritGuidePos[8][1], BG_IC_SpiritGuidePos[8][2], BG_IC_SpiritGuidePos[8][3], HORDE)) { sLog->outError("Isle of Conquest: Failed to spawn initial spirit guide!"); return false; } - gunshipHorde = CreateTransport(GO_HORDE_GUNSHIP,TRANSPORT_PERIOD_TIME); - gunshipAlliance = CreateTransport(GO_ALLIANCE_GUNSHIP,TRANSPORT_PERIOD_TIME); + gunshipHorde = CreateTransport(GO_HORDE_GUNSHIP, TRANSPORT_PERIOD_TIME); + gunshipAlliance = CreateTransport(GO_ALLIANCE_GUNSHIP, TRANSPORT_PERIOD_TIME); if (!gunshipAlliance || !gunshipHorde) { @@ -433,19 +433,19 @@ void BattlegroundIC::HandleKillUnit(Creature *unit, Player* killer) uint32 entry = unit->GetEntry(); if (entry == NPC_HIGH_COMMANDER_HALFORD_WYRMBANE) { - RewardHonorToTeam(WINNER_HONOR_AMOUNT,HORDE); + RewardHonorToTeam(WINNER_HONOR_AMOUNT, HORDE); EndBattleground(HORDE); } else if (entry == NPC_OVERLORD_AGMAR) { - RewardHonorToTeam(WINNER_HONOR_AMOUNT,ALLIANCE); + RewardHonorToTeam(WINNER_HONOR_AMOUNT, ALLIANCE); EndBattleground(ALLIANCE); } //Achievement Mowed Down // TO-DO: This should be done on the script of each vehicle of the BG. if (unit->IsVehicle()) - killer->CastSpell(killer,SPELL_DESTROYED_VEHICLE_ACHIEVEMENT,true); + killer->CastSpell(killer, SPELL_DESTROYED_VEHICLE_ACHIEVEMENT, true); } void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer) @@ -466,7 +466,7 @@ void BattlegroundIC::HandleKillPlayer(Player* player, Player* killer) void BattlegroundIC::EndBattleground(uint32 winner) { - SendMessage2ToAll(LANG_BG_IC_TEAM_WINS,CHAT_MSG_BG_SYSTEM_NEUTRAL,NULL, (winner == ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE)); + SendMessage2ToAll(LANG_BG_IC_TEAM_WINS, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (winner == ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE)); Battleground::EndBattleground(winner); } @@ -507,7 +507,7 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target if (nodePoint[i].faction == player->GetTeamId()) return; - uint32 nextBanner = GetNextBanner(&nodePoint[i],player->GetTeamId(),false); + uint32 nextBanner = GetNextBanner(&nodePoint[i], player->GetTeamId(), false); // we set the new settings of the nodePoint nodePoint[i].faction = player->GetTeamId(); @@ -531,8 +531,8 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target UpdatePlayerScore(player, SCORE_BASES_ASSAULTED, 1); - SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_1,CHAT_MSG_BG_SYSTEM_NEUTRAL,player,nodePoint[i].string); - SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_2,CHAT_MSG_BG_SYSTEM_NEUTRAL,player,nodePoint[i].string, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE)); + SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_1, CHAT_MSG_BG_SYSTEM_NEUTRAL, player, nodePoint[i].string); + SendMessage2ToAll(LANG_BG_IC_TEAM_ASSAULTED_NODE_2, CHAT_MSG_BG_SYSTEM_NEUTRAL, player, nodePoint[i].string, (player->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_ALLIANCE : LANG_BG_IC_HORDE)); HandleContestedNodes(&nodePoint[i]); } else if (nextBanner == nodePoint[i].banners[BANNER_A_CONTROLLED] || nextBanner == nodePoint[i].banners[BANNER_H_CONTROLLED]) @@ -540,8 +540,8 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target { nodePoint[i].timer = BANNER_STATE_CHANGE_TIME; nodePoint[i].needChange = false; - SendMessage2ToAll(LANG_BG_IC_TEAM_DEFENDED_NODE,CHAT_MSG_BG_SYSTEM_NEUTRAL,player,nodePoint[i].string); - HandleCapturedNodes(&nodePoint[i],true); + SendMessage2ToAll(LANG_BG_IC_TEAM_DEFENDED_NODE, CHAT_MSG_BG_SYSTEM_NEUTRAL, player, nodePoint[i].string); + HandleCapturedNodes(&nodePoint[i], true); UpdatePlayerScore(player, SCORE_BASES_DEFENDED, 1); } @@ -553,7 +553,7 @@ void BattlegroundIC::EventPlayerClickedOnFlag(Player* player, GameObject* target float cords[4] = {banner->GetPositionX(), banner->GetPositionY(), banner->GetPositionZ(), banner->GetOrientation() }; DelObject(nodePoint[i].gameobject_type); - AddObject(nodePoint[i].gameobject_type,nodePoint[i].gameobject_entry,cords[0],cords[1],cords[2],cords[3],0,0,0,0,RESPAWN_ONE_DAY); + AddObject(nodePoint[i].gameobject_type, nodePoint[i].gameobject_entry, cords[0], cords[1], cords[2], cords[3], 0, 0, 0, 0, RESPAWN_ONE_DAY); GetBGObject(nodePoint[i].gameobject_type)->SetUInt32Value(GAMEOBJECT_FACTION, nodePoint[i].faction == TEAM_ALLIANCE ? BG_IC_Factions[1] : BG_IC_Factions[0]); @@ -587,9 +587,9 @@ void BattlegroundIC::UpdateNodeWorldState(ICNodePoint* nodePoint) // with this we are sure we dont bug the client for (uint8 i = 0; i < 4; i++) - UpdateWorldState(nodePoint->worldStates[i],0); + UpdateWorldState(nodePoint->worldStates[i], 0); - UpdateWorldState(worldstate,1); + UpdateWorldState(worldstate, 1); } uint32 BattlegroundIC::GetNextBanner(ICNodePoint* nodePoint, uint32 team, bool returnDefinitve) @@ -637,7 +637,7 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) BG_IC_SpiritGuidePos[nodePoint->nodeType][0], BG_IC_SpiritGuidePos[nodePoint->nodeType][1], BG_IC_SpiritGuidePos[nodePoint->nodeType][2], BG_IC_SpiritGuidePos[nodePoint->nodeType][3], (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE))) - sLog->outError("Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u,", nodePoint->nodeType, nodePoint->faction); + sLog->outError("Isle of Conquest: Failed to spawn spirit guide! point: %u, team: %u, ", nodePoint->nodeType, nodePoint->faction); } switch(nodePoint->gameobject_type) @@ -651,9 +651,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) { uint8 type = BG_IC_GO_HANGAR_TELEPORTER_1+u; AddObject(type, (nodePoint->faction == TEAM_ALLIANCE ? GO_ALLIANCE_GUNSHIP_PORTAL : GO_HORDE_GUNSHIP_PORTAL), - BG_IC_HangarTeleporters[u].GetPositionX(),BG_IC_HangarTeleporters[u].GetPositionY(), - BG_IC_HangarTeleporters[u].GetPositionZ(),BG_IC_HangarTeleporters[u].GetOrientation(), - 0,0,0,0,RESPAWN_ONE_DAY); + BG_IC_HangarTeleporters[u].GetPositionX(), BG_IC_HangarTeleporters[u].GetPositionY(), + BG_IC_HangarTeleporters[u].GetPositionZ(), BG_IC_HangarTeleporters[u].GetOrientation(), + 0, 0, 0, 0, RESPAWN_ONE_DAY); } //sLog->outError("BG_IC_GO_HANGAR_BANNER CAPTURED Faction: %u", nodePoint->faction); @@ -663,12 +663,12 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) // we should spawn teleporters break; case BG_IC_GO_QUARRY_BANNER: - RemoveAuraOnTeam(SPELL_QUARRY,(nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE)); - CastSpellOnTeam(SPELL_QUARRY,(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)); + RemoveAuraOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE)); + CastSpellOnTeam(SPELL_QUARRY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)); break; case BG_IC_GO_REFINERY_BANNER: - RemoveAuraOnTeam(SPELL_OIL_REFINERY,(nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE)); - CastSpellOnTeam(SPELL_OIL_REFINERY,(nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)); + RemoveAuraOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? HORDE : ALLIANCE)); + CastSpellOnTeam(SPELL_OIL_REFINERY, (nodePoint->faction == TEAM_ALLIANCE ? ALLIANCE : HORDE)); break; case BG_IC_GO_DOCKS_BANNER: @@ -711,9 +711,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) if (GetBGCreature(type) && GetBGCreature(type)->isAlive()) continue; - if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H,type,nodePoint->faction, - BG_IC_DocksVehiclesGlaives[i].GetPositionX(),BG_IC_DocksVehiclesGlaives[i].GetPositionY(), - BG_IC_DocksVehiclesGlaives[i].GetPositionZ(),BG_IC_DocksVehiclesGlaives[i].GetOrientation(), + if (AddCreature(nodePoint->faction == TEAM_ALLIANCE ? NPC_GLAIVE_THROWER_A : NPC_GLAIVE_THROWER_H, type, nodePoint->faction, + BG_IC_DocksVehiclesGlaives[i].GetPositionX(), BG_IC_DocksVehiclesGlaives[i].GetPositionY(), + BG_IC_DocksVehiclesGlaives[i].GetPositionZ(), BG_IC_DocksVehiclesGlaives[i].GetOrientation(), RESPAWN_ONE_DAY)) GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); } @@ -726,9 +726,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) if (GetBGCreature(type) && GetBGCreature(type)->isAlive()) continue; - if (AddCreature(NPC_CATAPULT,type,nodePoint->faction, - BG_IC_DocksVehiclesCatapults[i].GetPositionX(),BG_IC_DocksVehiclesCatapults[i].GetPositionY(), - BG_IC_DocksVehiclesCatapults[i].GetPositionZ(),BG_IC_DocksVehiclesCatapults[i].GetOrientation(), + if (AddCreature(NPC_CATAPULT, type, nodePoint->faction, + BG_IC_DocksVehiclesCatapults[i].GetPositionX(), BG_IC_DocksVehiclesCatapults[i].GetPositionY(), + BG_IC_DocksVehiclesCatapults[i].GetPositionZ(), BG_IC_DocksVehiclesCatapults[i].GetOrientation(), RESPAWN_ONE_DAY)) GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); } @@ -761,9 +761,9 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) if (GetBGCreature(type) && GetBGCreature(type)->isAlive()) continue; - if (AddCreature(NPC_DEMOLISHER,type,nodePoint->faction, - BG_IC_WorkshopVehicles[i].GetPositionX(),BG_IC_WorkshopVehicles[i].GetPositionY(), - BG_IC_WorkshopVehicles[i].GetPositionZ(),BG_IC_WorkshopVehicles[i].GetOrientation(), + if (AddCreature(NPC_DEMOLISHER, type, nodePoint->faction, + BG_IC_WorkshopVehicles[i].GetPositionX(), BG_IC_WorkshopVehicles[i].GetPositionY(), + BG_IC_WorkshopVehicles[i].GetPositionZ(), BG_IC_WorkshopVehicles[i].GetOrientation(), RESPAWN_ONE_DAY)) GetBGCreature(type)->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); } @@ -784,14 +784,14 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) uint8 siegeType = (nodePoint->faction == TEAM_ALLIANCE ? BG_IC_NPC_SIEGE_ENGINE_A : BG_IC_NPC_SIEGE_ENGINE_H); if (!GetBGCreature(siegeType) || !GetBGCreature(siegeType)->isAlive()) { - AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H),siegeType,nodePoint->faction, - BG_IC_WorkshopVehicles[4].GetPositionX(),BG_IC_WorkshopVehicles[4].GetPositionY(), - BG_IC_WorkshopVehicles[4].GetPositionZ(),BG_IC_WorkshopVehicles[4].GetOrientation(), + AddCreature((nodePoint->faction == TEAM_ALLIANCE ? NPC_SIEGE_ENGINE_A : NPC_SIEGE_ENGINE_H), siegeType, nodePoint->faction, + BG_IC_WorkshopVehicles[4].GetPositionX(), BG_IC_WorkshopVehicles[4].GetPositionY(), + BG_IC_WorkshopVehicles[4].GetPositionZ(), BG_IC_WorkshopVehicles[4].GetOrientation(), RESPAWN_ONE_DAY); if (Creature* siegeEngine = GetBGCreature(siegeType)) { - siegeEngine->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE); + siegeEngine->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_UNK_14|UNIT_FLAG_OOC_NOT_ATTACKABLE); siegeEngine->setFaction(BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); } } @@ -799,15 +799,15 @@ void BattlegroundIC::HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture) for (uint8 i = 0; i < MAX_WORKSHOP_BOMBS_SPAWNS_PER_FACTION; i++) { - AddObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i,GO_SEAFORIUM_BOMBS, - workshopBombs[i].GetPositionX(),workshopBombs[i].GetPositionY(), - workshopBombs[i].GetPositionZ(),workshopBombs[i].GetOrientation(), - 0,0,0,0,10); + AddObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i, GO_SEAFORIUM_BOMBS, + workshopBombs[i].GetPositionX(), workshopBombs[i].GetPositionY(), + workshopBombs[i].GetPositionZ(), workshopBombs[i].GetOrientation(), + 0, 0, 0, 0, 10); if (GameObject* seaforiumBombs = GetBGObject(BG_IC_GO_SEAFORIUM_BOMBS_1+i)) { seaforiumBombs->SetRespawnTime(10); - seaforiumBombs->SetUInt32Value(GAMEOBJECT_FACTION,BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); + seaforiumBombs->SetUInt32Value(GAMEOBJECT_FACTION, BG_IC_Factions[(nodePoint->faction == TEAM_ALLIANCE ? 0 : 1)]); } } break; @@ -824,7 +824,7 @@ void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedE uint32 uws_close = GetWorldStateFromGateEntry(go->GetEntry(), false); if (uws_open) { - UpdateWorldState(uws_close,0); + UpdateWorldState(uws_close, 0); UpdateWorldState(uws_open, 1); } DoorOpen((pl->GetTeamId() == TEAM_ALLIANCE ? BG_IC_GO_HORDE_KEEP_PORTCULLIS : BG_IC_GO_DOODAD_PORTCULLISACTIVE02)); @@ -850,7 +850,7 @@ void BattlegroundIC::DestroyGate(Player* pl, GameObject* go, uint32 /*destroyedE break; } - SendMessage2ToAll(lang_entry,CHAT_MSG_BG_SYSTEM_NEUTRAL,NULL,(pl->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP)); + SendMessage2ToAll(lang_entry, CHAT_MSG_BG_SYSTEM_NEUTRAL, NULL, (pl->GetTeamId() == TEAM_ALLIANCE ? LANG_BG_IC_HORDE_KEEP : LANG_BG_IC_ALLIANCE_KEEP)); } void BattlegroundIC::EventPlayerDamagedGO(Player* /*plr*/, GameObject* /*go*/, uint32 /*eventType*/) @@ -897,9 +897,9 @@ WorldSafeLocsEntry const* BattlegroundIC::GetClosestGraveYard(Player* player) return good_entry; } -Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period) +Transport* BattlegroundIC::CreateTransport(uint32 goEntry, uint32 period) { - Transport* t = new Transport(period,0); + Transport* t = new Transport(period, 0); const GameObjectTemplate* goinfo = sObjectMgr->GetGameObjectTemplate(goEntry); @@ -915,7 +915,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period) if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed)) // skip transports with empty waypoints list { - sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId); + sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId); delete t; return NULL; } @@ -928,7 +928,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period) float o = 1; // creates the Gameobject - if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT),goEntry, mapid, x, y, z, o, 100, 0)) + if (!t->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_MO_TRANSPORT), goEntry, mapid, x, y, z, o, 100, 0)) { delete t; return NULL; @@ -938,7 +938,7 @@ Transport* BattlegroundIC::CreateTransport(uint32 goEntry,uint32 period) t->SetMap(GetBgMap()); for (uint8 i = 0; i < 5; i++) - t->AddNPCPassenger(0,(goEntry == GO_HORDE_GUNSHIP ? NPC_HORDE_GUNSHIP_CANNON : NPC_ALLIANCE_GUNSHIP_CANNON), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionX() : allianceGunshipPassengers[i].GetPositionX()) , (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionY() : allianceGunshipPassengers[i].GetPositionY()),(goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionZ() : allianceGunshipPassengers[i].GetPositionZ()), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetOrientation() : allianceGunshipPassengers[i].GetOrientation())); + t->AddNPCPassenger(0, (goEntry == GO_HORDE_GUNSHIP ? NPC_HORDE_GUNSHIP_CANNON : NPC_ALLIANCE_GUNSHIP_CANNON), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionX() : allianceGunshipPassengers[i].GetPositionX()) , (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionY() : allianceGunshipPassengers[i].GetPositionY()), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetPositionZ() : allianceGunshipPassengers[i].GetPositionZ()), (goEntry == GO_HORDE_GUNSHIP ? hordeGunshipPassengers[i].GetOrientation() : allianceGunshipPassengers[i].GetOrientation())); return t; } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h index 662e0f27c31..282ec5f531a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundIC.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundIC.h @@ -445,44 +445,44 @@ enum BG_IC_MaxSpawns const ICNpc BG_IC_NpcSpawnlocs[MAX_NORMAL_NPCS_SPAWNS]= { - {BG_IC_NPC_OVERLORD_AGMAR,NPC_OVERLORD_AGMAR,TEAM_HORDE,1295.44f,-765.733f,70.0541f,0.0f},//Overlord Agmar 1 - {BG_IC_NPC_HIGH_COMMANDER_HALFORD_WYRMBANE,NPC_HIGH_COMMANDER_HALFORD_WYRMBANE,TEAM_ALLIANCE,224.983f,-831.573f,60.9034f,0.0f},//High Commander Halford Wyrmbane 2 - {BG_IC_NPC_KOR_KRON_GUARD_1,NPC_KOR_KRON_GUARD,TEAM_HORDE,1296.01f,-773.256f,69.958f,0.292168f}, // 3 - {BG_IC_NPC_KOR_KRON_GUARD_2,NPC_KOR_KRON_GUARD,TEAM_HORDE,1295.94f,-757.756f,69.9587f,6.02165f}, // 4 - {BG_IC_NPC_KOR_KRON_GUARD_3,NPC_KOR_KRON_GUARD,TEAM_HORDE,1295.09f,-760.927f,69.9587f,5.94311f}, // 5 - {BG_IC_NPC_KOR_KRON_GUARD_4,NPC_KOR_KRON_GUARD,TEAM_HORDE,1295.13f,-769.7f,69.95f,0.34f}, // 6 - - {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_1,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,223.969f,-822.958f,60.8151f,0.46337f}, // 7 - {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_2,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,224.211f,-826.952f,60.8188f,6.25961f}, // 8 - {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_3,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,223.119f,-838.386f,60.8145f,5.64857f}, // 9 - {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_4,NPC_SEVEN_TH_LEGION_INFANTRY,TEAM_ALLIANCE,223.889f,-835.102f,60.8201f,6.21642f},// 10 - - {BG_IC_NPC_KEEP_CANNON_1,NPC_KEEP_CANNON,TEAM_ALLIANCE,415.825f,-754.634f,87.799f,1.78024f},// 11 - {BG_IC_NPC_KEEP_CANNON_2,NPC_KEEP_CANNON,TEAM_ALLIANCE,410.142f,-755.332f,87.7991f,1.78024f},// 12 - {BG_IC_NPC_KEEP_CANNON_3,NPC_KEEP_CANNON,TEAM_ALLIANCE,424.33f,-879.352f,88.0446f,0.436332f},// 13 - {BG_IC_NPC_KEEP_CANNON_4,NPC_KEEP_CANNON,TEAM_ALLIANCE,425.602f,-786.646f,87.7991f,5.74213f},// 14 - {BG_IC_NPC_KEEP_CANNON_5,NPC_KEEP_CANNON,TEAM_ALLIANCE,426.743f,-884.939f,87.9613f,0.436332f},// 15 - {BG_IC_NPC_KEEP_CANNON_6,NPC_KEEP_CANNON,TEAM_ALLIANCE,404.736f,-755.495f,87.7989f,1.78024f},// 16 - {BG_IC_NPC_KEEP_CANNON_7,NPC_KEEP_CANNON,TEAM_ALLIANCE,428.375f,-780.797f,87.7991f,5.79449f},// 17 - {BG_IC_NPC_KEEP_CANNON_8,NPC_KEEP_CANNON,TEAM_ALLIANCE,429.175f,-890.436f,88.0446f,0.436332f},// 18 - {BG_IC_NPC_KEEP_CANNON_9,NPC_KEEP_CANNON,TEAM_ALLIANCE,430.872f,-775.278f,87.7991f,5.88176f},// 19 - {BG_IC_NPC_KEEP_CANNON_10,NPC_KEEP_CANNON,TEAM_ALLIANCE,408.056f,-911.283f,88.0445f,4.64258f},// 20 - {BG_IC_NPC_KEEP_CANNON_11,NPC_KEEP_CANNON,TEAM_ALLIANCE,413.609f,-911.566f,88.0447f,4.66003f},// 21 - {BG_IC_NPC_KEEP_CANNON_12,NPC_KEEP_CANNON,TEAM_ALLIANCE,402.554f,-910.557f,88.0446f,4.57276f},// 22 - - {BG_IC_NPC_KEEP_CANNON_13,NPC_KEEP_CANNON,TEAM_HORDE,1158.91f,-660.144f,87.9332f,0.750492f},// 23 - {BG_IC_NPC_KEEP_CANNON_14,NPC_KEEP_CANNON,TEAM_HORDE,1156.22f,-866.809f,87.8754f,5.27089f},// 24 - {BG_IC_NPC_KEEP_CANNON_15,NPC_KEEP_CANNON,TEAM_HORDE,1163.74f,-663.67f,88.3571f,0.558505f},// 25 - {BG_IC_NPC_KEEP_CANNON_16,NPC_KEEP_CANNON,TEAM_HORDE,1135.18f,-683.896f,88.0409f,3.9619f},// 26 - {BG_IC_NPC_KEEP_CANNON_17,NPC_KEEP_CANNON,TEAM_HORDE,1138.91f,-836.359f,88.3728f,2.18166f},// 27 - {BG_IC_NPC_KEEP_CANNON_18,NPC_KEEP_CANNON,TEAM_HORDE,1162.08f,-863.717f,88.358f,5.48033f},// 28 - {BG_IC_NPC_KEEP_CANNON_19,NPC_KEEP_CANNON,TEAM_HORDE,1167.13f,-669.212f,87.9682f,0.383972f},// 29 - {BG_IC_NPC_KEEP_CANNON_20,NPC_KEEP_CANNON,TEAM_HORDE,1137.72f,-688.517f,88.4023f,3.9619f},// 30 - {BG_IC_NPC_KEEP_CANNON_21,NPC_KEEP_CANNON,TEAM_HORDE,1135.29f,-840.878f,88.0252f,2.30383f},// 31 - {BG_IC_NPC_KEEP_CANNON_22,NPC_KEEP_CANNON,TEAM_HORDE,1144.33f,-833.309f,87.9268f,2.14675f},// 32 - {BG_IC_NPC_KEEP_CANNON_23,NPC_KEEP_CANNON,TEAM_HORDE,1135.29f,-840.878f,88.0252f,2.30383f},// 33 - {BG_IC_NPC_KEEP_CANNON_24,NPC_KEEP_CANNON,TEAM_HORDE,1142.59f,-691.946f,87.9756f,3.9619f},// 34 - {BG_IC_NPC_KEEP_CANNON_25,NPC_KEEP_CANNON,TEAM_HORDE,1166.13f,-858.391f,87.9653f,5.63741f},// 35 + {BG_IC_NPC_OVERLORD_AGMAR, NPC_OVERLORD_AGMAR, TEAM_HORDE, 1295.44f, -765.733f, 70.0541f, 0.0f}, //Overlord Agmar 1 + {BG_IC_NPC_HIGH_COMMANDER_HALFORD_WYRMBANE, NPC_HIGH_COMMANDER_HALFORD_WYRMBANE, TEAM_ALLIANCE, 224.983f, -831.573f, 60.9034f, 0.0f}, //High Commander Halford Wyrmbane 2 + {BG_IC_NPC_KOR_KRON_GUARD_1, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1296.01f, -773.256f, 69.958f, 0.292168f}, // 3 + {BG_IC_NPC_KOR_KRON_GUARD_2, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1295.94f, -757.756f, 69.9587f, 6.02165f}, // 4 + {BG_IC_NPC_KOR_KRON_GUARD_3, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1295.09f, -760.927f, 69.9587f, 5.94311f}, // 5 + {BG_IC_NPC_KOR_KRON_GUARD_4, NPC_KOR_KRON_GUARD, TEAM_HORDE, 1295.13f, -769.7f, 69.95f, 0.34f}, // 6 + + {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_1, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 223.969f, -822.958f, 60.8151f, 0.46337f}, // 7 + {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_2, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 224.211f, -826.952f, 60.8188f, 6.25961f}, // 8 + {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_3, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 223.119f, -838.386f, 60.8145f, 5.64857f}, // 9 + {BG_IC_NPC_SEVEN_TH_LEGION_INFANTRY_4, NPC_SEVEN_TH_LEGION_INFANTRY, TEAM_ALLIANCE, 223.889f, -835.102f, 60.8201f, 6.21642f}, // 10 + + {BG_IC_NPC_KEEP_CANNON_1, NPC_KEEP_CANNON, TEAM_ALLIANCE, 415.825f, -754.634f, 87.799f, 1.78024f}, // 11 + {BG_IC_NPC_KEEP_CANNON_2, NPC_KEEP_CANNON, TEAM_ALLIANCE, 410.142f, -755.332f, 87.7991f, 1.78024f}, // 12 + {BG_IC_NPC_KEEP_CANNON_3, NPC_KEEP_CANNON, TEAM_ALLIANCE, 424.33f, -879.352f, 88.0446f, 0.436332f}, // 13 + {BG_IC_NPC_KEEP_CANNON_4, NPC_KEEP_CANNON, TEAM_ALLIANCE, 425.602f, -786.646f, 87.7991f, 5.74213f}, // 14 + {BG_IC_NPC_KEEP_CANNON_5, NPC_KEEP_CANNON, TEAM_ALLIANCE, 426.743f, -884.939f, 87.9613f, 0.436332f}, // 15 + {BG_IC_NPC_KEEP_CANNON_6, NPC_KEEP_CANNON, TEAM_ALLIANCE, 404.736f, -755.495f, 87.7989f, 1.78024f}, // 16 + {BG_IC_NPC_KEEP_CANNON_7, NPC_KEEP_CANNON, TEAM_ALLIANCE, 428.375f, -780.797f, 87.7991f, 5.79449f}, // 17 + {BG_IC_NPC_KEEP_CANNON_8, NPC_KEEP_CANNON, TEAM_ALLIANCE, 429.175f, -890.436f, 88.0446f, 0.436332f}, // 18 + {BG_IC_NPC_KEEP_CANNON_9, NPC_KEEP_CANNON, TEAM_ALLIANCE, 430.872f, -775.278f, 87.7991f, 5.88176f}, // 19 + {BG_IC_NPC_KEEP_CANNON_10, NPC_KEEP_CANNON, TEAM_ALLIANCE, 408.056f, -911.283f, 88.0445f, 4.64258f}, // 20 + {BG_IC_NPC_KEEP_CANNON_11, NPC_KEEP_CANNON, TEAM_ALLIANCE, 413.609f, -911.566f, 88.0447f, 4.66003f}, // 21 + {BG_IC_NPC_KEEP_CANNON_12, NPC_KEEP_CANNON, TEAM_ALLIANCE, 402.554f, -910.557f, 88.0446f, 4.57276f}, // 22 + + {BG_IC_NPC_KEEP_CANNON_13, NPC_KEEP_CANNON, TEAM_HORDE, 1158.91f, -660.144f, 87.9332f, 0.750492f}, // 23 + {BG_IC_NPC_KEEP_CANNON_14, NPC_KEEP_CANNON, TEAM_HORDE, 1156.22f, -866.809f, 87.8754f, 5.27089f}, // 24 + {BG_IC_NPC_KEEP_CANNON_15, NPC_KEEP_CANNON, TEAM_HORDE, 1163.74f, -663.67f, 88.3571f, 0.558505f}, // 25 + {BG_IC_NPC_KEEP_CANNON_16, NPC_KEEP_CANNON, TEAM_HORDE, 1135.18f, -683.896f, 88.0409f, 3.9619f}, // 26 + {BG_IC_NPC_KEEP_CANNON_17, NPC_KEEP_CANNON, TEAM_HORDE, 1138.91f, -836.359f, 88.3728f, 2.18166f}, // 27 + {BG_IC_NPC_KEEP_CANNON_18, NPC_KEEP_CANNON, TEAM_HORDE, 1162.08f, -863.717f, 88.358f, 5.48033f}, // 28 + {BG_IC_NPC_KEEP_CANNON_19, NPC_KEEP_CANNON, TEAM_HORDE, 1167.13f, -669.212f, 87.9682f, 0.383972f}, // 29 + {BG_IC_NPC_KEEP_CANNON_20, NPC_KEEP_CANNON, TEAM_HORDE, 1137.72f, -688.517f, 88.4023f, 3.9619f}, // 30 + {BG_IC_NPC_KEEP_CANNON_21, NPC_KEEP_CANNON, TEAM_HORDE, 1135.29f, -840.878f, 88.0252f, 2.30383f}, // 31 + {BG_IC_NPC_KEEP_CANNON_22, NPC_KEEP_CANNON, TEAM_HORDE, 1144.33f, -833.309f, 87.9268f, 2.14675f}, // 32 + {BG_IC_NPC_KEEP_CANNON_23, NPC_KEEP_CANNON, TEAM_HORDE, 1135.29f, -840.878f, 88.0252f, 2.30383f}, // 33 + {BG_IC_NPC_KEEP_CANNON_24, NPC_KEEP_CANNON, TEAM_HORDE, 1142.59f, -691.946f, 87.9756f, 3.9619f}, // 34 + {BG_IC_NPC_KEEP_CANNON_25, NPC_KEEP_CANNON, TEAM_HORDE, 1166.13f, -858.391f, 87.9653f, 5.63741f}, // 35 }; const Position BG_IC_WorkshopVehicles[5] = @@ -510,9 +510,9 @@ const Position BG_IC_DocksVehiclesCatapults[4] = const Position BG_IC_HangarTeleporters[3] = { - {827.958f,-994.467f,134.071f,0.0f}, // Gunship Portal - {738.613f,-1106.58f,134.745f,2.54818f}, // Gunship Portal - {672.283f,-1156.99f,133.706f,1.37881f}, // Gunship Portal + {827.958f, -994.467f, 134.071f, 0.0f}, // Gunship Portal + {738.613f, -1106.58f, 134.745f, 2.54818f}, // Gunship Portal + {672.283f, -1156.99f, 133.706f, 1.37881f}, // Gunship Portal }; struct ICGo @@ -527,128 +527,128 @@ struct ICGo const ICGo BG_IC_Teleporters[MAX_FORTRESS_TELEPORTERS_SPAWNS] = { - {BG_IC_GO_TELEPORTER_1_1,GO_TELEPORTER_1,1143.25f,-779.599f,48.629f,1.64061f}, // Teleporter - {BG_IC_GO_TELEPORTER_1_2,GO_TELEPORTER_1,1236.53f,-669.415f,48.2729f,0.104719f}, // Teleporter - {BG_IC_GO_TELEPORTER_2_1,GO_TELEPORTER_2,1233.27f,-844.526f,48.8824f,-0.0174525f}, // Teleporter - {BG_IC_GO_TELEPORTER_3_1,GO_TELEPORTER_3,311.92f,-913.972f,48.8159f,3.08918f}, // Teleporter - {BG_IC_GO_TELEPORTER_2_2,GO_TELEPORTER_2,1235.53f,-683.872f,49.304f,-3.08918f}, // Teleporter - {BG_IC_GO_TELEPORTER_4_1,GO_TELEPORTER_4,397.089f,-859.382f,48.8993f,1.64061f}, // Teleporter - {BG_IC_GO_TELEPORTER_3_2,GO_TELEPORTER_3,324.635f,-749.128f,49.3602f,0.0174525f}, // Teleporter - {BG_IC_GO_TELEPORTER_3_3,GO_TELEPORTER_3,425.675f,-857.09f,48.5104f,-1.6057f}, // Teleporter - {BG_IC_GO_TELEPORTER_4_2,GO_TELEPORTER_4,323.54f,-888.361f,48.9197f,0.0349063f}, // Teleporter - {BG_IC_GO_TELEPORTER_4_3,GO_TELEPORTER_4,326.285f,-777.366f,49.0208f,3.12412f}, // Teleporter - {BG_IC_GO_TELEPORTER_1_3,GO_TELEPORTER_1,1235.09f,-857.898f,48.9163f,3.07177f}, // Teleporter - {BG_IC_GO_TELEPORTER_2_3,GO_TELEPORTER_2,1158.76f,-746.182f,48.6277f,-1.51844f}, // Teleporter - - {BG_IC_GO_TELEPORTER_EFFECTS_A_1,GO_TELEPORTER_EFFECTS_A,425.686f,-857.092f,48.51f,-1.62316f}, // Teleporter Effects (Alliance) - {BG_IC_GO_TELEPORTER_EFFECTS_A_2,GO_TELEPORTER_EFFECTS_A,324.634f,-749.148f,49.359f,0.0174525f}, // Teleporter Effects (Alliance) - {BG_IC_GO_TELEPORTER_EFFECTS_A_3,GO_TELEPORTER_EFFECTS_A,311.911f,-913.986f,48.8157f,3.08918f}, // Teleporter Effects (Alliance) - {BG_IC_GO_TELEPORTER_EFFECTS_A_4,GO_TELEPORTER_EFFECTS_A,326.266f,-777.347f,49.0215f,3.12412f}, // Teleporter Effects (Alliance) - {BG_IC_GO_TELEPORTER_EFFECTS_A_5,GO_TELEPORTER_EFFECTS_A,323.55f,-888.347f,48.9198f,0.0174525f}, // Teleporter Effects (Alliance) - {BG_IC_GO_TELEPORTER_EFFECTS_A_6,GO_TELEPORTER_EFFECTS_A,397.116f,-859.378f,48.8989f,1.64061f}, // Teleporter Effects (Alliance) - - {BG_IC_GO_TELEPORTER_EFFECTS_H_1,GO_TELEPORTER_EFFECTS_H,1143.25f,-779.623f,48.6291f,1.62316f}, // Teleporter Effects (Horde) - {BG_IC_GO_TELEPORTER_EFFECTS_H_2,GO_TELEPORTER_EFFECTS_H,1158.64f,-746.148f,48.6277f,-1.50098f}, // Teleporter Effects (Horde) - {BG_IC_GO_TELEPORTER_EFFECTS_H_3,GO_TELEPORTER_EFFECTS_H,1233.25f,-844.573f,48.8836f,0.0174525f}, // Teleporter Effects (Horde) - {BG_IC_GO_TELEPORTER_EFFECTS_H_4,GO_TELEPORTER_EFFECTS_H,1235.07f,-857.957f,48.9163f,3.05433f}, // Teleporter Effects (Horde) - {BG_IC_GO_TELEPORTER_EFFECTS_H_5,GO_TELEPORTER_EFFECTS_H,1236.46f,-669.344f,48.2684f,0.087266f}, // Teleporter Effects (Horde) - {BG_IC_GO_TELEPORTER_EFFECTS_H_6,GO_TELEPORTER_EFFECTS_H,1235.6f,-683.806f,49.3028f,-3.07177f}, // Teleporter Effects (Horde) + {BG_IC_GO_TELEPORTER_1_1, GO_TELEPORTER_1, 1143.25f, -779.599f, 48.629f, 1.64061f}, // Teleporter + {BG_IC_GO_TELEPORTER_1_2, GO_TELEPORTER_1, 1236.53f, -669.415f, 48.2729f, 0.104719f}, // Teleporter + {BG_IC_GO_TELEPORTER_2_1, GO_TELEPORTER_2, 1233.27f, -844.526f, 48.8824f, -0.0174525f}, // Teleporter + {BG_IC_GO_TELEPORTER_3_1, GO_TELEPORTER_3, 311.92f, -913.972f, 48.8159f, 3.08918f}, // Teleporter + {BG_IC_GO_TELEPORTER_2_2, GO_TELEPORTER_2, 1235.53f, -683.872f, 49.304f, -3.08918f}, // Teleporter + {BG_IC_GO_TELEPORTER_4_1, GO_TELEPORTER_4, 397.089f, -859.382f, 48.8993f, 1.64061f}, // Teleporter + {BG_IC_GO_TELEPORTER_3_2, GO_TELEPORTER_3, 324.635f, -749.128f, 49.3602f, 0.0174525f}, // Teleporter + {BG_IC_GO_TELEPORTER_3_3, GO_TELEPORTER_3, 425.675f, -857.09f, 48.5104f, -1.6057f}, // Teleporter + {BG_IC_GO_TELEPORTER_4_2, GO_TELEPORTER_4, 323.54f, -888.361f, 48.9197f, 0.0349063f}, // Teleporter + {BG_IC_GO_TELEPORTER_4_3, GO_TELEPORTER_4, 326.285f, -777.366f, 49.0208f, 3.12412f}, // Teleporter + {BG_IC_GO_TELEPORTER_1_3, GO_TELEPORTER_1, 1235.09f, -857.898f, 48.9163f, 3.07177f}, // Teleporter + {BG_IC_GO_TELEPORTER_2_3, GO_TELEPORTER_2, 1158.76f, -746.182f, 48.6277f, -1.51844f}, // Teleporter + + {BG_IC_GO_TELEPORTER_EFFECTS_A_1, GO_TELEPORTER_EFFECTS_A, 425.686f, -857.092f, 48.51f, -1.62316f}, // Teleporter Effects (Alliance) + {BG_IC_GO_TELEPORTER_EFFECTS_A_2, GO_TELEPORTER_EFFECTS_A, 324.634f, -749.148f, 49.359f, 0.0174525f}, // Teleporter Effects (Alliance) + {BG_IC_GO_TELEPORTER_EFFECTS_A_3, GO_TELEPORTER_EFFECTS_A, 311.911f, -913.986f, 48.8157f, 3.08918f}, // Teleporter Effects (Alliance) + {BG_IC_GO_TELEPORTER_EFFECTS_A_4, GO_TELEPORTER_EFFECTS_A, 326.266f, -777.347f, 49.0215f, 3.12412f}, // Teleporter Effects (Alliance) + {BG_IC_GO_TELEPORTER_EFFECTS_A_5, GO_TELEPORTER_EFFECTS_A, 323.55f, -888.347f, 48.9198f, 0.0174525f}, // Teleporter Effects (Alliance) + {BG_IC_GO_TELEPORTER_EFFECTS_A_6, GO_TELEPORTER_EFFECTS_A, 397.116f, -859.378f, 48.8989f, 1.64061f}, // Teleporter Effects (Alliance) + + {BG_IC_GO_TELEPORTER_EFFECTS_H_1, GO_TELEPORTER_EFFECTS_H, 1143.25f, -779.623f, 48.6291f, 1.62316f}, // Teleporter Effects (Horde) + {BG_IC_GO_TELEPORTER_EFFECTS_H_2, GO_TELEPORTER_EFFECTS_H, 1158.64f, -746.148f, 48.6277f, -1.50098f}, // Teleporter Effects (Horde) + {BG_IC_GO_TELEPORTER_EFFECTS_H_3, GO_TELEPORTER_EFFECTS_H, 1233.25f, -844.573f, 48.8836f, 0.0174525f}, // Teleporter Effects (Horde) + {BG_IC_GO_TELEPORTER_EFFECTS_H_4, GO_TELEPORTER_EFFECTS_H, 1235.07f, -857.957f, 48.9163f, 3.05433f}, // Teleporter Effects (Horde) + {BG_IC_GO_TELEPORTER_EFFECTS_H_5, GO_TELEPORTER_EFFECTS_H, 1236.46f, -669.344f, 48.2684f, 0.087266f}, // Teleporter Effects (Horde) + {BG_IC_GO_TELEPORTER_EFFECTS_H_6, GO_TELEPORTER_EFFECTS_H, 1235.6f, -683.806f, 49.3028f, -3.07177f}, // Teleporter Effects (Horde) }; const ICGo BG_IC_ObjSpawnlocs[MAX_NORMAL_GAMEOBJECTS_SPAWNS] = { - {BG_IC_GO_ALLIANCE_GATE_1,GO_ALLIANCE_GATE_1,351.615f,-762.75f,48.9162f,-1.5708f}, // Alliance Gate || Left - {BG_IC_GO_ALLIANCE_GATE_2,GO_ALLIANCE_GATE_2,351.024f,-903.326f,48.9247f,1.5708f}, // Alliance Gate || Right - {BG_IC_GO_ALLIANCE_GATE_3,GO_ALLIANCE_GATE_3,413.479f,-833.95f,48.5238f,3.14159f}, // Alliance Gate || Front - - {BG_IC_GO_HORDE_GATE_1,GO_HORDE_GATE_1,1150.9f,-762.606f,47.5077f,3.14159f}, // Horde Gate || Front - {BG_IC_GO_HORDE_GATE_2,GO_HORDE_GATE_2,1218.74f,-851.155f,48.2533f,-1.5708f}, // Horde Gate || Left - {BG_IC_GO_HORDE_GATE_3,GO_HORDE_GATE_3,1217.9f,-676.948f,47.6341f,1.5708f}, // Horde Gate || Right - - {BG_IC_GO_HORDE_BANNER,GO_HORDE_BANNER,1284.76f,-705.668f,48.9163f,-3.08918f}, // Horde Banner - {BG_IC_GO_ALLIANCE_BANNER,GO_ALLIANCE_BANNER,299.153f,-784.589f,48.9162f,-0.157079f}, // Alliance Banner - - {BG_IC_GO_WORKSHOP_BANNER,GO_WORKSHOP_BANNER,776.229f,-804.283f,6.45052f,1.6057f}, // Workshop Banner - {BG_IC_GO_DOCKS_BANNER,GO_DOCKS_BANNER,726.385f,-360.205f,17.8153f,-1.62316f}, // Docks Banner - {BG_IC_GO_HANGAR_BANNER,GO_HANGAR_BANNER,807.78f,-1000.07f,132.381f,-1.93732f}, // Hangar Banner - {BG_IC_GO_QUARRY_BANNER,GO_QUARRY_BANNER,251.016f,-1159.32f,17.2376f,-2.25147f}, // Quarry Banner - {BG_IC_GO_REFINERY_BANNER,GO_REFINERY_BANNER,1269.5f,-400.809f,37.6253f,-1.76278f}, // Refinery Banner - - {BG_IC_GO_BENCH_1,GO_BENCH_1,834.208f,-461.826f,22.3067f,1.5708f}, // Bench - {BG_IC_GO_BENCH_2,GO_BENCH_2,826.153f,-461.985f,22.5149f,1.5708f}, // Bench - {BG_IC_GO_BENCH_3,GO_BENCH_3,817.446f,-470.47f,25.372f,-1.56207f}, // Bench - {BG_IC_GO_BENCH_4,GO_BENCH_4,827.001f,-474.415f,25.372f,1.57952f}, // Bench - {BG_IC_GO_BENCH_5,GO_BENCH_5,819.264f,-461.961f,22.7614f,1.57952f}, // Bench - - {BG_IC_GO_BONFIRE_1,GO_BONFIRE_1,1162.91f,-734.578f,48.8948f,-2.9845f}, // Bonfire - {BG_IC_GO_BONFIRE_2,GO_BONFIRE_2,1282.34f,-799.762f,87.1357f,-3.13286f}, // Bonfire - {BG_IC_GO_BONFIRE_3,GO_BONFIRE_3,1358.06f,-732.178f,87.1606f,-3.13284f}, // Bonfire - {BG_IC_GO_BONFIRE_4,GO_BONFIRE_4,1281.76f,-732.844f,87.1574f,-3.13246f}, // Bonfire - {BG_IC_GO_BONFIRE_5,GO_BONFIRE_5,1358.81f,-797.899f,87.2953f,3.13312f}, // Bonfire - {BG_IC_GO_BONFIRE_6,GO_BONFIRE_6,1162.21f,-790.543f,48.9162f,2.27765f}, // Bonfire - - {BG_IC_GO_BRAZIER_1,GO_BRAZIER_1,1262.21f,-751.358f,48.8133f,2.26893f}, // Brazier - {BG_IC_GO_BRAZIER_2,GO_BRAZIER_2,1262.58f,-781.861f,48.8132f,2.04203f}, // Brazier - {BG_IC_GO_BRAZIER_3,GO_BRAZIER_3,223.818f,-839.352f,60.7917f,1.09083f}, // Brazier - {BG_IC_GO_BRAZIER_4,GO_BRAZIER_4,224.277f,-822.77f,60.7917f,2.06822f}, // Brazier - - {BG_IC_GO_CHAIR_1,GO_CHAIR_1,632.876f,-282.461f,5.45364f,-0.851094f}, // Chair - {BG_IC_GO_CHAIR_2,GO_CHAIR_2,635.796f,-276.295f,5.48659f,-3.03273f}, // Chair - {BG_IC_GO_CHAIR_3_1,GO_CHAIR_3,762.245f,-444.795f,22.8526f,-1.98095f}, // Chair - {BG_IC_GO_CHAIR_4,GO_CHAIR_4,632.156f,-304.503f,5.4879f,1.15603f}, // Chair - {BG_IC_GO_CHAIR_5,GO_CHAIR_5,643.86f,-270.204f,5.48898f,2.36903f}, // Chair - {BG_IC_GO_CHAIR_6_1,GO_CHAIR_6,902.234f,-455.508f,18.3935f,-1.00356f}, // Chair - {BG_IC_GO_CHAIR_7,GO_CHAIR_7,810.237f,-461.2f,25.4627f,1.5708f}, // Chair - {BG_IC_GO_CHAIR_3_2,GO_CHAIR_3,1117.19f,-365.674f,18.8456f,0.968657f}, // Chair - {BG_IC_GO_CHAIR_6_2,GO_CHAIR_6,1066.19f,-337.214f,18.8225f,0.453785f}, // Chair - {BG_IC_GO_CHAIR_8_1,GO_CHAIR_8,798.324f,-444.951f,22.5601f,-1.02102f}, // Chair - {BG_IC_GO_CHAIR_8_2,GO_CHAIR_8,1081.81f,-358.637f,18.5531f,1.92859f}, // Chair - {BG_IC_GO_CHAIR_9,GO_CHAIR_9,814.931f,-470.816f,33.6373f,-3.12412f}, // Chair - - {BG_IC_GO_DOODAD_HU_PORTCULLIS01_1,GO_DOODAD_HU_PORTCULLIS01,401.024f,-780.724f,49.9482f,-2.52896f}, // Doodad_HU_Portcullis01 - {BG_IC_GO_DOODAD_HU_PORTCULLIS01_2,GO_DOODAD_HU_PORTCULLIS01,399.802f,-885.208f,50.1939f,2.516f}, // Doodad_HU_Portcullis01 - - {BG_IC_GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01,GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01,413.479f,-833.95f,48.5238f,3.14159f}, // Doodad_ND_Human_Gate_ClosedFX_Door01 - - {BG_IC_GO_DOODAD_PORTCULLISACTIVE01,GO_DOODAD_PORTCULLISACTIVE01,-832.595f,51.4109f,-0.0261791f, 0.0f}, // Doodad_PortcullisActive01 - - {BG_IC_GO_DOODAD_PORTCULLISACTIVE02,GO_DOODAD_PORTCULLISACTIVE02,273.033f,-832.199f,51.4109f,-0.0261791f}, // Doodad_PortcullisActive02 - - {BG_IC_GO_DOODAD_VR_PORTCULLIS01_1,GO_DOODAD_VR_PORTCULLIS01,1156.89f,-843.998f,48.6322f,0.732934f}, // Doodad_VR_Portcullis01 - {BG_IC_GO_DOODAD_VR_PORTCULLIS01_2,GO_DOODAD_VR_PORTCULLIS01,1157.05f,-682.36f,48.6322f,-0.829132f}, // Doodad_VR_Portcullis01 - - {BG_IC_GO_FLAGPOLE_1_1,GO_FLAGPOLE_1,-400.809f,37.6253f,-1.76278f, 0.0f}, // Flagpole - {BG_IC_GO_FLAGPOLE_2_1,GO_FLAGPOLE_2,1284.76f,-705.668f,48.9163f,-3.08918f}, // Flagpole - {BG_IC_GO_FLAGPOLE_2_2,GO_FLAGPOLE_2,299.153f,-784.589f,48.9162f,-0.157079f}, // Flagpole - {BG_IC_GO_FLAGPOLE_1_2,GO_FLAGPOLE_1,726.385f,-360.205f,17.8153f,-1.6057f}, // Flagpole - {BG_IC_GO_FLAGPOLE_1_3,GO_FLAGPOLE_1,807.78f,-1000.07f,132.381f,-1.91986f}, // Flagpole - {BG_IC_GO_FLAGPOLE_1_4,GO_FLAGPOLE_1,776.229f,-804.283f,6.45052f,1.6057f}, // Flagpole - {BG_IC_GO_FLAGPOLE_1_5,GO_FLAGPOLE_1,251.016f,-1159.32f,17.2376f,-2.25147f}, // Flagpole - - {BG_IC_GO_HORDE_KEEP_PORTCULLIS,GO_HORDE_KEEP_PORTCULLIS,1283.05f,-765.878f,50.8297f,-3.13286f}, // Horde Keep Portcullis - - {BG_IC_GO_STOVE_1_1,GO_STOVE_1,903.291f,-457.345f,18.1356f,2.23402f}, // Stove - {BG_IC_GO_STOVE_2_1,GO_STOVE_2,761.462f,-446.684f,22.5602f,0.244344f}, // Stove - {BG_IC_GO_STOVE_1_2,GO_STOVE_1,11068.13f,-336.373f,18.5647f,-2.59181f}, // Stove - {BG_IC_GO_STOVE_2_2,GO_STOVE_2,1118.32f,-363.969f,18.5532f,-3.08918f}, // Stove - - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_1,GO_HUGE_SEAFORIUM_BOMB_A,297.3212f,-851.321167f,48.91627f,-0.94247663f}, - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_2,GO_HUGE_SEAFORIUM_BOMB_A,298.104156f,-861.026062f,48.916275f,-2.75761318f}, - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_3,GO_HUGE_SEAFORIUM_BOMB_A,300.371521f,-818.732666f,48.91625f,0.785396755f}, - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_4,GO_HUGE_SEAFORIUM_BOMB_A,302.1354f,-810.7083f,48.91625f,-1.04719758f}, - - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_1,GO_HUGE_SEAFORIUM_BOMB_H,1268.30908f, -745.783f, 48.9187775f, 0.785396755f}, - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_2,GO_HUGE_SEAFORIUM_BOMB_H,1268.50867f, -738.1215f, 48.9175f, -1.04719758f}, - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_3,GO_HUGE_SEAFORIUM_BOMB_H,1273.066f, -786.572937f, 48.9419174f, -0.94247663f}, - {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_4,GO_HUGE_SEAFORIUM_BOMB_H,1273.849f, -796.2778f, 48.9364281f, -2.75761318f}, - - {BG_IC_GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01,GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01,1150.9f,-762.606f,47.0f,3.14159f} // Doodad_ND_WinterOrc_Wall_GateFX_Door01 -> this was not sniffed because I only had alliance sniffs + {BG_IC_GO_ALLIANCE_GATE_1, GO_ALLIANCE_GATE_1, 351.615f, -762.75f, 48.9162f, -1.5708f}, // Alliance Gate || Left + {BG_IC_GO_ALLIANCE_GATE_2, GO_ALLIANCE_GATE_2, 351.024f, -903.326f, 48.9247f, 1.5708f}, // Alliance Gate || Right + {BG_IC_GO_ALLIANCE_GATE_3, GO_ALLIANCE_GATE_3, 413.479f, -833.95f, 48.5238f, 3.14159f}, // Alliance Gate || Front + + {BG_IC_GO_HORDE_GATE_1, GO_HORDE_GATE_1, 1150.9f, -762.606f, 47.5077f, 3.14159f}, // Horde Gate || Front + {BG_IC_GO_HORDE_GATE_2, GO_HORDE_GATE_2, 1218.74f, -851.155f, 48.2533f, -1.5708f}, // Horde Gate || Left + {BG_IC_GO_HORDE_GATE_3, GO_HORDE_GATE_3, 1217.9f, -676.948f, 47.6341f, 1.5708f}, // Horde Gate || Right + + {BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, 1284.76f, -705.668f, 48.9163f, -3.08918f}, // Horde Banner + {BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, 299.153f, -784.589f, 48.9162f, -0.157079f}, // Alliance Banner + + {BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, 776.229f, -804.283f, 6.45052f, 1.6057f}, // Workshop Banner + {BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, 726.385f, -360.205f, 17.8153f, -1.62316f}, // Docks Banner + {BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, 807.78f, -1000.07f, 132.381f, -1.93732f}, // Hangar Banner + {BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, 251.016f, -1159.32f, 17.2376f, -2.25147f}, // Quarry Banner + {BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, 1269.5f, -400.809f, 37.6253f, -1.76278f}, // Refinery Banner + + {BG_IC_GO_BENCH_1, GO_BENCH_1, 834.208f, -461.826f, 22.3067f, 1.5708f}, // Bench + {BG_IC_GO_BENCH_2, GO_BENCH_2, 826.153f, -461.985f, 22.5149f, 1.5708f}, // Bench + {BG_IC_GO_BENCH_3, GO_BENCH_3, 817.446f, -470.47f, 25.372f, -1.56207f}, // Bench + {BG_IC_GO_BENCH_4, GO_BENCH_4, 827.001f, -474.415f, 25.372f, 1.57952f}, // Bench + {BG_IC_GO_BENCH_5, GO_BENCH_5, 819.264f, -461.961f, 22.7614f, 1.57952f}, // Bench + + {BG_IC_GO_BONFIRE_1, GO_BONFIRE_1, 1162.91f, -734.578f, 48.8948f, -2.9845f}, // Bonfire + {BG_IC_GO_BONFIRE_2, GO_BONFIRE_2, 1282.34f, -799.762f, 87.1357f, -3.13286f}, // Bonfire + {BG_IC_GO_BONFIRE_3, GO_BONFIRE_3, 1358.06f, -732.178f, 87.1606f, -3.13284f}, // Bonfire + {BG_IC_GO_BONFIRE_4, GO_BONFIRE_4, 1281.76f, -732.844f, 87.1574f, -3.13246f}, // Bonfire + {BG_IC_GO_BONFIRE_5, GO_BONFIRE_5, 1358.81f, -797.899f, 87.2953f, 3.13312f}, // Bonfire + {BG_IC_GO_BONFIRE_6, GO_BONFIRE_6, 1162.21f, -790.543f, 48.9162f, 2.27765f}, // Bonfire + + {BG_IC_GO_BRAZIER_1, GO_BRAZIER_1, 1262.21f, -751.358f, 48.8133f, 2.26893f}, // Brazier + {BG_IC_GO_BRAZIER_2, GO_BRAZIER_2, 1262.58f, -781.861f, 48.8132f, 2.04203f}, // Brazier + {BG_IC_GO_BRAZIER_3, GO_BRAZIER_3, 223.818f, -839.352f, 60.7917f, 1.09083f}, // Brazier + {BG_IC_GO_BRAZIER_4, GO_BRAZIER_4, 224.277f, -822.77f, 60.7917f, 2.06822f}, // Brazier + + {BG_IC_GO_CHAIR_1, GO_CHAIR_1, 632.876f, -282.461f, 5.45364f, -0.851094f}, // Chair + {BG_IC_GO_CHAIR_2, GO_CHAIR_2, 635.796f, -276.295f, 5.48659f, -3.03273f}, // Chair + {BG_IC_GO_CHAIR_3_1, GO_CHAIR_3, 762.245f, -444.795f, 22.8526f, -1.98095f}, // Chair + {BG_IC_GO_CHAIR_4, GO_CHAIR_4, 632.156f, -304.503f, 5.4879f, 1.15603f}, // Chair + {BG_IC_GO_CHAIR_5, GO_CHAIR_5, 643.86f, -270.204f, 5.48898f, 2.36903f}, // Chair + {BG_IC_GO_CHAIR_6_1, GO_CHAIR_6, 902.234f, -455.508f, 18.3935f, -1.00356f}, // Chair + {BG_IC_GO_CHAIR_7, GO_CHAIR_7, 810.237f, -461.2f, 25.4627f, 1.5708f}, // Chair + {BG_IC_GO_CHAIR_3_2, GO_CHAIR_3, 1117.19f, -365.674f, 18.8456f, 0.968657f}, // Chair + {BG_IC_GO_CHAIR_6_2, GO_CHAIR_6, 1066.19f, -337.214f, 18.8225f, 0.453785f}, // Chair + {BG_IC_GO_CHAIR_8_1, GO_CHAIR_8, 798.324f, -444.951f, 22.5601f, -1.02102f}, // Chair + {BG_IC_GO_CHAIR_8_2, GO_CHAIR_8, 1081.81f, -358.637f, 18.5531f, 1.92859f}, // Chair + {BG_IC_GO_CHAIR_9, GO_CHAIR_9, 814.931f, -470.816f, 33.6373f, -3.12412f}, // Chair + + {BG_IC_GO_DOODAD_HU_PORTCULLIS01_1, GO_DOODAD_HU_PORTCULLIS01, 401.024f, -780.724f, 49.9482f, -2.52896f}, // Doodad_HU_Portcullis01 + {BG_IC_GO_DOODAD_HU_PORTCULLIS01_2, GO_DOODAD_HU_PORTCULLIS01, 399.802f, -885.208f, 50.1939f, 2.516f}, // Doodad_HU_Portcullis01 + + {BG_IC_GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01, GO_DOODAD_ND_HUMAN_GATE_CLOSEDFX_DOOR01, 413.479f, -833.95f, 48.5238f, 3.14159f}, // Doodad_ND_Human_Gate_ClosedFX_Door01 + + {BG_IC_GO_DOODAD_PORTCULLISACTIVE01, GO_DOODAD_PORTCULLISACTIVE01, -832.595f, 51.4109f, -0.0261791f, 0.0f}, // Doodad_PortcullisActive01 + + {BG_IC_GO_DOODAD_PORTCULLISACTIVE02, GO_DOODAD_PORTCULLISACTIVE02, 273.033f, -832.199f, 51.4109f, -0.0261791f}, // Doodad_PortcullisActive02 + + {BG_IC_GO_DOODAD_VR_PORTCULLIS01_1, GO_DOODAD_VR_PORTCULLIS01, 1156.89f, -843.998f, 48.6322f, 0.732934f}, // Doodad_VR_Portcullis01 + {BG_IC_GO_DOODAD_VR_PORTCULLIS01_2, GO_DOODAD_VR_PORTCULLIS01, 1157.05f, -682.36f, 48.6322f, -0.829132f}, // Doodad_VR_Portcullis01 + + {BG_IC_GO_FLAGPOLE_1_1, GO_FLAGPOLE_1, -400.809f, 37.6253f, -1.76278f, 0.0f}, // Flagpole + {BG_IC_GO_FLAGPOLE_2_1, GO_FLAGPOLE_2, 1284.76f, -705.668f, 48.9163f, -3.08918f}, // Flagpole + {BG_IC_GO_FLAGPOLE_2_2, GO_FLAGPOLE_2, 299.153f, -784.589f, 48.9162f, -0.157079f}, // Flagpole + {BG_IC_GO_FLAGPOLE_1_2, GO_FLAGPOLE_1, 726.385f, -360.205f, 17.8153f, -1.6057f}, // Flagpole + {BG_IC_GO_FLAGPOLE_1_3, GO_FLAGPOLE_1, 807.78f, -1000.07f, 132.381f, -1.91986f}, // Flagpole + {BG_IC_GO_FLAGPOLE_1_4, GO_FLAGPOLE_1, 776.229f, -804.283f, 6.45052f, 1.6057f}, // Flagpole + {BG_IC_GO_FLAGPOLE_1_5, GO_FLAGPOLE_1, 251.016f, -1159.32f, 17.2376f, -2.25147f}, // Flagpole + + {BG_IC_GO_HORDE_KEEP_PORTCULLIS, GO_HORDE_KEEP_PORTCULLIS, 1283.05f, -765.878f, 50.8297f, -3.13286f}, // Horde Keep Portcullis + + {BG_IC_GO_STOVE_1_1, GO_STOVE_1, 903.291f, -457.345f, 18.1356f, 2.23402f}, // Stove + {BG_IC_GO_STOVE_2_1, GO_STOVE_2, 761.462f, -446.684f, 22.5602f, 0.244344f}, // Stove + {BG_IC_GO_STOVE_1_2, GO_STOVE_1, 11068.13f, -336.373f, 18.5647f, -2.59181f}, // Stove + {BG_IC_GO_STOVE_2_2, GO_STOVE_2, 1118.32f, -363.969f, 18.5532f, -3.08918f}, // Stove + + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_1, GO_HUGE_SEAFORIUM_BOMB_A, 297.3212f, -851.321167f, 48.91627f, -0.94247663f}, + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_2, GO_HUGE_SEAFORIUM_BOMB_A, 298.104156f, -861.026062f, 48.916275f, -2.75761318f}, + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_3, GO_HUGE_SEAFORIUM_BOMB_A, 300.371521f, -818.732666f, 48.91625f, 0.785396755f}, + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_A_4, GO_HUGE_SEAFORIUM_BOMB_A, 302.1354f, -810.7083f, 48.91625f, -1.04719758f}, + + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_1, GO_HUGE_SEAFORIUM_BOMB_H, 1268.30908f, -745.783f, 48.9187775f, 0.785396755f}, + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_2, GO_HUGE_SEAFORIUM_BOMB_H, 1268.50867f, -738.1215f, 48.9175f, -1.04719758f}, + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_3, GO_HUGE_SEAFORIUM_BOMB_H, 1273.066f, -786.572937f, 48.9419174f, -0.94247663f}, + {BG_IC_GO_HUGE_SEAFORIUM_BOMBS_H_4, GO_HUGE_SEAFORIUM_BOMB_H, 1273.849f, -796.2778f, 48.9364281f, -2.75761318f}, + + {BG_IC_GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01, GO_DOODAD_ND_WINTERORC_WALL_GATEFX_DOOR01, 1150.9f, -762.606f, 47.0f, 3.14159f} // Doodad_ND_WinterOrc_Wall_GateFX_Door01 -> this was not sniffed because I only had alliance sniffs }; const Position workshopBombs[2] = { - {750.601f,-864.597f,13.4754f,1.93731f}, - {785.509f,-864.715f,13.3993f,2.47837f} + {750.601f, -864.597f, 13.4754f, 1.93731f}, + {785.509f, -864.715f, 13.3993f, 2.47837f} }; enum Spells @@ -780,7 +780,7 @@ enum ICNodeState const uint32 BG_IC_GraveyardIds[MAX_NODE_TYPES+2] = {0, 0, 1480, 1481, 1482, 1485, 1486, 1483, 1484}; const Position TransportMovementInfo = {7.305609f, -0.095246f, 34.51022f, 0.0f}; -const Position TeleportToTransportPosition = {661.0f,-1244.0f,288.0f,0.0f}; +const Position TeleportToTransportPosition = {661.0f, -1244.0f, 288.0f, 0.0f}; const float BG_IC_SpiritGuidePos[MAX_NODE_TYPES+2][4] = { @@ -831,13 +831,13 @@ struct ICNodePoint const ICNodePoint nodePointInitial[7] = { - {BG_IC_GO_REFINERY_BANNER,GO_REFINERY_BANNER,TEAM_NEUTRAL,NODE_TYPE_REFINERY,{GO_ALLIANCE_BANNER_REFINERY,GO_ALLIANCE_BANNER_REFINERY_CONT,GO_HORDE_BANNER_REFINERY,GO_HORDE_BANNER_REFINERY_CONT},false,0,0,{BG_IC_REFINERY_UNCONTROLLED,BG_IC_REFINERY_CONFLICT_A,BG_IC_REFINERY_CONFLICT_H,BG_IC_REFINERY_CONTROLLED_A,BG_IC_REFINERY_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_REFINERY}, - {BG_IC_GO_QUARRY_BANNER,GO_QUARRY_BANNER,TEAM_NEUTRAL,NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY,GO_ALLIANCE_BANNER_QUARRY_CONT,GO_HORDE_BANNER_QUARRY,GO_HORDE_BANNER_QUARRY_CONT},false,0,0,{BG_IC_QUARRY_UNCONTROLLED,BG_IC_QUARRY_CONFLICT_A,BG_IC_QUARRY_CONFLICT_H,BG_IC_QUARRY_CONTROLLED_A,BG_IC_QUARRY_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_QUARRY}, - {BG_IC_GO_DOCKS_BANNER,GO_DOCKS_BANNER,TEAM_NEUTRAL,NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK,GO_ALLIANCE_BANNER_DOCK_CONT,GO_HORDE_BANNER_DOCK,GO_HORDE_BANNER_DOCK_CONT},false,0,0,{BG_IC_DOCKS_UNCONTROLLED, BG_IC_DOCKS_CONFLICT_A, BG_IC_DOCKS_CONFLICT_H, BG_IC_DOCKS_CONTROLLED_A,BG_IC_DOCKS_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_DOCKS}, - {BG_IC_GO_HANGAR_BANNER,GO_HANGAR_BANNER,TEAM_NEUTRAL,NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR,GO_ALLIANCE_BANNER_HANGAR_CONT,GO_HORDE_BANNER_HANGAR,GO_HORDE_BANNER_HANGAR_CONT},false,0,0,{BG_IC_HANGAR_UNCONTROLLED,BG_IC_HANGAR_CONFLICT_A, BG_IC_HANGAR_CONFLICT_H, BG_IC_HANGAR_CONTROLLED_A, BG_IC_HANGAR_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_HANGAR}, - {BG_IC_GO_WORKSHOP_BANNER,GO_WORKSHOP_BANNER,TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP,GO_ALLIANCE_BANNER_WORKSHOP_CONT,GO_HORDE_BANNER_WORKSHOP,GO_HORDE_BANNER_WORKSHOP_CONT},false,0,0,{BG_IC_WORKSHOP_UNCONTROLLED,BG_IC_WORKSHOP_CONFLICT_A,BG_IC_WORKSHOP_CONFLICT_H,BG_IC_WORKSHOP_CONTROLLED_A,BG_IC_WORKSHOP_CONTROLLED_H},NODE_STATE_UNCONTROLLED,LANG_BG_IC_WORKSHOP}, - {BG_IC_GO_ALLIANCE_BANNER,GO_ALLIANCE_BANNER,TEAM_ALLIANCE,NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A,GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT,GO_HORDE_BANNER_GRAVEYARD_A,GO_HORDE_BANNER_GRAVEYARD_A_CONT},false,0,0,{BG_IC_ALLIANCE_KEEP_UNCONTROLLED,BG_IC_ALLIANCE_KEEP_CONFLICT_A,BG_IC_ALLIANCE_KEEP_CONFLICT_H,BG_IC_ALLIANCE_KEEP_CONTROLLED_A,BG_IC_ALLIANCE_KEEP_CONTROLLED_H},NODE_STATE_CONTROLLED_A,LANG_BG_IC_ALLIANCE_KEEP}, - {BG_IC_GO_HORDE_BANNER,GO_HORDE_BANNER,TEAM_HORDE,NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H,GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT,GO_HORDE_BANNER_GRAVEYARD_H,GO_HORDE_BANNER_GRAVEYARD_H_CONT},false,0,0,{BG_IC_HORDE_KEEP_UNCONTROLLED,BG_IC_HORDE_KEEP_CONFLICT_A,BG_IC_HORDE_KEEP_CONFLICT_H,BG_IC_HORDE_KEEP_CONTROLLED_A,BG_IC_HORDE_KEEP_CONTROLLED_H},NODE_STATE_CONTROLLED_H,LANG_BG_IC_HORDE_KEEP}, + {BG_IC_GO_REFINERY_BANNER, GO_REFINERY_BANNER, TEAM_NEUTRAL, NODE_TYPE_REFINERY, {GO_ALLIANCE_BANNER_REFINERY, GO_ALLIANCE_BANNER_REFINERY_CONT, GO_HORDE_BANNER_REFINERY, GO_HORDE_BANNER_REFINERY_CONT}, false, 0, 0, {BG_IC_REFINERY_UNCONTROLLED, BG_IC_REFINERY_CONFLICT_A, BG_IC_REFINERY_CONFLICT_H, BG_IC_REFINERY_CONTROLLED_A, BG_IC_REFINERY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_REFINERY}, + {BG_IC_GO_QUARRY_BANNER, GO_QUARRY_BANNER, TEAM_NEUTRAL, NODE_TYPE_QUARRY, {GO_ALLIANCE_BANNER_QUARRY, GO_ALLIANCE_BANNER_QUARRY_CONT, GO_HORDE_BANNER_QUARRY, GO_HORDE_BANNER_QUARRY_CONT}, false, 0, 0, {BG_IC_QUARRY_UNCONTROLLED, BG_IC_QUARRY_CONFLICT_A, BG_IC_QUARRY_CONFLICT_H, BG_IC_QUARRY_CONTROLLED_A, BG_IC_QUARRY_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_QUARRY}, + {BG_IC_GO_DOCKS_BANNER, GO_DOCKS_BANNER, TEAM_NEUTRAL, NODE_TYPE_DOCKS, {GO_ALLIANCE_BANNER_DOCK, GO_ALLIANCE_BANNER_DOCK_CONT, GO_HORDE_BANNER_DOCK, GO_HORDE_BANNER_DOCK_CONT}, false, 0, 0, {BG_IC_DOCKS_UNCONTROLLED, BG_IC_DOCKS_CONFLICT_A, BG_IC_DOCKS_CONFLICT_H, BG_IC_DOCKS_CONTROLLED_A, BG_IC_DOCKS_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_DOCKS}, + {BG_IC_GO_HANGAR_BANNER, GO_HANGAR_BANNER, TEAM_NEUTRAL, NODE_TYPE_HANGAR, {GO_ALLIANCE_BANNER_HANGAR, GO_ALLIANCE_BANNER_HANGAR_CONT, GO_HORDE_BANNER_HANGAR, GO_HORDE_BANNER_HANGAR_CONT}, false, 0, 0, {BG_IC_HANGAR_UNCONTROLLED, BG_IC_HANGAR_CONFLICT_A, BG_IC_HANGAR_CONFLICT_H, BG_IC_HANGAR_CONTROLLED_A, BG_IC_HANGAR_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_HANGAR}, + {BG_IC_GO_WORKSHOP_BANNER, GO_WORKSHOP_BANNER, TEAM_NEUTRAL, NODE_TYPE_WORKSHOP, {GO_ALLIANCE_BANNER_WORKSHOP, GO_ALLIANCE_BANNER_WORKSHOP_CONT, GO_HORDE_BANNER_WORKSHOP, GO_HORDE_BANNER_WORKSHOP_CONT}, false, 0, 0, {BG_IC_WORKSHOP_UNCONTROLLED, BG_IC_WORKSHOP_CONFLICT_A, BG_IC_WORKSHOP_CONFLICT_H, BG_IC_WORKSHOP_CONTROLLED_A, BG_IC_WORKSHOP_CONTROLLED_H}, NODE_STATE_UNCONTROLLED, LANG_BG_IC_WORKSHOP}, + {BG_IC_GO_ALLIANCE_BANNER, GO_ALLIANCE_BANNER, TEAM_ALLIANCE, NODE_TYPE_GRAVEYARD_A, {GO_ALLIANCE_BANNER_GRAVEYARD_A, GO_ALLIANCE_BANNER_GRAVEYARD_A_CONT, GO_HORDE_BANNER_GRAVEYARD_A, GO_HORDE_BANNER_GRAVEYARD_A_CONT}, false, 0, 0, {BG_IC_ALLIANCE_KEEP_UNCONTROLLED, BG_IC_ALLIANCE_KEEP_CONFLICT_A, BG_IC_ALLIANCE_KEEP_CONFLICT_H, BG_IC_ALLIANCE_KEEP_CONTROLLED_A, BG_IC_ALLIANCE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_A, LANG_BG_IC_ALLIANCE_KEEP}, + {BG_IC_GO_HORDE_BANNER, GO_HORDE_BANNER, TEAM_HORDE, NODE_TYPE_GRAVEYARD_H, {GO_ALLIANCE_BANNER_GRAVEYARD_H, GO_ALLIANCE_BANNER_GRAVEYARD_H_CONT, GO_HORDE_BANNER_GRAVEYARD_H, GO_HORDE_BANNER_GRAVEYARD_H_CONT}, false, 0, 0, {BG_IC_HORDE_KEEP_UNCONTROLLED, BG_IC_HORDE_KEEP_CONFLICT_A, BG_IC_HORDE_KEEP_CONFLICT_H, BG_IC_HORDE_KEEP_CONTROLLED_A, BG_IC_HORDE_KEEP_CONTROLLED_H}, NODE_STATE_CONTROLLED_H, LANG_BG_IC_HORDE_KEEP}, }; enum HonorRewards @@ -869,7 +869,7 @@ class BattlegroundIC : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr,uint64 guid); + void RemovePlayer(Player *plr, uint64 guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); bool SetupBattleground(); void SpawnLeader(uint32 teamid); @@ -908,7 +908,7 @@ class BattlegroundIC : public Battleground Transport* gunshipAlliance; Transport* gunshipHorde; - uint32 GetNextBanner(ICNodePoint* nodePoint,uint32 team, bool returnDefinitve); + uint32 GetNextBanner(ICNodePoint* nodePoint, uint32 team, bool returnDefinitve); uint32 GetGateIDFromEntry(uint32 id) { @@ -957,7 +957,7 @@ class BattlegroundIC : public Battleground void UpdateNodeWorldState(ICNodePoint* nodePoint); void HandleCapturedNodes(ICNodePoint* nodePoint, bool recapture); void HandleContestedNodes(ICNodePoint* nodePoint); - Transport* CreateTransport(uint32 goEntry,uint32 period); + Transport* CreateTransport(uint32 goEntry, uint32 period); void SendTransportInit(Player* player); }; #endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp index e33d9f0123a..ec784385940 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundNA.cpp @@ -104,7 +104,7 @@ void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer) return; } - Battleground::HandleKillPlayer(player,killer); + Battleground::HandleKillPlayer(player, killer); UpdateArenaWorldState(); CheckArenaWinConditions(); @@ -112,7 +112,7 @@ void BattlegroundNA::HandleKillPlayer(Player *player, Player *killer) bool BattlegroundNA::HandlePlayerUnderMap(Player *player) { - player->TeleportTo(GetMapId(),4055.504395f,2919.660645f,13.611241f,player->GetOrientation(),false); + player->TeleportTo(GetMapId(), 4055.504395f, 2919.660645f, 13.611241f, player->GetOrientation(), false); return true; } @@ -135,7 +135,7 @@ void BattlegroundNA::HandleAreaTrigger(Player *Source, uint32 Trigger) } //if (buff_guid) - // HandleTriggerBuff(buff_guid,Source); + // HandleTriggerBuff(buff_guid, Source); } void BattlegroundNA::FillInitialWorldStates(WorldPacket &data) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp index c860d65d33c..5adc117a1be 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRB.cpp @@ -57,7 +57,7 @@ void BattlegroundRB::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundRB::RemovePlayer(Player* /*plr*/,uint64 /*guid*/) +void BattlegroundRB::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) { } @@ -75,5 +75,5 @@ void BattlegroundRB::UpdatePlayerScore(Player* Source, uint32 type, uint32 value if (itr == m_PlayerScores.end()) // player not found... return; - Battleground::UpdatePlayerScore(Source,type,value, doAddHonor); + Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); } diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRB.h b/src/server/game/Battlegrounds/Zones/BattlegroundRB.h index eb2e5cd181f..7a521ae489f 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRB.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRB.h @@ -41,7 +41,7 @@ class BattlegroundRB : public Battleground virtual void StartingEventCloseDoors(); virtual void StartingEventOpenDoors(); - void RemovePlayer(Player *plr,uint64 guid); + void RemovePlayer(Player *plr, uint64 guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); /* Scorekeeping */ diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp index 4581feaabca..c6f991ce184 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundRL.cpp @@ -104,7 +104,7 @@ void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer) return; } - Battleground::HandleKillPlayer(player,killer); + Battleground::HandleKillPlayer(player, killer); UpdateArenaWorldState(); CheckArenaWinConditions(); @@ -112,7 +112,7 @@ void BattlegroundRL::HandleKillPlayer(Player *player, Player *killer) bool BattlegroundRL::HandlePlayerUnderMap(Player *player) { - player->TeleportTo(GetMapId(),1285.810547f,1667.896851f,39.957642f,player->GetOrientation(),false); + player->TeleportTo(GetMapId(), 1285.810547f, 1667.896851f, 39.957642f, player->GetOrientation(), false); return true; } @@ -136,7 +136,7 @@ void BattlegroundRL::HandleAreaTrigger(Player *Source, uint32 Trigger) } //if (buff_guid) - // HandleTriggerBuff(buff_guid,Source); + // HandleTriggerBuff(buff_guid, Source); } void BattlegroundRL::FillInitialWorldStates(WorldPacket &data) diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp index c1ad44f7929..9a1e4a8c0b2 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp @@ -46,7 +46,7 @@ BattlegroundSA::~BattlegroundSA() void BattlegroundSA::Reset() { TotalTime = 0; - Attackers = ((urand(0,1)) ? TEAM_ALLIANCE : TEAM_HORDE); + Attackers = ((urand(0, 1)) ? TEAM_ALLIANCE : TEAM_HORDE); for (uint8 i = 0; i <= 5; i++) GateStatus[i] = BG_SA_GATE_OK; ShipsStarted = false; @@ -83,7 +83,7 @@ bool BattlegroundSA::ResetObjs() for (uint8 i = 0; i < BG_SA_BOAT_ONE; i++) { - if (!AddObject(i,BG_SA_ObjEntries[i],BG_SA_ObjSpawnlocs[i][0],BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3],0,0,0,0,RESPAWN_ONE_DAY)) + if (!AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY)) return false; } @@ -99,18 +99,18 @@ bool BattlegroundSA::ResetObjs() boatid= Attackers ? BG_SA_BOAT_TWO_H : BG_SA_BOAT_TWO_A; break; } - if (!AddObject(i,boatid,BG_SA_ObjSpawnlocs[i][0], + if (!AddObject(i, boatid, BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2]+(Attackers ? -3.750f: 0), - BG_SA_ObjSpawnlocs[i][3],0,0,0,0,RESPAWN_ONE_DAY)) + BG_SA_ObjSpawnlocs[i][3], 0, 0, 0, 0, RESPAWN_ONE_DAY)) return false; } for (uint8 i = BG_SA_SIGIL_1; i < BG_SA_CENTRAL_FLAG; i++) { - if (!AddObject(i,BG_SA_ObjEntries[i], - BG_SA_ObjSpawnlocs[i][0],BG_SA_ObjSpawnlocs[i][1], - BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3], - 0,0,0,0,RESPAWN_ONE_DAY)) + if (!AddObject(i, BG_SA_ObjEntries[i], + BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], + BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], + 0, 0, 0, 0, RESPAWN_ONE_DAY)) return false; } @@ -125,8 +125,8 @@ bool BattlegroundSA::ResetObjs() for (uint8 i = 0; i < BG_SA_NPC_SPARKLIGHT; i++) { if (!AddCreature(BG_SA_NpcEntries[i], i, (Attackers == TEAM_ALLIANCE ? TEAM_HORDE : TEAM_ALLIANCE), - BG_SA_NpcSpawnlocs[i][0],BG_SA_NpcSpawnlocs[i][1], - BG_SA_NpcSpawnlocs[i][2],BG_SA_NpcSpawnlocs[i][3],600)) + BG_SA_NpcSpawnlocs[i][0], BG_SA_NpcSpawnlocs[i][1], + BG_SA_NpcSpawnlocs[i][2], BG_SA_NpcSpawnlocs[i][3], 600)) return false; } @@ -156,7 +156,7 @@ bool BattlegroundSA::ResetObjs() if (!sg) { - sLog->outError("SOTA: Can't find GY entry %u",BG_SA_GYEntries[i]); + sLog->outError("SOTA: Can't find GY entry %u", BG_SA_GYEntries[i]); return false; } @@ -169,7 +169,7 @@ bool BattlegroundSA::ResetObjs() { GraveyardStatus[i] = ((Attackers == TEAM_HORDE)? TEAM_ALLIANCE : TEAM_HORDE); if (!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((Attackers == TEAM_HORDE)? ALLIANCE : HORDE))) - sLog->outError("SOTA: couldn't spawn GY: %u",i); + sLog->outError("SOTA: couldn't spawn GY: %u", i); } } @@ -179,7 +179,7 @@ bool BattlegroundSA::ResetObjs() AddObject(i, (BG_SA_ObjEntries[i] - (Attackers == TEAM_ALLIANCE ? 1:0)), BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], - 0,0,0,0,RESPAWN_ONE_DAY); + 0, 0, 0, 0, RESPAWN_ONE_DAY); GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF); } @@ -188,7 +188,7 @@ bool BattlegroundSA::ResetObjs() AddObject(i, BG_SA_ObjEntries[i], BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], - 0,0,0,0,RESPAWN_ONE_DAY); + 0, 0, 0, 0, RESPAWN_ONE_DAY); GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, defF); } @@ -197,7 +197,7 @@ bool BattlegroundSA::ResetObjs() AddObject(i, BG_SA_ObjEntries[BG_SA_BOMB], BG_SA_ObjSpawnlocs[i][0], BG_SA_ObjSpawnlocs[i][1], BG_SA_ObjSpawnlocs[i][2], BG_SA_ObjSpawnlocs[i][3], - 0,0,0,0,RESPAWN_ONE_DAY); + 0, 0, 0, 0, RESPAWN_ONE_DAY); GetBGObject(i)->SetUInt32Value(GAMEOBJECT_FACTION, atF); } @@ -220,8 +220,8 @@ bool BattlegroundSA::ResetObjs() UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 0); UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 0); - UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN,1); - UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN,0); + UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 1); + UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 0); } else { @@ -233,8 +233,8 @@ bool BattlegroundSA::ResetObjs() UpdateWorldState(BG_SA_RIGHT_ATT_TOKEN_HRD, 1); UpdateWorldState(BG_SA_LEFT_ATT_TOKEN_HRD, 1); - UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN,0); - UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN,1); + UpdateWorldState(BG_SA_HORDE_DEFENCE_TOKEN, 0); + UpdateWorldState(BG_SA_ALLIANCE_DEFENCE_TOKEN, 1); } UpdateWorldState(BG_SA_PURPLE_GATEWS, 1); @@ -443,9 +443,9 @@ void BattlegroundSA::AddPlayer(Player *plr) { if (plr->GetTeamId() == Attackers) { - plr->CastSpell(plr,12438,true);//Without this player falls before boat loads... + plr->CastSpell(plr, 12438, true);//Without this player falls before boat loads... - if (urand(0,1)) + if (urand(0, 1)) plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0); else plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0); @@ -465,7 +465,7 @@ void BattlegroundSA::AddPlayer(Player *plr) m_PlayerScores[plr->GetGUID()] = sc; } -void BattlegroundSA::RemovePlayer(Player* /*plr*/,uint64 /*guid*/) +void BattlegroundSA::RemovePlayer(Player* /*plr*/, uint64 /*guid*/) { } @@ -487,7 +487,7 @@ void BattlegroundSA::UpdatePlayerScore(Player* Source, uint32 type, uint32 value else if (type == SCORE_DESTROYED_WALL) ((BattlegroundSAScore*)itr->second)->gates_destroyed += value; else - Battleground::UpdatePlayerScore(Source,type,value, doAddHonor); + Battleground::UpdatePlayerScore(Source, type, value, doAddHonor); } void BattlegroundSA::TeleportPlayers() @@ -511,9 +511,9 @@ void BattlegroundSA::TeleportPlayers() if (plr->GetTeamId() == Attackers) { - plr->CastSpell(plr,12438,true); //Without this player falls before boat loads... + plr->CastSpell(plr, 12438, true); //Without this player falls before boat loads... - if (urand(0,1)) + if (urand(0, 1)) plr->TeleportTo(607, 2682.936f, -830.368f, 50.0f, 2.895f, 0); else plr->TeleportTo(607, 2577.003f, 980.261f, 50.0f, 0.807f, 0); @@ -635,9 +635,9 @@ void BattlegroundSA::DestroyGate(Player* pl, GameObject* /*go*/, uint32 destroye if (i < 5) DelObject(i+9); - UpdatePlayerScore(pl,SCORE_DESTROYED_WALL, 1); + UpdatePlayerScore(pl, SCORE_DESTROYED_WALL, 1); if (rewardHonor) - UpdatePlayerScore(pl,SCORE_BONUS_HONOR,(GetBonusHonorFromKill(1))); + UpdatePlayerScore(pl, SCORE_BONUS_HONOR, (GetBonusHonorFromKill(1))); } } } @@ -648,9 +648,9 @@ WorldSafeLocsEntry const* BattlegroundSA::GetClosestGraveYard(Player* player) WorldSafeLocsEntry const* ret; WorldSafeLocsEntry const* closest; float dist, nearest; - float x,y,z; + float x, y, z; - player->GetPosition(x,y,z); + player->GetPosition(x, y, z); if (player->GetTeamId() == Attackers) safeloc = BG_SA_GYEntries[BG_SA_BEACH_GY]; @@ -727,9 +727,9 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source) case BG_SA_LEFT_CAPTURABLE_GY: flag = BG_SA_LEFT_FLAG; DelObject(flag); - AddObject(flag,(BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)), - BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1], - BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY); + AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)), + BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], + BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); npc = BG_SA_NPC_RIGSPARK; AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, @@ -747,8 +747,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source) flag = BG_SA_RIGHT_FLAG; DelObject(flag); AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)), - BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1], - BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY); + BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], + BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); npc = BG_SA_NPC_SPARKLIGHT; AddCreature(BG_SA_NpcEntries[npc], npc, Attackers, @@ -766,8 +766,8 @@ void BattlegroundSA::CaptureGraveyard(BG_SA_Graveyards i, Player *Source) flag = BG_SA_CENTRAL_FLAG; DelObject(flag); AddObject(flag, (BG_SA_ObjEntries[flag] - (Source->GetTeamId() == TEAM_ALLIANCE ? 0:1)), - BG_SA_ObjSpawnlocs[flag][0],BG_SA_ObjSpawnlocs[flag][1], - BG_SA_ObjSpawnlocs[flag][2],BG_SA_ObjSpawnlocs[flag][3],0,0,0,0,RESPAWN_ONE_DAY); + BG_SA_ObjSpawnlocs[flag][0], BG_SA_ObjSpawnlocs[flag][1], + BG_SA_ObjSpawnlocs[flag][2], BG_SA_ObjSpawnlocs[flag][3], 0, 0, 0, 0, RESPAWN_ONE_DAY); UpdateWorldState(BG_SA_CENTER_GY_ALLIANCE, (GraveyardStatus[i] == TEAM_ALLIANCE? 1:0)); UpdateWorldState(BG_SA_CENTER_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1)); diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h index 5bd5216b708..a481194402a 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h +++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h @@ -170,10 +170,10 @@ const float BG_SA_NpcSpawnlocs[BG_SA_MAXNPC + BG_SA_DEMOLISHER_AMOUNT][4] = { 1236.213f, 92.287f, 64.965f, 5.751f }, { 1215.11f, 57.772f, 64.739f, 5.78f } , //Demolishers - { 1611.597656f,-117.270073f,8.719355f,2.513274f}, - { 1575.562500f,-158.421875f,5.024450f,2.129302f}, - { 1618.047729f,61.424641f,7.248210f,3.979351f}, - { 1575.103149f,98.873344f,2.830360f,3.752458f}, + { 1611.597656f, -117.270073f, 8.719355f, 2.513274f}, + { 1575.562500f, -158.421875f, 5.024450f, 2.129302f}, + { 1618.047729f, 61.424641f, 7.248210f, 3.979351f}, + { 1575.103149f, 98.873344f, 2.830360f, 3.752458f}, //trigger { 1453.49f, -250.453f, 30.896f, 4.2883f}, { 1377.05f, 97.036f, 30.8605f, 2.46539f}, @@ -240,19 +240,19 @@ const float BG_SA_ObjSpawnlocs[BG_SA_MAXOBJ][4] = { 1230.75f, -210.724f, 67.611f, 0.5023f }, { 1217.8f, 79.532f, 66.58f, 5.745f }, //Flagpoles - { 1215.114258f,-65.711861f,70.084267f,-3.124123f}, - {1338.863892f,-153.336533f,30.895121f,-2.530723f}, - {1309.124268f,9.410645f,30.893402f,-1.623156f}, + { 1215.114258f, -65.711861f, 70.084267f, -3.124123f}, + {1338.863892f, -153.336533f, 30.895121f, -2.530723f}, + {1309.124268f, 9.410645f, 30.893402f, -1.623156f}, //Flags - { 1215.108032f,-65.715767f,70.084267f,-3.124123f}, - { 1338.859253f,-153.327316f,30.895077f,-2.530723f}, - { 1309.192017f,9.416233f,30.893402f,1.518436f}, + { 1215.108032f, -65.715767f, 70.084267f, -3.124123f}, + { 1338.859253f, -153.327316f, 30.895077f, -2.530723f}, + { 1309.192017f, 9.416233f, 30.893402f, 1.518436f}, //Portal {1468.380005f, -225.798996f, 30.896200f, 0.0f}, //blue - {1394.270020f, 72.551399f, 31.054300f, 0.0f},//green - {1065.260010f, -89.79501f, 81.073402f, 0.0f},//yellow - {1216.069946f, 47.904301f, 54.278198f,0.0f}, //purple - {1255.569946f, -233.548996f, 56.43699f, 0.0f},//red + {1394.270020f, 72.551399f, 31.054300f, 0.0f}, //green + {1065.260010f, -89.79501f, 81.073402f, 0.0f}, //yellow + {1216.069946f, 47.904301f, 54.278198f, 0.0f}, //purple + {1255.569946f, -233.548996f, 56.43699f, 0.0f}, //red //Bombs {1333.45f, 211.354f, 31.0538f, 5.03666f}, {1334.29f, 209.582f, 31.0532f, 1.28088f}, @@ -346,8 +346,8 @@ const uint32 BG_SA_ObjEntries[BG_SA_MAXOBJ + BG_SA_FLAG_AMOUNT] = 190723, 192549, 192834, - 0,// Boat - 0,// Boat + 0, // Boat + 0, // Boat 192687, 192685, 192689, @@ -481,7 +481,7 @@ class BattlegroundSA : public Battleground void EndBattleground(uint32 winner); /// CAlled when a player leave battleground - void RemovePlayer(Player *plr,uint64 guid); + void RemovePlayer(Player *plr, uint64 guid); void HandleAreaTrigger(Player *Source, uint32 Trigger); /* Scorekeeping */ @@ -566,7 +566,7 @@ class BattlegroundSA : public Battleground bool SignaledRoundTwoHalfMin; /// for know if second round has been init bool InitSecondRound; - std::map<uint32/*id*/,uint32/*timer*/> DemoliserRespawnList; + std::map<uint32/*id*/, uint32/*timer*/> DemoliserRespawnList; }; #endif diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp index fe2791c3d14..927b8fc81ed 100755 --- a/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp +++ b/src/server/game/Battlegrounds/Zones/BattlegroundWS.cpp @@ -38,13 +38,13 @@ enum BG_WSG_Rewards }; uint32 BG_WSG_Honor[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = { - {20,40,40}, // normal honor - {60,40,80} // holiday + {20, 40, 40}, // normal honor + {60, 40, 80} // holiday }; uint32 BG_WSG_Reputation[BG_HONOR_MODE_NUM][BG_WSG_REWARD_NUM] = { - {0,35,0}, // normal honor - {0,45,0} // holiday + {0, 35, 0}, // normal honor + {0, 45, 0} // holiday }; BattlegroundWS::BattlegroundWS() @@ -143,9 +143,9 @@ void BattlegroundWS::Update(uint32 diff) if (m_FlagDebuffState == 0 && m_FlagSpellForceTimer >= 600000) //10 minutes { if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0])) - plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true); + plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true); if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1])) - plr->CastSpell(plr,WS_SPELL_FOCUSED_ASSAULT,true); + plr->CastSpell(plr, WS_SPELL_FOCUSED_ASSAULT, true); m_FlagDebuffState = 1; } else if (m_FlagDebuffState == 1 && m_FlagSpellForceTimer >= 900000) //15 minutes @@ -153,12 +153,12 @@ void BattlegroundWS::Update(uint32 diff) if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[0])) { plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); - plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true); + plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true); } if (Player * plr = sObjectMgr->GetPlayer(m_FlagKeepers[1])) { plr->RemoveAurasDueToSpell(WS_SPELL_FOCUSED_ASSAULT); - plr->CastSpell(plr,WS_SPELL_BRUTAL_ASSAULT,true); + plr->CastSpell(plr, WS_SPELL_BRUTAL_ASSAULT, true); } m_FlagDebuffState = 2; } @@ -242,7 +242,7 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team) if (GetStatus() != STATUS_IN_PROGRESS) return; - RespawnFlag(team,false); + RespawnFlag(team, false); if (team == ALLIANCE) { SpawnBGObject(BG_WS_OBJECT_A_FLAG, RESPAWN_IMMEDIATELY); @@ -260,9 +260,9 @@ void BattlegroundWS::RespawnFlagAfterDrop(uint32 team) if (obj) obj->Delete(); else - sLog->outError("unknown droped flag bg, guid: %u",GUID_LOPART(GetDroppedFlagGUID(team))); + sLog->outError("unknown droped flag bg, guid: %u", GUID_LOPART(GetDroppedFlagGUID(team))); - SetDroppedFlagGUID(0,team); + SetDroppedFlagGUID(0, team); m_BothFlagsKept = false; } @@ -509,9 +509,9 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target m_FlagState[BG_TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(HORDE, BG_WS_FLAG_STATE_ON_PLAYER); if (m_FlagDebuffState == 1) - Source->CastSpell(Source,WS_SPELL_FOCUSED_ASSAULT,true); + Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true); if (m_FlagDebuffState == 2) - Source->CastSpell(Source,WS_SPELL_BRUTAL_ASSAULT,true); + Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_ALLIANCE, 1); } //called in HandleGameObjectUseOpcode: @@ -543,9 +543,9 @@ void BattlegroundWS::EventPlayerClickedOnFlag(Player *Source, GameObject* target m_FlagState[BG_TEAM_HORDE] = BG_WS_FLAG_STATE_ON_PLAYER; UpdateFlagState(ALLIANCE, BG_WS_FLAG_STATE_ON_PLAYER); if (m_FlagDebuffState == 1) - Source->CastSpell(Source,WS_SPELL_FOCUSED_ASSAULT,true); + Source->CastSpell(Source, WS_SPELL_FOCUSED_ASSAULT, true); if (m_FlagDebuffState == 2) - Source->CastSpell(Source,WS_SPELL_BRUTAL_ASSAULT,true); + Source->CastSpell(Source, WS_SPELL_BRUTAL_ASSAULT, true); UpdateWorldState(BG_WS_FLAG_UNK_HORDE, 1); } //called in HandleGameObjectUseOpcode: @@ -652,7 +652,7 @@ void BattlegroundWS::HandleAreaTrigger(Player *Source, uint32 Trigger) } //if (buff_guid) - // HandleTriggerBuff(buff_guid,Source); + // HandleTriggerBuff(buff_guid, Source); } bool BattlegroundWS::SetupBattleground() diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp index 692067b3dc3..d1c5aa78cd5 100755 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -76,7 +76,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) uint64 banned_guid = atol(*iter); if (banned_guid) { - sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid); + sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) loaded banned guid:" UI64FMTD "", name.c_str(), banned_guid); banned.insert(banned_guid); } } @@ -88,7 +88,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team) stmt->setString(0, name); stmt->setUInt32(1, m_Team); CharacterDatabase.Execute(stmt); - sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) saved in database", name.c_str()); + sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) saved in database", name.c_str()); } m_IsSaved = true; @@ -116,7 +116,7 @@ void Channel::UpdateChannelInDB() const stmt->setUInt32(5, m_Team); CharacterDatabase.Execute(stmt); - sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) updated in database", m_name.c_str()); + sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) updated in database", m_name.c_str()); } } @@ -137,7 +137,7 @@ void Channel::CleanOldChannelsInDB() stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) * DAY); CharacterDatabase.Execute(stmt); - sLog->outDebug(LOG_FILTER_CHATSYS,"Cleaned out unused custom chat channels."); + sLog->outDebug(LOG_FILTER_CHATSYS, "Cleaned out unused custom chat channels."); } } @@ -576,7 +576,7 @@ void Channel::List(Player* player) } } - data.put<uint32>(pos,count); + data.put<uint32>(pos, count); SendToOne(&data, p); } diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index bc5f5b34f4b..136cc89aaf3 100755 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -44,12 +44,12 @@ ChannelMgr::~ChannelMgr() Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id) { std::wstring wname; - Utf8toWStr(name,wname); + Utf8toWStr(name, wname); wstrToLower(wname); if (channels.find(wname) == channels.end()) { - Channel *nchan = new Channel(name,channel_id, team); + Channel *nchan = new Channel(name, channel_id, team); channels[wname] = nchan; return nchan; } @@ -60,7 +60,7 @@ Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id) Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt) { std::wstring wname; - Utf8toWStr(name,wname); + Utf8toWStr(name, wname); wstrToLower(wname); ChannelMap::const_iterator i = channels.find(wname); @@ -70,7 +70,7 @@ Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt) if (pkt) { WorldPacket data; - MakeNotOnPacket(&data,name); + MakeNotOnPacket(&data, name); p->GetSession()->SendPacket(&data); } @@ -83,7 +83,7 @@ Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt) void ChannelMgr::LeftChannel(std::string name) { std::wstring wname; - Utf8toWStr(name,wname); + Utf8toWStr(name, wname); wstrToLower(wname); ChannelMap::const_iterator i = channels.find(wname); diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h index 2e99830f579..971bcaa196b 100755 --- a/src/server/game/Chat/Channels/ChannelMgr.h +++ b/src/server/game/Chat/Channels/ChannelMgr.h @@ -31,7 +31,7 @@ class ChannelMgr { public: uint32 team; - typedef std::map<std::wstring,Channel*> ChannelMap; + typedef std::map<std::wstring, Channel*> ChannelMap; ChannelMgr() {team = 0;} ~ChannelMgr(); diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index b394ba94211..32da0947aff 100755 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -240,28 +240,28 @@ ChatCommand * ChatHandler::getCommandTable() static ChatCommand serverIdleRestartCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL }, + { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverIdleShutdownCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL }, + { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverRestartCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL }, + { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand serverShutdownCommandTable[] = { - { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL }, + { "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL }, { "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; @@ -401,7 +401,7 @@ ChatCommand * ChatHandler::getCommandTable() { "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL }, { "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL }, { "combatstop", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL }, - { "flusharenapoints",SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL }, + { "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL }, { "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL }, @@ -443,7 +443,7 @@ ChatCommand * ChatHandler::getCommandTable() added += appendCommandTable(commandTableCache + added, *it); } - QueryResult result = WorldDatabase.Query("SELECT name,security,help FROM command"); + QueryResult result = WorldDatabase.Query("SELECT name, security, help FROM command"); if (result) { do @@ -499,7 +499,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong) return true; } - return HasLowerSecurityAccount(target_session,target_account,strong); + return HasLowerSecurityAccount(target_session, target_account, strong); } bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_account, bool strong) @@ -620,7 +620,7 @@ void ChatHandler::PSendSysMessage(int32 entry, ...) va_list ap; char str [2048]; va_start(ap, entry); - vsnprintf(str,2048,format, ap); + vsnprintf(str, 2048, format, ap); va_end(ap); SendSysMessage(str); } @@ -630,7 +630,7 @@ void ChatHandler::PSendSysMessage(const char *format, ...) va_list ap; char str [2048]; va_start(ap, format); - vsnprintf(str,2048,format, ap); + vsnprintf(str, 2048, format, ap); va_end(ap); SendSysMessage(str); } @@ -661,7 +661,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co if (!hasStringAbbr(table[j].Name, cmd.c_str())) continue; - if (strcmp(table[j].Name,cmd.c_str()) != 0) + if (strcmp(table[j].Name, cmd.c_str()) != 0) continue; else { @@ -683,7 +683,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co else SendSysMessage(LANG_CMD_SYNTAX); - ShowHelpForCommand(table[i].ChildCommands,text); + ShowHelpForCommand(table[i].ChildCommands, text); } return true; @@ -704,8 +704,8 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co { Player* p = m_session->GetPlayer(); uint64 sel_guid = p->GetSelection(); - sLog->outCommand(m_session->GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]", - fullcmd.c_str(),p->GetName(),m_session->GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(), + sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]", + fullcmd.c_str(), p->GetName(), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(), GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName() : "", GUID_LOPART(sel_guid)); } } @@ -756,12 +756,12 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text, // expected subcommand by full name DB content else if (*text) { - sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.",text,fullcommand.c_str()); + sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str()); return false; } if (table[i].SecurityLevel != security) - sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u",fullcommand.c_str(),table[i].SecurityLevel,security); + sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security); table[i].SecurityLevel = security; table[i].Help = help; @@ -772,9 +772,9 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text, if (!cmd.empty()) { if (table == getCommandTable()) - sLog->outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str()); + sLog->outErrorDb("Table `command` have not existed command '%s', skip.", cmd.c_str()); else - sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str()); + sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str()); } return false; @@ -910,10 +910,10 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, ch if (table == getCommandTable()) { SendSysMessage(LANG_AVIABLE_CMD); - PSendSysMessage("%s",list.c_str()); + PSendSysMessage("%s", list.c_str()); } else - PSendSysMessage(LANG_SUBCMDS_LIST,cmd,list.c_str()); + PSendSysMessage(LANG_SUBCMDS_LIST, cmd, list.c_str()); return true; } @@ -944,7 +944,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd) SendSysMessage(table[i].Help.c_str()); if (table[i].ChildCommands) - if (ShowHelpForSubCommands(table[i].ChildCommands,table[i].Name,subcmd ? subcmd : "")) + if (ShowHelpForSubCommands(table[i].ChildCommands, table[i].Name, subcmd ? subcmd : "")) return true; return !table[i].Help.empty(); @@ -965,14 +965,14 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd) SendSysMessage(table[i].Help.c_str()); if (table[i].ChildCommands) - if (ShowHelpForSubCommands(table[i].ChildCommands,"","")) + if (ShowHelpForSubCommands(table[i].ChildCommands, "", "")) return true; return !table[i].Help.empty(); } } - return ShowHelpForSubCommands(table,"",cmd); + return ShowHelpForSubCommands(table, "", cmd); } //Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored) @@ -1079,7 +1079,7 @@ Unit* ChatHandler::getSelectedUnit() if (guid == 0) return m_session->GetPlayer(); - return ObjectAccessor::GetUnit(*m_session->GetPlayer(),guid); + return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid); } WorldObject *ChatHandler::getSelectedObject() @@ -1092,7 +1092,7 @@ WorldObject *ChatHandler::getSelectedObject() if (guid == 0) return GetNearbyGameObject(); - return ObjectAccessor::GetUnit(*m_session->GetPlayer(),guid); + return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid); } Creature* ChatHandler::getSelectedCreature() @@ -1100,7 +1100,7 @@ Creature* ChatHandler::getSelectedCreature() if (!m_session) return NULL; - return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection()); + return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(), m_session->GetPlayer()->GetSelection()); } char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1) @@ -1132,9 +1132,9 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s if (!cLinkType) return NULL; // end of data - if (strcmp(cLinkType,linkType) != 0) + if (strcmp(cLinkType, linkType) != 0) { - strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after retturn from function + strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after retturn from function SendSysMessage(LANG_WRONG_LINK_TYPE); return NULL; } @@ -1147,7 +1147,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s *something1 = strtok(NULL, ":|"); // extract something strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces - strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function + strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function return cKey; } @@ -1193,7 +1193,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes, for (int i = 0; linkTypes[i]; ++i) { - if (strcmp(cLinkType,linkTypes[i]) == 0) + if (strcmp(cLinkType, linkTypes[i]) == 0) { char* cKeys = strtok(NULL, "|"); // extract keys and values char* cKeysTail = strtok(NULL, ""); @@ -1203,14 +1203,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes, *something1 = strtok(NULL, ":|"); // extract something strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces - strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function + strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function if (found_idx) *found_idx = i; return cKey; } } - strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function + strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function SendSysMessage(LANG_WRONG_LINK_TYPE); return NULL; } @@ -1228,7 +1228,7 @@ GameObject* ChatHandler::GetNearbyGameObject() return obj; } -GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry) +GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry) { if (!m_session) return NULL; @@ -1244,8 +1244,8 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; - Trinity::GameObjectWithDbGUIDCheck go_check(*pl,lowguid); - Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl,obj,go_check); + Trinity::GameObjectWithDbGUIDCheck go_check(*pl, lowguid); + Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check); TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker); cell.Visit(p, object_checker, *pl->GetMap()); @@ -1278,11 +1278,11 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text) // number or [name] Shift-click form |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r // number or [name] Shift-click form |color|Hglyph:glyph_slot_id:glyph_prop_id|h[%s]|h|r // number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r - // number or [name] Shift-click form |color|Htalent:talent_id,rank|h[name]|h|r - // number or [name] Shift-click form |color|Htrade:spell_id,skill_id,max_value,cur_value|h[name]|h|r + // number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r + // number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r int type = 0; char* param1_str = NULL; - char* idS = extractKeyFromLink(text,spellKeys,&type,¶m1_str); + char* idS = extractKeyFromLink(text, spellKeys, &type, ¶m1_str); if (!idS) return 0; @@ -1330,7 +1330,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text) GameTele const* ChatHandler::extractGameTeleFromLink(char* text) { // id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r - char* cId = extractKeyFromLink(text,"Htele"); + char* cId = extractKeyFromLink(text, "Htele"); if (!cId) return false; @@ -1364,7 +1364,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) // |color|Hcreature:creature_guid|h[name]|h|r // |color|Hgameobject:go_guid|h[name]|h|r // |color|Hplayer:name|h[name]|h|r - char* idS = extractKeyFromLink(text,guidKeys,&type); + char* idS = extractKeyFromLink(text, guidKeys, &type); if (!idS) return 0; @@ -1389,7 +1389,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) uint32 lowguid = (uint32)atol(idS); if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid)) - return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT); + return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT); else return 0; } @@ -1398,7 +1398,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) uint32 lowguid = (uint32)atol(idS); if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid)) - return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT); + return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT); else return 0; } @@ -1411,7 +1411,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text) std::string ChatHandler::extractPlayerNameFromLink(char* text) { // |color|Hplayer:name|h[name]|h|r - char* name_str = extractKeyFromLink(text,"Hplayer"); + char* name_str = extractKeyFromLink(text, "Hplayer"); if (!name_str) return ""; @@ -1422,7 +1422,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text) return name; } -bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/,std::string* player_name /*= NULL*/) +bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/, std::string* player_name /*= NULL*/) { if (args && *args) { diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index bef14f17c8e..216ce95ad9c 100755 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -63,14 +63,14 @@ class ChatHandler FillMessageData(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, message); } - static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; } + static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; } // function with different implementation for chat/console virtual const char *GetTrinityString(int32 entry) const; virtual void SendSysMessage(const char *str); void SendSysMessage(int32 entry); - void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2,3); + void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2, 3); void PSendSysMessage(int32 entry, ...); std::string PGetParseString(int32 entry, ...) const; @@ -118,7 +118,7 @@ class ChatHandler std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); } GameObject* GetNearbyGameObject(); - GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry); + GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry); bool HasSentErrorMessage() { return sentErrorMessage;} void SetSentErrorMessage(bool val){ sentErrorMessage = val;}; static bool LoadCommandTable() { return load_command_table;} @@ -352,11 +352,11 @@ class ChatHandler // Utility methods for commands bool LookupPlayerSearchCommand(QueryResult result, int32 limit); bool HandleBanListHelper(QueryResult result); - bool HandleBanHelper(BanMode mode,char const* args); + bool HandleBanHelper(BanMode mode, char const* args); bool HandleBanInfoHelper(uint32 accountid, char const* accountname); - bool HandleUnBanHelper(BanMode mode,char const* args); + bool HandleUnBanHelper(BanMode mode, char const* args); void HandleCharacterLevel(Player* player, uint64 player_guid, uint32 oldlevel, uint32 newlevel); - void HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id); + void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id); // Stores informations about a deleted character struct DeletedInfo diff --git a/src/server/game/Chat/ChatLink.cpp b/src/server/game/Chat/ChatLink.cpp index bb0c0889a44..7bf56ee85bc 100644 --- a/src/server/game/Chat/ChatLink.cpp +++ b/src/server/game/Chat/ChatLink.cpp @@ -37,7 +37,7 @@ // |color|Hquest:quest_id:quest_level|h[name]|h|r - client, quest list name shift-click // |color|Hskill:skill_id|h[name]|h|r // |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click -// |color|Htalent:talent_id,rank|h[name]|h|r - client, talent icon shift-click +// |color|Htalent:talent_id, rank|h[name]|h|r - client, talent icon shift-click // |color|Htaxinode:id|h[name]|h|r // |color|Htele:id|h[name]|h|r // |color|Htitle:id|h[name]|h|r diff --git a/src/server/game/Chat/Commands/Level1.cpp b/src/server/game/Chat/Commands/Level1.cpp index 1fa6ba0e0eb..671aae504db 100755 --- a/src/server/game/Chat/Commands/Level1.cpp +++ b/src/server/game/Chat/Commands/Level1.cpp @@ -78,7 +78,7 @@ bool ChatHandler::HandleGMAnnounceCommand(const char* args) if (!*args) return false; - sWorld->SendGMText(LANG_GM_BROADCAST,args); + sWorld->SendGMText(LANG_GM_BROADCAST, args); return true; } @@ -121,7 +121,7 @@ bool ChatHandler::HandleGPSCommand(const char* args) { uint64 guid = extractGuidFromLink((char*)args); if (guid) - obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(),guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!obj) { @@ -145,7 +145,7 @@ bool ChatHandler::HandleGPSCommand(const char* args) Cell cell(cell_val); uint32 zone_id, area_id; - obj->GetZoneAndAreaId(zone_id,area_id); + obj->GetZoneAndAreaId(zone_id, area_id); MapEntry const* mapEntry = sMapStore.LookupEntry(obj->GetMapId()); AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zone_id); @@ -154,7 +154,7 @@ bool ChatHandler::HandleGPSCommand(const char* args) float zone_x = obj->GetPositionX(); float zone_y = obj->GetPositionY(); - Map2ZoneCoordinates(zone_x,zone_y,zone_id); + Map2ZoneCoordinates(zone_x, zone_y, zone_id); Map const *map = obj->GetMap(); float ground_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), MAX_HEIGHT); @@ -166,8 +166,8 @@ bool ChatHandler::HandleGPSCommand(const char* args) int gx = 63 - p.x_coord; int gy = 63 - p.y_coord; - uint32 have_map = Map::ExistMap(obj->GetMapId(),gx,gy) ? 1 : 0; - uint32 have_vmap = Map::ExistVMap(obj->GetMapId(),gx,gy) ? 1 : 0; + uint32 have_map = Map::ExistMap(obj->GetMapId(), gx, gy) ? 1 : 0; + uint32 have_vmap = Map::ExistVMap(obj->GetMapId(), gx, gy) ? 1 : 0; if(have_vmap) { @@ -202,7 +202,7 @@ bool ChatHandler::HandleSummonCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; Player* _player = m_session->GetPlayer(); @@ -234,7 +234,7 @@ bool ChatHandler::HandleSummonCommand(const char* args) // only allow if gm mode is on if (!_player->isGameMaster()) { - PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,nameLink.c_str()); + PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str()); SetSentErrorMessage(true); return false; } @@ -262,13 +262,13 @@ bool ChatHandler::HandleSummonCommand(const char* args) (m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID())) // the last check is a bit excessive, but let it be, just in case { - PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,nameLink.c_str()); + PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str()); SetSentErrorMessage(true); return false; } } - PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),""); + PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), ""); if (needReportToTarget(target)) ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str()); @@ -283,9 +283,9 @@ bool ChatHandler::HandleSummonCommand(const char* args) target->SaveRecallPosition(); // before GM - float x,y,z; - m_session->GetPlayer()->GetClosePoint(x,y,z,target->GetObjectSize()); - target->TeleportTo(m_session->GetPlayer()->GetMapId(),x,y,z,target->GetOrientation()); + float x, y, z; + m_session->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize()); + target->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation()); target->SetPhaseMask(m_session->GetPlayer()->GetPhaseMask(), true); } else @@ -296,7 +296,7 @@ bool ChatHandler::HandleSummonCommand(const char* args) std::string nameLink = playerLink(target_name); - PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),GetTrinityString(LANG_OFFLINE)); + PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetTrinityString(LANG_OFFLINE)); // in point where GM stay Player::SavePositionInDB(m_session->GetPlayer()->GetMapId(), @@ -317,7 +317,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; Player* _player = m_session->GetPlayer(); @@ -342,7 +342,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) // only allow if gm mode is on if (!_player->isGameMaster()) { - PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chrNameLink.c_str()); + PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str()); SetSentErrorMessage(true); return false; } @@ -367,7 +367,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) // we are in group, we can go only if we are in the player group if (_player->GetGroup() != target->GetGroup()) { - PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chrNameLink.c_str()); + PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str()); SetSentErrorMessage(true); return false; } @@ -377,7 +377,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) // we are not in group, let's verify our GM mode if (!_player->isGameMaster()) { - PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chrNameLink.c_str()); + PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str()); SetSentErrorMessage(true); return false; } @@ -415,8 +415,8 @@ bool ChatHandler::HandleAppearCommand(const char* args) _player->SaveRecallPosition(); // to point to see at target with same orientation - float x,y,z; - target->GetContactPoint(_player,x,y,z); + float x, y, z; + target->GetContactPoint(_player, x, y, z); _player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE); _player->SetPhaseMask(target->GetPhaseMask(), true); @@ -432,10 +432,10 @@ bool ChatHandler::HandleAppearCommand(const char* args) PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str()); // to point where player stay (if loaded) - float x,y,z,o; + float x, y, z, o; uint32 map; bool in_flight; - if (!Player::LoadPositionFromDB(map,x,y,z,o,in_flight,target_guid)) + if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, target_guid)) return false; // stop flight if need @@ -448,7 +448,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) else _player->SaveRecallPosition(); - _player->TeleportTo(map, x, y, z,_player->GetOrientation()); + _player->TeleportTo(map, x, y, z, _player->GetOrientation()); } return true; @@ -458,7 +458,7 @@ bool ChatHandler::HandleAppearCommand(const char* args) bool ChatHandler::HandleRecallCommand(const char* args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; // check online security @@ -537,7 +537,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr (namepart,wnamepart)) + if (!Utf8toWStr (namepart, wnamepart)) return false; bool found = false; @@ -621,7 +621,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) std::string namepart = str; std::wstring wnamepart; - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -655,7 +655,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args) if (reply.str().empty()) SendSysMessage(LANG_COMMAND_TELE_NOLOCATION); else - PSendSysMessage(LANG_COMMAND_TELE_LOCATION,reply.str().c_str()); + PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str().c_str()); if (limitReached) PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults); @@ -709,7 +709,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; char* tail1 = strtok(NULL, ""); @@ -733,12 +733,12 @@ bool ChatHandler::HandleSendMailCommand(const char* args) std::string text = msgText; // from console show not existed sender - MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); //- TODO: Fix poor design SQLTransaction trans = CharacterDatabase.BeginTransaction(); MailDraft(subject, text) - .SendMailTo(trans, MailReceiver(target,GUID_LOPART(target_guid)),sender); + .SendMailTo(trans, MailReceiver(target, GUID_LOPART(target_guid)), sender); CharacterDatabase.CommitTransaction(trans); @@ -751,7 +751,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args) bool ChatHandler::HandleGroupSummonCommand(const char* args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; // check online security @@ -764,7 +764,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args) if (!grp) { - PSendSysMessage(LANG_NOT_IN_GROUP,nameLink.c_str()); + PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str()); SetSentErrorMessage(true); return false; } @@ -810,13 +810,13 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args) if (plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId()) { // cannot summon from instance to instance - PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,plNameLink.c_str()); + PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str()); SetSentErrorMessage(true); return false; } } - PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(),""); + PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), ""); if (needReportToTarget(pl)) ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str()); @@ -831,9 +831,9 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args) pl->SaveRecallPosition(); // before GM - float x,y,z; - m_session->GetPlayer()->GetClosePoint(x,y,z,pl->GetObjectSize()); - pl->TeleportTo(m_session->GetPlayer()->GetMapId(),x,y,z,pl->GetOrientation()); + float x, y, z; + m_session->GetPlayer()->GetClosePoint(x, y, z, pl->GetObjectSize()); + pl->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, pl->GetOrientation()); } return true; diff --git a/src/server/game/Chat/Commands/Level2.cpp b/src/server/game/Chat/Commands/Level2.cpp index 2f85c764270..2aa29687a39 100755 --- a/src/server/game/Chat/Commands/Level2.cpp +++ b/src/server/game/Chat/Commands/Level2.cpp @@ -48,7 +48,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) { char* nameStr; char* delayStr; - extractOptFirstArg((char*)args,&nameStr,&delayStr); + extractOptFirstArg((char*)args, &nameStr, &delayStr); if (!delayStr) return false; @@ -60,7 +60,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name)) + if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid); @@ -73,7 +73,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) uint32 notspeaktime = (uint32) atoi(delayStr); // must have strong lesser security level - if (HasLowerSecurity (target,target_guid,true)) + if (HasLowerSecurity (target, target_guid, true)) return false; time_t mutetime = time(NULL) + notspeaktime*60; @@ -81,7 +81,7 @@ bool ChatHandler::HandleMuteCommand(const char* args) if (target) target->GetSession()->m_muteTime = mutetime; - LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'",uint64(mutetime), account_id); + LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'", uint64(mutetime), account_id); if (target) ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str()); @@ -99,7 +99,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid); @@ -110,7 +110,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args) target = session->GetPlayer(); // must have strong lesser security level - if (HasLowerSecurity (target,target_guid,true)) + if (HasLowerSecurity (target, target_guid, true)) return false; if (target) @@ -236,7 +236,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; uint32 accId = 0; @@ -289,11 +289,11 @@ bool ChatHandler::HandlePInfoCommand(const char* args) uint32 security = 0; std::string last_login = GetTrinityString(LANG_ERROR); - QueryResult result = LoginDatabase.PQuery("SELECT a.username,aa.gmlevel,a.email,a.last_ip,a.last_login " + QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login " "FROM account a " "LEFT JOIN account_access aa " "ON (a.id = aa.id) " - "WHERE a.id = '%u'",accId); + "WHERE a.id = '%u'", accId); if (result) { Field* fields = result->Fetch(); @@ -348,7 +348,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args) case CLASS_DRUID: Class_s = "Druid"; break; } - std::string timeStr = secsToTimeString(total_player_time,true,true); + std::string timeStr = secsToTimeString(total_player_time, true, true); uint32 gold = money /GOLD; uint32 silv = (money % GOLD) / SILVER; uint32 copp = (money % GOLD) % SILVER; @@ -363,7 +363,7 @@ bool ChatHandler::HandleCharacterRenameCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; if (target) @@ -396,7 +396,7 @@ bool ChatHandler::HandleCharacterCustomizeCommand(const char* args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; if (target) @@ -422,7 +422,7 @@ bool ChatHandler::HandleCharacterChangeFactionCommand(const char * args) uint64 target_guid; std::string target_name; - if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if(!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; if(target) @@ -449,7 +449,7 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args) Player* target; uint64 target_guid; std::string target_name; - if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if(!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; if(target) @@ -474,7 +474,7 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args) bool ChatHandler::HandleCharacterReputationCommand(const char* args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; LocaleConstant loc = GetSessionDbcLocale(); @@ -521,7 +521,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) std::wstring wnamepart; // converting string that we try to find to lower case - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; wstrToLower(wnamepart); @@ -552,9 +552,9 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : ""; if (m_session) - PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active); + PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active); else - PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active); + PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active); if (!found) found = true; @@ -570,7 +570,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args) bool ChatHandler::HandleCombatStopCommand(const char* args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; // check online security @@ -594,9 +594,9 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args) LoginDatabase.escape_string (ip); - QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip = '%s'", ip.c_str ()); + QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str ()); - return LookupPlayerSearchCommand (result,limit); + return LookupPlayerSearchCommand (result, limit); } bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) @@ -613,9 +613,9 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args) LoginDatabase.escape_string (account); - QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE username = '%s'", account.c_str ()); + QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE username = '%s'", account.c_str ()); - return LookupPlayerSearchCommand (result,limit); + return LookupPlayerSearchCommand (result, limit); } bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) @@ -630,9 +630,9 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args) LoginDatabase.escape_string (email); - QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE email = '%s'", email.c_str ()); + QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ()); - return LookupPlayerSearchCommand (result,limit); + return LookupPlayerSearchCommand (result, limit); } bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) @@ -659,10 +659,10 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) uint32 acc_id = fields[0].GetUInt32(); std::string acc_name = fields[1].GetString(); - QueryResult chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id); + QueryResult chars = CharacterDatabase.PQuery("SELECT guid, name FROM characters WHERE account = '%u'", acc_id); if (chars) { - PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT,acc_name.c_str(),acc_id); + PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id); uint64 guid = 0; std::string name; @@ -673,7 +673,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit) guid = charfields[0].GetUInt64(); name = charfields[1].GetString(); - PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER,name.c_str(),guid); + PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid); ++i; } while (chars->NextRow() && (limit == -1 || i < limit)); @@ -700,7 +700,7 @@ bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/) bool ChatHandler::HandleRepairitemsCommand(const char* args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; // check online security @@ -807,7 +807,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/) } // prepare visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1); + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1); pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true); // this enables pet details window (Shift+P) @@ -817,7 +817,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/) pet->GetMap()->Add(pet->ToCreature()); // visual effect for levelup - pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()); + pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()); player->SetMinion(pet, true); pet->SavePetToDB(PET_SAVE_AS_CURRENT); @@ -858,7 +858,7 @@ bool ChatHandler::HandlePetLearnCommand(const char* args) SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo)) { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spellId); + PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId); SetSentErrorMessage(true); return false; } @@ -931,7 +931,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -983,13 +983,13 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args) : ""; char titleNameStr[80]; - snprintf(titleNameStr,80,name.c_str(),targetName); + snprintf(titleNameStr, 80, name.c_str(), targetName); // send title in "id (idx:idx) - [namedlink locale]" format if (m_session) - PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr); + PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); else - PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,titleNameStr,localeNames[loc],knownStr,activeStr); + PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[loc], knownStr, activeStr); ++counter; } @@ -1006,7 +1006,7 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args) return false; Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; LocaleConstant loc = GetSessionDbcLocale(); @@ -1028,13 +1028,13 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args) : ""; char titleNameStr[80]; - snprintf(titleNameStr,80,name.c_str(),targetName); + snprintf(titleNameStr, 80, name.c_str(), targetName); // send title in "id (idx:idx) - [namedlink locale]" format if (m_session) - PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr); + PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr); else - PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,name.c_str(),localeNames[loc],knownStr,activeStr); + PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr); } } return true; diff --git a/src/server/game/Chat/Commands/Level3.cpp b/src/server/game/Chat/Commands/Level3.cpp index 778a7007cce..9d5f1b91ca4 100755 --- a/src/server/game/Chat/Commands/Level3.cpp +++ b/src/server/game/Chat/Commands/Level3.cpp @@ -80,7 +80,7 @@ bool ChatHandler::HandleMaxSkillCommand(const char* /*args*/) bool ChatHandler::HandleSetSkillCommand(const char *args) { // number or [name] Shift-click form |color|Hskill:skill_id|h[name]|h|r - char* skill_p = extractKeyFromLink((char*)args,"Hskill"); + char* skill_p = extractKeyFromLink((char*)args, "Hskill"); if (!skill_p) return false; @@ -147,7 +147,7 @@ bool ChatHandler::HandleUnLearnCommand(const char *args) if (!spell_id) return false; - char const* allStr = strtok(NULL," "); + char const* allStr = strtok(NULL, " "); bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false; Player* target = getSelectedPlayer(); @@ -162,7 +162,7 @@ bool ChatHandler::HandleUnLearnCommand(const char *args) spell_id = sSpellMgr->GetFirstSpellInChain (spell_id); if (target->HasSpell(spell_id)) - target->removeSpell(spell_id,false,!allRanks); + target->removeSpell(spell_id, false, !allRanks); else SendSysMessage(LANG_FORGET_SPELL); @@ -203,7 +203,7 @@ bool ChatHandler::HandleCooldownCommand(const char *args) return false; } - target->RemoveSpellCooldown(spell_id,true); + target->RemoveSpellCooldown(spell_id, true); PSendSysMessage(LANG_REMOVE_COOLDOWN, spell_id, target == m_session->GetPlayer() ? GetTrinityString(LANG_YOU) : tNameLink.c_str()); } return true; @@ -238,7 +238,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args) } else // item_id or [name] Shift-click form |color|Hitem:item_id:0:0:0|h[name]|h|r { - char* cId = extractKeyFromLink((char*)args,"Hitem"); + char* cId = extractKeyFromLink((char*)args, "Hitem"); if (!cId) return false; itemId = atol(cId); @@ -303,9 +303,9 @@ bool ChatHandler::HandleAddItemCommand(const char *args) if (count > 0 && item) { - pl->SendNewItem(item,count,false,true); + pl->SendNewItem(item, count, false, true); if (pl != plTarget) - plTarget->SendNewItem(item,count,true,false); + plTarget->SendNewItem(item, count, true, false); } if (noSpaceForCount > 0) @@ -319,7 +319,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args) if (!*args) return false; - char* cId = extractKeyFromLink((char*)args,"Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r + char* cId = extractKeyFromLink((char*)args, "Hitemset"); // number or [name] Shift-click form |color|Hitemset:itemset_id|h[name]|h|r if (!cId) return false; @@ -328,7 +328,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args) // prevent generation all items with itemset field value '0' if (itemsetId == 0) { - PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND,itemsetId); + PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemsetId); SetSentErrorMessage(true); return false; } @@ -385,7 +385,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) if (!*args) return false; - char* cId = extractKeyFromLink((char*)args,"Hitem"); + char* cId = extractKeyFromLink((char*)args, "Hitem"); if (!cId) return false; @@ -513,7 +513,7 @@ bool ChatHandler::HandleListItemCommand(const char *args) // auction case uint32 auc_count = 0; - result=CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = '%u'",item_id); + result=CharacterDatabase.PQuery("SELECT COUNT(itemEntry) FROM auctionhouse ah INNER JOIN item_instance ii ON ii.guid = ah.itemguid WHERE itemEntry = '%u'", item_id); if (result) auc_count = (*result)[0].GetUInt32(); @@ -600,7 +600,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) return false; // number or [name] Shift-click form |color|Hgameobject_entry:go_id|h[name]|h|r - char* cId = extractKeyFromLink((char*)args,"Hgameobject_entry"); + char* cId = extractKeyFromLink((char*)args, "Hgameobject_entry"); if (!cId) return false; @@ -629,7 +629,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) QueryResult result; uint32 obj_count = 0; - result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'",go_id); + result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM gameobject WHERE id='%u'", go_id); if (result) obj_count = (*result)[0].GetUInt32(); @@ -637,11 +637,11 @@ bool ChatHandler::HandleListObjectCommand(const char *args) { Player* pl = m_session->GetPlayer(); result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM gameobject WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", - pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(),go_id,uint32(count)); + pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), go_id, uint32(count)); } else result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, id FROM gameobject WHERE id = '%u' LIMIT %u", - go_id,uint32(count)); + go_id, uint32(count)); if (result) { @@ -662,7 +662,7 @@ bool ChatHandler::HandleListObjectCommand(const char *args) } while (result->NextRow()); } - PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE,go_id,obj_count); + PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, go_id, obj_count); return true; } @@ -672,7 +672,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) return false; // number or [name] Shift-click form |color|Hcreature_entry:creature_id|h[name]|h|r - char* cId = extractKeyFromLink((char*)args,"Hcreature_entry"); + char* cId = extractKeyFromLink((char*)args, "Hcreature_entry"); if (!cId) return false; @@ -701,7 +701,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) QueryResult result; uint32 cr_count = 0; - result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'",cr_id); + result=WorldDatabase.PQuery("SELECT COUNT(guid) FROM creature WHERE id='%u'", cr_id); if (result) cr_count = (*result)[0].GetUInt32(); @@ -709,11 +709,11 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) { Player* pl = m_session->GetPlayer(); result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map, (POW(position_x - '%f', 2) + POW(position_y - '%f', 2) + POW(position_z - '%f', 2)) AS order_ FROM creature WHERE id = '%u' ORDER BY order_ ASC LIMIT %u", - pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), cr_id,uint32(count)); + pl->GetPositionX(), pl->GetPositionY(), pl->GetPositionZ(), cr_id, uint32(count)); } else result = WorldDatabase.PQuery("SELECT guid, position_x, position_y, position_z, map FROM creature WHERE id = '%u' LIMIT %u", - cr_id,uint32(count)); + cr_id, uint32(count)); if (result) { @@ -733,7 +733,7 @@ bool ChatHandler::HandleListCreatureCommand(const char *args) } while (result->NextRow()); } - PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE,cr_id,cr_count); + PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, cr_id, cr_count); return true; } @@ -746,7 +746,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args) std::wstring wnamepart; // converting string that we try to find to lower case - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; wstrToLower(wnamepart); @@ -827,7 +827,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -875,9 +875,9 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args) // send item set in "id - [namedlink locale]" format if (m_session) - PSendSysMessage(LANG_ITEMSET_LIST_CHAT,id,id,name.c_str(),localeNames[loc]); + PSendSysMessage(LANG_ITEMSET_LIST_CHAT, id, id, name.c_str(), localeNames[loc]); else - PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE,id,name.c_str(),localeNames[loc]); + PSendSysMessage(LANG_ITEMSET_LIST_CONSOLE, id, name.c_str(), localeNames[loc]); if (!found) found = true; @@ -900,7 +900,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -957,14 +957,14 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args) uint32 tempValue = target->GetSkillTempBonusValue(id); char const* valFormat = GetTrinityString(LANG_SKILL_VALUES); - snprintf(valStr,50,valFormat,curValue,maxValue,permValue,tempValue); + snprintf(valStr, 50, valFormat, curValue, maxValue, permValue, tempValue); } // send skill in "id - [namedlink locale]" format if (m_session) - PSendSysMessage(LANG_SKILL_LIST_CHAT,id,id,name.c_str(),localeNames[loc],knownStr,valStr); + PSendSysMessage(LANG_SKILL_LIST_CHAT, id, id, name.c_str(), localeNames[loc], knownStr, valStr); else - PSendSysMessage(LANG_SKILL_LIST_CONSOLE,id,name.c_str(),localeNames[loc],knownStr,valStr); + PSendSysMessage(LANG_SKILL_LIST_CONSOLE, id, name.c_str(), localeNames[loc], knownStr, valStr); if (!found) found = true; @@ -987,7 +987,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -1097,7 +1097,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) std::wstring wnamepart; // converting string that we try to find to lower case - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; wstrToLower(wnamepart); @@ -1147,9 +1147,9 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) } if (m_session) - PSendSysMessage(LANG_QUEST_LIST_CHAT,qinfo->GetQuestId(),qinfo->GetQuestId(),qinfo->GetQuestLevel(),title.c_str(),statusStr); + PSendSysMessage(LANG_QUEST_LIST_CHAT, qinfo->GetQuestId(), qinfo->GetQuestId(), qinfo->GetQuestLevel(), title.c_str(), statusStr); else - PSendSysMessage(LANG_QUEST_LIST_CONSOLE,qinfo->GetQuestId(),title.c_str(),statusStr); + PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qinfo->GetQuestId(), title.c_str(), statusStr); if (!found) found = true; @@ -1190,9 +1190,9 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args) } if (m_session) - PSendSysMessage(LANG_QUEST_LIST_CHAT,qinfo->GetQuestId(),qinfo->GetQuestId(),qinfo->GetQuestLevel(),title.c_str(),statusStr); + PSendSysMessage(LANG_QUEST_LIST_CHAT, qinfo->GetQuestId(), qinfo->GetQuestId(), qinfo->GetQuestLevel(), title.c_str(), statusStr); else - PSendSysMessage(LANG_QUEST_LIST_CONSOLE,qinfo->GetQuestId(),title.c_str(),statusStr); + PSendSysMessage(LANG_QUEST_LIST_CONSOLE, qinfo->GetQuestId(), title.c_str(), statusStr); if (!found) found = true; @@ -1214,7 +1214,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args) std::wstring wnamepart; // converting string that we try to find to lower case - if (!Utf8toWStr (namepart,wnamepart)) + if (!Utf8toWStr (namepart, wnamepart)) return false; wstrToLower (wnamepart); @@ -1295,7 +1295,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args) std::wstring wnamepart; // converting string that we try to find to lower case - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; wstrToLower(wnamepart); @@ -1377,7 +1377,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr (namepart,wnamepart)) + if (!Utf8toWStr (namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -1476,7 +1476,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args) std::string namepart = args; std::wstring wnamepart; - if (!Utf8toWStr(namepart,wnamepart)) + if (!Utf8toWStr(namepart, wnamepart)) return false; // converting string that we try to find to lower case @@ -1524,11 +1524,11 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args) // send taxinode in "id - [name] (Map:m X:x Y:y Z:z)" format if (m_session) - PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(),localeNames[loc], - nodeEntry->map_id,nodeEntry->x,nodeEntry->y,nodeEntry->z); + PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CHAT, id, id, name.c_str(), localeNames[loc], + nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); else PSendSysMessage (LANG_TAXINODE_ENTRY_LIST_CONSOLE, id, name.c_str(), localeNames[loc], - nodeEntry->map_id,nodeEntry->x,nodeEntry->y,nodeEntry->z); + nodeEntry->map_id, nodeEntry->x, nodeEntry->y, nodeEntry->z); if (!found) found = true; @@ -1681,7 +1681,7 @@ bool ChatHandler::HandleGuildCreateCommand(const char *args) } Guild *guild = new Guild; - if (!guild->Create (target,guildname)) + if (!guild->Create (target, guildname)) { delete guild; SendSysMessage (LANG_GUILD_NOT_CREATED); @@ -1724,7 +1724,7 @@ bool ChatHandler::HandleGuildUninviteCommand(const char *args) { Player* target; uint64 target_guid; - if (!extractPlayerTarget((char*)args,&target,&target_guid)) + if (!extractPlayerTarget((char*)args, &target, &target_guid)) return false; uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid); @@ -1744,14 +1744,14 @@ bool ChatHandler::HandleGuildRankCommand(const char *args) { char* nameStr; char* rankStr; - extractOptFirstArg((char*)args,&nameStr,&rankStr); + extractOptFirstArg((char*)args, &nameStr, &rankStr); if (!rankStr) return false; Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name)) + if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; uint32 glId = target ? target->GetGuildId () : Player::GetGuildIdFromDB (target_guid); @@ -1794,7 +1794,7 @@ bool ChatHandler::HandleGetDistanceCommand(const char *args) { uint64 guid = extractGuidFromLink((char*)args); if (guid) - obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(),guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!obj) { @@ -1832,7 +1832,7 @@ bool ChatHandler::HandleDieCommand(const char* /*args*/) if (target->GetTypeId() == TYPEID_PLAYER) { - if (HasLowerSecurity((Player*)target,0,false)) + if (HasLowerSecurity((Player*)target, 0, false)) return false; } @@ -1902,14 +1902,14 @@ bool ChatHandler::HandleDamageCommand(const char * args) uint32 absorb = 0; uint32 resist = 0; - m_session->GetPlayer()->CalcAbsorbResist(target,schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); + m_session->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist); if (damage <= absorb + resist) return true; damage -= absorb + resist; - m_session->GetPlayer()->DealDamageMods(target,damage,&absorb); + m_session->GetPlayer()->DealDamageMods(target, damage, &absorb); m_session->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false); m_session->GetPlayer()->SendAttackStateUpdate (HITINFO_NORMALSWING2, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0); return true; @@ -1930,7 +1930,7 @@ bool ChatHandler::HandleReviveCommand(const char *args) { Player* target; uint64 target_guid; - if (!extractPlayerTarget((char*)args,&target,&target_guid)) + if (!extractPlayerTarget((char*)args, &target, &target_guid)) return false; if (target) @@ -2009,9 +2009,9 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args) if (!px2) g_team = 0; - else if (strncmp(px2,"horde",6) == 0) + else if (strncmp(px2, "horde", 6) == 0) g_team = HORDE; - else if (strncmp(px2,"alliance",9) == 0) + else if (strncmp(px2, "alliance", 9) == 0) g_team = ALLIANCE; else return false; @@ -2032,15 +2032,15 @@ bool ChatHandler::HandleLinkGraveCommand(const char *args) AreaTableEntry const *areaEntry = GetAreaEntryByAreaID(zoneId); if (!areaEntry || areaEntry->zone !=0) { - PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, g_id,zoneId); + PSendSysMessage(LANG_COMMAND_GRAVEYARDWRONGZONE, g_id, zoneId); SetSentErrorMessage(true); return false; } - if (sObjectMgr->AddGraveYardLink(g_id,zoneId,g_team)) - PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id,zoneId); + if (sObjectMgr->AddGraveYardLink(g_id, zoneId, g_team)) + PSendSysMessage(LANG_COMMAND_GRAVEYARDLINKED, g_id, zoneId); else - PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id,zoneId); + PSendSysMessage(LANG_COMMAND_GRAVEYARDALRLINKED, g_id, zoneId); return true; } @@ -2053,9 +2053,9 @@ bool ChatHandler::HandleNearGraveCommand(const char *args) if (!*args) g_team = 0; - else if (strncmp((char*)args,"horde",argslen) == 0) + else if (strncmp((char*)args, "horde", argslen) == 0) g_team = HORDE; - else if (strncmp((char*)args,"alliance",argslen) == 0) + else if (strncmp((char*)args, "alliance", argslen) == 0) g_team = ALLIANCE; else return false; @@ -2064,16 +2064,16 @@ bool ChatHandler::HandleNearGraveCommand(const char *args) uint32 zone_id = player->GetZoneId(); WorldSafeLocsEntry const* graveyard = sObjectMgr->GetClosestGraveYard( - player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(),player->GetMapId(),g_team); + player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), player->GetMapId(), g_team); if (graveyard) { uint32 g_id = graveyard->ID; - GraveYardData const* data = sObjectMgr->FindGraveYardData(g_id,zone_id); + GraveYardData const* data = sObjectMgr->FindGraveYardData(g_id, zone_id); if (!data) { - PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR,g_id); + PSendSysMessage(LANG_COMMAND_GRAVEYARDERROR, g_id); SetSentErrorMessage(true); return false; } @@ -2089,7 +2089,7 @@ bool ChatHandler::HandleNearGraveCommand(const char *args) else if (g_team == ALLIANCE) team_name = GetTrinityString(LANG_COMMAND_GRAVEYARD_ALLIANCE); - PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id,team_name.c_str(),zone_id); + PSendSysMessage(LANG_COMMAND_GRAVEYARDNEAREST, g_id, team_name.c_str(), zone_id); } else { @@ -2105,7 +2105,7 @@ bool ChatHandler::HandleNearGraveCommand(const char *args) if (g_team == ~uint32(0)) PSendSysMessage(LANG_COMMAND_ZONENOGRAVEYARDS, zone_id); else - PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id,team_name.c_str()); + PSendSysMessage(LANG_COMMAND_ZONENOGRAFACTION, zone_id, team_name.c_str()); } return true; @@ -2130,24 +2130,24 @@ bool ChatHandler::HandleExploreCheatCommand(const char *args) { PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, GetNameLink(chr).c_str()); if (needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL,GetNameLink().c_str()); + ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, GetNameLink().c_str()); } else { PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, GetNameLink(chr).c_str()); if (needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING,GetNameLink().c_str()); + ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, GetNameLink().c_str()); } for (uint8 i=0; i<PLAYER_EXPLORED_ZONES_SIZE; ++i) { if (flag != 0) { - m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF); + m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); } else { - m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i,0); + m_session->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); } } @@ -2179,16 +2179,16 @@ void ChatHandler::HandleCharacterLevel(Player* player, uint64 player_guid, uint3 { player->GiveLevel(newlevel); player->InitTalentForLevel(); - player->SetUInt32Value(PLAYER_XP,0); + player->SetUInt32Value(PLAYER_XP, 0); if (needReportToTarget(player)) { if (oldlevel == newlevel) - ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET,GetNameLink().c_str()); + ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_PROGRESS_RESET, GetNameLink().c_str()); else if (oldlevel < newlevel) - ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP,GetNameLink().c_str(),newlevel); + ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_UP, GetNameLink().c_str(), newlevel); else // if (oldlevel > newlevel) - ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN,GetNameLink().c_str(),newlevel); + ChatHandler(player).PSendSysMessage(LANG_YOURS_LEVEL_DOWN, GetNameLink().c_str(), newlevel); } } else @@ -2202,7 +2202,7 @@ bool ChatHandler::HandleCharacterLevelCommand(const char *args) { char* nameStr; char* levelStr; - extractOptFirstArg((char*)args,&nameStr,&levelStr); + extractOptFirstArg((char*)args, &nameStr, &levelStr); if (!levelStr) return false; @@ -2216,7 +2216,7 @@ bool ChatHandler::HandleCharacterLevelCommand(const char *args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name)) + if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); @@ -2228,12 +2228,12 @@ bool ChatHandler::HandleCharacterLevelCommand(const char *args) if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level newlevel = STRONG_MAX_LEVEL; - HandleCharacterLevel(target,target_guid,oldlevel,newlevel); + HandleCharacterLevel(target, target_guid, oldlevel, newlevel); if (!m_session || m_session->GetPlayer() != target) // including player == NULL { std::string nameLink = playerLink(target_name); - PSendSysMessage(LANG_YOU_CHANGE_LVL,nameLink.c_str(),newlevel); + PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); } return true; @@ -2243,7 +2243,7 @@ bool ChatHandler::HandleLevelUpCommand(const char *args) { char* nameStr; char* levelStr; - extractOptFirstArg((char*)args,&nameStr,&levelStr); + extractOptFirstArg((char*)args, &nameStr, &levelStr); // exception opt second arg: .character level $name if (levelStr && isalpha(levelStr[0])) @@ -2255,7 +2255,7 @@ bool ChatHandler::HandleLevelUpCommand(const char *args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name)) + if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name)) return false; int32 oldlevel = target ? target->getLevel() : Player::GetLevelFromDB(target_guid); @@ -2268,12 +2268,12 @@ bool ChatHandler::HandleLevelUpCommand(const char *args) if (newlevel > STRONG_MAX_LEVEL) // hardcoded maximum level newlevel = STRONG_MAX_LEVEL; - HandleCharacterLevel(target,target_guid,oldlevel,newlevel); + HandleCharacterLevel(target, target_guid, oldlevel, newlevel); if (!m_session || m_session->GetPlayer() != target) // including chr == NULL { std::string nameLink = playerLink(target_name); - PSendSysMessage(LANG_YOU_CHANGE_LVL,nameLink.c_str(),newlevel); + PSendSysMessage(LANG_YOU_CHANGE_LVL, nameLink.c_str(), newlevel); } return true; @@ -2422,8 +2422,8 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/) aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), aura->GetDuration(), aura->GetMaxDuration(), ss_name.str().c_str(), - (aura->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""), - IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(aura->GetCasterGUID())); + (aura->IsPassive() ? passiveStr : ""), (talent ? talentStr : ""), + IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature", GUID_LOPART(aura->GetCasterGUID())); } else { @@ -2431,8 +2431,8 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/) aura->GetCharges(), aura->GetStackAmount(), aurApp->GetSlot(), aura->GetDuration(), aura->GetMaxDuration(), name, - (aura->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""), - IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(aura->GetCasterGUID())); + (aura->IsPassive() ? passiveStr : ""), (talent ? talentStr : ""), + IS_PLAYER_GUID(aura->GetCasterGUID()) ? "player" : "creature", GUID_LOPART(aura->GetCasterGUID())); } } for (uint16 i = 0; i < TOTAL_AURAS; ++i) @@ -2460,7 +2460,7 @@ bool ChatHandler::HandleResetAchievementsCommand (const char * args) { Player* target; uint64 target_guid; - if (!extractPlayerTarget((char*)args,&target,&target_guid)) + if (!extractPlayerTarget((char*)args, &target, &target_guid)) return false; if (target) @@ -2474,7 +2474,7 @@ bool ChatHandler::HandleResetAchievementsCommand (const char * args) bool ChatHandler::HandleResetHonorCommand (const char * args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; target->SetHonorPoints(0); @@ -2492,7 +2492,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player) ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass()); if (!cEntry) { - sLog->outError("Class %u not found in DBC (Wrong DBC files?)",player->getClass()); + sLog->outError("Class %u not found in DBC (Wrong DBC files?)", player->getClass()); return false; } @@ -2527,7 +2527,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player) bool ChatHandler::HandleResetLevelCommand(const char * args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; if (!HandleResetStatsOrLevelHelper(target)) @@ -2547,7 +2547,7 @@ bool ChatHandler::HandleResetLevelCommand(const char * args) target->InitTaxiNodesForLevel(); target->InitGlyphsForLevel(); target->InitTalentForLevel(); - target->SetUInt32Value(PLAYER_XP,0); + target->SetUInt32Value(PLAYER_XP, 0); target->_ApplyAllLevelScaleItemMods(true); @@ -2561,7 +2561,7 @@ bool ChatHandler::HandleResetLevelCommand(const char * args) bool ChatHandler::HandleResetStatsCommand(const char * args) { Player* target; - if (!extractPlayerTarget((char*)args,&target)) + if (!extractPlayerTarget((char*)args, &target)) return false; if (!HandleResetStatsOrLevelHelper(target)) @@ -2581,7 +2581,7 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) return false; if (target) @@ -2590,12 +2590,12 @@ bool ChatHandler::HandleResetSpellsCommand(const char * args) ChatHandler(target).SendSysMessage(LANG_RESET_SPELLS); if (!m_session || m_session->GetPlayer() != target) - PSendSysMessage(LANG_RESET_SPELLS_ONLINE,GetNameLink(target).c_str()); + PSendSysMessage(LANG_RESET_SPELLS_ONLINE, GetNameLink(target).c_str()); } else { - CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'",uint32(AT_LOGIN_RESET_SPELLS), GUID_LOPART(target_guid)); - PSendSysMessage(LANG_RESET_SPELLS_OFFLINE,target_name.c_str()); + CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'", uint32(AT_LOGIN_RESET_SPELLS), GUID_LOPART(target_guid)); + PSendSysMessage(LANG_RESET_SPELLS_OFFLINE, target_name.c_str()); } return true; @@ -2606,7 +2606,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args) Player* target; uint64 target_guid; std::string target_name; - if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name)) + if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name)) { // Try reset talents as Hunter Pet Creature* creature = getSelectedCreature(); @@ -2620,7 +2620,7 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args) ChatHandler(owner->ToPlayer()).SendSysMessage(LANG_RESET_PET_TALENTS); if (!m_session || m_session->GetPlayer() != owner->ToPlayer()) - PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE,GetNameLink(owner->ToPlayer()).c_str()); + PSendSysMessage(LANG_RESET_PET_TALENTS_ONLINE, GetNameLink(owner->ToPlayer()).c_str()); } return true; } @@ -2636,10 +2636,10 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args) target->SendTalentsInfoData(false); ChatHandler(target).SendSysMessage(LANG_RESET_TALENTS); if (!m_session || m_session->GetPlayer() != target) - PSendSysMessage(LANG_RESET_TALENTS_ONLINE,GetNameLink(target).c_str()); + PSendSysMessage(LANG_RESET_TALENTS_ONLINE, GetNameLink(target).c_str()); Pet* pet = target->GetPet(); - Pet::resetTalentsForAllPetsOf(target,pet); + Pet::resetTalentsForAllPetsOf(target, pet); if (pet) target->SendTalentsInfoData(true); return true; @@ -2647,9 +2647,9 @@ bool ChatHandler::HandleResetTalentsCommand(const char * args) else if (target_guid) { uint32 at_flags = AT_LOGIN_NONE | AT_LOGIN_RESET_PET_TALENTS; - CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'",at_flags, GUID_LOPART(target_guid)); + CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid = '%u'", at_flags, GUID_LOPART(target_guid)); std::string nameLink = playerLink(target_name); - PSendSysMessage(LANG_RESET_TALENTS_OFFLINE,nameLink.c_str()); + PSendSysMessage(LANG_RESET_TALENTS_OFFLINE, nameLink.c_str()); return true; } @@ -2684,12 +2684,12 @@ bool ChatHandler::HandleResetAllCommand(const char * args) } else { - PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE,args); + PSendSysMessage(LANG_RESETALL_UNKNOWN_CASE, args); SetSentErrorMessage(true); return false; } - CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin); + CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'", atLogin, atLogin); ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder<Player>::GetLock(), true); HashMapHolder<Player>::MapType const& plist = sObjectAccessor->GetPlayers(); @@ -2736,7 +2736,7 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args) sWorld->ShutdownServ (time, 0, exitcode); } else - sWorld->ShutdownServ(time,0,SHUTDOWN_EXIT_CODE); + sWorld->ShutdownServ(time, 0, SHUTDOWN_EXIT_CODE); return true; } @@ -2806,7 +2806,7 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args) sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode); } else - sWorld->ShutdownServ(time,SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE,RESTART_EXIT_CODE); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, RESTART_EXIT_CODE); return true; } @@ -2841,18 +2841,18 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args) sWorld->ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode); } else - sWorld->ShutdownServ(time,SHUTDOWN_MASK_IDLE,SHUTDOWN_EXIT_CODE); + sWorld->ShutdownServ(time, SHUTDOWN_MASK_IDLE, SHUTDOWN_EXIT_CODE); return true; } bool ChatHandler::HandleBanAccountCommand(const char *args) { - return HandleBanHelper(BAN_ACCOUNT,args); + return HandleBanHelper(BAN_ACCOUNT, args); } bool ChatHandler::HandleBanAccountByCharCommand(const char *args) { - return HandleBanHelper(BAN_CHARACTER,args); + return HandleBanHelper(BAN_CHARACTER, args); } bool ChatHandler::HandleBanCharacterCommand(const char *args) @@ -2866,11 +2866,11 @@ bool ChatHandler::HandleBanCharacterCommand(const char *args) std::string name = cname; - char* duration = strtok(NULL," "); + char* duration = strtok(NULL, " "); if (!duration || !atoi(duration)) return false; - char* reason = strtok(NULL,""); + char* reason = strtok(NULL, ""); if (!reason) return false; @@ -2906,7 +2906,7 @@ bool ChatHandler::HandleBanCharacterCommand(const char *args) bool ChatHandler::HandleBanIPCommand(const char *args) { - return HandleBanHelper(BAN_IP,args); + return HandleBanHelper(BAN_IP, args); } bool ChatHandler::HandleBanHelper(BanMode mode, const char *args) @@ -2920,11 +2920,11 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char *args) std::string nameOrIP = cnameOrIP; - char* duration = strtok (NULL," "); + char* duration = strtok (NULL, " "); if (!duration || !atoi(duration)) return false; - char* reason = strtok (NULL,""); + char* reason = strtok (NULL, ""); if (!reason) return false; @@ -2933,7 +2933,7 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char *args) case BAN_ACCOUNT: if (!AccountMgr::normalizeString(nameOrIP)) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,nameOrIP.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str()); SetSentErrorMessage(true); return false; } @@ -2952,13 +2952,13 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char *args) break; } - switch(sWorld->BanAccount(mode, nameOrIP, duration, reason,m_session ? m_session->GetPlayerName() : "")) + switch(sWorld->BanAccount(mode, nameOrIP, duration, reason, m_session ? m_session->GetPlayerName() : "")) { case BAN_SUCCESS: if (atoi(duration)>0) - PSendSysMessage(LANG_BAN_YOUBANNED,nameOrIP.c_str(),secsToTimeString(TimeStringToSecs(duration),true).c_str(),reason); + PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(duration), true).c_str(), reason); else - PSendSysMessage(LANG_BAN_YOUPERMBANNED,nameOrIP.c_str(),reason); + PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reason); break; case BAN_SYNTAX_ERROR: return false; @@ -2966,13 +2966,13 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char *args) switch(mode) { default: - PSendSysMessage(LANG_BAN_NOTFOUND,"account",nameOrIP.c_str()); + PSendSysMessage(LANG_BAN_NOTFOUND, "account", nameOrIP.c_str()); break; case BAN_CHARACTER: - PSendSysMessage(LANG_BAN_NOTFOUND,"character",nameOrIP.c_str()); + PSendSysMessage(LANG_BAN_NOTFOUND, "character", nameOrIP.c_str()); break; case BAN_IP: - PSendSysMessage(LANG_BAN_NOTFOUND,"ip",nameOrIP.c_str()); + PSendSysMessage(LANG_BAN_NOTFOUND, "ip", nameOrIP.c_str()); break; } SetSentErrorMessage(true); @@ -3041,7 +3041,7 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char *args) case BAN_ACCOUNT: if (!AccountMgr::normalizeString(nameOrIP)) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,nameOrIP.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, nameOrIP.c_str()); SetSentErrorMessage(true); return false; } @@ -3060,10 +3060,10 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char *args) break; } - if (sWorld->RemoveBanAccount(mode,nameOrIP)) - PSendSysMessage(LANG_UNBAN_UNBANNED,nameOrIP.c_str()); + if (sWorld->RemoveBanAccount(mode, nameOrIP)) + PSendSysMessage(LANG_UNBAN_UNBANNED, nameOrIP.c_str()); else - PSendSysMessage(LANG_UNBAN_ERROR,nameOrIP.c_str()); + PSendSysMessage(LANG_UNBAN_ERROR, nameOrIP.c_str()); return true; } @@ -3080,7 +3080,7 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char *args) std::string account_name = cname; if (!AccountMgr::normalizeString(account_name)) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str()); SetSentErrorMessage(true); return false; } @@ -3088,11 +3088,11 @@ bool ChatHandler::HandleBanInfoAccountCommand(const char *args) uint32 accountid = sAccountMgr->GetId(account_name); if (!accountid) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str()); return true; } - return HandleBanInfoHelper(accountid,account_name.c_str()); + return HandleBanInfoHelper(accountid, account_name.c_str()); } bool ChatHandler::HandleBanInfoCharacterCommand(const char *args) @@ -3147,7 +3147,7 @@ bool ChatHandler::HandleBanInfoCharacterCommand(const char *args) bool ChatHandler::HandleBanInfoHelper(uint32 accountid, char const* accountname) { - QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate,banreason,bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC",accountid); + QueryResult result = LoginDatabase.PQuery("SELECT FROM_UNIXTIME(bandate), unbandate-bandate, active, unbandate, banreason, bannedby FROM account_banned WHERE id = '%u' ORDER BY bandate ASC", accountid); if (!result) { PSendSysMessage(LANG_BANINFO_NOACCOUNTBAN, accountname); @@ -3187,7 +3187,7 @@ bool ChatHandler::HandleBanInfoIPCommand(const char *args) std::string IP = cIP; LoginDatabase.escape_string(IP); - QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason,bannedby,unbandate-bandate FROM ip_banned WHERE ip = '%s'",IP.c_str()); + QueryResult result = LoginDatabase.PQuery("SELECT ip, FROM_UNIXTIME(bandate), FROM_UNIXTIME(unbandate), unbandate-UNIX_TIMESTAMP(), banreason, bannedby, unbandate-bandate FROM ip_banned WHERE ip = '%s'", IP.c_str()); if (!result) { PSendSysMessage(LANG_BANINFO_NOIP); @@ -3307,7 +3307,7 @@ bool ChatHandler::HandleBanListAccountCommand(const char *args) else { result = LoginDatabase.PQuery("SELECT account.id, username FROM account, account_banned" - " WHERE account.id = account_banned.id AND active = 1 AND username "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'")" GROUP BY account.id", + " WHERE account.id = account_banned.id AND active = 1 AND username "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'")" GROUP BY account.id", filter.c_str()); } @@ -3332,7 +3332,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result) Field* fields = result->Fetch(); uint32 accountid = fields[0].GetUInt32(); - QueryResult banresult = LoginDatabase.PQuery("SELECT account.username FROM account,account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id",accountid); + QueryResult banresult = LoginDatabase.PQuery("SELECT account.username FROM account, account_banned WHERE account_banned.id='%u' AND account_banned.id=account.id", accountid); if (banresult) { Field* fields2 = banresult->Fetch(); @@ -3359,10 +3359,10 @@ bool ChatHandler::HandleBanListHelper(QueryResult result) account_name = fields[1].GetString(); // "character" case, name need extract from another DB else - sAccountMgr->GetName (account_id,account_name); + sAccountMgr->GetName (account_id, account_name); // No SQL injection. id is uint32. - QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate,unbandate,bannedby,banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id); + QueryResult banInfo = LoginDatabase.PQuery("SELECT bandate, unbandate, bannedby, banreason FROM account_banned WHERE id = %u ORDER BY unbandate", account_id); if (banInfo) { Field *fields2 = banInfo->Fetch(); @@ -3382,7 +3382,7 @@ bool ChatHandler::HandleBanListHelper(QueryResult result) time_t t_unban = fields2[1].GetUInt64(); tm* aTm_unban = localtime(&t_unban); PSendSysMessage("|%-15.15s|%02d-%02d-%02d %02d:%02d|%02d-%02d-%02d %02d:%02d|%-15.15s|%-15.15s|", - account_name.c_str(),aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min, + account_name.c_str(), aTm_ban->tm_year%100, aTm_ban->tm_mon+1, aTm_ban->tm_mday, aTm_ban->tm_hour, aTm_ban->tm_min, aTm_unban->tm_year%100, aTm_unban->tm_mon+1, aTm_unban->tm_mday, aTm_unban->tm_hour, aTm_unban->tm_min, fields2[2].GetCString(), fields2[3].GetCString()); } @@ -3406,15 +3406,15 @@ bool ChatHandler::HandleBanListIPCommand(const char *args) if (filter.empty()) { - result = LoginDatabase.Query ("SELECT ip,bandate,unbandate,bannedby,banreason FROM ip_banned" + result = LoginDatabase.Query ("SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned" " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP())" " ORDER BY unbandate"); } else { - result = LoginDatabase.PQuery("SELECT ip,bandate,unbandate,bannedby,banreason FROM ip_banned" - " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP()) AND ip "_LIKE_" "_CONCAT3_("'%%'","'%s'","'%%'") - " ORDER BY unbandate",filter.c_str()); + result = LoginDatabase.PQuery("SELECT ip, bandate, unbandate, bannedby, banreason FROM ip_banned" + " WHERE (bandate=unbandate OR unbandate>UNIX_TIMESTAMP()) AND ip "_LIKE_" "_CONCAT3_("'%%'", "'%s'", "'%%'") + " ORDER BY unbandate", filter.c_str()); } if (!result) @@ -3493,7 +3493,7 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/) cell.SetNoCreate(); Trinity::RespawnDo u_do; - Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(pl,u_do); + Trinity::WorldObjectWorker<Trinity::RespawnDo> worker(pl, u_do); TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::RespawnDo>, GridTypeMapContainer > obj_worker(worker); cell.Visit(p, obj_worker, *pl->GetMap()); @@ -3517,7 +3517,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) std::string account_name = account; if (!AccountMgr::normalizeString(account_name)) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str()); SetSentErrorMessage(true); return false; } @@ -3528,15 +3528,15 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) account_id = atoi(account); // use original string if (!account_id) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str()); SetSentErrorMessage(true); return false; } } - if (!sAccountMgr->GetName(account_id,account_name)) + if (!sAccountMgr->GetName(account_id, account_name)) { - PSendSysMessage(LANG_ACCOUNT_NOT_EXIST,account_name.c_str()); + PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str()); SetSentErrorMessage(true); return false; } @@ -3556,7 +3556,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) return false; } - if (ObjectMgr::CheckPlayerName(name,true) != CHAR_NAME_SUCCESS) + if (ObjectMgr::CheckPlayerName(name, true) != CHAR_NAME_SUCCESS) { PSendSysMessage(LANG_INVALID_CHARACTER_NAME); SetSentErrorMessage(true); @@ -3580,7 +3580,7 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) if (sObjectMgr->GetPlayerAccountIdByGUID(guid)) { - PSendSysMessage(LANG_CHARACTER_GUID_IN_USE,guid); + PSendSysMessage(LANG_CHARACTER_GUID_IN_USE, guid); SetSentErrorMessage(true); return false; } @@ -3592,15 +3592,15 @@ bool ChatHandler::HandlePDumpLoadCommand(const char *args) PSendSysMessage(LANG_COMMAND_IMPORT_SUCCESS); break; case DUMP_FILE_OPEN_ERROR: - PSendSysMessage(LANG_FILE_OPEN_FAIL,file); + PSendSysMessage(LANG_FILE_OPEN_FAIL, file); SetSentErrorMessage(true); return false; case DUMP_FILE_BROKEN: - PSendSysMessage(LANG_DUMP_BROKEN,file); + PSendSysMessage(LANG_DUMP_BROKEN, file); SetSentErrorMessage(true); return false; case DUMP_TOO_MANY_CHARS: - PSendSysMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL,account_name.c_str(),account_id); + PSendSysMessage(LANG_ACCOUNT_CHARACTER_LIST_FULL, account_name.c_str(), account_id); SetSentErrorMessage(true); return false; default: @@ -3653,7 +3653,7 @@ bool ChatHandler::HandlePDumpWriteCommand(const char *args) PSendSysMessage(LANG_COMMAND_EXPORT_SUCCESS); break; case DUMP_FILE_OPEN_ERROR: - PSendSysMessage(LANG_FILE_OPEN_FAIL,file); + PSendSysMessage(LANG_FILE_OPEN_FAIL, file); SetSentErrorMessage(true); return false; case DUMP_CHARACTER_DELETED: @@ -3679,7 +3679,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) return false; } - PSendSysMessage(LANG_MOVEGENS_LIST,(unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"),unit->GetGUIDLow()); + PSendSysMessage(LANG_MOVEGENS_LIST, (unit->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), unit->GetGUIDLow()); MotionMaster* mm = unit->GetMotionMaster(); for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i) @@ -3704,7 +3704,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) TargetedMovementGenerator<Player> const* mgen = static_cast<TargetedMovementGenerator<Player> const*>(mg); Unit* target = mgen->GetTarget(); if (target) - PSendSysMessage(LANG_MOVEGENS_TARGETED_PLAYER,target->GetName(),target->GetGUIDLow()); + PSendSysMessage(LANG_MOVEGENS_TARGETED_PLAYER, target->GetName(), target->GetGUIDLow()); else SendSysMessage(LANG_MOVEGENS_TARGETED_NULL); } @@ -3713,7 +3713,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) TargetedMovementGenerator<Creature> const* mgen = static_cast<TargetedMovementGenerator<Creature> const*>(mg); Unit* target = mgen->GetTarget(); if (target) - PSendSysMessage(LANG_MOVEGENS_TARGETED_CREATURE,target->GetName(),target->GetGUIDLow()); + PSendSysMessage(LANG_MOVEGENS_TARGETED_CREATURE, target->GetName(), target->GetGUIDLow()); else SendSysMessage(LANG_MOVEGENS_TARGETED_NULL); } @@ -3722,9 +3722,9 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) case HOME_MOTION_TYPE: if (unit->GetTypeId() == TYPEID_UNIT) { - float x,y,z; - mg->GetDestination(x,y,z); - PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE,x,y,z); + float x, y, z; + mg->GetDestination(x, y, z); + PSendSysMessage(LANG_MOVEGENS_HOME_CREATURE, x, y, z); } else SendSysMessage(LANG_MOVEGENS_HOME_PLAYER); @@ -3732,15 +3732,15 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/) case FLIGHT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FLIGHT); break; case POINT_MOTION_TYPE: { - float x,y,z; - mg->GetDestination(x,y,z); - PSendSysMessage(LANG_MOVEGENS_POINT,x,y,z); + float x, y, z; + mg->GetDestination(x, y, z); + PSendSysMessage(LANG_MOVEGENS_POINT, x, y, z); break; } case FLEEING_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FEAR); break; case DISTRACT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_DISTRACT); break; default: - PSendSysMessage(LANG_MOVEGENS_UNKNOWN,mg->GetMovementGeneratorType()); + PSendSysMessage(LANG_MOVEGENS_UNKNOWN, mg->GetMovementGeneratorType()); break; } } @@ -3757,15 +3757,15 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args) int l = strlen(param); - if (strncmp(param,"player",l) == 0) + if (strncmp(param, "player", l) == 0) sWorld->SetPlayerSecurityLimit(SEC_PLAYER); - else if (strncmp(param,"moderator",l) == 0) + else if (strncmp(param, "moderator", l) == 0) sWorld->SetPlayerSecurityLimit(SEC_MODERATOR); - else if (strncmp(param,"gamemaster",l) == 0) + else if (strncmp(param, "gamemaster", l) == 0) sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER); - else if (strncmp(param,"administrator",l) == 0) + else if (strncmp(param, "administrator", l) == 0) sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR); - else if (strncmp(param,"reset",l) == 0) + else if (strncmp(param, "reset", l) == 0) { sWorld->SetPlayerAmountLimit(sConfig->GetIntDefault("PlayerLimit", 100)); sWorld->LoadDBAllowedSecurityLevel(); @@ -3792,7 +3792,7 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args) default: secName = "<unknown>"; break; } - PSendSysMessage("Player limits: amount %u, min. security level %s.",pLimit,secName); + PSendSysMessage("Player limits: amount %u, min. security level %s.", pLimit, secName); return true; } @@ -3824,9 +3824,9 @@ bool ChatHandler::HandleCastCommand(const char *args) return false; } - if (!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer())) + if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell); + PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); SetSentErrorMessage(true); return false; } @@ -3835,13 +3835,13 @@ bool ChatHandler::HandleCastCommand(const char *args) if (trig_str) { int l = strlen(trig_str); - if (strncmp(trig_str,"triggered",l) != 0) + if (strncmp(trig_str, "triggered", l) != 0) return false; } bool triggered = (trig_str != NULL); - m_session->GetPlayer()->CastSpell(target,spell,triggered); + m_session->GetPlayer()->CastSpell(target, spell, triggered); return true; } @@ -3871,7 +3871,7 @@ bool ChatHandler::HandleCastBackCommand(const char *args) if (trig_str) { int l = strlen(trig_str); - if (strncmp(trig_str,"triggered",l) != 0) + if (strncmp(trig_str, "triggered", l) != 0) return false; } @@ -3879,7 +3879,7 @@ bool ChatHandler::HandleCastBackCommand(const char *args) caster->SetFacingToObject(m_session->GetPlayer()); - caster->CastSpell(m_session->GetPlayer(),spell,triggered); + caster->CastSpell(m_session->GetPlayer(), spell, triggered); return true; } @@ -3902,9 +3902,9 @@ bool ChatHandler::HandleCastDistCommand(const char *args) return false; } - if (!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer())) + if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell); + PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); SetSentErrorMessage(true); return false; } @@ -3920,16 +3920,16 @@ bool ChatHandler::HandleCastDistCommand(const char *args) if (trig_str) { int l = strlen(trig_str); - if (strncmp(trig_str,"triggered",l) != 0) + if (strncmp(trig_str, "triggered", l) != 0) return false; } bool triggered = (trig_str != NULL); - float x,y,z; - m_session->GetPlayer()->GetClosePoint(x,y,z,dist); + float x, y, z; + m_session->GetPlayer()->GetClosePoint(x, y, z, dist); - m_session->GetPlayer()->CastSpell(x,y,z,spell,triggered); + m_session->GetPlayer()->CastSpell(x, y, z, spell, triggered); return true; } @@ -3964,7 +3964,7 @@ bool ChatHandler::HandleCastTargetCommand(const char *args) if (trig_str) { int l = strlen(trig_str); - if (strncmp(trig_str,"triggered",l) != 0) + if (strncmp(trig_str, "triggered", l) != 0) return false; } @@ -3972,7 +3972,7 @@ bool ChatHandler::HandleCastTargetCommand(const char *args) caster->SetFacingToObject(m_session->GetPlayer()); - caster->CastSpell(caster->getVictim(),spell,triggered); + caster->CastSpell(caster->getVictim(), spell, triggered); return true; } @@ -4031,14 +4031,14 @@ bool ChatHandler::HandleCastSelfCommand(const char *args) if (!spellInfo) return false; - if (!SpellMgr::IsSpellValid(spellInfo,m_session->GetPlayer())) + if (!SpellMgr::IsSpellValid(spellInfo, m_session->GetPlayer())) { - PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spell); + PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spell); SetSentErrorMessage(true); return false; } - target->CastSpell(target,spell,false); + target->CastSpell(target, spell, false); return true; } @@ -4207,7 +4207,7 @@ bool ChatHandler::HandleSendItemsCommand(const char *args) Player* receiver; uint64 receiver_guid; std::string receiver_name; - if (!extractPlayerTarget((char*)args,&receiver,&receiver_guid,&receiver_name)) + if (!extractPlayerTarget((char*)args, &receiver, &receiver_guid, &receiver_name)) return false; char* tail1 = strtok(NULL, ""); @@ -4231,7 +4231,7 @@ bool ChatHandler::HandleSendItemsCommand(const char *args) std::string text = msgText; // extract items - typedef std::pair<uint32,uint32> ItemPair; + typedef std::pair<uint32, uint32> ItemPair; typedef std::list< ItemPair > ItemPairs; ItemPairs items; @@ -4263,18 +4263,18 @@ bool ChatHandler::HandleSendItemsCommand(const char *args) uint32 item_count = itemCountStr ? atoi(itemCountStr) : 1; if (item_count < 1 || (item_proto->MaxCount > 0 && item_count > uint32(item_proto->MaxCount))) { - PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count,item_id); + PSendSysMessage(LANG_COMMAND_INVALID_ITEM_COUNT, item_count, item_id); SetSentErrorMessage(true); return false; } while (item_count > item_proto->GetMaxStackSize()) { - items.push_back(ItemPair(item_id,item_proto->GetMaxStackSize())); + items.push_back(ItemPair(item_id, item_proto->GetMaxStackSize())); item_count -= item_proto->GetMaxStackSize(); } - items.push_back(ItemPair(item_id,item_count)); + items.push_back(ItemPair(item_id, item_count)); if (items.size() > MAX_MAIL_ITEMS) { @@ -4285,7 +4285,7 @@ bool ChatHandler::HandleSendItemsCommand(const char *args) } // from console show not existed sender - MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); // fill mail MailDraft draft(subject, text); @@ -4294,14 +4294,14 @@ bool ChatHandler::HandleSendItemsCommand(const char *args) for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr) { - if (Item* item = Item::CreateItem(itr->first,itr->second,m_session ? m_session->GetPlayer() : 0)) + if (Item* item = Item::CreateItem(itr->first, itr->second, m_session ? m_session->GetPlayer() : 0)) { item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted draft.AddItem(item); } } - draft.SendMailTo(trans, MailReceiver(receiver,GUID_LOPART(receiver_guid)), sender); + draft.SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiver_guid)), sender); CharacterDatabase.CommitTransaction(trans); std::string nameLink = playerLink(receiver_name); @@ -4317,7 +4317,7 @@ bool ChatHandler::HandleSendMoneyCommand(const char *args) Player* receiver; uint64 receiver_guid; std::string receiver_name; - if (!extractPlayerTarget((char*)args,&receiver,&receiver_guid,&receiver_name)) + if (!extractPlayerTarget((char*)args, &receiver, &receiver_guid, &receiver_name)) return false; char* tail1 = strtok(NULL, ""); @@ -4346,13 +4346,13 @@ bool ChatHandler::HandleSendMoneyCommand(const char *args) std::string text = msgText; // from console show not existed sender - MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); + MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM); SQLTransaction trans = CharacterDatabase.BeginTransaction(); MailDraft(subject, text) .AddMoney(money) - .SendMailTo(trans, MailReceiver(receiver,GUID_LOPART(receiver_guid)),sender); + .SendMailTo(trans, MailReceiver(receiver, GUID_LOPART(receiver_guid)), sender); CharacterDatabase.CommitTransaction(trans); @@ -4388,7 +4388,7 @@ bool ChatHandler::HandleSendMessageCommand(const char *args) //Confirmation message std::string nameLink = GetNameLink(rPlayer); - PSendSysMessage(LANG_SENDMESSAGE,nameLink.c_str(),msg_str); + PSendSysMessage(LANG_SENDMESSAGE, nameLink.c_str(), msg_str); return true; } @@ -4502,7 +4502,7 @@ bool ChatHandler::HandleFreezeCommand(const char *args) //effect if (player && player != m_session->GetPlayer()) { - PSendSysMessage(LANG_COMMAND_FREEZE,name.c_str()); + PSendSysMessage(LANG_COMMAND_FREEZE, name.c_str()); //stop combat + make player unattackable + duel stop + stop some spells player->setFaction(35); @@ -4519,11 +4519,11 @@ bool ChatHandler::HandleFreezeCommand(const char *args) pet->SavePetToDB(PET_SAVE_AS_CURRENT); // not let dismiss dead pet if (pet && pet->isAlive()) - player->RemovePet(pet,PET_SAVE_NOT_IN_SLOT); + player->RemovePet(pet, PET_SAVE_NOT_IN_SLOT); } } - //m_session->GetPlayer()->CastSpell(player,spellID,false); + //m_session->GetPlayer()->CastSpell(player, spellID, false); if (SpellEntry const *spellInfo = sSpellStore.LookupEntry(9454)) Aura::TryCreate(spellInfo, player, player); @@ -4555,7 +4555,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) //effect if (player) { - PSendSysMessage(LANG_COMMAND_UNFREEZE,name.c_str()); + PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); //Reset player faction + allow combat + allow duels player->setFactionForRace(player->getRace()); @@ -4573,7 +4573,7 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) if (TargetName) { //check for offline players - QueryResult result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'",name.c_str()); + QueryResult result = CharacterDatabase.PQuery("SELECT characters.guid FROM characters WHERE characters.name = '%s'", name.c_str()); if (!result) { SendSysMessage(LANG_COMMAND_FREEZE_WRONG); @@ -4583,8 +4583,8 @@ bool ChatHandler::HandleUnFreezeCommand(const char *args) Field *fields=result->Fetch(); uint64 pguid = fields[0].GetUInt64(); - CharacterDatabase.PQuery("DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = '%u'",pguid); - PSendSysMessage(LANG_COMMAND_UNFREEZE,name.c_str()); + CharacterDatabase.PQuery("DELETE FROM character_aura WHERE character_aura.spell = 9454 AND character_aura.guid = '%u'", pguid); + PSendSysMessage(LANG_COMMAND_UNFREEZE, name.c_str()); return true; } else @@ -4614,7 +4614,7 @@ bool ChatHandler::HandleListFreezeCommand(const char * /*args*/) { Field *fields = result->Fetch(); std::string fplayers = fields[0].GetString(); - PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS,fplayers.c_str()); + PSendSysMessage(LANG_COMMAND_FROZEN_PLAYERS, fplayers.c_str()); } while (result->NextRow()); return true; diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 92e0acb9892..10648b0b92e 100755 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -55,7 +55,7 @@ bool Condition::Meets(Player * player, Unit* invoker) condMeets = (mConditionValue2 && player->HasItemCount(mConditionValue1, mConditionValue2)) || (!mConditionValue2 && !player->HasItemCount(mConditionValue1, mConditionValue2));//HasItemCount returns false if 0 count is used break; case CONDITION_ITEM_EQUIPPED: - condMeets = player->HasItemOrGemWithIdEquipped(mConditionValue1,1); + condMeets = player->HasItemOrGemWithIdEquipped(mConditionValue1, 1); break; case CONDITION_ZONEID: condMeets = player->GetZoneId() == mConditionValue1; @@ -252,12 +252,12 @@ ConditionList ConditionMgr::GetConditionReferences(uint32 refId) return conditions; } -bool ConditionMgr::IsPlayerMeetToConditionList(Player* player,const ConditionList& conditions, Unit* invoker) +bool ConditionMgr::IsPlayerMeetToConditionList(Player* player, const ConditionList& conditions, Unit* invoker) { std::map<uint32, bool>ElseGroupMap; for (ConditionList::const_iterator i = conditions.begin(); i != conditions.end(); ++i) { - sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u",(*i)->mConditionType,(*i)->mConditionValue1); + sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->mConditionType, (*i)->mConditionValue1); if ((*i)->isLoaded()) { std::map<uint32, bool>::const_iterator itr = ElseGroupMap.find((*i)->mElseGroup); @@ -377,7 +377,7 @@ void ConditionMgr::LoadConditions(bool isReload) sObjectMgr->LoadGossipMenuItems(); } - QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference," + QueryResult result = WorldDatabase.Query("SELECT SourceTypeOrReferenceId, SourceGroup, SourceEntry, ElseGroup, ConditionTypeOrReference, " " ConditionValue1, ConditionValue2, ConditionValue3, ErrorTextId, ScriptName FROM conditions"); if (!result) @@ -888,14 +888,14 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) { cond->mConditionValue3 &= ~(1 << i); sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)" - ",TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" + ", TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" "TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52) in effect %u", cond->mSourceEntry, uint32(i)); } } if (!targetfound && !cond->mConditionValue3) // cond->mConditionValue3 already errored up there { sLog->outErrorDb("SourceEntry %u in `condition` table does not have any implicit target TARGET_UNIT_NEARBY_ENTRY(38) or TARGET_DST_NEARBY_ENTRY (46)" - ",TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" + ", TARGET_UNIT_AREA_ENTRY_SRC(7), TARGET_UNIT_AREA_ENTRY_DST(8), TARGET_UNIT_CONE_ENTRY(60), TARGET_GAMEOBJECT_NEARBY_ENTRY(40)" "TARGET_GAMEOBJECT_AREA_SRC(51), TARGET_GAMEOBJECT_AREA_DST(52)", cond->mSourceEntry); return false; } @@ -1026,7 +1026,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) { if (cond->mConditionType == CONDITION_NONE || cond->mConditionType >= CONDITION_MAX) { - sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType),cond->mSourceEntry); + sLog->outErrorDb("Invalid ConditionType %u at SourceEntry %u in `condition` table, ignoring.", uint32(cond->mConditionType), cond->mSourceEntry); return false; } diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index 6a1dbb8fa92..11a71ea0cfd 100755 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -73,28 +73,28 @@ enum LevelConditionType enum ConditionSourceType { - CONDITION_SOURCE_TYPE_NONE = 0,//DONE - CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE = 1,//DONE - CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE = 2,//DONE - CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE = 3,//DONE - CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE = 4,//DONE - CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE = 5,//DONE - CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE = 6,//DONE - CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE = 7,//DONE - CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE = 8,//DONE - CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE = 9,//DONE - CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE = 10,//DONE - CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE = 11,//DONE - CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE = 12,//DONE - CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET = 13,//DONE - CONDITION_SOURCE_TYPE_GOSSIP_MENU = 14,//DONE - CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15,//DONE - CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,//DONE - CONDITION_SOURCE_TYPE_SPELL = 17,//DONE - CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,//DONE - CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,//DONE - CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,//DONE - CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,//DONE + CONDITION_SOURCE_TYPE_NONE = 0, //DONE + CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE = 1, //DONE + CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE = 2, //DONE + CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE = 3, //DONE + CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE = 4, //DONE + CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE = 5, //DONE + CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE = 6, //DONE + CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE = 7, //DONE + CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE = 8, //DONE + CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE = 9, //DONE + CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE = 10, //DONE + CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE = 11, //DONE + CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE = 12, //DONE + CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET = 13, //DONE + CONDITION_SOURCE_TYPE_GOSSIP_MENU = 14, //DONE + CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15, //DONE + CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16, //DONE + CONDITION_SOURCE_TYPE_SPELL = 17, //DONE + CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18, //DONE + CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19, //DONE + CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20, //DONE + CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21, //DONE CONDITION_SOURCE_TYPE_MAX = 22//MAX }; @@ -166,7 +166,7 @@ class ConditionMgr bool addToLootTemplate(Condition* cond, LootTemplate* loot); bool addToGossipMenus(Condition* cond); bool addToGossipMenuItems(Condition* cond); - bool IsPlayerMeetToConditionList(Player* player,const ConditionList& conditions, Unit* invoker = NULL); + bool IsPlayerMeetToConditionList(Player* player, const ConditionList& conditions, Unit* invoker = NULL); bool isGroupable(ConditionSourceType sourceType) const { diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index ac5c43dcefa..3685dfdc0a6 100755 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -43,7 +43,7 @@ void DisableMgr::LoadDisables() m_DisableMap.clear(); - QueryResult result = WorldDatabase.Query("SELECT sourceType,entry,flags,params_0,params_1 FROM disables"); + QueryResult result = WorldDatabase.Query("SELECT sourceType, entry, flags, params_0, params_1 FROM disables"); uint32 total_count = 0; @@ -91,14 +91,14 @@ void DisableMgr::LoadDisables() if (flags & SPELL_DISABLE_MAP) { - Tokens tokens(params_0, ','); + Tokens tokens(params_0, ', '); for (uint8 i = 0; i < tokens.size(); ) data.params[0].insert(atoi(tokens[i++])); } if (flags & SPELL_DISABLE_AREA) { - Tokens tokens(params_1, ','); + Tokens tokens(params_1, ', '); for (uint8 i = 0; i < tokens.size(); ) data.params[1].insert(atoi(tokens[i++])); } diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index 9534ec9d0e3..5182a0d90ad 100755 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -278,7 +278,7 @@ enum Difficulty enum SpawnMask { - SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY),// any any maps without spawn modes + SPAWNMASK_CONTINENT = (1 << REGULAR_DIFFICULTY), // any any maps without spawn modes SPAWNMASK_DUNGEON_NORMAL = (1 << DUNGEON_DIFFICULTY_NORMAL), SPAWNMASK_DUNGEON_HEROIC = (1 << DUNGEON_DIFFICULTY_HEROIC), diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 5cf90472fa5..f4056dd0a37 100755 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -26,8 +26,8 @@ #include <map> -typedef std::map<uint16,uint32> AreaFlagByAreaID; -typedef std::map<uint32,uint32> AreaFlagByMapID; +typedef std::map<uint16, uint32> AreaFlagByAreaID; +typedef std::map<uint32, uint32> AreaFlagByMapID; struct WMOAreaTableTripple { @@ -83,7 +83,7 @@ DBCStorage <DurabilityCostsEntry> sDurabilityCostsStore(DurabilityCostsfmt); DBCStorage <EmotesEntry> sEmotesStore(EmotesEntryfmt); DBCStorage <EmotesTextEntry> sEmotesTextStore(EmotesTextEntryfmt); -typedef std::map<uint32,SimpleFactionsList> FactionTeamMap; +typedef std::map<uint32, SimpleFactionsList> FactionTeamMap; static FactionTeamMap sFactionTeamMap; DBCStorage <FactionEntry> sFactionStore(FactionEntryfmt); DBCStorage <FactionTemplateEntry> sFactionTemplateStore(FactionTemplateEntryfmt); @@ -196,9 +196,9 @@ typedef std::list<std::string> StoreProblemList; uint32 DBCFileCount = 0; -static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& filename) +static bool LoadDBC_assert_print(uint32 fsize, uint32 rsize, const std::string& filename) { - sLog->outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).",filename.c_str(),fsize,rsize); + sLog->outError("Size of '%s' setted by format string (%u) not equal size of C++ structure (%u).", filename.c_str(), fsize, rsize); // ASSERT must fail after function call return false; @@ -327,9 +327,9 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sGlyphSlotStore, dbcPath, "GlyphSlot.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sGtBarberShopCostBaseStore, dbcPath, "gtBarberShopCostBase.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sGtCombatRatingsStore, dbcPath, "gtCombatRatings.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritBaseStore,dbcPath, "gtChanceToMeleeCritBase.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritBaseStore, dbcPath, "gtChanceToMeleeCritBase.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToMeleeCritStore, dbcPath, "gtChanceToMeleeCrit.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritBaseStore,dbcPath, "gtChanceToSpellCritBase.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritBaseStore, dbcPath, "gtChanceToSpellCritBase.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sGtChanceToSpellCritStore, dbcPath, "gtChanceToSpellCrit.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sGtOCTRegenHPStore, dbcPath, "gtOCTRegenHP.dbc"); //LoadDBC(dbcCount, availableDbcLocales, bad_dbc_files, sGtOCTRegenMPStore, dbcPath, "gtOCTRegenMP.dbc"); -- not used currently @@ -376,7 +376,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sRandomPropertiesPointsStore, dbcPath, "RandPropPoints.dbc"); - LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore,dbcPath, "ScalingStatDistribution.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatDistributionStore, dbcPath, "ScalingStatDistribution.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sScalingStatValuesStore, dbcPath, "ScalingStatValues.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineStore, dbcPath, "SkillLine.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sSkillLineAbilityStore, dbcPath, "SkillLineAbility.dbc"); @@ -692,7 +692,7 @@ AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id) return sAreaStore.LookupEntry(areaflag); } -AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id) +AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id) { if (area_flag) return sAreaStore.LookupEntry(area_flag); @@ -725,7 +725,7 @@ uint32 GetVirtualMapForMapAndZone(uint32 mapid, uint32 zoneId) ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId) { - mapid = GetVirtualMapForMapAndZone(mapid,zoneId); + mapid = GetVirtualMapForMapAndZone(mapid, zoneId); if (mapid < 2) return CONTENT_1_60; @@ -761,7 +761,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT return (itemEntry->categoryMask & reqEntry->categoryMask) == reqEntry->categoryMask; } -void Zone2MapCoordinates(float& x,float& y,uint32 zone) +void Zone2MapCoordinates(float& x, float& y, uint32 zone) { WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone); @@ -769,12 +769,12 @@ void Zone2MapCoordinates(float& x,float& y,uint32 zone) if (!maEntry) return; - std::swap(x,y); // at client map coords swapped + std::swap(x, y); // at client map coords swapped x = x*((maEntry->x2-maEntry->x1)/100)+maEntry->x1; y = y*((maEntry->y2-maEntry->y1)/100)+maEntry->y1; // client y coord from top to down } -void Map2ZoneCoordinates(float& x,float& y,uint32 zone) +void Map2ZoneCoordinates(float& x, float& y, uint32 zone) { WorldMapAreaEntry const* maEntry = sWorldMapAreaStore.LookupEntry(zone); @@ -784,12 +784,12 @@ void Map2ZoneCoordinates(float& x,float& y,uint32 zone) x = (x-maEntry->x1)/((maEntry->x2-maEntry->x1)/100); y = (y-maEntry->y1)/((maEntry->y2-maEntry->y1)/100); // client y coord from top to down - std::swap(x,y); // client have map coords swapped + std::swap(x, y); // client have map coords swapped } MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty) { - MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId,difficulty)); + MapDifficultyMap::const_iterator itr = sMapDifficultyMap.find(MAKE_PAIR32(mapId, difficulty)); return itr != sMapDifficultyMap.end() ? &itr->second : NULL; } diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 27fca9de326..97598e87f8e 100755 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -34,7 +34,7 @@ TalentSpellPos const* GetTalentSpellPos(uint32 spellId); int32 GetAreaFlagByAreaID(uint32 area_id); // -1 if not found AreaTableEntry const* GetAreaEntryByAreaID(uint32 area_id); -AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag,uint32 map_id); +AreaTableEntry const* GetAreaEntryByAreaFlagAndMap(uint32 area_flag, uint32 map_id); uint32 GetAreaFlagByMapId(uint32 mapid); WMOAreaTableEntry const* GetWMOAreaTableEntryByTripple(int32 rootid, int32 adtid, int32 groupid); @@ -54,7 +54,7 @@ bool IsTotemCategoryCompatiableWith(uint32 itemTotemCategoryId, uint32 requiredT void Zone2MapCoordinates(float &x, float &y, uint32 zone); void Map2ZoneCoordinates(float &x, float &y, uint32 zone); -typedef std::map<uint32/*pair32(map,diff)*/,MapDifficulty> MapDifficultyMap; +typedef std::map<uint32/*pair32(map, diff)*/, MapDifficulty> MapDifficultyMap; MapDifficulty const* GetMapDifficultyData(uint32 mapId, Difficulty difficulty); MapDifficulty const* GetDownscaledMapDifficultyData(uint32 mapId, Difficulty &difficulty); diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index b35516ebfa4..ded277dfbe6 100755 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -32,11 +32,11 @@ // Structures using to access raw DBC data and required packing to portability -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct AchievementEntry @@ -254,13 +254,13 @@ struct AchievementCriteriaEntry // ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_TEAM_RATING = 38 struct { - uint32 teamtype; // 3 {2,3,5} + uint32 teamtype; // 3 {2, 3, 5} } highest_team_rating; // ACHIEVEMENT_CRITERIA_TYPE_REACH_TEAM_RATING = 39 struct { - uint32 teamtype; // 3 {2,3,5} + uint32 teamtype; // 3 {2, 3, 5} uint32 teamrating; // 4 } reach_team_rating; @@ -1214,7 +1214,7 @@ struct MapEntry float entrance_x; // 60 entrance x coordinate (if exist single entry) float entrance_y; // 61 entrance y coordinate (if exist single entry) // 62 -1, 0 and 720 - uint32 addon; // 63 (0-original maps,1-tbc addon) + uint32 addon; // 63 (0-original maps, 1-tbc addon) uint32 unk_time; // 64 some kind of time? //uint32 maxPlayers; // 65 max players @@ -1584,9 +1584,9 @@ struct SpellEntry }; typedef std::set<uint32> SpellCategorySet; -typedef std::map<uint32,SpellCategorySet > SpellCategoryStore; +typedef std::map<uint32, SpellCategorySet > SpellCategoryStore; typedef std::set<uint32> PetFamilySpellsSet; -typedef std::map<uint32,PetFamilySpellsSet > PetFamilySpellsStore; +typedef std::map<uint32, PetFamilySpellsSet > PetFamilySpellsStore; struct SpellCastTimesEntry { @@ -1599,7 +1599,7 @@ struct SpellCastTimesEntry struct SpellDifficultyEntry { uint32 ID; // 0 - int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N,25N,10H,25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2 + int32 SpellID[MAX_DIFFICULTY]; // 1-4 instance modes: 10N, 25N, 10H, 25H or Normal/Heroic if only 1-2 is set, if 3-4 is 0 then Mode-2 }; struct SpellFocusObjectEntry @@ -1920,7 +1920,7 @@ struct WorldMapAreaEntry float x1; // 6 float x2; // 7 int32 virtual_map_id; // 8 -1 (map_id have correct map) other: virtual map where zone show (map_id - where zone in fact internally) - // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1,x2,y1,y2 coordinates) + // int32 dungeonMap_id; // 9 pointer to DungeonMap.dbc (owerride x1, x2, y1, y2 coordinates) // uint32 someMapID; // 10 }; @@ -1974,18 +1974,18 @@ struct TalentSpellPos uint8 rank; }; -typedef std::map<uint32,TalentSpellPos> TalentSpellPosMap; +typedef std::map<uint32, TalentSpellPos> TalentSpellPosMap; struct TaxiPathBySourceAndDestination { - TaxiPathBySourceAndDestination() : ID(0),price(0) {} - TaxiPathBySourceAndDestination(uint32 _id,uint32 _price) : ID(_id),price(_price) {} + TaxiPathBySourceAndDestination() : ID(0), price(0) {} + TaxiPathBySourceAndDestination(uint32 _id, uint32 _price) : ID(_id), price(_price) {} uint32 ID; uint32 price; }; -typedef std::map<uint32,TaxiPathBySourceAndDestination> TaxiPathSetForSource; -typedef std::map<uint32,TaxiPathSetForSource> TaxiPathSetBySource; +typedef std::map<uint32, TaxiPathBySourceAndDestination> TaxiPathSetForSource; +typedef std::map<uint32, TaxiPathSetForSource> TaxiPathSetBySource; struct TaxiPathNodePtr { @@ -1995,7 +1995,7 @@ struct TaxiPathNodePtr operator TaxiPathNodeEntry const& () const { return *i_ptr; } }; -typedef Path<TaxiPathNodePtr,TaxiPathNodeEntry const> TaxiPathNodeList; +typedef Path<TaxiPathNodePtr, TaxiPathNodeEntry const> TaxiPathNodeList; typedef std::vector<TaxiPathNodeList> TaxiPathNodesByPath; #define TaxiMaskSize 14 diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index 827da373ac7..ae4c7ebe263 100755 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -785,7 +785,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal) uint64 frontGuid = check.front(); check.pop_front(); - // Check all-but-new compatibilities (New,A,B,C,D) --> check(A,B,C,D) + // Check all-but-new compatibilities (New, A, B, C, D) --> check(A, B, C, D) if (!CheckCompatibility(check, pProposal)) // Group not compatible { sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s) not compatibles (%s not compatibles)", strGuids.c_str(), ConcatenateGuids(check).c_str()); @@ -1140,7 +1140,7 @@ LfgAnswer LFGMgr::GetCompatibles(std::string key) /** Given a list of dungeons remove the dungeons players have restrictions. - @param[in,out] dungeons Dungeons to check restrictions + @param[in, out] dungeons Dungeons to check restrictions @param[in] players Set of players to check their dungeon restrictions @param[out] lockMap Map of players Lock status info of given dungeons (Empty if dungeons is not empty) */ @@ -1795,8 +1795,8 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) return; // if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day. - if (player->CanRewardQuest(qReward,false)) - player->RewardQuest(qReward,0,NULL,false); + if (player->CanRewardQuest(qReward, false)) + player->RewardQuest(qReward, 0, NULL, false); else { index = 1; @@ -1804,11 +1804,11 @@ void LFGMgr::RewardDungeonDoneFor(const uint32 dungeonId, Player* player) if (!qReward) return; // we give reward without informing client (retail does this) - player->RewardQuest(qReward,0,NULL,false); + player->RewardQuest(qReward, 0, NULL, false); } // Give rewards - sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u,%s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); + sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::RewardDungeonDoneFor: [" UI64FMTD "] done dungeon %u, %s previously done.", player->GetGUID(), GetDungeon(gguid), index > 0 ? " " : " not"); player->GetSession()->SendLfgPlayerReward(dungeon->Entry(), GetDungeon(gguid, false), index, reward, qReward); } diff --git a/src/server/game/Entities/Corpse/Corpse.h b/src/server/game/Entities/Corpse/Corpse.h index 792641acbba..d977aed0719 100755 --- a/src/server/game/Entities/Corpse/Corpse.h +++ b/src/server/game/Entities/Corpse/Corpse.h @@ -77,11 +77,11 @@ class Corpse : public WorldObject, public GridObject<Corpse> Player* lootRecipient; bool lootForBody; - void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); } - void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } - void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); } - void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId,receiver); } - void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } + void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); } + void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); } + void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); } + void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); } bool IsExpired(time_t t) const; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index a53e5de6ebe..aaa6b9e7713 100755 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -92,7 +92,7 @@ uint32 CreatureTemplate::GetRandomValidModelId() const if (Modelid3) modelIDs[c++] = Modelid3; if (Modelid4) modelIDs[c++] = Modelid4; - return ((c>0) ? modelIDs[urand(0,c-1)] : 0); + return ((c>0) ? modelIDs[urand(0, c-1)] : 0); } uint32 CreatureTemplate::GetFirstValidModelId() const @@ -243,10 +243,10 @@ void Creature::RemoveCorpse(bool setSpawnTime) if(setSpawnTime) m_respawnTime = time(NULL) + respawnDelay; - float x,y,z,o; + float x, y, z, o; GetRespawnCoord(x, y, z, &o); - SetHomePosition(x,y,z,o); - GetMap()->CreatureRelocation(this,x,y,z,o); + SetHomePosition(x, y, z, o); + GetMap()->CreatureRelocation(this, x, y, z, o); } /** @@ -289,13 +289,13 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data // equal to player Race field, but creature does not have race SetByteValue(UNIT_FIELD_BYTES_0, 0, 0); - // known valid are: CLASS_WARRIOR,CLASS_PALADIN,CLASS_ROGUE,CLASS_MAGE + // known valid are: CLASS_WARRIOR, CLASS_PALADIN, CLASS_ROGUE, CLASS_MAGE SetByteValue(UNIT_FIELD_BYTES_0, 1, uint8(cinfo->unit_class)); // Cancel load if no model defined if (!(cinfo->GetFirstValidModelId())) { - sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ",Entry); + sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry); return false; } @@ -303,7 +303,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data 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); + sLog->outErrorDb("Creature (Entry: %u) has no model defined in table `creature_template`, can't load. ", Entry); return false; } @@ -319,8 +319,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data SetName(normalInfo->Name); // at normal entry always - SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius); - SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach); + SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius); + SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach); SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); @@ -344,7 +344,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 /*team*/, const CreatureData *data bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) { - if (!InitEntry(Entry,team,data)) + if (!InitEntry(Entry, team, data)) return false; CreatureTemplate const* cInfo = GetCreatureInfo(); @@ -370,7 +370,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) SetAttackTime(BASE_ATTACK, cInfo->baseattacktime); SetAttackTime(OFF_ATTACK, cInfo->baseattacktime); - SetAttackTime(RANGED_ATTACK,cInfo->rangeattacktime); + SetAttackTime(RANGED_ATTACK, cInfo->rangeattacktime); SetUInt32Value(UNIT_FIELD_FLAGS, unit_flags); @@ -410,7 +410,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data) if (cInfo->flags_extra & CREATURE_FLAG_EXTRA_NO_TAUNT) { ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); } // TODO: In fact monster move flags should be set - not movement flags. @@ -437,11 +437,11 @@ void Creature::Update(uint32 diff) { case JUST_ALIVED: // Don't must be called, see Creature::setDeathState JUST_ALIVED -> ALIVE promoting. - sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)",GetGUIDLow(),GetEntry()); + sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_ALIVED (4)", GetGUIDLow(), GetEntry()); break; case JUST_DIED: // Don't must be called, see Creature::setDeathState JUST_DIED -> CORPSE promoting. - sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)",GetGUIDLow(),GetEntry()); + sLog->outError("Creature (GUID: %u Entry: %u) in wrong state: JUST_DEAD (1)", GetGUIDLow(), GetEntry()); break; case DEAD: { @@ -462,7 +462,7 @@ void Creature::Update(uint32 diff) if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day) SetRespawnTime(DAY); else - m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5,MINUTE); // else copy time from master and add a little + m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little SaveRespawnTime(); // also save to DB immediately } } @@ -687,7 +687,7 @@ void Creature::DoFleeToGetAssistance() UpdateSpeed(MOVE_RUN, false); if (!pCreature) - //SetFeared(true, getVictim()->GetGUID(), 0 ,sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); + //SetFeared(true, getVictim()->GetGUID(), 0 , sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_FLEE_DELAY)); //TODO: use 31365 SetControlled(true, UNIT_STAT_FLEEING); else @@ -737,7 +737,7 @@ bool Creature::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, { ASSERT(map); SetMap(map); - SetPhaseMask(phaseMask,false); + SetPhaseMask(phaseMask, false); CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(Entry); if (!cinfo) @@ -828,7 +828,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const if ((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS) { sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.", - GetGUIDLow(),GetEntry()); + GetGUIDLow(), GetEntry()); return false; } @@ -842,15 +842,15 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const pPlayer->PlayerTalkClass->ClearMenus(); switch(GetCreatureInfo()->trainer_class) { - case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913,GetGUID()); break; - case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090,GetGUID()); break; - case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328,GetGUID()); break; - case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635,GetGUID()); break; - case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436,GetGUID()); break; - case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797,GetGUID()); break; - case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003,GetGUID()); break; - case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836,GetGUID()); break; - case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985,GetGUID()); break; + case CLASS_DRUID: pPlayer->PlayerTalkClass->SendGossipMenu(4913, GetGUID()); break; + case CLASS_HUNTER: pPlayer->PlayerTalkClass->SendGossipMenu(10090, GetGUID()); break; + case CLASS_MAGE: pPlayer->PlayerTalkClass->SendGossipMenu(328, GetGUID()); break; + case CLASS_PALADIN:pPlayer->PlayerTalkClass->SendGossipMenu(1635, GetGUID()); break; + case CLASS_PRIEST: pPlayer->PlayerTalkClass->SendGossipMenu(4436, GetGUID()); break; + case CLASS_ROGUE: pPlayer->PlayerTalkClass->SendGossipMenu(4797, GetGUID()); break; + case CLASS_SHAMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5003, GetGUID()); break; + case CLASS_WARLOCK:pPlayer->PlayerTalkClass->SendGossipMenu(5836, GetGUID()); break; + case CLASS_WARRIOR:pPlayer->PlayerTalkClass->SendGossipMenu(4985, GetGUID()); break; } } return false; @@ -860,7 +860,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const if (pPlayer->getClass() != CLASS_HUNTER) { pPlayer->PlayerTalkClass->ClearMenus(); - pPlayer->PlayerTalkClass->SendGossipMenu(3620,GetGUID()); + pPlayer->PlayerTalkClass->SendGossipMenu(3620, GetGUID()); return false; } break; @@ -872,16 +872,16 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const pPlayer->PlayerTalkClass->ClearMenus(); switch(GetCreatureInfo()->trainer_class) { - case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865,GetGUID()); break; - case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881,GetGUID()); break; - case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861,GetGUID()); break; - case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break; - case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863,GetGUID()); break; - case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break; - case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816,GetGUID()); break; - case RACE_UNDEAD_PLAYER:pPlayer->PlayerTalkClass->SendGossipMenu(624,GetGUID()); break; - case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862,GetGUID()); break; - case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864,GetGUID()); break; + case RACE_DWARF: pPlayer->PlayerTalkClass->SendGossipMenu(5865, GetGUID()); break; + case RACE_GNOME: pPlayer->PlayerTalkClass->SendGossipMenu(4881, GetGUID()); break; + case RACE_HUMAN: pPlayer->PlayerTalkClass->SendGossipMenu(5861, GetGUID()); break; + case RACE_NIGHTELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break; + case RACE_ORC: pPlayer->PlayerTalkClass->SendGossipMenu(5863, GetGUID()); break; + case RACE_TAUREN: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break; + case RACE_TROLL: pPlayer->PlayerTalkClass->SendGossipMenu(5816, GetGUID()); break; + case RACE_UNDEAD_PLAYER:pPlayer->PlayerTalkClass->SendGossipMenu(624, GetGUID()); break; + case RACE_BLOODELF: pPlayer->PlayerTalkClass->SendGossipMenu(5862, GetGUID()); break; + case RACE_DRAENEI: pPlayer->PlayerTalkClass->SendGossipMenu(5864, GetGUID()); break; } } return false; @@ -893,7 +893,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const if (msg) { pPlayer->PlayerTalkClass->ClearMenus(); - pPlayer->PlayerTalkClass->SendGossipMenu(11031,GetGUID()); + pPlayer->PlayerTalkClass->SendGossipMenu(11031, GetGUID()); } return false; } @@ -918,9 +918,9 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const pPlayer->PlayerTalkClass->ClearMenus(); switch(bgTypeId) { - case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616,GetGUID()); break; - case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599,GetGUID()); break; - case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642,GetGUID()); break; + case BATTLEGROUND_AV: pPlayer->PlayerTalkClass->SendGossipMenu(7616, GetGUID()); break; + case BATTLEGROUND_WS: pPlayer->PlayerTalkClass->SendGossipMenu(7599, GetGUID()); break; + case BATTLEGROUND_AB: pPlayer->PlayerTalkClass->SendGossipMenu(7642, GetGUID()); break; case BATTLEGROUND_EY: case BATTLEGROUND_NA: case BATTLEGROUND_BE: @@ -928,7 +928,7 @@ bool Creature::isCanInteractWithBattleMaster(Player* pPlayer, bool msg) const case BATTLEGROUND_RL: case BATTLEGROUND_SA: case BATTLEGROUND_DS: - case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024,GetGUID()); break; + case BATTLEGROUND_RV: pPlayer->PlayerTalkClass->SendGossipMenu(10024, GetGUID()); break; default: break; } return false; @@ -1097,26 +1097,26 @@ void Creature::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) std::ostringstream ss; ss << "INSERT INTO creature VALUES (" - << m_DBTableGuid << "," - << GetEntry() << "," - << mapid <<"," - << uint32(spawnMask) << "," // cast to prevent save as symbol - << uint16(GetPhaseMask()) << "," // prevent out of range error - << displayId <<"," - << GetEquipmentId() <<"," - << GetPositionX() << "," - << GetPositionY() << "," - << GetPositionZ() << "," - << GetOrientation() << "," - << m_respawnDelay << "," //respawn time - << (float) m_respawnradius << "," //spawn distance (float) - << (uint32) (0) << "," //currentwaypoint - << GetHealth() << "," //curhealth - << GetPower(POWER_MANA) << "," //curmana - << (m_isDeadByDefault ? 1 : 0) << "," //is_dead - << GetDefaultMovementType() << "," //default movement generator type - << npcflag << "," - << unit_flags << "," + << m_DBTableGuid << ", " + << GetEntry() << ", " + << mapid <<", " + << uint32(spawnMask) << ", " // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ", " // prevent out of range error + << displayId <<", " + << GetEquipmentId() <<", " + << GetPositionX() << ", " + << GetPositionY() << ", " + << GetPositionZ() << ", " + << GetOrientation() << ", " + << m_respawnDelay << ", " //respawn time + << (float) m_respawnradius << ", " //spawn distance (float) + << (uint32) (0) << ", " //currentwaypoint + << GetHealth() << ", " //curhealth + << GetPower(POWER_MANA) << ", " //curmana + << (m_isDeadByDefault ? 1 : 0) << ", " //is_dead + << GetDefaultMovementType() << ", " //default movement generator type + << npcflag << ", " + << unit_flags << ", " << dynamicflags << ")"; trans->Append(ss.str().c_str()); @@ -1165,8 +1165,8 @@ void Creature::SelectLevel(const CreatureTemplate *cinfo) SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * damagemod); SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * damagemod); - SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE,cinfo->minrangedmg * damagemod); - SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE,cinfo->maxrangedmg * damagemod); + SetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, cinfo->minrangedmg * damagemod); + SetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, cinfo->maxrangedmg * damagemod); SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, cinfo->attackpower * damagemod); @@ -1268,25 +1268,25 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) if (!data) { - sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ",guid); + sLog->outErrorDb("Creature (GUID: %u) not found in table `creature`, can't load. ", guid); return false; } m_DBTableGuid = guid; if (map->GetInstanceId() == 0) { - if (map->GetCreature(MAKE_NEW_GUID(guid,data->id,HIGHGUID_UNIT))) + if (map->GetCreature(MAKE_NEW_GUID(guid, data->id, HIGHGUID_UNIT))) return false; } else guid = sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT); uint16 team = 0; - if (!Create(guid,map,data->phaseMask,data->id,0,team,data->posX,data->posY,data->posZ,data->orientation,data)) + if (!Create(guid, map, data->phaseMask, data->id, 0, team, data->posX, data->posY, data->posZ, data->orientation, data)) return false; //We should set first home position, because then AI calls home movement - SetHomePosition(data->posX,data->posY,data->posZ,data->orientation); + SetHomePosition(data->posX, data->posY, data->posZ, data->orientation); m_respawnradius = data->spawndist; @@ -1294,15 +1294,15 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) m_isDeadByDefault = data->is_dead; m_deathState = m_isDeadByDefault ? DEAD : ALIVE; - m_respawnTime = sObjectMgr->GetCreatureRespawnTime(m_DBTableGuid,GetInstanceId()); + m_respawnTime = sObjectMgr->GetCreatureRespawnTime(m_DBTableGuid, GetInstanceId()); if (m_respawnTime) // respawn on Update { m_deathState = DEAD; if (canFly()) { - float tz = map->GetHeight(data->posX,data->posY,data->posZ,false); + float tz = map->GetHeight(data->posX, data->posY, data->posZ, false); if (data->posZ - tz > 0.1) - Relocate(data->posX,data->posY,tz); + Relocate(data->posX, data->posY, tz); } } @@ -1317,12 +1317,12 @@ bool Creature::LoadFromDB(uint32 guid, Map *map) if (curhealth < 1) curhealth = 1; } - SetPower(POWER_MANA,data->curmana); + SetPower(POWER_MANA, data->curmana); } else { curhealth = GetMaxHealth(); - SetPower(POWER_MANA,GetMaxPower(POWER_MANA)); + SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); } SetHealth(m_deathState == ALIVE ? curhealth : 0); @@ -1507,7 +1507,7 @@ void Creature::setDeathState(DeathState s) if (s == JUST_DIED) { - SetUInt64Value(UNIT_FIELD_TARGET,0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState) + SetUInt64Value(UNIT_FIELD_TARGET, 0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState) SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); setActive(false); @@ -1823,7 +1823,7 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const Unit *target = NULL; if (dist > ATTACK_DISTANCE) - sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.",GetGUIDLow(),GetEntry()); + sLog->outError("Creature (GUID: %u Entry: %u) SelectNearestTargetInAttackDistance called with dist > ATTACK_DISTANCE. Extra distance ignored.", GetGUIDLow(), GetEntry()); { Trinity::NearestHostileUnitInAttackDistanceCheck u_check(this, dist); @@ -1995,7 +1995,7 @@ void Creature::SaveRespawnTime() if (isSummon() || !m_DBTableGuid || (m_creatureData && !m_creatureData->dbData)) return; - sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); + sObjectMgr->SaveCreatureRespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime); } // this should not be called by petAI or @@ -2115,9 +2115,9 @@ void Creature::SendZoneUnderAttackMessage(Player* attacker) { uint32 enemy_team = attacker->GetTeam(); - WorldPacket data(SMSG_ZONE_UNDER_ATTACK,4); + WorldPacket data(SMSG_ZONE_UNDER_ATTACK, 4); data << (uint32)GetAreaId(); - sWorld->SendGlobalMessage(&data,NULL,(enemy_team == ALLIANCE ? HORDE : ALLIANCE)); + sWorld->SendGlobalMessage(&data, NULL, (enemy_team == ALLIANCE ? HORDE : ALLIANCE)); } void Creature::SetInCombatWithZone() @@ -2351,7 +2351,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us if (itr == m_vendorItemCounts.end()) { uint32 new_count = vItem->maxcount > used_count ? vItem->maxcount-used_count : 0; - m_vendorItemCounts.push_back(VendorItemCount(vItem->item,new_count)); + m_vendorItemCounts.push_back(VendorItemCount(vItem->item, new_count)); return new_count; } diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 5f9f221ddac..9d087ecafcf 100755 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -64,11 +64,11 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_NO_SKILLGAIN | CREATURE_FLAG_EXTRA_TAUNT_DIMINISH | CREATURE_FLAG_EXTRA_ALL_DIMINISH | \ CREATURE_FLAG_EXTRA_GUARD) -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif #define MAX_KILL_CREDIT 2 @@ -401,7 +401,7 @@ struct TrainerSpellData TrainerSpell const* Find(uint32 spell_id) const; }; -typedef std::map<uint32,time_t> CreatureSpellCooldowns; +typedef std::map<uint32, time_t> CreatureSpellCooldowns; // max different by z coordinate for creature aggro reaction #define CREATURE_Z_ATTACK_RANGE 3 @@ -534,11 +534,11 @@ class Creature : public Unit, public GridObject<Creature> std::string GetScriptName() const; uint32 GetScriptId() const; - void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); } - void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } - void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId,TargetGuid,IsBossEmote); } - void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId,receiver,IsBossWhisper); } - void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } + void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); } + void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); } + void TextEmote(int32 textId, uint64 TargetGuid, bool IsBossEmote = false) { MonsterTextEmote(textId, TargetGuid, IsBossEmote); } + void Whisper(int32 textId, uint64 receiver, bool IsBossWhisper = false) { MonsterWhisper(textId, receiver, IsBossWhisper); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); } // override WorldObject function for proper name localization const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const; diff --git a/src/server/game/Entities/Creature/GossipDef.cpp b/src/server/game/Entities/Creature/GossipDef.cpp index e39b8f90dff..75e665feac0 100755 --- a/src/server/game/Entities/Creature/GossipDef.cpp +++ b/src/server/game/Entities/Creature/GossipDef.cpp @@ -70,7 +70,7 @@ void GossipMenu::AddMenuItem(uint8 Icon, const std::string& Message, bool Coded) void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, bool Coded) { - AddMenuItem(Icon, std::string(Message ? Message : ""),Coded); + AddMenuItem(Icon, std::string(Message ? Message : ""), Coded); } void GossipMenu::AddMenuItem(uint8 Icon, char const* Message, uint32 dtSender, uint32 dtAction, char const* BoxMessage, uint32 BoxMoney, bool Coded) @@ -206,7 +206,7 @@ void PlayerMenu::SendPointOfInterest(uint32 poi_id) PointOfInterest const* poi = sObjectMgr->GetPointOfInterest(poi_id); if (!poi) { - sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.",poi_id); + sLog->outErrorDb("Request to send non-existing POI (Id: %u), ignored.", poi_id); return; } diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp index 62174fe8c9c..92c57009832 100755 --- a/src/server/game/Entities/Creature/TemporarySummon.cpp +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp @@ -159,7 +159,7 @@ void TempSummon::Update(uint32 diff) } default: UnSummon(); - sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ",GetEntry(),m_type); + sLog->outError("Temporary summoned creature (entry: %u) have unknown type %u of ", GetEntry(), m_type); break; } } diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.cpp b/src/server/game/Entities/DynamicObject/DynamicObject.cpp index 70e92bd06d7..444b4170104 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.cpp +++ b/src/server/game/Entities/DynamicObject/DynamicObject.cpp @@ -84,7 +84,7 @@ bool DynamicObject::Create(uint32 guidlow, Unit* caster, uint32 spellId, Positio Relocate(pos); if (!IsPositionValid()) { - sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",spellId,GetPositionX(),GetPositionY()); + sLog->outError("DynamicObject (spell %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", spellId, GetPositionX(), GetPositionY()); return false; } diff --git a/src/server/game/Entities/DynamicObject/DynamicObject.h b/src/server/game/Entities/DynamicObject/DynamicObject.h index 77479234ce3..540e4c06113 100755 --- a/src/server/game/Entities/DynamicObject/DynamicObject.h +++ b/src/server/game/Entities/DynamicObject/DynamicObject.h @@ -61,7 +61,7 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject> void Say(int32 textId, uint32 language, uint64 targetGuid) { MonsterSay(textId, language, targetGuid); } void Yell(int32 textId, uint32 language, uint64 targetGuid) { MonsterYell(textId, language, targetGuid); } void TextEmote(int32 textId, uint64 targetGuid) { MonsterTextEmote(textId, targetGuid); } - void Whisper(int32 textId,uint64 receiver) { MonsterWhisper(textId, receiver); } + void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); } void YellToZone(int32 textId, uint32 language, uint64 targetGuid) { MonsterYellToZone(textId, language, targetGuid); } protected: diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 003c693216d..af7fe560d9d 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -100,10 +100,10 @@ void GameObject::CleanupsBeforeDelete(bool /*finalCleanup*/) // Possible crash at access to deleted GO in Unit::m_gameobj if (uint64 owner_guid = GetOwnerGUID()) { - Unit* owner = ObjectAccessor::GetUnit(*this,owner_guid); + Unit* owner = ObjectAccessor::GetUnit(*this, owner_guid); if (owner) - owner->RemoveGameObject(this,false); + owner->RemoveGameObject(this, false); else { const char * ownerType = "creature"; @@ -144,9 +144,9 @@ void GameObject::RemoveFromWorld() if (uint64 owner_guid = GetOwnerGUID()) { if (Unit * owner = GetOwner()) - owner->RemoveGameObject(this,false); + owner->RemoveGameObject(this, false); else - sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.",GetGUIDLow(),GetGOInfo()->entry,GUID_LOPART(owner_guid)); + sLog->outError("Delete GameObject (GUID: %u Entry: %u) that have references in not found creature %u GO list. Crash possible later.", GetGUIDLow(), GetGOInfo()->entry, GUID_LOPART(owner_guid)); } WorldObject::RemoveFromWorld(); sObjectAccessor->RemoveObject(this); @@ -158,14 +158,14 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa ASSERT(map); SetMap(map); - Relocate(x,y,z,ang); + Relocate(x, y, z, ang); if (!IsPositionValid()) { - sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)",guidlow,name_id,x,y); + sLog->outError("Gameobject (GUID: %u Entry: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", guidlow, name_id, x, y); return false; } - SetPhaseMask(phaseMask,false); + SetPhaseMask(phaseMask, false); SetZoneScript(); if (m_zoneScript) @@ -178,7 +178,7 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa GameObjectTemplate const* goinfo = sObjectMgr->GetGameObjectTemplate(name_id); if (!goinfo) { - sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f",guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); + sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist entry in `gameobject_template`. Map: %u (X: %f Y: %f Z: %f) ang: %f rotation0: %f rotation1: %f rotation2: %f rotation3: %f", guidlow, name_id, map->GetId(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3); return false; } @@ -188,14 +188,14 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa if (goinfo->type >= MAX_GAMEOBJECT_TYPE) { - sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.",guidlow,name_id,goinfo->type); + sLog->outErrorDb("Gameobject (GUID: %u Entry: %u) not created: it have not exist GO type '%u' in `gameobject_template`. It's will crash client if created.", guidlow, name_id, goinfo->type); return false; } SetFloatValue(GAMEOBJECT_PARENTROTATION+0, rotation0); SetFloatValue(GAMEOBJECT_PARENTROTATION+1, rotation1); - UpdateRotationFields(rotation2,rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3 + UpdateRotationFields(rotation2, rotation3); // GAMEOBJECT_FACING, GAMEOBJECT_ROTATION, GAMEOBJECT_PARENTROTATION+2/3 SetFloatValue(OBJECT_FIELD_SCALE_X, goinfo->size); @@ -302,7 +302,7 @@ void GameObject::Update(uint32 diff) UpdateData udata; WorldPacket packet; - BuildValuesUpdateBlockForPlayer(&udata,caster->ToPlayer()); + BuildValuesUpdateBlockForPlayer(&udata, caster->ToPlayer()); udata.BuildPacket(&packet); caster->ToPlayer()->GetSession()->SendPacket(&packet); @@ -334,7 +334,7 @@ void GameObject::Update(uint32 diff) if (targetGuid == GetGUID()) // if linking self, never respawn (check delayed to next day) SetRespawnTime(DAY); else - m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5,MINUTE); // else copy time from master and add a little + m_respawnTime = (now > linkedRespawntime ? now : linkedRespawntime)+urand(5, MINUTE); // else copy time from master and add a little SaveRespawnTime(); // also save to DB immediately return; } @@ -352,7 +352,7 @@ void GameObject::Update(uint32 diff) { caster->FinishSpell(CURRENT_CHANNELED_SPELL); - WorldPacket data(SMSG_FISH_ESCAPED,0); + WorldPacket data(SMSG_FISH_ESCAPED, 0); caster->ToPlayer()->GetSession()->SendPacket(&data); } // can be delete @@ -629,12 +629,12 @@ void GameObject::getFishLoot(Loot *fishloot, Player* loot_owner) fishloot->clear(); uint32 zone, subzone; - GetZoneAndAreaId(zone,subzone); + GetZoneAndAreaId(zone, subzone); // if subzone loot exist use it if (!fishloot->FillLoot(subzone, LootTemplates_Fishing, loot_owner, true, true)) // else use zone loot (must exist in like case) - fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner,true); + fishloot->FillLoot(zone, LootTemplates_Fishing, loot_owner, true); } void GameObject::SaveToDB() @@ -687,8 +687,8 @@ void GameObject::SaveToDB(uint32 mapid, uint8 spawnMask, uint32 phaseMask) << m_DBTableGuid << ", " << GetEntry() << ", " << mapid << ", " - << uint32(spawnMask) << "," // cast to prevent save as symbol - << uint16(GetPhaseMask()) << "," // prevent out of range error + << uint32(spawnMask) << ", " // cast to prevent save as symbol + << uint16(GetPhaseMask()) << ", " // prevent out of range error << GetPositionX() << ", " << GetPositionY() << ", " << GetPositionZ() << ", " @@ -713,7 +713,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) if (!data) { - sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ",guid); + sLog->outErrorDb("Gameobject (GUID: %u) not found in table `gameobject`, can't load. ", guid); return false; } @@ -737,7 +737,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map) m_DBTableGuid = guid; if (map->GetInstanceId() != 0) guid = sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT); - if (!Create(guid,entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit)) + if (!Create(guid, entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit)) return false; if (data->spawntimesecs >= 0) @@ -838,7 +838,7 @@ Unit* GameObject::GetOwner() const void GameObject::SaveRespawnTime() { if (m_goData && m_goData->dbData && m_respawnTime > time(NULL) && m_spawnedByDefault) - sObjectMgr->SaveGORespawnTime(m_DBTableGuid,GetInstanceId(),m_respawnTime); + sObjectMgr->SaveGORespawnTime(m_DBTableGuid, GetInstanceId(), m_respawnTime); } bool GameObject::isAlwaysVisibleFor(WorldObject const* seer) const @@ -892,7 +892,7 @@ bool GameObject::ActivateToQuest(Player *pTarget) const //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 (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(),pTarget->GetTeam()))) + if (bg->GetTypeID(true) == BATTLEGROUND_AV && !(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(GetEntry(), pTarget->GetTeam()))) return false; return true; } @@ -947,8 +947,8 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target) Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; - Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target,trapEntry,range); - Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO,go_check); + Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range); + Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check); TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker); cell.Visit(p, object_checker, *GetMap(), *target, range); @@ -963,7 +963,7 @@ GameObject* GameObject::LookupFishingHoleAround(float range) { GameObject* ok = NULL; - CellPair p(Trinity::ComputeCellPair(GetPositionX(),GetPositionY())); + CellPair p(Trinity::ComputeCellPair(GetPositionX(), GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; Trinity::NearestGameObjectFishingHole u_check(*this, range); @@ -993,7 +993,7 @@ void GameObject::UseDoorOrButton(uint32 time_to_restore, bool alternative /* = f if (!time_to_restore) time_to_restore = GetGOInfo()->GetAutoCloseTime(); - SwitchDoorOrButton(true,alternative); + SwitchDoorOrButton(true, alternative); SetLootState(GO_ACTIVATED); m_cooldownTime = time(NULL) + time_to_restore; @@ -1161,7 +1161,7 @@ void GameObject::Use(Unit* user) if (itr != ChairListSlots.end()) { itr->second = player->GetGUID(); //this slot in now used by player - player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); + player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->chair.height); return; } @@ -1269,7 +1269,7 @@ void GameObject::Use(Unit* user) case GO_READY: // ready for loot { uint32 zone, subzone; - GetZoneAndAreaId(zone,subzone); + GetZoneAndAreaId(zone, subzone); int32 zone_skill = sObjectMgr->GetFishingBaseSkillLevel(subzone); if (!zone_skill) @@ -1277,23 +1277,23 @@ void GameObject::Use(Unit* user) //provide error, no fishable zone or area should be 0 if (!zone_skill) - sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.",subzone); + sLog->outErrorDb("Fishable areaId %u are not properly defined in `skill_fishing_base_level`.", subzone); int32 skill = player->GetSkillValue(SKILL_FISHING); int32 chance; if (skill < zone_skill) { - chance = int32(pow((double)skill/zone_skill,2) * 100); + chance = int32(pow((double)skill/zone_skill, 2) * 100); if (chance < 1) chance = 1; } else chance = 100; - int32 roll = irand(1,100); + int32 roll = irand(1, 100); - sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i",skill,zone_skill,chance,roll); + sLog->outStaticDebug("Fishing check (skill: %i zone min skill: %i chance %i roll: %i", skill, zone_skill, chance, roll); // but you will likely cause junk in areas that require a high fishing skill (not yet implemented) if (chance >= roll) @@ -1301,7 +1301,7 @@ void GameObject::Use(Unit* user) player->UpdateFishingSkill(); // prevent removing GO at spell cancel - player->RemoveGameObject(this,false); + player->RemoveGameObject(this, false); SetOwnerGUID(player->GetGUID()); //TODO: find reasonable value for fishing hole search @@ -1312,7 +1312,7 @@ void GameObject::Use(Unit* user) SetLootState(GO_JUST_DEACTIVATED); } else - player->SendLoot(GetGUID(),LOOT_FISHING); + player->SendLoot(GetGUID(), LOOT_FISHING); } // TODO: else: junk @@ -1571,7 +1571,7 @@ void GameObject::Use(Unit* user) Player* player = user->ToPlayer(); // fallback, will always work - player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(),TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); + player->TeleportTo(GetMapId(), GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET); WorldPacket data(SMSG_ENABLE_BARBER_SHOP, 0); player->GetSession()->SendPacket(&data); @@ -1592,7 +1592,7 @@ void GameObject::Use(Unit* user) if (!spellInfo) { if (user->GetTypeId() != TYPEID_PLAYER || !sOutdoorPvPMgr->HandleCustomSpell(user->ToPlayer(), spellId, this)) - sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId,GetEntry(),GetGoType()); + sLog->outError("WORLD: unknown spell id %u at use action for gameobject (Entry: %u GoType: %u)", spellId, GetEntry(), GetGoType()); else sLog->outDebug(LOG_FILTER_OUTDOORPVP, "WORLD: %u non-dbc spell was handled by OutdoorPvP", spellId); return; @@ -1648,7 +1648,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId) void GameObject::SendCustomAnim(uint32 anim) { - WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); + WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM, 8+4); data << GetGUID(); data << uint32(anim); SendMessageToSet(&data, true); diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h index 1055342944c..2941861ef9b 100755 --- a/src/server/game/Entities/GameObject/GameObject.h +++ b/src/server/game/Entities/GameObject/GameObject.h @@ -28,11 +28,11 @@ class GameObjectAI; -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif #define MAX_GAMEOBJECT_QUEST_ITEMS 6 @@ -636,11 +636,11 @@ class GameObject : public WorldObject, public GridObject<GameObject> void UpdateRotationFields(float rotation2 = 0.0f, float rotation3 = 0.0f); - void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId,language,TargetGuid); } - void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId,language,TargetGuid); } - void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId,TargetGuid); } - void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId,receiver); } - void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId,language,TargetGuid); } + void Say(int32 textId, uint32 language, uint64 TargetGuid) { MonsterSay(textId, language, TargetGuid); } + void Yell(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYell(textId, language, TargetGuid); } + void TextEmote(int32 textId, uint64 TargetGuid) { MonsterTextEmote(textId, TargetGuid); } + void Whisper(int32 textId, uint64 receiver) { MonsterWhisper(textId, receiver); } + void YellToZone(int32 textId, uint32 language, uint64 TargetGuid) { MonsterYellToZone(textId, language, TargetGuid); } // overwrite WorldObject function for proper name localization const char* GetNameForLocaleIdx(LocaleConstant locale_idx) const; @@ -792,7 +792,7 @@ class GameObject : public WorldObject, public GridObject<GameObject> std::set<uint32> m_unique_users; uint32 m_usetimes; - typedef std::map<uint32,uint64> ChairSlotAndUser; + typedef std::map<uint32, uint64> ChairSlotAndUser; ChairSlotAndUser ChairListSlots; uint32 m_DBTableGuid; ///< For new or temporary gameobjects is 0 for saved it is lowguid diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index f65d58b4101..2fc5ccca6ad 100755 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -26,7 +26,7 @@ #include "ScriptMgr.h" #include "ConditionMgr.h" -void AddItemsSetItem(Player* player,Item* item) +void AddItemsSetItem(Player* player, Item* item) { ItemTemplate const* proto = item->GetTemplate(); uint32 setid = proto->ItemSet; @@ -35,7 +35,7 @@ void AddItemsSetItem(Player* player,Item* item) if (!set) { - sLog->outErrorDb("Item set %u for item (id %u) not found, mods not applied.",setid,proto->ItemId); + sLog->outErrorDb("Item set %u for item (id %u) not found, mods not applied.", setid, proto->ItemId); return; } @@ -109,7 +109,7 @@ void AddItemsSetItem(Player* player,Item* item) } } -void RemoveItemsSetItem(Player*player,ItemTemplate const *proto) +void RemoveItemsSetItem(Player*player, ItemTemplate const *proto) { uint32 setid = proto->ItemSet; @@ -117,7 +117,7 @@ void RemoveItemsSetItem(Player*player,ItemTemplate const *proto) if (!set) { - sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.",setid,proto->ItemId); + sLog->outErrorDb("Item set #%u for item #%u not found, mods not removed.", setid, proto->ItemId); return; } @@ -152,7 +152,7 @@ void RemoveItemsSetItem(Player*player,ItemTemplate const *proto) if (eff->spells[z] && eff->spells[z]->Id == set->spells[x]) { // spell can be not active if not fit form requirement - player->ApplyEquipSpell(eff->spells[z],NULL,false); + player->ApplyEquipSpell(eff->spells[z], NULL, false); eff->spells[z]=NULL; break; } @@ -272,7 +272,7 @@ bool Item::Create(uint32 guidlow, uint32 itemid, Player const* owner) SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability); for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i) - SetSpellCharges(i,itemProto->Spells[i].SpellCharges); + SetSpellCharges(i, itemProto->Spells[i].SpellCharges); SetUInt32Value(ITEM_FIELD_DURATION, abs(itemProto->Duration)); SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, 0); @@ -293,7 +293,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff) if (!GetUInt32Value(ITEM_FIELD_DURATION)) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)",GetEntry(),GetUInt32Value(ITEM_FIELD_DURATION),diff); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Item::UpdateDuration Item (Entry: %u Duration %u Diff %u)", GetEntry(), GetUInt32Value(ITEM_FIELD_DURATION), diff); if (GetUInt32Value(ITEM_FIELD_DURATION) <= diff) { @@ -507,7 +507,7 @@ uint32 Item::GetSkill() const static uint32 item_armor_skills[MAX_ITEM_SUBCLASS_ARMOR] = { - 0,SKILL_CLOTH,SKILL_LEATHER,SKILL_MAIL,SKILL_PLATE_MAIL,0,SKILL_SHIELD,0,0,0,0 + 0, SKILL_CLOTH, SKILL_LEATHER, SKILL_MAIL, SKILL_PLATE_MAIL, 0, SKILL_SHIELD, 0, 0, 0, 0 }; ItemTemplate const* proto = GetTemplate(); @@ -585,7 +585,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id) // item can have not null only one from field values if ((itemProto->RandomProperty) && (itemProto->RandomSuffix)) { - sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0",itemProto->ItemId,itemProto->RandomProperty,itemProto->RandomSuffix); + sLog->outErrorDb("Item template %u have RandomProperty == %u and RandomSuffix == %u, but must have one from field =0", itemProto->ItemId, itemProto->RandomProperty, itemProto->RandomSuffix); return 0; } @@ -596,7 +596,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id) 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); + sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in 'ItemRandomProperties.dbc'", randomPropId); return 0; } @@ -609,7 +609,7 @@ int32 Item::GenerateItemRandomPropertyId(uint32 item_id) 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); + sLog->outErrorDb("Enchantment id #%u used but it doesn't have records in sItemRandomSuffixStore.", randomPropId); return 0; } @@ -629,11 +629,11 @@ void Item::SetItemRandomProperties(int32 randomPropId) { if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != int32(item_rand->ID)) { - SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID,item_rand->ID); + SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, item_rand->ID); SetState(ITEM_CHANGED, GetOwner()); } for (uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i) - SetEnchantment(EnchantmentSlot(i),item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2],0,0); + SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2], 0, 0); } } else @@ -644,13 +644,13 @@ void Item::SetItemRandomProperties(int32 randomPropId) if (GetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID) != -int32(item_rand->ID) || !GetItemSuffixFactor()) { - SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID,-int32(item_rand->ID)); + SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID, -int32(item_rand->ID)); UpdateItemSuffixFactor(); SetState(ITEM_CHANGED, GetOwner()); } for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_0 + 3; ++i) - SetEnchantment(EnchantmentSlot(i),item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0],0,0); + SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0); } } } @@ -753,7 +753,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const if (Player* owner = GetOwner()) { - if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK) + if (owner->CanUnequipItem(GetPos(), false) != EQUIP_ERR_OK) return false; if (owner->GetLootGUID() == GetGUID()) return false; @@ -881,9 +881,9 @@ void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint if ((GetEnchantmentId(slot) == id) && (GetEnchantmentDuration(slot) == duration) && (GetEnchantmentCharges(slot) == charges)) return; - SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET,id); - SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration); - SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges); + SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_ID_OFFSET, id); + SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET, duration); + SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET, charges); SetState(ITEM_CHANGED, GetOwner()); } @@ -892,7 +892,7 @@ void Item::SetEnchantmentDuration(EnchantmentSlot slot, uint32 duration, Player* if (GetEnchantmentDuration(slot) == duration) return; - SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET,duration); + SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_DURATION_OFFSET, duration); SetState(ITEM_CHANGED, owner); // Cannot use GetOwner() here, has to be passed as an argument to avoid freeze due to hashtable locking } @@ -902,7 +902,7 @@ void Item::SetEnchantmentCharges(EnchantmentSlot slot, uint32 charges) if (GetEnchantmentCharges(slot) == charges) return; - SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET,charges); + SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + ENCHANTMENT_CHARGES_OFFSET, charges); SetState(ITEM_CHANGED, GetOwner()); } @@ -1112,8 +1112,8 @@ void Item::SaveRefundDataToDB() { SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM item_refund_instance WHERE item_guid = '%u'", GetGUIDLow()); - trans->PAppend("INSERT INTO item_refund_instance (`item_guid`,`player_guid`,`paidMoney`,`paidExtendedCost`)" - " VALUES('%u','%u','%u','%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost()); + trans->PAppend("INSERT INTO item_refund_instance (`item_guid`, `player_guid`, `paidMoney`, `paidExtendedCost`)" + " VALUES('%u', '%u', '%u', '%u')", GetGUIDLow(), GetRefundRecipient(), GetPaidMoney(), GetPaidExtendedCost()); CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Entities/Item/Item.h b/src/server/game/Entities/Item/Item.h index 39ac95c209f..a584be963fc 100755 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -314,7 +314,7 @@ class Item : public Object // spell charges (signed but stored as unsigned) int32 GetSpellCharges(uint8 index/*0..5*/ = 0) const { return GetInt32Value(ITEM_FIELD_SPELL_CHARGES + index); } - void SetSpellCharges(uint8 index/*0..5*/, int32 value) { SetInt32Value(ITEM_FIELD_SPELL_CHARGES + index,value); } + void SetSpellCharges(uint8 index/*0..5*/, int32 value) { SetInt32Value(ITEM_FIELD_SPELL_CHARGES + index, value); } Loot loot; bool m_lootGenerated; diff --git a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp index a07fbe368cb..6dcf16935cc 100755 --- a/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp +++ b/src/server/game/Entities/Item/ItemEnchantmentMgr.cpp @@ -90,7 +90,7 @@ uint32 GetItemEnchantMod(int32 entry) EnchantmentStore::const_iterator tab = RandomItemEnch.find(entry); if (tab == RandomItemEnch.end()) { - sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.",entry); + sLog->outErrorDb("Item RandomProperty / RandomSuffix id #%u used in `item_template` but it does not have records in `item_enchantment_template` table.", entry); return 0; } diff --git a/src/server/game/Entities/Item/ItemPrototype.h b/src/server/game/Entities/Item/ItemPrototype.h index 6ba6a8eb94c..94c740de1f6 100755 --- a/src/server/game/Entities/Item/ItemPrototype.h +++ b/src/server/game/Entities/Item/ItemPrototype.h @@ -535,11 +535,11 @@ inline uint8 ItemSubClassToDurabilityMultiplierId(uint32 ItemClass, uint32 ItemS return 0; } -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct _Damage diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 7a79c526f1e..907d62ad5e8 100755 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -317,7 +317,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const } else { - if (flags3 & 0x8000) // probably x,y,z coords there + if (flags3 & 0x8000) // probably x, y, z coords there { *data << (float)0; *data << (float)0; @@ -1141,7 +1141,7 @@ void Object::RemoveByteFlag(uint16 index, uint8 offset, uint8 oldFlag) bool Object::PrintIndexError(uint32 index, bool set) const { - sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType); + sLog->outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u", (set ? "set value to" : "get value from"), index, m_valuesCount, GetTypeId(), m_objectType); // ASSERT must fail after function call return false; @@ -1349,15 +1349,15 @@ bool WorldObject::_IsWithinDist(WorldObject const* obj, float dist2compare, bool bool WorldObject::IsWithinLOSInMap(const WorldObject* obj) const { if (!IsInMap(obj)) return false; - float ox,oy,oz; - obj->GetPosition(ox,oy,oz); + float ox, oy, oz; + obj->GetPosition(ox, oy, oz); return(IsWithinLOS(ox, oy, oz)); } bool WorldObject::IsWithinLOS(float ox, float oy, float oz) const { - float x,y,z; - GetPosition(x,y,z); + float x, y, z; + GetPosition(x, y, z); VMAP::IVMapManager *vMapManager = VMAP::VMapFactory::createOrGetVMapManager(); return vMapManager->isInLineOfSight(GetMapId(), x, y, z+2.0f, ox, oy, oz+2.0f); } @@ -1571,40 +1571,40 @@ void WorldObject::GetRandomPoint(const Position &pos, float distance, float &ran Trinity::NormalizeMapCoord(rand_x); Trinity::NormalizeMapCoord(rand_y); - UpdateGroundPositionZ(rand_x,rand_y,rand_z); // update to LOS height if available + UpdateGroundPositionZ(rand_x, rand_y, rand_z); // update to LOS height if available } void WorldObject::UpdateGroundPositionZ(float x, float y, float &z) const { - float new_z = GetBaseMap()->GetHeight(x,y,z,true); + float new_z = GetBaseMap()->GetHeight(x, y, z, true); if (new_z > INVALID_HEIGHT) z = new_z+ 0.05f; // just to be sure that we are not a few pixel under the surface } bool Position::IsPositionValid() const { - return Trinity::IsValidMapCoord(m_positionX,m_positionY,m_positionZ,m_orientation); + return Trinity::IsValidMapCoord(m_positionX, m_positionY, m_positionZ, m_orientation); } void WorldObject::MonsterSay(const char* text, uint32 language, uint64 TargetGuid) { WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data,CHAT_MSG_MONSTER_SAY,text,language,GetName(),TargetGuid); - SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true); + BuildMonsterChat(&data, CHAT_MSG_MONSTER_SAY, text, language, GetName(), TargetGuid); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), true); } void WorldObject::MonsterYell(const char* text, uint32 language, uint64 TargetGuid) { WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,text,language,GetName(),TargetGuid); - SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true); + BuildMonsterChat(&data, CHAT_MSG_MONSTER_YELL, text, language, GetName(), TargetGuid); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), true); } void WorldObject::MonsterTextEmote(const char* text, uint64 TargetGuid, bool IsBossEmote) { WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data,IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE,text,LANG_UNIVERSAL,GetName(),TargetGuid); - SendMessageToSetInRange(&data,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true); + BuildMonsterChat(&data, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, text, LANG_UNIVERSAL, GetName(), TargetGuid); + SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true); } void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossWhisper) @@ -1614,7 +1614,7 @@ void WorldObject::MonsterWhisper(const char* text, uint64 receiver, bool IsBossW return; WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetName(),receiver); + BuildMonsterChat(&data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, text, LANG_UNIVERSAL, GetName(), receiver); player->GetSession()->SendPacket(&data); } @@ -1884,10 +1884,10 @@ namespace Trinity : i_object(obj), i_msgtype(msgtype), i_textId(textId), i_language(language), i_targetGUID(targetGUID) {} void operator()(WorldPacket& data, LocaleConstant loc_idx) { - char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx); // TODO: i_object.GetName() also must be localized? - i_object.BuildMonsterChat(&data,i_msgtype,text,i_language,i_object.GetNameForLocaleIdx(loc_idx),i_targetGUID); + i_object.BuildMonsterChat(&data, i_msgtype, text, i_language, i_object.GetNameForLocaleIdx(loc_idx), i_targetGUID); } private: @@ -1907,9 +1907,9 @@ void WorldObject::MonsterSay(int32 textId, uint32 language, uint64 TargetGuid) cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId,language,TargetGuid); + Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_SAY, textId, language, TargetGuid); Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); - Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY),say_do); + Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), say_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY)); } @@ -1922,16 +1922,16 @@ void WorldObject::MonsterYell(int32 textId, uint32 language, uint64 TargetGuid) cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); + Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId, language, TargetGuid); Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); - Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL),say_do); + Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL), say_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_YELL)); } void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 TargetGuid) { - Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId,language,TargetGuid); + Trinity::MonsterChatBuilder say_build(*this, CHAT_MSG_MONSTER_YELL, textId, language, TargetGuid); Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); uint32 zoneid = GetZoneId(); @@ -1950,9 +1950,9 @@ void WorldObject::MonsterTextEmote(int32 textId, uint64 TargetGuid, bool IsBossE cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId,LANG_UNIVERSAL,TargetGuid); + Trinity::MonsterChatBuilder say_build(*this, IsBossEmote ? CHAT_MSG_RAID_BOSS_EMOTE : CHAT_MSG_MONSTER_EMOTE, textId, LANG_UNIVERSAL, TargetGuid); Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> say_do(say_build); - Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this,sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),say_do); + Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> > say_worker(this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), say_do); TypeContainerVisitor<Trinity::PlayerDistWorker<Trinity::LocalizedPacketDo<Trinity::MonsterChatBuilder> >, WorldTypeMapContainer > message(say_worker); cell.Visit(p, message, *GetMap(), *this, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE)); } @@ -1967,7 +1967,7 @@ void WorldObject::MonsterWhisper(int32 textId, uint64 receiver, bool IsBossWhisp char const* text = sObjectMgr->GetTrinityString(textId, loc_idx); WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildMonsterChat(&data,IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER,text,LANG_UNIVERSAL,GetNameForLocaleIdx(loc_idx),receiver); + BuildMonsterChat(&data, IsBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, text, LANG_UNIVERSAL, GetNameForLocaleIdx(loc_idx), receiver); player->GetSession()->SendPacket(&data); } @@ -2060,7 +2060,7 @@ void WorldObject::AddObjectToRemoveList() Map* map = FindMap(); if (!map) { - sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId()); + sLog->outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).", GetTypeId(), GetEntry(), GetGUIDLow(), GetMapId()); return; } @@ -2196,7 +2196,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy pet->Relocate(x, y, z, ang); if (!pet->IsPositionValid()) { - sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)",pet->GetGUIDLow(),pet->GetEntry(),pet->GetPositionX(),pet->GetPositionY()); + sLog->outError("Pet (guidlow %d, entry %d) not summoned. Suggested coordinates isn't valid (X: %f Y: %f)", pet->GetGUIDLow(), pet->GetEntry(), pet->GetPositionX(), pet->GetPositionY()); delete pet; return NULL; } @@ -2215,7 +2215,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy pet->setPowerType(POWER_MANA); pet->SetUInt32Value(UNIT_NPC_FLAGS , 0); - pet->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + pet->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); pet->InitStatsForLevel(getLevel()); SetMinion(pet, true); @@ -2287,7 +2287,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float } 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)) + if (!go->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x, y, z, ang, rotation0, rotation1, rotation2, rotation3, 100, GO_STATE_READY)) { delete go; return NULL; @@ -2385,16 +2385,16 @@ namespace Trinity if (c == i_searcher || c == &i_object) return; - float x,y,z; + float x, y, z; if (!c->isAlive() || c->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED | UNIT_STAT_DISTRACTED) || - !c->GetMotionMaster()->GetDestination(x,y,z)) + !c->GetMotionMaster()->GetDestination(x, y, z)) { x = c->GetPositionX(); y = c->GetPositionY(); } - add(c,x,y); + add(c, x, y); } template<class T> @@ -2404,19 +2404,19 @@ namespace Trinity if (u == i_searcher || u == &i_object) return; - float x,y; + float x, y; x = u->GetPositionX(); y = u->GetPositionY(); - add(u,x,y); + add(u, x, y); } // we must add used pos that can fill places around center void add(WorldObject* u, float x, float y) const { // u is too nearest/far away to i_object - if (!i_object.IsInRange2d(x,y,i_selector.m_dist - i_selector.m_size,i_selector.m_dist + i_selector.m_size)) + if (!i_object.IsInRange2d(x, y, i_selector.m_dist - i_selector.m_size, i_selector.m_dist + i_selector.m_size)) return; float angle = i_object.GetAngle(u)-i_angle; @@ -2428,8 +2428,8 @@ namespace Trinity angle += 2.0f * M_PI; // dist include size of u - float dist2d = i_object.GetDistance2d(x,y); - i_selector.AddUsedPos(u->GetObjectSize(),angle,dist2d + i_object.GetObjectSize()); + float dist2d = i_object.GetDistance2d(x, y); + i_selector.AddUsedPos(u->GetObjectSize(), angle, dist2d + i_object.GetObjectSize()); } private: WorldObject const& i_object; @@ -2453,15 +2453,15 @@ void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float abs void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const { - GetNearPoint2D(x,y,distance2d+searcher_size,absAngle); + GetNearPoint2D(x, y, distance2d+searcher_size, absAngle); z = GetPositionZ(); - UpdateGroundPositionZ(x,y,z); + UpdateGroundPositionZ(x, y, z); /* // if detection disabled, return first point if (!sWorld->getIntConfig(CONFIG_DETECT_POS_COLLISION)) { - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available return; } @@ -2471,7 +2471,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float bool first_los_conflict = false; // first point LOS problems // prepare selector for work - ObjectPosSelector selector(GetPositionX(),GetPositionY(),GetObjectSize(),distance2d+searcher_size); + ObjectPosSelector selector(GetPositionX(), GetPositionY(), GetObjectSize(), distance2d+searcher_size); // adding used positions around object { @@ -2480,8 +2480,8 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float cell.data.Part.reserved = ALL_DISTRICT; cell.SetNoCreate(); - Trinity::NearUsedPosDo u_do(*this,searcher,absAngle,selector); - Trinity::WorldObjectWorker<Trinity::NearUsedPosDo> worker(this,u_do); + Trinity::NearUsedPosDo u_do(*this, searcher, absAngle, selector); + Trinity::WorldObjectWorker<Trinity::NearUsedPosDo> worker(this, u_do); TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::NearUsedPosDo>, GridTypeMapContainer > grid_obj_worker(worker); TypeContainerVisitor<Trinity::WorldObjectWorker<Trinity::NearUsedPosDo>, WorldTypeMapContainer > world_obj_worker(worker); @@ -2494,9 +2494,9 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float // maybe can just place in primary position if (selector.CheckOriginal()) { - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available - if (IsWithinLOS(x,y,z)) + if (IsWithinLOS(x, y, z)) return; first_los_conflict = true; // first point have LOS problems @@ -2507,11 +2507,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float // special case when one from list empty and then empty side preferred if (selector.FirstAngle(angle)) { - GetNearPoint2D(x,y,distance2d,absAngle+angle); + GetNearPoint2D(x, y, distance2d, absAngle+angle); z = GetPositionZ(); - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available - if (IsWithinLOS(x,y,z)) + if (IsWithinLOS(x, y, z)) return; } @@ -2521,11 +2521,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float // select in positions after current nodes (selection one by one) while (selector.NextAngle(angle)) // angle for free pos { - GetNearPoint2D(x,y,distance2d,absAngle+angle); + GetNearPoint2D(x, y, distance2d, absAngle+angle); z = GetPositionZ(); - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available - if (IsWithinLOS(x,y,z)) + if (IsWithinLOS(x, y, z)) return; } @@ -2537,7 +2537,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float x = first_x; y = first_y; - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available return; } @@ -2546,11 +2546,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float { if (!selector.FirstAngle(angle)) // _used_ pos { - GetNearPoint2D(x,y,distance2d,absAngle+angle); + GetNearPoint2D(x, y, distance2d, absAngle+angle); z = GetPositionZ(); - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available - if (IsWithinLOS(x,y,z)) + if (IsWithinLOS(x, y, z)) return; } } @@ -2561,11 +2561,11 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float // select in positions after current nodes (selection one by one) while (selector.NextUsedAngle(angle)) // angle for used pos but maybe without LOS problem { - GetNearPoint2D(x,y,distance2d,absAngle+angle); + GetNearPoint2D(x, y, distance2d, absAngle+angle); z = GetPositionZ(); - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available - if (IsWithinLOS(x,y,z)) + if (IsWithinLOS(x, y, z)) return; } @@ -2573,7 +2573,7 @@ void WorldObject::GetNearPoint(WorldObject const* /*searcher*/, float &x, float x = first_x; y = first_y; - UpdateGroundPositionZ(x,y,z); // update to LOS height if available + UpdateGroundPositionZ(x, y, z); // update to LOS height if available */ } @@ -2599,7 +2599,7 @@ void WorldObject::MovePositionToFirstCollision(Position &pos, float dist, float floor = GetMap()->GetHeight(destx, desty, pos.m_positionZ, true); destz = fabs(ground - pos.m_positionZ) <= fabs(floor - pos.m_positionZ) ? ground : floor; - bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(GetMapId(),pos.m_positionX,pos.m_positionY,pos.m_positionZ+0.5f,destx,desty,destz+0.5f,destx,desty,destz,-0.5f); + bool col = VMAP::VMapFactory::createOrGetVMapManager()->getObjectHitPos(GetMapId(), pos.m_positionX, pos.m_positionY, pos.m_positionZ+0.5f, destx, desty, destz+0.5f, destx, desty, destz, -0.5f); // collision occured if (col) @@ -2647,7 +2647,7 @@ void WorldObject::SetPhaseMask(uint32 newPhaseMask, bool update) void WorldObject::PlayDistanceSound(uint32 sound_id, Player* target /*= NULL*/) { - WorldPacket data(SMSG_PLAY_OBJECT_SOUND,4+8); + WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 4+8); data << uint32(sound_id); data << uint64(GetGUID()); if (target) diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index eba300feb43..13e8ca29970 100755 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -214,7 +214,7 @@ class Object void SetFloatValue(uint16 index, float value); void SetByteValue(uint16 index, uint8 offset, uint8 value); void SetUInt16Value(uint16 index, uint8 offset, uint16 value); - void SetInt16Value(uint16 index, uint8 offset, int16 value) { SetUInt16Value(index,offset,(uint16)value); } + void SetInt16Value(uint16 index, uint8 offset, int16 value) { SetUInt16Value(index, offset, (uint16)value); } void SetStatFloatValue(uint16 index, float value); void SetStatInt32Value(uint16 index, int32 value); @@ -271,21 +271,21 @@ class Object void ApplyModFlag(uint16 index, uint32 flag, bool apply) { - if (apply) SetFlag(index,flag); else RemoveFlag(index,flag); + if (apply) SetFlag(index, flag); else RemoveFlag(index, flag); } void SetFlag64(uint16 index, uint64 newFlag) { uint64 oldval = GetUInt64Value(index); uint64 newval = oldval | newFlag; - SetUInt64Value(index,newval); + SetUInt64Value(index, newval); } void RemoveFlag64(uint16 index, uint64 oldFlag) { uint64 oldval = GetUInt64Value(index); uint64 newval = oldval & ~oldFlag; - SetUInt64Value(index,newval); + SetUInt64Value(index, newval); } void ToggleFlag64(uint16 index, uint64 flag) @@ -304,7 +304,7 @@ class Object void ApplyModFlag64(uint16 index, uint64 flag, bool apply) { - if (apply) SetFlag64(index,flag); else RemoveFlag64(index,flag); + if (apply) SetFlag64(index, flag); else RemoveFlag64(index, flag); } void ClearUpdateMask(bool remove); @@ -503,7 +503,7 @@ struct MovementInfo MovementInfo() { - pos.Relocate(0,0,0,0); + pos.Relocate(0, 0, 0, 0); guid = 0; flags = 0; flags2 = 0; @@ -511,7 +511,7 @@ struct MovementInfo splineElevation = 0; pitch = j_zspeed = j_sinAngle = j_cosAngle = j_xyspeed = 0.0f; t_guid = 0; - t_pos.Relocate(0,0,0,0); + t_pos.Relocate(0, 0, 0, 0); t_seat = -1; } @@ -597,11 +597,11 @@ class WorldObject : public Object, public WorldLocation } void GetNearPoint2D(float &x, float &y, float distance, float absAngle) const; - void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d,float absAngle) const; + void GetNearPoint(WorldObject const* searcher, float &x, float &y, float &z, float searcher_size, float distance2d, float absAngle) const; void GetClosePoint(float &x, float &y, float &z, float size, float distance2d = 0, float angle = 0) const { // angle calculated from current orientation - GetNearPoint(NULL,x,y,z,size,distance2d,GetOrientation() + angle); + GetNearPoint(NULL, x, y, z, size, distance2d, GetOrientation() + angle); } void MovePosition(Position &pos, float dist, float angle); void GetNearPosition(Position &pos, float dist, float angle) @@ -624,7 +624,7 @@ class WorldObject : public Object, public WorldLocation void GetContactPoint(const WorldObject* obj, float &x, float &y, float &z, float distance2d = CONTACT_DISTANCE) const { // angle to face `obj` to `this` using distance includes size of `obj` - GetNearPoint(obj,x,y,z,obj->GetObjectSize(),distance2d,GetAngle(obj)); + GetNearPoint(obj, x, y, z, obj->GetObjectSize(), distance2d, GetAngle(obj)); } float GetObjectSize() const @@ -705,11 +705,11 @@ class WorldObject : public Object, public WorldLocation // use only if you will sure about placing both object at same map bool IsWithinDist(WorldObject const* obj, float dist2compare, bool is3D = true) const { - return obj && _IsWithinDist(obj,dist2compare,is3D); + return obj && _IsWithinDist(obj, dist2compare, is3D); } bool IsWithinDistInMap(WorldObject const* obj, float dist2compare, bool is3D = true) const { - return obj && IsInMap(obj) && _IsWithinDist(obj,dist2compare,is3D); + return obj && IsInMap(obj) && _IsWithinDist(obj, dist2compare, is3D); } bool IsWithinLOS(float x, float y, float z) const; bool IsWithinLOSInMap(const WorldObject* obj) const; @@ -717,7 +717,7 @@ class WorldObject : public Object, public WorldLocation bool IsInRange(WorldObject const* obj, float minRange, float maxRange, bool is3D = true) const; bool IsInRange2d(float x, float y, float minRange, float maxRange) const; bool IsInRange3d(float x, float y, float z, float minRange, float maxRange) const; - bool isInFront(WorldObject const* target,float distance, float arc = M_PI) const; + 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; diff --git a/src/server/game/Entities/Object/ObjectPosSelector.cpp b/src/server/game/Entities/Object/ObjectPosSelector.cpp index 84c59b3ae19..d7b8ede76f6 100755 --- a/src/server/game/Entities/Object/ObjectPosSelector.cpp +++ b/src/server/game/Entities/Object/ObjectPosSelector.cpp @@ -18,8 +18,8 @@ #include "ObjectPosSelector.h" -ObjectPosSelector::ObjectPosSelector(float x,float y,float size,float dist) -: m_center_x(x),m_center_y(y),m_size(size),m_dist(dist) +ObjectPosSelector::ObjectPosSelector(float x, float y, float size, float dist) +: m_center_x(x), m_center_y(y), m_size(size), m_dist(dist) { m_anglestep = acos(m_dist/(m_dist+2*m_size)); @@ -53,12 +53,12 @@ ObjectPosSelector::UsedPosList::value_type const* ObjectPosSelector::nextUsedPos return &*itr; } -void ObjectPosSelector::AddUsedPos(float size,float angle,float dist) +void ObjectPosSelector::AddUsedPos(float size, float angle, float dist) { if(angle>=0) - m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle,UsedPos(1.0,size,dist))); + m_UsedPosLists[USED_POS_PLUS].insert(UsedPosList::value_type(angle, UsedPos(1.0, size, dist))); else - m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle,UsedPos(-1.0,size,dist))); + m_UsedPosLists[USED_POS_MINUS].insert(UsedPosList::value_type(-angle, UsedPos(-1.0, size, dist))); } void ObjectPosSelector::InitializeAngle() @@ -76,9 +76,9 @@ void ObjectPosSelector::InitializeAngle() bool ObjectPosSelector::FirstAngle(float& angle) { if(m_UsedPosLists[USED_POS_PLUS].empty() && !m_UsedPosLists[USED_POS_MINUS].empty() ) - return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(),1.0,USED_POS_PLUS,angle); + return NextAngleFor(*m_UsedPosLists[USED_POS_MINUS].begin(), 1.0, USED_POS_PLUS, angle); else if(m_UsedPosLists[USED_POS_MINUS].empty() && !m_UsedPosLists[USED_POS_PLUS].empty() ) - return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(),-1.0,USED_POS_MINUS,angle); + return NextAngleFor(*m_UsedPosLists[USED_POS_PLUS].begin(), -1.0, USED_POS_MINUS, angle); return false; } @@ -118,9 +118,9 @@ bool ObjectPosSelector::NextPosibleAngle( float& angle ) { bool ok; if(m_smallStepOk[USED_POS_PLUS]) - ok = NextSmallStepAngle(1.0,USED_POS_PLUS,angle); + ok = NextSmallStepAngle(1.0, USED_POS_PLUS, angle); else - ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS],1.0,USED_POS_PLUS,angle); + ok = NextAngleFor(*m_nextUsedPos[USED_POS_PLUS], 1.0, USED_POS_PLUS, angle); if(!ok) ++m_nextUsedPos[USED_POS_PLUS]; // increase. only at fail (original or checked) @@ -131,9 +131,9 @@ bool ObjectPosSelector::NextPosibleAngle( float& angle ) { bool ok; if(m_smallStepOk[USED_POS_MINUS]) - ok = NextSmallStepAngle(-1.0,USED_POS_MINUS,angle); + ok = NextSmallStepAngle(-1.0, USED_POS_MINUS, angle); else - ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS],-1.0,USED_POS_MINUS,angle); + ok = NextAngleFor(*m_nextUsedPos[USED_POS_MINUS], -1.0, USED_POS_MINUS, angle); if(!ok) ++m_nextUsedPos[USED_POS_MINUS]; @@ -143,12 +143,12 @@ bool ObjectPosSelector::NextPosibleAngle( float& angle ) { if( m_smallStepOk[USED_POS_PLUS] && (!m_smallStepOk[USED_POS_MINUS] || m_smallStepAngle[USED_POS_PLUS] <= m_smallStepAngle[USED_POS_MINUS]) ) { - return NextSmallStepAngle(1.0,USED_POS_PLUS,angle); + return NextSmallStepAngle(1.0, USED_POS_PLUS, angle); } // -- direction less updated else if( m_smallStepOk[USED_POS_MINUS] ) { - return NextSmallStepAngle(-1.0,USED_POS_MINUS,angle); + return NextSmallStepAngle(-1.0, USED_POS_MINUS, angle); } } diff --git a/src/server/game/Entities/Object/ObjectPosSelector.h b/src/server/game/Entities/Object/ObjectPosSelector.h index a06047193a1..571f4b5f556 100755 --- a/src/server/game/Entities/Object/ObjectPosSelector.h +++ b/src/server/game/Entities/Object/ObjectPosSelector.h @@ -34,7 +34,7 @@ struct ObjectPosSelector { struct UsedPos { - UsedPos(float sign_, float size_,float dist_) : sign(sign_), size(size_),dist(dist_) {} + UsedPos(float sign_, float size_, float dist_) : sign(sign_), size(size_), dist(dist_) {} float sign; @@ -42,11 +42,11 @@ struct ObjectPosSelector float dist; // dist to central point (including central point size) }; - typedef std::multimap<float,UsedPos> UsedPosList; // abs(angle)->Node + typedef std::multimap<float, UsedPos> UsedPosList; // abs(angle)->Node - ObjectPosSelector(float x,float y,float size,float dist); + ObjectPosSelector(float x, float y, float size, float dist); - void AddUsedPos(float size,float angle,float dist); + void AddUsedPos(float size, float angle, float dist); void InitializeAngle(); bool FirstAngle(float& angle); @@ -68,8 +68,8 @@ struct ObjectPosSelector bool CheckOriginal() const { - return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_PLUS].begin(),1.0,0)) && - (m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_MINUS].begin(),-1.0,0)); + return (m_UsedPosLists[USED_POS_PLUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_PLUS].begin(), 1.0, 0)) && + (m_UsedPosLists[USED_POS_MINUS].empty() || CheckAngle( *m_UsedPosLists[USED_POS_MINUS].begin(), -1.0, 0)); } bool IsNonBalanced() const { return m_UsedPosLists[USED_POS_PLUS].empty() != m_UsedPosLists[USED_POS_MINUS].empty(); } diff --git a/src/server/game/Entities/Object/Updates/UpdateData.cpp b/src/server/game/Entities/Object/Updates/UpdateData.cpp index e4d78d65706..befd7da2705 100755 --- a/src/server/game/Entities/Object/Updates/UpdateData.cpp +++ b/src/server/game/Entities/Object/Updates/UpdateData.cpp @@ -31,7 +31,7 @@ UpdateData::UpdateData() : m_blockCount(0) void UpdateData::AddOutOfRangeGUID(std::set<uint64>& guids) { - m_outOfRangeGUIDs.insert(guids.begin(),guids.end()); + m_outOfRangeGUIDs.insert(guids.begin(), guids.end()); } void UpdateData::AddOutOfRangeGUID(const uint64 &guid) @@ -57,7 +57,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) int z_res = deflateInit(&c_stream, sWorld->getIntConfig(CONFIG_COMPRESSION)); if (z_res != Z_OK) { - sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflateInit) Error code: %i (%s)", z_res, zError(z_res)); *dst_size = 0; return; } @@ -70,7 +70,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) z_res = deflate(&c_stream, Z_NO_FLUSH); if (z_res != Z_OK) { - sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflate) Error code: %i (%s)", z_res, zError(z_res)); *dst_size = 0; return; } @@ -85,7 +85,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) z_res = deflate(&c_stream, Z_FINISH); if (z_res != Z_STREAM_END) { - sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflate should report Z_STREAM_END instead %i (%s)", z_res, zError(z_res)); *dst_size = 0; return; } @@ -93,7 +93,7 @@ void UpdateData::Compress(void* dst, uint32 *dst_size, void* src, int src_size) z_res = deflateEnd(&c_stream); if (z_res != Z_OK) { - sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)",z_res,zError(z_res)); + sLog->outError("Can't compress update packet (zlib: deflateEnd) Error code: %i (%s)", z_res, zError(z_res)); *dst_size = 0; return; } diff --git a/src/server/game/Entities/Pet/Pet.cpp b/src/server/game/Entities/Pet/Pet.cpp index 2be91237121..058175b63ae 100755 --- a/src/server/game/Entities/Pet/Pet.cpp +++ b/src/server/game/Entities/Pet/Pet.cpp @@ -124,13 +124,13 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND entry = '%u' AND (slot = '%u' OR slot > '%u') ", - ownerid, petentry,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT); + ownerid, petentry, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); else // any current or other non-stabled pet (for hunter "call pet") // 0 1 2(?) 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 result = CharacterDatabase.PQuery("SELECT id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType " "FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u') ", - ownerid,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT); + ownerid, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); if (!result) return false; @@ -212,7 +212,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c // this enables popup window (pet dismiss, cancel) break; case HUNTER_PET: - SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); //class=warrior,gender=none,power=focus + SetUInt32Value(UNIT_FIELD_BYTES_0, 0x02020100); //class=warrior, gender=none, power=focus SetSheath(SHEATH_STATE_MELEE); SetByteFlag(UNIT_FIELD_BYTES_2, 2, fields[9].GetBool() ? UNIT_CAN_BE_ABANDONED : UNIT_CAN_BE_RENAMED | UNIT_CAN_BE_ABANDONED); @@ -394,7 +394,7 @@ void Pet::SavePetToDB(PetSaveMode mode) CharacterDatabase.escape_string(name); SQLTransaction trans = CharacterDatabase.BeginTransaction(); // remove current data - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", owner,m_charmInfo->GetPetNumber()); + trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND id = '%u'", owner, m_charmInfo->GetPetNumber()); // prevent duplicate using slot (except PET_SAVE_NOT_IN_SLOT) if (mode <= PET_SAVE_LAST_STABLE_SLOT) @@ -404,7 +404,7 @@ void Pet::SavePetToDB(PetSaveMode mode) // prevent existence another hunter pet in PET_SAVE_AS_CURRENT and PET_SAVE_NOT_IN_SLOT if (getPetType() == HUNTER_PET && (mode == PET_SAVE_AS_CURRENT||mode > PET_SAVE_LAST_STABLE_SLOT)) trans->PAppend("DELETE FROM character_pet WHERE owner = '%u' AND (slot = '%u' OR slot > '%u')", - owner,PET_SAVE_AS_CURRENT,PET_SAVE_LAST_STABLE_SLOT); + owner, PET_SAVE_AS_CURRENT, PET_SAVE_LAST_STABLE_SLOT); // save pet std::ostringstream ss; ss << "INSERT INTO character_pet (id, entry, owner, modelid, level, exp, Reactstate, slot, name, renamed, curhealth, curmana, curhappiness, abdata, savetime, resettalents_cost, resettalents_time, CreatedBySpell, PetType) " @@ -682,7 +682,7 @@ bool Pet::CanTakeMoreActiveSpells(uint32 spellid) void Pet::Remove(PetSaveMode mode, bool returnreagent) { - m_owner->RemovePet(this,mode,returnreagent); + m_owner->RemovePet(this, mode, returnreagent); } void Pet::GivePetXP(uint32 xp) @@ -997,11 +997,11 @@ bool Guardian::InitStatsForLevel(uint8 petlevel) SetBonusDamage(int32(m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier)); // 14AP == 1dps, wolf's strike speed == 2s so dmg = basedmg + AP / 14 * 2 - SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE,float((petlevel * 4 - petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14))); - SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE,float((petlevel * 4 + petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14))); + SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel * 4 - petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14))); + SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel * 4 + petlevel) + (m_owner->GetTotalAttackPowerValue(BASE_ATTACK) * dmg_multiplier * 2 / 14))); SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(m_owner->GetArmor()) * 0.35f); // Bonus Armor (35% of player armor) - SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE,float(m_owner->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina) + SetModifierValue(UNIT_MOD_STAT_STAMINA, BASE_VALUE, float(m_owner->GetStat(STAT_STAMINA)) * 0.3f); // Bonus Stamina (30% of player stamina) if (!HasAura(58877))//prevent apply twice for the 2 wolves AddAura(58877, this);//Spirit Hunt, passive, Spirit Wolves' attacks heal them and their master for 150% of damage done. break; @@ -1080,7 +1080,7 @@ void Pet::_LoadSpellCooldowns() m_CreatureSpellCooldowns.clear(); m_CreatureCategoryCooldowns.clear(); - QueryResult result = CharacterDatabase.PQuery("SELECT spell,time FROM pet_spell_cooldown WHERE guid = '%u'",m_charmInfo->GetPetNumber()); + QueryResult result = CharacterDatabase.PQuery("SELECT spell, time FROM pet_spell_cooldown WHERE guid = '%u'", m_charmInfo->GetPetNumber()); if (result) { @@ -1099,7 +1099,7 @@ void Pet::_LoadSpellCooldowns() if (!sSpellStore.LookupEntry(spell_id)) { - sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.",m_charmInfo->GetPetNumber(),spell_id); + sLog->outError("Pet %u have unknown spell %u in `pet_spell_cooldown`, skipping.", m_charmInfo->GetPetNumber(), spell_id); continue; } @@ -1110,7 +1110,7 @@ void Pet::_LoadSpellCooldowns() data << uint32(spell_id); data << uint32(uint32(db_time-curTime)*IN_MILLISECONDS); - _AddCreatureSpellCooldown(spell_id,db_time); + _AddCreatureSpellCooldown(spell_id, db_time); sLog->outDebug(LOG_FILTER_PETS, "Pet (Number: %u) spell %u cooldown loaded (%u secs).", m_charmInfo->GetPetNumber(), spell_id, uint32(db_time-curTime)); } @@ -1134,7 +1134,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans) m_CreatureSpellCooldowns.erase(itr++); else { - trans->PAppend("INSERT INTO pet_spell_cooldown (guid,spell,time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second)); + trans->PAppend("INSERT INTO pet_spell_cooldown (guid, spell, time) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, uint32(itr->second)); ++itr; } } @@ -1142,7 +1142,7 @@ void Pet::_SaveSpellCooldowns(SQLTransaction& trans) void Pet::_LoadSpells() { - QueryResult result = CharacterDatabase.PQuery("SELECT spell,active FROM pet_spell WHERE guid = '%u'",m_charmInfo->GetPetNumber()); + QueryResult result = CharacterDatabase.PQuery("SELECT spell, active FROM pet_spell WHERE guid = '%u'", m_charmInfo->GetPetNumber()); if (result) { @@ -1174,10 +1174,10 @@ void Pet::_SaveSpells(SQLTransaction& trans) continue; case PETSPELL_CHANGED: trans->PAppend("DELETE FROM pet_spell WHERE guid = '%u' and spell = '%u'", m_charmInfo->GetPetNumber(), itr->first); - trans->PAppend("INSERT INTO pet_spell (guid,spell,active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); + trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); break; case PETSPELL_NEW: - trans->PAppend("INSERT INTO pet_spell (guid,spell,active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); + trans->PAppend("INSERT INTO pet_spell (guid, spell, active) VALUES ('%u', '%u', '%u')", m_charmInfo->GetPetNumber(), itr->first, itr->second.active); break; case PETSPELL_UNCHANGED: continue; @@ -1188,9 +1188,9 @@ void Pet::_SaveSpells(SQLTransaction& trans) void Pet::_LoadAuras(uint32 timediff) { - sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u",GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PETS, "Loading auras for pet %u", GetGUIDLow()); - QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber()); + QueryResult result = CharacterDatabase.PQuery("SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber()); if (result) { @@ -1217,7 +1217,7 @@ void Pet::_LoadAuras(uint32 timediff) SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid); if (!spellproto) { - sLog->outError("Unknown aura (spellid %u), ignore.",spellid); + sLog->outError("Unknown aura (spellid %u), ignore.", spellid); continue; } @@ -1246,7 +1246,7 @@ void Pet::_LoadAuras(uint32 timediff) aura->Remove(); continue; } - aura->SetLoadedState(maxduration,remaintime,remaincharges,stackcount,recalculatemask,&damage[0]); + aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]); aura->ApplyForTargets(); sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask); } @@ -1288,15 +1288,15 @@ void Pet::_SaveAuras(SQLTransaction& trans) } } - trans->PAppend("INSERT INTO pet_aura (guid,caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2,maxduration,remaintime,remaincharges) " + trans->PAppend("INSERT INTO pet_aura (guid, caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxduration, remaintime, remaincharges) " "VALUES ('%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%u')", m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(), itr->second->GetId(), effMask, recalculateMask, itr->second->GetStackAmount(), damage[0], damage[1], damage[2], baseDamage[0], baseDamage[1], baseDamage[2], - itr->second->GetMaxDuration(), itr->second->GetDuration(),itr->second->GetCharges()); + itr->second->GetMaxDuration(), itr->second->GetDuration(), itr->second->GetCharges()); } } -bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpellState state /*= PETSPELL_NEW*/, PetSpellType type /*= PETSPELL_NORMAL*/) +bool Pet::addSpell(uint32 spell_id, ActiveStates active /*= ACT_DECIDE*/, PetSpellState state /*= PETSPELL_NEW*/, PetSpellType type /*= PETSPELL_NORMAL*/) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); if (!spellInfo) @@ -1304,11 +1304,11 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel // do pet spell book cleanup if (state == PETSPELL_UNCHANGED) // spell load case { - sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.",spell_id); - CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'",spell_id); + sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request, deleting for all pets in `pet_spell`.", spell_id); + CharacterDatabase.PExecute("DELETE FROM pet_spell WHERE spell = '%u'", spell_id); } else - sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); + sLog->outError("Pet::addSpell: Non-existed in SpellStore spell #%u request.", spell_id); return false; } @@ -1366,7 +1366,7 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel // skip unknown ranks if (!HasSpell(rankSpellId)) continue; - removeSpell(rankSpellId,false,false); + removeSpell(rankSpellId, false, false); } } } @@ -1376,21 +1376,21 @@ bool Pet::addSpell(uint32 spell_id,ActiveStates active /*= ACT_DECIDE*/, PetSpel { if (itr2->second.state == PETSPELL_REMOVED) continue; - if (sSpellMgr->IsRankSpellDueToSpell(spellInfo,itr2->first)) + if (sSpellMgr->IsRankSpellDueToSpell(spellInfo, itr2->first)) { // replace by new high rank - if (sSpellMgr->IsHighRankOfSpell(spell_id,itr2->first)) + if (sSpellMgr->IsHighRankOfSpell(spell_id, itr2->first)) { newspell.active = itr2->second.active; if (newspell.active == ACT_ENABLED) ToggleAutocast(itr2->first, false); - unlearnSpell(itr2->first,false,false); + unlearnSpell(itr2->first, false, false); break; } // ignore new lesser rank - else if (sSpellMgr->IsHighRankOfSpell(itr2->first,spell_id)) + else if (sSpellMgr->IsHighRankOfSpell(itr2->first, spell_id)) return false; } } @@ -1445,7 +1445,7 @@ void Pet::InitLevelupSpellsForLevel() { // will called first if level down if (itr->first > level) - unlearnSpell(itr->second,true); // will learn prev rank if any + unlearnSpell(itr->second, true); // will learn prev rank if any // will called if level up else learnSpell(itr->second); // will unlearn prev rank if any @@ -1465,7 +1465,7 @@ void Pet::InitLevelupSpellsForLevel() // will called first if level down if (spellEntry->spellLevel > level) - unlearnSpell(spellEntry->Id,true); + unlearnSpell(spellEntry->Id, true); // will called if level up else learnSpell(spellEntry->Id); @@ -1475,7 +1475,7 @@ void Pet::InitLevelupSpellsForLevel() bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab) { - if (removeSpell(spell_id,learn_prev,clear_ab)) + if (removeSpell(spell_id, learn_prev, clear_ab)) { if (!m_loading) { @@ -1571,7 +1571,7 @@ bool Pet::resetTalents(bool no_cost) // not need after this call if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS)) - owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS,true); + owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true); CreatureTemplate const * ci = GetCreatureInfo(); if (!ci) @@ -1634,9 +1634,9 @@ bool Pet::resetTalents(bool no_cost) uint32 itrFirstId = sSpellMgr->GetFirstSpellInChain(itr->first); // unlearn if first rank is talent or learned by talent - if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId)) + if (itrFirstId == talentInfo->RankID[j] || sSpellMgr->IsSpellLearnToSpell(talentInfo->RankID[j], itrFirstId)) { - unlearnSpell(itr->first,false); + unlearnSpell(itr->first, false); itr = m_spells.begin(); continue; } @@ -1664,7 +1664,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) { // not need after this call if (owner->ToPlayer()->HasAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS)) - owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS,true); + owner->ToPlayer()->RemoveAtLoginFlag(AT_LOGIN_RESET_PET_TALENTS, true); // reset for online if (online_pet) @@ -1675,7 +1675,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) QueryResult resultPets = CharacterDatabase.PQuery( "SELECT id FROM character_pet WHERE owner = '%u' AND id <> '%u'", - owner->GetGUIDLow(),except_petnumber); + owner->GetGUIDLow(), except_petnumber); // no offline pets if (!resultPets) @@ -1684,7 +1684,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) QueryResult result = CharacterDatabase.PQuery( "SELECT DISTINCT pet_spell.spell FROM pet_spell, character_pet " "WHERE character_pet.owner = '%u' AND character_pet.id = pet_spell.guid AND character_pet.id <> %u", - owner->GetGUIDLow(),except_petnumber); + owner->GetGUIDLow(), except_petnumber); if (!result) return; @@ -1700,7 +1700,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) uint32 id = fields[0].GetUInt32(); if (need_comma) - ss << ","; + ss << ", "; ss << id; @@ -1721,7 +1721,7 @@ void Pet::resetTalentsForAllPetsOf(Player* owner, Pet* online_pet /*= NULL*/) continue; if (need_execute) - ss << ","; + ss << ", "; ss << spell; @@ -1855,7 +1855,7 @@ bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint3 ASSERT(map); SetMap(map); - SetPhaseMask(phaseMask,false); + SetPhaseMask(phaseMask, false); Object::_Create(guidlow, pet_number, HIGHGUID_PET); m_DBTableGuid = guidlow; diff --git a/src/server/game/Entities/Pet/Pet.h b/src/server/game/Entities/Pet/Pet.h index 299d050b3ca..0630aec7cca 100755 --- a/src/server/game/Entities/Pet/Pet.h +++ b/src/server/game/Entities/Pet/Pet.h @@ -138,9 +138,9 @@ class Pet : public Guardian 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 CreateBaseAtCreatureInfo(CreatureTemplate const* cinfo, Unit * owner); bool CreateBaseAtTamed(CreatureTemplate const * cinfo, Map * map, uint32 phaseMask); - bool LoadPetFromDB(Player* owner,uint32 petentry = 0,uint32 petnumber = 0, bool current = false); + bool LoadPetFromDB(Player* owner, uint32 petentry = 0, uint32 petnumber = 0, bool current = false); bool isBeingLoaded() const { return m_loading;} void SavePetToDB(PetSaveMode mode); void Remove(PetSaveMode mode, bool returnreagent = false); @@ -195,7 +195,7 @@ class Pet : public Guardian void _LoadSpells(); void _SaveSpells(SQLTransaction& trans); - bool addSpell(uint32 spell_id,ActiveStates active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL); + bool addSpell(uint32 spell_id, ActiveStates active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL); bool learnSpell(uint32 spell_id); void learnSpellHighRank(uint32 spellid); void InitLevelupSpellsForLevel(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 88381292182..4233ba7d677 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -79,11 +79,11 @@ #define SKILL_VALUE(x) PAIR32_LOPART(x) #define SKILL_MAX(x) PAIR32_HIPART(x) -#define MAKE_SKILL_VALUE(v, m) MAKE_PAIR32(v,m) +#define MAKE_SKILL_VALUE(v, m) MAKE_PAIR32(v, m) #define SKILL_TEMP_BONUS(x) int16(PAIR32_LOPART(x)) #define SKILL_PERM_BONUS(x) int16(PAIR32_HIPART(x)) -#define MAKE_SKILL_BONUS(t, p) MAKE_PAIR32(t,p) +#define MAKE_SKILL_BONUS(t, p) MAKE_PAIR32(t, p) enum CharacterFlags { @@ -216,7 +216,7 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, uint3 { ClearTaxiDestinations(); - Tokens tokens(values,' '); + Tokens tokens(values, ' '); for (Tokens::iterator iter = tokens.begin(); iter != tokens.end(); ++iter) { @@ -235,13 +235,13 @@ bool PlayerTaxi::LoadTaxiDestinationsFromString(const std::string& values, uint3 { uint32 cost; uint32 path; - sObjectMgr->GetTaxiPath(m_TaxiDestinations[i-1],m_TaxiDestinations[i],path,cost); + sObjectMgr->GetTaxiPath(m_TaxiDestinations[i-1], m_TaxiDestinations[i], path, cost); if (!path) return false; } // can't load taxi path without mount set (quest taxi path?) - if (!sObjectMgr->GetTaxiMountDisplayId(GetTaxiSource(),team,true)) + if (!sObjectMgr->GetTaxiMountDisplayId(GetTaxiSource(), team, true)) return false; return true; @@ -268,7 +268,7 @@ uint32 PlayerTaxi::GetCurrentTaxiPath() const uint32 path; uint32 cost; - sObjectMgr->GetTaxiPath(m_TaxiDestinations[0],m_TaxiDestinations[1],path,cost); + sObjectMgr->GetTaxiPath(m_TaxiDestinations[0], m_TaxiDestinations[1], path, cost); return path; } @@ -920,12 +920,12 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c for (uint8 i = 0; i < PLAYER_SLOTS_COUNT; i++) m_items[i] = NULL; - Relocate(info->positionX,info->positionY,info->positionZ,info->orientation); + Relocate(info->positionX, info->positionY, info->positionZ, info->orientation); ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(class_); if (!cEntry) { - sLog->outError("Class %u not found in DBC (Wrong DBC files?)",class_); + sLog->outError("Class %u not found in DBC (Wrong DBC files?)", class_); return false; } @@ -1002,46 +1002,46 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED)) { for (uint8 i=0; i<PLAYER_EXPLORED_ZONES_SIZE; i++) - SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF); + SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); } //Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way if (sWorld->getBoolConfig(CONFIG_START_ALL_REP)) { - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(936),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1011),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(970),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(967),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(989),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(932),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(934),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1038),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1077),42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(936), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1011), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(970), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(967), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(989), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(932), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(934), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1038), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1077), 42999); // Factions depending on team, like cities and some more stuff switch(GetTeam()) { case ALLIANCE: - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(72),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(47),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(69),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(930),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(730),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(978),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(54),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(946),42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(72), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(47), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(69), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(930), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(730), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(978), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(54), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(946), 42999); break; case HORDE: - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(76),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(68),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(81),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(911),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(729),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(941),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(530),42999); - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(947),42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(76), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(68), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(81), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(911), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(729), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(941), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(530), 42999); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(947), 42999); break; default: break; @@ -1066,7 +1066,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c if (getPowerType() == POWER_MANA) { UpdateMaxPower(POWER_MANA); // Update max Mana (for add bonus from intellect) - SetPower(POWER_MANA,GetMaxPower(POWER_MANA)); + SetPower(POWER_MANA, GetMaxPower(POWER_MANA)); } if (getPowerType() == POWER_RUNIC_POWER) @@ -1082,7 +1082,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c // original action bar for (PlayerCreateInfoActions::const_iterator action_itr = info->action.begin(); action_itr != info->action.end(); ++action_itr) - addActionButton(action_itr->button,action_itr->action, action_itr->type); + addActionButton(action_itr->button, action_itr->action, action_itr->type); // original items CharStartOutfitEntry const* oEntry = NULL; @@ -1149,7 +1149,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c InventoryResult msg = CanEquipItem(NULL_SLOT, eDest, pItem, false); if (msg == EQUIP_ERR_OK) { - RemoveItem(INVENTORY_SLOT_BAG_0, i,true); + RemoveItem(INVENTORY_SLOT_BAG_0, i, true); EquipItem(eDest, pItem, true); } // move other items to more appropriate slots (ammo not equipped in special bag) @@ -1159,7 +1159,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c msg = CanStoreItem(NULL_BAG, NULL_SLOT, sDest, pItem, false); if (msg == EQUIP_ERR_OK) { - RemoveItem(INVENTORY_SLOT_BAG_0, i,true); + RemoveItem(INVENTORY_SLOT_BAG_0, i, true); pItem = StoreItem(sDest, pItem, true); } @@ -1177,7 +1177,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) { - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Creating initial item, itemId = %u, count = %u",titem_id, titem_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: Creating initial item, itemId = %u, count = %u", titem_id, titem_amount); // attempt equip by one while (titem_amount > 0) @@ -1206,7 +1206,7 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount) } // item can't be added - sLog->outError("STORAGE: Can't equip or store initial item %u for race %u class %u , error msg = %u",titem_id,getRace(),getClass(),msg); + sLog->outError("STORAGE: Can't equip or store initial item %u for race %u class %u , error msg = %u", titem_id, getRace(), getClass(), msg); return false; } @@ -1251,7 +1251,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) damage-=absorb+resist; - DealDamageMods(this,damage,&absorb); + DealDamageMods(this, damage, &absorb); WorldPacket data(SMSG_ENVIRONMENTALDAMAGELOG, (21)); data << uint64(GetGUID()); @@ -1268,7 +1268,7 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage) if (type == DAMAGE_FALL) // DealDamage not apply item durability loss at self damage { sLog->outStaticDebug("We are fall to death, loosing 10 percents durability"); - DurabilityLossAll(0.10f,false); + DurabilityLossAll(0.10f, false); // durability lost message WorldPacket data2(SMSG_DURABILITY_DAMAGE_DEATH, 0); GetSession()->SendPacket(&data2); @@ -1462,7 +1462,7 @@ void Player::SetDrunkValue(uint16 newDrunkenValue, uint32 itemId) m_invisibilityDetect.AddValue(INVISIBILITY_DRUNK, int32(newDrunkenValue - m_drunk) / 256); m_drunk = newDrunkenValue; - SetUInt32Value(PLAYER_BYTES_3,(GetUInt32Value(PLAYER_BYTES_3) & 0xFFFF0001) | (m_drunk & 0xFFFE)); + SetUInt32Value(PLAYER_BYTES_3, (GetUInt32Value(PLAYER_BYTES_3) & 0xFFFF0001) | (m_drunk & 0xFFFE)); uint32 newDrunkenState = Player::GetDrunkenstateByValue(m_drunk); @@ -1574,13 +1574,13 @@ void Player::Update(uint32 p_time) if (Unit *pVictim = getVictim()) { // default combat reach 10 - // TODO add weapon,skill check + // TODO add weapon, skill check if (isAttackReady(BASE_ATTACK)) { if (!IsWithinMeleeRange(pVictim)) { - setAttackTimer(BASE_ATTACK,100); + setAttackTimer(BASE_ATTACK, 100); if (m_swingErrorMsg != 1) // send single time (client auto repeat) { SendAttackSwingNotInRange(); @@ -1590,7 +1590,7 @@ void Player::Update(uint32 p_time) //120 degrees of radiant range else if (!HasInArc(2*M_PI/3, pVictim)) { - setAttackTimer(BASE_ATTACK,100); + setAttackTimer(BASE_ATTACK, 100); if (m_swingErrorMsg != 2) // send single time (client auto repeat) { SendAttackSwingBadFacingAttack(); @@ -1604,7 +1604,7 @@ void Player::Update(uint32 p_time) // prevent base and off attack in same time, delay attack at 0.2 sec if (haveOffhandWeapon()) if (getAttackTimer(OFF_ATTACK) < ATTACK_DISPLAY_DELAY) - setAttackTimer(OFF_ATTACK,ATTACK_DISPLAY_DELAY); + setAttackTimer(OFF_ATTACK, ATTACK_DISPLAY_DELAY); // do attack AttackerStateUpdate(pVictim, BASE_ATTACK); @@ -1615,14 +1615,14 @@ void Player::Update(uint32 p_time) if (haveOffhandWeapon() && isAttackReady(OFF_ATTACK)) { if (!IsWithinMeleeRange(pVictim)) - setAttackTimer(OFF_ATTACK,100); + setAttackTimer(OFF_ATTACK, 100); else if (!HasInArc(2*M_PI/3, pVictim)) - setAttackTimer(OFF_ATTACK,100); + setAttackTimer(OFF_ATTACK, 100); else { // prevent base and off attack in same time, delay attack at 0.2 sec if (getAttackTimer(BASE_ATTACK) < ATTACK_DISPLAY_DELAY) - setAttackTimer(BASE_ATTACK,ATTACK_DISPLAY_DELAY); + setAttackTimer(BASE_ATTACK, ATTACK_DISPLAY_DELAY); // do attack AttackerStateUpdate(pVictim, OFF_ATTACK); @@ -1668,10 +1668,10 @@ void Player::Update(uint32 p_time) if (p_time >= m_zoneUpdateTimer) { uint32 newzone, newarea; - GetZoneAndAreaId(newzone,newarea); + GetZoneAndAreaId(newzone, newarea); if (m_zoneUpdateId != newzone) - UpdateZone(newzone,newarea); // also update area + UpdateZone(newzone, newarea); // also update area else { // use area updates as well @@ -1825,7 +1825,7 @@ void Player::setDeathState(DeathState s) GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_IN_DUNGEON, 1); - GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL,ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH); + GetAchievementMgr().ResetAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, ACHIEVEMENT_CRITERIA_CONDITION_NO_DEATH); } Unit::setDeathState(s); @@ -2160,7 +2160,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati if (!(options & TELE_TO_NOT_UNSUMMON_PET)) { //same map, only remove pet if out of range for new position - if (pet && !pet->IsWithinDist3d(x,y,z, GetMap()->GetVisibilityRange())) + if (pet && !pet->IsWithinDist3d(x, y, z, GetMap()->GetVisibilityRange())) UnsummonPetTemporaryIfAny(); } @@ -2736,7 +2736,7 @@ GameObject* Player::GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes bool Player::IsUnderWater() const { return IsInWater() && - GetPositionZ() < (GetBaseMap()->GetWaterLevel(GetPositionX(),GetPositionY())-2); + GetPositionZ() < (GetBaseMap()->GetWaterLevel(GetPositionX(), GetPositionY())-2); } void Player::SetInWater(bool apply) @@ -3040,11 +3040,11 @@ void Player::GiveLevel(uint8 level) if (Pet* pet = GetPet()) pet->SynchronizeLevelWithOwner(); - if (MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level,getRaceMask())) + if (MailLevelReward const* mailReward = sObjectMgr->GetMailLevelReward(level, getRaceMask())) { //- TODO: Poor design of mail system SQLTransaction trans = CharacterDatabase.BeginTransaction(); - MailDraft(mailReward->mailTemplateId).SendMailTo(trans, this,MailSender(MAIL_CREATURE,mailReward->senderEntry)); + MailDraft(mailReward->mailTemplateId).SendMailTo(trans, this, MailSender(MAIL_CREATURE, mailReward->senderEntry)); CharacterDatabase.CommitTransaction(trans); } @@ -3097,10 +3097,10 @@ void Player::InitStatsForLevel(bool reapplyMods) _RemoveAllStatBonuses(); PlayerClassLevelInfo classInfo; - sObjectMgr->GetPlayerClassLevelInfo(getClass(),getLevel(),&classInfo); + sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), &classInfo); PlayerLevelInfo info; - sObjectMgr->GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info); + sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), getLevel(), &info); SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)); SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr->GetXPForLevel(getLevel())); @@ -3114,7 +3114,7 @@ void Player::InitStatsForLevel(bool reapplyMods) SetFloatValue(UNIT_MOD_CAST_SPEED, 1.0f); // reset size before reapply auras - SetFloatValue(OBJECT_FIELD_SCALE_X,1.0f); + SetFloatValue(OBJECT_FIELD_SCALE_X, 1.0f); // save base values (bonuses already included in stored stats for (uint8 i = STAT_STRENGTH; i < MAX_STATS; ++i) @@ -3136,7 +3136,7 @@ void Player::InitStatsForLevel(bool reapplyMods) for (uint16 index = PLAYER_FIELD_COMBAT_RATING_1; index < PLAYER_FIELD_COMBAT_RATING_1 + MAX_COMBAT_RATING; ++index) SetUInt32Value(index, 0); - SetUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS,0); + SetUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, 0); for (uint8 i = 0; i < 7; ++i) { SetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i, 0); @@ -3158,15 +3158,15 @@ void Player::InitStatsForLevel(bool reapplyMods) SetInt32Value(UNIT_FIELD_ATTACK_POWER, 0); SetInt32Value(UNIT_FIELD_ATTACK_POWER_MODS, 0); - SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER,0.0f); + SetFloatValue(UNIT_FIELD_ATTACK_POWER_MULTIPLIER, 0.0f); SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER, 0); - SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS,0); - SetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER,0.0f); + SetInt32Value(UNIT_FIELD_RANGED_ATTACK_POWER_MODS, 0); + SetFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER, 0.0f); // Base crit values (will be recalculated in UpdateAllStats() at loading and in _ApplyAllStatBonuses() at reset - SetFloatValue(PLAYER_CRIT_PERCENTAGE,0.0f); - SetFloatValue(PLAYER_OFFHAND_CRIT_PERCENTAGE,0.0f); - SetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE,0.0f); + SetFloatValue(PLAYER_CRIT_PERCENTAGE, 0.0f); + SetFloatValue(PLAYER_OFFHAND_CRIT_PERCENTAGE, 0.0f); + SetFloatValue(PLAYER_RANGED_CRIT_PERCENTAGE, 0.0f); // Init spell schools (will be recalculated in UpdateAllStats() at loading and in _ApplyAllStatBonuses() at reset for (uint8 i = 0; i < 7; ++i) @@ -3191,12 +3191,12 @@ void Player::InitStatsForLevel(bool reapplyMods) SetResistanceBuffMods(SpellSchools(i), false, 0.0f); } - SetUInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,0); - SetUInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,0); + SetUInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, 0); + SetUInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE, 0); for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i) { - SetUInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,0); - SetFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER+i,0.0f); + SetUInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i, 0); + SetFloatValue(UNIT_FIELD_POWER_COST_MULTIPLIER+i, 0.0f); } // Reset no reagent cost field for (uint8 i = 0; i < 3; ++i) @@ -3223,7 +3223,7 @@ void Player::InitStatsForLevel(bool reapplyMods) UNIT_FLAG_SKINNABLE | UNIT_FLAG_MOUNT | UNIT_FLAG_TAXI_FLIGHT ); SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); // must be set - SetFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_REGENERATE_POWER);// must be set + SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_REGENERATE_POWER);// must be set // cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example. RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST | PLAYER_ALLOW_ONLY_ABILITY); @@ -3279,7 +3279,7 @@ void Player::SendInitialSpells() spellCount +=1; } - data.put<uint16>(countPos,spellCount); // write real count value + data.put<uint16>(countPos, spellCount); // write real count value uint16 spellCooldowns = m_spellCooldowns.size(); data << uint16(spellCooldowns); @@ -3399,25 +3399,25 @@ bool Player::AddTalent(uint32 spell_id, uint8 spec, bool learning) // do character spell book cleanup (all characters) if (!IsInWorld() && !learning) // spell load case { - sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.",spell_id); - CharacterDatabase.PExecute("DELETE FROM character_talent WHERE spell = '%u'",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spell_id); + CharacterDatabase.PExecute("DELETE FROM character_talent WHERE spell = '%u'", spell_id); } else - sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.", spell_id); return false; } - if (!SpellMgr::IsSpellValid(spellInfo,this,false)) + if (!SpellMgr::IsSpellValid(spellInfo, this, false)) { // do character spell book cleanup (all characters) if (!IsInWorld() && !learning) // spell load case { - sLog->outError("Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.",spell_id); - CharacterDatabase.PExecute("DELETE FROM character_talent WHERE spell = '%u'",spell_id); + sLog->outError("Player::addTalent: Broken spell #%u learning not allowed, deleting for all characters in `character_talent`.", spell_id); + CharacterDatabase.PExecute("DELETE FROM character_talent WHERE spell = '%u'", spell_id); } else - sLog->outError("Player::addTalent: Broken spell #%u learning not allowed.",spell_id); + sLog->outError("Player::addTalent: Broken spell #%u learning not allowed.", spell_id); return false; } @@ -3462,25 +3462,25 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // do character spell book cleanup (all characters) if (!IsInWorld() && !learning) // spell load case { - sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.",spell_id); - CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request, deleting for all characters in `character_spell`.", spell_id); + CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'", spell_id); } else - sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.",spell_id); + sLog->outError("Player::addSpell: Non-existed in SpellStore spell #%u request.", spell_id); return false; } - if (!SpellMgr::IsSpellValid(spellInfo,this,false)) + if (!SpellMgr::IsSpellValid(spellInfo, this, false)) { // do character spell book cleanup (all characters) if (!IsInWorld() && !learning) // spell load case { - sLog->outError("Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.",spell_id); - CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'",spell_id); + sLog->outError("Player::addSpell: Broken spell #%u learning not allowed, deleting for all characters in `character_spell`.", spell_id); + CharacterDatabase.PExecute("DELETE FROM character_spell WHERE spell = '%u'", spell_id); } else - sLog->outError("Player::addSpell: Broken spell #%u learning not allowed.",spell_id); + sLog->outError("Player::addSpell: Broken spell #%u learning not allowed.", spell_id); return false; } @@ -3545,7 +3545,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen if (active) { if (IsPassiveSpell(spell_id) && IsNeedCastPassiveSpellAtLearn(spellInfo)) - CastSpell (this,spell_id,true); + CastSpell (this, spell_id, true); } else if (IsInWorld()) { @@ -3615,7 +3615,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen if (!rankSpellId || rankSpellId == spell_id) continue; - removeSpell(rankSpellId,false,false); + removeSpell(rankSpellId, false, false); } } } @@ -3623,7 +3623,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen else if (uint32 prev_spell = sSpellMgr->GetPrevSpellInChain(spell_id)) { if (!IsInWorld() || disabled) // at spells loading, no output, but allow save - addSpell(prev_spell,active,true,true,disabled); + addSpell(prev_spell, active, true, true, disabled); else // at normal learning learnSpell(prev_spell, true); } @@ -3643,11 +3643,11 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen SpellEntry const *i_spellInfo = sSpellStore.LookupEntry(itr2->first); if (!i_spellInfo) continue; - if (sSpellMgr->IsRankSpellDueToSpell(spellInfo,itr2->first)) + if (sSpellMgr->IsRankSpellDueToSpell(spellInfo, itr2->first)) { if (itr2->second->active) { - if (sSpellMgr->IsHighRankOfSpell(spell_id,itr2->first)) + if (sSpellMgr->IsHighRankOfSpell(spell_id, itr2->first)) { if (IsInWorld()) // not send spell (re-/over-)learn packets at loading { @@ -3663,7 +3663,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen itr2->second->state = PLAYERSPELL_CHANGED; superceded_old = true; // new spell replace old in action bars and spell book. } - else if (sSpellMgr->IsHighRankOfSpell(itr2->first,spell_id)) + else if (sSpellMgr->IsHighRankOfSpell(itr2->first, spell_id)) { if (IsInWorld()) // not send spell (re-/over-)learn packets at loading { @@ -3694,7 +3694,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // cast talents with SPELL_EFFECT_LEARN_SPELL (other dependent spells will learned later as not auto-learned) // note: all spells with SPELL_EFFECT_LEARN_SPELL isn't passive - if (talentCost > 0 && IsSpellHaveEffect(spellInfo,SPELL_EFFECT_LEARN_SPELL)) + if (talentCost > 0 && IsSpellHaveEffect(spellInfo, SPELL_EFFECT_LEARN_SPELL)) { // ignore stance requirement for talent learn spell (stance set for spell only for client spell description show) CastSpell(this, spell_id, true); @@ -3705,7 +3705,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen if (IsNeedCastPassiveSpellAtLearn(spellInfo)) CastSpell(this, spell_id, true); } - else if (IsSpellHaveEffect(spellInfo,SPELL_EFFECT_SKILL_STEP)) + else if (IsSpellHaveEffect(spellInfo, SPELL_EFFECT_SKILL_STEP)) { CastSpell(this, spell_id, true); return false; @@ -3765,7 +3765,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // lockpicking/runeforging special case, not have ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL ((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)) { - switch(GetSkillRangeType(pSkill,_spell_idx->second->racemask != 0)) + switch(GetSkillRangeType(pSkill, _spell_idx->second->racemask != 0)) { case SKILL_RANGE_LANGUAGE: SetSkill(pSkill->id, GetSkillStep(pSkill->id), 300, 300); @@ -3792,7 +3792,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen if (!itr2->second.autoLearned) { if (!IsInWorld() || !itr2->second.active) // at spells loading, no output, but allow save - addSpell(itr2->second.spell,itr2->second.active,true,true,false); + addSpell(itr2->second.spell, itr2->second.active, true, true, false); else // at normal learning learnSpell(itr2->second.spell, true); } @@ -3803,11 +3803,11 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen // not ranked skills for (SkillLineAbilityMap::const_iterator _spell_idx = skill_bounds.first; _spell_idx != skill_bounds.second; ++_spell_idx) { - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE,_spell_idx->second->skillId); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,_spell_idx->second->skillId); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE, _spell_idx->second->skillId); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS, _spell_idx->second->skillId); } - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL,spell_id); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spell_id); } // return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell @@ -3860,7 +3860,7 @@ void Player::learnSpell(uint32 spell_id, bool dependent) bool disabled = (itr != m_spells.end()) ? itr->second->disabled : false; bool active = disabled ? itr->second->active : true; - bool learning = addSpell(spell_id,active,true,dependent,false); + bool learning = addSpell(spell_id, active, true, dependent, false); // prevent duplicated entires in spell book, also not send if not in world (loading) if (learning && IsInWorld()) @@ -3905,12 +3905,12 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) if (SpellChainNode const* node = sSpellMgr->GetSpellChainNode(spell_id)) { if (HasSpell(node->next) && !GetTalentSpellPos(node->next)) - removeSpell(node->next,disabled, false); + removeSpell(node->next, disabled, false); } //unlearn spells dependent from recently removed spells SpellsRequiringSpellMapBounds spellsRequiringSpell = sSpellMgr->GetSpellsRequiringSpellBounds(spell_id); for (SpellsRequiringSpellMap::const_iterator itr2 = spellsRequiringSpell.first; itr2 != spellsRequiringSpell.second; ++itr2) - removeSpell(itr2->second,disabled); + removeSpell(itr2->second, disabled); // re-search, it can be corrupted in prev loop itr = m_spells.find(spell_id); @@ -4074,7 +4074,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) // now re-learn if need re-activate if (cur_active && !prev_itr->second->active && learn_low_rank) { - if (addSpell(prev_id,true,false,prev_itr->second->dependent,prev_itr->second->disabled)) + if (addSpell(prev_id, true, false, prev_itr->second->dependent, prev_itr->second->disabled)) { // downgrade spell ranks in spellbook and action bar WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4); @@ -4220,7 +4220,7 @@ void Player::_LoadSpellCooldowns(PreparedQueryResult result) { // some cooldowns can be already set at aura loading... - //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,item,time FROM character_spell_cooldown WHERE guid = '%u'",GetGUIDLow()); + //QueryResult *result = CharacterDatabase.PQuery("SELECT spell, item, time FROM character_spell_cooldown WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -4270,13 +4270,13 @@ void Player::_SaveSpellCooldowns(SQLTransaction& trans) { if (first_round) { - ss << "INSERT INTO character_spell_cooldown (guid,spell,item,time) VALUES "; + ss << "INSERT INTO character_spell_cooldown (guid, spell, item, time) VALUES "; first_round = false; } // next new/changed record prefix else ss << ", "; - ss << "(" << GetGUIDLow() << "," << itr->first << "," << itr->second.itemid << "," << uint64(itr->second.end) << ")"; + ss << "(" << GetGUIDLow() << ", " << itr->first << ", " << itr->second.itemid << ", " << uint64(itr->second.end) << ")"; ++itr; } else @@ -4373,11 +4373,11 @@ bool Player::resetTalents(bool no_cost) // skip non-existant talent ranks if (talentInfo->RankID[rank] == 0) continue; - removeSpell(talentInfo->RankID[rank],true); + removeSpell(talentInfo->RankID[rank], true); if (const SpellEntry *_spellEntry = sSpellStore.LookupEntry(talentInfo->RankID[rank])) for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) // search through the SpellEntry for valid trigger spells if (_spellEntry->EffectTriggerSpell[i] > 0 && _spellEntry->Effect[i] == SPELL_EFFECT_LEARN_SPELL) - removeSpell(_spellEntry->EffectTriggerSpell[i],true); // and remove any spells that the talent teaches + removeSpell(_spellEntry->EffectTriggerSpell[i], true); // and remove any spells that the talent teaches // if this talent rank can be found in the PlayerTalentMap, mark the talent as removed so it gets deleted PlayerTalentMap::iterator plrTalent = m_talents[m_activeSpec]->find(talentInfo->RankID[rank]); if (plrTalent != m_talents[m_activeSpec]->end()) @@ -4403,12 +4403,12 @@ bool Player::resetTalents(bool no_cost) } //FIXME: remove pet before or after unlearn spells? for now after unlearn to allow removing of talent related, pet affecting auras - RemovePet(NULL,PET_SAVE_NOT_IN_SLOT, true); + RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); /* when prev line will dropped use next line if (Pet* pet = GetPet()) { if (pet->getPetType() == HUNTER_PET && !pet->GetCreatureInfo()->isTameable(CanTameExoticPets())) - RemovePet(NULL,PET_SAVE_NOT_IN_SLOT, true); + RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); } */ @@ -4418,7 +4418,7 @@ bool Player::resetTalents(bool no_cost) void Player::SetFreeTalentPoints(uint32 points) { sScriptMgr->OnPlayerFreeTalentPointsChanged(this, points); - SetUInt32Value(PLAYER_CHARACTER_POINTS1,points); + SetUInt32Value(PLAYER_CHARACTER_POINTS1, points); } Mail* Player::GetMail(uint32 id) @@ -4747,7 +4747,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC { SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Return back all mails with COD and Item 0 1 2 3 4 5 6 7 - QueryResult resultMail = CharacterDatabase.PQuery("SELECT id,messageType,mailTemplateId,sender,subject,body,money,has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", guid); + QueryResult resultMail = CharacterDatabase.PQuery("SELECT id, messageType, mailTemplateId, sender, subject, body, money, has_items FROM mail WHERE receiver='%u' AND has_items<>0 AND cod<>0", guid); if (resultMail) { do @@ -4777,7 +4777,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC MailDraft draft(subject, body); if (mailTemplateId) - draft = MailDraft(mailTemplateId,false); // items are already included + draft = MailDraft(mailTemplateId, false); // items are already included if (has_items) { @@ -4852,48 +4852,48 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC } while (resultFriends->NextRow()); } - trans->PAppend("DELETE FROM characters WHERE guid = '%u'",guid); + trans->PAppend("DELETE FROM characters WHERE guid = '%u'", guid); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_ACCOUNT_DATA); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_action WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_aura WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_gifts WHERE guid = '%u'",guid); + trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_action WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_aura WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_gifts WHERE guid = '%u'", guid); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_HOMEBIND); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_instance WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_inventory WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_queststatus WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_queststatus_rewarded WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_spell WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_spell_cooldown WHERE guid = '%u'",guid); + trans->PAppend("DELETE FROM character_instance WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_inventory WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_queststatus WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_queststatus_rewarded WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_spell WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_spell_cooldown WHERE guid = '%u'", guid); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_GM_TICKETS); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM item_instance WHERE owner_guid = '%u'",guid); - trans->PAppend("DELETE FROM character_social WHERE guid = '%u' OR friend='%u'",guid,guid); - trans->PAppend("DELETE FROM mail WHERE receiver = '%u'",guid); - trans->PAppend("DELETE FROM mail_items WHERE receiver = '%u'",guid); - trans->PAppend("DELETE FROM character_pet WHERE owner = '%u'",guid); - trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u'",guid); + trans->PAppend("DELETE FROM item_instance WHERE owner_guid = '%u'", guid); + trans->PAppend("DELETE FROM character_social WHERE guid = '%u' OR friend='%u'", guid, guid); + trans->PAppend("DELETE FROM mail WHERE receiver = '%u'", guid); + trans->PAppend("DELETE FROM mail_items WHERE receiver = '%u'", guid); + trans->PAppend("DELETE FROM character_pet WHERE owner = '%u'", guid); + trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u'", guid); trans->PAppend("DELETE FROM character_achievement WHERE guid = '%u' " // NOTE: These achievements have flags & 256 in DBC. "AND achievement NOT BETWEEN '456' AND '467' " // Realm First Level 80 "AND achievement NOT BETWEEN '1400' AND '1427' " // Realm First Raid Achievements "AND achievement NOT IN(1463, 3117, 3259) ", guid); // Realm First Northen Vanguard + Raid Achievements - trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_equipmentsets WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM guild_eventlog WHERE PlayerGuid1 = '%u' OR PlayerGuid2 = '%u'",guid, guid); - trans->PAppend("DELETE FROM guild_bank_eventlog WHERE PlayerGuid = '%u'",guid); + trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_equipmentsets WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM guild_eventlog WHERE PlayerGuid1 = '%u' OR PlayerGuid2 = '%u'", guid, guid); + trans->PAppend("DELETE FROM guild_bank_eventlog WHERE PlayerGuid = '%u'", guid); stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_PLAYER_BGDATA); stmt->setUInt32(0, guid); trans->Append(stmt); - trans->PAppend("DELETE FROM character_glyphs WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_talent WHERE guid = '%u'",guid); - trans->PAppend("DELETE FROM character_skills WHERE guid = '%u'",guid); + trans->PAppend("DELETE FROM character_glyphs WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_talent WHERE guid = '%u'", guid); + trans->PAppend("DELETE FROM character_skills WHERE guid = '%u'", guid); CharacterDatabase.CommitTransaction(trans); break; @@ -4938,7 +4938,7 @@ void Player::DeleteOldCharacters(uint32 keepDays) QueryResult resultChars = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Account FROM characters WHERE deleteDate IS NOT NULL AND deleteDate < '%u'", uint32(time(NULL) - time_t(keepDays * DAY))); if (resultChars) { - sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete",resultChars->GetRowCount()); + sLog->outString("Player::DeleteOldChars: Found " UI64FMTD " character(s) to delete", resultChars->GetRowCount()); do { Field *charFields = resultChars->Fetch(); @@ -4957,7 +4957,7 @@ void Player::SetMovement(PlayerMovementType pType) case MOVE_WATER_WALK: data.Initialize(SMSG_MOVE_WATER_WALK, GetPackGUID().size()+4); break; case MOVE_LAND_WALK: data.Initialize(SMSG_MOVE_LAND_WALK, GetPackGUID().size()+4); break; default: - sLog->outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.",pType); + sLog->outError("Player::SetMovement: Unsupported move type (%d), data not sent to client.", pType); return; } data.append(GetPackGUID()); @@ -5058,8 +5058,8 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness) // trigger update zone for alive state zone updates uint32 newzone, newarea; - GetZoneAndAreaId(newzone,newarea); - UpdateZone(newzone,newarea); + GetZoneAndAreaId(newzone, newarea); + UpdateZone(newzone, newarea); sOutdoorPvPMgr->HandlePlayerResurrects(this, newzone); if (InBattleground()) @@ -5241,7 +5241,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(pItem,percent); + DurabilityLoss(pItem, percent); if (inventory) { @@ -5250,7 +5250,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityLoss(pItem,percent); + DurabilityLoss(pItem, percent); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5259,7 +5259,7 @@ void Player::DurabilityLossAll(double percent, bool inventory) if (Bag* pBag = GetBagByPos(i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) if (Item* pItem = GetItemByPos(i, j)) - DurabilityLoss(pItem,percent); + DurabilityLoss(pItem, percent); } } @@ -5278,14 +5278,14 @@ void Player::DurabilityLoss(Item* item, double percent) if (pDurabilityLoss < 1) pDurabilityLoss = 1; - DurabilityPointsLoss(item,pDurabilityLoss); + DurabilityPointsLoss(item, pDurabilityLoss); } void Player::DurabilityPointsLossAll(int32 points, bool inventory) { for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; i++) if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(pItem,points); + DurabilityPointsLoss(pItem, points); if (inventory) { @@ -5294,7 +5294,7 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) for (uint8 i = INVENTORY_SLOT_ITEM_START; i < INVENTORY_SLOT_ITEM_END; i++) if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) - DurabilityPointsLoss(pItem,points); + DurabilityPointsLoss(pItem, points); // keys not have durability //for (int i = KEYRING_SLOT_START; i < KEYRING_SLOT_END; i++) @@ -5303,7 +5303,7 @@ void Player::DurabilityPointsLossAll(int32 points, bool inventory) if (Bag* pBag = (Bag*)GetItemByPos(INVENTORY_SLOT_BAG_0, i)) for (uint32 j = 0; j < pBag->GetBagSize(); j++) if (Item* pItem = GetItemByPos(i, j)) - DurabilityPointsLoss(pItem,points); + DurabilityPointsLoss(pItem, points); } } @@ -5322,13 +5322,13 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) { // modify item stats _before_ Durability set to 0 to pass _ApplyItemMods internal check if (pNewDurability == 0 && pOldDurability > 0 && item->IsEquipped()) - _ApplyItemMods(item,item->GetSlot(), false); + _ApplyItemMods(item, item->GetSlot(), false); item->SetUInt32Value(ITEM_FIELD_DURABILITY, pNewDurability); // modify item stats _after_ restore durability to pass _ApplyItemMods internal check if (pNewDurability > 0 && pOldDurability == 0 && item->IsEquipped()) - _ApplyItemMods(item,item->GetSlot(), true); + _ApplyItemMods(item, item->GetSlot(), true); item->SetState(ITEM_CHANGED, this); } @@ -5337,7 +5337,7 @@ void Player::DurabilityPointsLoss(Item* item, int32 points) void Player::DurabilityPointLossForEquipSlot(EquipmentSlots slot) { if (Item *pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, slot)) - DurabilityPointsLoss(pItem,1); + DurabilityPointsLoss(pItem, 1); } uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank) @@ -5345,14 +5345,14 @@ uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank) uint32 TotalCost = 0; // equipped, backpack, bags itself for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; i++) - TotalCost += DurabilityRepair(((INVENTORY_SLOT_BAG_0 << 8) | i),cost,discountMod, guildBank); + TotalCost += DurabilityRepair(((INVENTORY_SLOT_BAG_0 << 8) | i), cost, discountMod, guildBank); // bank, buyback and keys not repaired // items in inventory bags for (uint8 j = INVENTORY_SLOT_BAG_START; j < INVENTORY_SLOT_BAG_END; j++) for (uint8 i = 0; i < MAX_BAG_SIZE; i++) - TotalCost += DurabilityRepair(((j << 8) | i),cost,discountMod, guildBank); + TotalCost += DurabilityRepair(((j << 8) | i), cost, discountMod, guildBank); return TotalCost; } @@ -5392,7 +5392,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g return TotalCost; } - uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class,ditemProto->SubClass)]; + uint32 dmultiplier = dcost->multiplier[ItemSubClassToDurabilityMultiplierId(ditemProto->Class, ditemProto->SubClass)]; uint32 costs = uint32(LostDurability*dmultiplier*double(dQualitymodEntry->quality_mod)); costs = uint32(costs * discountMod * sWorld->getRate(RATE_REPAIRCOST)); @@ -5432,7 +5432,7 @@ uint32 Player::DurabilityRepair(uint16 pos, bool cost, float discountMod, bool g // reapply mods for total broken and repaired item if equipped if (IsEquipmentPos(pos) && !curDurability) - _ApplyItemMods(item,pos & 255, true); + _ApplyItemMods(item, pos & 255, true); return TotalCost; } @@ -5623,7 +5623,7 @@ void Player::UpdateDefense() { uint32 defense_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_DEFENSE); - if (UpdateSkill(SKILL_DEFENSE,defense_skill_gain)) + if (UpdateSkill(SKILL_DEFENSE, defense_skill_gain)) { // update dependent from defense skill part UpdateDefenseBonusesMod(); @@ -5865,8 +5865,8 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) case CR_HASTE_MELEE: { float RatingChange = value / GetRatingCoefficient(cr); - ApplyAttackTimePercentMod(BASE_ATTACK,RatingChange,apply); - ApplyAttackTimePercentMod(OFF_ATTACK,RatingChange,apply); + ApplyAttackTimePercentMod(BASE_ATTACK, RatingChange, apply); + ApplyAttackTimePercentMod(OFF_ATTACK, RatingChange, apply); break; } case CR_HASTE_RANGED: @@ -5878,7 +5878,7 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply) case CR_HASTE_SPELL: { float RatingChange = value / GetRatingCoefficient(cr); - ApplyCastTimePercentMod(RatingChange,apply); + ApplyCastTimePercentMod(RatingChange, apply); break; } default: @@ -6023,11 +6023,11 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step) if (new_value > max) new_value = max; - SetUInt32Value(valueIndex,MAKE_SKILL_VALUE(new_value,max)); + SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(new_value, max)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; UpdateSkillEnchantments(skill_id, value, new_value); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,skill_id); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skill_id); return true; } @@ -6090,17 +6090,17 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve case SKILL_LOCKPICKING: case SKILL_JEWELCRAFTING: case SKILL_INSCRIPTION: - return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); + return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator, gathering_skill_gain); case SKILL_SKINNING: if (sWorld->getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0) - return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); + return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator, gathering_skill_gain); else return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld->getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain); case SKILL_MINING: if (sWorld->getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0) - return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain); + return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator, gathering_skill_gain); else - return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld->getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain); + return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld->getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)), gathering_skill_gain); } return false; } @@ -6115,13 +6115,13 @@ bool Player::UpdateFishingSkill() uint32 gathering_skill_gain = sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING); - return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain); + return UpdateSkillPro(SKILL_FISHING, chance*10, gathering_skill_gain); } // levels sync. with spell requirement for skill levels to learn // bonus abilities in sSkillLineAbilityStore // Used only to avoid scan DBC at each skill grow -static uint32 bonusSkillLevels[] = {75,150,225,300,375,450}; +static uint32 bonusSkillLevels[] = {75, 150, 225, 300, 375, 450}; bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) { @@ -6148,7 +6148,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) if (!MaxValue || !SkillValue || SkillValue >= MaxValue) return false; - int32 Roll = irand(1,1000); + int32 Roll = irand(1, 1000); if (Roll <= Chance) { @@ -6156,7 +6156,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) if (new_value > MaxValue) new_value = MaxValue; - SetUInt32Value(valueIndex,MAKE_SKILL_VALUE(new_value,MaxValue)); + SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(new_value, MaxValue)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; for (uint32* bsl = &bonusSkillLevels[0]; *bsl; ++bsl) @@ -6168,7 +6168,7 @@ bool Player::UpdateSkillPro(uint16 SkillId, int32 Chance, uint32 step) } } UpdateSkillEnchantments(SkillId, SkillValue, new_value); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,SkillId); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, SkillId); sLog->outDebug(LOG_FILTER_PLAYER_SKILLS, "Player::UpdateSkillPro Chance=%3.1f%% taken", Chance/10.0); return true; } @@ -6199,18 +6199,18 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType) { case BASE_ATTACK: { - Item *tmpitem = GetWeaponForAttack(attType,true); + Item *tmpitem = GetWeaponForAttack(attType, true); if (!tmpitem) - UpdateSkill(SKILL_UNARMED,weapon_skill_gain); + UpdateSkill(SKILL_UNARMED, weapon_skill_gain); else if (tmpitem->GetTemplate()->SubClass != ITEM_SUBCLASS_WEAPON_FISHING_POLE) - UpdateSkill(tmpitem->GetSkill(),weapon_skill_gain); + UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain); break; } case OFF_ATTACK: case RANGED_ATTACK: { - Item *tmpitem = GetWeaponForAttack(attType,true); + Item *tmpitem = GetWeaponForAttack(attType, true); if (tmpitem) UpdateSkill(tmpitem->GetSkill(), weapon_skill_gain); break; @@ -6258,7 +6258,7 @@ void Player::UpdateCombatSkills(Unit *pVictim, WeaponAttackType attType, bool de return; } -void Player::ModifySkillBonus(uint32 skillid,int32 val, bool talent) +void Player::ModifySkillBonus(uint32 skillid, int32 val, bool talent) { SkillStatusMap::const_iterator itr = mSkillStatus.find(skillid); if (itr == mSkillStatus.end() || itr->second.uState == SKILL_DELETED) @@ -6271,9 +6271,9 @@ void Player::ModifySkillBonus(uint32 skillid,int32 val, bool talent) int16 perm_bonus = SKILL_PERM_BONUS(bonus_val); if (talent) // permanent bonus stored in high part - SetUInt32Value(bonusIndex,MAKE_SKILL_BONUS(temp_bonus,perm_bonus+val)); + SetUInt32Value(bonusIndex, MAKE_SKILL_BONUS(temp_bonus, perm_bonus+val)); else // temporary/item bonus stored in low part - SetUInt32Value(bonusIndex,MAKE_SKILL_BONUS(temp_bonus+val,perm_bonus)); + SetUInt32Value(bonusIndex, MAKE_SKILL_BONUS(temp_bonus+val, perm_bonus)); } void Player::UpdateSkillsForLevel() @@ -6293,7 +6293,7 @@ void Player::UpdateSkillsForLevel() if (!pSkill) continue; - if (GetSkillRangeType(pSkill,false) != SKILL_RANGE_LEVEL) + if (GetSkillRangeType(pSkill, false) != SKILL_RANGE_LEVEL) continue; uint32 valueIndex = PLAYER_SKILL_VALUE_INDEX(itr->second.pos); @@ -6307,13 +6307,13 @@ void Player::UpdateSkillsForLevel() /// maximize skill always if (alwaysMaxSkill) { - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(maxSkill,maxSkill)); + SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(maxSkill, maxSkill)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } else if (max != maxconfskill) /// update max skill value if current max skill not maximized { - SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(val,maxSkill)); + SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(val, maxSkill)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } @@ -6337,7 +6337,7 @@ void Player::UpdateSkillsToMaxSkillsForLevel() if (max > 1) { - SetUInt32Value(valueIndex,MAKE_SKILL_VALUE(max,max)); + SetUInt32Value(valueIndex, MAKE_SKILL_VALUE(max, max)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; } @@ -6368,24 +6368,24 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) // update step SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos), MAKE_PAIR32(id, step)); // update value - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos),MAKE_SKILL_VALUE(newVal,maxVal)); + SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos), MAKE_SKILL_VALUE(newVal, maxVal)); if (itr->second.uState != SKILL_NEW) itr->second.uState = SKILL_CHANGED; learnSkillRewardedSpells(id, newVal); // if skill value is going up, update enchantments after setting the new value if (newVal > currVal) UpdateSkillEnchantments(id, currVal, newVal); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL,id); - GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL,id); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); + GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); } else //remove { //remove enchantments needing this skill UpdateSkillEnchantments(id, currVal, 0); // clear skill fields - SetUInt32Value(PLAYER_SKILL_INDEX(itr->second.pos),0); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos),0); - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos),0); + SetUInt32Value(PLAYER_SKILL_INDEX(itr->second.pos), 0); + SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(itr->second.pos), 0); + SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(itr->second.pos), 0); // mark as deleted or simply remove from map if not saved yet if (itr->second.uState != SKILL_NEW) @@ -6414,7 +6414,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) } SetUInt32Value(PLAYER_SKILL_INDEX(i), MAKE_PAIR32(id, step)); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i),MAKE_SKILL_VALUE(newVal, maxVal)); + SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(i), MAKE_SKILL_VALUE(newVal, maxVal)); UpdateSkillEnchantments(id, currVal, newVal); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, id); GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, id); @@ -6429,7 +6429,7 @@ void Player::SetSkill(uint16 id, uint16 step, uint16 newVal, uint16 maxVal) mSkillStatus.insert(SkillStatusMap::value_type(id, SkillStatusData(i, SKILL_NEW))); // apply skill bonuses - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0); + SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i), 0); // temporary bonuses AuraEffectList const& mModSkill = GetAuraEffectsByType(SPELL_AURA_MOD_SKILL); @@ -6647,7 +6647,7 @@ ActionButton* Player::addActionButton(uint8 button, uint32 action, uint8 type) ActionButton& ab = m_actionButtons[button]; // set data and update to CHANGED if not NEW - ab.SetActionAndType(action,ActionButtonType(type)); + ab.SetActionAndType(action, ActionButtonType(type)); sLog->outDetail("Player '%u' Added Action '%u' (type %u) to Button '%u'", GetGUIDLow(), action, type, button); return &ab; @@ -6771,7 +6771,7 @@ void Player::CheckAreaExploreAndOutdoor() return; bool isOutdoor; - uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor); + uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(), GetPositionY(), GetPositionZ(), &isOutdoor); if (sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor) RemoveAurasWithAttribute(SPELL_ATTR0_OUTDOORS_ONLY); @@ -6782,7 +6782,7 @@ void Player::CheckAreaExploreAndOutdoor() if (offset >= PLAYER_EXPLORED_ZONES_SIZE) { - sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).",areaFlag,GetPositionX(),GetPositionY(),offset,offset, PLAYER_EXPLORED_ZONES_SIZE); + sLog->outError("Wrong area flag %u in map data for (X: %f Y: %f) point to field PLAYER_EXPLORED_ZONES_1 + %u ( %u must be < %u ).", areaFlag, GetPositionX(), GetPositionY(), offset, offset, PLAYER_EXPLORED_ZONES_SIZE); return; } @@ -6795,17 +6795,17 @@ void Player::CheckAreaExploreAndOutdoor() GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA); - AreaTableEntry const *p = GetAreaEntryByAreaFlagAndMap(areaFlag,GetMapId()); + AreaTableEntry const *p = GetAreaEntryByAreaFlagAndMap(areaFlag, GetMapId()); if (!p) { - sLog->outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(),GetPositionY(),GetMapId()); + sLog->outError("PLAYER: Player %u discovered unknown area (x: %f y: %f map: %u", GetGUIDLow(), GetPositionX(), GetPositionY(), GetMapId()); } else if (p->area_level > 0) { uint32 area = p->ID; if (getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - SendExplorationExperience(area,0); + SendExplorationExperience(area, 0); } else { @@ -6831,7 +6831,7 @@ void Player::CheckAreaExploreAndOutdoor() } GiveXP(XP, NULL); - SendExplorationExperience(area,XP); + SendExplorationExperience(area, XP); } sLog->outDetail("PLAYER: Player %u discovered a new area: %u", GetGUIDLow(), area); } @@ -7040,7 +7040,7 @@ void Player::UpdateHonorFields() // this is the first update today, reset today's contribution SetUInt32Value(PLAYER_FIELD_TODAY_CONTRIBUTION, 0); - SetUInt32Value(PLAYER_FIELD_KILLS, MAKE_PAIR32(0,kills_today)); + SetUInt32Value(PLAYER_FIELD_KILLS, MAKE_PAIR32(0, kills_today)); } else { @@ -7167,8 +7167,8 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt // victim_guid - for show victim name in log // victim_rank [1..4] HK: <dishonored rank> // victim_rank [5..19] HK: <alliance\horde rank> - // victim_rank [0,20+] HK: <> - WorldPacket data(SMSG_PVP_CREDIT,4+8+4); + // victim_rank [0, 20+] HK: <> + WorldPacket data(SMSG_PVP_CREDIT, 4+8+4); data << honor; data << victim_guid; data << victim_rank; @@ -7291,7 +7291,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) if (!zone) { // stored zone is zero, use generic and slow zone detection - result = CharacterDatabase.PQuery("SELECT map,position_x,position_y,position_z FROM characters WHERE guid='%u'", guidLow); + result = CharacterDatabase.PQuery("SELECT map, position_x, position_y, position_z FROM characters WHERE guid='%u'", guidLow); if (!result) return 0; fields = result->Fetch(); @@ -7300,7 +7300,7 @@ uint32 Player::GetZoneIdFromDB(uint64 guid) float posy = fields[2].GetFloat(); float posz = fields[3].GetFloat(); - zone = sMapMgr->GetZoneId(map,posx,posy,posz); + zone = sMapMgr->GetZoneId(map, posx, posy, posz); if (zone > 0) CharacterDatabase.PExecute("UPDATE characters SET zone='%u' WHERE guid='%u'", zone, guidLow); @@ -7404,7 +7404,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) { SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING); SetRestType(REST_TYPE_IN_CITY); - InnEnter(time(0),GetMapId(),0,0,0); + InnEnter(time(0), GetMapId(), 0, 0, 0); } pvpInfo.inNoPvPArea = true; } @@ -7509,7 +7509,7 @@ void Player::DuelComplete(DuelCompleteType type) data << uint8(type == DUEL_WON ? 0 : 1); // 0 = just won; 1 = fled data << duel->opponent->GetName(); data << GetName(); - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); } sScriptMgr->OnPlayerDuelEnd(duel->opponent, this, type); @@ -7550,7 +7550,7 @@ void Player::DuelComplete(DuelCompleteType type) //Remove Duel Flag object GameObject* obj = GetMap()->GetGameObject(GetUInt64Value(PLAYER_DUEL_ARBITER)); if (obj) - duel->initiator->RemoveGameObject(obj,true); + duel->initiator->RemoveGameObject(obj, true); /* remove auras */ AuraApplicationMap &itsAuras = duel->opponent->GetAppliedAuras(); @@ -7586,7 +7586,7 @@ void Player::DuelComplete(DuelCompleteType type) // Honor points after duel (the winner) - ImpConfig if (uint32 amount = sWorld->getIntConfig(CONFIG_HONOR_AFTER_DUEL)) - duel->opponent->RewardHonor(NULL,1,amount); + duel->opponent->RewardHonor(NULL, 1, amount); //cleanups SetUInt64Value(PLAYER_DUEL_ARBITER, 0); @@ -7602,7 +7602,7 @@ void Player::DuelComplete(DuelCompleteType type) //---------------------------------------------------------// -void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) +void Player::_ApplyItemMods(Item *item, uint8 slot, bool apply) { if (slot >= INVENTORY_SLOT_BAG_END || !item) return; @@ -7616,7 +7616,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) if (item->IsBroken()) return; - sLog->outDetail("applying mods for item %u ",item->GetGUIDLow()); + sLog->outDetail("applying mods for item %u ", item->GetGUIDLow()); uint8 attacktype = Player::GetAttackBySlot(slot); @@ -7624,14 +7624,14 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) CorrectMetaGemEnchants(slot, apply); if (attacktype < MAX_ATTACK) - _ApplyWeaponDependentAuraMods(item,WeaponAttackType(attacktype),apply); + _ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), apply); - _ApplyItemBonuses(proto,slot,apply); + _ApplyItemBonuses(proto, slot, apply); if (slot == EQUIPMENT_SLOT_RANGED) _ApplyAmmoBonuses(); - ApplyItemEquipSpell(item,apply); + ApplyItemEquipSpell(item, apply); ApplyEnchantment(item, apply); sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "_ApplyItemMods complete."); @@ -7980,7 +7980,7 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const *proto, ScalingSt UpdateDamagePhysical(attType); } -void Player::_ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply) +void Player::_ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply) { AuraEffectList const& auraCritList = GetAuraEffectsByType(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT); for (AuraEffectList::const_iterator itr = auraCritList.begin(); itr != auraCritList.end(); ++itr) @@ -8081,7 +8081,7 @@ void Player::ApplyItemEquipSpell(Item *item, bool apply, bool form_change) if (!spellproto) continue; - ApplyEquipSpell(spellproto,item,apply,form_change); + ApplyEquipSpell(spellproto, item, apply, form_change); } } @@ -8103,7 +8103,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply sLog->outStaticDebug("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id); - CastSpell(this,spellInfo,true,item); + CastSpell(this, spellInfo, true, item); } else { @@ -8115,7 +8115,7 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply } if (item) - RemoveAurasDueToItemSpell(item,spellInfo->Id); // un-apply all spells, not only at-equipped + RemoveAurasDueToItemSpell(item, spellInfo->Id); // un-apply all spells, not only at-equipped else RemoveAurasDueToSpell(spellInfo->Id); // un-apply spell (item set case) } @@ -8127,8 +8127,8 @@ void Player::UpdateEquipSpellsAtFormChange() { if (m_items[i] && !m_items[i]->IsBroken() && CanUseAttackType(GetAttackBySlot(i))) { - ApplyItemEquipSpell(m_items[i],false,true); // remove spells that not fit to form - ApplyItemEquipSpell(m_items[i],true,true); // add spells that fit form but not active + ApplyItemEquipSpell(m_items[i], false, true); // remove spells that not fit to form + ApplyItemEquipSpell(m_items[i], true, true); // add spells that fit form but not active } } @@ -8145,8 +8145,8 @@ void Player::UpdateEquipSpellsAtFormChange() if (!spellInfo) continue; - ApplyEquipSpell(spellInfo,NULL,false,true); // remove spells that not fit to form - ApplyEquipSpell(spellInfo,NULL,true,true); // add spells that fit form but not active + ApplyEquipSpell(spellInfo, NULL, false, true); // remove spells that not fit to form + ApplyEquipSpell(spellInfo, NULL, true, true); // add spells that fit form but not active } } } @@ -8158,7 +8158,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) { // If usable, try to cast item spell - if (Item * item = GetItemByPos(INVENTORY_SLOT_BAG_0,i)) + if (Item * item = GetItemByPos(INVENTORY_SLOT_BAG_0, i)) if (!item->IsBroken() && CanUseAttackType(attType)) if (ItemTemplate const *proto = item->GetTemplate()) { @@ -8290,7 +8290,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 } // Apply spell mods - ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance); + ApplySpellMod(pEnchant->spellid[s], SPELLMOD_CHANCE_OF_SUCCESS, chance); // Shiv has 100% chance to apply the poison if (FindCurrentSpellBySpellId(5938) && e_slot == TEMP_ENCHANTMENT_SLOT) @@ -8307,7 +8307,7 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32 } } -void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 cast_count, uint32 glyphIndex) +void Player::CastItemUseSpell(Item *item, SpellCastTargets const& targets, uint8 cast_count, uint32 glyphIndex) { ItemTemplate const* proto = item->GetTemplate(); // special learning case @@ -8319,12 +8319,12 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c SpellEntry const *spellInfo = sSpellStore.LookupEntry(learn_spell_id); if (!spellInfo) { - sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ",proto->ItemId, learn_spell_id); - SendEquipError(EQUIP_ERR_NONE,item,NULL); + sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring ", proto->ItemId, learn_spell_id); + SendEquipError(EQUIP_ERR_NONE, item, NULL); return; } - Spell *spell = new Spell(this, spellInfo,false); + Spell *spell = new Spell(this, spellInfo, false); spell->m_CastItem = item; spell->m_cast_count = cast_count; //set count of casts spell->SetSpellValue(SPELLVALUE_BASE_POINT0, learning_spell_id); @@ -8351,7 +8351,7 @@ void Player::CastItemUseSpell(Item *item,SpellCastTargets const& targets,uint8 c SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellData.SpellId); if (!spellInfo) { - sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring",proto->ItemId, spellData.SpellId); + sLog->outError("Player::CastItemUseSpell: Item (Entry: %u) in have wrong spell id %u, ignoring", proto->ItemId, spellData.SpellId); continue; } @@ -8408,7 +8408,7 @@ void Player::_RemoveAllItemMods() // item set bonuses not dependent from item broken state if (proto->ItemSet) - RemoveItemsSetItem(this,proto); + RemoveItemsSetItem(this, proto); if (m_items[i]->IsBroken() || !CanUseAttackType(GetAttackBySlot(i))) continue; @@ -8430,9 +8430,9 @@ void Player::_RemoveAllItemMods() uint32 attacktype = Player::GetAttackBySlot(i); if (attacktype < MAX_ATTACK) - _ApplyWeaponDependentAuraMods(m_items[i],WeaponAttackType(attacktype),false); + _ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), false); - _ApplyItemBonuses(proto,i, false); + _ApplyItemBonuses(proto, i, false); if (i == EQUIPMENT_SLOT_RANGED) _ApplyAmmoBonuses(); @@ -8459,9 +8459,9 @@ void Player::_ApplyAllItemMods() uint32 attacktype = Player::GetAttackBySlot(i); if (attacktype < MAX_ATTACK) - _ApplyWeaponDependentAuraMods(m_items[i],WeaponAttackType(attacktype),true); + _ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), true); - _ApplyItemBonuses(proto,i, true); + _ApplyItemBonuses(proto, i, true); if (i == EQUIPMENT_SLOT_RANGED) _ApplyAmmoBonuses(); @@ -8478,12 +8478,12 @@ void Player::_ApplyAllItemMods() // item set bonuses not dependent from item broken state if (proto->ItemSet) - AddItemsSetItem(this,m_items[i]); + AddItemsSetItem(this, m_items[i]); if (m_items[i]->IsBroken() || !CanUseAttackType(GetAttackBySlot(i))) continue; - ApplyItemEquipSpell(m_items[i],true); + ApplyItemEquipSpell(m_items[i], true); ApplyEnchantment(m_items[i], true); } } @@ -8504,7 +8504,7 @@ void Player::_ApplyAllLevelScaleItemMods(bool apply) if (!proto) continue; - _ApplyItemBonuses(proto,i, apply, true); + _ApplyItemBonuses(proto, i, apply, true); } } } @@ -8587,7 +8587,7 @@ void Player::RemovedInsignia(Player* looterPlr) // We have to convert player corpse to bones, not to be able to resurrect there // SpawnCorpseBones isn't handy, 'cos it saves player while he in BG - Corpse *bones = sObjectAccessor->ConvertCorpseForPlayer(GetGUID(),true); + Corpse *bones = sObjectAccessor->ConvertCorpseForPlayer(GetGUID(), true); if (!bones) return; @@ -8624,7 +8624,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) // not check distance for GO in case owned GO (fishing bobber case, for example) // And permit out of range GO with no owner in case fishing hole - if (!go || (loot_type != LOOT_FISHINGHOLE && (loot_type != LOOT_FISHING || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this,INTERACTION_DISTANCE)) || (loot_type == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault())) + if (!go || (loot_type != LOOT_FISHINGHOLE && (loot_type != LOOT_FISHING || go->GetOwnerGUID() != GetGUID()) && !go->IsWithinDistInMap(this, INTERACTION_DISTANCE)) || (loot_type == LOOT_CORPSE && go->GetRespawnTime() && go->isSpawnedByDefault())) { SendLootRelease(guid); return; @@ -8640,7 +8640,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) if ((go->GetEntry() == BG_AV_OBJECTID_MINE_N || go->GetEntry() == BG_AV_OBJECTID_MINE_S)) if (Battleground *bg = GetBattleground()) if (bg->GetTypeID(true) == BATTLEGROUND_AV) - if (!(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(go->GetEntry(),GetTeam()))) + if (!(((BattlegroundAV*)bg)->PlayerCanDoMineQuest(go->GetEntry(), GetTeam()))) { SendLootRelease(guid); return; @@ -8665,7 +8665,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) } if (loot_type == LOOT_FISHING) - go->getFishLoot(loot,this); + go->getFishLoot(loot, this); if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_CHEST && go->GetGOInfo()->chest.groupLootRules) { @@ -8738,16 +8738,16 @@ void Player::SendLoot(uint64 guid, LootType loot_type) switch (loot_type) { case LOOT_DISENCHANTING: - loot->FillLoot(item->GetTemplate()->DisenchantID, LootTemplates_Disenchant, this,true); + loot->FillLoot(item->GetTemplate()->DisenchantID, LootTemplates_Disenchant, this, true); break; case LOOT_PROSPECTING: - loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this,true); + loot->FillLoot(item->GetEntry(), LootTemplates_Prospecting, this, true); break; case LOOT_MILLING: - loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this,true); + loot->FillLoot(item->GetEntry(), LootTemplates_Milling, this, true); break; default: - loot->generateMoneyLoot(item->GetTemplate()->MinMoneyLoot,item->GetTemplate()->MaxMoneyLoot); + loot->generateMoneyLoot(item->GetTemplate()->MinMoneyLoot, item->GetTemplate()->MaxMoneyLoot); loot->FillLoot(item->GetEntry(), LootTemplates_Item, this, true, loot->gold != 0); break; } @@ -8788,7 +8788,7 @@ void Player::SendLoot(uint64 guid, LootType loot_type) Creature *creature = GetMap()->GetCreature(guid); // must be in range and creature must be alive for pickpocket and must be dead for another loot - if (!creature || creature->isAlive() != (loot_type == LOOT_PICKPOCKETING) || !creature->IsWithinDistInMap(this,INTERACTION_DISTANCE)) + if (!creature || creature->isAlive() != (loot_type == LOOT_PICKPOCKETING) || !creature->IsWithinDistInMap(this, INTERACTION_DISTANCE)) { SendLootRelease(guid); return; @@ -9590,7 +9590,7 @@ uint32 Player::GetXPRestBonus(uint32 xp) SetRestBonus(GetRestBonus() - rested_bonus); - sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f",xp+rested_bonus,rested_bonus,GetRestBonus()); + sLog->outDetail("Player gain %u xp (+ %u Rested Bonus). Rested points=%f", xp+rested_bonus, rested_bonus, GetRestBonus()); return rested_bonus; } @@ -9644,10 +9644,10 @@ void Player::SetVirtualItemSlot(uint8 i, Item* item) if (charges == 0) return; if (charges > 1) - item->SetEnchantmentCharges(TEMP_ENCHANTMENT_SLOT,charges-1); + item->SetEnchantmentCharges(TEMP_ENCHANTMENT_SLOT, charges-1); else if (charges <= 1) { - ApplyEnchantment(item,TEMP_ENCHANTMENT_SLOT,false); + ApplyEnchantment(item, TEMP_ENCHANTMENT_SLOT, false); item->ClearEnchantment(TEMP_ENCHANTMENT_SLOT); } } @@ -9658,25 +9658,25 @@ void Player::SetSheath(SheathState sheathed) switch (sheathed) { case SHEATH_STATE_UNARMED: // no prepared weapon - SetVirtualItemSlot(0,NULL); - SetVirtualItemSlot(1,NULL); - SetVirtualItemSlot(2,NULL); + SetVirtualItemSlot(0, NULL); + SetVirtualItemSlot(1, NULL); + SetVirtualItemSlot(2, NULL); break; case SHEATH_STATE_MELEE: // prepared melee weapon { - SetVirtualItemSlot(0,GetWeaponForAttack(BASE_ATTACK,true)); - SetVirtualItemSlot(1,GetWeaponForAttack(OFF_ATTACK,true)); - SetVirtualItemSlot(2,NULL); + SetVirtualItemSlot(0, GetWeaponForAttack(BASE_ATTACK, true)); + SetVirtualItemSlot(1, GetWeaponForAttack(OFF_ATTACK, true)); + SetVirtualItemSlot(2, NULL); }; break; case SHEATH_STATE_RANGED: // prepared ranged weapon - SetVirtualItemSlot(0,NULL); - SetVirtualItemSlot(1,NULL); - SetVirtualItemSlot(2,GetWeaponForAttack(RANGED_ATTACK,true)); + SetVirtualItemSlot(0, NULL); + SetVirtualItemSlot(1, NULL); + SetVirtualItemSlot(2, GetWeaponForAttack(RANGED_ATTACK, true)); break; default: - SetVirtualItemSlot(0,NULL); - SetVirtualItemSlot(1,NULL); - SetVirtualItemSlot(2,NULL); + SetVirtualItemSlot(0, NULL); + SetVirtualItemSlot(1, NULL); + SetVirtualItemSlot(2, NULL); break; } Unit::SetSheath(sheathed); // this must visualize Sheath changing for other players... @@ -10412,13 +10412,13 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const for (uint8 i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i) { pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory,TotemCategory)) + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = KEYRING_SLOT_START; i < CURRENCYTOKEN_SLOT_END; ++i) { pItem = GetUseableItemByPos(INVENTORY_SLOT_BAG_0, i); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory,TotemCategory)) + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i) @@ -10428,7 +10428,7 @@ bool Player::HasItemTotemCategory(uint32 TotemCategory) const for (uint32 j = 0; j < pBag->GetBagSize(); ++j) { pItem = GetUseableItemByPos(i, j); - if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory,TotemCategory)) + if (pItem && IsTotemCategoryCompatiableWith(pItem->GetTemplate()->TotemCategory, TotemCategory)) return true; } } @@ -10479,7 +10479,7 @@ InventoryResult Player::_CanStoreItem_InSpecificSlot(uint8 bag, uint8 slot, Item if (slot >= pBagProto->ContainerSlots) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; - if (!ItemCanGoIntoBag(pProto,pBagProto)) + if (!ItemCanGoIntoBag(pProto, pBagProto)) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; } @@ -10532,7 +10532,7 @@ InventoryResult Player::_CanStoreItem_InBag(uint8 bag, ItemPosCountVec &dest, It if (non_specialized != (pBagProto->Class == ITEM_CLASS_CONTAINER && pBagProto->SubClass == ITEM_SUBCLASS_CONTAINER)) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; - if (!ItemCanGoIntoBag(pProto,pBagProto)) + if (!ItemCanGoIntoBag(pProto, pBagProto)) return EQUIP_ERR_ITEM_DOESNT_GO_INTO_BAG; for (uint32 j = 0; j < pBag->GetBagSize(); j++) @@ -10663,7 +10663,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de // check count of items (skip for auto move for same player from bank) uint32 no_similar_count = 0; // can't store this amount similar items - InventoryResult res = _CanTakeMoreSimilarItems(entry,count,pItem,&no_similar_count); + InventoryResult res = _CanTakeMoreSimilarItems(entry, count, pItem, &no_similar_count); if (res != EQUIP_ERR_OK) { if (count == no_similar_count) @@ -10678,7 +10678,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de // in specific slot if (bag != NULL_BAG && slot != NULL_SLOT) { - res = _CanStoreItem_InSpecificSlot(bag,slot,dest,pProto,count,swap,pItem); + res = _CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10707,7 +10707,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de { if (bag == INVENTORY_SLOT_BAG_0) // inventory { - res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,true,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10725,7 +10725,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10746,9 +10746,9 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de else // equipped bag { // we need check 2 time (specialized/non_specialized), use NULL_BAG to prevent skipping bag - res = _CanStoreItem_InBag(bag,dest,pProto,count,true,false,pItem,NULL_BAG,slot); + res = _CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = _CanStoreItem_InBag(bag,dest,pProto,count,true,true,pItem,NULL_BAG,slot); + res = _CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10776,7 +10776,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_START+keyringSize,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10794,7 +10794,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10814,7 +10814,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10833,7 +10833,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de } } - res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10853,9 +10853,9 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de } else // equipped bag { - res = _CanStoreItem_InBag(bag,dest,pProto,count,false,false,pItem,NULL_BAG,slot); + res = _CanStoreItem_InBag(bag, dest, pProto, count, false, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = _CanStoreItem_InBag(bag,dest,pProto,count,false,true,pItem,NULL_BAG,slot); + res = _CanStoreItem_InBag(bag, dest, pProto, count, false, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) { @@ -10881,7 +10881,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de // search stack for merge to if (pProto->Stackable != 1) { - res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,true,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10899,7 +10899,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de return EQUIP_ERR_CANT_CARRY_MORE_OF_THIS; } - res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10921,7 +10921,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de { for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,true,false,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -10939,7 +10939,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,true,true,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -10961,7 +10961,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de if (pProto->BagFamily & BAG_FAMILY_MASK_KEYS) { uint32 keyringSize = GetMaxKeyringSize(); - res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START,KEYRING_SLOT_START+keyringSize,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(KEYRING_SLOT_START, KEYRING_SLOT_START+keyringSize, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -10981,7 +10981,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de } else if (pProto->BagFamily & BAG_FAMILY_MASK_CURRENCY_TOKENS) { - res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START,CURRENCYTOKEN_SLOT_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(CURRENCYTOKEN_SLOT_START, CURRENCYTOKEN_SLOT_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11002,7 +11002,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de for (uint32 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,false,false,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11022,7 +11022,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de return EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG; // search free slot - res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START,INVENTORY_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) { if (no_space_count) @@ -11042,7 +11042,7 @@ InventoryResult Player::_CanStoreItem(uint8 bag, uint8 slot, ItemPosCountVec &de for (uint8 i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11246,7 +11246,7 @@ InventoryResult Player::CanStoreItems(Item** pItems, int count) const // not plain container check if (pBagProto && (pBagProto->Class != ITEM_CLASS_CONTAINER || pBagProto->SubClass != ITEM_SUBCLASS_CONTAINER) && - ItemCanGoIntoBag(pProto,pBagProto)) + ItemCanGoIntoBag(pProto, pBagProto)) { for (uint32 j = 0; j < pBag->GetBagSize(); j++) { @@ -11439,7 +11439,7 @@ InventoryResult Player::CanEquipItem(uint8 slot, uint16 &dest, Item *pItem, bool Item *offItem = GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND); ItemPosCountVec off_dest; if (offItem && (!not_loading || - CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND,false) != EQUIP_ERR_OK || + CanUnequipItem(uint16(INVENTORY_SLOT_BAG_0) << 8 | EQUIPMENT_SLOT_OFFHAND, false) != EQUIP_ERR_OK || CanStoreItem(NULL_BAG, NULL_SLOT, off_dest, offItem, false) != EQUIP_ERR_OK)) return swap ? EQUIP_ERR_ITEMS_CANT_BE_SWAPPED : EQUIP_ERR_INVENTORY_FULL; } @@ -11542,7 +11542,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest return res; } - res = _CanStoreItem_InSpecificSlot(bag,slot,dest,pProto,count,swap,pItem); + res = _CanStoreItem_InSpecificSlot(bag, slot, dest, pProto, count, swap, pItem); if (res != EQUIP_ERR_OK) return res; @@ -11563,7 +11563,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { if (bag == INVENTORY_SLOT_BAG_0) { - res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11572,9 +11572,9 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } else { - res = _CanStoreItem_InBag(bag,dest,pProto,count,true,false,pItem,NULL_BAG,slot); + res = _CanStoreItem_InBag(bag, dest, pProto, count, true, false, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) - res = _CanStoreItem_InBag(bag,dest,pProto,count,true,true,pItem,NULL_BAG,slot); + res = _CanStoreItem_InBag(bag, dest, pProto, count, true, true, pItem, NULL_BAG, slot); if (res != EQUIP_ERR_OK) return res; @@ -11587,7 +11587,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest // search free slot in bag if (bag == INVENTORY_SLOT_BAG_0) { - res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11614,7 +11614,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest if (pProto->Stackable != 1) { // in slots - res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,true,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11626,7 +11626,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,true,false,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, true, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11637,7 +11637,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,true,true,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, true, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11651,7 +11651,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest { for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,false,false,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, false, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11661,7 +11661,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest } // search free space - res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START,BANK_SLOT_ITEM_END,dest,pProto,count,false,pItem,bag,slot); + res = _CanStoreItem_InInventorySlots(BANK_SLOT_ITEM_START, BANK_SLOT_ITEM_END, dest, pProto, count, false, pItem, bag, slot); if (res != EQUIP_ERR_OK) return res; @@ -11670,7 +11670,7 @@ InventoryResult Player::CanBankItem(uint8 bag, uint8 slot, ItemPosCountVec &dest for (uint8 i = BANK_SLOT_BAG_START; i < BANK_SLOT_BAG_END; i++) { - res = _CanStoreItem_InBag(i,dest,pProto,count,false,true,pItem,bag,slot); + res = _CanStoreItem_InBag(i, dest, pProto, count, false, true, pItem, bag, slot); if (res != EQUIP_ERR_OK) continue; @@ -11892,11 +11892,11 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update) if (itr == dest.end()) { - lastItem = _StoreItem(pos,pItem,count,false,update); + lastItem = _StoreItem(pos, pItem, count, false, update); break; } - lastItem = _StoreItem(pos,pItem,count,true,update); + lastItem = _StoreItem(pos, pItem, count, true, update); } GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_OWN_ITEM, entry); return lastItem; @@ -12270,7 +12270,7 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update) // Common operation need to remove item from inventory without delete in trade, auction, guild bank, mail.... void Player::MoveItemFromInventory(uint8 bag, uint8 slot, bool update) { - if (Item* it = GetItemByPos(bag,slot)) + if (Item* it = GetItemByPos(bag, slot)) { ItemRemovedQuestCheck(it->GetEntry(), it->GetCount()); RemoveItem(bag, slot, update); @@ -12612,13 +12612,13 @@ void Player::DestroyItemCount(Item* pItem, uint32 &count, bool update) if (!pItem) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(),pItem->GetEntry(), count); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: DestroyItemCount item (GUID: %u, Entry: %u) count = %u", pItem->GetGUIDLow(), pItem->GetEntry(), count); if (pItem->GetCount() <= count) { count -= pItem->GetCount(); - DestroyItem(pItem->GetBagSlot(),pItem->GetSlot(), update); + DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), update); } else { @@ -13237,7 +13237,7 @@ void Player::SendBuyError(BuyResult msg, Creature* pCreature, uint32 item, uint3 void Player::SendSellError(SellResult msg, Creature* pCreature, uint64 guid, uint32 param) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SELL_ITEM"); - WorldPacket data(SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10 + WorldPacket data(SMSG_SELL_ITEM, (8+8+(param?4:0)+1)); // last check 2.0.10 data << uint64(pCreature ? pCreature->GetGUID() : 0); data << uint64(guid); if (param > 0) @@ -13310,7 +13310,7 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) if (m_itemDuration.empty()) return; - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Player::UpdateItemDuration(%u,%u)", time, realtimeonly); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Player::UpdateItemDuration(%u, %u)", time, realtimeonly); for (ItemDurationList::const_iterator itr = m_itemDuration.begin(); itr != m_itemDuration.end();) { @@ -13318,13 +13318,13 @@ void Player::UpdateItemDuration(uint32 time, bool realtimeonly) ++itr; // current element can be erased in UpdateDuration if ((realtimeonly && item->GetTemplate()->Duration < 0) || !realtimeonly) - item->UpdateDuration(this,time); + item->UpdateDuration(this, time); } } void Player::UpdateEnchantTime(uint32 time) { - for (EnchantDurationList::iterator itr = m_enchantDuration.begin(),next; itr != m_enchantDuration.end(); itr=next) + for (EnchantDurationList::iterator itr = m_enchantDuration.begin(), next; itr != m_enchantDuration.end(); itr=next) { ASSERT(itr->item); next = itr; @@ -13420,7 +13420,7 @@ void Player::RemoveArenaEnchantments(EnchantmentSlot slot) } // duration == 0 will remove item enchant -void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 duration) +void Player::AddEnchantmentDuration(Item *item, EnchantmentSlot slot, uint32 duration) { if (!item) return; @@ -13444,7 +13444,7 @@ void Player::AddEnchantmentDuration(Item *item,EnchantmentSlot slot,uint32 durat } } -void Player::ApplyEnchantment(Item *item,bool apply) +void Player::ApplyEnchantment(Item *item, bool apply) { for (uint32 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot) ApplyEnchantment(item, EnchantmentSlot(slot), apply); @@ -13579,39 +13579,39 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool } } - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Adding %u to stat nb %u",enchant_amount,enchant_spell_id); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "Adding %u to stat nb %u", enchant_amount, enchant_spell_id); switch (enchant_spell_id) { case ITEM_MOD_MANA: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u MANA", enchant_amount); HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_HEALTH: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u HEALTH", enchant_amount); HandleStatModifier(UNIT_MOD_HEALTH, BASE_VALUE, float(enchant_amount), apply); break; case ITEM_MOD_AGILITY: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u AGILITY",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u AGILITY", enchant_amount); HandleStatModifier(UNIT_MOD_STAT_AGILITY, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_AGILITY, (float)enchant_amount, apply); break; case ITEM_MOD_STRENGTH: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STRENGTH",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STRENGTH", enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STRENGTH, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STRENGTH, (float)enchant_amount, apply); break; case ITEM_MOD_INTELLECT: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u INTELLECT",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u INTELLECT", enchant_amount); HandleStatModifier(UNIT_MOD_STAT_INTELLECT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_INTELLECT, (float)enchant_amount, apply); break; case ITEM_MOD_SPIRIT: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPIRIT",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u SPIRIT", enchant_amount); HandleStatModifier(UNIT_MOD_STAT_SPIRIT, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_SPIRIT, (float)enchant_amount, apply); break; case ITEM_MOD_STAMINA: - sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STAMINA",enchant_amount); + sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "+ %u STAMINA", enchant_amount); HandleStatModifier(UNIT_MOD_STAT_STAMINA, TOTAL_VALUE, float(enchant_amount), apply); ApplyStatBuffMod(STAT_STAMINA, (float)enchant_amount, apply); break; @@ -14068,7 +14068,7 @@ void Player::SendPreparedGossip(WorldObject *pSource) if (pSource->GetTypeId() == TYPEID_UNIT) { // in case no gossip flag and quest menu not empty, open quest menu (client expect gossip menu with this flag) - if (!pSource->ToCreature()->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_GOSSIP) && !PlayerTalkClass->GetQuestMenu().Empty()) + if (!pSource->ToCreature()->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && !PlayerTalkClass->GetQuestMenu().Empty()) { SendPreparedQuest(pSource->GetGUID()); return; @@ -14147,7 +14147,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me break; case GOSSIP_OPTION_SPIRITHEALER: if (isDead()) - pSource->ToCreature()->CastSpell((pSource->ToCreature()),17251,true,NULL,NULL,GetGUID()); + pSource->ToCreature()->CastSpell((pSource->ToCreature()), 17251, true, NULL, NULL, GetGUID()); break; case GOSSIP_OPTION_QUESTGIVER: PrepareQuestMenu(guid); @@ -14365,7 +14365,7 @@ void Player::SendPreparedQuest(uint64 guid) // TODO: verify if check for !pQuest->IsDaily() is really correct (possibly not) else { - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*this, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM); + Object* pObject = ObjectAccessor::GetObjectByTypeMask(*this, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM); if (!pObject || (!pObject->hasQuest(quest_id) && !pObject->hasInvolvedQuest(quest_id))) { PlayerTalkClass->CloseGossip(); @@ -14395,7 +14395,7 @@ void Player::SendPreparedQuest(uint64 guid) std::string title = ""; // need pet case for some quests - Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); + Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (pCreature) { uint32 textid = GetGossipTextId(pCreature); @@ -14443,7 +14443,7 @@ Quest const * Player::GetNextQuest(uint64 guid, Quest const *pQuest) { QuestRelationBounds pObjectQR; - Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this,guid); + Creature *pCreature = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, guid); if (pCreature) pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(pCreature->GetEntry()); else @@ -14601,7 +14601,7 @@ bool Player::CanCompleteRepeatableQuest(Quest const *pQuest) if (pQuest->HasFlag(QUEST_TRINITY_FLAGS_DELIVER)) for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; i++) - if (pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i],pQuest->ReqItemCount[i])) + if (pQuest->ReqItemId[i] && pQuest->ReqItemCount[i] && !HasItemCount(pQuest->ReqItemId[i], pQuest->ReqItemCount[i])) return false; if (!CanRewardQuest(pQuest, false)) @@ -14617,7 +14617,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, bool msg) return false; // daily quest can't be rewarded (25 daily quest already completed) - if (!SatisfyQuestDay(pQuest,true) || !SatisfyQuestWeek(pQuest,true)) + if (!SatisfyQuestDay(pQuest, true) || !SatisfyQuestWeek(pQuest, true)) return false; // rewarded and not repeatable quest (only cheating case, then ignore without message) @@ -14649,7 +14649,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, bool msg) bool Player::CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg) { // prevent receive reward with quest items in bank or for not completed quest - if (!CanRewardQuest(pQuest,msg)) + if (!CanRewardQuest(pQuest, msg)) return false; if (pQuest->GetRewChoiceItemsCount() > 0) @@ -14750,16 +14750,16 @@ void Player::AddQuest(Quest const *pQuest, Object *questGiver) GetMap()->ScriptsStart(sQuestStartScripts, pQuest->GetQuestStartScript(), questGiver, this); // Some spells applied at quest activation - SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id,true); + SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id, true); if (saBounds.first != saBounds.second) { uint32 zone, area; - GetZoneAndAreaId(zone,area); + GetZoneAndAreaId(zone, area); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if (itr->second->autocast && itr->second->IsFitToRequirements(this,zone,area)) + if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area)) if (!HasAura(itr->second->spellId)) - CastSpell(this,itr->second->spellId,true); + CastSpell(this, itr->second->spellId, true); } UpdateForQuestWorldObjects(); @@ -14773,12 +14773,12 @@ void Player::CompleteQuest(uint32 quest_id) uint16 log_slot = FindQuestSlot(quest_id); if (log_slot < MAX_QUEST_LOG_SIZE) - SetQuestSlotState(log_slot,QUEST_STATE_COMPLETE); + SetQuestSlotState(log_slot, QUEST_STATE_COMPLETE); if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(quest_id)) { if (qInfo->HasFlag(QUEST_FLAGS_AUTO_REWARDED)) - RewardQuest(qInfo,0,this,false); + RewardQuest(qInfo, 0, this, false); else SendQuestComplete(quest_id); } @@ -14793,7 +14793,7 @@ void Player::IncompleteQuest(uint32 quest_id) uint16 log_slot = FindQuestSlot(quest_id); if (log_slot < MAX_QUEST_LOG_SIZE) - RemoveQuestSlotState(log_slot,QUEST_STATE_COMPLETE); + RemoveQuestSlotState(log_slot, QUEST_STATE_COMPLETE); } } @@ -14949,24 +14949,24 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver, SpellAreaForQuestMapBounds saEndBounds = sSpellMgr->GetSpellAreaForQuestEndMapBounds(quest_id); if (saEndBounds.first != saEndBounds.second) { - GetZoneAndAreaId(zone,area); + GetZoneAndAreaId(zone, area); for (SpellAreaForAreaMap::const_iterator itr = saEndBounds.first; itr != saEndBounds.second; ++itr) - if (!itr->second->IsFitToRequirements(this,zone,area)) + if (!itr->second->IsFitToRequirements(this, zone, area)) RemoveAurasDueToSpell(itr->second->spellId); } // Some spells applied at quest reward - SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id,false); + SpellAreaForQuestMapBounds saBounds = sSpellMgr->GetSpellAreaForQuestMapBounds(quest_id, false); if (saBounds.first != saBounds.second) { if (!zone || !area) - GetZoneAndAreaId(zone,area); + GetZoneAndAreaId(zone, area); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if (itr->second->autocast && itr->second->IsFitToRequirements(this,zone,area)) + if (itr->second->autocast && itr->second->IsFitToRequirements(this, zone, area)) if (!HasAura(itr->second->spellId)) - CastSpell(this,itr->second->spellId,true); + CastSpell(this, itr->second->spellId, true); } //lets remove flag for delayed teleports @@ -15532,7 +15532,7 @@ void Player::AdjustQuestReqItemCount(Quest const* pQuest, QuestStatusData& quest uint32 reqitemcount = pQuest->ReqItemCount[i]; if (reqitemcount != 0) { - uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i],true); + uint32 curitemcount = GetItemCount(pQuest->ReqItemId[i], true); questStatusData.m_itemcount[i] = std::min(curitemcount, reqitemcount); m_QuestStatusSave[pQuest->GetQuestId()] = true; @@ -15655,7 +15655,7 @@ void Player::ItemRemovedQuestCheck(uint32 entry, uint32 count) if (q_status.m_status != QUEST_STATUS_COMPLETE) curitemcount = q_status.m_itemcount[j]; else - curitemcount = GetItemCount(entry,true); + curitemcount = GetItemCount(entry, true); if (curitemcount < reqitemcount + count) { uint16 remitemcount = curitemcount <= reqitemcount ? count : count + reqitemcount - curitemcount; @@ -16159,7 +16159,7 @@ void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, ui uint16 log_slot = FindQuestSlot(pQuest->GetQuestId()); if (log_slot < MAX_QUEST_LOG_SIZE) - SetQuestSlotCounter(log_slot,creatureOrGO_idx,GetQuestSlotCounter(log_slot,creatureOrGO_idx)+add_count); + SetQuestSlotCounter(log_slot, creatureOrGO_idx, GetQuestSlotCounter(log_slot, creatureOrGO_idx)+add_count); } /*********************************************************/ @@ -16277,9 +16277,9 @@ void Player::_LoadBGData(PreparedQueryResult result) m_bgData.mountSpell = fields[9].GetUInt32(); } -bool Player::LoadPositionFromDB(uint32& mapid, float& x,float& y,float& z,float& o, bool& in_flight, uint64 guid) +bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid) { - QueryResult result = CharacterDatabase.PQuery("SELECT position_x,position_y,position_z,orientation,map,taxi_path FROM characters WHERE guid = '%u'",GUID_LOPART(guid)); + QueryResult result = CharacterDatabase.PQuery("SELECT position_x, position_y, position_z, orientation, map, taxi_path FROM characters WHERE guid = '%u'", GUID_LOPART(guid)); if (!result) return false; @@ -16325,7 +16325,7 @@ uint32 Player::GetUInt32ValueFromArray(Tokens const& data, uint16 index) float Player::GetFloatValueFromArray(Tokens const& data, uint16 index) { float result; - uint32 temp = Player::GetUInt32ValueFromArray(data,index); + uint32 temp = Player::GetUInt32ValueFromArray(data, index); memcpy(&result, &temp, sizeof(result)); return result; @@ -16334,20 +16334,20 @@ float Player::GetFloatValueFromArray(Tokens const& data, uint16 index) bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { //// 0 1 2 3 4 5 6 7 8 9 10 11 - //QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account,name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags," + //QueryResult *result = CharacterDatabase.PQuery("SELECT guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " // 12 13 14 15 16 17 18 19 20 21 22 23 24 - //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost," + //"position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, " // 25 26 27 28 29 30 31 32 33 34 35 36 37 38 - //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask," + //"resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, instance_mode_mask, " // 39 40 41 42 43 44 45 46 47 48 49 - //"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk," + //"arenaPoints, totalHonorPoints, todayHonorPoints, yesterdayHonorPoints, totalKills, todayKills, yesterdayKills, chosenTitle, knownCurrencies, watchedFaction, drunk, " // 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 //"health, power1, power2, power3, power4, power5, power6, power7, instance_id, speccount, activespec, exploredZones, equipmentCache, ammoId, knownTitles, actionBars FROM characters WHERE guid = '%u'", guid); PreparedQueryResult result = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADFROM); if (!result) { - sLog->outError("Player (GUID: %u) not found in table `characters`, can't load. ",guid); + sLog->outError("Player (GUID: %u) not found in table `characters`, can't load. ", guid); return false; } @@ -16359,7 +16359,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // player should be able to load/delete character only with correct account! if (dbAccountId != GetSession()->GetAccountId()) { - sLog->outError("Player (GUID: %u) loading from wrong account (is: %u, should be: %u)",guid,GetSession()->GetAccountId(),dbAccountId); + sLog->outError("Player (GUID: %u) loading from wrong account (is: %u, should be: %u)", guid, GetSession()->GetAccountId(), dbAccountId); return false; } @@ -16377,7 +16377,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS || (GetSession()->GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(m_name))) { - CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME),guid); + CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME), guid); return false; } @@ -16509,7 +16509,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) MapEntry const * mapEntry = sMapStore.LookupEntry(mapId); if (!mapEntry || !IsPositionValid()) { - sLog->outError("Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); + sLog->outError("Player (guidlow %d) have invalid coordinates (MapId: %u X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); RelocateToHomebind(); } // Player was saved in Arena or Bg @@ -16532,7 +16532,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) currentBg->EventPlayerLoggedIn(this); currentBg->AddOrSetPlayerToCorrectBgGroup(this, m_bgData.bgTeam); - SetInviteForBattlegroundQueueType(bgQueueTypeId,currentBg->GetInstanceID()); + SetInviteForBattlegroundQueueType(bgQueueTypeId, currentBg->GetInstanceID()); } // Bg was not found - go to Entry Point else @@ -16547,7 +16547,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (mapId == MAPID_INVALID) // Battleground Entry Point not found (???) { - sLog->outError("Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.",guid); + sLog->outError("Player (guidlow %d) was in BG in database, but BG was not found, and entry point was invalid! Teleport to default race/class locations.", guid); RelocateToHomebind(); } else @@ -16564,14 +16564,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_movementInfo.t_pos.Relocate(fields[26].GetFloat(), fields[27].GetFloat(), fields[28].GetFloat(), fields[29].GetFloat()); if (!Trinity::IsValidMapCoord( - GetPositionX()+m_movementInfo.t_pos.m_positionX,GetPositionY()+m_movementInfo.t_pos.m_positionY, - GetPositionZ()+m_movementInfo.t_pos.m_positionZ,GetOrientation()+m_movementInfo.t_pos.m_orientation) || + GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY, + GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.m_orientation) || // transport size limited m_movementInfo.t_pos.m_positionX > 250 || m_movementInfo.t_pos.m_positionY > 250 || m_movementInfo.t_pos.m_positionZ > 250) { sLog->outError("Player (guidlow %d) have invalid transport coordinates (X: %f Y: %f Z: %f O: %f). Teleport to bind location.", - guid,GetPositionX()+m_movementInfo.t_pos.m_positionX,GetPositionY()+m_movementInfo.t_pos.m_positionY, - GetPositionZ()+m_movementInfo.t_pos.m_positionZ,GetOrientation()+m_movementInfo.t_pos.m_orientation); + guid, GetPositionX()+m_movementInfo.t_pos.m_positionX, GetPositionY()+m_movementInfo.t_pos.m_positionY, + GetPositionZ()+m_movementInfo.t_pos.m_positionZ, GetOrientation()+m_movementInfo.t_pos.m_orientation); RelocateToHomebind(); } @@ -16590,7 +16590,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (!m_transport) { sLog->outError("Player (guidlow %d) have problems with transport guid (%u). Teleport to bind location.", - guid,transGUID); + guid, transGUID); RelocateToHomebind(); } @@ -16607,7 +16607,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) for (int i = 0; i < 2; ++i) m_taxi.AddTaxiDestination(m_bgData.taxiPath[i]); } - else if (!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes,GetTeam())) + else if (!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes, GetTeam())) { // problems with taxi path loading TaxiNodesEntry const* nodeEntry = NULL; @@ -16616,14 +16616,14 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) if (!nodeEntry) // don't know taxi start node, to homebind { - sLog->outError("Character %u have wrong data in taxi destination list, teleport to homebind.",GetGUIDLow()); + sLog->outError("Character %u have wrong data in taxi destination list, teleport to homebind.", GetGUIDLow()); RelocateToHomebind(); } else // have start node, to it { - sLog->outError("Character %u have too short taxi destination list, teleport to original node.",GetGUIDLow()); + sLog->outError("Character %u have too short taxi destination list, teleport to original node.", GetGUIDLow()); mapId = nodeEntry->map_id; - Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z,0.0f); + Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f); } m_taxi.ClearTaxiDestinations(); } @@ -16636,7 +16636,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString mapId = nodeEntry->map_id; - Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z,0.0f); + Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z, 0.0f); } // flight will started later @@ -16671,13 +16671,13 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) AreaTrigger const* at = sObjectMgr->GetGoBackTrigger(mapId); if (at) { - sLog->outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); + sLog->outError("Player (guidlow %d) is teleported to gobacktrigger (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); Relocate(at->target_X, at->target_Y, at->target_Z, GetOrientation()); mapId = at->target_mapId; } else { - sLog->outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).",guid,mapId,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); + sLog->outError("Player (guidlow %d) is teleported to home (Map: %u X: %f Y: %f Z: %f O: %f).", guid, mapId, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); RelocateToHomebind(); } @@ -16686,12 +16686,12 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) { PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); mapId = info->mapId; - Relocate(info->positionX,info->positionY,info->positionZ,0.0f); - sLog->outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); + Relocate(info->positionX, info->positionY, info->positionZ, 0.0f); + sLog->outError("Player (guidlow %d) have invalid coordinates (X: %f Y: %f Z: %f O: %f). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); map = sMapMgr->CreateMap(mapId, this, 0); if (!map) { - sLog->outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created",guid,GetPositionX(),GetPositionY(),GetPositionZ(),GetOrientation()); + sLog->outError("Player (guidlow %d) has invalid default map coordinates (X: %f Y: %f Z: %f O: %f). or instance couldn't be created", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation()); return false; } } @@ -16715,7 +16715,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // randomize first save time in range [CONFIG_INTERVAL_SAVE] around [CONFIG_INTERVAL_SAVE] // this must help in case next save after mass player load after server startup - m_nextSave = urand(m_nextSave/2,m_nextSave*3/2); + m_nextSave = urand(m_nextSave/2, m_nextSave*3/2); SaveRecallPosition(); @@ -16755,7 +16755,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) m_stableSlots = fields[32].GetUInt8(); if (m_stableSlots > MAX_PET_STABLES) { - sLog->outError("Player can have not more %u stable slots, but have in DB %u",MAX_PET_STABLES,uint32(m_stableSlots)); + sLog->outError("Player can have not more %u stable slots, but have in DB %u", MAX_PET_STABLES, uint32(m_stableSlots)); m_stableSlots = MAX_PET_STABLES; } @@ -16772,7 +16772,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) // clear channel spell data (if saved at channel spell casting) SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, 0); - SetUInt32Value(UNIT_CHANNEL_SPELL,0); + SetUInt32Value(UNIT_CHANNEL_SPELL, 0); // clear charm/summon related fields SetUInt64Value(UNIT_FIELD_SUMMONEDBY, 0); @@ -16902,7 +16902,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder) for (uint8 i = 0; i < MAX_POWERS; ++i) { uint32 savedPower = fields[51+i].GetUInt32(); - SetPower(Powers(i),savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); + SetPower(Powers(i), savedPower > GetMaxPower(Powers(i)) ? GetMaxPower(Powers(i)) : savedPower); } sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "The value of player %s after load item and aura is: ", m_name.c_str()); @@ -17048,12 +17048,12 @@ void Player::_LoadActions(PreparedQueryResult result) void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) { - sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Loading auras for player %u",GetGUIDLow()); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "Loading auras for player %u", GetGUIDLow()); /* 0 1 2 3 4 5 6 7 8 9 10 - QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,recalculate_mask,stackcount,amount0,amount1,amount2,base_amount0,base_amount1,base_amount2, + QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid, spell, effect_mask, recalculate_mask, stackcount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, 11 12 13 - maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow()); + maxduration, remaintime, remaincharges FROM character_aura WHERE guid = '%u'", GetGUIDLow()); */ if (result) @@ -17081,7 +17081,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid); if (!spellproto) { - sLog->outError("Unknown aura (spellid %u), ignore.",spellid); + sLog->outError("Unknown aura (spellid %u), ignore.", spellid); continue; } @@ -17110,7 +17110,7 @@ void Player::_LoadAuras(PreparedQueryResult result, uint32 timediff) aura->Remove(); continue; } - aura->SetLoadedState(maxduration,remaintime,remaincharges,stackcount,recalculatemask,&damage[0]); + aura->SetLoadedState(maxduration, remaintime, remaincharges, stackcount, recalculatemask, &damage[0]); aura->ApplyForTargets(); sLog->outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask); } @@ -17168,7 +17168,7 @@ void Player::LoadCorpse() void Player::_LoadInventory(PreparedQueryResult result, uint32 timeDiff) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT data,text,bag,slot,item,item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag,slot", GetGUIDLow()); + //QueryResult *result = CharacterDatabase.PQuery("SELECT data, text, bag, slot, item, item_template FROM character_inventory JOIN item_instance ON character_inventory.item = item_instance.guid WHERE character_inventory.guid = '%u' ORDER BY bag, slot", GetGUIDLow()); //NOTE: the "order by `bag`" is important because it makes sure //the bagMap is filled before items in the bags are loaded //NOTE2: the "order by `slot`" is needed because mainhand weapons are (wrongly?) @@ -17400,7 +17400,7 @@ void Player::_LoadMailedItems(Mail *mail) if (!proto) { - sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), item_guid_low, item_template,mail->messageID); + sLog->outError("Player %u has unknown item_template (ProtoType) in mailed items(GUID: %u template: %u) in mail (%u), deleted.", GetGUIDLow(), item_guid_low, item_template, mail->messageID); trans->PAppend("DELETE FROM mail_items WHERE item_guid = '%u'", item_guid_low); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_INSTANCE); stmt->setUInt32(0, item_guid_low); @@ -17429,7 +17429,7 @@ void Player::_LoadMailedItems(Mail *mail) void Player::_LoadMailInit(PreparedQueryResult resultUnread, PreparedQueryResult resultDelivery) { //set a count of unread mails - //QueryResult *resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(playerGuid),(uint64)cTime); + //QueryResult *resultMails = CharacterDatabase.PQuery("SELECT COUNT(id) FROM mail WHERE receiver = '%u' AND (checked & 1)=0 AND deliver_time <= '" UI64FMTD "'", GUID_LOPART(playerGuid), (uint64)cTime); if (resultUnread) unReadMails = (*resultUnread)[0].GetUInt8(); @@ -17443,7 +17443,7 @@ void Player::_LoadMail() { m_mail.clear(); //mails are in right order 0 1 2 3 4 5 6 7 8 9 10 11 12 13 - QueryResult result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC",GetGUIDLow()); + QueryResult result = CharacterDatabase.PQuery("SELECT id, messageType, sender, receiver, subject, body, has_items, expire_time, deliver_time, money, cod, checked, stationery, mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow()); if (result) { do @@ -17523,7 +17523,7 @@ void Player::_LoadQuestStatus(PreparedQueryResult result) else { questStatusData.m_status = QUEST_STATUS_INCOMPLETE; - sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",GetName(),quest_id,qstatus); + sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", GetName(), quest_id, qstatus); } questStatusData.m_explored = (fields[2].GetUInt8() > 0); @@ -17617,11 +17617,11 @@ void Player::_LoadQuestStatusRewarded(PreparedQueryResult result) void Player::_LoadDailyQuestStatus(PreparedQueryResult result) { for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) - SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx,0); + SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, 0); m_DFQuests.clear(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT quest,time FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow()); + //QueryResult *result = CharacterDatabase.PQuery("SELECT quest, time FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -17642,7 +17642,7 @@ void Player::_LoadDailyQuestStatus(PreparedQueryResult result) if (quest_daily_idx >= PLAYER_MAX_DAILY_QUESTS) // max amount with exist data in query { - sLog->outError("Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`",GetGUIDLow()); + sLog->outError("Player (GUID: %u) have more 25 daily quest records in `charcter_queststatus_daily`", GetGUIDLow()); break; } @@ -17690,7 +17690,7 @@ void Player::_LoadWeeklyQuestStatus(PreparedQueryResult result) void Player::_LoadSpells(PreparedQueryResult result) { - //QueryResult *result = CharacterDatabase.PQuery("SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'",GetGUIDLow()); + //QueryResult *result = CharacterDatabase.PQuery("SELECT spell, active, disabled FROM character_spell WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -17758,7 +17758,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) continue; } - MapDifficulty const* mapDiff = GetMapDifficultyData(mapId,Difficulty(difficulty)); + MapDifficulty const* mapDiff = GetMapDifficultyData(mapId, Difficulty(difficulty)); if (!mapDiff) { sLog->outError("_LoadBoundInstances: player %s(%d) has bind to not existed difficulty %d instance for map %u", GetName(), GetGUIDLow(), difficulty, mapId); @@ -17768,7 +17768,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) if (!perm && group) { - sLog->outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d,%d,%d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty); + sLog->outError("_LoadBoundInstances: player %s(%d) is in group %d but has a non-permanent character bind to map %d, %d, %d", GetName(), GetGUIDLow(), GUID_LOPART(group->GetGUID()), mapId, instanceId, difficulty); CharacterDatabase.PExecute("DELETE FROM character_instance WHERE guid = '%d' AND instance = '%d'", GetGUIDLow(), instanceId); continue; } @@ -17784,7 +17784,7 @@ void Player::_LoadBoundInstances(PreparedQueryResult result) InstancePlayerBind* Player::GetBoundInstance(uint32 mapid, Difficulty difficulty) { // some instances only have one difficulty - MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapid,difficulty); + MapDifficulty const* mapDiff = GetDownscaledMapDifficultyData(mapid, difficulty); if (!mapDiff) return NULL; @@ -18081,7 +18081,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result) MapEntry const* bindMapEntry = sMapStore.LookupEntry(m_homebindMapId); // accept saved data only for valid position (and non instanceable), and accessable - if (MapManager::IsValidMapCoord(m_homebindMapId,m_homebindX,m_homebindY,m_homebindZ) && + if (MapManager::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ) && !bindMapEntry->Instanceable() && GetSession()->Expansion() >= bindMapEntry->Expansion()) ok = true; else @@ -18142,7 +18142,7 @@ void Player::SaveToDB() CharacterDatabase.escape_string(sql_name); std::ostringstream ss; - ss << "REPLACE INTO characters (guid,account,name,race,class,gender,level,xp,money,playerBytes,playerBytes2,playerFlags," + ss << "REPLACE INTO characters (guid, account, name, race, class, gender, level, xp, money, playerBytes, playerBytes2, playerFlags, " "map, instance_id, instance_mode_mask, position_x, position_y, position_z, orientation, " "taximask, online, cinematic, " "totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, " @@ -18273,13 +18273,13 @@ void Player::SaveToDB() ss << " 0 "; } - ss << "',"; + ss << "', "; ss << GetUInt32Value(PLAYER_AMMO_ID) << ", '"; for (uint32 i = 0; i < KNOWN_TITLES_SIZE*2; ++i) ss << GetUInt32Value(PLAYER__FIELD_KNOWN_TITLES + i) << " "; - ss << "',"; + ss << "', "; ss << uint32(GetByteValue(PLAYER_FIELD_BYTES, 2)); ss << ")"; @@ -18340,7 +18340,7 @@ void Player::_SaveActions(SQLTransaction& trans) switch (itr->second.uState) { case ACTIONBUTTON_NEW: - trans->PAppend("INSERT INTO character_action (guid,spec,button,action,type) VALUES ('%u', '%u', '%u', '%u', '%u')", + trans->PAppend("INSERT INTO character_action (guid, spec, button, action, type) VALUES ('%u', '%u', '%u', '%u', '%u')", GetGUIDLow(), m_activeSpec, (uint32)itr->first, (uint32)itr->second.GetAction(), (uint32)itr->second.GetType()); itr->second.uState = ACTIONBUTTON_UNCHANGED; ++itr; @@ -18460,7 +18460,7 @@ void Player::_SaveInventory(SQLTransaction& trans) // update enchantment durations for (EnchantDurationList::iterator itr = m_enchantDuration.begin(); itr != m_enchantDuration.end(); ++itr) - itr->item->SetEnchantmentDuration(itr->slot,itr->leftduration, this); + itr->item->SetEnchantmentDuration(itr->slot, itr->leftduration, this); // if no changes if (m_itemUpdateQueue.empty()) @@ -18539,7 +18539,7 @@ void Player::_SaveMail(SQLTransaction& trans) Mail *m = (*itr); if (m->state == MAIL_STATE_CHANGED) { - trans->PAppend("UPDATE mail SET has_items = '%u',expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "',money = '%u',cod = '%u',checked = '%u' WHERE id = '%u'", + trans->PAppend("UPDATE mail SET has_items = '%u', expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "', money = '%u', cod = '%u', checked = '%u' WHERE id = '%u'", m->HasItems() ? 1 : 0, (uint64)m->expire_time, (uint64)m->deliver_time, m->money, m->COD, m->checked, m->messageID); if (m->removedItems.size()) { @@ -18597,7 +18597,7 @@ void Player::_SaveQuestStatus(SQLTransaction& trans) statusItr = m_QuestStatus.find(saveItr->first); if (statusItr != m_QuestStatus.end() && (keepAbandoned || statusItr->second.m_status != QUEST_STATUS_NONE)) { - trans->PAppend("REPLACE INTO character_queststatus (guid,quest,status,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4) " + trans->PAppend("REPLACE INTO character_queststatus (guid, quest, status, explored, timer, mobcount1, mobcount2, mobcount3, mobcount4, itemcount1, itemcount2, itemcount3, itemcount4) " "VALUES ('%u', '%u', '%u', '%u', '" UI64FMTD "', '%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", GetGUIDLow(), statusItr->first, statusItr->second.m_status, statusItr->second.m_explored, uint64(statusItr->second.m_timer / IN_MILLISECONDS+ sWorld->GetGameTime()), statusItr->second.m_creatureOrGOcount[0], statusItr->second.m_creatureOrGOcount[1], statusItr->second.m_creatureOrGOcount[2], statusItr->second.m_creatureOrGOcount[3], statusItr->second.m_itemcount[0], statusItr->second.m_itemcount[1], statusItr->second.m_itemcount[2], statusItr->second.m_itemcount[3]); } @@ -18629,18 +18629,18 @@ void Player::_SaveDailyQuestStatus(SQLTransaction& trans) // save last daily quest time for all quests: we need only mostly reset time for reset check anyway // we don't need transactions here. - trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'",GetGUIDLow()); + trans->PAppend("DELETE FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow()); for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) if (GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)) - trans->PAppend("INSERT INTO character_queststatus_daily (guid,quest,time) VALUES ('%u', '%u','" UI64FMTD "')", - GetGUIDLow(), GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx),uint64(m_lastDailyQuestTime)); + trans->PAppend("INSERT INTO character_queststatus_daily (guid, quest, time) VALUES ('%u', '%u', '" UI64FMTD "')", + GetGUIDLow(), GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx), uint64(m_lastDailyQuestTime)); if (!m_DFQuests.empty()) { for (DFQuestsDoneList::iterator itr = m_DFQuests.begin(); itr != m_DFQuests.end(); ++itr) { - trans->PAppend("INSERT INTO character_queststatus_daily (guid,quest,time) VALUES ('%u', '%u','" UI64FMTD "')", - GetGUIDLow(),(*itr),uint64(m_lastDailyQuestTime)); + trans->PAppend("INSERT INTO character_queststatus_daily (guid, quest, time) VALUES ('%u', '%u', '" UI64FMTD "')", + GetGUIDLow(), (*itr), uint64(m_lastDailyQuestTime)); } } } @@ -18651,13 +18651,13 @@ void Player::_SaveWeeklyQuestStatus(SQLTransaction& trans) return; // we don't need transactions here. - trans->PAppend("DELETE FROM character_queststatus_weekly WHERE guid = '%u'",GetGUIDLow()); + trans->PAppend("DELETE FROM character_queststatus_weekly WHERE guid = '%u'", GetGUIDLow()); for (QuestSet::const_iterator iter = m_weeklyquests.begin(); iter != m_weeklyquests.end(); ++iter) { uint32 quest_id = *iter; - trans->PAppend("INSERT INTO character_queststatus_weekly (guid,quest) VALUES ('%u', '%u')", GetGUIDLow(), quest_id); + trans->PAppend("INSERT INTO character_queststatus_weekly (guid, quest) VALUES ('%u', '%u')", GetGUIDLow(), quest_id); } m_WeeklyQuestChanged = false; @@ -18692,7 +18692,7 @@ void Player::_SaveSkills(SQLTransaction& trans) GetGUIDLow(), itr->first, value, max); break; case SKILL_CHANGED: - trans->PAppend("UPDATE character_skills SET value = '%u',max = '%u'WHERE guid = '%u' AND skill = '%u' ", + trans->PAppend("UPDATE character_skills SET value = '%u', max = '%u'WHERE guid = '%u' AND skill = '%u' ", value, max, GetGUIDLow(), itr->first); break; default: @@ -18713,7 +18713,7 @@ void Player::_SaveSpells(SQLTransaction& trans) // add only changed/new not dependent spells if (!itr->second->dependent && (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED)) - trans->PAppend("INSERT INTO character_spell (guid,spell,active,disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0,itr->second->disabled ? 1 : 0); + trans->PAppend("INSERT INTO character_spell (guid, spell, active, disabled) VALUES ('%u', '%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->active ? 1 : 0, itr->second->disabled ? 1 : 0); if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -18749,7 +18749,7 @@ void Player::_SaveStats(SQLTransaction& trans) ss << GetStat(Stats(i)) << ", "; // armor + school resistances for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) - ss << GetResistance(SpellSchools(i)) << ","; + ss << GetResistance(SpellSchools(i)) << ", "; ss << GetFloatValue(PLAYER_BLOCK_PERCENTAGE) << ", " << GetFloatValue(PLAYER_DODGE_PERCENTAGE) << ", " << GetFloatValue(PLAYER_PARRY_PERCENTAGE) << ", " @@ -18767,18 +18767,18 @@ void Player::outDebugValues() const if (!sLog->IsOutDebug()) // optimize disabled debug output return; - sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u",GetMaxHealth(), GetMaxPower(POWER_MANA)); - sLog->outDebug(LOG_FILTER_UNITS, "AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f",GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); - sLog->outDebug(LOG_FILTER_UNITS, "INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f",GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); - sLog->outDebug(LOG_FILTER_UNITS, "STAMINA is: \t\t%f",GetStat(STAT_STAMINA)); - sLog->outDebug(LOG_FILTER_UNITS, "Armor is: \t\t%u\t\tBlock is: \t\t%f",GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); - sLog->outDebug(LOG_FILTER_UNITS, "HolyRes is: \t\t%u\t\tFireRes is: \t\t%u",GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); - sLog->outDebug(LOG_FILTER_UNITS, "NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u",GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); - sLog->outDebug(LOG_FILTER_UNITS, "ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u",GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); - sLog->outDebug(LOG_FILTER_UNITS, "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f",GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); - sLog->outDebug(LOG_FILTER_UNITS, "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); - sLog->outDebug(LOG_FILTER_UNITS, "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f",GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); - sLog->outDebug(LOG_FILTER_UNITS, "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u",GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); + sLog->outDebug(LOG_FILTER_UNITS, "HP is: \t\t\t%u\t\tMP is: \t\t\t%u", GetMaxHealth(), GetMaxPower(POWER_MANA)); + sLog->outDebug(LOG_FILTER_UNITS, "AGILITY is: \t\t%f\t\tSTRENGTH is: \t\t%f", GetStat(STAT_AGILITY), GetStat(STAT_STRENGTH)); + sLog->outDebug(LOG_FILTER_UNITS, "INTELLECT is: \t\t%f\t\tSPIRIT is: \t\t%f", GetStat(STAT_INTELLECT), GetStat(STAT_SPIRIT)); + sLog->outDebug(LOG_FILTER_UNITS, "STAMINA is: \t\t%f", GetStat(STAT_STAMINA)); + sLog->outDebug(LOG_FILTER_UNITS, "Armor is: \t\t%u\t\tBlock is: \t\t%f", GetArmor(), GetFloatValue(PLAYER_BLOCK_PERCENTAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "HolyRes is: \t\t%u\t\tFireRes is: \t\t%u", GetResistance(SPELL_SCHOOL_HOLY), GetResistance(SPELL_SCHOOL_FIRE)); + sLog->outDebug(LOG_FILTER_UNITS, "NatureRes is: \t\t%u\t\tFrostRes is: \t\t%u", GetResistance(SPELL_SCHOOL_NATURE), GetResistance(SPELL_SCHOOL_FROST)); + sLog->outDebug(LOG_FILTER_UNITS, "ShadowRes is: \t\t%u\t\tArcaneRes is: \t\t%u", GetResistance(SPELL_SCHOOL_SHADOW), GetResistance(SPELL_SCHOOL_ARCANE)); + sLog->outDebug(LOG_FILTER_UNITS, "MIN_DAMAGE is: \t\t%f\tMAX_DAMAGE is: \t\t%f", GetFloatValue(UNIT_FIELD_MINDAMAGE), GetFloatValue(UNIT_FIELD_MAXDAMAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "MIN_OFFHAND_DAMAGE is: \t%f\tMAX_OFFHAND_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE), GetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "MIN_RANGED_DAMAGE is: \t%f\tMAX_RANGED_DAMAGE is: \t%f", GetFloatValue(UNIT_FIELD_MINRANGEDDAMAGE), GetFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE)); + sLog->outDebug(LOG_FILTER_UNITS, "ATTACK_TIME is: \t%u\t\tRANGE_ATTACK_TIME is: \t%u", GetAttackTime(BASE_ATTACK), GetAttackTime(RANGED_ATTACK)); } /*********************************************************/ @@ -18830,21 +18830,21 @@ void Player::SendAttackSwingNotInRange() GetSession()->SendPacket(&data); } -void Player::SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint32 zone,uint64 guid) +void Player::SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, uint64 guid) { std::ostringstream ss; - ss << "UPDATE characters SET position_x='"<<x<<"',position_y='"<<y - << "',position_z='"<<z<<"',orientation='"<<o<<"',map='"<<mapid - << "',zone='"<<zone<<"',trans_x='0',trans_y='0',trans_z='0'," - << "transguid='0',taxi_path='' WHERE guid='"<< GUID_LOPART(guid) <<"'"; + ss << "UPDATE characters SET position_x='"<<x<<"', position_y='"<<y + << "', position_z='"<<z<<"', orientation='"<<o<<"', map='"<<mapid + << "', zone='"<<zone<<"', trans_x='0', trans_y='0', trans_z='0', " + << "transguid='0', taxi_path='' WHERE guid='"<< GUID_LOPART(guid) <<"'"; sLog->outDebug(LOG_FILTER_UNITS, "%s", ss.str().c_str()); CharacterDatabase.Execute(ss.str().c_str()); } -void Player::SetUInt32ValueInArray(Tokens& tokens,uint16 index, uint32 value) +void Player::SetUInt32ValueInArray(Tokens& tokens, uint16 index, uint32 value) { char buf[11]; - snprintf(buf,11,"%u",value); + snprintf(buf, 11, "%u", value); if (index >= tokens.size()) return; @@ -19067,7 +19067,7 @@ Pet* Player::GetPet() const return pet; //there may be a guardian in slot - //sLog->outError("Player::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid)); + //sLog->outError("Player::GetPet: Pet %u not exist.", GUID_LOPART(pet_guid)); //const_cast<Player*>(this)->SetPetGUID(0); } @@ -19081,7 +19081,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) if (pet) { - sLog->outDebug(LOG_FILTER_PETS,"RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); + sLog->outDebug(LOG_FILTER_PETS, "RemovePet %u, %u, %u", pet->GetEntry(), mode, returnreagent); if (pet->m_removed) return; @@ -19105,7 +19105,7 @@ void Player::RemovePet(Pet* pet, PetSaveMode mode, bool returnreagent) { Item* item = StoreNewItem(dest, spellInfo->Reagent[i], true); if (IsInWorld()) - SendNewItem(item,spellInfo->ReagentCount[i],true,false); + SendNewItem(item, spellInfo->ReagentCount[i], true, false); } } } @@ -19273,7 +19273,7 @@ void Player::PetSpellInitialize() if (!pet) return; - sLog->outDebug(LOG_FILTER_PETS,"Pet Spells Groups"); + sLog->outDebug(LOG_FILTER_PETS, "Pet Spells Groups"); CharmInfo *charmInfo = pet->GetCharmInfo(); @@ -19300,7 +19300,7 @@ void Player::PetSpellInitialize() if (itr->second.state == PETSPELL_REMOVED) continue; - data << uint32(MAKE_UNIT_ACTION_BUTTON(itr->first,itr->second.active)); + data << uint32(MAKE_UNIT_ACTION_BUTTON(itr->first, itr->second.active)); ++addlist; } } @@ -19403,7 +19403,7 @@ void Player::VehicleSpellInitialize() data << uint16(0) << uint8(0) << uint8(i+8); } else - data << uint32(MAKE_UNIT_ACTION_BUTTON(spellId,i+8)); + data << uint32(MAKE_UNIT_ACTION_BUTTON(spellId, i+8)); } for (uint32 i = CREATURE_MAX_SPELLS; i < MAX_SPELL_CONTROL_BAR; ++i) @@ -19646,9 +19646,9 @@ void Player::RemovePetitionsAndSigns(uint64 guid, uint32 type) { QueryResult result = QueryResult(NULL); if (type == 10) - result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid)); + result = CharacterDatabase.PQuery("SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = '%u'", GUID_LOPART(guid)); else - result = CharacterDatabase.PQuery("SELECT ownerguid,petitionguid FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); + result = CharacterDatabase.PQuery("SELECT ownerguid, petitionguid FROM petition_sign WHERE playerguid = '%u' AND type = '%u'", GUID_LOPART(guid), type); if (result) { do // this part effectively does nothing, since the deletion / modification only takes place _after_ the PetitionQuery. Though I don't know if the result remains intact if I execute the delete query beforehand. @@ -19789,13 +19789,13 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc if (Spell* spell = GetCurrentSpell(CURRENT_GENERIC_SPELL)) if (spell->m_spellInfo->Id != spellid) - InterruptSpell(CURRENT_GENERIC_SPELL,false); + InterruptSpell(CURRENT_GENERIC_SPELL, false); - InterruptSpell(CURRENT_AUTOREPEAT_SPELL,false); + InterruptSpell(CURRENT_AUTOREPEAT_SPELL, false); if (Spell* spell = GetCurrentSpell(CURRENT_CHANNELED_SPELL)) if (spell->m_spellInfo->Id != spellid) - InterruptSpell(CURRENT_CHANNELED_SPELL,true); + InterruptSpell(CURRENT_CHANNELED_SPELL, true); } uint32 sourcenode = nodes[0]; @@ -19952,7 +19952,7 @@ bool Player::ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid /*= 0*/) nodes[0] = entry->from; nodes[1] = entry->to; - return ActivateTaxiPathTo(nodes,NULL,spellid); + return ActivateTaxiPathTo(nodes, NULL, spellid); } void Player::CleanupAfterTaxiFlight() @@ -19971,7 +19971,7 @@ void Player::ContinueTaxiFlight() sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Restart character %u taxi flight", GetGUIDLow()); - uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeam(),true); + uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeam(), true); uint32 path = m_taxi.GetCurrentTaxiPath(); // search appropriate start path node @@ -20059,8 +20059,8 @@ void Player::InitDataForForm(bool reapplyMods) SpellShapeshiftEntry const* ssEntry = sSpellShapeshiftStore.LookupEntry(form); if (ssEntry && ssEntry->attackSpeed) { - SetAttackTime(BASE_ATTACK,ssEntry->attackSpeed); - SetAttackTime(OFF_ATTACK,ssEntry->attackSpeed); + SetAttackTime(BASE_ATTACK, ssEntry->attackSpeed); + SetAttackTime(OFF_ATTACK, ssEntry->attackSpeed); SetAttackTime(RANGED_ATTACK, BASE_ATTACK_TIME); } else @@ -20120,7 +20120,7 @@ void Player::InitDisplayIds() SetNativeDisplayId(info->displayId_m); break; default: - sLog->outError("Invalid gender %u for player",gender); + sLog->outError("Invalid gender %u for player", gender); return; } } @@ -20161,7 +20161,7 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c EquipNewItem(uiDest, item, true); if (it) { - uint32 new_count = pVendor->UpdateVendorItemCurrentCount(crItem,pProto->BuyCount * count); + uint32 new_count = pVendor->UpdateVendorItemCurrentCount(crItem, pProto->BuyCount * count); WorldPacket data(SMSG_BUY_ITEM, (8+4+4+4)); data << uint64(pVendor->GetGUID()); @@ -20207,7 +20207,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 return false; } - Creature *pCreature = GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); + Creature *pCreature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: BuyItemFromVendor - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(vendorguid))); @@ -20289,7 +20289,7 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32 if (GetMaxPersonalArenaRatingRequirement(iece->reqarenaslot) < iece->reqpersonalarenarating) { // probably not the proper equip err - SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK,NULL,NULL); + SendEquipError(EQUIP_ERR_CANT_EQUIP_RANK, NULL, NULL); return false; } } @@ -20385,7 +20385,7 @@ void Player::UpdateHomebindTime(uint32 time) data << uint32(m_HomebindTimer); data << uint32(1); GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_MAPS, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(),GetGUIDLow()); + sLog->outDebug(LOG_FILTER_MAPS, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(), GetGUIDLow()); } } @@ -20419,7 +20419,7 @@ void Player::UpdatePvPState(bool onlyFFA) } else // in friendly area { - if (IsPvP() && !HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_IN_PVP) && pvpInfo.endTimer == 0) + if (IsPvP() && !HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP) && pvpInfo.endTimer == 0) pvpInfo.endTimer = time(0); // start toggle-off } } @@ -20568,11 +20568,11 @@ void Player::UpdatePotionCooldown(Spell* spell) for (uint8 idx = 0; idx < MAX_ITEM_SPELLS; ++idx) if (proto->Spells[idx].SpellId && proto->Spells[idx].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE) if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(proto->Spells[idx].SpellId)) - SendCooldownEvent(spellInfo,m_lastPotionId); + SendCooldownEvent(spellInfo, m_lastPotionId); } // from spell cases (m_lastPotionId set in Spell::SendSpellCooldown) else - SendCooldownEvent(spell->m_spellInfo,m_lastPotionId,spell); + SendCooldownEvent(spell->m_spellInfo, m_lastPotionId, spell); m_lastPotionId = 0; } @@ -20696,7 +20696,7 @@ void Player::CorrectMetaGemEnchants(uint8 exceptslot, bool apply) { // ignore item gem conditions //if state changed, (dis)apply enchant - ApplyEnchantment(pItem,EnchantmentSlot(enchant_slot),!wasactive,true,true); + ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), !wasactive, true, true); } } } @@ -20732,7 +20732,7 @@ void Player::ToggleMetaGemsActive(uint8 exceptslot, bool apply) //only metagems to be (de)activated, so only enchants with condition uint32 condition = enchantEntry->EnchantmentCondition; if (condition) - ApplyEnchantment(pItem,EnchantmentSlot(enchant_slot), apply); + ApplyEnchantment(pItem, EnchantmentSlot(enchant_slot), apply); } } } @@ -20969,13 +20969,13 @@ void Player::UpdateVisibilityOf(WorldObject* target) if (!canSeeOrDetect(target, false, true)) { if (target->GetTypeId() == TYPEID_UNIT) - BeforeVisibilityDestroy<Creature>(target->ToCreature(),this); + BeforeVisibilityDestroy<Creature>(target->ToCreature(), this); target->DestroyForPlayer(this); m_clientGUIDs.erase(target->GetGUID()); #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u) out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u) out of range for player %u. Distance = %f", target->GetGUIDLow(), target->GetTypeId(), GetGUIDLow(), GetDistance(target)); #endif } } @@ -20990,7 +20990,7 @@ void Player::UpdateVisibilityOf(WorldObject* target) m_clientGUIDs.insert(target->GetGUID()); #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u) is visible now for player %u. Distance = %f", target->GetGUIDLow(), target->GetTypeId(), GetGUIDLow(), GetDistance(target)); #endif // target aura duration for caster show only if target exist at caster client @@ -21016,7 +21016,7 @@ void Player::UpdateTriggerVisibility() if (!obj || !obj->isTrigger()) continue; - obj->BuildCreateUpdateBlockForPlayer(&udata,this); + obj->BuildCreateUpdateBlockForPlayer(&udata, this); } } udata.BuildPacket(&packet); @@ -21042,13 +21042,13 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& vi { if (!canSeeOrDetect(target, false, true)) { - BeforeVisibilityDestroy<T>(target,this); + BeforeVisibilityDestroy<T>(target, this); target->BuildOutOfRangeUpdateBlock(&data); m_clientGUIDs.erase(target->GetGUID()); #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u, Entry: %u) is out of range for player %u. Distance = %f", target->GetGUIDLow(), target->GetTypeId(), target->GetEntry(), GetGUIDLow(), GetDistance(target)); #endif } } @@ -21060,10 +21060,10 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<Unit*>& vi // UpdateVisibilityOf(((Unit*)target)->m_Vehicle, data, visibleNow); target->BuildCreateUpdateBlockForPlayer(&data, this); - UpdateVisibilityOf_helper(m_clientGUIDs,target,visibleNow); + UpdateVisibilityOf_helper(m_clientGUIDs, target, visibleNow); #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f",target->GetGUIDLow(),target->GetTypeId(),target->GetEntry(),GetGUIDLow(),GetDistance(target)); + sLog->outDebug(LOG_FILTER_MAPS, "Object %u (Type: %u, Entry: %u) is visible now for player %u. Distance = %f", target->GetGUIDLow(), target->GetTypeId(), target->GetEntry(), GetGUIDLow(), GetDistance(target)); #endif } } @@ -21215,7 +21215,7 @@ void Player::ClearComboPoints() SendComboPoints(); - if (Unit* target = ObjectAccessor::GetUnit(*this,m_comboTarget)) + if (Unit* target = ObjectAccessor::GetUnit(*this, m_comboTarget)) target->RemoveComboPointHolder(GetGUIDLow()); m_comboTarget = 0; @@ -21296,8 +21296,8 @@ void Player::SendInitialPacketsAfterAddToMap() // update zone uint32 newzone, newarea; - GetZoneAndAreaId(newzone,newarea); - UpdateZone(newzone,newarea); // also call SendInitWorldStates(); + GetZoneAndAreaId(newzone, newarea); + UpdateZone(newzone, newarea); // also call SendInitWorldStates(); ResetTimeSync(); SendTimeSync(); @@ -21329,7 +21329,7 @@ void Player::SendInitialPacketsAfterAddToMap() WorldPacket data2(SMSG_FORCE_MOVE_ROOT, 10); data2.append(GetPackGUID()); data2 << (uint32)2; - SendMessageToSet(&data2,true); + SendMessageToSet(&data2, true); } SendAurasForTarget(this); @@ -21437,7 +21437,7 @@ void Player::resetSpells(bool myClassOnly) { // not need after this call if (HasAtLoginFlag(AT_LOGIN_RESET_SPELLS)) - RemoveAtLoginFlag(AT_LOGIN_RESET_SPELLS,true); + RemoveAtLoginFlag(AT_LOGIN_RESET_SPELLS, true); // make full copy of map (spells removed and marked as deleted at another spell remove // and we can't use original map for safe iterative with visit each spell at loop end @@ -21476,13 +21476,13 @@ void Player::resetSpells(bool myClassOnly) continue; // skip broken spells - if (!SpellMgr::IsSpellValid(spellInfo,this,false)) + if (!SpellMgr::IsSpellValid(spellInfo, this, false)) continue; } } else for (PlayerSpellMap::const_iterator iter = smap.begin(); iter != smap.end(); ++iter) - removeSpell(iter->first,false,false); // only iter->first can be accessed, object by iter->second can be deleted already + removeSpell(iter->first, false, false); // only iter->first can be accessed, object by iter->second can be deleted already learnDefaultSpells(); learnQuestRewardedSpells(); @@ -21491,13 +21491,13 @@ void Player::resetSpells(bool myClassOnly) void Player::learnDefaultSpells() { // learn default race/class spells - PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(),getClass()); + PlayerInfo const *info = sObjectMgr->GetPlayerInfo(getRace(), getClass()); for (PlayerCreateInfoSpells::const_iterator itr = info->spell.begin(); itr != info->spell.end(); ++itr) { uint32 tspell = *itr; - sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "PLAYER (Class: %u Race: %u): Adding initial spell, id = %u",uint32(getClass()),uint32(getRace()), tspell); + sLog->outDebug(LOG_FILTER_PLAYER_LOADING, "PLAYER (Class: %u Race: %u): Adding initial spell, id = %u", uint32(getClass()), uint32(getRace()), tspell); if (!IsInWorld()) // will send in INITIAL_SPELLS in list anyway at map add - addSpell(tspell,true,true,true,false); + addSpell(tspell, true, true, true, false); else // but send in normal spell in game learn case learnSpell(tspell, true); } @@ -21620,7 +21620,7 @@ void Player::learnSkillRewardedSpells(uint32 skill_id, uint32 skill_value) removeSpell(pAbility->spellId); // need learn else if (!IsInWorld()) - addSpell(pAbility->spellId,true,true,true,false); + addSpell(pAbility->spellId, true, true, true, false); else learnSpell(pAbility->spellId, true); } @@ -21676,7 +21676,7 @@ void Player::SetDailyQuestStatus(uint32 quest_id) { if (!GetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx)) { - SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx,quest_id); + SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, quest_id); m_lastDailyQuestTime = time(NULL); // last daily quest time m_DailyQuestChanged = true; break; @@ -21701,7 +21701,7 @@ void Player::SetWeeklyQuestStatus(uint32 quest_id) void Player::ResetDailyQuestStatus() { for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx) - SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx,0); + SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1+quest_daily_idx, 0); m_DFQuests.clear(); // Dungeon Finder Quests. @@ -21841,7 +21841,7 @@ void Player::UpdateForQuestWorldObjects() if (IS_GAMEOBJECT_GUID(*itr)) { if (GameObject *obj = HashMapHolder<GameObject>::Find(*itr)) - obj->BuildValuesUpdateBlockForPlayer(&udata,this); + obj->BuildValuesUpdateBlockForPlayer(&udata, this); } else if (IS_CRE_OR_VEH_GUID(*itr)) { @@ -21850,14 +21850,14 @@ void Player::UpdateForQuestWorldObjects() continue; // check if this unit requires quest specific flags - if (!obj->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_SPELLCLICK)) + if (!obj->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK)) continue; SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(obj->GetEntry()); for (SpellClickInfoMap::const_iterator _itr = clickPair.first; _itr != clickPair.second; ++_itr) if (_itr->second.questStart || _itr->second.questEnd) { - obj->BuildCreateUpdateBlockForPlayer(&udata,this); + obj->BuildCreateUpdateBlockForPlayer(&udata, this); break; } } @@ -21894,7 +21894,7 @@ void Player::SummonIfPossible(bool agree) GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_ACCEPTED_SUMMONINGS, 1); - TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z,GetOrientation()); + TeleportTo(m_summon_mapid, m_summon_x, m_summon_y, m_summon_z, GetOrientation()); } void Player::RemoveItemDurations(Item *item) @@ -21996,7 +21996,7 @@ bool Player::HasItemFitToSpellRequirements(SpellEntry const* spellInfo, Item con break; } default: - sLog->outError("HasItemFitToSpellRequirements: Not handled spell requirement for item class %u",spellInfo->EquippedItemClass); + sLog->outError("HasItemFitToSpellRequirements: Not handled spell requirement for item class %u", spellInfo->EquippedItemClass); break; } @@ -22036,7 +22036,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item * pItem) } // skip if not item dependent or have alternative item - if (HasItemFitToSpellRequirements(spellInfo,pItem)) + if (HasItemFitToSpellRequirements(spellInfo, pItem)) { ++itr; continue; @@ -22049,7 +22049,7 @@ void Player::RemoveItemDependentAurasAndCasts(Item * pItem) // currently casted spells can be dependent from item for (uint32 i = 0; i < CURRENT_MAX_SPELL; ++i) if (Spell* spell = GetCurrentSpell(CurrentSpellTypes(i))) - if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo,pItem)) + if (spell->getState() != SPELL_STATE_DELAYED && !HasItemFitToSpellRequirements(spell->m_spellInfo, pItem)) InterruptSpell(CurrentSpellTypes(i)); } @@ -22074,7 +22074,7 @@ uint32 Player::GetResurrectionSpellId() case 27239: spell_id = 27240; break; // rank 6 case 47883: spell_id = 47882; break; // rank 7 default: - sLog->outError("Unhandled spell %u: S.Resurrection",(*itr)->GetId()); + sLog->outError("Unhandled spell %u: S.Resurrection", (*itr)->GetId()); continue; } @@ -22089,7 +22089,7 @@ uint32 Player::GetResurrectionSpellId() } // Reincarnation (passive spell) // prio: 1 // Glyph of Renewed Life - if (prio < 1 && HasSpell(20608) && !HasSpellCooldown(21169) && (HasAura(58059) || HasItemCount(17030,1))) + if (prio < 1 && HasSpell(20608) && !HasSpellCooldown(21169) && (HasAura(58059) || HasItemCount(17030, 1))) spell_id = 21169; return spell_id; @@ -22218,7 +22218,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const { - Item* item = GetWeaponForAttack(attType,true); + Item* item = GetWeaponForAttack(attType, true); // unarmed only with base attack if (attType != BASE_ATTACK && !item) @@ -22243,7 +22243,7 @@ void Player::ResurectUsingRequestData() return; } - ResurrectPlayer(0.0f,false); + ResurrectPlayer(0.0f, false); if (GetMaxHealth() > m_resurrectHealth) SetHealth(m_resurrectHealth); @@ -22277,9 +22277,9 @@ void Player::UpdateZoneDependentAuras(uint32 newZone) // Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(newZone); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if (itr->second->autocast && itr->second->IsFitToRequirements(this,newZone,0)) + if (itr->second->autocast && itr->second->IsFitToRequirements(this, newZone, 0)) if (!HasAura(itr->second->spellId)) - CastSpell(this,itr->second->spellId,true); + CastSpell(this, itr->second->spellId, true); } void Player::UpdateAreaDependentAuras(uint32 newArea) @@ -22288,7 +22288,7 @@ void Player::UpdateAreaDependentAuras(uint32 newArea) for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();) { // use m_zoneUpdateId for speed: UpdateArea called from UpdateZone or instead UpdateZone in both cases m_zoneUpdateId up-to-date - if (sSpellMgr->GetSpellAllowedInLocationError(iter->second->GetSpellProto(),GetMapId(),m_zoneUpdateId,newArea,this) != SPELL_CAST_OK) + if (sSpellMgr->GetSpellAllowedInLocationError(iter->second->GetSpellProto(), GetMapId(), m_zoneUpdateId, newArea, this) != SPELL_CAST_OK) RemoveOwnedAura(iter); else ++iter; @@ -22297,9 +22297,9 @@ void Player::UpdateAreaDependentAuras(uint32 newArea) // some auras applied at subzone enter SpellAreaForAreaMapBounds saBounds = sSpellMgr->GetSpellAreaForAreaMapBounds(newArea); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) - if (itr->second->autocast && itr->second->IsFitToRequirements(this,m_zoneUpdateId,newArea)) + if (itr->second->autocast && itr->second->IsFitToRequirements(this, m_zoneUpdateId, newArea)) if (!HasAura(itr->second->spellId)) - CastSpell(this,itr->second->spellId,true); + CastSpell(this, itr->second->spellId, true); if (newArea == 4273 && GetVehicle() && GetPositionX() > 400) // Ulduar { @@ -22423,7 +22423,7 @@ Player* Player::GetNextRandomRaidMember(float radius) if (nearMembers.empty()) return NULL; - uint32 randTarget = urand(0,nearMembers.size()-1); + uint32 randTarget = urand(0, nearMembers.size()-1); return nearMembers[randTarget]; } @@ -22994,15 +22994,15 @@ bool Player::IsBaseRuneSlotsOnCooldown(RuneType runeType) const void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore const& store, bool broadcast) { Loot loot; - loot.FillLoot (loot_id,store,this,true); + loot.FillLoot (loot_id, store, this, true); uint32 max_slot = loot.GetMaxSlotInLootFor(this); for (uint32 i = 0; i < max_slot; ++i) { - LootItem* lootItem = loot.LootItemInSlot(i,this); + LootItem* lootItem = loot.LootItemInSlot(i, this); ItemPosCountVec dest; - InventoryResult msg = CanStoreNewItem(bag, slot, dest,lootItem->itemid, lootItem->count); + InventoryResult msg = CanStoreNewItem(bag, slot, dest, lootItem->itemid, lootItem->count); if (msg != EQUIP_ERR_OK && slot != NULL_SLOT) msg = CanStoreNewItem(bag, NULL_SLOT, dest, lootItem->itemid, lootItem->count); if (msg != EQUIP_ERR_OK && bag != NULL_BAG) @@ -23013,7 +23013,7 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons continue; } - Item* pItem = StoreNewItem(dest,lootItem->itemid, true, lootItem->randomPropertyId); + Item* pItem = StoreNewItem(dest, lootItem->itemid, true, lootItem->randomPropertyId); SendNewItem(pItem, lootItem->count, false, false, broadcast); } } @@ -23141,7 +23141,7 @@ void Player::_LoadSkills(PreparedQueryResult result) } // set fixed skill ranges - switch(GetSkillRangeType(pSkill,false)) + switch(GetSkillRangeType(pSkill, false)) { case SKILL_RANGE_LANGUAGE: // 300..300 value = max = 300; @@ -23161,12 +23161,12 @@ void Player::_LoadSkills(PreparedQueryResult result) // enable unlearn button for primary professions only if (pSkill->categoryId == SKILL_CATEGORY_PROFESSION) - SetUInt32Value(PLAYER_SKILL_INDEX(count), MAKE_PAIR32(skill,1)); + SetUInt32Value(PLAYER_SKILL_INDEX(count), MAKE_PAIR32(skill, 1)); else - SetUInt32Value(PLAYER_SKILL_INDEX(count), MAKE_PAIR32(skill,0)); + SetUInt32Value(PLAYER_SKILL_INDEX(count), MAKE_PAIR32(skill, 0)); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(count),MAKE_SKILL_VALUE(value, max)); - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count),0); + SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(count), MAKE_SKILL_VALUE(value, max)); + SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count), 0); mSkillStatus.insert(SkillStatusMap::value_type(skill, SkillStatusData(count, SKILL_UNCHANGED))); @@ -23186,14 +23186,14 @@ void Player::_LoadSkills(PreparedQueryResult result) for (; count < PLAYER_MAX_SKILLS; ++count) { SetUInt32Value(PLAYER_SKILL_INDEX(count), 0); - SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(count),0); - SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count),0); + SetUInt32Value(PLAYER_SKILL_VALUE_INDEX(count), 0); + SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(count), 0); } // special settings if (getClass() == CLASS_DEATH_KNIGHT) { - uint8 base_level = std::min(getLevel(),uint8(sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL))); + uint8 base_level = std::min(getLevel(), uint8(sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL))); if (base_level < 1) base_level = 1; uint16 base_skill = (base_level-1)*5; // 270 at starting level 55 @@ -23243,7 +23243,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi ItemTemplate const* pProto = pItem->GetTemplate(); // proto based limitations - if (InventoryResult res = CanEquipUniqueItem(pProto,eslot,limit_count)) + if (InventoryResult res = CanEquipUniqueItem(pProto, eslot, limit_count)) return res; // check unique-equipped on gems @@ -23323,7 +23323,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld->getRate(RATE_DAMAGE_FALL)); float height = movementInfo.pos.m_positionZ; - UpdateGroundPositionZ(movementInfo.pos.m_positionX,movementInfo.pos.m_positionY,height); + UpdateGroundPositionZ(movementInfo.pos.m_positionX, movementInfo.pos.m_positionY, height); if (damage > 0) { @@ -23617,7 +23617,7 @@ void Player::AddKnownCurrency(uint32 itemId) SetFlag64(PLAYER_FIELD_KNOWN_CURRENCIES, (1LL << (ctEntry->BitIndex-1))); } -void Player::UpdateFallInformationIfNeed(MovementInfo const& minfo,uint16 opcode) +void Player::UpdateFallInformationIfNeed(MovementInfo const& minfo, uint16 opcode) { if (m_lastFallTime >= minfo.fallTime || m_lastFallZ <= minfo.pos.GetPositionZ() || opcode == MSG_MOVE_FALL_LAND) SetFallInformation(minfo.fallTime, minfo.pos.GetPositionZ()); @@ -23659,7 +23659,7 @@ void Player::ResummonPetTemporaryUnSummonedIfAny() bool Player::canSeeSpellClickOn(Creature const *c) const { - if (!c->HasFlag(UNIT_NPC_FLAGS,UNIT_NPC_FLAG_SPELLCLICK)) + if (!c->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK)) return false; SpellClickInfoMapBounds clickPair = sObjectMgr->GetSpellClickInfoMapBounds(c->GetEntry()); @@ -23998,7 +23998,7 @@ void Player::_SaveBGData(SQLTransaction& trans) stmt->setUInt16(7, m_bgData.joinPos.GetMapId()); stmt->setUInt16(8, m_bgData.taxiPath[0]); stmt->setUInt16(9, m_bgData.taxiPath[1]); - stmt->setUInt16(10,m_bgData.mountSpell); + stmt->setUInt16(10, m_bgData.mountSpell); trans->Append(stmt); } } @@ -24078,7 +24078,7 @@ void Player::_LoadGlyphs(PreparedQueryResult result) void Player::_SaveGlyphs(SQLTransaction& trans) { - trans->PAppend("DELETE FROM character_glyphs WHERE guid='%u'",GetGUIDLow()); + trans->PAppend("DELETE FROM character_glyphs WHERE guid='%u'", GetGUIDLow()); for (uint8 spec = 0; spec < m_specsCount; ++spec) { trans->PAppend("INSERT INTO character_glyphs VALUES('%u', '%u', '%u', '%u', '%u', '%u', '%u', '%u')", @@ -24107,7 +24107,7 @@ void Player::_SaveTalents(SQLTransaction& trans) trans->PAppend("DELETE FROM character_talent WHERE guid = '%u' and spell = '%u' and spec = '%u'", GetGUIDLow(), itr->first, itr->second->spec); if (itr->second->state == PLAYERSPELL_NEW || itr->second->state == PLAYERSPELL_CHANGED) - trans->PAppend("INSERT INTO character_talent (guid,spell,spec) VALUES ('%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->spec); + trans->PAppend("INSERT INTO character_talent (guid, spell, spec) VALUES ('%u', '%u', '%u')", GetGUIDLow(), itr->first, itr->second->spec); if (itr->second->state == PLAYERSPELL_REMOVED) { @@ -24139,7 +24139,7 @@ void Player::UpdateSpecCount(uint8 count) { _SaveActions(trans); // make sure the button list is cleaned up for (ActionButtonList::iterator itr = m_actionButtons.begin(); itr != m_actionButtons.end(); ++itr) - trans->PAppend("INSERT INTO character_action (guid,button,action,type,spec) VALUES ('%u', '%u', '%u', '%u', '%u')", + trans->PAppend("INSERT INTO character_action (guid, button, action, type, spec) VALUES ('%u', '%u', '%u', '%u', '%u')", GetGUIDLow(), uint32(itr->first), uint32(itr->second.GetAction()), uint32(itr->second.GetType()), 1); } @@ -24147,7 +24147,7 @@ void Player::UpdateSpecCount(uint8 count) else if (count < curCount) { _SaveActions(trans); - trans->PAppend("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'",m_activeSpec, GetGUIDLow()); + trans->PAppend("DELETE FROM character_action WHERE spec<>'%u' AND guid='%u'", m_activeSpec, GetGUIDLow()); m_activeSpec = 0; } @@ -24321,7 +24321,7 @@ void Player::SendTimeSync() void Player::SetReputation(uint32 factionentry, uint32 value) { - GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry),value); + GetReputationMgr().SetReputation(sFactionStore.LookupEntry(factionentry), value); } uint32 Player::GetReputation(uint32 factionentry) { @@ -24411,7 +24411,7 @@ bool Player::AddItem(uint32 itemId, uint32 count) Item* item = StoreNewItem(dest, itemId, true, Item::GenerateItemRandomPropertyId(itemId)); if(item) - SendNewItem(item,count,true,false); + SendNewItem(item, count, true, false); else return false; return true; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 3a74ba3d494..71fe07275a8 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -188,7 +188,7 @@ struct ActionButton #define MAX_ACTION_BUTTONS 144 //checked in 3.2.0 -typedef std::map<uint8,ActionButton> ActionButtonList; +typedef std::map<uint8, ActionButton> ActionButtonList; struct PlayerCreateInfoItem { @@ -238,7 +238,7 @@ typedef std::list<PlayerCreateInfoAction> PlayerCreateInfoActions; struct PlayerInfo { // existence checked by displayId != 0 - PlayerInfo() : displayId_m(0),displayId_f(0),levelInfo(NULL) + PlayerInfo() : displayId_m(0), displayId_f(0), levelInfo(NULL) { } @@ -687,8 +687,8 @@ enum TransferAbortReason TRANSFER_ABORT_NOT_FOUND = 0x03, // Transfer Aborted: instance not found TRANSFER_ABORT_TOO_MANY_INSTANCES = 0x04, // You have entered too many instances recently. TRANSFER_ABORT_ZONE_IN_COMBAT = 0x06, // Unable to zone in while an encounter is in progress. - TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x07, // You must have <TBC,WotLK> expansion installed to access this area. - TRANSFER_ABORT_DIFFICULTY = 0x08, // <Normal,Heroic,Epic> difficulty mode is not available for %s. + TRANSFER_ABORT_INSUF_EXPAN_LVL = 0x07, // You must have <TBC, WotLK> expansion installed to access this area. + TRANSFER_ABORT_DIFFICULTY = 0x08, // <Normal, Heroic, Epic> difficulty mode is not available for %s. TRANSFER_ABORT_UNIQUE_MESSAGE = 0x09, // Until you've escaped TLK's grasp, you cannot leave this place! TRANSFER_ABORT_TOO_MANY_REALM_INSTANCES = 0x0A, // Additional instances cannot be launched, please try again later. TRANSFER_ABORT_NEED_GROUP = 0x0B, // 3.1 @@ -890,7 +890,7 @@ class PlayerTaxi else return false; } - void AppendTaximaskTo(ByteBuffer& data,bool all); + void AppendTaximaskTo(ByteBuffer& data, bool all); // Destinations bool LoadTaxiDestinationsFromString(const std::string& values, uint32 team); @@ -1086,8 +1086,8 @@ class Player : public Unit, public GridObject<Player> bool ToggleAFK(); bool ToggleDND(); - bool isAFK() const { return HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_AFK); } - bool isDND() const { return HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_DND); } + bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); } + bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); } uint8 chatTag() const; std::string afkMsg; std::string dndMsg; @@ -1131,7 +1131,7 @@ class Player : public Unit, public GridObject<Player> void setDeathState(DeathState s); // overwrite Unit::setDeathState - void InnEnter (time_t time,uint32 mapid, float x,float y,float z) + void InnEnter (time_t time, uint32 mapid, float x, float y, float z) { inn_pos_mapid = mapid; inn_pos_x = x; @@ -1162,7 +1162,7 @@ class Player : public Unit, public GridObject<Player> void Say(const std::string& text, const uint32 language); 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 Whisper(const std::string& text, const uint32 language, uint64 receiver); void BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const; /*********************************************************/ @@ -1189,12 +1189,12 @@ class Player : public Unit, public GridObject<Player> Item* GetShield(bool useable = false) const; static uint8 GetAttackBySlot(uint8 slot); // MAX_ATTACK if not weapon slot std::vector<Item *> &GetItemUpdateQueue() { return m_itemUpdateQueue; } - static bool IsInventoryPos(uint16 pos) { return IsInventoryPos(pos >> 8,pos & 255); } + 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); } + static bool IsEquipmentPos(uint16 pos) { return IsEquipmentPos(pos >> 8, pos & 255); } static bool IsEquipmentPos(uint8 bag, uint8 slot); static bool IsBagPos(uint16 pos); - static bool IsBankPos(uint16 pos) { return IsBankPos(pos >> 8,pos & 255); } + static bool IsBankPos(uint16 pos) { return IsBankPos(pos >> 8, pos & 255); } static bool IsBankPos(uint8 bag, uint8 slot); bool IsValidPos(uint16 pos, bool explicit_pos) { return IsValidPos(pos >> 8, pos & 255, explicit_pos); } bool IsValidPos(uint8 bag, uint8 slot, bool explicit_pos); @@ -1205,8 +1205,8 @@ class Player : public Unit, public GridObject<Player> bool CanNoReagentCast(SpellEntry const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; - InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(),pItem->GetCount(),pItem); } - InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry,count,NULL); } + InventoryResult CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem); } + InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry, count, NULL); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = NULL) const { return _CanStoreItem(bag, slot, dest, item, count, NULL, false, no_space_count); @@ -1219,7 +1219,7 @@ class Player : public Unit, public GridObject<Player> return _CanStoreItem(bag, slot, dest, pItem->GetEntry(), count, pItem, swap, NULL); } - InventoryResult CanStoreItems(Item** pItem,int count) const; + 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; @@ -1240,7 +1240,7 @@ class Player : public Unit, public GridObject<Player> 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); - void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG,NULL_SLOT,loot_id,store,broadcast); } + void AutoStoreLoot(uint32 loot_id, LootStore const& store, bool broadcast = false) { AutoStoreLoot(NULL_BAG, NULL_SLOT, loot_id, store, broadcast); } void StoreLootItem(uint8 lootSlot, Loot* loot); InventoryResult _CanTakeMoreSimilarItems(uint32 entry, uint32 count, Item* pItem, uint32* no_space_count = NULL) const; @@ -1289,7 +1289,7 @@ class Player : public Unit, public GridObject<Player> bool IsUseEquipedWeapon(bool mainhand) const { // disarm applied only to mainhand weapon - return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED)); + return !IsInFeralForm() && (!mainhand || !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED)); } bool IsTwoHandUsed() const { @@ -1473,7 +1473,7 @@ class Player : public Unit, public GridObject<Player> static float GetFloatValueFromArray(Tokens const& data, uint16 index); static uint32 GetZoneIdFromDB(uint64 guid); static uint32 GetLevelFromDB(uint64 guid); - static bool LoadPositionFromDB(uint32& mapid, float& x,float& y,float& z,float& o, bool& in_flight, uint64 guid); + static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid); static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; } @@ -1485,10 +1485,10 @@ class Player : public Unit, public GridObject<Player> void SaveInventoryAndGoldToDB(SQLTransaction& trans); // fast save function for item/money cheating preventing void SaveGoldToDB(SQLTransaction& trans); - static void SetUInt32ValueInArray(Tokens& data,uint16 index, uint32 value); - static void SetFloatValueInArray(Tokens& data,uint16 index, float value); + static void SetUInt32ValueInArray(Tokens& data, uint16 index, uint32 value); + static void SetFloatValueInArray(Tokens& data, uint16 index, float value); static void Customize(uint64 guid, uint8 gender, uint8 skin, uint8 face, uint8 hairStyle, uint8 hairColor, uint8 facialHair); - static void SavePositionInDB(uint32 mapid, float x,float y,float z,float o,uint32 zone,uint64 guid); + static void SavePositionInDB(uint32 mapid, float x, float y, float z, float o, uint32 zone, uint64 guid); static void DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmChars = true, bool deleteFinally = false); static void DeleteOldCharacters(); @@ -1500,7 +1500,7 @@ class Player : public Unit, public GridObject<Player> void SetBindPoint(uint64 guid); void SendTalentWipeConfirm(uint64 guid); void ResetPetTalents(); - void CalcRage(uint32 damage,bool attacker); + void CalcRage(uint32 damage, bool attacker); void RegenerateAll(); void Regenerate(Powers power); void RegenerateHealth(); @@ -1707,7 +1707,7 @@ class Player : public Unit, public GridObject<Player> m_resurrectHealth = health; m_resurrectMana = mana; } - void clearResurrectRequestData() { setResurrectRequestData(0,0,0.0f,0.0f,0.0f,0,0); } + void clearResurrectRequestData() { setResurrectRequestData(0, 0, 0.0f, 0.0f, 0.0f, 0, 0); } bool isRessurectRequestedBy(uint64 guid) const { return m_resurrectGUID == guid; } bool isRessurectRequested() const { return m_resurrectGUID != 0; } void ResurectUsingRequestData(); @@ -1737,7 +1737,7 @@ class Player : public Unit, public GridObject<Player> (*itr)->SetPvP(state); } void UpdatePvP(bool state, bool override=false); - void UpdateZone(uint32 newZone,uint32 newArea); + void UpdateZone(uint32 newZone, uint32 newArea); void UpdateArea(uint32 newArea); void UpdateZoneDependentAuras(uint32 zone_id); // zones @@ -1766,7 +1766,7 @@ class Player : public Unit, public GridObject<Player> bool IsInSameRaidWith(Player const* p) const { return p == this || (GetGroup() != NULL && GetGroup() == p->GetGroup()); } void UninviteFromGroup(); static void RemoveFromGroup(Group* group, uint64 guid, RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0 , const char* reason = NULL); - void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(),GetGUID(), method); } + void RemoveFromGroup(RemoveMethod method = GROUP_REMOVEMETHOD_DEFAULT) { RemoveFromGroup(GetGroup(), GetGUID(), method); } void SendUpdateToOutOfRangeGroupMembers(); void SetInGuild(uint32 GuildId) { SetUInt32Value(PLAYER_GUILDID, GuildId); } @@ -1992,7 +1992,7 @@ class Player : public Unit, public GridObject<Player> void UpdateSkillsForLevel(); void UpdateSkillsToMaxSkillsForLevel(); // for .levelup - void ModifySkillBonus(uint32 skillid,int32 val, bool talent); + void ModifySkillBonus(uint32 skillid, int32 val, bool talent); /*********************************************************/ /*** PVP SYSTEM ***/ @@ -2044,11 +2044,11 @@ class Player : public Unit, public GridObject<Player> 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 _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); @@ -2060,7 +2060,7 @@ class Player : public Unit, public GridObject<Player> void ApplyEquipSpell(SpellEntry 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 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(); @@ -2225,7 +2225,7 @@ class Player : public Unit, public GridObject<Player> /*********************************************************/ /*** VARIOUS SYSTEMS ***/ /*********************************************************/ - void UpdateFallInformationIfNeed(MovementInfo const& minfo,uint16 opcode); + void UpdateFallInformationIfNeed(MovementInfo const& minfo, uint16 opcode); Unit *m_mover; WorldObject *m_seer; void SetFallInformation(uint32 time, float z) @@ -2759,8 +2759,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) diff --git a/src/server/game/Entities/Player/SocialMgr.cpp b/src/server/game/Entities/Player/SocialMgr.cpp index dbf9e29f87a..b85bee3e864 100755 --- a/src/server/game/Entities/Player/SocialMgr.cpp +++ b/src/server/game/Entities/Player/SocialMgr.cpp @@ -106,7 +106,7 @@ void PlayerSocial::SetFriendNote(uint32 friend_guid, std::string note) if (itr == m_playerSocialMap.end()) // not exist return; - utf8truncate(note,48); // DB and client size limitation + utf8truncate(note, 48); // DB and client size limitation CharacterDatabase.escape_string(note); CharacterDatabase.PExecute("UPDATE character_social SET note = '%s' WHERE guid = '%u' AND friend = '%u'", note.c_str(), GetPlayerGUID(), friend_guid); diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp index 2c799ca13b4..6aace74f90a 100755 --- a/src/server/game/Entities/Transport/Transport.cpp +++ b/src/server/game/Entities/Transport/Transport.cpp @@ -77,7 +77,7 @@ void MapManager::LoadTransports() if (!t->GenerateWaypoints(goinfo->moTransport.taxiPathId, mapsUsed)) // skip transports with empty waypoints list { - sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.",goinfo->moTransport.taxiPathId); + sLog->outErrorDb("Transport (path id %u) path size = 0. Transport ignored, check DBC files or transport GO data0 field.", goinfo->moTransport.taxiPathId); delete t; continue; } @@ -109,7 +109,7 @@ void MapManager::LoadTransports() while (result->NextRow()); // check transport data DB integrity - result = WorldDatabase.Query("SELECT gameobject.guid,gameobject.id,transports.name FROM gameobject,transports WHERE gameobject.id = transports.entry"); + result = WorldDatabase.Query("SELECT gameobject.guid, gameobject.id, transports.name FROM gameobject, transports WHERE gameobject.id = transports.entry"); if (result) // wrong data found { do @@ -119,7 +119,7 @@ void MapManager::LoadTransports() uint32 guid = fields[0].GetUInt32(); uint32 entry = fields[1].GetUInt32(); std::string name = fields[2].GetString(); - sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.",entry,name.c_str(),guid); + sLog->outErrorDb("Transport %u '%s' have record (GUID: %u) in `gameobject`. Transports DON'T must have any records in `gameobject` or its behavior will be unpredictable/bugged.", entry, name.c_str(), guid); } while (result->NextRow()); } @@ -195,13 +195,13 @@ Transport::~Transport() bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, float y, float z, float ang, uint32 animprogress, uint32 dynflags) { - Relocate(x,y,z,ang); + Relocate(x, y, z, ang); // instance id and phaseMask isn't set to values different from std. if (!IsPositionValid()) { sLog->outError("Transport (GUID: %u) not created. Suggested coordinates isn't valid (X: %f Y: %f)", - guidlow,x,y); + guidlow, x, y); return false; } @@ -211,7 +211,7 @@ bool Transport::Create(uint32 guidlow, uint32 entry, uint32 mapid, float x, floa if (!goinfo) { - sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f",guidlow, mapid, x, y, z, ang); + sLog->outErrorDb("Transport not created: entry in `gameobject_template` not found, guidlow: %u map: %u (X: %f Y: %f Z: %f) ang: %f", guidlow, mapid, x, y, z, ang); return false; } @@ -559,7 +559,7 @@ void Transport::Update(uint32 p_diff) m_curr = GetNextWayPoint(); m_next = GetNextWayPoint(); - DoEventIfAny(*m_curr,false); + DoEventIfAny(*m_curr, false); // first check help in case client-server transport coordinates de-synchronization if (m_curr->second.mapid != GetMapId() || m_curr->second.teleport) @@ -568,7 +568,7 @@ void Transport::Update(uint32 p_diff) } else { - Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x,m_next->second.y) + float(M_PI)); + Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z, GetAngle(m_next->second.x, m_next->second.y) + float(M_PI)); UpdateNPCPositions(); // COME BACK MARKER } @@ -577,7 +577,7 @@ void Transport::Update(uint32 p_diff) m_nextNodeTime = m_curr->first; if (m_curr == m_WayPoints.begin()) - sLog->outDebug(LOG_FILTER_TRANSPORTS," ************ BEGIN ************** %s", m_name.c_str()); + sLog->outDebug(LOG_FILTER_TRANSPORTS, " ************ BEGIN ************** %s", m_name.c_str()); sLog->outDebug(LOG_FILTER_TRANSPORTS, "%s moved to %d %f %f %f %d", m_name.c_str(), m_curr->second.id, m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid); } @@ -671,7 +671,7 @@ uint32 Transport::AddNPCPassenger(uint32 tguid, uint32 entry, float x, float y, if(!pCreature->IsPositionValid()) { - sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)",pCreature->GetGUIDLow(),pCreature->GetEntry(),pCreature->GetPositionX(),pCreature->GetPositionY()); + sLog->outError("Creature (guidlow %d, entry %d) not created. Suggested coordinates isn't valid (X: %f Y: %f)", pCreature->GetGUIDLow(), pCreature->GetEntry(), pCreature->GetPositionX(), pCreature->GetPositionY()); delete pCreature; return 0; } @@ -700,7 +700,7 @@ void Transport::UpdatePosition(MovementInfo* mi) float transport_y = mi->pos.m_positionY - (mi->t_pos.m_positionY * cos(transport_o) + mi->t_pos.m_positionX*sin(transport_o)); float transport_z = mi->pos.m_positionZ - mi->t_pos.m_positionZ; - Relocate(transport_x,transport_y,transport_z,transport_o); + Relocate(transport_x, transport_y, transport_z, transport_o); UpdateNPCPositions(); } diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp index 91be2af73b9..9e8ba3770ba 100755 --- a/src/server/game/Entities/Unit/StatSystem.cpp +++ b/src/server/game/Entities/Unit/StatSystem.cpp @@ -449,7 +449,7 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo break; } - float att_speed = GetAPMultiplier(attType,normalized); + float att_speed = GetAPMultiplier(attType, normalized); float base_value = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType)/ 14.0f * att_speed; float base_pct = GetModifierValue(unitMod, BASE_PCT); @@ -501,16 +501,16 @@ void Player::UpdateDamagePhysical(WeaponAttackType attType) { case BASE_ATTACK: default: - SetStatFloatValue(UNIT_FIELD_MINDAMAGE,mindamage); - SetStatFloatValue(UNIT_FIELD_MAXDAMAGE,maxdamage); + SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage); + SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage); break; case OFF_ATTACK: - SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE,mindamage); - SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE,maxdamage); + SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, mindamage); + SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxdamage); break; case RANGED_ATTACK: - SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE,mindamage); - SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE,maxdamage); + SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, mindamage); + SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxdamage); break; } } @@ -901,16 +901,16 @@ void Creature::UpdateDamagePhysical(WeaponAttackType attType) { case BASE_ATTACK: default: - SetStatFloatValue(UNIT_FIELD_MINDAMAGE,mindamage); - SetStatFloatValue(UNIT_FIELD_MAXDAMAGE,maxdamage); + SetStatFloatValue(UNIT_FIELD_MINDAMAGE, mindamage); + SetStatFloatValue(UNIT_FIELD_MAXDAMAGE, maxdamage); break; case OFF_ATTACK: - SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE,mindamage); - SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE,maxdamage); + SetStatFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, mindamage); + SetStatFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, maxdamage); break; case RANGED_ATTACK: - SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE,mindamage); - SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE,maxdamage); + SetStatFloatValue(UNIT_FIELD_MINRANGEDDAMAGE, mindamage); + SetStatFloatValue(UNIT_FIELD_MAXRANGEDDAMAGE, maxdamage); break; } } diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 0c78294b645..445488d7d82 100755 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -298,7 +298,7 @@ void Unit::Update(uint32 p_time) bool Unit::haveOffhandWeapon() const { if (GetTypeId() == TYPEID_PLAYER) - return this->ToPlayer()->GetWeaponForAttack(OFF_ATTACK,true); + return this->ToPlayer()->GetWeaponForAttack(OFF_ATTACK, true); else return m_canDualWield; } @@ -317,12 +317,12 @@ void Unit::SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTim if (GetTypeId() == TYPEID_PLAYER) { Traveller<Player> traveller(*(Player*)this); - transitTime = traveller.GetTotalTrevelTimeTo(x,y,z); + transitTime = traveller.GetTotalTrevelTimeTo(x, y, z); } else { Traveller<Creature> traveller(*this->ToCreature()); - transitTime = traveller.GetTotalTrevelTimeTo(x,y,z); + transitTime = traveller.GetTotalTrevelTimeTo(x, y, z); } } //float orientation = (float)atan2((double)dy, (double)dx); @@ -516,7 +516,7 @@ void Unit::GetRandomContactPoint(const Unit* obj, float &x, float &y, float &z, float combat_reach = GetCombatReach(); if (combat_reach < 0.1) // sometimes bugged for players { - //sLog->outError("Unit %u (Type: %u) has invalid combat_reach %f",GetGUIDLow(),GetTypeId(),combat_reach); + //sLog->outError("Unit %u (Type: %u) has invalid combat_reach %f", GetGUIDLow(), GetTypeId(), combat_reach); //if (GetTypeId() == TYPEID_UNIT) // sLog->outError("Creature entry %u has invalid combat_reach", this->ToCreature()->GetEntry()); combat_reach = DEFAULT_COMBAT_REACH; @@ -524,7 +524,7 @@ void Unit::GetRandomContactPoint(const Unit* obj, float &x, float &y, float &z, uint32 attacker_number = getAttackers().size(); if (attacker_number > 0) --attacker_number; - GetNearPoint(obj,x,y,z,obj->GetCombatReach(), distance2dMin+(distance2dMax-distance2dMin)*(float)rand_norm() + GetNearPoint(obj, x, y, z, obj->GetCombatReach(), distance2dMin+(distance2dMax-distance2dMin)*(float)rand_norm() , GetAngle(obj) + (attacker_number ? (static_cast<float>(M_PI/2) - static_cast<float>(M_PI) * (float)rand_norm()) * float(attacker_number) / combat_reach * 0.3f : 0)); } @@ -666,7 +666,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa sLog->outStaticDebug("DealDamageStart"); uint32 health = pVictim->GetHealth(); - sLog->outDetail("deal dmg:%d to health:%d ",damage,health); + sLog->outDetail("deal dmg:%d to health:%d ", damage, health); // duel ends when player has 1 or less hp bool duel_hasEnded = false; @@ -742,7 +742,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // random durability for items (HIT TAKEN) if (roll_chance_f(sWorld->getRate(RATE_DURABILITY_LOSS_DAMAGE))) { - EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1)); + EquipmentSlots slot = EquipmentSlots(urand(0, EQUIPMENT_SLOT_END-1)); pVictim->ToPlayer()->DurabilityPointLossForEquipSlot(slot); } } @@ -759,7 +759,7 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa // random durability for items (HIT DONE) if (roll_chance_f(sWorld->getRate(RATE_DURABILITY_LOSS_DAMAGE))) { - EquipmentSlots slot = EquipmentSlots(urand(0,EQUIPMENT_SLOT_END-1)); + EquipmentSlots slot = EquipmentSlots(urand(0, EQUIPMENT_SLOT_END-1)); this->ToPlayer()->DurabilityPointLossForEquipSlot(slot); } } @@ -822,7 +822,7 @@ void Unit::CastStop(uint32 except_spellid) { for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) if (m_currentSpells[i] && m_currentSpells[i]->m_spellInfo->Id != except_spellid) - InterruptSpell(CurrentSpellTypes(i),false); + InterruptSpell(CurrentSpellTypes(i), false); } void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, AuraEffect const * triggeredByAura, uint64 originalCaster) @@ -831,18 +831,18 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte if (!spellInfo) { - sLog->outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } - CastSpell(Victim,spellInfo,triggered,castItem,triggeredByAura, originalCaster); + CastSpell(Victim, spellInfo, triggered, castItem, triggeredByAura, originalCaster); } -void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, AuraEffect const * triggeredByAura, uint64 originalCaster) +void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem, AuraEffect const * triggeredByAura, uint64 originalCaster) { if (!spellInfo) { - sLog->outError("CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: unknown spell by caster: %s %u)", (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -889,7 +889,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId); if (!spellInfo) { - sLog->outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: unknown spell id %i by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -920,7 +920,7 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered, if (!spellInfo) { - sLog->outError("CastSpell(x,y,z): unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell(x, y, z): unknown spell id %i by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -950,13 +950,13 @@ void Unit::CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castI if (!spellInfo) { - sLog->outError("CastSpell(x,y,z): unknown spell id %i by caster: %s %u)", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell(x, y, z): unknown spell id %i by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } if (!(spellInfo->Targets & (TARGET_FLAG_OBJECT | TARGET_FLAG_OBJECT_CASTER))) { - sLog->outError("CastSpell: spell id %i by caster: %s %u) is not gameobject spell", spellId,(GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"),(GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); + sLog->outError("CastSpell: spell id %i by caster: %s %u) is not gameobject spell", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUIDLow() : GetEntry())); return; } @@ -981,7 +981,7 @@ uint32 Unit::SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage SpellNonMeleeDamage damageInfo(this, pVictim, spellInfo->Id, spellInfo->SchoolMask); damage = SpellDamageBonus(pVictim, spellInfo, damage, SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); - DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb); + DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); DealSpellDamage(&damageInfo, true); return damageInfo.damage; @@ -1394,7 +1394,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) } // Call default DealDamage - CleanDamage cleanDamage(damageInfo->cleanDamage,damageInfo->absorb,damageInfo->attackType,damageInfo->hitOutCome); + CleanDamage cleanDamage(damageInfo->cleanDamage, damageInfo->absorb, damageInfo->attackType, damageInfo->hitOutCome); DealDamage(pVictim, damageInfo->damage, &cleanDamage, DIRECT_DAMAGE, SpellSchoolMask(damageInfo->damageSchoolMask), NULL, durabilityLoss); // If this is a creature and it attacks from behind it has a probability to daze it's victim @@ -1435,7 +1435,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) { SpellEntry const *i_spellProto = (*dmgShieldItr)->GetSpellProto(); // Damage shield can be resisted... - if (SpellMissInfo missInfo = pVictim->SpellHitResult(this, i_spellProto ,false)) + if (SpellMissInfo missInfo = pVictim->SpellHitResult(this, i_spellProto , false)) { pVictim->SendSpellMiss(this, i_spellProto->Id, missInfo); continue; @@ -1451,10 +1451,10 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss) uint32 damage = (*dmgShieldItr)->GetAmount(); // No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that - pVictim->DealDamageMods(this,damage,NULL); + pVictim->DealDamageMods(this, damage, NULL); // TODO: Move this to a packet handler - WorldPacket data(SMSG_SPELLDAMAGESHIELD,(8+8+4+4+4+4)); + WorldPacket data(SMSG_SPELLDAMAGESHIELD, (8+8+4+4+4+4)); data << uint64(pVictim->GetGUID()); data << uint64(GetGUID()); data << uint32(i_spellProto->Id); @@ -1960,7 +1960,7 @@ void Unit::AttackerStateUpdate (Unit *pVictim, WeaponAttackType attType, bool ex SendAttackStateUpdate(&damageInfo); ProcDamageAndSpell(damageInfo.target, damageInfo.procAttacker, damageInfo.procVictim, damageInfo.procEx, damageInfo.damage, damageInfo.attackType); - DealMeleeDamage(&damageInfo,true); + DealMeleeDamage(&damageInfo, true); if (GetTypeId() == TYPEID_PLAYER) sLog->outStaticDebug("AttackerStateUpdate: (Player) %u attacked %u (TypeId: %u) for %u dmg, absorbed %u, blocked %u, resisted %u.", @@ -1987,7 +1987,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT // Miss chance based on melee //float miss_chance = MeleeMissChanceCalc(pVictim, attType); - float miss_chance = MeleeSpellMissChance(pVictim, attType, int32(GetWeaponSkillValue(attType,pVictim)) - int32(pVictim->GetDefenseSkillValue(this)), 0); + float miss_chance = MeleeSpellMissChance(pVictim, attType, int32(GetWeaponSkillValue(attType, pVictim)) - int32(pVictim->GetDefenseSkillValue(this)), 0); // Critical hit chance float crit_chance = GetUnitCriticalChance(attType, pVictim); @@ -1998,9 +1998,9 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(const Unit *pVictim, WeaponAttackT float parry_chance = pVictim->GetUnitParryChance(); // Useful if want to specify crit & miss chances for melee, else it could be removed - sLog->outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance,crit_chance,dodge_chance,parry_chance,block_chance); + sLog->outStaticDebug("MELEE OUTCOME: miss %f crit %f dodge %f parry %f block %f", miss_chance, crit_chance, dodge_chance, parry_chance, block_chance); - return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100),int32(parry_chance*100),int32(block_chance*100)); + return RollMeleeOutcomeAgainst(pVictim, attType, int32(crit_chance*100), int32(miss_chance*100), int32(dodge_chance*100), int32(parry_chance*100), int32(block_chance*100)); } MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttackType attType, int32 crit_chance, int32 miss_chance, int32 dodge_chance, int32 parry_chance, int32 block_chance) const @@ -2011,7 +2011,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack int32 attackerMaxSkillValueForLevel = GetMaxSkillValueForLevel(pVictim); int32 victimMaxSkillValueForLevel = pVictim->GetMaxSkillValueForLevel(this); - int32 attackerWeaponSkill = GetWeaponSkillValue(attType,pVictim); + int32 attackerWeaponSkill = GetWeaponSkillValue(attType, pVictim); int32 victimDefenseSkill = pVictim->GetDefenseSkillValue(this); // bonus from skills is 0.04% @@ -2041,7 +2041,7 @@ MeleeHitOutcome Unit::RollMeleeOutcomeAgainst (const Unit *pVictim, WeaponAttack // Dodge chance // only players can't dodge if attacker is behind - if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + if (pVictim->GetTypeId() == TYPEID_PLAYER && !pVictim->HasInArc(M_PI, this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { sLog->outStaticDebug ("RollMeleeOutcomeAgainst: attack came from behind and victim was a player."); } @@ -2171,7 +2171,7 @@ uint32 Unit::CalculateDamage(WeaponAttackType attType, bool normalized, bool add float min_damage, max_damage; if (GetTypeId() == TYPEID_PLAYER && (normalized || !addTotalPct)) - this->ToPlayer()->CalculateMinMaxDamage(attType,normalized,addTotalPct,min_damage, max_damage); + this->ToPlayer()->CalculateMinMaxDamage(attType, normalized, addTotalPct, min_damage, max_damage); else { switch (attType) @@ -2197,7 +2197,7 @@ uint32 Unit::CalculateDamage(WeaponAttackType attType, bool normalized, bool add } if (min_damage > max_damage) - std::swap(min_damage,max_damage); + std::swap(min_damage, max_damage); if (max_damage == 0.0f) max_damage = 5.0f; @@ -2241,12 +2241,12 @@ void Unit::SendMeleeAttackStop(Unit* victim) data.append(victim->GetPackGUID()); // can be 0x00... data << uint32(0); // can be 0x1 SendMessageToSet(&data, true); - sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"),victim->GetGUIDLow()); + sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow()); } bool Unit::isSpellBlocked(Unit *pVictim, SpellEntry const * /*spellProto*/, WeaponAttackType attackType) { - if (pVictim->HasInArc(M_PI,this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + if (pVictim->HasInArc(M_PI, this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { // Check creatures flags_extra for disable block if (pVictim->GetTypeId() == TYPEID_UNIT && @@ -2304,7 +2304,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) attackerWeaponSkill = getLevel() * 5; // bonus from skills is 0.04% per skill Diff else - attackerWeaponSkill = int32(GetWeaponSkillValue(attType,pVictim)); + attackerWeaponSkill = int32(GetWeaponSkillValue(attType, pVictim)); int32 skillDiff = attackerWeaponSkill - int32(pVictim->GetMaxSkillValueForLevel(this)); int32 fullSkillDiff = attackerWeaponSkill - int32(pVictim->GetDefenseSkillValue(this)); @@ -2353,7 +2353,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) if (attType == RANGED_ATTACK) { // only if in front - if (pVictim->HasInArc(M_PI,this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + if (pVictim->HasInArc(M_PI, this) || pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { int32 deflect_chance = pVictim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS)*100; tmp+=deflect_chance; @@ -2364,7 +2364,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit *pVictim, SpellEntry const *spell) } // Check for attack from behind - if (!pVictim->HasInArc(M_PI,this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + if (!pVictim->HasInArc(M_PI, this) && !pVictim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) { // Can`t dodge from behind in PvP (but its possible in PvE) if (pVictim->GetTypeId() == TYPEID_PLAYER) @@ -2646,9 +2646,9 @@ float Unit::GetUnitParryChance() const Player const* player = (Player const*)this; if (player->CanParry()) { - Item *tmpitem = player->GetWeaponForAttack(BASE_ATTACK,true); + Item *tmpitem = player->GetWeaponForAttack(BASE_ATTACK, true); if (!tmpitem) - tmpitem = player->GetWeaponForAttack(OFF_ATTACK,true); + tmpitem = player->GetWeaponForAttack(OFF_ATTACK, true); if (tmpitem) chance = GetFloatValue(PLAYER_PARRY_PERCENTAGE); @@ -2758,7 +2758,7 @@ uint32 Unit::GetWeaponSkillValue (WeaponAttackType attType, Unit const* target) uint32 value = 0; if (GetTypeId() == TYPEID_PLAYER) { - Item* item = this->ToPlayer()->GetWeaponForAttack(attType,true); + Item* item = this->ToPlayer()->GetWeaponForAttack(attType, true); // feral or unarmed skill only for base attack if (attType != BASE_ATTACK && !item) @@ -2861,7 +2861,7 @@ void Unit::_UpdateSpells(uint32 time) void Unit::_UpdateAutoRepeatSpell() { //check "realtime" interrupts - if ((GetTypeId() == TYPEID_PLAYER && ((Player*)this)->isMoving()) || IsNonMeleeSpellCasted(false,false,true,m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) + if ((GetTypeId() == TYPEID_PLAYER && ((Player*)this)->isMoving()) || IsNonMeleeSpellCasted(false, false, true, m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == 75)) { // cancel wand shoot if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) @@ -2872,7 +2872,7 @@ void Unit::_UpdateAutoRepeatSpell() //apply delay (Auto Shot (spellID 75) not affected) if (m_AutoRepeatFirstCast && getAttackTimer(RANGED_ATTACK) < 500 && m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id != 75) - setAttackTimer(RANGED_ATTACK,500); + setAttackTimer(RANGED_ATTACK, 500); m_AutoRepeatFirstCast = false; //castroutine @@ -2903,7 +2903,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) if (pSpell == m_currentSpells[CSpellType]) return; // avoid breaking self // break same type spell if it is not delayed - InterruptSpell(CSpellType,false); + InterruptSpell(CSpellType, false); // special breakage effects: switch (CSpellType) @@ -2911,7 +2911,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) case CURRENT_GENERIC_SPELL: { // generic spells always break channeled not delayed spells - InterruptSpell(CURRENT_CHANNELED_SPELL,false); + InterruptSpell(CURRENT_CHANNELED_SPELL, false); // autorepeat breaking if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL]) @@ -2927,7 +2927,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) case CURRENT_CHANNELED_SPELL: { // channel spells always break generic non-delayed and any channeled spells - InterruptSpell(CURRENT_GENERIC_SPELL,false); + InterruptSpell(CURRENT_GENERIC_SPELL, false); InterruptSpell(CURRENT_CHANNELED_SPELL); // it also does break autorepeat if not Auto Shot @@ -2943,8 +2943,8 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell) if (pSpell->m_spellInfo->Id != 75) { // generic autorepeats break generic non-delayed and channeled non-delayed spells - InterruptSpell(CURRENT_GENERIC_SPELL,false); - InterruptSpell(CURRENT_CHANNELED_SPELL,false); + InterruptSpell(CURRENT_GENERIC_SPELL, false); + InterruptSpell(CURRENT_CHANNELED_SPELL, false); } // special action: set first cast flag m_AutoRepeatFirstCast = true; @@ -3041,15 +3041,15 @@ void Unit::InterruptNonMeleeSpells(bool withDelayed, uint32 spell_id, bool withI { // generic spells are interrupted if they are not finished or delayed if (m_currentSpells[CURRENT_GENERIC_SPELL] && (!spell_id || m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == spell_id)) - InterruptSpell(CURRENT_GENERIC_SPELL,withDelayed,withInstant); + InterruptSpell(CURRENT_GENERIC_SPELL, withDelayed, withInstant); // autorepeat spells are interrupted if they are not finished or delayed if (m_currentSpells[CURRENT_AUTOREPEAT_SPELL] && (!spell_id || m_currentSpells[CURRENT_AUTOREPEAT_SPELL]->m_spellInfo->Id == spell_id)) - InterruptSpell(CURRENT_AUTOREPEAT_SPELL,withDelayed,withInstant); + InterruptSpell(CURRENT_AUTOREPEAT_SPELL, withDelayed, withInstant); // channeled spells are interrupted if they are not finished, even if they are delayed if (m_currentSpells[CURRENT_CHANNELED_SPELL] && (!spell_id || m_currentSpells[CURRENT_CHANNELED_SPELL]->m_spellInfo->Id == spell_id)) - InterruptSpell(CURRENT_CHANNELED_SPELL,true,true); + InterruptSpell(CURRENT_CHANNELED_SPELL, true, true); } Spell* Unit::FindCurrentSpellBySpellId(uint32 spell_id) const @@ -3098,12 +3098,12 @@ bool Unit::isInAccessiblePlaceFor(Creature const* c) const bool Unit::IsInWater() const { - return GetBaseMap()->IsInWater(GetPositionX(),GetPositionY(), GetPositionZ()); + return GetBaseMap()->IsInWater(GetPositionX(), GetPositionY(), GetPositionZ()); } bool Unit::IsUnderWater() const { - return GetBaseMap()->IsUnderWater(GetPositionX(),GetPositionY(),GetPositionZ()); + return GetBaseMap()->IsUnderWater(GetPositionX(), GetPositionY(), GetPositionZ()); } void Unit::DeMorph() @@ -3263,7 +3263,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo ASSERT(aurApp->GetTarget() == this); aurApp->SetRemoveMode(removeMode); Aura * aura = aurApp->GetBase(); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS,"Aura %u now is remove mode %d", aura->GetId(), removeMode); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u now is remove mode %d", aura->GetId(), removeMode); // dead loop is killing the server probably ASSERT(m_removedAurasCount < 0xFFFFFFFF); @@ -3745,7 +3745,7 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit } } -void Unit::RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId) +void Unit::RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId) { for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);) { @@ -4045,7 +4045,7 @@ void Unit::DelayOwnedAuras(uint32 spellId, uint64 caster, int32 delaytime) // update for out of range group members (on 1 slot use) aura->SetNeedClientUpdateForTargets(); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u partially interrupted on unit %u, new duration: %u ms",aura->GetId() , GetGUIDLow(), aura->GetDuration()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u partially interrupted on unit %u, new duration: %u ms", aura->GetId() , GetGUIDLow(), aura->GetDuration()); } } } @@ -4592,7 +4592,7 @@ void Unit::AddGameObject(GameObject* gameObj) // Need disable spell use for owner if (createBySpell && createBySpell->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE) // note: item based cooldowns and cooldown spell mods with charges ignored (unknown existed cases) - this->ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell,0,NULL,true); + this->ToPlayer()->AddSpellAndCategoryCooldowns(createBySpell, 0, NULL, true); } } @@ -4709,7 +4709,7 @@ void Unit::ProcDamageAndSpell(Unit *pVictim, uint32 procAttacker, uint32 procVic { // Not much to do if no flags are set. if (procAttacker) - ProcDamageAndSpellFor(false, pVictim, procAttacker, procExtra,attType, procSpell, amount, procAura); + ProcDamageAndSpellFor(false, pVictim, procAttacker, procExtra, attType, procSpell, amount, procAura); // Now go on with a victim's events'n'auras // Not much to do if no flags are set or there is no victim if (pVictim && pVictim->isAlive() && procVictim) @@ -4783,7 +4783,7 @@ void Unit::SendSpellDamageImmune(Unit * target, uint32 spellId) data << uint64(target->GetGUID()); data << uint32(spellId); data << uint8(0); // bool - log format: 0-default, 1-debug - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); } void Unit::SendAttackStateUpdate(CalcDamageInfo *damageInfo) @@ -4905,7 +4905,7 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (!triggerEntry) { - sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u",hasteSpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u", hasteSpell->Id, triggered_spell_id); return false; } @@ -4917,12 +4917,12 @@ bool Unit::HandleHasteAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger return false; if (basepoints0) - CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); else - CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); + CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); + this->ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); return true; } @@ -4967,7 +4967,7 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*damage*/, AuraE if (!triggerEntry) { - sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u",triggeredByAuraSpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleHasteAuraProc: Spell %u have not existed triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id); return false; } @@ -4979,12 +4979,12 @@ bool Unit::HandleSpellCritChanceAuraProc(Unit *pVictim, uint32 /*damage*/, AuraE return false; if (basepoints0) - CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); else - CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); + CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); + this->ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); return true; } @@ -5166,25 +5166,25 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Select class defined buff switch (getClass()) { - case CLASS_PALADIN: // 39511,40997,40998,40999,41002,41005,41009,41011,41409 - case CLASS_DRUID: // 39511,40997,40998,40999,41002,41005,41009,41011,41409 - triggered_spell_id = RAND(39511,40997,40998,40999,41002,41005,41009,41011,41409); + case CLASS_PALADIN: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409 + case CLASS_DRUID: // 39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409 + triggered_spell_id = RAND(39511, 40997, 40998, 40999, 41002, 41005, 41009, 41011, 41409); cooldown_spell_id = 39511; break; - case CLASS_ROGUE: // 39511,40997,40998,41002,41005,41011 - case CLASS_WARRIOR: // 39511,40997,40998,41002,41005,41011 - triggered_spell_id = RAND(39511,40997,40998,41002,41005,41011); + case CLASS_ROGUE: // 39511, 40997, 40998, 41002, 41005, 41011 + case CLASS_WARRIOR: // 39511, 40997, 40998, 41002, 41005, 41011 + triggered_spell_id = RAND(39511, 40997, 40998, 41002, 41005, 41011); cooldown_spell_id = 39511; break; - case CLASS_PRIEST: // 40999,41002,41005,41009,41011,41406,41409 - case CLASS_SHAMAN: // 40999,41002,41005,41009,41011,41406,41409 - case CLASS_MAGE: // 40999,41002,41005,41009,41011,41406,41409 - case CLASS_WARLOCK: // 40999,41002,41005,41009,41011,41406,41409 - triggered_spell_id = RAND(40999,41002,41005,41009,41011,41406,41409); + case CLASS_PRIEST: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 + case CLASS_SHAMAN: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 + case CLASS_MAGE: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 + case CLASS_WARLOCK: // 40999, 41002, 41005, 41009, 41011, 41406, 41409 + triggered_spell_id = RAND(40999, 41002, 41005, 41009, 41011, 41406, 41409); cooldown_spell_id = 40999; break; - case CLASS_HUNTER: // 40997,40999,41002,41005,41009,41011,41406,41409 - triggered_spell_id = RAND(40997,40999,41002,41005,41009,41011,41406,41409); + case CLASS_HUNTER: // 40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409 + triggered_spell_id = RAND(40997, 40999, 41002, 41005, 41009, 41011, 41406, 41409); cooldown_spell_id = 40997; break; default: @@ -5226,7 +5226,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (!target) { uint64 selected_guid = ToPlayer()->GetSelection(); - target = ObjectAccessor::GetUnit(*this,selected_guid); + target = ObjectAccessor::GetUnit(*this, selected_guid); if (!target) return false; } @@ -5345,7 +5345,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (!owner || owner->GetTypeId() != TYPEID_PLAYER) return false; // Glyph of Shadowfiend (need cast as self cast for owner, no hidden cooldown) - owner->CastSpell(owner,58227,true,castItem,triggeredByAura); + owner->CastSpell(owner, 58227, true, castItem, triggeredByAura); return true; } // Divine purpose @@ -5403,12 +5403,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (RandomSpells.empty()) //shouldn't happen return false; - uint8 rand_spell = irand(0,(RandomSpells.size() - 1)); - CastSpell(target,RandomSpells[rand_spell],true,castItem,triggeredByAura, originalCaster); + uint8 rand_spell = irand(0, (RandomSpells.size() - 1)); + CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster); for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr) { if (!ToPlayer()->HasSpellCooldown(*itr)) - ToPlayer()->AddSpellCooldown(*itr,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(*itr, 0, time(NULL) + cooldown); } break; } @@ -5449,12 +5449,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (RandomSpells.empty()) //shouldn't happen return false; - uint8 rand_spell = irand(0,(RandomSpells.size() - 1)); - CastSpell(target,RandomSpells[rand_spell],true,castItem,triggeredByAura, originalCaster); + uint8 rand_spell = irand(0, (RandomSpells.size() - 1)); + CastSpell(target, RandomSpells[rand_spell], true, castItem, triggeredByAura, originalCaster); for (std::vector<uint32>::iterator itr = RandomSpells.begin(); itr != RandomSpells.end(); ++itr) { if (!ToPlayer()->HasSpellCooldown(*itr)) - ToPlayer()->AddSpellCooldown(*itr,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(*itr, 0, time(NULL) + cooldown); } break; } @@ -5573,7 +5573,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger case 31571: triggered_spell_id = 57529; break; case 31572: triggered_spell_id = 57531; break; default: - sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u",dummySpell->Id); + sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u", dummySpell->Id); return false; } break; @@ -5655,7 +5655,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger case 12847: basepoints0 = int32(0.16f*damage); break; case 12848: basepoints0 = int32(0.20f*damage); break; default: - sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)",dummySpell->Id); + sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id); return false; } @@ -5687,7 +5687,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger basepoints0 = int32(CalculatePctN(damage, 15)); if (AuraEffect* aurEff = pVictim->GetAuraEffect(64413, 0, GetGUID())) { - // The shield can grow to a maximum size of 20,000 damage absorbtion + // The shield can grow to a maximum size of 20, 000 damage absorbtion aurEff->SetAmount(std::max<int32>(aurEff->GetAmount() + basepoints0, 20000)); // Refresh and return to prevent replacing the aura @@ -5751,7 +5751,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger case 29834: triggered_spell_id=29841; break; case 42770: triggered_spell_id=42771; break; default: - sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (SW)",dummySpell->Id); + sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (SW)", dummySpell->Id); return false; } @@ -5891,17 +5891,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (target) { // regen mana for pet - CastCustomSpell(target,54607,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, 54607, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); } // regen mana for caster - CastCustomSpell(this,59117,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(this, 59117, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); // Get second aura of spell for replenishment effect on party if (AuraEffect const * aurEff = (*i)->GetBase()->GetEffect(1)) { // Replenishment - roll chance if (roll_chance_i(aurEff->GetAmount())) { - CastSpell(this,57669,true, castItem, triggeredByAura); + CastSpell(this, 57669, true, castItem, triggeredByAura); } } break; @@ -5956,7 +5956,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger return false; // Energize 0.25% of max. mana - pVictim->CastSpell(pVictim,57669,true,castItem,triggeredByAura); + pVictim->CastSpell(pVictim, 57669, true, castItem, triggeredByAura); return true; // no hidden cooldown } // Divine Aegis @@ -6182,7 +6182,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Improved Leader of the Pack // Check cooldown of heal spell cooldown if (GetTypeId() == TYPEID_PLAYER && !ToPlayer()->HasSpellCooldown(34299)) - CastCustomSpell(this,60889,&basepoints1,0,0,true,0,triggeredByAura); + CastCustomSpell(this, 60889, &basepoints1, 0, 0, true, 0, triggeredByAura); break; } // Healing Touch (Dreamwalker Raiment set) @@ -6527,7 +6527,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger target = this; triggered_spell_id = 31930; // replenishment - CastSpell(this,57669,true, castItem, triggeredByAura); + CastSpell(this, 57669, true, castItem, triggeredByAura); break; } // Sanctified Wrath @@ -6536,7 +6536,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 57318; target = this; basepoints0 = triggerAmount; - CastCustomSpell(target,triggered_spell_id,&basepoints0,&basepoints0,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); return true; } // Sacred Shield @@ -6659,7 +6659,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Seal of Vengeance (damage calc on apply aura) case 31801: { - if (effIndex != 0) // effect 1,2 used by seal unleashing code + if (effIndex != 0) // effect 1, 2 used by seal unleashing code return false; // At melee attack or Hammer of the Righteous spell damage considered as melee attack @@ -6684,7 +6684,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Seal of Corruption case 53736: { - if (effIndex != 0) // effect 1,2 used by seal unleashing code + if (effIndex != 0) // effect 1, 2 used by seal unleashing code return false; // At melee attack or Hammer of the Righteous spell damage considered as melee attack @@ -6953,7 +6953,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Now compute real proc chance... uint32 chance = 20; - this->ToPlayer()->ApplySpellMod(dummySpell->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance); + this->ToPlayer()->ApplySpellMod(dummySpell->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance); Item* addWeapon = this->ToPlayer()->GetWeaponForAttack(attType == BASE_ATTACK ? OFF_ATTACK : BASE_ATTACK, true); uint32 enchant_id_add = addWeapon ? addWeapon->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)) : 0; @@ -6980,7 +6980,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger default: { sLog->outError("Unit::HandleDummyAuraProc: non handled item enchantment (rank?) %u for spell id: %u (Windfury)", - castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)),dummySpell->Id); + castItem->GetEnchantmentId(EnchantmentSlot(TEMP_ENCHANTMENT_SLOT)), dummySpell->Id); return false; } } @@ -6988,7 +6988,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger SpellEntry const* windfurySpellEntry = sSpellStore.LookupEntry(spellId); if (!windfurySpellEntry) { - sLog->outError("Unit::HandleDummyAuraProc: non existed spell id: %u (Windfury)",spellId); + sLog->outError("Unit::HandleDummyAuraProc: non existed spell id: %u (Windfury)", spellId); return false; } @@ -7000,11 +7000,11 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // apply cooldown before cast to prevent processing itself if (cooldown) - ToPlayer()->AddSpellCooldown(dummySpell->Id,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(dummySpell->Id, 0, time(NULL) + cooldown); // Attack Twice for (uint32 i = 0; i<2; ++i) - CastCustomSpell(pVictim,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(pVictim, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); return true; } @@ -7109,7 +7109,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger newCooldownDelay = 0; else newCooldownDelay -= 2; - ToPlayer()->AddSpellCooldown(16166,0, uint32(time(NULL) + newCooldownDelay)); + ToPlayer()->AddSpellCooldown(16166, 0, uint32(time(NULL) + newCooldownDelay)); WorldPacket data(SMSG_MODIFY_COOLDOWN, 4+8+4); data << uint32(16166); // Spell ID @@ -7197,7 +7197,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger basepoints0 = triggerAmount; // Glyph of Earth Shield - if (AuraEffect* aur = GetAuraEffect(63279,0)) + if (AuraEffect* aur = GetAuraEffect(63279, 0)) AddPctN(basepoints0, aur->GetAmount()); triggered_spell_id = 379; break; @@ -7240,7 +7240,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger else return false; - CastCustomSpell(pVictim,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(pVictim, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); return true; } // Improved Water Shield @@ -7397,8 +7397,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger if (pPet && pPet->getVictim() && damage && procSpell) { uint32 procDmg = damage / 2; - pPet->SendSpellNonMeleeDamageLog(pPet->getVictim(),procSpell->Id,procDmg,GetSpellSchoolMask(procSpell),0,0,false,0,false); - pPet->DealDamage(pPet->getVictim(),procDmg,NULL,SPELL_DIRECT_DAMAGE,GetSpellSchoolMask(procSpell),procSpell,true); + pPet->SendSpellNonMeleeDamageLog(pPet->getVictim(), procSpell->Id, procDmg, GetSpellSchoolMask(procSpell), 0, 0, false, 0, false); + pPet->DealDamage(pPet->getVictim(), procDmg, NULL, SPELL_DIRECT_DAMAGE, GetSpellSchoolMask(procSpell), procSpell, true); break; } else @@ -7416,7 +7416,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger { basepoints0 = CalculatePctN(int32(damage), triggerAmount); // Glyph of Unholy Blight - if (AuraEffect *glyph=GetAuraEffect(63332,0)) + if (AuraEffect *glyph=GetAuraEffect(63332, 0)) AddPctN(basepoints0, glyph->GetAmount()); // Find replaced aura to use it's remaining amount AuraEffectList const& DoTAuras = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE); @@ -7592,8 +7592,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger else continue; - basepoints0 = int32(CalculateSpellDamage(this, procSpell,i) * 0.4f); - CastCustomSpell(this,triggered_spell_id,&basepoints0,NULL,NULL,true,NULL,triggeredByAura); + basepoints0 = int32(CalculateSpellDamage(this, procSpell, i) * 0.4f); + CastCustomSpell(this, triggered_spell_id, &basepoints0, NULL, NULL, true, NULL, triggeredByAura); } return true; } @@ -7636,7 +7636,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger SpellEntry const* triggerEntry = sSpellStore.LookupEntry(triggered_spell_id); if (!triggerEntry) { - sLog->outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleDummyAuraProc: Spell %u have not existed triggered spell %u", dummySpell->Id, triggered_spell_id); return false; } @@ -7651,12 +7651,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger return false; if (basepoints0) - CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura, originalCaster); + CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura, originalCaster); else - CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura, originalCaster); + CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura, originalCaster); if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(cooldown_spell_id,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(cooldown_spell_id, 0, time(NULL) + cooldown); return true; } @@ -7698,7 +7698,7 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffe // Try handle unknown trigger spells if (!triggerEntry) { - sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleObsModEnergyAuraProc: Spell %u have not existed triggered spell %u", dummySpell->Id, triggered_spell_id); return false; } @@ -7709,12 +7709,12 @@ bool Unit::HandleObsModEnergyAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffe if (cooldown && GetTypeId() == TYPEID_PLAYER && this->ToPlayer()->HasSpellCooldown(triggered_spell_id)) return false; if (basepoints0) - CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); else - CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); + CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); + this->ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); return true; } bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellEntry const * /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) @@ -7755,7 +7755,7 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur if (!triggerEntry) { - sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u",dummySpell->Id,triggered_spell_id); + sLog->outError("Unit::HandleModDamagePctTakenAuraProc: Spell %u have not existed triggered spell %u", dummySpell->Id, triggered_spell_id); return false; } @@ -7767,12 +7767,12 @@ bool Unit::HandleModDamagePctTakenAuraProc(Unit *pVictim, uint32 /*damage*/, Aur return false; if (basepoints0) - CastCustomSpell(target,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); else - CastSpell(target,triggered_spell_id,true,castItem,triggeredByAura); + CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); + this->ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); return true; } @@ -8058,7 +8058,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig trigger_spell_id = 31643; break; default: - sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed",auraSpellInfo->Id); + sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Blazing Speed", auraSpellInfo->Id); return false; } } @@ -8078,7 +8078,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig { if ((*i)->GetMiscValue() == SPELLMOD_CHANCE_OF_SUCCESS && (*i)->GetSpellProto()->SpellIconID == 113) { - int32 value2 = CalculateSpellDamage(this, (*i)->GetSpellProto(),2); + int32 value2 = CalculateSpellDamage(this, (*i)->GetSpellProto(), 2); basepoints0 = int32(CalculatePctN(GetMaxPower(POWER_MANA), value2)); // Drain Soul CastCustomSpell(this, 18371, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); @@ -8175,7 +8175,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig trigger_spell_id = 63468; break; default: - sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots",auraSpellInfo->Id); + sLog->outError("Unit::HandleProcTriggerSpell: Spell %u miss posibly Piercing Shots", auraSpellInfo->Id); return false; } SpellEntry const *TriggerPS = sSpellStore.LookupEntry(trigger_spell_id); @@ -8300,14 +8300,14 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig case 48820: originalSpellId = 48824; break; case 48821: originalSpellId = 48825; break; default: - sLog->outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); + sLog->outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock", procSpell->Id); return false; } } SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId); if (!originalSpell) { - sLog->outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId); + sLog->outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu", originalSpellId); return false; } // percent stored in effect 1 (class scripts) base points @@ -8362,7 +8362,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig return false; if (pVictim && pVictim->isAlive()) - pVictim->getThreatManager().modifyThreatPercent(this,-10); + pVictim->getThreatManager().modifyThreatPercent(this, -10); basepoints0 = int32(CountPctFromMaxHealth(triggerAmount)); trigger_spell_id = 31616; @@ -8414,7 +8414,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig if (triggerEntry == NULL) { // Not cast unknown spell - // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?",auraSpellInfo->Id,triggeredByAura->GetEffIndex()); + // sLog->outError("Unit::HandleProcTriggerSpell: Spell %u have 0 in EffectTriggered[%d], not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex()); return false; } @@ -8583,10 +8583,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig if (cooldown && target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->HasSpellCooldown(trigger_spell_id)) return false; - target->CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); + target->CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown); + this->ToPlayer()->AddSpellCooldown(trigger_spell_id, 0, time(NULL) + cooldown); return true; } // Cast positive spell on enemy target @@ -8791,12 +8791,12 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig return false; if (basepoints0) - CastCustomSpell(target,trigger_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); else - CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura); + CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(trigger_spell_id,0,time(NULL) + cooldown); + ToPlayer()->AddSpellCooldown(trigger_spell_id, 0, time(NULL) + cooldown); return true; } @@ -8888,7 +8888,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 /*damage*/, A if (!triggerEntry) { - sLog->outError("Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u",triggered_spell_id,scriptId); + sLog->outError("Unit::HandleOverrideClassScriptAuraProc: Spell %u triggering for class script id %u", triggered_spell_id, scriptId); return false; } @@ -8898,7 +8898,7 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 /*damage*/, A CastSpell(pVictim, triggered_spell_id, true, castItem, triggeredByAura); if (cooldown && GetTypeId() == TYPEID_PLAYER) - this->ToPlayer()->AddSpellCooldown(triggered_spell_id,0,time(NULL) + cooldown); + this->ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); return true; } @@ -9081,7 +9081,7 @@ bool Unit::IsHostileTo(Unit const* unit) const } } - // common faction based case (CvC,PvC,CvP) + // common faction based case (CvC, PvC, CvP) return tester_faction->IsHostileTo(*target_faction); } @@ -9196,7 +9196,7 @@ bool Unit::IsFriendlyTo(Unit const* unit) const } } - // common faction based case (CvC,PvC,CvP) + // common faction based case (CvC, PvC, CvP) return tester_faction->IsFriendlyTo(*target_faction); } @@ -9442,7 +9442,7 @@ void Unit::ModifyAuraState(AuraState flag, bool apply) } else { - if (HasFlag(UNIT_FIELD_AURASTATE,1<<(flag-1))) + if (HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1))) { RemoveFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); @@ -9531,7 +9531,7 @@ Minion *Unit::GetFirstMinion() const if (pet->HasUnitTypeMask(UNIT_MASK_MINION)) return (Minion*)pet; - sLog->outError("Unit::GetFirstMinion: Minion %u not exist.",GUID_LOPART(pet_guid)); + sLog->outError("Unit::GetFirstMinion: Minion %u not exist.", GUID_LOPART(pet_guid)); const_cast<Unit*>(this)->SetMinionGUID(0); } @@ -9560,7 +9560,7 @@ Unit* Unit::GetCharm() const if (Unit* pet = ObjectAccessor::GetUnit(*this, charm_guid)) return pet; - sLog->outError("Unit::GetCharm: Charmed creature %u not exist.",GUID_LOPART(charm_guid)); + sLog->outError("Unit::GetCharm: Charmed creature %u not exist.", GUID_LOPART(charm_guid)); const_cast<Unit*>(this)->SetUInt64Value(UNIT_FIELD_CHARM, 0); } @@ -9977,7 +9977,7 @@ Unit* Unit::GetNextRandomRaidMemberOrPet(float radius) if (nearMembers.empty()) return NULL; - uint32 randTarget = urand(0,nearMembers.size()-1); + uint32 randTarget = urand(0, nearMembers.size()-1); return nearMembers[randTarget]; } @@ -10225,7 +10225,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Rage of Rivendare case 7293: { - if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0x02000000, 0)) { if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) AddPctF(DoneTotalMod, chain->rank * 2.0f); @@ -10235,7 +10235,7 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Twisted Faith case 7377: { - if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID())) + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetGUID())) AddPctN(DoneTotalMod, (*i)->GetAmount()); break; } @@ -10290,13 +10290,13 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 // Glyph of Shadow Word: Pain if (AuraEffect * aurEff = GetAuraEffect(55687, 0)) // Increase Mind Flay damage if Shadow Word: Pain present on target - if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID())) + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetGUID())) AddPctN(DoneTotalMod, aurEff->GetAmount()); // Twisted Faith - Mind Flay part if (AuraEffect * aurEff = GetAuraEffect(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS, SPELLFAMILY_PRIEST, 2848, 1)) // Increase Mind Flay damage if Shadow Word: Pain present on target - if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0,0, GetGUID())) + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, GetGUID())) AddPctN(DoneTotalMod, aurEff->GetAmount()); } // Smite @@ -10741,7 +10741,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM if (spellProto->SpellFamilyFlags[0] & 0x40000000) { // Sacred Shield - AuraEffect const* aura = pVictim->GetAuraEffect(58597,1); + AuraEffect const* aura = pVictim->GetAuraEffect(58597, 1); if (aura && aura->GetCasterGUID() == GetGUID()) crit_chance+=aura->GetAmount(); break; @@ -10758,7 +10758,7 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM // Lava Burst if (spellProto->SpellFamilyFlags[1] & 0x00001000) { - if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0,0, GetGUID())) + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_SHAMAN, 0x10000000, 0, 0, GetGUID())) if (pVictim->GetTotalAuraModifier(SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE) > -100) return true; break; @@ -11404,7 +11404,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att normalized = true; break; } - DoneFlatBenefit += int32(APbonus/14.0f * GetAPMultiplier(attType,normalized)); + DoneFlatBenefit += int32(APbonus/14.0f * GetAPMultiplier(attType, normalized)); } // ..taken @@ -11510,7 +11510,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att // Rage of Rivendare case 7293: { - if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0,0x02000000,0)) + if (pVictim->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_DEATHKNIGHT, 0, 0x02000000, 0)) if (SpellChainNode const *chain = sSpellMgr->GetSpellChainNode((*i)->GetId())) AddPctF(DoneTotalMod, chain->rank * 2.0f); break; @@ -11621,7 +11621,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att AuraEffect* eff0 = (*i)->GetBase()->GetEffect(0); if (!eff0 || (*i)->GetEffIndex() != 1) { - sLog->outError("Spell structure of DD (%u) changed.",(*i)->GetId()); + sLog->outError("Spell structure of DD (%u) changed.", (*i)->GetId()); continue; } @@ -11692,7 +11692,7 @@ void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply) void Unit::ApplySpellDispelImmunity(const SpellEntry * spellProto, DispelType type, bool apply) { - ApplySpellImmune(spellProto->Id,IMMUNITY_DISPEL, type, apply); + ApplySpellImmune(spellProto->Id, IMMUNITY_DISPEL, type, apply); if (apply && spellProto->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) { @@ -11732,7 +11732,7 @@ float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellEntry * s // Apply chance modifer aura if (spellProto) if (Player* modOwner = GetSpellModOwner()) - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_PROC_PER_MINUTE,PPM); + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_PROC_PER_MINUTE, PPM); return floor((WeaponSpeed * PPM) / 600.0f); // result is chance in percents (probability = Speed_in_sec * (PPM / 60)) } @@ -11770,7 +11770,7 @@ void Unit::Mount(uint32 mount, uint32 VehicleId, uint32 creatureEntry) WorldPacket data(SMSG_PLAYER_VEHICLE_DATA, GetPackGUID().size()+4); data.appendPackGUID(GetGUID()); data << uint32(VehicleId); - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); data.Initialize(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); plr->GetSession()->SendPacket(&data); @@ -11827,7 +11827,7 @@ void Unit::SetInCombatWith(Unit* enemy) Unit* eOwner = enemy->GetCharmerOrOwnerOrSelf(); if (eOwner->IsPvP()) { - SetInCombatState(true,enemy); + SetInCombatState(true, enemy); return; } @@ -11837,11 +11837,11 @@ void Unit::SetInCombatWith(Unit* enemy) Unit const* myOwner = GetCharmerOrOwnerOrSelf(); if (((Player const*)eOwner)->duel->opponent == myOwner) { - SetInCombatState(true,enemy); + SetInCombatState(true, enemy); return; } } - SetInCombatState(false,enemy); + SetInCombatState(false, enemy); } void Unit::CombatStart(Unit* target, bool initialAggro) @@ -12097,7 +12097,7 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) int32 val = dVal + curPower; if (val <= 0) { - SetPower(power,0); + SetPower(power, 0); return -curPower; } @@ -12105,12 +12105,12 @@ int32 Unit::ModifyPower(Powers power, int32 dVal) if (val < maxPower) { - SetPower(power,val); + SetPower(power, val); gain = val - curPower; } else if (curPower != maxPower) { - SetPower(power,maxPower); + SetPower(power, maxPower); gain = maxPower - curPower; } @@ -12325,7 +12325,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.Initialize(MSG_MOVE_SET_PITCH_RATE, 8+4+2+4+4+4+4+4+4+4); break; default: - sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype); + sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); return; } @@ -12384,7 +12384,7 @@ void Unit::SetSpeed(UnitMoveType mtype, float rate, bool forced) data.Initialize(SMSG_FORCE_PITCH_RATE_CHANGE, 16); break; default: - sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.",mtype); + sLog->outError("Unit::SetSpeed: Unsupported move type (%d), data not sent to client.", mtype); return; } data.append(GetPackGUID()); @@ -12439,7 +12439,7 @@ void Unit::setDeathState(DeathState s) //without this when removing IncreaseMaxHealth aura player may stuck with 1 hp //do not why since in IncreaseMaxHealth currenthealth is checked SetHealth(0); - SetPower(getPowerType(),0); + SetPower(getPowerType(), 0); } else if (s == JUST_ALIVED) RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); // clear skinnable for creature and player (at battleground) @@ -12878,7 +12878,7 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) return DIMINISHING_LEVEL_1; // If last spell was casted more than 15 seconds ago - reset the count. - if (i->stack == 0 && getMSTimeDiff(i->hitTime,getMSTime()) > 15000) + if (i->stack == 0 && getMSTimeDiff(i->hitTime, getMSTime()) > 15000) { i->hitCount = DIMINISHING_LEVEL_1; return DIMINISHING_LEVEL_1; @@ -12901,7 +12901,7 @@ void Unit::IncrDiminishing(DiminishingGroup group) i->hitCount += 1; return; } - m_Diminishing.push_back(DiminishingReturn(group,getMSTime(),DIMINISHING_LEVEL_2)); + m_Diminishing.push_back(DiminishingReturn(group, getMSTime(), DIMINISHING_LEVEL_2)); } float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit *caster, DiminishingLevels Level, int32 limitduration) @@ -12985,7 +12985,7 @@ void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply) } } -uint32 Unit::GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry) +uint32 Unit::GetSpellMaxRangeForTarget(Unit* target, const SpellRangeEntry * rangeEntry) { if (!rangeEntry) return 0; @@ -12995,7 +12995,7 @@ uint32 Unit::GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rang return uint32(rangeEntry->maxRangeHostile); return uint32(rangeEntry->maxRangeFriend); }; -uint32 Unit::GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry) +uint32 Unit::GetSpellMinRangeForTarget(Unit* target, const SpellRangeEntry * rangeEntry) { if (!rangeEntry) return 0; @@ -13005,7 +13005,7 @@ uint32 Unit::GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rang return uint32(rangeEntry->minRangeHostile); return uint32(rangeEntry->minRangeFriend); }; -uint32 Unit::GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry) +uint32 Unit::GetSpellRadiusForTarget(Unit* target, const SpellRadiusEntry * radiusEntry) { if (!radiusEntry) return 0; @@ -13018,12 +13018,12 @@ uint32 Unit::GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiu Unit* Unit::GetUnit(WorldObject& object, uint64 guid) { - return ObjectAccessor::GetUnit(object,guid); + return ObjectAccessor::GetUnit(object, guid); } Player* Unit::GetPlayer(WorldObject& object, uint64 guid) { - return ObjectAccessor::GetPlayer(object,guid); + return ObjectAccessor::GetPlayer(object, guid); } Creature* Unit::GetCreature(WorldObject& object, uint64 guid) @@ -13238,7 +13238,7 @@ float Unit::GetTotalAttackPowerValue(WeaponAttackType attType) const } } -float Unit::GetWeaponDamageRange(WeaponAttackType attType ,WeaponDamageRange type) const +float Unit::GetWeaponDamageRange(WeaponAttackType attType , WeaponDamageRange type) const { if (attType == OFF_ATTACK && !haveOffhandWeapon()) return 0.0f; @@ -13534,7 +13534,7 @@ CharmInfo::CharmInfo(Unit* unit) m_isCommandAttack(false), m_isAtStay(false), m_isFollowing(false), m_isReturning(false) { for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i) - m_charmspells[i].SetActionAndType(0,ACT_DISABLED); + m_charmspells[i].SetActionAndType(0, ACT_DISABLED); if (m_unit->GetTypeId() == TYPEID_UNIT) { @@ -13558,25 +13558,25 @@ void CharmInfo::InitPetActionBar() { // the first 3 SpellOrActions are attack, follow and stay for (uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_START - ACTION_BAR_INDEX_START; ++i) - SetActionBar(ACTION_BAR_INDEX_START + i,COMMAND_ATTACK - i,ACT_COMMAND); + SetActionBar(ACTION_BAR_INDEX_START + i, COMMAND_ATTACK - i, ACT_COMMAND); // middle 4 SpellOrActions are spells/special attacks/abilities for (uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_END-ACTION_BAR_INDEX_PET_SPELL_START; ++i) - SetActionBar(ACTION_BAR_INDEX_PET_SPELL_START + i,0,ACT_PASSIVE); + SetActionBar(ACTION_BAR_INDEX_PET_SPELL_START + i, 0, ACT_PASSIVE); // last 3 SpellOrActions are reactions for (uint32 i = 0; i < ACTION_BAR_INDEX_END - ACTION_BAR_INDEX_PET_SPELL_END; ++i) - SetActionBar(ACTION_BAR_INDEX_PET_SPELL_END + i,COMMAND_ATTACK - i,ACT_REACTION); + SetActionBar(ACTION_BAR_INDEX_PET_SPELL_END + i, COMMAND_ATTACK - i, ACT_REACTION); } void CharmInfo::InitEmptyActionBar(bool withAttack) { if (withAttack) - SetActionBar(ACTION_BAR_INDEX_START,COMMAND_ATTACK,ACT_COMMAND); + SetActionBar(ACTION_BAR_INDEX_START, COMMAND_ATTACK, ACT_COMMAND); else - SetActionBar(ACTION_BAR_INDEX_START,0,ACT_PASSIVE); + SetActionBar(ACTION_BAR_INDEX_START, 0, ACT_PASSIVE); for (uint32 x = ACTION_BAR_INDEX_START+1; x < ACTION_BAR_INDEX_END; ++x) - SetActionBar(x,0,ACT_PASSIVE); + SetActionBar(x, 0, ACT_PASSIVE); } void CharmInfo::InitPossessCreateSpells() @@ -13617,18 +13617,18 @@ void CharmInfo::InitCharmCreateSpells() if (!spellId) { - m_charmspells[x].SetActionAndType(spellId,ACT_DISABLED); + m_charmspells[x].SetActionAndType(spellId, ACT_DISABLED); continue; } if (IsPassiveSpell(spellId)) { m_unit->CastSpell(m_unit, spellId, true); - m_charmspells[x].SetActionAndType(spellId,ACT_PASSIVE); + m_charmspells[x].SetActionAndType(spellId, ACT_PASSIVE); } else { - m_charmspells[x].SetActionAndType(spellId,ACT_DISABLED); + m_charmspells[x].SetActionAndType(spellId, ACT_DISABLED); ActiveStates newstate = ACT_PASSIVE; if (spellInfo) @@ -13679,7 +13679,7 @@ bool CharmInfo::AddSpellToActionBar(uint32 spell_id, ActiveStates newstate) { if (!PetActionBar[i].GetAction() && PetActionBar[i].IsActionBarForSpell()) { - SetActionBar(i,spell_id,newstate == ACT_DECIDE ? IsAutocastableSpell(spell_id) ? ACT_DISABLED : ACT_PASSIVE : newstate); + SetActionBar(i, spell_id, newstate == ACT_DECIDE ? IsAutocastableSpell(spell_id) ? ACT_DISABLED : ACT_PASSIVE : newstate); return true; } } @@ -13696,7 +13696,7 @@ bool CharmInfo::RemoveSpellFromActionBar(uint32 spell_id) { if (PetActionBar[i].IsActionBarForSpell() && sSpellMgr->GetFirstSpellInChain(action) == first_id) { - SetActionBar(i,0,ACT_PASSIVE); + SetActionBar(i, 0, ACT_PASSIVE); return true; } } @@ -13950,7 +13950,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, // if and victim block attack if (procExtra & PROC_EX_BLOCK) { - ModifyAuraState(AURA_STATE_DEFENSE,true); + ModifyAuraState(AURA_STATE_DEFENSE, true); StartReactiveTimer(REACTIVE_DEFENSE); } } @@ -14037,7 +14037,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, bool handled = false; if (HandleAuraProc(pTarget, damage, i->aura, procSpell, procFlag, procExtra, cooldown, &handled)) { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), Id); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), Id); takeCharges = true; } @@ -14054,7 +14054,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, { case SPELL_AURA_PROC_TRIGGER_SPELL: { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); // Don`t drop charge or add cooldown for not started trigger if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -14066,7 +14066,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, SpellNonMeleeDamage damageInfo(this, pTarget, spellInfo->Id, spellInfo->SchoolMask); uint32 damage = SpellDamageBonus(pTarget, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); CalculateSpellDamageTaken(&damageInfo, damage, spellInfo); - DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb); + DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); SendSpellNonMeleeDamageLog(&damageInfo); DealSpellDamage(&damageInfo, true); takeCharges = true; @@ -14075,31 +14075,31 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, case SPELL_AURA_MANA_SHIELD: case SPELL_AURA_DUMMY: { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s dummy aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleDummyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; } case SPELL_AURA_OBS_MOD_POWER: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleObsModEnergyAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleModDamagePctTakenAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; case SPELL_AURA_MOD_MELEE_HASTE: { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleHasteAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; } case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleOverrideClassScriptAuraProc(pTarget, damage, triggeredByAura, procSpell, cooldown)) takeCharges = true; break; @@ -14107,7 +14107,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, case SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE: { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", - (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId()); + (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); HandleAuraRaidProcFromChargeWithValue(triggeredByAura); takeCharges = true; @@ -14116,7 +14116,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, case SPELL_AURA_RAID_PROC_FROM_CHARGE: { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting mending (triggered by %s dummy aura of spell %u)", - (isVictim?"a victim's":"an attacker's"),triggeredByAura->GetId()); + (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); HandleAuraRaidProcFromCharge(triggeredByAura); takeCharges = true; @@ -14124,7 +14124,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, } case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell %u (triggered with value by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (HandleProcTriggerSpell(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; @@ -14164,7 +14164,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag, takeCharges = true; break; case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id,(isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); if (procSpell && HandleSpellCritChanceAuraProc(pTarget, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) takeCharges = true; break; @@ -14304,7 +14304,7 @@ void Unit::StopMoving() //float z = sMapMgr->GetBaseMap(GetMapId())->GetHeight(GetPositionX(), GetPositionY(), GetPositionZ(), true); //if (fabs(GetPositionZ() - z) < 2.0f) // Relocate(GetPositionX(), GetPositionY(), z); - //Relocate(GetPositionX(), GetPositionY(),GetPositionZ()); + //Relocate(GetPositionX(), GetPositionY(), GetPositionZ()); if (!(GetUnitMovementFlags() & MOVEMENTFLAG_ONTRANSPORT)) SendMonsterStop(); @@ -14504,18 +14504,18 @@ Unit* Unit::SelectNearbyTarget(float dist) const return *tcIter; } -void Unit::ApplyAttackTimePercentMod(WeaponAttackType att,float val, bool apply) +void Unit::ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply) { float remainingTimePct = (float)m_attackTimer[att] / (GetAttackTime(att) * m_modAttackSpeedPct[att]); if (val > 0) { ApplyPercentModFloatVar(m_modAttackSpeedPct[att], val, !apply); - ApplyPercentModFloatValue(UNIT_FIELD_BASEATTACKTIME+att,val,!apply); + ApplyPercentModFloatValue(UNIT_FIELD_BASEATTACKTIME+att, val, !apply); } else { ApplyPercentModFloatVar(m_modAttackSpeedPct[att], -val, apply); - ApplyPercentModFloatValue(UNIT_FIELD_BASEATTACKTIME+att,-val,apply); + ApplyPercentModFloatValue(UNIT_FIELD_BASEATTACKTIME+att, -val, apply); } m_attackTimer[att] = uint32(GetAttackTime(att) * m_modAttackSpeedPct[att] * remainingTimePct); } @@ -14523,9 +14523,9 @@ void Unit::ApplyAttackTimePercentMod(WeaponAttackType att,float val, bool apply) void Unit::ApplyCastTimePercentMod(float val, bool apply) { if (val > 0) - ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED,val,!apply); + ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, val, !apply); else - ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED,-val,apply); + ApplyPercentModFloatValue(UNIT_MOD_CAST_SPEED, -val, apply); } uint32 Unit::GetCastingTimeForBonus(SpellEntry const *spellProto, DamageEffectType damagetype, uint32 CastingTime) @@ -14673,7 +14673,7 @@ float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized) bool Unit::IsUnderLastManaUseEffect() const { - return getMSTimeDiff(m_lastManaUse,getMSTime()) < 5000; + return getMSTimeDiff(m_lastManaUse, getMSTime()) < 5000; } void Unit::SetContestedPvP(Player *attackedPlayer) @@ -14719,7 +14719,7 @@ void Unit::RemovePetAura(PetAura const* petSpell) pet->RemoveAurasDueToSpell(petSpell->GetAura(pet->GetEntry())); } -Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id) +Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id) { if (GetTypeId() != TYPEID_PLAYER) return NULL; @@ -14770,7 +14770,7 @@ bool Unit::InitTamedPet(Pet * pet, uint8 level, uint32 spell_id) if (!pet->InitStatsForLevel(level)) { - sLog->outError("Pet::InitStatsForLevel() failed for creature (Entry: %u)!",pet->GetEntry()); + sLog->outError("Pet::InitStatsForLevel() failed for creature (Entry: %u)!", pet->GetEntry()); return false; } @@ -14878,7 +14878,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co // Apply chance modifer aura if (Player* modOwner = GetSpellModOwner()) { - modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance); + modOwner->ApplySpellMod(spellProto->Id, SPELLMOD_CHANCE_OF_SUCCESS, chance); } return roll_chance_f(chance); } @@ -14971,7 +14971,7 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura) if (spellProto->EffectRadiusIndex[effIdx]) radius = (float)GetSpellRadiusForTarget(triggeredByAura->GetCaster(), sSpellRadiusStore.LookupEntry(spellProto->EffectRadiusIndex[effIdx])); else - radius = (float)GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() ,sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); + radius = (float)GetSpellMaxRangeForTarget(triggeredByAura->GetCaster() , sSpellRangeStore.LookupEntry(spellProto->rangeIndex)); if (Unit * caster = triggeredByAura->GetCaster()) { @@ -14980,14 +14980,14 @@ bool Unit::HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura) if (Unit* target= GetNextRandomRaidMemberOrPet(radius)) { - CastSpell(target, spellProto, true,NULL,triggeredByAura,caster_guid); + CastSpell(target, spellProto, true, NULL, triggeredByAura, caster_guid); if (Aura * aura = target->GetAura(spellProto->Id, caster->GetGUID())) aura->SetCharges(jumps); } } } - CastSpell(this, damageSpellId, true,NULL,triggeredByAura,caster_guid); + CastSpell(this, damageSpellId, true, NULL, triggeredByAura, caster_guid); return true; } @@ -15079,7 +15079,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) if (uint32 lootid = creature->GetCreatureInfo()->lootid) loot->FillLoot(lootid, LootTemplates_Creature, pLooter, false, false, creature->GetLootMode()); - loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold,creature->GetCreatureInfo()->maxgold); + loot->generateMoneyLoot(creature->GetCreatureInfo()->mingold, creature->GetCreatureInfo()->maxgold); } player->RewardPlayerAndGroupAtKill(pVictim, false); @@ -15113,10 +15113,10 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) //Remove all expected to remove at death auras (most important negative case like DoT or periodic triggers) pVictim->RemoveAllAurasOnDeath(); // restore for use at real death - pVictim->SetUInt32Value(PLAYER_SELF_RES_SPELL,ressSpellId); + pVictim->SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId); // FORM_SPIRITOFREDEMPTION and related auras - pVictim->CastSpell(pVictim,27827,true,NULL,aurEff); + pVictim->CastSpell(pVictim, 27827, true, NULL, aurEff); SpiritOfRedemption = true; break; } @@ -15141,7 +15141,7 @@ void Unit::Kill(Unit *pVictim, bool durabilityLoss) if ((durabilityLoss && !player && !pVictim->ToPlayer()->InBattleground()) || (player && sWorld->getBoolConfig(CONFIG_DURABILITY_LOSS_IN_PVP))) { sLog->outStaticDebug("We are dead, losing %f percent durability", sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH)); - pVictim->ToPlayer()->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH),false); + pVictim->ToPlayer()->DurabilityLossAll(sWorld->getRate(RATE_DURABILITY_LOSS_ON_DEATH), false); // durability lost message WorldPacket data(SMSG_DURABILITY_DAMAGE_DEATH, 0); pVictim->ToPlayer()->GetSession()->SendPacket(&data); @@ -15360,7 +15360,7 @@ void Unit::SetStunned(bool apply) WorldPacket data(SMSG_FORCE_MOVE_ROOT, 8); data.append(GetPackGUID()); data << uint32(0); - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); } else { @@ -15377,7 +15377,7 @@ void Unit::SetStunned(bool apply) WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 8+4); data.append(GetPackGUID()); data << uint32(0); - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); // RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); } @@ -15398,13 +15398,13 @@ void Unit::SetRooted(bool apply) WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); data.append(GetPackGUID()); data << m_rootTimes; - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); } else { WorldPacket data(SMSG_SPLINE_MOVE_ROOT, 8); data.append(GetPackGUID()); - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); ToCreature()->StopMoving(); } } @@ -15417,13 +15417,13 @@ void Unit::SetRooted(bool apply) WorldPacket data(SMSG_FORCE_MOVE_UNROOT, 10); data.append(GetPackGUID()); data << ++m_rootTimes; - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); } else { WorldPacket data(SMSG_SPLINE_MOVE_UNROOT, 8); data.append(GetPackGUID()); - SendMessageToSet(&data,true); + SendMessageToSet(&data, true); } // RemoveUnitMovementFlag(MOVEMENTFLAG_ROOT); @@ -16114,19 +16114,19 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update) if (IsInWorld()) RemoveNotOwnSingleTargetAuras(newPhaseMask); // we can lost access to caster or target - WorldObject::SetPhaseMask(newPhaseMask,update); + WorldObject::SetPhaseMask(newPhaseMask, update); if (!IsInWorld()) return; for (ControlList::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr) if ((*itr)->GetTypeId() == TYPEID_UNIT) - (*itr)->SetPhaseMask(newPhaseMask,true); + (*itr)->SetPhaseMask(newPhaseMask, true); for (uint8 i = 0; i < MAX_SUMMON_SLOT; ++i) if (m_SummonSlot[i]) if (Creature *summon = GetMap()->GetCreature(m_SummonSlot[i])) - summon->SetPhaseMask(newPhaseMask,true); + summon->SetPhaseMask(newPhaseMask, true); } void Unit::UpdateObjectVisibility(bool forced) @@ -16510,7 +16510,7 @@ bool Unit::CheckPlayerCondition(Player* pPlayer) { case 35644: //Argent Warhorse case 36558: //Argent Battleworg - if (!pPlayer->HasItemOrGemWithIdEquipped(46106,1)) //Check item Argent Lance + if (!pPlayer->HasItemOrGemWithIdEquipped(46106, 1)) //Check item Argent Lance return false; default: return true; @@ -16820,9 +16820,9 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas bool Unit::SetPosition(float x, float y, float z, float orientation, bool teleport) { // prevent crash when a bad coord is sent by the client - if (!Trinity::IsValidMapCoord(x,y,z,orientation)) + if (!Trinity::IsValidMapCoord(x, y, z, orientation)) { - sLog->outDebug(LOG_FILTER_UNITS, "Unit::SetPosition(%f, %f, %f) .. bad coordinates!",x,y,z); + sLog->outDebug(LOG_FILTER_UNITS, "Unit::SetPosition(%f, %f, %f) .. bad coordinates!", x, y, z); return false; } @@ -16846,7 +16846,7 @@ bool Unit::SetPosition(float x, float y, float z, float orientation, bool telepo SetOrientation(orientation); if ((relocated || turn) && IsVehicle()) - GetVehicleKit()->RelocatePassengers(x,y,z,orientation); + GetVehicleKit()->RelocatePassengers(x, y, z, orientation); return (relocated || turn); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index faa3527d501..1d1b34e1520 100755 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -152,7 +152,7 @@ enum SpellFacingFlags #define BASE_MAXDAMAGE 2.0f #define BASE_ATTACK_TIME 2000 -// byte value (UNIT_FIELD_BYTES_1,0) +// byte value (UNIT_FIELD_BYTES_1, 0) enum UnitStandStateType { UNIT_STAND_STATE_STAND = 0, @@ -167,7 +167,7 @@ enum UnitStandStateType UNIT_STAND_STATE_SUBMERGED = 9 }; -// byte flag value (UNIT_FIELD_BYTES_1,2) +// byte flag value (UNIT_FIELD_BYTES_1, 2) enum UnitStandFlags { UNIT_STAND_FLAGS_UNK1 = 0x01, @@ -178,7 +178,7 @@ enum UnitStandFlags UNIT_STAND_FLAGS_ALL = 0xFF }; -// byte flags value (UNIT_FIELD_BYTES_1,3) +// byte flags value (UNIT_FIELD_BYTES_1, 3) enum UnitBytes1_Flags { UNIT_BYTE1_FLAG_ALWAYS_STAND = 0x01, @@ -982,7 +982,7 @@ enum CommandStates #define UNIT_ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF) #define UNIT_ACTION_BUTTON_TYPE(X) ((uint32(X) & 0xFF000000) >> 24) -#define MAKE_UNIT_ACTION_BUTTON(A,T) (uint32(A) | (uint32(T) << 24)) +#define MAKE_UNIT_ACTION_BUTTON(A, T) (uint32(A) | (uint32(T) << 24)) struct UnitActionBarEntry { @@ -1001,12 +1001,12 @@ struct UnitActionBarEntry void SetActionAndType(uint32 action, ActiveStates type) { - packedData = MAKE_UNIT_ACTION_BUTTON(action,type); + packedData = MAKE_UNIT_ACTION_BUTTON(action, type); } void SetType(ActiveStates type) { - packedData = MAKE_UNIT_ACTION_BUTTON(UNIT_ACTION_BUTTON_ACTION(packedData),type); + packedData = MAKE_UNIT_ACTION_BUTTON(UNIT_ACTION_BUTTON_ACTION(packedData), type); } void SetAction(uint32 action) @@ -1061,9 +1061,9 @@ struct CharmInfo void LoadPetActionBar(const std::string& data); void BuildActionBar(WorldPacket* data); void SetSpellAutocast(uint32 spell_id, bool state); - void SetActionBar(uint8 index, uint32 spellOrAction,ActiveStates type) + void SetActionBar(uint8 index, uint32 spellOrAction, ActiveStates type) { - PetActionBar[index].SetActionAndType(spellOrAction,type); + PetActionBar[index].SetActionAndType(spellOrAction, type); } UnitActionBarEntry const* GetActionBarEntry(uint8 index) const { return &(PetActionBar[index]); } @@ -1168,14 +1168,14 @@ class Unit : public WorldObject DiminishingLevels GetDiminishing(DiminishingGroup group); void IncrDiminishing(DiminishingGroup group); - float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration); + float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration); void ApplyDiminishingAura(DiminishingGroup group, bool apply); void ClearDiminishings() { m_Diminishing.clear(); } //target dependent range checks - uint32 GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry); - uint32 GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry); - uint32 GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry); + uint32 GetSpellMaxRangeForTarget(Unit* target, const SpellRangeEntry * rangeEntry); + uint32 GetSpellMinRangeForTarget(Unit* target, const SpellRangeEntry * rangeEntry); + uint32 GetSpellRadiusForTarget(Unit* target, const SpellRadiusEntry * radiusEntry); virtual void Update(uint32 time); @@ -1260,7 +1260,7 @@ class Unit : public WorldObject void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); } uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); } - void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school,val); } + void SetResistance(SpellSchools school, int32 val) { SetStatInt32Value(UNIT_FIELD_RESISTANCES+school, val); } uint32 GetHealth() const { return GetUInt32Value(UNIT_FIELD_HEALTH); } uint32 GetMaxHealth() const { return GetUInt32Value(UNIT_FIELD_MAXHEALTH); } @@ -1294,8 +1294,8 @@ class Unit : public WorldObject return (uint32)f_BaseAttackTime; } - void SetAttackTime(WeaponAttackType att, uint32 val) { SetFloatValue(UNIT_FIELD_BASEATTACKTIME+att,val*m_modAttackSpeedPct[att]); } - void ApplyAttackTimePercentMod(WeaponAttackType att,float val, bool apply); + void SetAttackTime(WeaponAttackType att, uint32 val) { SetFloatValue(UNIT_FIELD_BASEATTACKTIME+att, val*m_modAttackSpeedPct[att]); } + void ApplyAttackTimePercentMod(WeaponAttackType att, float val, bool apply); void ApplyCastTimePercentMod(float val, bool apply); SheathState GetSheath() const { return SheathState(GetByteValue(UNIT_FIELD_BYTES_2, 0)); } @@ -1341,8 +1341,8 @@ class Unit : public WorldObject bool IsStandState() const; void SetStandState(uint8 state); - void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, 2,flags); } - void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, 2,flags); } + void SetStandFlags(uint8 flags) { SetByteFlag(UNIT_FIELD_BYTES_1, 2, flags); } + void RemoveStandFlags(uint8 flags) { RemoveByteFlag(UNIT_FIELD_BYTES_1, 2, flags); } bool IsMounted() const { return HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_MOUNT); } uint32 GetMountID() const { return GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID); } @@ -1398,9 +1398,9 @@ class Unit : public WorldObject { switch(attacktype) { - case BASE_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISARMED); - case OFF_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_DISARM_OFFHAND); - case RANGED_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2,UNIT_FLAG2_DISARM_RANGED); + case BASE_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED); + case OFF_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISARM_OFFHAND); + case RANGED_ATTACK: return !HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_DISARM_RANGED); } return true; } @@ -1468,7 +1468,7 @@ class Unit : public WorldObject void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, uint32 OverHeal, uint32 Absorb, bool critical = false); int32 HealBySpell(Unit * pVictim, SpellEntry const * spellInfo, uint32 addHealth, bool critical = false); - void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype); + 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); @@ -1489,7 +1489,7 @@ class Unit : public WorldObject 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(Unit *target,uint32 SpellID, uint32 Damage, SpellSchoolMask damageSchoolMask, uint32 AbsorbedDamage, uint32 Resist, bool PhysicalDamage, uint32 Blocked, bool CriticalHit = false); + 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 SendSpellMiss(Unit *target, uint32 spellID, SpellMissInfo missInfo); void SendSpellDamageImmune(Unit *target, uint32 spellId); @@ -1515,7 +1515,7 @@ class Unit : public WorldObject void SendMovementFlagUpdate(); template<typename PathElem, typename PathNode> - void SendMonsterMoveByPath(Path<PathElem,PathNode> const& path, uint32 start, uint32 end); + void SendMonsterMoveByPath(Path<PathElem, PathNode> const& path, uint32 start, uint32 end); void SendChangeCurrentVictimOpcode(HostileReference* pHostileReference); void SendClearThreatListOpcode(); @@ -1610,8 +1610,8 @@ class Unit : public WorldObject void RemoveBindSightAuras(); void RemoveCharmAuras(); - Pet* CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id = 0); - Pet* CreateTamedPetFrom(uint32 creatureEntry,uint32 spell_id = 0); + 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); // aura apply/remove helpers - you should better not use these @@ -1647,10 +1647,10 @@ class Unit : public WorldObject 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); - inline void RemoveAuraFromStack(AuraMap::iterator &iter,AuraRemoveMode removeMode); + inline void RemoveAuraFromStack(AuraMap::iterator &iter, AuraRemoveMode removeMode); void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeller); void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer); - void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId); + void RemoveAurasDueToItemSpell(Item* castItem, uint32 spellId); 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); @@ -1722,7 +1722,7 @@ class Unit : public WorldObject int32 GetMaxNegativeAuraModifierByAffectMask(AuraType auratype, SpellEntry const * affectedSpell) const; float GetResistanceBuffMods(SpellSchools school, bool positive) const { return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school); } - void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school,val); } + void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val); } void ApplyResistanceBuffModsMod(SpellSchools school, bool positive, float val, bool apply) { ApplyModSignedFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); } void ApplyResistanceBuffModsPercentMod(SpellSchools school, bool positive, float val, bool apply) { ApplyPercentModFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school, val, apply); } void InitStatBuffMods() @@ -1824,10 +1824,10 @@ class Unit : public WorldObject virtual void UpdateAttackPowerAndDamage(bool ranged = false) = 0; virtual void UpdateDamagePhysical(WeaponAttackType attType) = 0; float GetTotalAttackPowerValue(WeaponAttackType attType) const; - float GetWeaponDamageRange(WeaponAttackType attType ,WeaponDamageRange type) const; - void SetBaseWeaponDamage(WeaponAttackType attType ,WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; } + float GetWeaponDamageRange(WeaponAttackType attType , WeaponDamageRange type) const; + void SetBaseWeaponDamage(WeaponAttackType attType , WeaponDamageRange damageRange, float value) { m_weaponDamage[attType][damageRange] = value; } - bool isInFrontInMap(Unit const* target,float distance, float arc = M_PI) const; + bool isInFrontInMap(Unit const* target, float distance, float arc = M_PI) const; void SetInFront(Unit const* target) { if (!HasUnitState(UNIT_STAT_CANNOT_TURN)) @@ -2235,7 +2235,7 @@ namespace Trinity } template<typename Elem, typename Node> -inline void Unit::SendMonsterMoveByPath(Path<Elem,Node> const& path, uint32 start, uint32 end) +inline void Unit::SendMonsterMoveByPath(Path<Elem, Node> const& path, uint32 start, uint32 end) { uint32 traveltime = uint32(path.GetTotalLength(start, end) * 32); uint32 pathSize = end - start; diff --git a/src/server/game/Events/GameEventMgr.cpp b/src/server/game/Events/GameEventMgr.cpp index d4d6bccfe67..004dd9d5e2d 100755 --- a/src/server/game/Events/GameEventMgr.cpp +++ b/src/server/game/Events/GameEventMgr.cpp @@ -203,7 +203,7 @@ void GameEventMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT eventEntry,UNIX_TIMESTAMP(start_time),UNIX_TIMESTAMP(end_time),occurence,length,holiday,description,world_event FROM game_event"); + QueryResult result = WorldDatabase.Query("SELECT eventEntry, UNIX_TIMESTAMP(start_time), UNIX_TIMESTAMP(end_time), occurence, length, holiday, description, world_event FROM game_event"); if (!result) { mGameEvent.clear(); @@ -238,7 +238,7 @@ void GameEventMgr::LoadFromDB() if (pGameEvent.length == 0 && pGameEvent.state == GAMEEVENT_NORMAL) // length>0 is validity check { - sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.",event_id); + sLog->outErrorDb("`game_event` game event id (%i) isn't a world event and has length = 0, thus it can't be used.", event_id); continue; } @@ -246,7 +246,7 @@ void GameEventMgr::LoadFromDB() { if (!sHolidaysStore.LookupEntry(pGameEvent.holiday_id)) { - sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.",event_id,pGameEvent.holiday_id); + sLog->outErrorDb("`game_event` game event id (%i) have not existed holiday id %u.", event_id, pGameEvent.holiday_id); pGameEvent.holiday_id = HOLIDAY_NONE; } } @@ -385,7 +385,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventCreatureGuids.size())) { - sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_creature` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -428,7 +428,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventGameobjectGuids.size())) { - sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_gameobject` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -469,7 +469,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventModelEquip.size()) { - sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_model_equip` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -526,7 +526,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventCreatureQuests.size()) { - sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_creature_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -567,7 +567,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventGameObjectQuests.size()) { - sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_gameobject_quest` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -609,7 +609,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_quest_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -650,7 +650,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_condition` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -692,7 +692,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_condition_save` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -703,7 +703,7 @@ void GameEventMgr::LoadFromDB() } else { - sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u",event_id, condition); + sLog->outErrorDb("game_event_condition_save contains not present condition evt id %u cond id %u", event_id, condition); continue; } @@ -741,11 +741,11 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_npcflag` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } - mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid,npcflag)); + mGameEventNPCFlags[event_id].push_back(GuidNPCFlagPair(guid, npcflag)); ++count; } @@ -779,7 +779,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEventVendors.size()) { - sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_npc_vendor` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -845,7 +845,7 @@ void GameEventMgr::LoadFromDB() if (event_id >= mGameEvent.size()) { - sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_battleground_holiday` game event id (%u) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -887,7 +887,7 @@ void GameEventMgr::LoadFromDB() if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`",event_id); + sLog->outErrorDb("`game_event_pool` game event id (%i) is out of range compared to max event id in `game_event`", event_id); continue; } @@ -962,11 +962,11 @@ uint32 GameEventMgr::StartSystem() // return the next void GameEventMgr::StartArenaSeason() { - QueryResult result = WorldDatabase.PQuery("SELECT eventEntry FROM game_event_arena_seasons WHERE season = '%i'",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); + QueryResult result = WorldDatabase.PQuery("SELECT eventEntry FROM game_event_arena_seasons WHERE season = '%i'", sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); if (!result) { - sLog->outError("ArenaSeason (%i) must be an existant Arena Season",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); + sLog->outError("ArenaSeason (%i) must be an existant Arena Season", sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); return; } @@ -974,8 +974,8 @@ void GameEventMgr::StartArenaSeason() uint16 eventId = fields[0].GetUInt16(); - StartEvent(eventId,true); - sLog->outString("Arena Season %i started...",sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); + StartEvent(eventId, true); + sLog->outString("Arena Season %i started...", sWorld->getIntConfig(CONFIG_ARENA_SEASON_ID)); sLog->outString(); } @@ -989,7 +989,7 @@ uint32 GameEventMgr::Update() // return the next e { // must do the activating first, and after that the deactivating // so first queue it - //sLog->outErrorDb("Checking event %u",itr); + //sLog->outErrorDb("Checking event %u", itr); if (CheckOneGameEvent(itr)) { // if the world event is in NEXTPHASE state, and the time has passed to finish this event, then do so @@ -1010,14 +1010,14 @@ uint32 GameEventMgr::Update() // return the next e // changed, save to DB the gameevent state, will be updated in next update cycle SaveWorldEventStateToDB(itr); - //sLog->outDebug("GameEvent %u is active",itr->first); + //sLog->outDebug("GameEvent %u is active", itr->first); // queue for activation if (!IsActiveEvent(itr)) activate.insert(itr); } else { - //sLog->outDebug("GameEvent %u is not active",itr->first); + //sLog->outDebug("GameEvent %u is not active", itr->first); if (IsActiveEvent(itr)) deactivate.insert(itr); else @@ -1109,14 +1109,14 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id) // get the creature data from the low guid to get the entry, to be able to find out the whole guid if (CreatureData const* data = sObjectMgr->GetCreatureData(itr->first)) { - Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first,data->id,HIGHGUID_UNIT)); + Creature * cr = HashMapHolder<Creature>::Find(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT)); // if we found the creature, modify its npcflag if (cr) { uint32 npcflag = GetNPCFlag(cr); if (const CreatureTemplate * ci = cr->GetCreatureInfo()) npcflag |= ci->npcflag; - cr->SetUInt32Value(UNIT_NPC_FLAGS,npcflag); + cr->SetUInt32Value(UNIT_NPC_FLAGS, npcflag); // reset gossip options, since the flag change might have added / removed some //cr->ResetGossipOptions(); } @@ -1168,7 +1168,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //sLog->outDebug("Spawning creature %u",*itr); + //sLog->outDebug("Spawning creature %u", *itr); if (!pCreature->LoadFromDB(*itr, map)) delete pCreature; else @@ -1234,7 +1234,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin(); itr != mGameEventCreatureGuids[internal_event_id].end(); ++itr) { // check if it's needed by another event, if so, don't remove - if (event_id > 0 && hasCreatureActiveEventExcept(*itr,event_id)) + if (event_id > 0 && hasCreatureActiveEventExcept(*itr, event_id)) continue; // Remove the creature from grid if (CreatureData const* data = sObjectMgr->GetCreatureData(*itr)) @@ -1256,7 +1256,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin(); itr != mGameEventGameobjectGuids[internal_event_id].end(); ++itr) { // check if it's needed by another event, if so, don't remove - if (event_id >0 && hasGameObjectActiveEventExcept(*itr,event_id)) + if (event_id >0 && hasGameObjectActiveEventExcept(*itr, event_id)) continue; // Remove the gameobject from grid if (GameObjectData const* data = sObjectMgr->GetGOData(*itr)) @@ -1269,7 +1269,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id) } if (internal_event_id < 0 || internal_event_id >= int32(mGameEventPoolIds.size())) { - sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")",internal_event_id,mGameEventPoolIds.size()); + sLog->outError("GameEventMgr::GameEventUnspawn attempt access to out of range mGameEventPoolIds element %u (size: " SIZEFMTD ")", internal_event_id, mGameEventPoolIds.size()); return; } @@ -1289,7 +1289,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) continue; // Update if spawned - Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id,HIGHGUID_UNIT), (Creature*)NULL); + Creature* pCreature = ObjectAccessor::GetObjectInWorld(MAKE_NEW_GUID(itr->first, data->id, HIGHGUID_UNIT), (Creature*)NULL); if (pCreature) { if (activate) @@ -1304,8 +1304,8 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) { pCreature->SetDisplayId(itr->second.modelid); pCreature->SetNativeDisplayId(itr->second.modelid); - pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius); - pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach); + pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius); + pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach); } } } @@ -1319,8 +1319,8 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) { pCreature->SetDisplayId(itr->second.modelid_prev); pCreature->SetNativeDisplayId(itr->second.modelid_prev); - pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS,minfo->bounding_radius); - pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH,minfo->combat_reach); + pCreature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, minfo->bounding_radius); + pCreature->SetFloatValue(UNIT_FIELD_COMBATREACH, minfo->combat_reach); } } } @@ -1331,7 +1331,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate) if (data2 && activate) { CreatureTemplate const *cinfo = sObjectMgr->GetCreatureTemplate(data2->id); - uint32 displayID = sObjectMgr->ChooseDisplayId(0,cinfo,data2); + uint32 displayID = sObjectMgr->ChooseDisplayId(0, cinfo, data2); CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID); if (data2->equipmentId == 0) @@ -1423,13 +1423,13 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate) for (itr = mGameEventCreatureQuests[event_id].begin(); itr != mGameEventCreatureQuests[event_id].end(); ++itr) { QuestRelations* CreatureQuestMap = sObjectMgr->GetCreatureQuestRelationMap(); - if (activate) // Add the pair(id,quest) to the multimap + if (activate) // Add the pair(id, quest) to the multimap CreatureQuestMap->insert(QuestRelations::value_type(itr->first, itr->second)); else { - if (!hasCreatureQuestActiveEventExcept(itr->second,event_id)) + if (!hasCreatureQuestActiveEventExcept(itr->second, event_id)) { - // Remove the pair(id,quest) from the multimap + // Remove the pair(id, quest) from the multimap QuestRelations::iterator qitr = CreatureQuestMap->find(itr->first); if (qitr == CreatureQuestMap->end()) continue; @@ -1448,13 +1448,13 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool activate) for (itr = mGameEventGameObjectQuests[event_id].begin(); itr != mGameEventGameObjectQuests[event_id].end(); ++itr) { QuestRelations* GameObjectQuestMap = sObjectMgr->GetGOQuestRelationMap(); - if (activate) // Add the pair(id,quest) to the multimap + if (activate) // Add the pair(id, quest) to the multimap GameObjectQuestMap->insert(QuestRelations::value_type(itr->first, itr->second)); else { - if (!hasGameObjectQuestActiveEventExcept(itr->second,event_id)) + if (!hasGameObjectQuestActiveEventExcept(itr->second, event_id)) { - // Remove the pair(id,quest) from the multimap + // Remove the pair(id, quest) from the multimap QuestRelations::iterator qitr = GameObjectQuestMap->find(itr->first); if (qitr == GameObjectQuestMap->end()) continue; @@ -1512,7 +1512,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id) // not in correct phase, return if (mGameEvent[event_id].state != GAMEEVENT_WORLD_CONDITIONS) return; - std::map<uint32,GameEventFinishCondition>::iterator citr = mGameEvent[event_id].conditions.find(condition); + std::map<uint32, GameEventFinishCondition>::iterator citr = mGameEvent[event_id].conditions.find(condition); // condition is registered if (citr != mGameEvent[event_id].conditions.end()) { @@ -1552,7 +1552,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id) bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id) { - for (std::map<uint32,GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr) + for (std::map<uint32, GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr) if (itr->second.done < itr->second.reqNum) // return false if a condition doesn't match return false; @@ -1585,7 +1585,7 @@ void GameEventMgr::SaveWorldEventStateToDB(uint16 event_id) void GameEventMgr::SendWorldStateUpdate(Player * plr, uint16 event_id) { - std::map<uint32,GameEventFinishCondition>::iterator itr; + std::map<uint32, GameEventFinishCondition>::iterator itr; for (itr = mGameEvent[event_id].conditions.begin(); itr !=mGameEvent[event_id].conditions.end(); ++itr) { if (itr->second.done_world_state) diff --git a/src/server/game/Globals/ObjectAccessor.cpp b/src/server/game/Globals/ObjectAccessor.cpp index 2405d6c2b40..7810ad458d6 100755 --- a/src/server/game/Globals/ObjectAccessor.cpp +++ b/src/server/game/Globals/ObjectAccessor.cpp @@ -59,7 +59,7 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid) case HIGHGUID_UNIT: return GetCreature(p, guid); case HIGHGUID_PET: return GetPet(p, guid); case HIGHGUID_DYNAMICOBJECT: return GetDynamicObject(p, guid); - case HIGHGUID_CORPSE: return GetCorpse(p,guid); + case HIGHGUID_CORPSE: return GetCorpse(p, guid); default: return NULL; } } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 6c0f08939a6..5dab1e0acc9 100755 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -146,14 +146,14 @@ bool normalizePlayerName(std::string& name) wchar_t wstr_buf[MAX_INTERNAL_PLAYER_NAME+1]; size_t wstr_len = MAX_INTERNAL_PLAYER_NAME; - if (!Utf8toWStr(name,&wstr_buf[0],wstr_len)) + if (!Utf8toWStr(name, &wstr_buf[0], wstr_len)) return false; wstr_buf[0] = wcharToUpper(wstr_buf[0]); for (size_t i = 1; i < wstr_len; ++i) wstr_buf[i] = wcharToLower(wstr_buf[i]); - if (!WStrToUtf8(wstr_buf,wstr_len,name)) + if (!WStrToUtf8(wstr_buf, wstr_len, name)) return false; return true; @@ -434,7 +434,7 @@ void ObjectMgr::LoadCreatureLocales() mCreatureLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry,name_loc1,subname_loc1,name_loc2,subname_loc2,name_loc3,subname_loc3,name_loc4,subname_loc4,name_loc5,subname_loc5,name_loc6,subname_loc6,name_loc7,subname_loc7,name_loc8,subname_loc8 FROM locales_creature"); + QueryResult result = WorldDatabase.Query("SELECT entry, name_loc1, subname_loc1, name_loc2, subname_loc2, name_loc3, subname_loc3, name_loc4, subname_loc4, name_loc5, subname_loc5, name_loc6, subname_loc6, name_loc7, subname_loc7, name_loc8, subname_loc8 FROM locales_creature"); if (!result) return; @@ -468,11 +468,11 @@ void ObjectMgr::LoadGossipMenuItemsLocales() mGossipMenuItemsLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT menu_id,id," - "option_text_loc1,box_text_loc1,option_text_loc2,box_text_loc2," - "option_text_loc3,box_text_loc3,option_text_loc4,box_text_loc4," - "option_text_loc5,box_text_loc5,option_text_loc6,box_text_loc6," - "option_text_loc7,box_text_loc7,option_text_loc8,box_text_loc8 " + QueryResult result = WorldDatabase.Query("SELECT menu_id, id, " + "option_text_loc1, box_text_loc1, option_text_loc2, box_text_loc2, " + "option_text_loc3, box_text_loc3, option_text_loc4, box_text_loc4, " + "option_text_loc5, box_text_loc5, option_text_loc6, box_text_loc6, " + "option_text_loc7, box_text_loc7, option_text_loc8, box_text_loc8 " "FROM locales_gossip_menu_option"); if (!result) @@ -485,7 +485,7 @@ void ObjectMgr::LoadGossipMenuItemsLocales() uint16 menuId = fields[0].GetUInt16(); uint16 id = fields[1].GetUInt16(); - GossipMenuItemsLocale& data = mGossipMenuItemsLocaleMap[MAKE_PAIR32(menuId,id)]; + GossipMenuItemsLocale& data = mGossipMenuItemsLocaleMap[MAKE_PAIR32(menuId, id)]; for (uint8 i = 1; i < TOTAL_LOCALES; ++i) { @@ -508,7 +508,7 @@ void ObjectMgr::LoadPointOfInterestLocales() mPointOfInterestLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry,icon_name_loc1,icon_name_loc2,icon_name_loc3,icon_name_loc4,icon_name_loc5,icon_name_loc6,icon_name_loc7,icon_name_loc8 FROM locales_points_of_interest"); + QueryResult result = WorldDatabase.Query("SELECT entry, icon_name_loc1, icon_name_loc2, icon_name_loc3, icon_name_loc4, icon_name_loc5, icon_name_loc6, icon_name_loc7, icon_name_loc8 FROM locales_points_of_interest"); if (!result) return; @@ -1252,7 +1252,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32 &display return NULL; // If a model for another gender exists, 50% chance to use it - if (minfo->modelid_other_gender != 0 && urand(0,1) == 0) + if (minfo->modelid_other_gender != 0 && urand(0, 1) == 0) { CreatureModelInfo const *minfo_tmp = GetCreatureModelInfo(minfo->modelid_other_gender); if (!minfo_tmp) @@ -1585,11 +1585,11 @@ void ObjectMgr::LoadCreatures() difficultyCreatures[diff].insert(itr->second.DifficultyEntry[diff]); // Build single time for check spawnmask - std::map<uint32,uint32> spawnMasks; + std::map<uint32, uint32> spawnMasks; for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i) if (sMapStore.LookupEntry(i)) for (int k = 0; k < MAX_DIFFICULTY; ++k) - if (GetMapDifficultyData(i,Difficulty(k))) + if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); uint32 count = 0; @@ -1635,12 +1635,12 @@ void ObjectMgr::LoadCreatures() MapEntry const* mapEntry = sMapStore.LookupEntry(data.mapid); if (!mapEntry) { - sLog->outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.",guid, data.mapid); + sLog->outErrorDb("Table `creature` have creature (GUID: %u) that spawned at not existed map (Id: %u), skipped.", guid, data.mapid); continue; } if (data.spawnMask & ~spawnMasks[data.mapid]) - sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).",guid, data.spawnMask, data.mapid); + sLog->outErrorDb("Table `creature` have creature (GUID: %u) that have wrong spawn mask %u including not supported difficulty modes for map (Id: %u).", guid, data.spawnMask, data.mapid); bool ok = true; for (uint32 diff = 0; diff < MAX_DIFFICULTY - 1 && ok; ++diff) @@ -1729,7 +1729,7 @@ void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data) CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid,i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; cell_guids.creatures.insert(guid); } } @@ -1745,7 +1745,7 @@ void ObjectMgr::RemoveCreatureFromGrid(uint32 guid, CreatureData const* data) CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid,i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; cell_guids.creatures.erase(guid); } } @@ -1898,7 +1898,7 @@ void ObjectMgr::LoadGameobjects() uint32 count = 0; // 0 1 2 3 4 5 6 - QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation," + QueryResult result = WorldDatabase.Query("SELECT gameobject.guid, id, map, position_x, position_y, position_z, orientation, " // 7 8 9 10 11 12 13 14 15 16 17 "rotation0, rotation1, rotation2, rotation3, spawntimesecs, animprogress, state, spawnMask, phaseMask, eventEntry, pool_entry " "FROM gameobject LEFT OUTER JOIN game_event_gameobject ON gameobject.guid = game_event_gameobject.guid " @@ -1912,11 +1912,11 @@ void ObjectMgr::LoadGameobjects() } // build single time for check spawnmask - std::map<uint32,uint32> spawnMasks; + std::map<uint32, uint32> spawnMasks; for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i) if (sMapStore.LookupEntry(i)) for (int k = 0; k < MAX_DIFFICULTY; ++k) - if (GetMapDifficultyData(i,Difficulty(k))) + if (GetMapDifficultyData(i, Difficulty(k))) spawnMasks[i] |= (1 << k); do @@ -1948,7 +1948,7 @@ void ObjectMgr::LoadGameobjects() if (gInfo->displayId && !sGameObjectDisplayInfoStore.LookupEntry(gInfo->displayId)) { - sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.",guid, entry, gInfo->type, gInfo->displayId); + sLog->outErrorDb("Gameobject (GUID: %u Entry %u GoType: %u) has an invalid displayId (%u), not loaded.", guid, entry, gInfo->type, gInfo->displayId); continue; } @@ -1975,7 +1975,7 @@ void ObjectMgr::LoadGameobjects() if (data.spawntimesecs == 0 && gInfo->IsDespawnAtAction()) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.",guid,data.id); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `spawntimesecs` (0) value, but the gameobejct is marked as despawnable at action.", guid, data.id); } data.animprogress = fields[12].GetUInt32(); @@ -1984,7 +1984,7 @@ void ObjectMgr::LoadGameobjects() uint32 go_state = fields[13].GetUInt32(); if (go_state >= MAX_GO_STATE) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip",guid,data.id,go_state); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid `state` (%u) value, skip", guid, data.id, go_state); continue; } data.go_state = GOState(go_state); @@ -2000,25 +2000,25 @@ void ObjectMgr::LoadGameobjects() if (data.rotation2 < -1.0f || data.rotation2 > 1.0f) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip",guid,data.id,data.rotation2); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation2 (%f) value, skip", guid, data.id, data.rotation2); continue; } if (data.rotation3 < -1.0f || data.rotation3 > 1.0f) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip",guid,data.id,data.rotation3); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid rotation3 (%f) value, skip", guid, data.id, data.rotation3); continue; } - if (!MapManager::IsValidMapCoord(data.mapid,data.posX,data.posY,data.posZ,data.orientation)) + if (!MapManager::IsValidMapCoord(data.mapid, data.posX, data.posY, data.posZ, data.orientation)) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip",guid,data.id); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with invalid coordinates, skip", guid, data.id); continue; } if (data.phaseMask == 0) { - sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.",guid,data.id); + sLog->outErrorDb("Table `gameobject` has gameobject (GUID: %u Entry: %u) with `phaseMask`=0 (not visible for anyone), set to 1.", guid, data.id); data.phaseMask = 1; } @@ -2042,7 +2042,7 @@ void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data) CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid,i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; cell_guids.gameobjects.insert(guid); } } @@ -2058,7 +2058,7 @@ void ObjectMgr::RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data CellPair cell_pair = Trinity::ComputeCellPair(data->posX, data->posY); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid,i)][cell_id]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(data->mapid, i)][cell_id]; cell_guids.gameobjects.erase(guid); } } @@ -2086,7 +2086,7 @@ void ObjectMgr::LoadCreatureRespawnTimes() uint32 respawn_time = fields[1].GetUInt32(); uint32 instance = fields[2].GetUInt32(); - mCreatureRespawnTimes[MAKE_PAIR64(loguid,instance)] = time_t(respawn_time); + mCreatureRespawnTimes[MAKE_PAIR64(loguid, instance)] = time_t(respawn_time); ++count; } while (result->NextRow()); @@ -2120,7 +2120,7 @@ void ObjectMgr::LoadGameobjectRespawnTimes() uint32 respawn_time = fields[1].GetUInt32(); uint32 instance = fields[2].GetUInt32(); - mGORespawnTimes[MAKE_PAIR64(loguid,instance)] = time_t(respawn_time); + mGORespawnTimes[MAKE_PAIR64(loguid, instance)] = time_t(respawn_time); ++count; } while (result->NextRow()); @@ -2225,7 +2225,7 @@ void ObjectMgr::LoadItemLocales() mItemLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry,name_loc1,description_loc1,name_loc2,description_loc2,name_loc3,description_loc3,name_loc4,description_loc4,name_loc5,description_loc5,name_loc6,description_loc6,name_loc7,description_loc7,name_loc8,description_loc8 FROM locales_item"); + QueryResult result = WorldDatabase.Query("SELECT entry, name_loc1, description_loc1, name_loc2, description_loc2, name_loc3, description_loc3, name_loc4, description_loc4, name_loc5, description_loc5, name_loc6, description_loc6, name_loc7, description_loc7, name_loc8, description_loc8 FROM locales_item"); if (!result) return; @@ -2348,8 +2348,8 @@ void ObjectMgr::LoadItemTemplates() for (uint8 i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i) { - itemTemplate.Damage[i].DamageMax = fields[50 + i*3].GetFloat(); - itemTemplate.Damage[i].DamageMin = fields[51 + i*3].GetFloat(); + itemTemplate.Damage[i].DamageMin = fields[50 + i*3].GetFloat(); + itemTemplate.Damage[i].DamageMax = fields[51 + i*3].GetFloat(); itemTemplate.Damage[i].DamageType = uint32(fields[52 + i*3].GetUInt8()); } @@ -2469,13 +2469,13 @@ void ObjectMgr::LoadItemTemplates() if (itemTemplate.SubClass >= MaxItemSubclassValues[itemTemplate.Class]) { - sLog->outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u",entry,itemTemplate.SubClass,itemTemplate.Class); + sLog->outErrorDb("Item (Entry: %u) has wrong Subclass value (%u) for class %u", entry, itemTemplate.SubClass, itemTemplate.Class); itemTemplate.SubClass = 0;// exist for all item classes } if (itemTemplate.Quality >= MAX_ITEM_QUALITY) { - sLog->outErrorDb("Item (Entry: %u) has wrong Quality value (%u)",entry,itemTemplate.Quality); + sLog->outErrorDb("Item (Entry: %u) has wrong Quality value (%u)", entry, itemTemplate.Quality); itemTemplate.Quality = ITEM_QUALITY_NORMAL; } @@ -2500,19 +2500,19 @@ void ObjectMgr::LoadItemTemplates() if (itemTemplate.BuyCount <= 0) { - sLog->outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).",entry,itemTemplate.BuyCount); + sLog->outErrorDb("Item (Entry: %u) has wrong BuyCount value (%u), set to default(1).", entry, itemTemplate.BuyCount); itemTemplate.BuyCount = 1; } if (itemTemplate.InventoryType >= MAX_INVTYPE) { - sLog->outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)",entry,itemTemplate.InventoryType); + sLog->outErrorDb("Item (Entry: %u) has wrong InventoryType value (%u)", entry, itemTemplate.InventoryType); itemTemplate.InventoryType = INVTYPE_NON_EQUIP; } if (itemTemplate.RequiredSkill >= MAX_SKILL_TYPE) { - sLog->outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)",entry,itemTemplate.RequiredSkill); + sLog->outErrorDb("Item (Entry: %u) has wrong RequiredSkill value (%u)", entry, itemTemplate.RequiredSkill); itemTemplate.RequiredSkill = 0; } @@ -2532,21 +2532,21 @@ void ObjectMgr::LoadItemTemplates() if (req) { if (!(itemTemplate.AllowableClass & CLASSMASK_ALL_PLAYABLE)) - sLog->outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.",entry,itemTemplate.AllowableClass); + sLog->outErrorDb("Item (Entry: %u) does not have any playable classes (%u) in `AllowableClass` and can't be equipped or used.", entry, itemTemplate.AllowableClass); if (!(itemTemplate.AllowableRace & RACEMASK_ALL_PLAYABLE)) - sLog->outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.",entry,itemTemplate.AllowableRace); + sLog->outErrorDb("Item (Entry: %u) does not have any playable races (%u) in `AllowableRace` and can't be equipped or used.", entry, itemTemplate.AllowableRace); } } if (itemTemplate.RequiredSpell && !sSpellStore.LookupEntry(itemTemplate.RequiredSpell)) { - sLog->outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)",entry,itemTemplate.RequiredSpell); + sLog->outErrorDb("Item (Entry: %u) has a wrong (non-existing) spell in RequiredSpell (%u)", entry, itemTemplate.RequiredSpell); itemTemplate.RequiredSpell = 0; } if (itemTemplate.RequiredReputationRank >= MAX_REPUTATION_RANK) - sLog->outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.",entry,itemTemplate.RequiredReputationRank); + sLog->outErrorDb("Item (Entry: %u) has wrong reputation rank in RequiredReputationRank (%u), item can't be used.", entry, itemTemplate.RequiredReputationRank); if (itemTemplate.RequiredReputationFaction) { @@ -2562,30 +2562,30 @@ void ObjectMgr::LoadItemTemplates() if (itemTemplate.MaxCount < -1) { - sLog->outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.",entry,itemTemplate.MaxCount); + sLog->outErrorDb("Item (Entry: %u) has too large negative in maxcount (%i), replace by value (-1) no storing limits.", entry, itemTemplate.MaxCount); itemTemplate.MaxCount = -1; } if (itemTemplate.Stackable == 0) { - sLog->outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.",entry,itemTemplate.Stackable); + sLog->outErrorDb("Item (Entry: %u) has wrong value in stackable (%i), replace by default 1.", entry, itemTemplate.Stackable); itemTemplate.Stackable = 1; } else if (itemTemplate.Stackable < -1) { - sLog->outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.",entry,itemTemplate.Stackable); + sLog->outErrorDb("Item (Entry: %u) has too large negative in stackable (%i), replace by value (-1) no stacking limits.", entry, itemTemplate.Stackable); itemTemplate.Stackable = -1; } if (itemTemplate.ContainerSlots > MAX_BAG_SIZE) { - sLog->outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).",entry,itemTemplate.ContainerSlots,MAX_BAG_SIZE); + sLog->outErrorDb("Item (Entry: %u) has too large value in ContainerSlots (%u), replace by hardcoded limit (%u).", entry, itemTemplate.ContainerSlots, MAX_BAG_SIZE); itemTemplate.ContainerSlots = MAX_BAG_SIZE; } if (itemTemplate.StatsCount > MAX_ITEM_PROTO_STATS) { - sLog->outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).",entry,itemTemplate.StatsCount,MAX_ITEM_PROTO_STATS); + sLog->outErrorDb("Item (Entry: %u) has too large value in statscount (%u), replace by hardcoded limit (%u).", entry, itemTemplate.StatsCount, MAX_ITEM_PROTO_STATS); itemTemplate.StatsCount = MAX_ITEM_PROTO_STATS; } @@ -2594,7 +2594,7 @@ void ObjectMgr::LoadItemTemplates() // for ItemStatValue != 0 if (itemTemplate.ItemStat[j].ItemStatValue && itemTemplate.ItemStat[j].ItemStatType >= MAX_ITEM_MOD) { - sLog->outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)",entry,j+1,itemTemplate.ItemStat[j].ItemStatType); + sLog->outErrorDb("Item (Entry: %u) has wrong (non-existing?) stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); itemTemplate.ItemStat[j].ItemStatType = 0; } @@ -2602,7 +2602,7 @@ void ObjectMgr::LoadItemTemplates() { case ITEM_MOD_SPELL_HEALING_DONE: case ITEM_MOD_SPELL_DAMAGE_DONE: - sLog->outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)",entry,j+1,itemTemplate.ItemStat[j].ItemStatType); + sLog->outErrorDb("Item (Entry: %u) has deprecated stat_type%d (%u)", entry, j+1, itemTemplate.ItemStat[j].ItemStatType); break; default: break; @@ -2613,7 +2613,7 @@ void ObjectMgr::LoadItemTemplates() { if (itemTemplate.Damage[j].DamageType >= MAX_SPELL_SCHOOL) { - sLog->outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)",entry,j+1,itemTemplate.Damage[j].DamageType); + sLog->outErrorDb("Item (Entry: %u) has wrong dmg_type%d (%u)", entry, j+1, itemTemplate.Damage[j].DamageType); itemTemplate.Damage[j].DamageType = 0; } } @@ -2624,7 +2624,7 @@ void ObjectMgr::LoadItemTemplates() // spell_1 if (itemTemplate.Spells[0].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format",entry,0+1,itemTemplate.Spells[0].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format", entry, 0+1, itemTemplate.Spells[0].SpellTrigger); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[0].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; itemTemplate.Spells[1].SpellId = 0; @@ -2634,14 +2634,14 @@ void ObjectMgr::LoadItemTemplates() // spell_2 have learning spell if (itemTemplate.Spells[1].SpellTrigger != ITEM_SPELLTRIGGER_LEARN_SPELL_ID) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.",entry,1+1,itemTemplate.Spells[1].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u) for special learning format.", entry, 1+1, itemTemplate.Spells[1].SpellTrigger); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } else if (!itemTemplate.Spells[1].SpellId) { - sLog->outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.",entry,1+1); + sLog->outErrorDb("Item (Entry: %u) does not have an expected spell in spellid_%d in special learning format.", entry, 1+1); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } @@ -2650,7 +2650,7 @@ void ObjectMgr::LoadItemTemplates() SpellEntry const* spellInfo = sSpellStore.LookupEntry(itemTemplate.Spells[1].SpellId); if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, NULL)) { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",entry,1+1,itemTemplate.Spells[1].SpellId); + sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; @@ -2658,25 +2658,25 @@ void ObjectMgr::LoadItemTemplates() // allowed only in special format else if ((itemTemplate.Spells[1].SpellId == 483) || (itemTemplate.Spells[1].SpellId == 55884)) { - sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",entry,1+1,itemTemplate.Spells[1].SpellId); + sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId); itemTemplate.Spells[0].SpellId = 0; itemTemplate.Spells[1].SpellId = 0; itemTemplate.Spells[1].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } } - // spell_3*,spell_4*,spell_5* is empty + // spell_3*, spell_4*, spell_5* is empty for (uint8 j = 2; j < MAX_ITEM_PROTO_SPELLS; ++j) { if (itemTemplate.Spells[j].SpellTrigger != ITEM_SPELLTRIGGER_ON_USE) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",entry,j+1,itemTemplate.Spells[j].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); itemTemplate.Spells[j].SpellId = 0; itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } else if (itemTemplate.Spells[j].SpellId != 0) { - sLog->outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format",entry,j+1,itemTemplate.Spells[j].SpellId); + sLog->outErrorDb("Item (Entry: %u) has wrong spell in spellid_%d (%d) for learning special format", entry, j+1, itemTemplate.Spells[j].SpellId); itemTemplate.Spells[j].SpellId = 0; } } @@ -2688,7 +2688,7 @@ void ObjectMgr::LoadItemTemplates() { if (itemTemplate.Spells[j].SpellTrigger >= MAX_ITEM_SPELLTRIGGER || itemTemplate.Spells[j].SpellTrigger == ITEM_SPELLTRIGGER_LEARN_SPELL_ID) { - sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)",entry,j+1,itemTemplate.Spells[j].SpellTrigger); + sLog->outErrorDb("Item (Entry: %u) has wrong item spell trigger value in spelltrigger_%d (%u)", entry, j+1, itemTemplate.Spells[j].SpellTrigger); itemTemplate.Spells[j].SpellId = 0; itemTemplate.Spells[j].SpellTrigger = ITEM_SPELLTRIGGER_ON_USE; } @@ -2698,13 +2698,13 @@ void ObjectMgr::LoadItemTemplates() SpellEntry const* spellInfo = sSpellStore.LookupEntry(itemTemplate.Spells[j].SpellId); if (!spellInfo && !sDisableMgr->IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, NULL)) { - sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)",entry,j+1,itemTemplate.Spells[j].SpellId); + sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); itemTemplate.Spells[j].SpellId = 0; } // allowed only in special format else if ((itemTemplate.Spells[j].SpellId == 483) || (itemTemplate.Spells[j].SpellId == 55884)) { - sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)",entry,j+1,itemTemplate.Spells[j].SpellId); + sLog->outErrorDb("Item (Entry: %u) has broken spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId); itemTemplate.Spells[j].SpellId = 0; } } @@ -2712,17 +2712,17 @@ void ObjectMgr::LoadItemTemplates() } if (itemTemplate.Bonding >= MAX_BIND_TYPE) - sLog->outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)",entry,itemTemplate.Bonding); + sLog->outErrorDb("Item (Entry: %u) has wrong Bonding value (%u)", entry, itemTemplate.Bonding); if (itemTemplate.PageText && !GetPageText(itemTemplate.PageText)) - sLog->outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", entry,itemTemplate.PageText); + sLog->outErrorDb("Item (Entry: %u) has non existing first page (Id:%u)", entry, itemTemplate.PageText); if (itemTemplate.LockID && !sLockStore.LookupEntry(itemTemplate.LockID)) - sLog->outErrorDb("Item (Entry: %u) has wrong LockID (%u)",entry,itemTemplate.LockID); + sLog->outErrorDb("Item (Entry: %u) has wrong LockID (%u)", entry, itemTemplate.LockID); if (itemTemplate.Sheath >= MAX_SHEATHETYPE) { - sLog->outErrorDb("Item (Entry: %u) has wrong Sheath (%u)",entry,itemTemplate.Sheath); + sLog->outErrorDb("Item (Entry: %u) has wrong Sheath (%u)", entry, itemTemplate.Sheath); itemTemplate.Sheath = SHEATHETYPE_NONE; } @@ -2734,28 +2734,28 @@ void ObjectMgr::LoadItemTemplates() else if (!sItemRandomPropertiesStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomProperty))) { - sLog->outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)",entry,itemTemplate.RandomProperty); + sLog->outErrorDb("Item (Entry: %u) has unknown (wrong or not listed in `item_enchantment_template`) RandomProperty (%u)", entry, itemTemplate.RandomProperty); itemTemplate.RandomProperty = 0; } } if (itemTemplate.RandomSuffix && !sItemRandomSuffixStore.LookupEntry(GetItemEnchantMod(itemTemplate.RandomSuffix))) { - sLog->outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)",entry,itemTemplate.RandomSuffix); + sLog->outErrorDb("Item (Entry: %u) has wrong RandomSuffix (%u)", entry, itemTemplate.RandomSuffix); itemTemplate.RandomSuffix = 0; } if (itemTemplate.ItemSet && !sItemSetStore.LookupEntry(itemTemplate.ItemSet)) { - sLog->outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)",entry,itemTemplate.ItemSet); + sLog->outErrorDb("Item (Entry: %u) have wrong ItemSet (%u)", entry, itemTemplate.ItemSet); itemTemplate.ItemSet = 0; } if (itemTemplate.Area && !GetAreaEntryByAreaID(itemTemplate.Area)) - sLog->outErrorDb("Item (Entry: %u) has wrong Area (%u)",entry,itemTemplate.Area); + sLog->outErrorDb("Item (Entry: %u) has wrong Area (%u)", entry, itemTemplate.Area); if (itemTemplate.Map && !sMapStore.LookupEntry(itemTemplate.Map)) - sLog->outErrorDb("Item (Entry: %u) has wrong Map (%u)",entry,itemTemplate.Map); + sLog->outErrorDb("Item (Entry: %u) has wrong Map (%u)", entry, itemTemplate.Map); if (itemTemplate.BagFamily) { @@ -2787,29 +2787,29 @@ void ObjectMgr::LoadItemTemplates() } if (itemTemplate.TotemCategory && !sTotemCategoryStore.LookupEntry(itemTemplate.TotemCategory)) - sLog->outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)",entry,itemTemplate.TotemCategory); + sLog->outErrorDb("Item (Entry: %u) has wrong TotemCategory (%u)", entry, itemTemplate.TotemCategory); for (uint8 j = 0; j < MAX_ITEM_PROTO_SOCKETS; ++j) { if (itemTemplate.Socket[j].Color && (itemTemplate.Socket[j].Color & SOCKET_COLOR_ALL) != itemTemplate.Socket[j].Color) { - sLog->outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)",entry,j+1,itemTemplate.Socket[j].Color); + sLog->outErrorDb("Item (Entry: %u) has wrong socketColor_%d (%u)", entry, j+1, itemTemplate.Socket[j].Color); itemTemplate.Socket[j].Color = 0; } } if (itemTemplate.GemProperties && !sGemPropertiesStore.LookupEntry(itemTemplate.GemProperties)) - sLog->outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)",entry,itemTemplate.GemProperties); + sLog->outErrorDb("Item (Entry: %u) has wrong GemProperties (%u)", entry, itemTemplate.GemProperties); if (itemTemplate.FoodType >= MAX_PET_DIET) { - sLog->outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)",entry,itemTemplate.FoodType); + sLog->outErrorDb("Item (Entry: %u) has wrong FoodType value (%u)", entry, itemTemplate.FoodType); itemTemplate.FoodType = 0; } if (itemTemplate.ItemLimitCategory && !sItemLimitCategoryStore.LookupEntry(itemTemplate.ItemLimitCategory)) { - sLog->outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)",entry,itemTemplate.ItemLimitCategory); + sLog->outErrorDb("Item (Entry: %u) has wrong LimitCategory value (%u)", entry, itemTemplate.ItemLimitCategory); itemTemplate.ItemLimitCategory = 0; } @@ -2865,7 +2865,7 @@ void ObjectMgr::LoadItemSetNameLocales() mItemSetNameLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT `entry`,`name_loc1`,`name_loc2`,`name_loc3`,`name_loc4`,`name_loc5`,`name_loc6`,`name_loc7`,`name_loc8` FROM `locales_item_set_names`"); + QueryResult result = WorldDatabase.Query("SELECT `entry`, `name_loc1`, `name_loc2`, `name_loc3`, `name_loc4`, `name_loc5`, `name_loc6`, `name_loc7`, `name_loc8` FROM `locales_item_set_names`"); if (!result) return; @@ -2909,7 +2909,7 @@ void ObjectMgr::LoadItemSetNames() itemSetItems.insert(setEntry->itemId[i]); } - QueryResult result = WorldDatabase.Query("SELECT `entry`,`name`,`InventoryType` FROM `item_set_names`"); + QueryResult result = WorldDatabase.Query("SELECT `entry`, `name`, `InventoryType` FROM `item_set_names`"); if (!result) { @@ -2979,7 +2979,7 @@ void ObjectMgr::LoadVehicleTemplateAccessories() uint32 count = 0; - QueryResult result = WorldDatabase.Query("SELECT `entry`,`accessory_entry`,`seat_id`,`minion`,`summontype`,`summontimer` FROM `vehicle_template_accessory`"); + QueryResult result = WorldDatabase.Query("SELECT `entry`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_template_accessory`"); if (!result) { @@ -3035,7 +3035,7 @@ void ObjectMgr::LoadVehicleAccessories() uint32 count = 0; - QueryResult result = WorldDatabase.Query("SELECT `guid`,`accessory_entry`,`seat_id`,`minion`,`summontype`,`summontimer` FROM `vehicle_accessory`"); + QueryResult result = WorldDatabase.Query("SELECT `guid`, `accessory_entry`, `seat_id`, `minion`, `summontype`, `summontimer` FROM `vehicle_accessory`"); if (!result) { @@ -3079,7 +3079,7 @@ void ObjectMgr::LoadVehicleScaling() uint32 count = 0; - QueryResult result = WorldDatabase.Query("SELECT `entry`,`baseItemLevel`,`scalingFactor` FROM `vehicle_scaling_info`"); + QueryResult result = WorldDatabase.Query("SELECT `entry`, `baseItemLevel`, `scalingFactor` FROM `vehicle_scaling_info`"); if (!result) { @@ -3136,7 +3136,7 @@ void ObjectMgr::LoadPetLevelInfo() uint32 creature_id = fields[0].GetUInt32(); if (!sObjectMgr->GetCreatureTemplate(creature_id)) { - sLog->outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.",creature_id); + sLog->outErrorDb("Wrong creature id %u in `pet_levelstats` table, ignoring.", creature_id); continue; } @@ -3144,17 +3144,17 @@ void ObjectMgr::LoadPetLevelInfo() if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum - sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); + sLog->outErrorDb("Wrong (> %u) level %u in `pet_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.",current_level); + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `pet_levelstats` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; } else if (current_level < 1) { - sLog->outErrorDb("Wrong (<1) level %u in `pet_levelstats` table, ignoring.",current_level); + sLog->outErrorDb("Wrong (<1) level %u in `pet_levelstats` table, ignoring.", current_level); continue; } @@ -3187,7 +3187,7 @@ void ObjectMgr::LoadPetLevelInfo() // fatal error if no level 1 data if (!pInfo || pInfo[0].health == 0) { - sLog->outErrorDb("Creature %u does not have pet stats data for Level 1!",itr->first); + sLog->outErrorDb("Creature %u does not have pet stats data for Level 1!", itr->first); exit(1); } @@ -3196,7 +3196,7 @@ void ObjectMgr::LoadPetLevelInfo() { if (pInfo[level].health == 0) { - sLog->outErrorDb("Creature %u has no data for Level %i pet stats data, using data of Level %i.",itr->first,level+1, level); + sLog->outErrorDb("Creature %u has no data for Level %i pet stats data, using data of Level %i.", itr->first, level+1, level); pInfo[level] = pInfo[level-1]; } } @@ -3292,39 +3292,39 @@ void ObjectMgr::LoadPlayerInfo() if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race); continue; } ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(current_race); if (!rEntry) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo` table, ignoring.", current_race); continue; } if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class); continue; } if (!sChrClassesStore.LookupEntry(current_class)) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo` table, ignoring.", current_class); continue; } // accept DB data only for valid position (and non instanceable) - if (!MapManager::IsValidMapCoord(mapId,positionX,positionY,positionZ,orientation)) + if (!MapManager::IsValidMapCoord(mapId, positionX, positionY, positionZ, orientation)) { - sLog->outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.",current_class,current_race); + sLog->outErrorDb("Wrong home position for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); continue; } if (sMapStore.LookupEntry(mapId)->Instanceable()) { - sLog->outErrorDb("Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.",current_class,current_race); + sLog->outErrorDb("Home position in instanceable map for class %u race %u pair in `playercreateinfo` table, ignoring.", current_class, current_race); continue; } @@ -3372,14 +3372,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo_item` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo_item` table, ignoring.", current_class); continue; } @@ -3387,7 +3387,7 @@ void ObjectMgr::LoadPlayerInfo() if (!sObjectMgr->GetItemTemplate(item_id)) { - sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.",item_id,current_race,current_class); + sLog->outErrorDb("Item id %u (race %u class %u) in `playercreateinfo_item` table but not listed in `item_template`, ignoring.", item_id, current_race, current_class); continue; } @@ -3395,7 +3395,7 @@ void ObjectMgr::LoadPlayerInfo() if (!amount) { - sLog->outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.",item_id,current_race,current_class); + sLog->outErrorDb("Item id %u (class %u race %u) have amount == 0 in `playercreateinfo_item` table, ignoring.", item_id, current_race, current_class); continue; } @@ -3448,14 +3448,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo_spell` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo_spell` table, ignoring.", current_class); continue; } @@ -3505,19 +3505,19 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `playercreateinfo_action` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `playercreateinfo_action` table, ignoring.", current_class); continue; } PlayerInfo* pInfo = &playerInfo[current_race][current_class]; - pInfo->action.push_back(PlayerCreateInfoAction(fields[2].GetUInt8(),fields[3].GetUInt32(),fields[4].GetUInt8())); + pInfo->action.push_back(PlayerCreateInfoAction(fields[2].GetUInt8(), fields[3].GetUInt32(), fields[4].GetUInt8())); ++count; } @@ -3552,14 +3552,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_class = fields[0].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `player_classlevelstats` table, ignoring.", current_class); continue; } uint8 current_level = fields[1].GetUInt8(); // Can't be > than STRONG_MAX_LEVEL (hardcoded level maximum) due to var type if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.",current_level); + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_classlevelstats` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. continue; } @@ -3590,7 +3590,7 @@ void ObjectMgr::LoadPlayerInfo() // fatal error if no level 1 data if (!pClassInfo->levelInfo || pClassInfo->levelInfo[0].basehealth == 0) { - sLog->outErrorDb("Class %i Level 1 does not have health/mana data!",class_); + sLog->outErrorDb("Class %i Level 1 does not have health/mana data!", class_); exit(1); } @@ -3599,7 +3599,7 @@ void ObjectMgr::LoadPlayerInfo() { if (pClassInfo->levelInfo[level].basehealth == 0) { - sLog->outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.",class_,level+1, level); + sLog->outErrorDb("Class %i Level %i does not have health/mana data. Using stats data of level %i.", class_, level+1, level); pClassInfo->levelInfo[level] = pClassInfo->levelInfo[level-1]; } } @@ -3633,14 +3633,14 @@ void ObjectMgr::LoadPlayerInfo() uint32 current_race = fields[0].GetUInt32(); if (current_race >= MAX_RACES) { - sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.",current_race); + sLog->outErrorDb("Wrong race %u in `player_levelstats` table, ignoring.", current_race); continue; } uint32 current_class = fields[1].GetUInt32(); if (current_class >= MAX_CLASSES) { - sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.",current_class); + sLog->outErrorDb("Wrong class %u in `player_levelstats` table, ignoring.", current_class); continue; } @@ -3648,10 +3648,10 @@ void ObjectMgr::LoadPlayerInfo() if (current_level > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum - sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.",STRONG_MAX_LEVEL,current_level); + sLog->outErrorDb("Wrong (> %u) level %u in `player_levelstats` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.",current_level); + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_levelstats` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3703,7 +3703,7 @@ void ObjectMgr::LoadPlayerInfo() // fatal error if no level 1 data if (!pInfo->levelInfo || pInfo->levelInfo[0].stats[0] == 0) { - sLog->outErrorDb("Race %i Class %i Level 1 does not have stats data!",race,class_); + sLog->outErrorDb("Race %i Class %i Level 1 does not have stats data!", race, class_); exit(1); } @@ -3712,7 +3712,7 @@ void ObjectMgr::LoadPlayerInfo() { if (pInfo->levelInfo[level].stats[0] == 0) { - sLog->outErrorDb("Race %i Class %i Level %i does not have stats data. Using stats data of level %i.",race,class_,level+1, level); + sLog->outErrorDb("Race %i Class %i Level %i does not have stats data. Using stats data of level %i.", race, class_, level+1, level); pInfo->levelInfo[level] = pInfo->levelInfo[level-1]; } } @@ -3754,10 +3754,10 @@ void ObjectMgr::LoadPlayerInfo() if (current_level >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) { if (current_level > STRONG_MAX_LEVEL) // hardcoded level maximum - sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL,current_level); + sLog->outErrorDb("Wrong (> %u) level %u in `player_xp_for_level` table, ignoring.", STRONG_MAX_LEVEL, current_level); else { - sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.",current_level); + sLog->outDetail("Unused (> MaxPlayerLevel in worldserver.conf) level %u in `player_xp_for_levels` table, ignoring.", current_level); ++count; // make result loading percent "expected" correct in case disabled detail mode for example. } continue; @@ -3773,7 +3773,7 @@ void ObjectMgr::LoadPlayerInfo() { if (mPlayerXPperLevel[level] == 0) { - sLog->outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.",level+1, level); + sLog->outErrorDb("Level %i does not have XP for level data. Using data of level [%i] + 100.", level+1, level); mPlayerXPperLevel[level] = mPlayerXPperLevel[level-1]+100; } } @@ -3808,7 +3808,7 @@ void ObjectMgr::GetPlayerLevelInfo(uint32 race, uint32 class_, uint8 level, Play if (level <= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)) *info = pInfo->levelInfo[level-1]; else - BuildPlayerLevelInfo(race,class_,level,info); + BuildPlayerLevelInfo(race, class_, level, info); } void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, PlayerLevelInfo* info) const @@ -4220,7 +4220,7 @@ void ObjectMgr::LoadArenaTeams() // 0 1 2 3 4 5 6 7 8 - QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor," + QueryResult result = CharacterDatabase.Query("SELECT arena_team.arenaTeamId, name, captainGuid, type, backgroundColor, emblemStyle, emblemColor, borderStyle, borderColor, " // 9 10 11 12 13 14 "rating, weekGames, weekWins, seasonGames, seasonWins, rank FROM arena_team ORDER BY arena_team.arenaTeamId ASC"); @@ -4272,7 +4272,7 @@ void ObjectMgr::LoadGroups() // 0 1 2 3 4 5 6 7 8 9 QueryResult result = CharacterDatabase.PQuery("SELECT leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6" // 10 11 12 13 14 15 - ",icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups ORDER BY guid ASC"); + ", icon7, icon8, groupType, difficulty, raiddifficulty, guid FROM groups ORDER BY guid ASC"); if (!result) { sLog->outString(">> Loaded 0 group definitions. DB table `groups` is empty!"); @@ -4405,39 +4405,39 @@ void ObjectMgr::LoadQuests() mExclusiveQuestGroups.clear(); // 0 1 2 3 4 5 6 7 8 9 - QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClassMask, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue," + QueryResult result = WorldDatabase.Query("SELECT entry, Method, ZoneOrSort, SkillOrClassMask, MinLevel, MaxLevel, QuestLevel, Type, RequiredRaces, RequiredSkillValue, " // 10 11 12 13 14 15 16 17 18 19 - "RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime," + "RepObjectiveFaction, RepObjectiveValue, RepObjectiveFaction2, RepObjectiveValue2, RequiredMinRepFaction, RequiredMinRepValue, RequiredMaxRepFaction, RequiredMaxRepValue, SuggestedPlayers, LimitTime, " // 20 21 22 23 24 25 26 27 28 29 30 31 32 33 - "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, RewardArenaPoints, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell," + "QuestFlags, SpecialFlags, CharTitleId, PlayersSlain, BonusTalents, RewardArenaPoints, PrevQuestId, NextQuestId, ExclusiveGroup, NextQuestInChain, RewXPId, SrcItemId, SrcItemCount, SrcSpell, " // 34 35 36 37 38 39 40 41 42 43 44 - "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4," + "Title, Details, Objectives, OfferRewardText, RequestItemsText, EndText, CompletedText, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, " // 45 46 47 48 49 50 51 52 53 54 55 56 - "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6," + "ReqItemId1, ReqItemId2, ReqItemId3, ReqItemId4, ReqItemId5, ReqItemId6, ReqItemCount1, ReqItemCount2, ReqItemCount3, ReqItemCount4, ReqItemCount5, ReqItemCount6, " // 57 58 59 60 61 62 63 64 - "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4," + "ReqSourceId1, ReqSourceId2, ReqSourceId3, ReqSourceId4, ReqSourceCount1, ReqSourceCount2, ReqSourceCount3, ReqSourceCount4, " // 65 66 67 68 69 70 71 72 - "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4," + "ReqCreatureOrGOId1, ReqCreatureOrGOId2, ReqCreatureOrGOId3, ReqCreatureOrGOId4, ReqCreatureOrGOCount1, ReqCreatureOrGOCount2, ReqCreatureOrGOCount3, ReqCreatureOrGOCount4, " // 73 74 75 76 - "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4," + "ReqSpellCast1, ReqSpellCast2, ReqSpellCast3, ReqSpellCast4, " // 77 78 79 80 81 82 - "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6," + "RewChoiceItemId1, RewChoiceItemId2, RewChoiceItemId3, RewChoiceItemId4, RewChoiceItemId5, RewChoiceItemId6, " // 83 84 85 86 87 88 - "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6," + "RewChoiceItemCount1, RewChoiceItemCount2, RewChoiceItemCount3, RewChoiceItemCount4, RewChoiceItemCount5, RewChoiceItemCount6, " // 89 90 91 92 93 94 95 96 - "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4," + "RewItemId1, RewItemId2, RewItemId3, RewItemId4, RewItemCount1, RewItemCount2, RewItemCount3, RewItemCount4, " // 97 98 99 100 101 102 103 104 105 106 - "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5," + "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValueId1, RewRepValueId2, RewRepValueId3, RewRepValueId4, RewRepValueId5, " // 107 108 109 110 111 - "RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5," + "RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5, " // 112 113 114 115 116 117 118 119 120 121 122 123 - "RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," + "RewHonorAddition, RewHonorMultiplier, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt, " // 124 125 126 127 128 129 130 131 - "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4," + "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, " // 132 133 134 135 136 137 - "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," + "IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, " // 138 139 140 141 - "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4," + "OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " // 142 143 "StartScript, CompleteScript" " FROM quest_template"); @@ -4459,7 +4459,7 @@ void ObjectMgr::LoadQuests() mQuestTemplates[newQuest->GetQuestId()] = newQuest; } while (result->NextRow()); - std::map<uint32,uint32> usedMailTemplates; + std::map<uint32, uint32> usedMailTemplates; // Post processing for (QuestMap::iterator iter = mQuestTemplates.begin(); iter != mQuestTemplates.end(); ++iter) @@ -4474,19 +4474,19 @@ void ObjectMgr::LoadQuests() if (qinfo->GetQuestMethod() >= 3) { - sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.",qinfo->GetQuestId(),qinfo->GetQuestMethod()); + sLog->outErrorDb("Quest %u has `Method` = %u, expected values are 0, 1 or 2.", qinfo->GetQuestId(), qinfo->GetQuestMethod()); } if (qinfo->QuestFlags & ~QUEST_TRINITY_FLAGS_DB_ALLOWED) { sLog->outErrorDb("Quest %u has `SpecialFlags` = %u > max allowed value. Correct `SpecialFlags` to value <= %u", - qinfo->GetQuestId(),qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); + qinfo->GetQuestId(), qinfo->QuestFlags >> 20, QUEST_TRINITY_FLAGS_DB_ALLOWED >> 20); qinfo->QuestFlags &= QUEST_TRINITY_FLAGS_DB_ALLOWED; } if (qinfo->QuestFlags & QUEST_FLAGS_DAILY && qinfo->QuestFlags & QUEST_FLAGS_WEEKLY) { - sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.",qinfo->GetQuestId()); + sLog->outErrorDb("Weekly Quest %u is marked as daily quest in `QuestFlags`, removed daily flag.", qinfo->GetQuestId()); qinfo->QuestFlags &= ~QUEST_FLAGS_DAILY; } @@ -4494,7 +4494,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) { - sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); + sLog->outErrorDb("Daily Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } @@ -4503,7 +4503,7 @@ void ObjectMgr::LoadQuests() { if (!(qinfo->QuestFlags & QUEST_TRINITY_FLAGS_REPEATABLE)) { - sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.",qinfo->GetQuestId()); + sLog->outErrorDb("Weekly Quest %u not marked as repeatable in `SpecialFlags`, added.", qinfo->GetQuestId()); qinfo->QuestFlags |= QUEST_TRINITY_FLAGS_REPEATABLE; } } @@ -4516,7 +4516,7 @@ void ObjectMgr::LoadQuests() if (uint32 id = qinfo->RewChoiceItemId[j]) { sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item from `RewChoiceItemId%d` can't be rewarded with quest flag QUEST_FLAGS_AUTO_REWARDED.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest ignore this data } } @@ -4528,7 +4528,7 @@ void ObjectMgr::LoadQuests() if (!GetAreaEntryByAreaID(qinfo->ZoneOrSort)) { sLog->outErrorDb("Quest %u has `ZoneOrSort` = %u (zone case) but zone with this id does not exist.", - qinfo->GetQuestId(),qinfo->ZoneOrSort); + qinfo->GetQuestId(), qinfo->ZoneOrSort); // no changes, quest not dependent from this value but can have problems at client } } @@ -4539,7 +4539,7 @@ void ObjectMgr::LoadQuests() if (!qSort) { sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (sort case) but quest sort with this id does not exist.", - qinfo->GetQuestId(),qinfo->ZoneOrSort); + qinfo->GetQuestId(), qinfo->ZoneOrSort); // no changes, quest not dependent from this value but can have problems at client (note some may be 0, we must allow this so no check) } //check SkillOrClass value (class case). @@ -4549,7 +4549,7 @@ void ObjectMgr::LoadQuests() if (qinfo->SkillOrClassMask < 0) { sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (class sort case) and `SkillOrClassMask` = %i (class case), redundant.", - qinfo->GetQuestId(),qinfo->ZoneOrSort,qinfo->SkillOrClassMask); + qinfo->GetQuestId(), qinfo->ZoneOrSort, qinfo->SkillOrClassMask); } } //check for proper SkillOrClass value (skill case) @@ -4559,7 +4559,7 @@ void ObjectMgr::LoadQuests() if (qinfo->SkillOrClassMask != skill_id) { sLog->outErrorDb("Quest %u has `ZoneOrSort` = %i (skill sort case) but `SkillOrClassMask` does not have a corresponding value (%i).", - qinfo->GetQuestId(),qinfo->ZoneOrSort,skill_id); + qinfo->GetQuestId(), qinfo->ZoneOrSort, skill_id); //override, and force proper value here? } } @@ -4571,7 +4571,7 @@ void ObjectMgr::LoadQuests() if (!(-int32(qinfo->SkillOrClassMask) & CLASSMASK_ALL_PLAYABLE)) { sLog->outErrorDb("Quest %u has `SkillOrClassMask` = %i (class case) but classmask does not have valid class", - qinfo->GetQuestId(),qinfo->SkillOrClassMask); + qinfo->GetQuestId(), qinfo->SkillOrClassMask); } } // SkillOrClassMask (skill case) @@ -4580,7 +4580,7 @@ void ObjectMgr::LoadQuests() if (!sSkillLineStore.LookupEntry(qinfo->SkillOrClassMask)) { sLog->outErrorDb("Quest %u has `SkillOrClass` = %u (skill case) but skill (%i) does not exist", - qinfo->GetQuestId(),qinfo->SkillOrClassMask,qinfo->SkillOrClassMask); + qinfo->GetQuestId(), qinfo->SkillOrClassMask, qinfo->SkillOrClassMask); } } @@ -4589,14 +4589,14 @@ void ObjectMgr::LoadQuests() if (qinfo->RequiredSkillValue > sWorld->GetConfigMaxSkillValue()) { sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but max possible skill is %u, quest can't be done.", - qinfo->GetQuestId(),qinfo->RequiredSkillValue,sWorld->GetConfigMaxSkillValue()); + qinfo->GetQuestId(), qinfo->RequiredSkillValue, sWorld->GetConfigMaxSkillValue()); // no changes, quest can't be done for this requirement } if (qinfo->SkillOrClassMask <= 0) { sLog->outErrorDb("Quest %u has `RequiredSkillValue` = %u but `SkillOrClass` = %i (class case), value ignored.", - qinfo->GetQuestId(),qinfo->RequiredSkillValue,qinfo->SkillOrClassMask); + qinfo->GetQuestId(), qinfo->RequiredSkillValue, qinfo->SkillOrClassMask); // no changes, quest can't be done for this requirement (fail at wrong skill id) } } @@ -4605,77 +4605,77 @@ void ObjectMgr::LoadQuests() if (qinfo->RepObjectiveFaction2 && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction2)) { sLog->outErrorDb("Quest %u has `RepObjectiveFaction2` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(),qinfo->RepObjectiveFaction2,qinfo->RepObjectiveFaction2); + qinfo->GetQuestId(), qinfo->RepObjectiveFaction2, qinfo->RepObjectiveFaction2); // no changes, quest can't be done for this requirement } if (qinfo->RepObjectiveFaction && !sFactionStore.LookupEntry(qinfo->RepObjectiveFaction)) { sLog->outErrorDb("Quest %u has `RepObjectiveFaction` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(),qinfo->RepObjectiveFaction,qinfo->RepObjectiveFaction); + qinfo->GetQuestId(), qinfo->RepObjectiveFaction, qinfo->RepObjectiveFaction); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMinRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMinRepFaction)) { sLog->outErrorDb("Quest %u has `RequiredMinRepFaction` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(),qinfo->RequiredMinRepFaction,qinfo->RequiredMinRepFaction); + qinfo->GetQuestId(), qinfo->RequiredMinRepFaction, qinfo->RequiredMinRepFaction); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMaxRepFaction && !sFactionStore.LookupEntry(qinfo->RequiredMaxRepFaction)) { sLog->outErrorDb("Quest %u has `RequiredMaxRepFaction` = %u but faction template %u does not exist, quest can't be done.", - qinfo->GetQuestId(),qinfo->RequiredMaxRepFaction,qinfo->RequiredMaxRepFaction); + qinfo->GetQuestId(), qinfo->RequiredMaxRepFaction, qinfo->RequiredMaxRepFaction); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMinRepValue && qinfo->RequiredMinRepValue > ReputationMgr::Reputation_Cap) { sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but max reputation is %u, quest can't be done.", - qinfo->GetQuestId(),qinfo->RequiredMinRepValue,ReputationMgr::Reputation_Cap); + qinfo->GetQuestId(), qinfo->RequiredMinRepValue, ReputationMgr::Reputation_Cap); // no changes, quest can't be done for this requirement } if (qinfo->RequiredMinRepValue && qinfo->RequiredMaxRepValue && qinfo->RequiredMaxRepValue <= qinfo->RequiredMinRepValue) { sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d and `RequiredMinRepValue` = %d, quest can't be done.", - qinfo->GetQuestId(),qinfo->RequiredMaxRepValue,qinfo->RequiredMinRepValue); + qinfo->GetQuestId(), qinfo->RequiredMaxRepValue, qinfo->RequiredMinRepValue); // no changes, quest can't be done for this requirement } if (!qinfo->RepObjectiveFaction && qinfo->RepObjectiveValue > 0) { sLog->outErrorDb("Quest %u has `RepObjectiveValue` = %d but `RepObjectiveFaction` is 0, value has no effect", - qinfo->GetQuestId(),qinfo->RepObjectiveValue); + qinfo->GetQuestId(), qinfo->RepObjectiveValue); // warning } if (!qinfo->RepObjectiveFaction2 && qinfo->RepObjectiveValue2 > 0) { sLog->outErrorDb("Quest %u has `RepObjectiveValue2` = %d but `RepObjectiveFaction2` is 0, value has no effect", - qinfo->GetQuestId(),qinfo->RepObjectiveValue2); + qinfo->GetQuestId(), qinfo->RepObjectiveValue2); // warning } if (!qinfo->RequiredMinRepFaction && qinfo->RequiredMinRepValue > 0) { sLog->outErrorDb("Quest %u has `RequiredMinRepValue` = %d but `RequiredMinRepFaction` is 0, value has no effect", - qinfo->GetQuestId(),qinfo->RequiredMinRepValue); + qinfo->GetQuestId(), qinfo->RequiredMinRepValue); // warning } if (!qinfo->RequiredMaxRepFaction && qinfo->RequiredMaxRepValue > 0) { sLog->outErrorDb("Quest %u has `RequiredMaxRepValue` = %d but `RequiredMaxRepFaction` is 0, value has no effect", - qinfo->GetQuestId(),qinfo->RequiredMaxRepValue); + qinfo->GetQuestId(), qinfo->RequiredMaxRepValue); // warning } if (qinfo->CharTitleId && !sCharTitlesStore.LookupEntry(qinfo->CharTitleId)) { sLog->outErrorDb("Quest %u has `CharTitleId` = %u but CharTitle Id %u does not exist, quest can't be rewarded with title.", - qinfo->GetQuestId(),qinfo->GetCharTitleId(),qinfo->GetCharTitleId()); + qinfo->GetQuestId(), qinfo->GetCharTitleId(), qinfo->GetCharTitleId()); qinfo->CharTitleId = 0; // quest can't reward this title } @@ -4685,20 +4685,20 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(qinfo->SrcItemId)) { sLog->outErrorDb("Quest %u has `SrcItemId` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(),qinfo->SrcItemId,qinfo->SrcItemId); + qinfo->GetQuestId(), qinfo->SrcItemId, qinfo->SrcItemId); qinfo->SrcItemId = 0; // quest can't be done for this requirement } else if (qinfo->SrcItemCount == 0) { sLog->outErrorDb("Quest %u has `SrcItemId` = %u but `SrcItemCount` = 0, set to 1 but need fix in DB.", - qinfo->GetQuestId(),qinfo->SrcItemId); + qinfo->GetQuestId(), qinfo->SrcItemId); qinfo->SrcItemCount = 1; // update to 1 for allow quest work for backward compatibility with DB } } else if (qinfo->SrcItemCount>0) { sLog->outErrorDb("Quest %u has `SrcItemId` = 0 but `SrcItemCount` = %u, useless value.", - qinfo->GetQuestId(),qinfo->SrcItemCount); + qinfo->GetQuestId(), qinfo->SrcItemCount); qinfo->SrcItemCount=0; // no quest work changes in fact } @@ -4708,13 +4708,13 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u doesn't exist, quest can't be done.", - qinfo->GetQuestId(),qinfo->SrcSpell,qinfo->SrcSpell); + qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell); qinfo->SrcSpell = 0; // quest can't be done for this requirement } else if (!SpellMgr::IsSpellValid(spellInfo)) { sLog->outErrorDb("Quest %u has `SrcSpell` = %u but spell %u is broken, quest can't be done.", - qinfo->GetQuestId(),qinfo->SrcSpell,qinfo->SrcSpell); + qinfo->GetQuestId(), qinfo->SrcSpell, qinfo->SrcSpell); qinfo->SrcSpell = 0; // quest can't be done for this requirement } } @@ -4727,7 +4727,7 @@ void ObjectMgr::LoadQuests() if (qinfo->ReqItemCount[j] == 0) { sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but `ReqItemCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done for this requirement } @@ -4736,14 +4736,14 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(id)) { sLog->outErrorDb("Quest %u has `ReqItemId%d` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } else if (qinfo->ReqItemCount[j]>0) { sLog->outErrorDb("Quest %u has `ReqItemId%d` = 0 but `ReqItemCount%d` = %u, quest can't be done.", - qinfo->GetQuestId(),j+1,j+1,qinfo->ReqItemCount[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->ReqItemCount[j]); qinfo->ReqItemCount[j] = 0; // prevent incorrect work of quest } } @@ -4756,7 +4756,7 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(id)) { sLog->outErrorDb("Quest %u has `ReqSourceId%d` = %u but item with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); // no changes, quest can't be done for this requirement } } @@ -4765,7 +4765,7 @@ void ObjectMgr::LoadQuests() if (qinfo->ReqSourceCount[j]>0) { sLog->outErrorDb("Quest %u has `ReqSourceId%d` = 0 but `ReqSourceCount%d` = %u.", - qinfo->GetQuestId(),j+1,j+1,qinfo->ReqSourceCount[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->ReqSourceCount[j]); // no changes, quest ignore this data } } @@ -4780,7 +4780,7 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); continue; } @@ -4801,7 +4801,7 @@ void ObjectMgr::LoadQuests() { if (!qinfo->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.",spellInfo->Id,qinfo->QuestId,j+1,j+1); + sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and ReqCreatureOrGOId%d = 0, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags or ReqCreatureOrGOId%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->QuestId, j+1, j+1); // this will prevent quest completing without objective const_cast<Quest*>(qinfo)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -4810,7 +4810,7 @@ void ObjectMgr::LoadQuests() else { sLog->outErrorDb("Quest %u has `ReqSpellCast%d` = %u and ReqCreatureOrGOId%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.", - qinfo->GetQuestId(),j+1,id,j+1,id); + qinfo->GetQuestId(), j+1, id, j+1, id); // no changes, quest can't be done for this requirement } } @@ -4823,14 +4823,14 @@ void ObjectMgr::LoadQuests() if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id)) { sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but gameobject %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,uint32(-id)); + qinfo->GetQuestId(), j+1, id, uint32(-id)); qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement } if (id > 0 && !sObjectMgr->GetCreatureTemplate(id)) { sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %i but creature with entry %u does not exist, quest can't be done.", - qinfo->GetQuestId(),j+1,id,uint32(id)); + qinfo->GetQuestId(), j+1, id, uint32(id)); qinfo->ReqCreatureOrGOId[j] = 0; // quest can't be done for this requirement } @@ -4843,14 +4843,14 @@ void ObjectMgr::LoadQuests() if (!qinfo->ReqCreatureOrGOCount[j]) { sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = %u but `ReqCreatureOrGOCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can be incorrectly done, but we already report this } } else if (qinfo->ReqCreatureOrGOCount[j]>0) { sLog->outErrorDb("Quest %u has `ReqCreatureOrGOId%d` = 0 but `ReqCreatureOrGOCount%d` = %u.", - qinfo->GetQuestId(),j+1,j+1,qinfo->ReqCreatureOrGOCount[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->ReqCreatureOrGOCount[j]); // no changes, quest ignore this data } } @@ -4863,21 +4863,21 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(id)) { sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); qinfo->RewChoiceItemId[j] = 0; // no changes, quest will not reward this } if (!qinfo->RewChoiceItemCount[j]) { sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = %u but `RewChoiceItemCount%d` = 0, quest can't be done.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes, quest can't be done } } else if (qinfo->RewChoiceItemCount[j]>0) { sLog->outErrorDb("Quest %u has `RewChoiceItemId%d` = 0 but `RewChoiceItemCount%d` = %u.", - qinfo->GetQuestId(),j+1,j+1,qinfo->RewChoiceItemCount[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->RewChoiceItemCount[j]); // no changes, quest ignore this data } } @@ -4890,21 +4890,21 @@ void ObjectMgr::LoadQuests() if (!sObjectMgr->GetItemTemplate(id)) { sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but item with entry %u does not exist, quest will not reward this item.", - qinfo->GetQuestId(),j+1,id,id); + qinfo->GetQuestId(), j+1, id, id); qinfo->RewItemId[j] = 0; // no changes, quest will not reward this item } if (!qinfo->RewItemCount[j]) { sLog->outErrorDb("Quest %u has `RewItemId%d` = %u but `RewItemCount%d` = 0, quest will not reward this item.", - qinfo->GetQuestId(),j+1,id,j+1); + qinfo->GetQuestId(), j+1, id, j+1); // no changes } } else if (qinfo->RewItemCount[j]>0) { sLog->outErrorDb("Quest %u has `RewItemId%d` = 0 but `RewItemCount%d` = %u.", - qinfo->GetQuestId(),j+1,j+1,qinfo->RewItemCount[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->RewItemCount[j]); // no changes, quest ignore this data } } @@ -4919,7 +4919,7 @@ void ObjectMgr::LoadQuests() } if (!sFactionStore.LookupEntry(qinfo->RewRepFaction[j])) { - sLog->outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(),j+1,qinfo->RewRepFaction[j] ,qinfo->RewRepFaction[j]); + sLog->outErrorDb("Quest %u has `RewRepFaction%d` = %u but raw faction (faction.dbc) %u does not exist, quest will not reward reputation for this faction.", qinfo->GetQuestId(), j+1, qinfo->RewRepFaction[j] , qinfo->RewRepFaction[j]); qinfo->RewRepFaction[j] = 0; // quest will not reward this } } @@ -4927,7 +4927,7 @@ void ObjectMgr::LoadQuests() else if (qinfo->RewRepValue[j] != 0) { sLog->outErrorDb("Quest %u has `RewRepFaction%d` = 0 but `RewRepValue%d` = %i.", - qinfo->GetQuestId(),j+1,j+1,qinfo->RewRepValue[j]); + qinfo->GetQuestId(), j+1, j+1, qinfo->RewRepValue[j]); // no changes, quest ignore this data } } @@ -4939,21 +4939,21 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u does not exist, spell removed as display reward.", - qinfo->GetQuestId(),qinfo->RewSpell,qinfo->RewSpell); + qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell); qinfo->RewSpell = 0; // no spell reward will display for this quest } else if (!SpellMgr::IsSpellValid(spellInfo)) { sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is broken, quest will not have a spell reward.", - qinfo->GetQuestId(),qinfo->RewSpell,qinfo->RewSpell); + qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell); qinfo->RewSpell = 0; // no spell reward will display for this quest } else if (GetTalentSpellCost(qinfo->RewSpell)) { sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", - qinfo->GetQuestId(),qinfo->RewSpell,qinfo->RewSpell); + qinfo->GetQuestId(), qinfo->RewSpell, qinfo->RewSpell); qinfo->RewSpell = 0; // no spell reward will display for this quest } } @@ -4965,21 +4965,21 @@ void ObjectMgr::LoadQuests() if (!spellInfo) { sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u does not exist, quest will not have a spell reward.", - qinfo->GetQuestId(),qinfo->RewSpellCast,qinfo->RewSpellCast); + qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast); qinfo->RewSpellCast = 0; // no spell will be casted on player } else if (!SpellMgr::IsSpellValid(spellInfo)) { sLog->outErrorDb("Quest %u has `RewSpellCast` = %u but spell %u is broken, quest will not have a spell reward.", - qinfo->GetQuestId(),qinfo->RewSpellCast,qinfo->RewSpellCast); + qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast); qinfo->RewSpellCast = 0; // no spell will be casted on player } else if (GetTalentSpellCost(qinfo->RewSpellCast)) { sLog->outErrorDb("Quest %u has `RewSpell` = %u but spell %u is talent, quest will not have a spell reward.", - qinfo->GetQuestId(),qinfo->RewSpellCast,qinfo->RewSpellCast); + qinfo->GetQuestId(), qinfo->RewSpellCast, qinfo->RewSpellCast); qinfo->RewSpellCast = 0; // no spell will be casted on player } } @@ -4989,15 +4989,15 @@ void ObjectMgr::LoadQuests() if (!sMailTemplateStore.LookupEntry(qinfo->RewMailTemplateId)) { sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u does not exist, quest will not have a mail reward.", - qinfo->GetQuestId(),qinfo->RewMailTemplateId,qinfo->RewMailTemplateId); + qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId); qinfo->RewMailTemplateId = 0; // no mail will send to player qinfo->RewMailDelaySecs = 0; // no mail will send to player } else if (usedMailTemplates.find(qinfo->RewMailTemplateId) != usedMailTemplates.end()) { - std::map<uint32,uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewMailTemplateId); + std::map<uint32, uint32>::const_iterator used_mt_itr = usedMailTemplates.find(qinfo->RewMailTemplateId); sLog->outErrorDb("Quest %u has `RewMailTemplateId` = %u but mail template %u already used for quest %u, quest will not have a mail reward.", - qinfo->GetQuestId(),qinfo->RewMailTemplateId,qinfo->RewMailTemplateId,used_mt_itr->second); + qinfo->GetQuestId(), qinfo->RewMailTemplateId, qinfo->RewMailTemplateId, used_mt_itr->second); qinfo->RewMailTemplateId = 0; // no mail will send to player qinfo->RewMailDelaySecs = 0; // no mail will send to player } @@ -5011,7 +5011,7 @@ void ObjectMgr::LoadQuests() if (qNextItr == mQuestTemplates.end()) { sLog->outErrorDb("Quest %u has `NextQuestInChain` = %u but quest %u does not exist, quest chain will not work.", - qinfo->GetQuestId(),qinfo->NextQuestInChain ,qinfo->NextQuestInChain); + qinfo->GetQuestId(), qinfo->NextQuestInChain , qinfo->NextQuestInChain); qinfo->NextQuestInChain = 0; } else @@ -5073,7 +5073,7 @@ void ObjectMgr::LoadQuests() if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.",spellInfo->Id,quest_id); + sLog->outErrorDb("Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE for quest %u , but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Quest flags must be fixed, quest modified to enable objective.", spellInfo->Id, quest_id); // this will prevent quest completing without objective const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -5091,15 +5091,15 @@ void ObjectMgr::LoadQuestLocales() mQuestLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry," - "Title_loc1,Details_loc1,Objectives_loc1,OfferRewardText_loc1,RequestItemsText_loc1,EndText_loc1,CompletedText_loc1,ObjectiveText1_loc1,ObjectiveText2_loc1,ObjectiveText3_loc1,ObjectiveText4_loc1," - "Title_loc2,Details_loc2,Objectives_loc2,OfferRewardText_loc2,RequestItemsText_loc2,EndText_loc2,CompletedText_loc2,ObjectiveText1_loc2,ObjectiveText2_loc2,ObjectiveText3_loc2,ObjectiveText4_loc2," - "Title_loc3,Details_loc3,Objectives_loc3,OfferRewardText_loc3,RequestItemsText_loc3,EndText_loc3,CompletedText_loc3,ObjectiveText1_loc3,ObjectiveText2_loc3,ObjectiveText3_loc3,ObjectiveText4_loc3," - "Title_loc4,Details_loc4,Objectives_loc4,OfferRewardText_loc4,RequestItemsText_loc4,EndText_loc4,CompletedText_loc4,ObjectiveText1_loc4,ObjectiveText2_loc4,ObjectiveText3_loc4,ObjectiveText4_loc4," - "Title_loc5,Details_loc5,Objectives_loc5,OfferRewardText_loc5,RequestItemsText_loc5,EndText_loc5,CompletedText_loc5,ObjectiveText1_loc5,ObjectiveText2_loc5,ObjectiveText3_loc5,ObjectiveText4_loc5," - "Title_loc6,Details_loc6,Objectives_loc6,OfferRewardText_loc6,RequestItemsText_loc6,EndText_loc6,CompletedText_loc6,ObjectiveText1_loc6,ObjectiveText2_loc6,ObjectiveText3_loc6,ObjectiveText4_loc6," - "Title_loc7,Details_loc7,Objectives_loc7,OfferRewardText_loc7,RequestItemsText_loc7,EndText_loc7,CompletedText_loc7,ObjectiveText1_loc7,ObjectiveText2_loc7,ObjectiveText3_loc7,ObjectiveText4_loc7," - "Title_loc8,Details_loc8,Objectives_loc8,OfferRewardText_loc8,RequestItemsText_loc8,EndText_loc8,CompletedText_loc8,ObjectiveText1_loc8,ObjectiveText2_loc8,ObjectiveText3_loc8,ObjectiveText4_loc8" + QueryResult result = WorldDatabase.Query("SELECT entry, " + "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, " + "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, " + "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, " + "Title_loc4, Details_loc4, Objectives_loc4, OfferRewardText_loc4, RequestItemsText_loc4, EndText_loc4, CompletedText_loc4, ObjectiveText1_loc4, ObjectiveText2_loc4, ObjectiveText3_loc4, ObjectiveText4_loc4, " + "Title_loc5, Details_loc5, Objectives_loc5, OfferRewardText_loc5, RequestItemsText_loc5, EndText_loc5, CompletedText_loc5, ObjectiveText1_loc5, ObjectiveText2_loc5, ObjectiveText3_loc5, ObjectiveText4_loc5, " + "Title_loc6, Details_loc6, Objectives_loc6, OfferRewardText_loc6, RequestItemsText_loc6, EndText_loc6, CompletedText_loc6, ObjectiveText1_loc6, ObjectiveText2_loc6, ObjectiveText3_loc6, ObjectiveText4_loc6, " + "Title_loc7, Details_loc7, Objectives_loc7, OfferRewardText_loc7, RequestItemsText_loc7, EndText_loc7, CompletedText_loc7, ObjectiveText1_loc7, ObjectiveText2_loc7, ObjectiveText3_loc7, ObjectiveText4_loc7, " + "Title_loc8, Details_loc8, Objectives_loc8, OfferRewardText_loc8, RequestItemsText_loc8, EndText_loc8, CompletedText_loc8, ObjectiveText1_loc8, ObjectiveText2_loc8, ObjectiveText3_loc8, ObjectiveText4_loc8" " FROM locales_quest"); if (!result) @@ -5170,7 +5170,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) bool isSpellScriptTable = (type == SCRIPTS_SPELL); char buff[125]; - sprintf(buff, "SELECT id,delay,command,datalong,datalong2,dataint,x,y,z,o%s FROM %s", isSpellScriptTable ? ",effIndex" : "", tableName.c_str()); + sprintf(buff, "SELECT id, delay, command, datalong, datalong2, dataint, x, y, z, o%s FROM %s", isSpellScriptTable ? ", effIndex" : "", tableName.c_str()); QueryResult result = WorldDatabase.Query(buff); if (!result) @@ -5399,7 +5399,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) tableName.c_str(), tmp.RemoveAura.SpellID, tmp.id); continue; } - if (tmp.RemoveAura.Flags & ~0x1) // 1 bits (0,1) + if (tmp.RemoveAura.Flags & ~0x1) // 1 bits (0, 1) { sLog->outErrorDb("Table `%s` using unknown flags in datalong2 (%u) in SCRIPT_COMMAND_REMOVE_AURA for script id %u", tableName.c_str(), tmp.RemoveAura.Flags, tmp.id); @@ -5422,7 +5422,7 @@ void ObjectMgr::LoadScripts(ScriptsType type) tableName.c_str(), tmp.CastSpell.Flags, tmp.id); continue; } - if (tmp.CastSpell.Flags != 4 && tmp.CastSpell.CreatureEntry & ~0x1) // 1 bit (0,1) + if (tmp.CastSpell.Flags != 4 && tmp.CastSpell.CreatureEntry & ~0x1) // 1 bit (0, 1) { sLog->outErrorDb("Table `%s` using unknown flags in dataint (%u) in SCRIPT_COMMAND_CAST_SPELL for script id %u", tableName.c_str(), tmp.CastSpell.CreatureEntry, tmp.id); @@ -5480,7 +5480,7 @@ void ObjectMgr::LoadGameObjectScripts() for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr) { if (!GetGOData(itr->first)) - sLog->outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id",itr->first); + sLog->outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id", itr->first); } } @@ -5492,7 +5492,7 @@ void ObjectMgr::LoadQuestEndScripts() for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr) { if (!GetQuestTemplate(itr->first)) - sLog->outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id",itr->first); + sLog->outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first); } } @@ -5504,7 +5504,7 @@ void ObjectMgr::LoadQuestStartScripts() for (ScriptMapMap::const_iterator itr = sQuestStartScripts.begin(); itr != sQuestStartScripts.end(); ++itr) { if (!GetQuestTemplate(itr->first)) - sLog->outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id",itr->first); + sLog->outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id", itr->first); } } @@ -5645,7 +5645,7 @@ void ObjectMgr::LoadSpellScriptNames() SpellEntry const* spellEntry = sSpellStore.LookupEntry(spellId); if (!spellEntry) { - sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.",scriptName,fields[0].GetInt32()); + sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) does not exist in `Spell.dbc`.", scriptName, fields[0].GetInt32()); continue; } @@ -5653,7 +5653,7 @@ void ObjectMgr::LoadSpellScriptNames() { if (sSpellMgr->GetFirstSpellInChain(spellId) != uint32(spellId)) { - sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.",scriptName,fields[0].GetInt32()); + sLog->outErrorDb("Scriptname:`%s` spell (spell_id:%d) is not first rank of spell.", scriptName, fields[0].GetInt32()); continue; } while(spellId) @@ -5794,7 +5794,7 @@ void ObjectMgr::LoadPageTextLocales() mPageTextLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry,text_loc1,text_loc2,text_loc3,text_loc4,text_loc5,text_loc6,text_loc7,text_loc8 FROM locales_page_text"); + QueryResult result = WorldDatabase.Query("SELECT entry, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_page_text"); if (!result) return; @@ -6017,15 +6017,15 @@ void ObjectMgr::LoadNpcTextLocales() mNpcTextLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry," - "Text0_0_loc1,Text0_1_loc1,Text1_0_loc1,Text1_1_loc1,Text2_0_loc1,Text2_1_loc1,Text3_0_loc1,Text3_1_loc1,Text4_0_loc1,Text4_1_loc1,Text5_0_loc1,Text5_1_loc1,Text6_0_loc1,Text6_1_loc1,Text7_0_loc1,Text7_1_loc1," - "Text0_0_loc2,Text0_1_loc2,Text1_0_loc2,Text1_1_loc2,Text2_0_loc2,Text2_1_loc2,Text3_0_loc2,Text3_1_loc1,Text4_0_loc2,Text4_1_loc2,Text5_0_loc2,Text5_1_loc2,Text6_0_loc2,Text6_1_loc2,Text7_0_loc2,Text7_1_loc2," - "Text0_0_loc3,Text0_1_loc3,Text1_0_loc3,Text1_1_loc3,Text2_0_loc3,Text2_1_loc3,Text3_0_loc3,Text3_1_loc1,Text4_0_loc3,Text4_1_loc3,Text5_0_loc3,Text5_1_loc3,Text6_0_loc3,Text6_1_loc3,Text7_0_loc3,Text7_1_loc3," - "Text0_0_loc4,Text0_1_loc4,Text1_0_loc4,Text1_1_loc4,Text2_0_loc4,Text2_1_loc4,Text3_0_loc4,Text3_1_loc1,Text4_0_loc4,Text4_1_loc4,Text5_0_loc4,Text5_1_loc4,Text6_0_loc4,Text6_1_loc4,Text7_0_loc4,Text7_1_loc4," - "Text0_0_loc5,Text0_1_loc5,Text1_0_loc5,Text1_1_loc5,Text2_0_loc5,Text2_1_loc5,Text3_0_loc5,Text3_1_loc1,Text4_0_loc5,Text4_1_loc5,Text5_0_loc5,Text5_1_loc5,Text6_0_loc5,Text6_1_loc5,Text7_0_loc5,Text7_1_loc5," - "Text0_0_loc6,Text0_1_loc6,Text1_0_loc6,Text1_1_loc6,Text2_0_loc6,Text2_1_loc6,Text3_0_loc6,Text3_1_loc1,Text4_0_loc6,Text4_1_loc6,Text5_0_loc6,Text5_1_loc6,Text6_0_loc6,Text6_1_loc6,Text7_0_loc6,Text7_1_loc6," - "Text0_0_loc7,Text0_1_loc7,Text1_0_loc7,Text1_1_loc7,Text2_0_loc7,Text2_1_loc7,Text3_0_loc7,Text3_1_loc1,Text4_0_loc7,Text4_1_loc7,Text5_0_loc7,Text5_1_loc7,Text6_0_loc7,Text6_1_loc7,Text7_0_loc7,Text7_1_loc7, " - "Text0_0_loc8,Text0_1_loc8,Text1_0_loc8,Text1_1_loc8,Text2_0_loc8,Text2_1_loc8,Text3_0_loc8,Text3_1_loc1,Text4_0_loc8,Text4_1_loc8,Text5_0_loc8,Text5_1_loc8,Text6_0_loc8,Text6_1_loc8,Text7_0_loc8,Text7_1_loc8 " + QueryResult result = WorldDatabase.Query("SELECT entry, " + "Text0_0_loc1, Text0_1_loc1, Text1_0_loc1, Text1_1_loc1, Text2_0_loc1, Text2_1_loc1, Text3_0_loc1, Text3_1_loc1, Text4_0_loc1, Text4_1_loc1, Text5_0_loc1, Text5_1_loc1, Text6_0_loc1, Text6_1_loc1, Text7_0_loc1, Text7_1_loc1, " + "Text0_0_loc2, Text0_1_loc2, Text1_0_loc2, Text1_1_loc2, Text2_0_loc2, Text2_1_loc2, Text3_0_loc2, Text3_1_loc1, Text4_0_loc2, Text4_1_loc2, Text5_0_loc2, Text5_1_loc2, Text6_0_loc2, Text6_1_loc2, Text7_0_loc2, Text7_1_loc2, " + "Text0_0_loc3, Text0_1_loc3, Text1_0_loc3, Text1_1_loc3, Text2_0_loc3, Text2_1_loc3, Text3_0_loc3, Text3_1_loc1, Text4_0_loc3, Text4_1_loc3, Text5_0_loc3, Text5_1_loc3, Text6_0_loc3, Text6_1_loc3, Text7_0_loc3, Text7_1_loc3, " + "Text0_0_loc4, Text0_1_loc4, Text1_0_loc4, Text1_1_loc4, Text2_0_loc4, Text2_1_loc4, Text3_0_loc4, Text3_1_loc1, Text4_0_loc4, Text4_1_loc4, Text5_0_loc4, Text5_1_loc4, Text6_0_loc4, Text6_1_loc4, Text7_0_loc4, Text7_1_loc4, " + "Text0_0_loc5, Text0_1_loc5, Text1_0_loc5, Text1_1_loc5, Text2_0_loc5, Text2_1_loc5, Text3_0_loc5, Text3_1_loc1, Text4_0_loc5, Text4_1_loc5, Text5_0_loc5, Text5_1_loc5, Text6_0_loc5, Text6_1_loc5, Text7_0_loc5, Text7_1_loc5, " + "Text0_0_loc6, Text0_1_loc6, Text1_0_loc6, Text1_1_loc6, Text2_0_loc6, Text2_1_loc6, Text3_0_loc6, Text3_1_loc1, Text4_0_loc6, Text4_1_loc6, Text5_0_loc6, Text5_1_loc6, Text6_0_loc6, Text6_1_loc6, Text7_0_loc6, Text7_1_loc6, " + "Text0_0_loc7, Text0_1_loc7, Text1_0_loc7, Text1_1_loc7, Text2_0_loc7, Text2_1_loc7, Text3_0_loc7, Text3_1_loc1, Text4_0_loc7, Text4_1_loc7, Text5_0_loc7, Text5_1_loc7, Text6_0_loc7, Text6_1_loc7, Text7_0_loc7, Text7_1_loc7, " + "Text0_0_loc8, Text0_1_loc8, Text1_0_loc8, Text1_1_loc8, Text2_0_loc8, Text2_1_loc8, Text3_0_loc8, Text3_1_loc1, Text4_0_loc8, Text4_1_loc8, Text5_0_loc8, Text5_1_loc8, Text6_0_loc8, Text6_1_loc8, Text7_0_loc8, Text7_1_loc8 " " FROM locales_npc_text"); if (!result) @@ -6188,7 +6188,7 @@ void ObjectMgr::LoadQuestAreaTriggers() mQuestAreaTriggerMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT id,quest FROM areatrigger_involvedrelation"); + QueryResult result = WorldDatabase.Query("SELECT id, quest FROM areatrigger_involvedrelation"); if (!result) { @@ -6211,7 +6211,7 @@ void ObjectMgr::LoadQuestAreaTriggers() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",trigger_ID); + sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", trigger_ID); continue; } @@ -6219,13 +6219,13 @@ void ObjectMgr::LoadQuestAreaTriggers() if (!quest) { - sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u",trigger_ID,quest_ID); + sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not existing quest %u", trigger_ID, quest_ID); continue; } if (!quest->HasFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT)) { - sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.",trigger_ID,quest_ID); + sLog->outErrorDb("Table `areatrigger_involvedrelation` has record (id: %u) for not quest %u, but quest not have flag QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT. Trigger or quest flags must be fixed, quest modified to require objective.", trigger_ID, quest_ID); // this will prevent quest completing without objective const_cast<Quest*>(quest)->SetFlag(QUEST_TRINITY_FLAGS_EXPLORATION_OR_EVENT); @@ -6269,7 +6269,7 @@ void ObjectMgr::LoadTavernAreaTriggers() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",Trigger_ID); + sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); continue; } @@ -6308,7 +6308,7 @@ void ObjectMgr::LoadAreaTriggerScripts() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",Trigger_ID); + sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); continue; } mAreaTriggerScripts[Trigger_ID] = GetScriptId(scriptName); @@ -6428,7 +6428,7 @@ void ObjectMgr::LoadGraveyardZones() mGraveYardMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT id,ghost_zone,faction FROM game_graveyard_zone"); + QueryResult result = WorldDatabase.Query("SELECT id, ghost_zone, faction FROM game_graveyard_zone"); if (!result) { @@ -6452,31 +6452,31 @@ void ObjectMgr::LoadGraveyardZones() WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(safeLocId); if (!entry) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.",safeLocId); + sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", safeLocId); continue; } AreaTableEntry const *areaEntry = GetAreaEntryByAreaID(zoneId); if (!areaEntry) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.",zoneId); + sLog->outErrorDb("Table `game_graveyard_zone` has a record for not existing zone id (%u), skipped.", zoneId); continue; } if (areaEntry->zone != 0) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.",zoneId); + sLog->outErrorDb("Table `game_graveyard_zone` has a record for subzone id (%u) instead of zone, skipped.", zoneId); continue; } if (team != 0 && team != HORDE && team != ALLIANCE) { - sLog->outErrorDb("Table `game_graveyard_zone` has a record for non player faction (%u), skipped.",team); + sLog->outErrorDb("Table `game_graveyard_zone` has a record for non player faction (%u), skipped.", team); continue; } - if (!AddGraveYardLink(safeLocId,zoneId,team,false)) - sLog->outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.",safeLocId,zoneId); + if (!AddGraveYardLink(safeLocId, zoneId, team, false)) + sLog->outErrorDb("Table `game_graveyard_zone` has a duplicate record for Graveyard (ID: %u) and Zone (ID: %u), skipped.", safeLocId, zoneId); } while (result->NextRow()); sLog->outString(">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); @@ -6486,7 +6486,7 @@ void ObjectMgr::LoadGraveyardZones() WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) { // search for zone associated closest graveyard - uint32 zoneId = sMapMgr->GetZoneId(MapId,x,y,z); + uint32 zoneId = sMapMgr->GetZoneId(MapId, x, y, z); if (!zoneId) { @@ -6496,7 +6496,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float } // Simulate std. algorithm: - // found some graveyard associated to (ghost_zone,ghost_map) + // found some graveyard associated to (ghost_zone, ghost_map) // // if mapId == graveyard.mapId (ghost in plain zone or city or battleground) and search graveyard at same map // then check faction @@ -6509,7 +6509,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float if (graveLow == graveUp && !map->IsBattleArena()) { - sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); + sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); return NULL; } @@ -6535,7 +6535,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float WorldSafeLocsEntry const* entry = sWorldSafeLocsStore.LookupEntry(data.safeLocId); if (!entry) { - sLog->outErrorDb("Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.",data.safeLocId); + sLog->outErrorDb("Table `game_graveyard_zone` has record for not existing graveyard (WorldSafeLocs.dbc id) %u, skipped.", data.safeLocId); continue; } @@ -6622,7 +6622,7 @@ GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId) bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inDB) { - if (FindGraveYardData(id,zoneId)) + if (FindGraveYardData(id, zoneId)) return false; // add link to loaded data @@ -6630,13 +6630,13 @@ bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool inD data.safeLocId = id; data.team = team; - mGraveYardMap.insert(GraveYardMap::value_type(zoneId,data)); + mGraveYardMap.insert(GraveYardMap::value_type(zoneId, data)); // add link to DB if (inDB) { - WorldDatabase.PExecute("INSERT INTO game_graveyard_zone (id,ghost_zone,faction) " - "VALUES ('%u', '%u','%u')",id,zoneId,team); + WorldDatabase.PExecute("INSERT INTO game_graveyard_zone (id, ghost_zone, faction) " + "VALUES ('%u', '%u', '%u')", id, zoneId, team); } return true; @@ -6648,7 +6648,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool GraveYardMap::iterator graveUp = mGraveYardMap.upper_bound(zoneId); if (graveLow == graveUp) { - //sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.",zoneId,team); + //sLog->outErrorDb("Table `game_graveyard_zone` incomplete: Zone %u Team %u does not have a linked graveyard.", zoneId, team); return; } @@ -6683,7 +6683,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool // remove link from DB if (inDB) { - WorldDatabase.PExecute("DELETE FROM game_graveyard_zone WHERE id = '%u' AND ghost_zone = '%u' AND faction = '%u'",id,zoneId,team); + WorldDatabase.PExecute("DELETE FROM game_graveyard_zone WHERE id = '%u' AND ghost_zone = '%u' AND faction = '%u'", id, zoneId, team); } return; @@ -6725,20 +6725,20 @@ void ObjectMgr::LoadAreaTriggerTeleports() AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.",Trigger_ID); + sLog->outErrorDb("Area trigger (ID:%u) does not exist in `AreaTrigger.dbc`.", Trigger_ID); continue; } MapEntry const* mapEntry = sMapStore.LookupEntry(at.target_mapId); if (!mapEntry) { - sLog->outErrorDb("Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.",Trigger_ID,at.target_mapId); + sLog->outErrorDb("Area trigger (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Trigger_ID, at.target_mapId); continue; } if (at.target_X == 0 && at.target_Y == 0 && at.target_Z == 0) { - sLog->outErrorDb("Area trigger (ID:%u) target coordinates not provided.",Trigger_ID); + sLog->outErrorDb("Area trigger (ID:%u) target coordinates not provided.", Trigger_ID); continue; } @@ -6775,7 +6775,7 @@ void ObjectMgr::LoadAccessRequirements() uint32 mapid = fields[0].GetUInt32(); uint8 difficulty = fields[1].GetUInt8(); - uint32 requirement_ID = MAKE_PAIR32(mapid,difficulty); + uint32 requirement_ID = MAKE_PAIR32(mapid, difficulty); AccessRequirement ar; @@ -7087,10 +7087,10 @@ void ObjectMgr::LoadGameObjectLocales() mGameObjectLocaleMap.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry," - "name_loc1,name_loc2,name_loc3,name_loc4,name_loc5,name_loc6,name_loc7,name_loc8," - "castbarcaption_loc1,castbarcaption_loc2,castbarcaption_loc3,castbarcaption_loc4," - "castbarcaption_loc5,castbarcaption_loc6,castbarcaption_loc7,castbarcaption_loc8 FROM locales_gameobject"); + QueryResult result = WorldDatabase.Query("SELECT entry, " + "name_loc1, name_loc2, name_loc3, name_loc4, name_loc5, name_loc6, name_loc7, name_loc8, " + "castbarcaption_loc1, castbarcaption_loc2, castbarcaption_loc3, castbarcaption_loc4, " + "castbarcaption_loc5, castbarcaption_loc6, castbarcaption_loc7, castbarcaption_loc8 FROM locales_gameobject"); if (!result) return; @@ -7121,41 +7121,41 @@ void ObjectMgr::LoadGameObjectLocales() sLog->outString(); } -inline void CheckGOLockId(GameObjectTemplate* goInfo,uint32 dataN,uint32 N) +inline void CheckGOLockId(GameObjectTemplate* goInfo, uint32 dataN, uint32 N) { if (sLockStore.LookupEntry(dataN)) return; sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but lock (Id: %u) not found.", - goInfo->entry,goInfo->type,N,goInfo->door.lockId,goInfo->door.lockId); + goInfo->entry, goInfo->type, N, goInfo->door.lockId, goInfo->door.lockId); } -inline void CheckGOLinkedTrapId(GameObjectTemplate const* goInfo,uint32 dataN,uint32 N) +inline void CheckGOLinkedTrapId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) { if (GameObjectTemplate const* trapInfo = sObjectMgr->GetGameObjectTemplate(dataN)) { if (trapInfo->type != GAMEOBJECT_TYPE_TRAP) sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but GO (Entry %u) have not GAMEOBJECT_TYPE_TRAP (%u) type.", - goInfo->entry,goInfo->type,N,dataN,dataN,GAMEOBJECT_TYPE_TRAP); + goInfo->entry, goInfo->type, N, dataN, dataN, GAMEOBJECT_TYPE_TRAP); } } -inline void CheckGOSpellId(GameObjectTemplate const* goInfo,uint32 dataN,uint32 N) +inline void CheckGOSpellId(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) { if (sSpellStore.LookupEntry(dataN)) return; sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but Spell (Entry %u) not exist.", - goInfo->entry,goInfo->type,N,dataN,dataN); + goInfo->entry, goInfo->type, N, dataN, dataN); } -inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo,uint32 const& dataN,uint32 N) +inline void CheckAndFixGOChairHeightId(GameObjectTemplate const* goInfo, uint32 const& dataN, uint32 N) { if (dataN <= (UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR)) return; sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but correct chair height in range 0..%i.", - goInfo->entry,goInfo->type,N,dataN,UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); + goInfo->entry, goInfo->type, N, dataN, UNIT_STAND_STATE_SIT_HIGH_CHAIR-UNIT_STAND_STATE_SIT_LOW_CHAIR); // prevent client and server unexpected work const_cast<uint32&>(dataN) = 0; @@ -7170,14 +7170,14 @@ inline void CheckGONoDamageImmuneId(GameObjectTemplate* goTemplate, uint32 dataN sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) noDamageImmune field value.", goTemplate->entry, goTemplate->type, N, dataN); } -inline void CheckGOConsumable(GameObjectTemplate const* goInfo,uint32 dataN,uint32 N) +inline void CheckGOConsumable(GameObjectTemplate const* goInfo, uint32 dataN, uint32 N) { // 0/1 correct values if (dataN <= 1) return; sLog->outErrorDb("Gameobject (Entry: %u GoType: %u) have data%d=%u but expected boolean (0/1) consumable field value.", - goInfo->entry,goInfo->type,N,dataN); + goInfo->entry, goInfo->type, N, dataN); } void ObjectMgr::LoadGameObjectTemplate() @@ -7417,7 +7417,7 @@ void ObjectMgr::LoadPetNames() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT word,entry,half FROM pet_name_generation"); + QueryResult result = WorldDatabase.Query("SELECT word, entry, half FROM pet_name_generation"); if (!result) { @@ -7593,7 +7593,7 @@ void ObjectMgr::LoadReputationOnKill() uint32 count = 0; // 0 1 2 - QueryResult result = WorldDatabase.Query("SELECT creature_id, RewOnKillRepFaction1, RewOnKillRepFaction2," + QueryResult result = WorldDatabase.Query("SELECT creature_id, RewOnKillRepFaction1, RewOnKillRepFaction2, " // 3 4 5 6 7 8 9 "IsTeamAward1, MaxStanding1, RewOnKillRepValue1, IsTeamAward2, MaxStanding2, RewOnKillRepValue2, TeamDependent " "FROM creature_onkill_reputation"); @@ -7802,9 +7802,9 @@ void ObjectMgr::LoadPointsOfInterest() POI.data = fields[5].GetUInt32(); POI.icon_name = fields[6].GetString(); - if (!Trinity::IsValidMapCoord(POI.x,POI.y)) + if (!Trinity::IsValidMapCoord(POI.x, POI.y)) { - sLog->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.",point_id,POI.x,POI.y); + sLog->outErrorDb("Table `points_of_interest` (Entry: %u) have invalid coordinates (X: %f Y: %f), ignored.", point_id, POI.x, POI.y); continue; } @@ -8146,14 +8146,14 @@ void ObjectMgr::DeleteGOData(uint32 guid) void ObjectMgr::AddCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid, uint32 instance) { // corpses are always added to spawn mode 0 and they are spawned by their instance id - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(mapid,0)][cellid]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(mapid, 0)][cellid]; cell_guids.corpses[player_guid] = instance; } void ObjectMgr::DeleteCorpseCellData(uint32 mapid, uint32 cellid, uint32 player_guid) { // corpses are always added to spawn mode 0 and they are spawned by their instance id - CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(mapid,0)][cellid]; + CellObjectGuids& cell_guids = mMapObjectGuids[MAKE_PAIR32(mapid, 0)][cellid]; cell_guids.corpses.erase(player_guid); } @@ -8211,9 +8211,9 @@ void ObjectMgr::LoadGameobjectQuestRelations() { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - sLog->outErrorDb("Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u",itr->first,itr->second); + sLog->outErrorDb("Table `gameobject_questrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - sLog->outErrorDb("Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER",itr->first,itr->second); + sLog->outErrorDb("Table `gameobject_questrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } @@ -8225,9 +8225,9 @@ void ObjectMgr::LoadGameobjectInvolvedRelations() { GameObjectTemplate const* goInfo = GetGameObjectTemplate(itr->first); if (!goInfo) - sLog->outErrorDb("Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u",itr->first,itr->second); + sLog->outErrorDb("Table `gameobject_involvedrelation` have data for not existed gameobject entry (%u) and existed quest %u", itr->first, itr->second); else if (goInfo->type != GAMEOBJECT_TYPE_QUESTGIVER) - sLog->outErrorDb("Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER",itr->first,itr->second); + sLog->outErrorDb("Table `gameobject_involvedrelation` have data gameobject entry (%u) for quest %u, but GO is not GAMEOBJECT_TYPE_QUESTGIVER", itr->first, itr->second); } } @@ -8239,9 +8239,9 @@ void ObjectMgr::LoadCreatureQuestRelations() { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - sLog->outErrorDb("Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u",itr->first,itr->second); + sLog->outErrorDb("Table `creature_questrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - sLog->outErrorDb("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER",itr->first,itr->second); + sLog->outErrorDb("Table `creature_questrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -8253,9 +8253,9 @@ void ObjectMgr::LoadCreatureInvolvedRelations() { CreatureTemplate const* cInfo = GetCreatureTemplate(itr->first); if (!cInfo) - sLog->outErrorDb("Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u",itr->first,itr->second); + sLog->outErrorDb("Table `creature_involvedrelation` have data for not existed creature entry (%u) and existed quest %u", itr->first, itr->second); else if (!(cInfo->npcflag & UNIT_NPC_FLAG_QUESTGIVER)) - sLog->outErrorDb("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER",itr->first,itr->second); + sLog->outErrorDb("Table `creature_involvedrelation` has creature entry (%u) for quest %u, but npcflag does not include UNIT_NPC_FLAG_QUESTGIVER", itr->first, itr->second); } } @@ -8283,7 +8283,7 @@ void ObjectMgr::LoadReservedPlayersNames() std::string name= fields[0].GetString(); std::wstring wstr; - if (!Utf8toWStr (name,wstr)) + if (!Utf8toWStr (name, wstr)) { sLog->outError("Table `reserved_name` have invalid name: %s", name.c_str()); continue; @@ -8303,7 +8303,7 @@ void ObjectMgr::LoadReservedPlayersNames() bool ObjectMgr::IsReservedName(const std::string& name) const { std::wstring wstr; - if (!Utf8toWStr (name,wstr)) + if (!Utf8toWStr (name, wstr)) return false; wstrToLower(wstr); @@ -8352,11 +8352,11 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo { if (strictMask == 0) // any language, ignore realm { - if (isExtendedLatinString(wstr,numericOrSpace)) + if (isExtendedLatinString(wstr, numericOrSpace)) return true; - if (isCyrillicString(wstr,numericOrSpace)) + if (isCyrillicString(wstr, numericOrSpace)) return true; - if (isEastAsianString(wstr,numericOrSpace)) + if (isEastAsianString(wstr, numericOrSpace)) return true; return false; } @@ -8365,19 +8365,19 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo { LanguageType lt = GetRealmLanguageType(create); if (lt & LT_EXTENDEN_LATIN) - if (isExtendedLatinString(wstr,numericOrSpace)) + if (isExtendedLatinString(wstr, numericOrSpace)) return true; if (lt & LT_CYRILLIC) - if (isCyrillicString(wstr,numericOrSpace)) + if (isCyrillicString(wstr, numericOrSpace)) return true; if (lt & LT_EAST_ASIA) - if (isEastAsianString(wstr,numericOrSpace)) + if (isEastAsianString(wstr, numericOrSpace)) return true; } if (strictMask & 0x1) // basic Latin { - if (isBasicLatinString(wstr,numericOrSpace)) + if (isBasicLatinString(wstr, numericOrSpace)) return true; } @@ -8387,7 +8387,7 @@ bool isValidString(std::wstring wstr, uint32 strictMask, bool numericOrSpace, bo uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create) { std::wstring wname; - if (!Utf8toWStr(name,wname)) + if (!Utf8toWStr(name, wname)) return CHAR_NAME_INVALID_CHARACTER; if (wname.size() > MAX_PLAYER_NAME) @@ -8398,7 +8398,7 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create) return CHAR_NAME_TOO_SHORT; uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_PLAYER_NAMES); - if (!isValidString(wname,strictMask,false,create)) + if (!isValidString(wname, strictMask, false, create)) return CHAR_NAME_MIXED_LANGUAGES; return CHAR_NAME_SUCCESS; @@ -8407,7 +8407,7 @@ uint8 ObjectMgr::CheckPlayerName(const std::string& name, bool create) bool ObjectMgr::IsValidCharterName(const std::string& name) { std::wstring wname; - if (!Utf8toWStr(name,wname)) + if (!Utf8toWStr(name, wname)) return false; if (wname.size() > MAX_CHARTER_NAME) @@ -8419,13 +8419,13 @@ bool ObjectMgr::IsValidCharterName(const std::string& name) uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_CHARTER_NAMES); - return isValidString(wname,strictMask,true); + return isValidString(wname, strictMask, true); } PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name) { std::wstring wname; - if (!Utf8toWStr(name,wname)) + if (!Utf8toWStr(name, wname)) return PET_NAME_INVALID; if (wname.size() > MAX_PET_NAME) @@ -8436,7 +8436,7 @@ PetNameInvalidReason ObjectMgr::CheckPetName(const std::string& name) return PET_NAME_TOO_SHORT; uint32 strictMask = sWorld->getIntConfig(CONFIG_STRICT_PET_NAMES); - if (!isValidString(wname,strictMask,false)) + if (!isValidString(wname, strictMask, false)) return PET_NAME_MIXED_LANGUAGES; return PET_NAME_SUCCESS; @@ -8514,12 +8514,12 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max { if (end_value >= start_value) { - sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.",table,min_value,max_value); + sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); return false; } - // real range (max+1,min+1) exaple: (-10,-1000) -> -999...-10+1 - std::swap(start_value,end_value); + // real range (max+1, min+1) exaple: (-10, -1000) -> -999...-10+1 + std::swap(start_value, end_value); ++start_value; ++end_value; } @@ -8527,7 +8527,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max { if (start_value >= end_value) { - sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.",table,min_value,max_value); + sLog->outErrorDb("Table '%s' attempt loaded with invalid range (%d - %d), strings not loaded.", table, min_value, max_value); return false; } } @@ -8541,15 +8541,15 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max ++itr; } - QueryResult result = WorldDatabase.PQuery("SELECT entry,content_default,content_loc1,content_loc2,content_loc3,content_loc4,content_loc5,content_loc6,content_loc7,content_loc8 FROM %s",table); + QueryResult result = WorldDatabase.PQuery("SELECT entry, content_default, content_loc1, content_loc2, content_loc3, content_loc4, content_loc5, content_loc6, content_loc7, content_loc8 FROM %s", table); if (!result) { if (min_value == MIN_TRINITY_STRING_ID) // error only in case internal strings - sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.",table); + sLog->outErrorDb(">> Loaded 0 trinity strings. DB table `%s` is empty. Cannot continue.", table); else - sLog->outString(">> Loaded 0 string templates. DB table `%s` is empty.",table); + sLog->outString(">> Loaded 0 string templates. DB table `%s` is empty.", table); sLog->outString(); return false; } @@ -8564,12 +8564,12 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (entry == 0) { - sLog->outErrorDb("Table `%s` contain reserved entry 0, ignored.",table); + sLog->outErrorDb("Table `%s` contain reserved entry 0, ignored.", table); continue; } else if (entry < start_value || entry >= end_value) { - sLog->outErrorDb("Table `%s` contain entry %i out of allowed range (%d - %d), ignored.",table,entry,min_value,max_value); + sLog->outErrorDb("Table `%s` contain entry %i out of allowed range (%d - %d), ignored.", table, entry, min_value, max_value); continue; } @@ -8577,7 +8577,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max if (data.Content.size() > 0) { - sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.",table,entry); + sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry); continue; } @@ -8611,9 +8611,9 @@ const char *ObjectMgr::GetTrinityString(int32 entry, LocaleConstant locale_idx) } if (entry > 0) - sLog->outErrorDb("Entry %i not found in `trinity_string` table.",entry); + sLog->outErrorDb("Entry %i not found in `trinity_string` table.", entry); else - sLog->outErrorDb("Trinity string entry %i not found in DB.",entry); + sLog->outErrorDb("Trinity string entry %i not found in DB.", entry); return "<error>"; } @@ -8623,7 +8623,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() mFishingBaseForArea.clear(); // for reload case - QueryResult result = WorldDatabase.Query("SELECT entry,skill FROM skill_fishing_base_level"); + QueryResult result = WorldDatabase.Query("SELECT entry, skill FROM skill_fishing_base_level"); if (!result) { @@ -8644,7 +8644,7 @@ void ObjectMgr::LoadFishingBaseSkillLevel() AreaTableEntry const* fArea = GetAreaEntryByAreaID(entry); if (!fArea) { - sLog->outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist",entry); + sLog->outErrorDb("AreaId %u defined in `skill_fishing_base_level` does not exist", entry); continue; } @@ -8662,10 +8662,10 @@ bool ObjectMgr::CheckDeclinedNames(std::wstring mainpart, DeclinedName const& na for (uint8 i =0; i < MAX_DECLINED_NAME_CASES; ++i) { std::wstring wname; - if (!Utf8toWStr(names.name[i],wname)) + if (!Utf8toWStr(names.name[i], wname)) return false; - if (mainpart != GetMainPartOfName(wname,i+1)) + if (mainpart != GetMainPartOfName(wname, i+1)) return false; } return true; @@ -8681,7 +8681,7 @@ uint32 ObjectMgr::GetAreaTriggerScriptId(uint32 trigger_id) SpellScriptsBounds ObjectMgr::GetSpellScriptsBounds(uint32 spell_id) { - return SpellScriptsBounds(mSpellScripts.lower_bound(spell_id),mSpellScripts.upper_bound(spell_id)); + return SpellScriptsBounds(mSpellScripts.lower_bound(spell_id), mSpellScripts.upper_bound(spell_id)); } SkillRangeType GetSkillRangeType(SkillLineEntry const *pSkill, bool racial) @@ -8749,15 +8749,15 @@ void ObjectMgr::LoadGameTele() gt.mapId = fields[5].GetUInt32(); gt.name = fields[6].GetString(); - if (!MapManager::IsValidMapCoord(gt.mapId,gt.position_x,gt.position_y,gt.position_z,gt.orientation)) + if (!MapManager::IsValidMapCoord(gt.mapId, gt.position_x, gt.position_y, gt.position_z, gt.orientation)) { - sLog->outErrorDb("Wrong position for id %u (name: %s) in `game_tele` table, ignoring.",id,gt.name.c_str()); + sLog->outErrorDb("Wrong position for id %u (name: %s) in `game_tele` table, ignoring.", id, gt.name.c_str()); continue; } - if (!Utf8toWStr(gt.name,gt.wnameLow)) + if (!Utf8toWStr(gt.name, gt.wnameLow)) { - sLog->outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.",id); + sLog->outErrorDb("Wrong UTF8 name for id %u in `game_tele` table, ignoring.", id); continue; } @@ -8777,7 +8777,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const { // explicit name case std::wstring wname; - if (!Utf8toWStr(name,wname)) + if (!Utf8toWStr(name, wname)) return false; // converting string that we try to find to lower case @@ -8807,15 +8807,15 @@ bool ObjectMgr::AddGameTele(GameTele& tele) // use next ++new_id; - if (!Utf8toWStr(tele.name,tele.wnameLow)) + if (!Utf8toWStr(tele.name, tele.wnameLow)) return false; wstrToLower(tele.wnameLow); m_GameTeleMap[new_id] = tele; - WorldDatabase.PExecute("INSERT INTO game_tele (id,position_x,position_y,position_z,orientation,map,name) VALUES (%u,%f,%f,%f,%f,%d,'%s')", - new_id,tele.position_x,tele.position_y,tele.position_z,tele.orientation,tele.mapId,tele.name.c_str()); + WorldDatabase.PExecute("INSERT INTO game_tele (id, position_x, position_y, position_z, orientation, map, name) VALUES (%u, %f, %f, %f, %f, %d, '%s')", + new_id, tele.position_x, tele.position_y, tele.position_z, tele.orientation, tele.mapId, tele.name.c_str()); return true; } @@ -8823,7 +8823,7 @@ bool ObjectMgr::DeleteGameTele(const std::string& name) { // explicit name case std::wstring wname; - if (!Utf8toWStr(name,wname)) + if (!Utf8toWStr(name, wname)) return false; // converting string that we try to find to lower case @@ -8833,7 +8833,7 @@ bool ObjectMgr::DeleteGameTele(const std::string& name) { if (itr->second.wnameLow == wname) { - WorldDatabase.PExecute("DELETE FROM game_tele WHERE name = '%s'",itr->second.name.c_str()); + WorldDatabase.PExecute("DELETE FROM game_tele WHERE name = '%s'", itr->second.name.c_str()); m_GameTeleMap.erase(itr); return true; } @@ -8871,29 +8871,29 @@ void ObjectMgr::LoadMailLevelRewards() if (level > MAX_LEVEL) { - sLog->outErrorDb("Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.",level,MAX_LEVEL); + sLog->outErrorDb("Table `mail_level_reward` have data for level %u that more supported by client (%u), ignoring.", level, MAX_LEVEL); continue; } if (!(raceMask & RACEMASK_ALL_PLAYABLE)) { - sLog->outErrorDb("Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.",raceMask,level); + sLog->outErrorDb("Table `mail_level_reward` have raceMask (%u) for level %u that not include any player races, ignoring.", raceMask, level); continue; } if (!sMailTemplateStore.LookupEntry(mailTemplateId)) { - sLog->outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.",mailTemplateId,level); + sLog->outErrorDb("Table `mail_level_reward` have invalid mailTemplateId (%u) for level %u that invalid not include any player races, ignoring.", mailTemplateId, level); continue; } if (!GetCreatureTemplate(senderEntry)) { - sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.",senderEntry,level); + sLog->outErrorDb("Table `mail_level_reward` have not existed sender creature entry (%u) for level %u that invalid not include any player races, ignoring.", senderEntry, level); continue; } - m_mailLevelRewardMap[level].push_back(MailLevelReward(raceMask,mailTemplateId,senderEntry)); + m_mailLevelRewardMap[level].push_back(MailLevelReward(raceMask, mailTemplateId, senderEntry)); ++count; } @@ -9249,16 +9249,16 @@ void ObjectMgr::LoadGossipMenuItems() sLog->outString(); } -void ObjectMgr::AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb) +void ObjectMgr::AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 extendedcost, bool savetodb) { VendorItemData& vList = m_mCacheVendorItemMap[entry]; vList.AddItem(item, maxcount, incrtime, extendedcost); if (savetodb) - WorldDatabase.PExecute("INSERT INTO npc_vendor (entry,item,maxcount,incrtime,extendedcost) VALUES('%u','%u','%u','%u','%u')", entry, item, maxcount, incrtime, extendedcost); + WorldDatabase.PExecute("INSERT INTO npc_vendor (entry, item, maxcount, incrtime, extendedcost) VALUES('%u', '%u', '%u', '%u', '%u')", entry, item, maxcount, incrtime, extendedcost); } -bool ObjectMgr::RemoveVendorItem(uint32 entry,uint32 item, bool savetodb) +bool ObjectMgr::RemoveVendorItem(uint32 entry, uint32 item, bool savetodb) { CacheVendorItemMap::iterator iter = m_mCacheVendorItemMap.find(entry); if (iter == m_mCacheVendorItemMap.end()) @@ -9267,7 +9267,7 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry,uint32 item, bool savetodb) if(!iter->second.RemoveItem(item)) return false; - if (savetodb) WorldDatabase.PExecute("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'",entry, item); + if (savetodb) WorldDatabase.PExecute("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'", entry, item); return true; } @@ -9469,7 +9469,7 @@ bool LoadTrinityStrings(char const* table, int32 start_value, int32 end_value) // start/end reversed for negative values if (start_value > MAX_DB_SCRIPT_STRING_ID || end_value >= start_value) { - sLog->outErrorDb("Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.",table,start_value,end_value+1); + sLog->outErrorDb("Table '%s' load attempted with range (%d - %d) reserved by Trinity, strings not loaded.", table, start_value, end_value+1); return false; } @@ -9483,7 +9483,7 @@ uint32 GetScriptId(const char *name) CreatureBaseStats const* ObjectMgr::GetCreatureBaseStats(uint8 level, uint8 unitClass) { - CreatureBaseStatsMap::const_iterator it = m_creatureBaseStatsMap.find(MAKE_PAIR16(level,unitClass)); + CreatureBaseStatsMap::const_iterator it = m_creatureBaseStatsMap.find(MAKE_PAIR16(level, unitClass)); if (it != m_creatureBaseStatsMap.end()) return &(it->second); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index c9f3e8eb11e..6a6848590e0 100755 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -49,11 +49,11 @@ class Guild; class ArenaTeam; class Item; -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct PageText @@ -356,7 +356,7 @@ struct SpellClickInfo }; typedef std::multimap<uint32, SpellClickInfo> SpellClickInfoMap; -typedef std::pair<SpellClickInfoMap::const_iterator,SpellClickInfoMap::const_iterator> SpellClickInfoMapBounds; +typedef std::pair<SpellClickInfoMap::const_iterator, SpellClickInfoMap::const_iterator> SpellClickInfoMapBounds; struct AreaTrigger { @@ -368,17 +368,17 @@ struct AreaTrigger }; typedef std::set<uint32> CellGuidSet; -typedef std::map<uint32/*player guid*/,uint32/*instance*/> CellCorpseSet; +typedef std::map<uint32/*player guid*/, uint32/*instance*/> CellCorpseSet; struct CellObjectGuids { CellGuidSet creatures; CellGuidSet gameobjects; CellCorpseSet corpses; }; -typedef UNORDERED_MAP<uint32/*cell_id*/,CellObjectGuids> CellObjectGuidsMap; -typedef UNORDERED_MAP<uint32/*(mapid,spawnMode) pair*/,CellObjectGuidsMap> MapObjectGuids; +typedef UNORDERED_MAP<uint32/*cell_id*/, CellObjectGuids> CellObjectGuidsMap; +typedef UNORDERED_MAP<uint32/*(mapid, spawnMode) pair*/, CellObjectGuidsMap> MapObjectGuids; -typedef UNORDERED_MAP<uint64/*(instance,guid) pair*/,time_t> RespawnTimes; +typedef UNORDERED_MAP<uint64/*(instance, guid) pair*/, time_t> RespawnTimes; // Trinity string ranges #define MIN_TRINITY_STRING_ID 1 // 'trinity_string' @@ -396,23 +396,23 @@ struct TrinityStringLocale StringVector Content; }; -typedef std::map<uint64,uint64> LinkedRespawnMap; -typedef UNORDERED_MAP<uint32,CreatureData> CreatureDataMap; -typedef UNORDERED_MAP<uint32,GameObjectData> GameObjectDataMap; -typedef UNORDERED_MAP<uint32,CreatureLocale> CreatureLocaleMap; -typedef UNORDERED_MAP<uint32,GameObjectLocale> GameObjectLocaleMap; -typedef UNORDERED_MAP<uint32,ItemLocale> ItemLocaleMap; -typedef UNORDERED_MAP<uint32,ItemSetNameLocale> ItemSetNameLocaleMap; -typedef UNORDERED_MAP<uint32,QuestLocale> QuestLocaleMap; -typedef UNORDERED_MAP<uint32,NpcTextLocale> NpcTextLocaleMap; -typedef UNORDERED_MAP<uint32,PageTextLocale> PageTextLocaleMap; -typedef UNORDERED_MAP<int32,TrinityStringLocale> TrinityStringLocaleMap; -typedef UNORDERED_MAP<uint32,GossipMenuItemsLocale> GossipMenuItemsLocaleMap; -typedef UNORDERED_MAP<uint32,PointOfInterestLocale> PointOfInterestLocaleMap; - -typedef std::multimap<uint32,uint32> QuestRelations; +typedef std::map<uint64, uint64> LinkedRespawnMap; +typedef UNORDERED_MAP<uint32, CreatureData> CreatureDataMap; +typedef UNORDERED_MAP<uint32, GameObjectData> GameObjectDataMap; +typedef UNORDERED_MAP<uint32, CreatureLocale> CreatureLocaleMap; +typedef UNORDERED_MAP<uint32, GameObjectLocale> GameObjectLocaleMap; +typedef UNORDERED_MAP<uint32, ItemLocale> ItemLocaleMap; +typedef UNORDERED_MAP<uint32, ItemSetNameLocale> ItemSetNameLocaleMap; +typedef UNORDERED_MAP<uint32, QuestLocale> QuestLocaleMap; +typedef UNORDERED_MAP<uint32, NpcTextLocale> NpcTextLocaleMap; +typedef UNORDERED_MAP<uint32, PageTextLocale> PageTextLocaleMap; +typedef UNORDERED_MAP<int32, TrinityStringLocale> TrinityStringLocaleMap; +typedef UNORDERED_MAP<uint32, GossipMenuItemsLocale> GossipMenuItemsLocaleMap; +typedef UNORDERED_MAP<uint32, PointOfInterestLocale> PointOfInterestLocaleMap; + +typedef std::multimap<uint32, uint32> QuestRelations; typedef std::pair<QuestRelations::const_iterator, QuestRelations::const_iterator> QuestRelationBounds; -typedef std::multimap<uint32,ItemRequiredTarget> ItemRequiredTargetMap; +typedef std::multimap<uint32, ItemRequiredTarget> ItemRequiredTargetMap; typedef std::pair<ItemRequiredTargetMap::const_iterator, ItemRequiredTargetMap::const_iterator> ItemRequiredTargetMapBounds; struct PetLevelInfo @@ -436,7 +436,7 @@ struct MailLevelReward }; typedef std::list<MailLevelReward> MailLevelRewardList; -typedef UNORDERED_MAP<uint8,MailLevelRewardList> MailLevelRewardMap; +typedef UNORDERED_MAP<uint8, MailLevelRewardList> MailLevelRewardMap; // We assume the rate is in general the same for all three types below, but chose to keep three for scalability and customization struct RepRewardRate @@ -501,10 +501,10 @@ struct GossipMenus ConditionList conditions; }; -typedef std::multimap<uint32,GossipMenus> GossipMenusMap; +typedef std::multimap<uint32, GossipMenus> GossipMenusMap; typedef std::pair<GossipMenusMap::const_iterator, GossipMenusMap::const_iterator> GossipMenusMapBounds; typedef std::pair<GossipMenusMap::iterator, GossipMenusMap::iterator> GossipMenusMapBoundsNonConst; -typedef std::multimap<uint32,GossipMenuItems> GossipMenuItemsMap; +typedef std::multimap<uint32, GossipMenuItems> GossipMenuItemsMap; typedef std::pair<GossipMenuItemsMap::const_iterator, GossipMenuItemsMap::const_iterator> GossipMenuItemsMapBounds; typedef std::pair<GossipMenuItemsMap::iterator, GossipMenuItemsMap::iterator> GossipMenuItemsMapBoundsNonConst; @@ -540,7 +540,7 @@ struct GraveYardData uint32 safeLocId; uint32 team; }; -typedef std::multimap<uint32,GraveYardData> GraveYardMap; +typedef std::multimap<uint32, GraveYardData> GraveYardMap; // NPC gossip text id typedef UNORDERED_MAP<uint32, uint32> CacheNpcTextIdMap; @@ -594,7 +594,7 @@ struct DungeonEncounter }; typedef std::list<DungeonEncounter const*> DungeonEncounterList; -typedef UNORDERED_MAP<uint32,DungeonEncounterList> DungeonEncounterMap; +typedef UNORDERED_MAP<uint32, DungeonEncounterList> DungeonEncounterMap; class PlayerDumpReader; @@ -698,7 +698,7 @@ class ObjectMgr if (class_ >= MAX_CLASSES) return NULL; return &playerClassInfo[class_]; } - void GetPlayerClassLevelInfo(uint32 class_,uint8 level, PlayerClassLevelInfo* info) const; + void GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo* info) const; PlayerInfo const* GetPlayerInfo(uint32 race, uint32 class_) const { @@ -762,7 +762,7 @@ class ObjectMgr AccessRequirement const* GetAccessRequirement(uint32 mapid, Difficulty difficulty) const { - AccessRequirementMap::const_iterator itr = mAccessRequirements.find(MAKE_PAIR32(mapid,difficulty)); + AccessRequirementMap::const_iterator itr = mAccessRequirements.find(MAKE_PAIR32(mapid, difficulty)); if (itr != mAccessRequirements.end()) return &itr->second; return NULL; @@ -911,7 +911,7 @@ class ObjectMgr void ValidateSpellScripts(); bool LoadTrinityStrings(char const* table, int32 min_value, int32 max_value); - bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string",MIN_TRINITY_STRING_ID,MAX_TRINITY_STRING_ID); } + bool LoadTrinityStrings() { return LoadTrinityStrings("trinity_string", MIN_TRINITY_STRING_ID, MAX_TRINITY_STRING_ID); } void LoadDbScriptStrings(); void LoadCreatureClassLevelStats(); void LoadCreatureLocales(); @@ -1008,7 +1008,7 @@ class ObjectMgr typedef std::multimap<int32, uint32> ExclusiveQuestGroups; ExclusiveQuestGroups mExclusiveQuestGroups; - MailLevelReward const* GetMailLevelReward(uint32 level,uint32 raceMask) + MailLevelReward const* GetMailLevelReward(uint32 level, uint32 raceMask) { MailLevelRewardMap::const_iterator map_itr = m_mailLevelRewardMap.find(level); if (map_itr == m_mailLevelRewardMap.end()) @@ -1023,7 +1023,7 @@ class ObjectMgr CellObjectGuids const& GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id) { - return mMapObjectGuids[MAKE_PAIR32(mapid,spawnMode)][cell_id]; + return mMapObjectGuids[MAKE_PAIR32(mapid, spawnMode)][cell_id]; } CreatureData const* GetCreatureData(uint32 guid) const @@ -1120,7 +1120,7 @@ class ObjectMgr return &itr->second; } const char *GetTrinityString(int32 entry, LocaleConstant locale_idx) const; - const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry,DBCLocaleIndex); } + const char *GetTrinityStringForDBCLocale(int32 entry) const { return GetTrinityString(entry, DBCLocaleIndex); } LocaleConstant GetDBCLocaleIndex() const { return DBCLocaleIndex; } void SetDBCLocaleIndex(LocaleConstant locale) { DBCLocaleIndex = locale; } @@ -1144,14 +1144,14 @@ class ObjectMgr time_t GetCreatureRespawnTime(uint32 loguid, uint32 instance) { ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_CreatureRespawnTimesMtx, 0); - return mCreatureRespawnTimes[MAKE_PAIR64(loguid,instance)]; + return mCreatureRespawnTimes[MAKE_PAIR64(loguid, instance)]; } void SaveCreatureRespawnTime(uint32 loguid, uint32 instance, time_t t); void RemoveCreatureRespawnTime(uint32 loguid, uint32 instance); time_t GetGORespawnTime(uint32 loguid, uint32 instance) { ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, m_GORespawnTimesMtx, 0); - return mGORespawnTimes[MAKE_PAIR64(loguid,instance)]; + return mGORespawnTimes[MAKE_PAIR64(loguid, instance)]; } void SaveGORespawnTime(uint32 loguid, uint32 instance, time_t t); void RemoveGORespawnTime(uint32 loguid, uint32 instance); @@ -1214,7 +1214,7 @@ class ObjectMgr return &iter->second; } - void AddVendorItem(uint32 entry,uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event + void AddVendorItem(uint32 entry, uint32 item, int32 maxcount, uint32 incrtime, uint32 ExtendedCost, bool savetodb = true); // for event bool RemoveVendorItem(uint32 entry, uint32 item, bool savetodb = true); // for event bool IsVendorItemValid(uint32 vendor_entry, uint32 item, int32 maxcount, uint32 ptime, uint32 ExtendedCost, Player* pl = NULL, std::set<uint32>* skip_vendors = NULL, uint32 ORnpcflag = 0) const; @@ -1225,26 +1225,26 @@ class ObjectMgr SpellClickInfoMapBounds GetSpellClickInfoMapBounds(uint32 creature_id) const { - return SpellClickInfoMapBounds(mSpellClickInfoMap.lower_bound(creature_id),mSpellClickInfoMap.upper_bound(creature_id)); + return SpellClickInfoMapBounds(mSpellClickInfoMap.lower_bound(creature_id), mSpellClickInfoMap.upper_bound(creature_id)); } GossipMenusMapBounds GetGossipMenusMapBounds(uint32 uiMenuId) const { - return GossipMenusMapBounds(m_mGossipMenusMap.lower_bound(uiMenuId),m_mGossipMenusMap.upper_bound(uiMenuId)); + return GossipMenusMapBounds(m_mGossipMenusMap.lower_bound(uiMenuId), m_mGossipMenusMap.upper_bound(uiMenuId)); } GossipMenusMapBoundsNonConst GetGossipMenusMapBoundsNonConst(uint32 uiMenuId) { - return GossipMenusMapBoundsNonConst(m_mGossipMenusMap.lower_bound(uiMenuId),m_mGossipMenusMap.upper_bound(uiMenuId)); + return GossipMenusMapBoundsNonConst(m_mGossipMenusMap.lower_bound(uiMenuId), m_mGossipMenusMap.upper_bound(uiMenuId)); } GossipMenuItemsMapBounds GetGossipMenuItemsMapBounds(uint32 uiMenuId) const { - return GossipMenuItemsMapBounds(m_mGossipMenuItemsMap.lower_bound(uiMenuId),m_mGossipMenuItemsMap.upper_bound(uiMenuId)); + return GossipMenuItemsMapBounds(m_mGossipMenuItemsMap.lower_bound(uiMenuId), m_mGossipMenuItemsMap.upper_bound(uiMenuId)); } GossipMenuItemsMapBoundsNonConst GetGossipMenuItemsMapBoundsNonConst(uint32 uiMenuId) { - return GossipMenuItemsMapBoundsNonConst(m_mGossipMenuItemsMap.lower_bound(uiMenuId),m_mGossipMenuItemsMap.upper_bound(uiMenuId)); + return GossipMenuItemsMapBoundsNonConst(m_mGossipMenuItemsMap.lower_bound(uiMenuId), m_mGossipMenuItemsMap.upper_bound(uiMenuId)); } // for wintergrasp only @@ -1368,7 +1368,7 @@ class ObjectMgr CreatureBaseStatsMap m_creatureBaseStatsMap; - typedef std::map<uint32,PetLevelInfo*> PetLevelInfoMap; + typedef std::map<uint32, PetLevelInfo*> PetLevelInfoMap; // PetLevelInfoMap[creature_id][level] PetLevelInfoMap petInfo; // [creature_id][level] @@ -1381,10 +1381,10 @@ class ObjectMgr typedef std::vector<uint32> PlayerXPperLevel; // [level] PlayerXPperLevel mPlayerXPperLevel; - typedef std::map<uint32,uint32> BaseXPMap; // [area level][base xp] + typedef std::map<uint32, uint32> BaseXPMap; // [area level][base xp] BaseXPMap mBaseXPTable; - typedef std::map<uint32,int32> FishingBaseSkillMap; // [areaId][base skill level] + typedef std::map<uint32, int32> FishingBaseSkillMap; // [areaId][base skill level] FishingBaseSkillMap mFishingBaseForArea; typedef std::map<uint32, StringVector> HalfNameMap; @@ -1441,7 +1441,7 @@ class ObjectMgr #define sObjectMgr ACE_Singleton<ObjectMgr, ACE_Null_Mutex>::instance() // scripting access functions -bool LoadTrinityStrings(char const* table,int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min()); +bool LoadTrinityStrings(char const* table, int32 start_value = MAX_CREATURE_AI_TEXT_STRING_ID, int32 end_value = std::numeric_limits<int32>::min()); uint32 GetScriptId(const char *name); #endif diff --git a/src/server/game/Grids/Cells/CellImpl.h b/src/server/game/Grids/Cells/CellImpl.h index 71a93891499..069362466a8 100755 --- a/src/server/game/Grids/Cells/CellImpl.h +++ b/src/server/game/Grids/Cells/CellImpl.h @@ -120,7 +120,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER> &v { for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++) { - CellPair cell_pair(x,y); + CellPair cell_pair(x, y); Cell r_zone(cell_pair); r_zone.data.Part.nocreate = this->data.Part.nocreate; m.Visit(r_zone, visitor); @@ -218,7 +218,7 @@ Cell::Visit(const CellPair& standing_cell, TypeContainerVisitor<T, CONTAINER> &v { for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) { - CellPair cell_pair(x,y); + CellPair cell_pair(x, y); //lets skip standing cell since we already visited it if (cell_pair != standing_cell) { @@ -254,7 +254,7 @@ Cell::VisitCircle(TypeContainerVisitor<T, CONTAINER> &visitor, Map &m, const Cel { for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y) { - CellPair cell_pair(x,y); + CellPair cell_pair(x, y); Cell r_zone(cell_pair); r_zone.data.Part.nocreate = this->data.Part.nocreate; m.Visit(r_zone, visitor); diff --git a/src/server/game/Grids/GridDefines.h b/src/server/game/Grids/GridDefines.h index 6163bef4296..a284e342ca9 100755 --- a/src/server/game/Grids/GridDefines.h +++ b/src/server/game/Grids/GridDefines.h @@ -65,7 +65,7 @@ typedef GridRefManager<DynamicObject> DynamicObjectMapType; typedef GridRefManager<GameObject> GameObjectMapType; typedef GridRefManager<Player> PlayerMapType; -typedef Grid<Player, AllWorldObjectTypes,AllGridObjectTypes> GridType; +typedef Grid<Player, AllWorldObjectTypes, AllGridObjectTypes> GridType; typedef NGrid<MAX_NUMBER_OF_CELLS, Player, AllWorldObjectTypes, AllGridObjectTypes> NGridType; typedef TypeMapContainer<AllGridObjectTypes> GridTypeMapContainer; @@ -180,12 +180,12 @@ namespace Trinity inline bool IsValidMapCoord(float x, float y, float z) { - return IsValidMapCoord(x,y) && finite(z); + return IsValidMapCoord(x, y) && finite(z); } inline bool IsValidMapCoord(float x, float y, float z, float o) { - return IsValidMapCoord(x,y,z) && finite(o); + return IsValidMapCoord(x, y, z) && finite(o); } } #endif diff --git a/src/server/game/Grids/GridLoader.h b/src/server/game/Grids/GridLoader.h index f2246d83878..0e762d3a07e 100755 --- a/src/server/game/Grids/GridLoader.h +++ b/src/server/game/Grids/GridLoader.h @@ -47,7 +47,7 @@ class GridLoader /** Loads the grid */ template<class LOADER> - void Load(Grid<ACTIVE_OBJECT,WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, LOADER &loader) + void Load(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, LOADER &loader) { grid.LockGrid(); loader.Load(grid); @@ -57,7 +57,7 @@ class GridLoader /** Stop the grid */ template<class STOPER> - void Stop(Grid<ACTIVE_OBJECT,WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, STOPER &stoper) + void Stop(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, STOPER &stoper) { grid.LockGrid(); stoper.Stop(grid); @@ -66,7 +66,7 @@ class GridLoader /** Unloads the grid */ template<class UNLOADER> - void Unload(Grid<ACTIVE_OBJECT,WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, UNLOADER &unloader) + void Unload(Grid<ACTIVE_OBJECT, WORLD_OBJECT_TYPES, GRID_OBJECT_TYPES> &grid, UNLOADER &unloader) { grid.LockGrid(); unloader.Unload(grid); diff --git a/src/server/game/Grids/GridStates.cpp b/src/server/game/Grids/GridStates.cpp index b7f910b6059..a1abb66af1f 100755 --- a/src/server/game/Grids/GridStates.cpp +++ b/src/server/game/Grids/GridStates.cpp @@ -38,7 +38,7 @@ ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 &x, c ObjectGridStoper stoper(grid); stoper.StopN(); grid.SetGridState(GRID_STATE_IDLE); - sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to IDLE state", x, y, m.GetId()); } else { @@ -52,7 +52,7 @@ IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const ui { m.ResetGridExpiry(grid); grid.SetGridState(GRID_STATE_REMOVAL); - sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] on map %u moved to REMOVAL state", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", x, y, m.GetId()); } void @@ -65,7 +65,7 @@ RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 &x, c { if (!m.UnloadGrid(x, y, false)) { - sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u,%u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", x, y, m.GetId()); m.ResetGridExpiry(grid); } } diff --git a/src/server/game/Grids/NGrid.h b/src/server/game/Grids/NGrid.h index f7468e1bbb7..95aa6901871 100755 --- a/src/server/game/Grids/NGrid.h +++ b/src/server/game/Grids/NGrid.h @@ -33,10 +33,10 @@ class GridInfo { public: GridInfo() - : i_timer(0), vis_Update(0, irand(0,DEFAULT_VISIBILITY_NOTIFY_PERIOD)), + : i_timer(0), vis_Update(0, irand(0, DEFAULT_VISIBILITY_NOTIFY_PERIOD)), i_unloadActiveLockCount(0), i_unloadExplicitLock(false), i_unloadReferenceLock(false) {} GridInfo(time_t expiry, bool unload = true ) - : i_timer(expiry), vis_Update(0, irand(0,DEFAULT_VISIBILITY_NOTIFY_PERIOD)), + : i_timer(expiry), vis_Update(0, irand(0, DEFAULT_VISIBILITY_NOTIFY_PERIOD)), i_unloadActiveLockCount(0), i_unloadExplicitLock(!unload), i_unloadReferenceLock(false) {} const TimeTracker& getTimeTracker() const { return i_timer; } bool getUnloadLock() const { return i_unloadActiveLockCount || i_unloadExplicitLock || i_unloadReferenceLock; } diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp index 439dd1c875f..9fa6c70cc96 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp +++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp @@ -129,7 +129,7 @@ void PlayerRelocationNotifier::Visit(PlayerMapType &m) vis_guids.erase(plr->GetGUID()); - i_player.UpdateVisibilityOf(plr,i_data,i_visibleNow); + i_player.UpdateVisibilityOf(plr, i_data, i_visibleNow); if (plr->m_seer->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) continue; @@ -148,7 +148,7 @@ void PlayerRelocationNotifier::Visit(CreatureMapType &m) vis_guids.erase(c->GetGUID()); - i_player.UpdateVisibilityOf(c,i_data,i_visibleNow); + i_player.UpdateVisibilityOf(c, i_data, i_visibleNow); if (relocated_for_ai && !c->isNeedNotify(NOTIFY_VISIBILITY_CHANGED)) CreatureUnitRelocationWorker(c, &i_player); diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index c71d9080b92..a575e3685ec 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -173,7 +173,7 @@ namespace Trinity Check &i_check; WorldObjectSearcher(WorldObject const* searcher, WorldObject* & result, Check& check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(GameObjectMapType &m); void Visit(PlayerMapType &m); @@ -192,7 +192,7 @@ namespace Trinity Check& i_check; WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {} void Visit(PlayerMapType &m); void Visit(CreatureMapType &m); @@ -259,7 +259,7 @@ namespace Trinity Check &i_check; GameObjectSearcher(WorldObject const* searcher, GameObject* & result, Check& check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(GameObjectMapType &m); @@ -308,7 +308,7 @@ namespace Trinity Check & i_check; UnitSearcher(WorldObject const* searcher, Unit* & result, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(CreatureMapType &m); void Visit(PlayerMapType &m); @@ -325,7 +325,7 @@ namespace Trinity Check & i_check; UnitLastSearcher(WorldObject const* searcher, Unit* & result, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(CreatureMapType &m); void Visit(PlayerMapType &m); @@ -342,7 +342,7 @@ namespace Trinity Check& i_check; UnitListSearcher(WorldObject const* searcher, std::list<Unit*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {} void Visit(PlayerMapType &m); void Visit(CreatureMapType &m); @@ -360,7 +360,7 @@ namespace Trinity Check & i_check; CreatureSearcher(WorldObject const* searcher, Creature* & result, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(CreatureMapType &m); @@ -376,7 +376,7 @@ namespace Trinity Check & i_check; CreatureLastSearcher(WorldObject const* searcher, Creature* & result, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(CreatureMapType &m); @@ -391,7 +391,7 @@ namespace Trinity Check& i_check; CreatureListSearcher(WorldObject const* searcher, std::list<Creature*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {} void Visit(CreatureMapType &m); @@ -427,7 +427,7 @@ namespace Trinity Check & i_check; PlayerSearcher(WorldObject const* searcher, Player* & result, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_object(result),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {} void Visit(PlayerMapType &m); @@ -442,7 +442,7 @@ namespace Trinity Check& i_check; PlayerListSearcher(WorldObject const* searcher, std::list<Player*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects),i_check(check) {} + : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) {} void Visit(PlayerMapType &m); @@ -481,7 +481,7 @@ namespace Trinity void Visit(PlayerMapType &m) { for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) - if (itr->getSource()->InSamePhase(i_searcher) && itr->getSource()->IsWithinDist(i_searcher,i_dist)) + if (itr->getSource()->InSamePhase(i_searcher) && itr->getSource()->IsWithinDist(i_searcher, i_dist)) i_do(itr->getSource()); } @@ -607,7 +607,7 @@ namespace Trinity class GameObjectFocusCheck { public: - GameObjectFocusCheck(Unit const* unit,uint32 focusId) : i_unit(unit), i_focusId(focusId) {} + GameObjectFocusCheck(Unit const* unit, uint32 focusId) : i_unit(unit), i_focusId(focusId) {} bool operator()(GameObject* go) const { if (go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS) @@ -674,7 +674,7 @@ namespace Trinity class NearestGameObjectEntryInObjectRangeCheck { public: - NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj,uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) {} + NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj, uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) {} bool operator()(GameObject* go) { if (go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range)) @@ -697,7 +697,7 @@ namespace Trinity class GameObjectWithDbGUIDCheck { public: - GameObjectWithDbGUIDCheck(WorldObject const& obj,uint32 db_guid) : i_obj(obj), i_db_guid(db_guid) {} + GameObjectWithDbGUIDCheck(WorldObject const& obj, uint32 db_guid) : i_obj(obj), i_db_guid(db_guid) {} bool operator()(GameObject const* go) const { return go->GetDBTableGUIDLow() == i_db_guid; @@ -1074,7 +1074,7 @@ namespace Trinity { if (u == i_obj) return false; - if (!u->CanAssistTo(i_obj,i_enemy)) + if (!u->CanAssistTo(i_obj, i_enemy)) return false; if (!i_obj->IsWithinDistInMap(u, i_range)) @@ -1160,7 +1160,7 @@ namespace Trinity AllGameObjectsWithEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} bool operator() (GameObject* pGo) { - if (pGo->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pGo,m_fRange,false)) + if (pGo->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pGo, m_fRange, false)) return true; return false; @@ -1177,7 +1177,7 @@ namespace Trinity AllCreaturesOfEntryInRange(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} bool operator() (Unit* pUnit) { - if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit,m_fRange,false)) + if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit, m_fRange, false)) return true; return false; @@ -1196,7 +1196,7 @@ namespace Trinity bool operator() (Player* pPlayer) { //No threat list check, must be done explicit if expected to be in combat with creature - if (!pPlayer->isGameMaster() && pPlayer->isAlive() && !pUnit->IsWithinDist(pPlayer,fRange,false)) + if (!pPlayer->isGameMaster() && pPlayer->isAlive() && !pUnit->IsWithinDist(pPlayer, fRange, false)) return true; return false; diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 9c806063721..67bbddacec1 100755 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -34,7 +34,7 @@ Trinity::VisibleNotifier::Visit(GridRefManager<T> &m) for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter) { vis_guids.erase(iter->getSource()->GetGUID()); - i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow); + i_player.UpdateVisibilityOf(iter->getSource(), i_data, i_visibleNow); } } @@ -413,7 +413,7 @@ void Trinity::LocalizedPacketDo<Builder>::operator()(Player* p) data = new WorldPacket(SMSG_MESSAGECHAT, 200); - i_builder(*data,loc_idx); + i_builder(*data, loc_idx); i_data_cache[cache_idx] = data; } @@ -438,7 +438,7 @@ void Trinity::LocalizedPacketListDo<Builder>::operator()(Player* p) data_list = &i_data_cache[cache_idx]; - i_builder(*data_list,loc_idx); + i_builder(*data_list, loc_idx); } else data_list = &i_data_cache[cache_idx]; diff --git a/src/server/game/Grids/ObjectGridLoader.cpp b/src/server/game/Grids/ObjectGridLoader.cpp index 4a9f11d892c..840408c0d7e 100755 --- a/src/server/game/Grids/ObjectGridLoader.cpp +++ b/src/server/game/Grids/ObjectGridLoader.cpp @@ -109,7 +109,7 @@ template <class T> void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map, T *obj) { obj->GetGridRef().link(&m, obj); - AddUnitState(obj,cell); + AddUnitState(obj, cell); obj->AddToWorld(); if (obj->isActiveObject()) map->AddToActive(obj); @@ -124,7 +124,7 @@ void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager<T> & { T* obj = new T; uint32 guid = *i_guid; - //sLog->outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading",table,guid); + //sLog->outString("DEBUG: LoadHelper from table: %s for (guid: %u) Loading", table, guid); if (!obj->LoadFromDB(guid, map)) { delete obj; @@ -166,7 +166,7 @@ ObjectGridLoader::Visit(GameObjectMapType &m) { uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellPair cell_pair(x,y); + CellPair cell_pair(x, y); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); @@ -179,7 +179,7 @@ ObjectGridLoader::Visit(CreatureMapType &m) { uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellPair cell_pair(x,y); + CellPair cell_pair(x, y); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; CellObjectGuids const& cell_guids = sObjectMgr->GetCellObjectGuids(i_map->GetId(), i_map->GetSpawnMode(), cell_id); @@ -192,7 +192,7 @@ ObjectWorldLoader::Visit(CorpseMapType &m) { uint32 x = (i_cell.GridX()*MAX_NUMBER_OF_CELLS) + i_cell.CellX(); uint32 y = (i_cell.GridY()*MAX_NUMBER_OF_CELLS) + i_cell.CellY(); - CellPair cell_pair(x,y); + CellPair cell_pair(x, y); uint32 cell_id = (cell_pair.y_coord*TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord; // corpses are always added to spawn mode 0 and they are spawned by their instance id @@ -230,7 +230,7 @@ void ObjectGridLoader::LoadN(void) loader.Load(i_grid(x, y), *this); } } - sLog->outDebug(LOG_FILTER_MAPS, "%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses,i_grid.GetGridId(), i_map->GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "%u GameObjects, %u Creatures, and %u Corpses/Bones loaded for grid %u on map %u", i_gameObjects, i_creatures, i_corpses, i_grid.GetGridId(), i_map->GetId()); } void ObjectGridUnloader::MoveToRespawnN() diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 098f2c19c17..0eb65395e91 100755 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -123,8 +123,8 @@ bool Group::Create(Player *leader) sObjectMgr->RegisterGroupStorageId(m_storageId, this); // store group in database - CharacterDatabase.PExecute("INSERT INTO groups (guid,leaderGuid,lootMethod,looterGuid,lootThreshold,icon1,icon2,icon3,icon4,icon5,icon6,icon7,icon8,groupType,difficulty,raiddifficulty) " - "VALUES ('%u','%u','%u','%u','%u','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','" UI64FMTD "','%u','%u','%u')", + CharacterDatabase.PExecute("INSERT INTO groups (guid, leaderGuid, lootMethod, looterGuid, lootThreshold, icon1, icon2, icon3, icon4, icon5, icon6, icon7, icon8, groupType, difficulty, raiddifficulty) " + "VALUES ('%u', '%u', '%u', '%u', '%u', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '" UI64FMTD "', '%u', '%u', '%u')", m_storageId, GUID_LOPART(m_leaderGuid), uint32(m_lootMethod), GUID_LOPART(m_looterGuid), uint32(m_lootThreshold), m_targetIcons[0], m_targetIcons[1], m_targetIcons[2], m_targetIcons[3], m_targetIcons[4], m_targetIcons[5], m_targetIcons[6], m_targetIcons[7], uint8(m_groupType), uint32(m_dungeonDifficulty), m_raidDifficulty); @@ -355,8 +355,8 @@ bool Group::AddMember(Player *player) { // reset the new member's instances, unless he is currently in one of them // including raid/heroic instances that they are not permanently bound to! - player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,false); - player->ResetInstances(INSTANCE_RESET_GROUP_JOIN,true); + player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, false); + player->ResetInstances(INSTANCE_RESET_GROUP_JOIN, true); if (player->getLevel() >= LEVELREQUIREMENT_HEROIC) { @@ -756,8 +756,8 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); - Roll* r = new Roll(newitemGUID,*i); + uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); + Roll* r = new Roll(newitemGUID, *i); //a vector is filled with only near party members for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) @@ -767,7 +767,7 @@ void Group::GroupLoot(Loot *loot, WorldObject* pLootedObject) continue; if (i->AllowedForPlayer(member)) { - if (member->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (member->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { r->totalPlayersRolling++; @@ -844,8 +844,8 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) //roll for over-threshold item if it's one-player loot if (item->Quality >= uint32(m_lootThreshold)) { - uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM); - Roll* r=new Roll(newitemGUID,*i); + uint64 newitemGUID = MAKE_NEW_GUID(sObjectMgr->GenerateLowGuid(HIGHGUID_ITEM), 0, HIGHGUID_ITEM); + Roll* r=new Roll(newitemGUID, *i); for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -856,7 +856,7 @@ void Group::NeedBeforeGreed(Loot *loot, WorldObject* pLootedObject) bool allowedForPlayer = i->AllowedForPlayer(playerToRoll); if (playerToRoll->CanUseItem(item) == EQUIP_ERR_OK && allowedForPlayer) { - if (playerToRoll->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (playerToRoll->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { r->totalPlayersRolling++; @@ -931,19 +931,19 @@ void Group::MasterLoot(Loot* /*loot*/, WorldObject* pLootedObject) if (!looter->IsInWorld()) continue; - if (looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { data << uint64(looter->GetGUID()); ++real_count; } } - data.put<uint8>(0,real_count); + data.put<uint8>(0, real_count); for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next()) { Player *looter = itr->getSource(); - if (looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) looter->GetSession()->SendPacket(&data); } } @@ -1401,7 +1401,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) { // not update if only update if need and ok Player* looter = ObjectAccessor::FindPlayer(guid_itr->guid); - if (looter && looter->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (looter && looter->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) return; } ++guid_itr; @@ -1412,7 +1412,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr) { if (Player* pl = ObjectAccessor::FindPlayer(itr->guid)) - if (pl->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (pl->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { pNewLooter = pl; break; @@ -1425,7 +1425,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed) for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr) { if (Player* pl = ObjectAccessor::FindPlayer(itr->guid)) - if (pl->IsWithinDistInMap(pLootedObject,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (pl->IsWithinDistInMap(pLootedObject, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) { pNewLooter = pl; break; @@ -1470,7 +1470,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (!reference) return ERR_BATTLEGROUND_JOIN_FAILED; - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(),reference->getLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->getLevel()); if (!bracketEntry) return ERR_BATTLEGROUND_JOIN_FAILED; @@ -1491,7 +1491,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const* if (member->GetTeam() != team) return ERR_BATTLEGROUND_JOIN_TIMED_OUT; // not in the same battleground level braket, don't let join - PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId,member->getLevel()); + PvPDifficultyEntry const* memberBracketEntry = GetBattlegroundBracketByLevel(bracketEntry->mapId, member->getLevel()); if (memberBracketEntry != bracketEntry) return ERR_BATTLEGROUND_JOIN_RANGE_INDEX; // don't let join rated matches if the arena team id doesn't match @@ -1663,7 +1663,7 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap) Difficulty difficulty = GetDifficulty(aMap->IsRaid()); // some instances only have one difficulty - GetDownscaledMapDifficultyData(aMap->GetId(),difficulty); + GetDownscaledMapDifficultyData(aMap->GetId(), difficulty); BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(aMap->GetId()); if (itr != m_boundInstances[difficulty].end()) @@ -1680,7 +1680,7 @@ InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry) Difficulty difficulty = GetDifficulty(mapEntry->IsRaid()); // some instances only have one difficulty - GetDownscaledMapDifficultyData(mapEntry->MapID,difficulty); + GetDownscaledMapDifficultyData(mapEntry->MapID, difficulty); BoundInstancesMap::iterator itr = m_boundInstances[difficulty].find(mapEntry->MapID); if (itr != m_boundInstances[difficulty].end()) @@ -1872,12 +1872,12 @@ 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, const uint64& guid2) const { member_citerator mslot2 = _getMemberCSlot(guid2); if (mslot2 == m_memberSlots.end()) return false; - return SameSubGroup(guid1,&*mslot2); + return SameSubGroup(guid1, &*mslot2); } bool Group::SameSubGroup(uint64 guid1, MemberSlot const* slot2) const diff --git a/src/server/game/Groups/Group.h b/src/server/game/Groups/Group.h index 636efd7ca86..1387b6eca35 100755 --- a/src/server/game/Groups/Group.h +++ b/src/server/game/Groups/Group.h @@ -118,7 +118,7 @@ enum GroupUpdateFlags }; #define GROUP_UPDATE_FLAGS_COUNT 20 - // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11,12,13,14,15,16,17,18,19 + // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 static const uint8 GroupUpdateLength[GROUP_UPDATE_FLAGS_COUNT] = { 0, 2, 2, 2, 1, 2, 2, 2, 2, 4, 8, 8, 1, 2, 2, 2, 1, 2, 2, 8}; class Roll : public LootValidatorRef diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp index 1e0398f0a6d..ffb56e20cb7 100755 --- a/src/server/game/Guilds/Guild.cpp +++ b/src/server/game/Guilds/Guild.cpp @@ -1971,7 +1971,7 @@ bool Guild::Validate() // Validate ranks data // GUILD RANKS represent a sequence starting from 0 = GUILD_MASTER (ALL PRIVILEGES) to max 9 (lowest privileges). // The lower rank id is considered higher rank - so promotion does rank-- and demotion does rank++ - // Between ranks in sequence cannot be gaps - so 0,1,2,4 is impossible + // Between ranks in sequence cannot be gaps - so 0, 1, 2, 4 is impossible // Min ranks count is 5 and max is 10. bool broken_ranks = false; if (_GetRanksSize() < GUILD_RANKS_MIN_COUNT || _GetRanksSize() > GUILD_RANKS_MAX_COUNT) @@ -2296,7 +2296,7 @@ void Guild::_CreateRank(const std::string& name, uint32 rights) if (_GetRanksSize() >= GUILD_RANKS_MAX_COUNT) return; - // Ranks represent sequence 0,1,2,... where 0 means guildmaster + // Ranks represent sequence 0, 1, 2, ... where 0 means guildmaster uint8 newRankId = _GetRanksSize(); RankInfo info(m_id, newRankId, name, rights, 0); diff --git a/src/server/game/Instances/InstanceSaveMgr.cpp b/src/server/game/Instances/InstanceSaveMgr.cpp index ddd27b273b0..9a322cc1681 100755 --- a/src/server/game/Instances/InstanceSaveMgr.cpp +++ b/src/server/game/Instances/InstanceSaveMgr.cpp @@ -96,7 +96,7 @@ InstanceSave* InstanceSaveManager::AddInstanceSave(uint32 mapId, uint32 instance // initialize reset time // for normal instances if no creatures are killed the instance will reset in two hours if (entry->map_type == MAP_RAID || difficulty > DUNGEON_DIFFICULTY_NORMAL) - resetTime = GetResetTimeFor(mapId,difficulty); + resetTime = GetResetTimeFor(mapId, difficulty); else { resetTime = time(NULL) + 2 * HOUR; @@ -227,9 +227,9 @@ bool InstanceSave::UnloadIfEmpty() return true; } -void InstanceSaveManager::_DelHelper(const char *fields, const char *table, const char *queryTail,...) +void InstanceSaveManager::_DelHelper(const char *fields, const char *table, const char *queryTail, ...) { - Tokens fieldTokens(fields, ','); + Tokens fieldTokens(fields, ', '); ASSERT(fieldTokens.size() != 0); va_list ap; @@ -297,12 +297,12 @@ void InstanceSaveManager::LoadResetTimes() // get the current reset times for normal instances (these may need to be updated) // these are only kept in memory for InstanceSaves that are loaded later // resettime = 0 in the DB for raid/heroic instances so those are skipped - typedef std::pair<uint32 /*PAIR32(map,difficulty)*/, time_t> ResetTimeMapDiffType; + typedef std::pair<uint32 /*PAIR32(map, difficulty)*/, time_t> ResetTimeMapDiffType; typedef std::map<uint32, ResetTimeMapDiffType> InstResetTimeMapDiffType; InstResetTimeMapDiffType instResetTime; // index instance ids by map/difficulty pairs for fast reset warning send - typedef std::multimap<uint32 /*PAIR32(map,difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances; + typedef std::multimap<uint32 /*PAIR32(map, difficulty)*/, uint32 /*instanceid*/ > ResetTimeMapDiffInstances; ResetTimeMapDiffInstances mapDiffResetInstances; QueryResult result = CharacterDatabase.Query("SELECT id, map, difficulty, resettime FROM instance ORDER BY id ASC"); @@ -373,7 +373,7 @@ void InstanceSaveManager::LoadResetTimes() if (!mapDiff) { sLog->outError("InstanceSaveManager::LoadResetTimes: invalid mapid(%u)/difficulty(%u) pair in instance_reset!", mapid, difficulty); - CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid,difficulty); + CharacterDatabase.DirectPExecute("DELETE FROM instance_reset WHERE mapid = '%u' AND difficulty = '%u'", mapid, difficulty); continue; } @@ -408,12 +408,12 @@ void InstanceSaveManager::LoadResetTimes() if (period < DAY) period = DAY; - time_t t = GetResetTimeFor(mapid,difficulty); + time_t t = GetResetTimeFor(mapid, difficulty); if (!t) { // initialize the reset time t = today + period + diff; - CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u','%u','%u')", mapid, difficulty, (uint32)t); + CharacterDatabase.DirectPExecute("INSERT INTO instance_reset VALUES ('%u', '%u', '%u')", mapid, difficulty, (uint32)t); } if (t < now) @@ -425,7 +425,7 @@ void InstanceSaveManager::LoadResetTimes() CharacterDatabase.DirectPExecute("UPDATE instance_reset SET resettime = '"UI64FMTD"' WHERE mapid = '%u' AND difficulty= '%u'", (uint64)t, mapid, difficulty); } - SetResetTimeFor(mapid,difficulty,t); + SetResetTimeFor(mapid, difficulty, t); // schedule the global reset/warning uint8 type; @@ -470,7 +470,7 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev } if (itr == m_resetTimeQueue.end()) - sLog->outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d,%d,%d) was not found!", event.type, event.mapid, event.instanceId); + sLog->outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d, %d, %d) was not found!", event.type, event.mapid, event.instanceId); } } else @@ -498,7 +498,7 @@ void InstanceSaveManager::Update() else { // global reset/warning for a certain map - time_t resetTime = GetResetTimeFor(event.mapid,event.difficulty); + time_t resetTime = GetResetTimeFor(event.mapid, event.difficulty); _ResetOrWarnAll(event.mapid, event.difficulty, event.type != 4, resetTime); if (event.type != 4) { diff --git a/src/server/game/Instances/InstanceSaveMgr.h b/src/server/game/Instances/InstanceSaveMgr.h index 40759477899..810ff6efedb 100755 --- a/src/server/game/Instances/InstanceSaveMgr.h +++ b/src/server/game/Instances/InstanceSaveMgr.h @@ -112,7 +112,7 @@ class InstanceSave bool m_canReset; }; -typedef UNORDERED_MAP<uint32 /*PAIR32(map,difficulty)*/,time_t /*resetTime*/> ResetTimeByMapDifficultyMap; +typedef UNORDERED_MAP<uint32 /*PAIR32(map, difficulty)*/, time_t /*resetTime*/> ResetTimeByMapDifficultyMap; class InstanceSaveManager { @@ -145,12 +145,12 @@ class InstanceSaveManager void LoadResetTimes(); time_t GetResetTimeFor(uint32 mapid, Difficulty d) const { - ResetTimeByMapDifficultyMap::const_iterator itr = m_resetTimeByMapDifficulty.find(MAKE_PAIR32(mapid,d)); + ResetTimeByMapDifficultyMap::const_iterator itr = m_resetTimeByMapDifficulty.find(MAKE_PAIR32(mapid, d)); return itr != m_resetTimeByMapDifficulty.end() ? itr->second : 0; } void SetResetTimeFor(uint32 mapid, Difficulty d, time_t t) { - m_resetTimeByMapDifficulty[MAKE_PAIR32(mapid,d)] = t; + m_resetTimeByMapDifficulty[MAKE_PAIR32(mapid, d)] = t; } ResetTimeByMapDifficultyMap const& GetResetTimeMap() const { @@ -179,7 +179,7 @@ class InstanceSaveManager void _ResetOrWarnAll(uint32 mapid, Difficulty difficulty, bool warn, time_t resetTime); void _ResetInstance(uint32 mapid, uint32 instanceId); void _ResetSave(InstanceSaveHashMap::iterator &itr); - void _DelHelper(const char *fields, const char *table, const char *queryTail,...); + void _DelHelper(const char *fields, const char *table, const char *queryTail, ...); // used during global instance resets bool lock_instLists; // fast lookup by instance id diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 5451b4a19c5..e468e29c70c 100755 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -263,12 +263,12 @@ void InstanceScript::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, if (pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR || pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON) { if (pGo->getLootState() == GO_READY) - pGo->UseDoorOrButton(uiWithRestoreTime,bUseAlternativeState); + pGo->UseDoorOrButton(uiWithRestoreTime, bUseAlternativeState); else if (pGo->getLootState() == GO_ACTIVATED) pGo->ResetDoorOrButton(); } else - sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType()); + sLog->outError("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.", pGo->GetEntry(), pGo->GetGoType()); } } @@ -398,7 +398,7 @@ void InstanceScript::DoCastSpellOnPlayers(uint32 spell) bool InstanceScript::CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/ /*= NULL*/, uint32 /*miscvalue1*/ /*= 0*/) { sLog->outError("Achievement system call InstanceScript::CheckAchievementCriteriaMeet but instance script for map %u not have implementation for achievement criteria %u", - instance->GetId(),criteria_id); + instance->GetId(), criteria_id); return false; } diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index d099f9471af..3c90364bbfd 100755 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -28,8 +28,8 @@ #define OUT_SAVE_INST_DATA sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #define OUT_SAVE_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) #define OUT_LOAD_INST_DATA(a) sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) -#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) -#define OUT_LOAD_INST_DATA_FAIL sLog->outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_LOAD_INST_DATA_COMPLETE sLog->outDebug(LOG_FILTER_TSCR, "TSCR: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_LOAD_INST_DATA_FAIL sLog->outError("TSCR: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) class Map; class Unit; diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index 154e8929e38..a336e776ebb 100755 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -121,13 +121,13 @@ uint32 LootStore::LoadLootTable() if (maxcount > std::numeric_limits<uint8>::max()) { - sLog->outErrorDb("Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount,std::numeric_limits<uint8>::max()); + sLog->outErrorDb("Table '%s' entry %d item %d: maxcount value (%u) to large. must be less %u - skipped", GetName(), entry, item, maxcount, std::numeric_limits<uint8>::max()); continue; // error already printed to log/console. } LootStoreItem storeitem = LootStoreItem(item, chanceOrQuestChance, lootmode, group, mincountOrRef, maxcount); - if (!storeitem.IsValid(*this,entry)) // Validity checks + if (!storeitem.IsValid(*this, entry)) // Validity checks continue; // Looking for the template of the entry @@ -167,7 +167,7 @@ bool LootStore::HaveQuestLootFor(uint32 loot_id) const return itr->second->HasQuestDrop(m_LootTemplates); } -bool LootStore::HaveQuestLootForPlayer(uint32 loot_id,Player* player) const +bool LootStore::HaveQuestLootForPlayer(uint32 loot_id, Player* player) const { LootTemplateMap::const_iterator tab = m_LootTemplates.find(loot_id); if (tab != m_LootTemplates.end()) @@ -219,19 +219,19 @@ uint32 LootStore::LoadAndCollectLootIds(LootIdSet& ids_set) void LootStore::CheckLootRefs(LootIdSet* ref_set) const { for (LootTemplateMap::const_iterator ltItr = m_LootTemplates.begin(); ltItr != m_LootTemplates.end(); ++ltItr) - ltItr->second->CheckLootRefs(m_LootTemplates,ref_set); + ltItr->second->CheckLootRefs(m_LootTemplates, ref_set); } void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const { // all still listed ids isn't referenced for (LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr) - sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr,GetEntryName()); + sLog->outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName()); } void LootStore::ReportNotExistedId(uint32 id) const { - sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id,GetEntryName()); + sLog->outErrorDb("Table '%s' entry %d (%s) not exist but used as loot id in DB.", GetName(), id, GetEntryName()); } // @@ -953,7 +953,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv) } //update number of items shown - b.put<uint8>(count_pos,itemsShown); + b.put<uint8>(count_pos, itemsShown); return b; } @@ -1333,7 +1333,7 @@ void LootTemplate::Verify(LootStore const& lootstore, uint32 id) const { // Checking group chances for (uint32 i=0; i < Groups.size(); ++i) - Groups[i].Verify(lootstore,id,i+1); + Groups[i].Verify(lootstore, id, i+1); // TODO: References validity checks } @@ -1352,7 +1352,7 @@ void LootTemplate::CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_se } for (LootGroups::const_iterator grItr = Groups.begin(); grItr != Groups.end(); ++grItr) - grItr->CheckLootRefs(store,ref_set); + grItr->CheckLootRefs(store, ref_set); } bool LootTemplate::addConditionItem(Condition* cond) { diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index e0c46fe575a..7a9601030bd 100755 --- a/src/server/game/Loot/LootMgr.h +++ b/src/server/game/Loot/LootMgr.h @@ -192,7 +192,7 @@ class LootStore bool HaveLootFor(uint32 loot_id) const { return m_LootTemplates.find(loot_id) != m_LootTemplates.end(); } bool HaveQuestLootFor(uint32 loot_id) const; - bool HaveQuestLootForPlayer(uint32 loot_id,Player* player) const; + bool HaveQuestLootForPlayer(uint32 loot_id, Player* player) const; LootTemplate const* GetLootFor(uint32 loot_id) const; void ResetConditions(); @@ -359,7 +359,7 @@ struct LootView Loot &loot; Player *viewer; PermissionTypes permission; - LootView(Loot &_loot, Player *_viewer,PermissionTypes _permission = ALL_PERMISSION) + LootView(Loot &_loot, Player *_viewer, PermissionTypes _permission = ALL_PERMISSION) : loot(_loot), viewer(_viewer), permission(_permission) {} }; diff --git a/src/server/game/Mails/Mail.cpp b/src/server/game/Mails/Mail.cpp index 8653db0fa7b..a76b1020f46 100755 --- a/src/server/game/Mails/Mail.cpp +++ b/src/server/game/Mails/Mail.cpp @@ -71,7 +71,7 @@ MailReceiver::MailReceiver(Player* receiver) : m_receiver(receiver), m_receiver_ { } -MailReceiver::MailReceiver(Player* receiver,uint32 receiver_lowguid) : m_receiver(receiver), m_receiver_lowguid(receiver_lowguid) +MailReceiver::MailReceiver(Player* receiver, uint32 receiver_lowguid) : m_receiver(receiver), m_receiver_lowguid(receiver_lowguid) { ASSERT(!receiver || receiver->GetGUIDLow() == receiver_lowguid); } @@ -96,9 +96,9 @@ void MailDraft::prepareItems(Player* receiver, SQLTransaction& trans) uint32 max_slot = mailLoot.GetMaxSlotInLootFor(receiver); for (uint32 i = 0; m_items.size() < MAX_MAIL_ITEMS && i < max_slot; ++i) { - if (LootItem* lootitem = mailLoot.LootItemInSlot(i,receiver)) + if (LootItem* lootitem = mailLoot.LootItemInSlot(i, receiver)) { - if (Item* item = Item::CreateItem(lootitem->itemid,lootitem->count,receiver)) + if (Item* item = Item::CreateItem(lootitem->itemid, lootitem->count, receiver)) { item->SaveToDB(trans); // save for prevent lost at next mail load, if send fail then item will deleted AddItem(item); @@ -167,7 +167,7 @@ void MailDraft::SendReturnToSender(uint32 sender_acc, uint32 sender_guid, uint32 uint32 deliver_delay = needItemDelay ? sWorld->getIntConfig(CONFIG_MAIL_DELIVERY_DELAY) : 0; // will delete item or place to receiver mail list - SendMailTo(trans,MailReceiver(receiver,receiver_guid), MailSender(MAIL_NORMAL, sender_guid), MAIL_CHECK_MASK_RETURNED, deliver_delay); + SendMailTo(trans, MailReceiver(receiver, receiver_guid), MailSender(MAIL_NORMAL, sender_guid), MAIL_CHECK_MASK_RETURNED, deliver_delay); CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Mails/Mail.h b/src/server/game/Mails/Mail.h index 67f92496a41..247743f46fc 100755 --- a/src/server/game/Mails/Mail.h +++ b/src/server/game/Mails/Mail.h @@ -111,7 +111,7 @@ class MailReceiver public: // Constructors explicit MailReceiver(uint32 receiver_lowguid) : m_receiver(NULL), m_receiver_lowguid(receiver_lowguid) {} MailReceiver(Player* receiver); - MailReceiver(Player* receiver,uint32 receiver_lowguid); + MailReceiver(Player* receiver, uint32 receiver_lowguid); public: // Accessors Player* GetPlayer() const { return m_receiver; } uint32 GetPlayerGUIDLow() const { return m_receiver_lowguid; } diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index a7c2cbda158..51b03e85581 100755 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -56,24 +56,24 @@ Map::~Map() sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size()); } -bool Map::ExistMap(uint32 mapid,int gx,int gy) +bool Map::ExistMap(uint32 mapid, int gx, int gy) { int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; char* tmp = new char[len]; - snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(),mapid,gx,gy); + snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), mapid, gx, gy); bool ret = false; - FILE *pf=fopen(tmp,"rb"); + FILE *pf=fopen(tmp, "rb"); if (!pf) - sLog->outError("Map file '%s': does not exist!",tmp); + sLog->outError("Map file '%s': does not exist!", tmp); else { map_fileheader header; if (fread(&header, sizeof(header), 1, pf) == 1) { if (header.mapMagic != uint32(MAP_MAGIC) || header.versionMagic != uint32(MAP_VERSION_MAGIC)) - sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.",tmp); + sLog->outError("Map file '%s' is from an incompatible clientversion. Please recreate using the mapextractor.", tmp); else ret = true; } @@ -83,16 +83,16 @@ bool Map::ExistMap(uint32 mapid,int gx,int gy) return ret; } -bool Map::ExistVMap(uint32 mapid,int gx,int gy) +bool Map::ExistVMap(uint32 mapid, int gx, int gy) { if (VMAP::IVMapManager* vmgr = VMAP::VMapFactory::createOrGetVMapManager()) { if (vmgr->isMapLoadingEnabled()) { - bool exists = vmgr->existsMap((sWorld->GetDataPath()+ "vmaps").c_str(), mapid, gx,gy); + bool exists = vmgr->existsMap((sWorld->GetDataPath()+ "vmaps").c_str(), mapid, gx, gy); if (!exists) { - std::string name = vmgr->getDirFileName(mapid,gx,gy); + std::string name = vmgr->getDirFileName(mapid, gx, gy); sLog->outError("VMap file '%s' is missing or points to wrong version of vmap file. Redo vmaps with latest version of vmap_assembler.exe.", (sWorld->GetDataPath()+"vmaps/"+name).c_str()); return false; } @@ -102,25 +102,25 @@ bool Map::ExistVMap(uint32 mapid,int gx,int gy) return true; } -void Map::LoadVMap(int gx,int gy) +void Map::LoadVMap(int gx, int gy) { // x and y are swapped !! - int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld->GetDataPath()+ "vmaps").c_str(), GetId(), gx,gy); + int vmapLoadResult = VMAP::VMapFactory::createOrGetVMapManager()->loadMap((sWorld->GetDataPath()+ "vmaps").c_str(), GetId(), gx, gy); switch(vmapLoadResult) { case VMAP::VMAP_LOAD_RESULT_OK: - sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy); + sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); break; case VMAP::VMAP_LOAD_RESULT_ERROR: - sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy); + sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); break; case VMAP::VMAP_LOAD_RESULT_IGNORED: - sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx,gy,gx,gy); + sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy); break; } } -void Map::LoadMap(int gx,int gy, bool reload) +void Map::LoadMap(int gx, int gy, bool reload) { if (i_InstanceId != 0) { @@ -129,9 +129,9 @@ void Map::LoadMap(int gx,int gy, bool reload) // load grid map for base map if (!m_parentMap->GridMaps[gx][gy]) - m_parentMap->EnsureGridCreated(GridPair(63-gx,63-gy)); + m_parentMap->EnsureGridCreated(GridPair(63-gx, 63-gy)); - ((MapInstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx,gy)); + ((MapInstanced*)(m_parentMap))->AddGridMapReference(GridPair(gx, gy)); GridMaps[gx][gy] = m_parentMap->GridMaps[gx][gy]; return; } @@ -142,7 +142,7 @@ void Map::LoadMap(int gx,int gy, bool reload) //map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?) if (GridMaps[gx][gy]) { - sLog->outDetail("Unloading previously loaded map %u before reloading.",GetId()); + sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId()); sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy); delete (GridMaps[gx][gy]); @@ -153,8 +153,8 @@ void Map::LoadMap(int gx,int gy, bool reload) char *tmp=NULL; int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1; tmp = new char[len]; - snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(),GetId(),gx,gy); - sLog->outDetail("Loading map %s",tmp); + snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy); + sLog->outDetail("Loading map %s", tmp); // loading data GridMaps[gx][gy] = new GridMap(); if (!GridMaps[gx][gy]->loadData(tmp)) @@ -166,9 +166,9 @@ void Map::LoadMap(int gx,int gy, bool reload) sScriptMgr->OnLoadGridMap(this, GridMaps[gx][gy], gx, gy); } -void Map::LoadMapAndVMap(int gx,int gy) +void Map::LoadMapAndVMap(int gx, int gy) { - LoadMap(gx,gy); + LoadMap(gx, gy); if (i_InstanceId == 0) LoadVMap(gx, gy); // Only load the data for the base map } @@ -263,7 +263,7 @@ void Map::SwitchGridContainers(T* obj, bool on) if (!loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y))) return; - sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u,%u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on); + sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on); NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(ngrid != NULL); @@ -317,7 +317,7 @@ Map::EnsureGridCreated(const GridPair &p) ACE_GUARD(ACE_Thread_Mutex, Guard, Lock); if (!getNGrid(p.x_coord, p.y_coord)) { - sLog->outDebug(LOG_FILTER_MAPS, "Creating grid[%u,%u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); + sLog->outDebug(LOG_FILTER_MAPS, "Creating grid[%u, %u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId); setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)), p.x_coord, p.y_coord); @@ -332,7 +332,7 @@ Map::EnsureGridCreated(const GridPair &p) int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord; if (!GridMaps[gx][gy]) - LoadMapAndVMap(gx,gy); + LoadMapAndVMap(gx, gy); } } } @@ -349,11 +349,11 @@ Map::EnsureGridLoadedAtEnter(const Cell &cell, Player *player) { if (player) { - sLog->outStaticDebug("Player %s enter cell[%u,%u] triggers loading of grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), GetId()); + sLog->outStaticDebug("Player %s enter cell[%u, %u] triggers loading of grid[%u, %u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), GetId()); } else { - sLog->outStaticDebug("Active object nearby triggers loading of grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), GetId()); + sLog->outStaticDebug("Active object nearby triggers loading of grid [%u, %u] on map %u", cell.GridX(), cell.GridY(), GetId()); } ResetGridExpiry(*grid, 0.1f); @@ -369,15 +369,15 @@ bool Map::EnsureGridLoaded(const Cell &cell) ASSERT(grid != NULL); if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY())) { - sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u,%u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); + sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId); - setGridObjectDataLoaded(true,cell.GridX(), cell.GridY()); + setGridObjectDataLoaded(true, cell.GridX(), cell.GridY()); ObjectGridLoader loader(*grid, this, cell); loader.LoadN(); // Add resurrectable corpses to world object list in grid - sObjectAccessor->AddCorpsesToGrid(GridPair(cell.GridX(),cell.GridY()),(*grid)(cell.CellX(), cell.CellY()), this); + sObjectAccessor->AddCorpsesToGrid(GridPair(cell.GridX(), cell.GridY()), (*grid)(cell.CellX(), cell.CellY()), this); return true; } @@ -448,14 +448,14 @@ Map::Add(T *obj) NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(grid != NULL); - AddToGrid(obj,grid,cell); + AddToGrid(obj, grid, cell); //obj->SetMap(this); obj->AddToWorld(); if (obj->isActiveObject()) AddToActive(obj); - sLog->outStaticDebug("Object %u enters grid[%u,%u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); + sLog->outStaticDebug("Object %u enters grid[%u, %u]", GUID_LOPART(obj->GetGUID()), cell.GridX(), cell.GridY()); //something, such as vehicle, needs to be update immediately //also, trigger needs to cast spell, if not update, cannot see visual @@ -493,7 +493,7 @@ void Map::VisitNearbyCellsOf(WorldObject* obj, TypeContainerVisitor<Trinity::Obj continue; markCell(cell_id); - CellPair pair(x,y); + CellPair pair(x, y); Cell cell(pair); cell.data.Part.reserved = CENTER_DISTRICT; cell.Visit(pair, gridVisitor, *this); @@ -606,7 +606,7 @@ void Map::ProcessRelocationNotifies(const uint32 & diff) if (!isCellMarked(cell_id)) continue; - CellPair pair(x,y); + CellPair pair(x, y); Cell cell(pair); cell.SetNoCreate(); @@ -647,7 +647,7 @@ void Map::ProcessRelocationNotifies(const uint32 & diff) if (!isCellMarked(cell_id)) continue; - CellPair pair(x,y); + CellPair pair(x, y); Cell cell(pair); cell.SetNoCreate(); Visit(cell, grid_notifier); @@ -669,15 +669,15 @@ void Map::Remove(Player *player, bool remove) { Cell cell(p); if (!getNGrid(cell.data.Part.grid_x, cell.data.Part.grid_y)) - sLog->outError("Map::Remove() i_grids was NULL x:%d, y:%d",cell.data.Part.grid_x,cell.data.Part.grid_y); + sLog->outError("Map::Remove() i_grids was NULL x:%d, y:%d", cell.data.Part.grid_x, cell.data.Part.grid_y); else { - sLog->outStaticDebug("Remove player %s from grid[%u,%u]", player->GetName(), cell.GridX(), cell.GridY()); + sLog->outStaticDebug("Remove player %s from grid[%u, %u]", player->GetName(), cell.GridX(), cell.GridY()); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(grid != NULL); player->UpdateObjectVisibility(true); - RemoveFromGrid(player,grid,cell); + RemoveFromGrid(player, grid, cell); } } @@ -703,12 +703,12 @@ Map::Remove(T *obj, bool remove) Cell cell(p); if (loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y))) { - sLog->outStaticDebug("Remove object " UI64FMTD " from grid[%u,%u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y); + sLog->outStaticDebug("Remove object " UI64FMTD " from grid[%u, %u]", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y); NGridType *grid = getNGrid(cell.GridX(), cell.GridY()); ASSERT(grid != NULL); obj->UpdateObjectVisibility(true); - RemoveFromGrid(obj,grid,cell); + RemoveFromGrid(obj, grid, cell); } } @@ -738,16 +738,16 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell)) { - sLog->outStaticDebug("Player %s relocation grid[%u,%u]cell[%u,%u]->grid[%u,%u]cell[%u,%u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outStaticDebug("Player %s relocation grid[%u, %u]cell[%u, %u]->grid[%u, %u]cell[%u, %u]", player->GetName(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); NGridType* oldGrid = getNGrid(old_cell.GridX(), old_cell.GridY()); - RemoveFromGrid(player, oldGrid,old_cell); + RemoveFromGrid(player, oldGrid, old_cell); if (old_cell.DiffGrid(new_cell)) EnsureGridLoadedAtEnter(new_cell, player); NGridType* newGrid = getNGrid(new_cell.GridX(), new_cell.GridY()); - AddToGrid(player, newGrid,new_cell); + AddToGrid(player, newGrid, new_cell); } player->UpdateObjectVisibility(false); @@ -756,7 +756,7 @@ Map::PlayerRelocation(Player *player, float x, float y, float z, float orientati void Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang, bool respawnRelocationOnFail) { - ASSERT(CheckGridIntegrity(creature,false)); + ASSERT(CheckGridIntegrity(creature, false)); Cell old_cell = creature->GetCurrentCell(); @@ -770,7 +770,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang if (old_cell.DiffCell(new_cell) || old_cell.DiffGrid(new_cell)) { #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) added to moving list from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) added to moving list from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", creature->GetGUIDLow(), creature->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif AddCreatureToMoveList(creature, x, y, z, ang); // in diffcell/diffgrid case notifiers called at finishing move creature in Map::MoveAllCreaturesInMoveList @@ -781,7 +781,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang creature->UpdateObjectVisibility(false); } - ASSERT(CheckGridIntegrity(creature,true)); + ASSERT(CheckGridIntegrity(creature, true)); } void Map::AddCreatureToMoveList(Creature *c, float x, float y, float z, float ang) @@ -807,11 +807,11 @@ void Map::MoveAllCreaturesInMoveList() Cell new_cell(new_val); // do move or do move to respawn or remove creature if previous all fail - if (CreatureCellRelocation(c,new_cell)) + if (CreatureCellRelocation(c, new_cell)) { // update pos c->Relocate(cm.x, cm.y, cm.z, cm.ang); - //CreatureRelocationNotify(c,new_cell,new_cell.cellPair()); + //CreatureRelocationNotify(c, new_cell, new_cell.cellPair()); c->UpdateObjectVisibility(false); } else @@ -822,7 +822,7 @@ void Map::MoveAllCreaturesInMoveList() { // ... or unload (if respawn grid also not loaded) #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) cannot be move to unloaded respawn grid.", c->GetGUIDLow(), c->GetEntry()); #endif AddObjectToRemoveList(c); } @@ -839,16 +839,16 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) if (old_cell.DiffCell(new_cell)) { #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved in grid[%u,%u] from cell[%u,%u] to cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved in grid[%u, %u] from cell[%u, %u] to cell[%u, %u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.CellX(), new_cell.CellY()); #endif - RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); - AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell); + RemoveFromGrid(c, getNGrid(old_cell.GridX(), old_cell.GridY()), old_cell); + AddToGrid(c, getNGrid(new_cell.GridX(), new_cell.GridY()), new_cell); } else { #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved in same grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved in same grid[%u, %u]cell[%u, %u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY()); #endif } @@ -861,11 +861,11 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) EnsureGridLoadedAtEnter(new_cell); #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Active creature (GUID: %u Entry: %u) moved from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif - RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); - AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell); + RemoveFromGrid(c, getNGrid(old_cell.GridX(), old_cell.GridY()), old_cell); + AddToGrid(c, getNGrid(new_cell.GridX(), new_cell.GridY()), new_cell); return true; } @@ -874,19 +874,19 @@ bool Map::CreatureCellRelocation(Creature *c, Cell new_cell) if (loaded(GridPair(new_cell.GridX(), new_cell.GridY()))) { #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved from grid[%u, %u]cell[%u, %u] to grid[%u, %u]cell[%u, %u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif - RemoveFromGrid(c,getNGrid(old_cell.GridX(), old_cell.GridY()),old_cell); + RemoveFromGrid(c, getNGrid(old_cell.GridX(), old_cell.GridY()), old_cell); EnsureGridCreated(GridPair(new_cell.GridX(), new_cell.GridY())); - AddToGrid(c,getNGrid(new_cell.GridX(), new_cell.GridY()),new_cell); + AddToGrid(c, getNGrid(new_cell.GridX(), new_cell.GridY()), new_cell); return true; } // fail to move: normal creature attempt move to unloaded grid #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) attempted to move from grid[%u,%u]cell[%u,%u] to unloaded grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) attempted to move from grid[%u, %u]cell[%u, %u] to unloaded grid[%u, %u]cell[%u, %u].", c->GetGUIDLow(), c->GetEntry(), old_cell.GridX(), old_cell.GridY(), old_cell.CellX(), old_cell.CellY(), new_cell.GridX(), new_cell.GridY(), new_cell.CellX(), new_cell.CellY()); #endif return false; } @@ -903,15 +903,15 @@ bool Map::CreatureRespawnRelocation(Creature *c) c->GetMotionMaster()->Clear(); #ifdef TRINITY_DEBUG - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved from grid[%u,%u]cell[%u,%u] to respawn grid[%u,%u]cell[%u,%u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u Entry: %u) moved from grid[%u, %u]cell[%u, %u] to respawn grid[%u, %u]cell[%u, %u].", c->GetGUIDLow(), c->GetEntry(), c->GetCurrentCell().GridX(), c->GetCurrentCell().GridY(), c->GetCurrentCell().CellX(), c->GetCurrentCell().CellY(), resp_cell.GridX(), resp_cell.GridY(), resp_cell.CellX(), resp_cell.CellY()); #endif // teleport it to respawn point (like normal respawn if player see) - if (CreatureCellRelocation(c,resp_cell)) + if (CreatureCellRelocation(c, resp_cell)) { c->Relocate(resp_x, resp_y, resp_z, resp_o); c->GetMotionMaster()->Initialize(); // prevent possible problems with default move generators - //CreatureRelocationNotify(c,resp_cell,resp_cell.cellPair()); + //CreatureRelocationNotify(c, resp_cell, resp_cell.cellPair()); c->UpdateObjectVisibility(false); return true; } @@ -928,7 +928,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) if (!unloadAll && ActiveObjectsNearGrid(x, y)) return false; - sLog->outDebug(LOG_FILTER_MAPS, "Unloading grid[%u,%u] for map %u", x,y, GetId()); + sLog->outDebug(LOG_FILTER_MAPS, "Unloading grid[%u, %u] for map %u", x, y, GetId()); ObjectGridUnloader unloader(*grid); @@ -978,7 +978,7 @@ bool Map::UnloadGrid(const uint32 &x, const uint32 &y, bool unloadAll) GridMaps[gx][gy] = NULL; } - sLog->outStaticDebug("Unloading grid[%u,%u] for map %u finished", x,y, GetId()); + sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId()); return true; } @@ -1053,7 +1053,7 @@ bool GridMap::loadData(char *filename) if (!in) return true; - if (fread(&header, sizeof(header),1,in) != 1) + if (fread(&header, sizeof(header), 1, in) != 1) { fclose(in); return false; @@ -1234,11 +1234,11 @@ float GridMap::getHeightFromFloat(float x, float y) const // Height stored as: h5 - its v8 grid, h1-h4 - its v9 grid // +--------------> X // | h1-------h2 Coordinates is: - // | | \ 1 / | h1 0,0 - // | | \ / | h2 0,1 - // | | 2 h5 3 | h3 1,0 - // | | / \ | h4 1,1 - // | | / 4 \ | h5 1/2,1/2 + // | | \ 1 / | h1 0, 0 + // | | \ / | h2 0, 1 + // | | 2 h5 3 | h3 1, 0 + // | | / \ | h4 1, 1 + // | | / 4 \ | h5 1/2, 1/2 // | h3-------h4 // V Y // For find height need @@ -1246,7 +1246,7 @@ float GridMap::getHeightFromFloat(float x, float y) const // 2 - solve linear equation from triangle points // Calculate coefficients for solve h = a*x + b*y + c - float a,b,c; + float a, b, c; // Select triangle: if (x+y < 1) { @@ -1533,7 +1533,7 @@ inline GridMap *Map::GetGrid(float x, float y) int gy=(int)(32-y/SIZE_OF_GRIDS); //grid y // ensure GridMap is loaded - EnsureGridCreated(GridPair(63-gx,63-gy)); + EnsureGridCreated(GridPair(63-gx, 63-gy)); return GridMaps[gx][gy]; } @@ -1544,7 +1544,7 @@ float Map::GetHeight(float x, float y, float z, bool pUseVmaps, float maxSearchD float mapHeight; if (GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y)) { - float _mapheight = gmap->getHeight(x,y); + float _mapheight = gmap->getHeight(x, y); // look from a bit higher pos to find the floor, ignore under surface case if (z + 2.0f > _mapheight) @@ -1653,7 +1653,7 @@ bool Map::GetAreaInfo(float x, float y, float z, uint32 &flags, int32 &adtId, in // check if there's terrain between player height and object height if(GridMap *gmap = const_cast<Map*>(this)->GetGrid(x, y)) { - float _mapheight = gmap->getHeight(x,y); + float _mapheight = gmap->getHeight(x, y); // z + 2.0f condition taken from GetHeight(), not sure if it's such a great choice... if(z + 2.0f > _mapheight && _mapheight > vmap_z) return false; @@ -1767,9 +1767,9 @@ float Map::GetWaterLevel(float x, float y) const return 0; } -uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id) +uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id) { - AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id); + AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); if (entry) return entry->ID; @@ -1777,9 +1777,9 @@ uint32 Map::GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id) return 0; } -uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id) +uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id) { - AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id); + AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); if (entry) return (entry->zone != 0) ? entry->zone : entry->ID; @@ -1787,9 +1787,9 @@ uint32 Map::GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id) return 0; } -void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id) +void Map::GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag, uint32 map_id) { - AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag,map_id); + AreaTableEntry const *entry = GetAreaEntryByAreaFlagAndMap(areaflag, map_id); areaid = entry ? entry->ID : 0; zoneid = entry ? ((entry->zone != 0) ? entry->zone : entry->ID) : 0; @@ -1826,9 +1826,9 @@ bool Map::CheckGridIntegrity(Creature* c, bool moved) const Cell xy_cell(xy_val); if (xy_cell != cur_cell) { - sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u) X: %f Y: %f (%s) is in grid[%u,%u]cell[%u,%u] instead of grid[%u,%u]cell[%u,%u]", + sLog->outDebug(LOG_FILTER_MAPS, "Creature (GUID: %u) X: %f Y: %f (%s) is in grid[%u, %u]cell[%u, %u] instead of grid[%u, %u]cell[%u, %u]", c->GetGUIDLow(), - c->GetPositionX(),c->GetPositionY(),(moved ? "final" : "original"), + c->GetPositionX(), c->GetPositionY(), (moved ? "final" : "original"), cur_cell.GridX(), cur_cell.GridY(), cur_cell.CellX(), cur_cell.CellY(), xy_cell.GridX(), xy_cell.GridY(), xy_cell.CellX(), xy_cell.CellY()); return true; // not crash at error, just output error in debug mode @@ -1952,7 +1952,7 @@ inline void Map::setNGrid(NGridType *grid, uint32 x, uint32 y) { if (x >= MAX_NUMBER_OF_GRIDS || y >= MAX_NUMBER_OF_GRIDS) { - sLog->outError("map::setNGrid() Invalid grid coordinates found: %d, %d!",x,y); + sLog->outError("map::setNGrid() Invalid grid coordinates found: %d, %d!", x, y); ASSERT(false); } i_grids[x][y] = grid; @@ -1962,7 +1962,7 @@ void Map::DelayedUpdate(const uint32 t_diff) { RemoveAllObjectsInRemoveList(); - // Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load ! + // Don't unload grids if it's battleground, since we may have manually added GOs, creatures, those doesn't load from DB at grid re-load ! // This isn't really bother us, since as soon as we have instanced BG-s, the whole map unloads as the BG gets ended if (!IsBattlegroundOrArena()) { @@ -1984,7 +1984,7 @@ void Map::AddObjectToRemoveList(WorldObject *obj) obj->CleanupsBeforeDelete(false); // remove or simplify at least cross referenced links i_objectsToRemove.insert(obj); - //sLog->outDebug(LOG_FILTER_MAPS, "Object (GUID: %u TypeId: %u) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId()); + //sLog->outDebug(LOG_FILTER_MAPS, "Object (GUID: %u TypeId: %u) added to removing list.", obj->GetGUIDLow(), obj->GetTypeId()); } void Map::AddObjectToSwitchList(WorldObject *obj, bool on) @@ -2034,23 +2034,23 @@ void Map::RemoveAllObjectsInRemoveList() if (!corpse) sLog->outError("Tried to delete corpse/bones %u that is not in map.", obj->GetGUIDLow()); else - Remove(corpse,true); + Remove(corpse, true); break; } case TYPEID_DYNAMICOBJECT: - Remove((DynamicObject*)obj,true); + Remove((DynamicObject*)obj, true); break; case TYPEID_GAMEOBJECT: - Remove((GameObject*)obj,true); + Remove((GameObject*)obj, true); break; case TYPEID_UNIT: // in case triggered sequence some spell can continue casting after prev CleanupsBeforeDelete call // make sure that like sources auras/etc removed before destructor start obj->ToCreature()->CleanupsBeforeDelete(); - Remove(obj->ToCreature(),true); + Remove(obj->ToCreature(), true); break; default: - sLog->outError("Non-grid object (TypeId: %u) is in grid object remove list, ignored.",obj->GetTypeId()); + sLog->outError("Non-grid object (TypeId: %u) is in grid object remove list, ignored.", obj->GetTypeId()); break; } @@ -2122,15 +2122,15 @@ void Map::AddToActive(Creature* c) // also not allow unloading spawn grid to prevent creating creature clone at load if (!c->isPet() && c->GetDBTableGUIDLow()) { - float x,y,z; - c->GetRespawnCoord(x,y,z); + float x, y, z; + c->GetRespawnCoord(x, y, z); GridPair p = Trinity::ComputeGridPair(x, y); if (getNGrid(p.x_coord, p.y_coord)) getNGrid(p.x_coord, p.y_coord)->incUnloadActiveLock(); else { GridPair p2 = Trinity::ComputeGridPair(c->GetPositionX(), c->GetPositionY()); - sLog->outError("Active creature (GUID: %u Entry: %u) added to grid[%u,%u] but spawn grid[%u,%u] was not loaded.", + sLog->outError("Active creature (GUID: %u Entry: %u) added to grid[%u, %u] but spawn grid[%u, %u] was not loaded.", c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); } } @@ -2143,15 +2143,15 @@ void Map::RemoveFromActive(Creature* c) // also allow unloading spawn grid if (!c->isPet() && c->GetDBTableGUIDLow()) { - float x,y,z; - c->GetRespawnCoord(x,y,z); + float x, y, z; + c->GetRespawnCoord(x, y, z); GridPair p = Trinity::ComputeGridPair(x, y); if (getNGrid(p.x_coord, p.y_coord)) getNGrid(p.x_coord, p.y_coord)->decUnloadActiveLock(); else { GridPair p2 = Trinity::ComputeGridPair(c->GetPositionX(), c->GetPositionY()); - sLog->outError("Active creature (GUID: %u Entry: %u) removed from grid[%u,%u] but spawn grid[%u,%u] was not loaded.", + sLog->outError("Active creature (GUID: %u Entry: %u) removed from grid[%u, %u] but spawn grid[%u, %u] was not loaded.", c->GetGUIDLow(), c->GetEntry(), p.x_coord, p.y_coord, p2.x_coord, p2.y_coord); } } @@ -2162,8 +2162,8 @@ template void Map::Add(Creature *); template void Map::Add(GameObject *); template void Map::Add(DynamicObject *); -template void Map::Remove(Corpse *,bool); -template void Map::Remove(Creature *,bool); +template void Map::Remove(Corpse *, bool); +template void Map::Remove(Creature *, bool); template void Map::Remove(GameObject *, bool); template void Map::Remove(DynamicObject *, bool); @@ -2202,7 +2202,7 @@ bool InstanceMap::CanEnter(Player *player) { if (player->GetMapRef().getTarget() == this) { - sLog->outError("InstanceMap::CanEnter - player %s(%u) already in map %d,%d,%d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode()); + sLog->outError("InstanceMap::CanEnter - player %s(%u) already in map %d, %d, %d!", player->GetName(), player->GetGUIDLow(), GetId(), GetInstanceId(), GetSpawnMode()); ASSERT(false); return false; } @@ -2296,7 +2296,7 @@ bool InstanceMap::Add(Player *player) // cannot enter other instances if bound permanently if (playerBind->save != mapSave) { - sLog->outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d,%d,%d,%d,%d,%d but he is being put into instance %d,%d,%d,%d,%d,%d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset()); + sLog->outError("InstanceMap::Add: player %s(%d) is permanently bound to instance %d, %d, %d, %d, %d, %d but he is being put into instance %d, %d, %d, %d, %d, %d", player->GetName(), player->GetGUIDLow(), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset()); return false; } } @@ -2308,9 +2308,9 @@ bool InstanceMap::Add(Player *player) InstanceGroupBind *groupBind = group->GetBoundInstance(this); if (playerBind) { - sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d,%d,%d,%d but he is in group %d and is bound to instance %d,%d,%d,%d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); + sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d, %d, %d, %d but he is in group %d and is bound to instance %d, %d, %d, %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), mapSave->GetPlayerCount(), mapSave->GetGroupCount(), mapSave->CanReset(), GUID_LOPART(group->GetLeaderGUID()), playerBind->save->GetMapId(), playerBind->save->GetInstanceId(), playerBind->save->GetDifficulty(), playerBind->save->GetPlayerCount(), playerBind->save->GetGroupCount(), playerBind->save->CanReset()); if (groupBind) - sLog->outError("InstanceMap::Add: the group is bound to the instance %d,%d,%d,%d,%d,%d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset()); + sLog->outError("InstanceMap::Add: the group is bound to the instance %d, %d, %d, %d, %d, %d", groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty(), groupBind->save->GetPlayerCount(), groupBind->save->GetGroupCount(), groupBind->save->CanReset()); //ASSERT(false); return false; } @@ -2322,7 +2322,7 @@ bool InstanceMap::Add(Player *player) // cannot jump to a different instance without resetting it if (groupBind->save != mapSave) { - sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d,%d,%d but he is in group %d which is bound to instance %d,%d,%d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty()); + sLog->outError("InstanceMap::Add: player %s(%d) is being put into instance %d, %d, %d but he is in group %d which is bound to instance %d, %d, %d!", player->GetName(), player->GetGUIDLow(), mapSave->GetMapId(), mapSave->GetInstanceId(), mapSave->GetDifficulty(), GUID_LOPART(group->GetLeaderGUID()), groupBind->save->GetMapId(), groupBind->save->GetInstanceId(), groupBind->save->GetDifficulty()); if (mapSave) sLog->outError("MapSave players: %d, group count: %d", mapSave->GetPlayerCount(), mapSave->GetGroupCount()); else @@ -2538,7 +2538,7 @@ void InstanceMap::SetResetSchedule(bool on) MapDifficulty const* Map::GetMapDifficulty() const { - return GetMapDifficultyData(GetId(),GetDifficulty()); + return GetMapDifficultyData(GetId(), GetDifficulty()); } uint32 InstanceMap::GetMaxPlayers() const diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h index 0b245ecb347..bf4ba4aade9 100755 --- a/src/server/game/Maps/Map.h +++ b/src/server/game/Maps/Map.h @@ -207,11 +207,11 @@ struct CreatureMover float x, y, z, ang; }; -// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct InstanceTemplate @@ -327,23 +327,23 @@ class Map : public GridRefManager<NGridType> bool IsInWater(float x, float y, float z, LiquidData *data = 0) const; bool IsUnderWater(float x, float y, float z) const; - static uint32 GetAreaIdByAreaFlag(uint16 areaflag,uint32 map_id); - static uint32 GetZoneIdByAreaFlag(uint16 areaflag,uint32 map_id); - static void GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag,uint32 map_id); + static uint32 GetAreaIdByAreaFlag(uint16 areaflag, uint32 map_id); + static uint32 GetZoneIdByAreaFlag(uint16 areaflag, uint32 map_id); + static void GetZoneAndAreaIdByAreaFlag(uint32& zoneid, uint32& areaid, uint16 areaflag, uint32 map_id); uint32 GetAreaId(float x, float y, float z) const { - return GetAreaIdByAreaFlag(GetAreaFlag(x,y,z),GetId()); + return GetAreaIdByAreaFlag(GetAreaFlag(x, y, z), GetId()); } uint32 GetZoneId(float x, float y, float z) const { - return GetZoneIdByAreaFlag(GetAreaFlag(x,y,z),GetId()); + return GetZoneIdByAreaFlag(GetAreaFlag(x, y, z), GetId()); } void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, float x, float y, float z) const { - GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(x,y,z),GetId()); + GetZoneAndAreaIdByAreaFlag(zoneid, areaid, GetAreaFlag(x, y, z), GetId()); } void MoveAllCreaturesInMoveList(); @@ -441,7 +441,7 @@ class Map : public GridRefManager<NGridType> private: void LoadMapAndVMap(int gx, int gy); void LoadVMap(int gx, int gy); - void LoadMap(int gx,int gy, bool reload = false); + void LoadMap(int gx, int gy, bool reload = false); GridMap *GetGrid(float x, float y); void SetTimer(uint32 t) { i_gridExpiry = t < MIN_GRID_DELAY ? MIN_GRID_DELAY : t; } @@ -473,8 +473,8 @@ class Map : public GridRefManager<NGridType> return i_grids[x][y]; } - bool isGridObjectDataLoaded(uint32 x, uint32 y) const { return getNGrid(x,y)->isGridObjectDataLoaded(); } - void setGridObjectDataLoaded(bool pLoaded, uint32 x, uint32 y) { getNGrid(x,y)->setGridObjectDataLoaded(pLoaded); } + bool isGridObjectDataLoaded(uint32 x, uint32 y) const { return getNGrid(x, y)->isGridObjectDataLoaded(); } + void setGridObjectDataLoaded(bool pLoaded, uint32 x, uint32 y) { getNGrid(x, y)->setGridObjectDataLoaded(pLoaded); } void setNGrid(NGridType* grid, uint32 x, uint32 y); void ScriptsProcess(); @@ -644,7 +644,7 @@ Map::Visit(const Cell& cell, TypeContainerVisitor<T, CONTAINER> &visitor) const uint32 cell_x = cell.CellX(); const uint32 cell_y = cell.CellY(); - if (!cell.NoCreate() || loaded(GridPair(x,y))) + if (!cell.NoCreate() || loaded(GridPair(x, y))) { EnsureGridLoaded(cell); getNGrid(x, y)->Visit(cell_x, cell_y, visitor); diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp index 12e484fbd11..b64f4a030f3 100755 --- a/src/server/game/Maps/MapInstanced.cpp +++ b/src/server/game/Maps/MapInstanced.cpp @@ -187,7 +187,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave *save, } // some instances only have one difficulty - GetDownscaledMapDifficultyData(GetId(),difficulty); + GetDownscaledMapDifficultyData(GetId(), difficulty); sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal"); @@ -208,7 +208,7 @@ BattlegroundMap* MapInstanced::CreateBattleground(uint32 InstanceId, Battlegroun sLog->outDebug(LOG_FILTER_MAPS, "MapInstanced::CreateBattleground: map bg %d for %d created.", InstanceId, GetId()); - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),bg->GetMinLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), bg->GetMinLevel()); uint8 spawnMode; diff --git a/src/server/game/Maps/MapManager.cpp b/src/server/game/Maps/MapManager.cpp index f34521aea46..c26454701ed 100755 --- a/src/server/game/Maps/MapManager.cpp +++ b/src/server/game/Maps/MapManager.cpp @@ -288,14 +288,14 @@ void MapManager::DoDelayedMovesAndRemoves() { } -bool MapManager::ExistMapAndVMap(uint32 mapid, float x,float y) +bool MapManager::ExistMapAndVMap(uint32 mapid, float x, float y) { - GridPair p = Trinity::ComputeGridPair(x,y); + GridPair p = Trinity::ComputeGridPair(x, y); int gx=63-p.x_coord; int gy=63-p.y_coord; - return Map::ExistMap(mapid,gx,gy) && Map::ExistVMap(mapid,gx,gy); + return Map::ExistMap(mapid, gx, gy) && Map::ExistVMap(mapid, gx, gy); } bool MapManager::IsValidMAP(uint32 mapid, bool startUp) diff --git a/src/server/game/Maps/MapManager.h b/src/server/game/Maps/MapManager.h index 610d2626eda..8ca856cbd6f 100755 --- a/src/server/game/Maps/MapManager.h +++ b/src/server/game/Maps/MapManager.h @@ -49,15 +49,15 @@ class MapManager } uint32 GetAreaId(uint32 mapid, float x, float y, float z) const { - return Map::GetAreaIdByAreaFlag(GetAreaFlag(mapid, x, y, z),mapid); + return Map::GetAreaIdByAreaFlag(GetAreaFlag(mapid, x, y, z), mapid); } uint32 GetZoneId(uint32 mapid, float x, float y, float z) const { - return Map::GetZoneIdByAreaFlag(GetAreaFlag(mapid, x, y, z),mapid); + return Map::GetZoneIdByAreaFlag(GetAreaFlag(mapid, x, y, z), mapid); } void GetZoneAndAreaId(uint32& zoneid, uint32& areaid, uint32 mapid, float x, float y, float z) { - Map::GetZoneAndAreaIdByAreaFlag(zoneid,areaid,GetAreaFlag(mapid, x, y, z),mapid); + Map::GetZoneAndAreaIdByAreaFlag(zoneid, areaid, GetAreaFlag(mapid, x, y, z), mapid); } void Initialize(void); @@ -86,19 +86,19 @@ class MapManager static bool ExistMapAndVMap(uint32 mapid, float x, float y); static bool IsValidMAP(uint32 mapid, bool startUp); - static bool IsValidMapCoord(uint32 mapid, float x,float y) + static bool IsValidMapCoord(uint32 mapid, float x, float y) { - return IsValidMAP(mapid, false) && Trinity::IsValidMapCoord(x,y); + return IsValidMAP(mapid, false) && Trinity::IsValidMapCoord(x, y); } - static bool IsValidMapCoord(uint32 mapid, float x,float y,float z) + static bool IsValidMapCoord(uint32 mapid, float x, float y, float z) { - return IsValidMAP(mapid, false) && Trinity::IsValidMapCoord(x,y,z); + return IsValidMAP(mapid, false) && Trinity::IsValidMapCoord(x, y, z); } - static bool IsValidMapCoord(uint32 mapid, float x,float y,float z,float o) + static bool IsValidMapCoord(uint32 mapid, float x, float y, float z, float o) { - return IsValidMAP(mapid, false) && Trinity::IsValidMapCoord(x,y,z,o); + return IsValidMAP(mapid, false) && Trinity::IsValidMapCoord(x, y, z, o); } static bool IsValidMapCoord(WorldLocation const& loc) diff --git a/src/server/game/Miscellaneous/Formulas.h b/src/server/game/Miscellaneous/Formulas.h index 0cd45b958c6..cf59106103f 100755 --- a/src/server/game/Miscellaneous/Formulas.h +++ b/src/server/game/Miscellaneous/Formulas.h @@ -127,7 +127,7 @@ namespace Trinity nBaseExp = 580; break; default: - sLog->outError("BaseGain: Unsupported content level %u",content); + sLog->outError("BaseGain: Unsupported content level %u", content); nBaseExp = 45; break; } diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 56b9dfe2239..bff49fe385f 100755 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -1029,20 +1029,20 @@ enum TrinityStrings LANG_BG_SA_START_ONE_MINUTE = 10057, LANG_BG_SA_START_HALF_MINUTE = 10058, LANG_BG_SA_HAS_BEGUN = 10059, - LANG_BG_SA_IS_UNDER_ATTACK = 10060,//The %s is under attack! - LANG_BG_SA_WAS_DESTROYED = 10061,//The %s was destroyed! - LANG_BG_SA_ROUND_ONE_END = 10062,//Round 1 - finished! - LANG_BG_SA_ALLIANCE_CAPTURED_RELIC = 10063,//The Alliance captured the titan portal! - LANG_BG_SA_HORDE_CAPTURED_RELIC = 10064,//The Horde captured the titan portal! - LANG_BG_SA_ROUND_TWO_ONE_MINUTE = 10065,//Round 2 of the Battle for the Strand of the Ancients begins in 1 minute. - LANG_BG_SA_ROUND_TWO_START_HALF_MINUTE = 10066,//Round 2 begins in 30 seconds. Prepare yourselves! - LANG_BG_SA_CHAMBER_BREACHED = 10067,//The chamber has been breached! The titan relic is vulnerable! - LANG_BG_SA_A_GY_SOUTH = 10068,//The Alliance captured the South Graveyard! - LANG_BG_SA_A_GY_WEST = 10069,//The Alliance captured the West Graveyard! - LANG_BG_SA_A_GY_EAST = 10070,//The Alliance captured the East Graveyard! - LANG_BG_SA_H_GY_SOUTH = 10071,//The Horde captured the South Graveyard! - LANG_BG_SA_H_GY_WEST = 10072,//The Horde captured the West Graveyard! - LANG_BG_SA_H_GY_EAST = 10073,//The Horde captured the East Graveyard! + LANG_BG_SA_IS_UNDER_ATTACK = 10060, //The %s is under attack! + LANG_BG_SA_WAS_DESTROYED = 10061, //The %s was destroyed! + LANG_BG_SA_ROUND_ONE_END = 10062, //Round 1 - finished! + LANG_BG_SA_ALLIANCE_CAPTURED_RELIC = 10063, //The Alliance captured the titan portal! + LANG_BG_SA_HORDE_CAPTURED_RELIC = 10064, //The Horde captured the titan portal! + LANG_BG_SA_ROUND_TWO_ONE_MINUTE = 10065, //Round 2 of the Battle for the Strand of the Ancients begins in 1 minute. + LANG_BG_SA_ROUND_TWO_START_HALF_MINUTE = 10066, //Round 2 begins in 30 seconds. Prepare yourselves! + LANG_BG_SA_CHAMBER_BREACHED = 10067, //The chamber has been breached! The titan relic is vulnerable! + LANG_BG_SA_A_GY_SOUTH = 10068, //The Alliance captured the South Graveyard! + LANG_BG_SA_A_GY_WEST = 10069, //The Alliance captured the West Graveyard! + LANG_BG_SA_A_GY_EAST = 10070, //The Alliance captured the East Graveyard! + LANG_BG_SA_H_GY_SOUTH = 10071, //The Horde captured the South Graveyard! + LANG_BG_SA_H_GY_WEST = 10072, //The Horde captured the West Graveyard! + LANG_BG_SA_H_GY_EAST = 10073, //The Horde captured the East Graveyard! // Use for custom patches 11000-11999 LANG_AUTO_BROADCAST = 11000, diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index f9194b7b1d5..1683e43ee49 100755 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -1228,7 +1228,7 @@ enum DispelType #define DISPEL_ALL_MASK ((1<<DISPEL_MAGIC) | (1<<DISPEL_CURSE) | (1<<DISPEL_DISEASE) | (1<<DISPEL_POISON)) -//To all Immune system,if target has immunes, +//To all Immune system, if target has immunes, //some spell that related to ImmuneToDispel or ImmuneToSchool or ImmuneToDamage type can't cast to it, //some spell_effects that related to ImmuneToEffect<effect>(only this effect in the spell) can't cast to it, //some aura(related to Mechanics or ImmuneToState<aura>) can't apply to it. diff --git a/src/server/game/Movement/DestinationHolderImp.h b/src/server/game/Movement/DestinationHolderImp.h index e43f8ad7600..fac415a27a5 100755 --- a/src/server/game/Movement/DestinationHolderImp.h +++ b/src/server/game/Movement/DestinationHolderImp.h @@ -28,7 +28,7 @@ template<typename TRAVELLER> void DestinationHolder<TRAVELLER>::_findOffSetPoint(float x1, float y1, float x2, float y2, float offset, float &x, float &y) { - /* given the point (x1, y1) and (x2, y2).. need to find the point (x,y) on the same line + /* given the point (x1, y1) and (x2, y2).. need to find the point (x, y) on the same line * such that the distance from (x, y) to (x2, y2) is offset. * Let the distance of p1 to p2 = d.. then the ratio of offset/d = (x2-x)/(x2-x1) * hence x = x2 - (offset/d)*(x2-x1) @@ -82,7 +82,7 @@ DestinationHolder<TRAVELLER>::StartTravel(TRAVELLER &traveller, bool sendMove) i_fromY = traveller.GetPositionY(); i_fromZ = traveller.GetPositionZ(); - i_totalTravelTime = traveller.GetTotalTrevelTimeTo(i_destX,i_destY,i_destZ); + i_totalTravelTime = traveller.GetTotalTrevelTimeTo(i_destX, i_destY, i_destZ); i_timeElapsed = 0; if (sendMove) traveller.MoveTo(i_destX, i_destY, i_destZ, i_totalTravelTime); @@ -113,7 +113,7 @@ DestinationHolder<TRAVELLER>::UpdateTraveller(TRAVELLER &traveller, uint32 diff, return true; if (traveller.GetTraveller().HasUnitState(UNIT_STAT_IN_FLIGHT)) - GetLocationNow(traveller.GetTraveller().GetBaseMap() ,x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation + GetLocationNow(traveller.GetTraveller().GetBaseMap() , x, y, z, true); // Should reposition Object with right Coord, so I can bypass some Grid Relocation else GetLocationNow(traveller.GetTraveller().GetBaseMap(), x, y, z, false); @@ -166,7 +166,7 @@ DestinationHolder<TRAVELLER>::GetLocationNow(const Map * map, float &x, float &y else { //That part is good for mob Walking on the floor. But the floor is not always what we thought. - z = map->GetHeight(x,y,i_fromZ,false); // Disable cave check + z = map->GetHeight(x, y, i_fromZ, false); // Disable cave check const float groundDist = sqrt(distanceX*distanceX + distanceY*distanceY); const float zDist = fabs(i_fromZ - z) + 0.000001f; const float slope = groundDist / zDist; @@ -180,8 +180,8 @@ template<typename TRAVELLER> float DestinationHolder<TRAVELLER>::GetDistance3dFromDestSq(const WorldObject &obj) const { - float x,y,z; - obj.GetPosition(x,y,z); + float x, y, z; + obj.GetPosition(x, y, z); return (i_destX-x)*(i_destX-x)+(i_destY-y)*(i_destY-y)+(i_destZ-z)*(i_destZ-z); } diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 9aaae6035a9..6ef2e71d907 100755 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -243,7 +243,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle) i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new TargetedMovementGenerator<Player>(*target,dist,angle), MOTION_SLOT_ACTIVE); + Mutate(new TargetedMovementGenerator<Player>(*target, dist, angle), MOTION_SLOT_ACTIVE); } else { @@ -251,7 +251,7 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle) i_owner->GetEntry(), i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new TargetedMovementGenerator<Creature>(*target,dist,angle), MOTION_SLOT_ACTIVE); + Mutate(new TargetedMovementGenerator<Creature>(*target, dist, angle), MOTION_SLOT_ACTIVE); } } @@ -268,7 +268,7 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slo sLog->outStaticDebug("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new TargetedMovementGenerator<Player>(*target,dist,angle), slot); + Mutate(new TargetedMovementGenerator<Player>(*target, dist, angle), slot); } else { @@ -276,7 +276,7 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slo i_owner->GetEntry(), i_owner->GetGUIDLow(), target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature", target->GetTypeId() == TYPEID_PLAYER ? target->GetGUIDLow() : target->ToCreature()->GetDBTableGUIDLow()); - Mutate(new TargetedMovementGenerator<Creature>(*target,dist,angle), slot); + Mutate(new TargetedMovementGenerator<Creature>(*target, dist, angle), slot); } } @@ -286,13 +286,13 @@ MotionMaster::MovePoint(uint32 id, float x, float y, float z) if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), id, x, y, z); - Mutate(new PointMovementGenerator<Player>(id,x,y,z), MOTION_SLOT_ACTIVE); + Mutate(new PointMovementGenerator<Player>(id, x, y, z), MOTION_SLOT_ACTIVE); } else { sLog->outStaticDebug("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), id, x, y, z); - Mutate(new PointMovementGenerator<Creature>(id,x,y,z), MOTION_SLOT_ACTIVE); + Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_ACTIVE); } } @@ -334,13 +334,13 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z); - Mutate(new PointMovementGenerator<Player>(0,x,y,z), MOTION_SLOT_CONTROLLED); + Mutate(new PointMovementGenerator<Player>(0, x, y, z), MOTION_SLOT_CONTROLLED); } else { sLog->outStaticDebug("Creature (Entry: %u GUID: %u) jump to point (X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z); - Mutate(new PointMovementGenerator<Creature>(0,x,y,z), MOTION_SLOT_CONTROLLED); + Mutate(new PointMovementGenerator<Creature>(0, x, y, z), MOTION_SLOT_CONTROLLED); } i_owner->SendMonsterMove(x, y, z, moveFlag, time, speedZ); @@ -357,13 +357,13 @@ MotionMaster::MoveCharge(float x, float y, float z, float speed, uint32 id) if (i_owner->GetTypeId() == TYPEID_PLAYER) { sLog->outStaticDebug("Player (GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), x, y, z); - Mutate(new PointMovementGenerator<Player>(id,x,y,z), MOTION_SLOT_CONTROLLED); + Mutate(new PointMovementGenerator<Player>(id, x, y, z), MOTION_SLOT_CONTROLLED); } else { sLog->outStaticDebug("Creature (Entry: %u GUID: %u) charge point (X: %f Y: %f Z: %f)", i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z); - Mutate(new PointMovementGenerator<Creature>(id,x,y,z), MOTION_SLOT_CONTROLLED); + Mutate(new PointMovementGenerator<Creature>(id, x, y, z), MOTION_SLOT_CONTROLLED); } } @@ -380,7 +380,7 @@ MotionMaster::MoveSeekAssistance(float x, float y, float z) { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog->outError("Player (GUID: %u) attempt to seek assistance",i_owner->GetGUIDLow()); + sLog->outError("Player (GUID: %u) attempt to seek assistance", i_owner->GetGUIDLow()); } else { @@ -388,7 +388,7 @@ MotionMaster::MoveSeekAssistance(float x, float y, float z) i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z); i_owner->AttackStop(); i_owner->ToCreature()->SetReactState(REACT_PASSIVE); - Mutate(new AssistanceMovementGenerator(x,y,z), MOTION_SLOT_ACTIVE); + Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE); } } @@ -397,7 +397,7 @@ MotionMaster::MoveSeekAssistanceDistract(uint32 time) { if (i_owner->GetTypeId() == TYPEID_PLAYER) { - sLog->outError("Player (GUID: %u) attempt to call distract after assistance",i_owner->GetGUIDLow()); + sLog->outError("Player (GUID: %u) attempt to call distract after assistance", i_owner->GetGUIDLow()); } else { @@ -445,7 +445,7 @@ MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode) if (path < sTaxiPathNodesByPath.size()) { sLog->outStaticDebug("%s taxi to (Path %u node %u)", i_owner->GetName(), path, pathnode); - FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(sTaxiPathNodesByPath[path],pathnode); + FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(sTaxiPathNodesByPath[path], pathnode); Mutate(mgen, MOTION_SLOT_CONTROLLED); } else @@ -597,5 +597,5 @@ bool MotionMaster::GetDestination(float &x, float &y, float &z) if (empty()) return false; - return top()->GetDestination(x,y,z); + return top()->GetDestination(x, y, z); } diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index 4c140d010c7..8ea450283e6 100755 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -151,13 +151,13 @@ class MotionMaster //: private std::stack<MovementGenerator *> void MoveFleeing(Unit* enemy, uint32 time = 0); void MovePoint(uint32 id, const Position &pos) { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ); } - void MovePoint(uint32 id, float x,float y,float z); + void MovePoint(uint32 id, float x, float y, float z); void MoveCharge(float x, float y, float z, float speed = SPEED_CHARGE, uint32 id = EVENT_CHARGE); void MoveFall(float z, uint32 id = 0); void MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ); void MoveJumpTo(float angle, float speedXY, float speedZ); void MoveJump(float x, float y, float z, float speedXY, float speedZ); - void MoveSeekAssistance(float x,float y,float z); + void MoveSeekAssistance(float x, float y, float z); void MoveSeekAssistanceDistract(uint32 timer); void MoveTaxiFlight(uint32 path, uint32 pathnode); void MoveDistract(uint32 time); diff --git a/src/server/game/Movement/MovementGenerator.h b/src/server/game/Movement/MovementGenerator.h index 5934a14d9be..ca9605c8d08 100755 --- a/src/server/game/Movement/MovementGenerator.h +++ b/src/server/game/Movement/MovementGenerator.h @@ -79,9 +79,9 @@ class MovementGeneratorMedium : public MovementGenerator bool Update(T &u, const uint32 &time_diff); }; -struct SelectableMovement : public FactoryHolder<MovementGenerator,MovementGeneratorType> +struct SelectableMovement : public FactoryHolder<MovementGenerator, MovementGeneratorType> { - SelectableMovement(MovementGeneratorType mgt) : FactoryHolder<MovementGenerator,MovementGeneratorType>(mgt) {} + SelectableMovement(MovementGeneratorType mgt) : FactoryHolder<MovementGenerator, MovementGeneratorType>(mgt) {} }; template<class REAL_MOVEMENT> @@ -92,8 +92,8 @@ struct MovementGeneratorFactory : public SelectableMovement MovementGenerator* Create(void *) const; }; -typedef FactoryHolder<MovementGenerator,MovementGeneratorType> MovementGeneratorCreator; -typedef FactoryHolder<MovementGenerator,MovementGeneratorType>::FactoryHolderRegistry MovementGeneratorRegistry; -typedef FactoryHolder<MovementGenerator,MovementGeneratorType>::FactoryHolderRepository MovementGeneratorRepository; +typedef FactoryHolder<MovementGenerator, MovementGeneratorType> MovementGeneratorCreator; +typedef FactoryHolder<MovementGenerator, MovementGeneratorType>::FactoryHolderRegistry MovementGeneratorRegistry; +typedef FactoryHolder<MovementGenerator, MovementGeneratorType>::FactoryHolderRepository MovementGeneratorRepository; #endif diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp index 9b4cf3f1231..59c624519e2 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.cpp @@ -25,7 +25,7 @@ #ifdef MAP_BASED_RAND_GEN #define rand_norm() unit.rand_norm() -#define urand(a,b) unit.urand(a,b) +#define urand(a, b) unit.urand(a, b) #endif template<class T> @@ -33,7 +33,7 @@ void ConfusedMovementGenerator<T>::Initialize(T &unit) { const float wander_distance = 11; - float x,y,z; + float x, y, z; x = unit.GetPositionX(); y = unit.GetPositionY(); z = unit.GetPositionZ(); @@ -140,7 +140,7 @@ ConfusedMovementGenerator<T>::Update(T &unit, const uint32 &diff) // arrived, stop and wait a bit unit.ClearUnitState(UNIT_STAT_MOVE); - i_nextMove = urand(1,MAX_CONF_WAYPOINTS); + i_nextMove = urand(1, MAX_CONF_WAYPOINTS); i_nextMoveTime.Reset(urand(0, 1500-1)); // TODO: check the minimum reset time, should be probably higher } } diff --git a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h index 597a85af530..f85453bc040 100755 --- a/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/ConfusedMovementGenerator.h @@ -40,7 +40,7 @@ class ConfusedMovementGenerator bool GetDestination(float &x, float &y, float &z) const { if (i_destinationHolder.HasArrived()) return false; - i_destinationHolder.GetDestination(x,y,z); + i_destinationHolder.GetDestination(x, y, z); return true; } diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp index 11dcd826fd2..ae091289299 100755 --- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp @@ -159,30 +159,30 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z) temp_y = y + distance * sin(angle); Trinity::NormalizeMapCoord(temp_x); Trinity::NormalizeMapCoord(temp_y); - if (owner.IsWithinLOS(temp_x,temp_y,z)) + if (owner.IsWithinLOS(temp_x, temp_y, z)) { - bool is_water_now = _map->IsInWater(x,y,z); + bool is_water_now = _map->IsInWater(x, y, z); - if (is_water_now && _map->IsInWater(temp_x,temp_y,z)) + if (is_water_now && _map->IsInWater(temp_x, temp_y, z)) { x = temp_x; y = temp_y; return true; } - float new_z = _map->GetHeight(temp_x,temp_y,z,true); + float new_z = _map->GetHeight(temp_x, temp_y, z, true); if (new_z <= INVALID_HEIGHT) continue; - bool is_water_next = _map->IsInWater(temp_x,temp_y,new_z); + bool is_water_next = _map->IsInWater(temp_x, temp_y, new_z); if ((is_water_now && !is_water_next && !is_land_ok) || (!is_water_now && is_water_next && !is_water_ok)) continue; if (!(new_z - z) || distance / fabs(new_z - z) > 1.0f) { - float new_z_left = _map->GetHeight(temp_x + (float)(cos(angle+M_PI/2)),temp_y + (float)(sin(angle+M_PI/2)),z,true); - float new_z_right = _map->GetHeight(temp_x + (float)(cos(angle-M_PI/2)),temp_y + (float)(sin(angle-M_PI/2)),z,true); + float new_z_left = _map->GetHeight(temp_x + (float)(cos(angle+M_PI/2)), temp_y + (float)(sin(angle+M_PI/2)), z, true); + float new_z_right = _map->GetHeight(temp_x + (float)(cos(angle-M_PI/2)), temp_y + (float)(sin(angle-M_PI/2)), z, true); if (fabs(new_z_left - new_z) < 1.2f && fabs(new_z_right - new_z) < 1.2f) { x = temp_x; @@ -194,7 +194,7 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z) } } i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset(urand(500,1000)); + i_nextCheckTime.Reset(urand(500, 1000)); return false; } @@ -218,7 +218,7 @@ FleeingMovementGenerator<T>::_setMoveData(T &owner) { // we are very far or too close, stopping i_to_distance_from_caster = 0.0f; - i_nextCheckTime.Reset(urand(500,1000)); + i_nextCheckTime.Reset(urand(500, 1000)); return false; } else diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index 461d27461fb..e8cb46e2a1d 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -76,7 +76,7 @@ HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32& time_diff // restore orientation of not moving creature at returning to home if (owner.GetDefaultMovementType() == IDLE_MOTION_TYPE) { - //sLog->outDebug("Entering HomeMovement::GetDestination(z,y,z)"); + //sLog->outDebug("Entering HomeMovement::GetDestination(z, y, z)"); owner.SetOrientation(ori); WorldPacket packet; owner.BuildHeartBeatMsg(&packet); diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h index 82284bee0ce..2b50d380fb8 100755 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.h @@ -44,7 +44,7 @@ class HomeMovementGenerator<Creature> void modifyTravelTime(uint32 travel_time) { i_travel_timer = travel_time; } MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; } - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } + bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x, y, z); return true; } private: void _setTargetLocation(Creature &); diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp index 9aa2088cbe8..a75a5b64f10 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp @@ -29,8 +29,8 @@ void PointMovementGenerator<T>::Initialize(T &unit) { unit.StopMoving(); Traveller<T> traveller(unit); - // knockback effect has UNIT_STAT_JUMPING set,so if here we disable sentmonstermove there will be creature position sync problem between client and server - i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, true /* !unit.HasUnitState(UNIT_STAT_JUMPING)*/); + // knockback effect has UNIT_STAT_JUMPING set, so if here we disable sentmonstermove there will be creature position sync problem between client and server + i_destinationHolder.SetDestination(traveller, i_x, i_y, i_z, true /* !unit.HasUnitState(UNIT_STAT_JUMPING)*/); } template<class T> diff --git a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h index 03c547b5cdc..47853b37325 100755 --- a/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/PointMovementGenerator.h @@ -44,7 +44,7 @@ class PointMovementGenerator bool GetDestination(float& x, float& y, float& z) const { x=i_x; y=i_y; z=i_z; return true; } private: uint32 id; - float i_x,i_y,i_z; + float i_x, i_y, i_z; TimeTracker i_nextMoveTime; DestinationHolder< Traveller<T> > i_destinationHolder; bool arrived; diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp index 9918ad579b0..c165831027a 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp @@ -47,7 +47,7 @@ template<> void RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) { - float X,Y,Z,z,nx,ny,nz,ori,dist; + float X, Y, Z, z, nx, ny, nz, ori, dist; creature.GetHomePosition(X, Y, Z, ori); @@ -97,13 +97,13 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) // The fastest way to get an accurate result 90% of the time. // Better result can be obtained like 99% accuracy with a ray light, but the cost is too high and the code is too long. - nz = map->GetHeight(nx,ny,Z+dist-2.0f,false); // Map check + nz = map->GetHeight(nx, ny, Z+dist-2.0f, false); // Map check if (fabs(nz-Z)>dist) { - nz = map->GetHeight(nx,ny,Z-2.0f,true); // Vmap Horizontal or above + nz = map->GetHeight(nx, ny, Z-2.0f, true); // Vmap Horizontal or above if (fabs(nz-Z)>dist) { - nz = map->GetHeight(nx,ny,Z+dist-2.0f,true); // Vmap Higher + nz = map->GetHeight(nx, ny, Z+dist-2.0f, true); // Vmap Higher if (fabs(nz-Z)>dist) continue; // let's forget this bad coords where a z cannot be find and retry at next tick } @@ -113,7 +113,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) } Traveller<Creature> traveller(creature); - creature.SetOrientation(creature.GetAngle(nx,ny)); + creature.SetOrientation(creature.GetAngle(nx, ny)); i_destinationHolder.SetDestination(traveller, nx, ny, nz); creature.AddUnitState(UNIT_STAT_ROAMING); if (is_air_ok) @@ -123,7 +123,7 @@ RandomMovementGenerator<Creature>::_setRandomLocation(Creature &creature) //else if (is_water_ok) // Swimming mode to be done with more than this check else { - i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(),5000+i_destinationHolder.GetTotalTravelTime())); + i_nextMoveTime.Reset(urand(500+i_destinationHolder.GetTotalTravelTime(), 5000+i_destinationHolder.GetTotalTravelTime())); creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING); } @@ -144,7 +144,7 @@ RandomMovementGenerator<Creature>::Initialize(Creature &creature) if (!wander_distance) wander_distance = creature.GetRespawnRadius(); - if (irand(0,RUNNING_CHANCE_RANDOMMV) > 0) + if (irand(0, RUNNING_CHANCE_RANDOMMV) > 0) creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING); _setRandomLocation(creature); } @@ -185,11 +185,11 @@ RandomMovementGenerator<Creature>::Update(Creature &creature, const uint32 &diff { if (i_nextMoveTime.Passed()) { - if (irand(0,RUNNING_CHANCE_RANDOMMV) > 0) + if (irand(0, RUNNING_CHANCE_RANDOMMV) > 0) creature.AddUnitMovementFlag(MOVEMENTFLAG_WALKING); _setRandomLocation(creature); } - else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(),PET_FOLLOW_DIST+2.5f)) + else if (creature.isPet() && creature.GetOwner() && !creature.IsWithinDist(creature.GetOwner(), PET_FOLLOW_DIST+2.5f)) { creature.RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); _setRandomLocation(creature); diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h index b7d7c7196d6..63d006c12b7 100755 --- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h @@ -37,9 +37,9 @@ class RandomMovementGenerator void Reset(T &); bool Update(T &, const uint32 &); bool GetDestination(float &x, float &y, float &z) const; - void UpdateMapPosition(uint32 mapid, float &x ,float &y, float &z) + void UpdateMapPosition(uint32 mapid, float &x , float &y, float &z) { - i_destinationHolder.GetLocationNow(mapid, x,y,z); + i_destinationHolder.GetLocationNow(mapid, x, y, z); } MovementGeneratorType GetMovementGeneratorType() { return RANDOM_MOTION_TYPE; } private: diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp index 8080b842e52..c796fd6a355 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp @@ -122,7 +122,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) else { // to at i_offset distance from target and i_angle from target facing - i_target->GetClosePoint(x,y,z,owner.GetObjectSize(),i_offset,i_angle); + i_target->GetClosePoint(x, y, z, owner.GetObjectSize(), i_offset, i_angle); } /* @@ -138,7 +138,7 @@ TargetedMovementGenerator<T>::_setTargetLocation(T &owner) //We don't update Mob Movement, if the difference between New destination and last destination is < BothObjectSize float bothObjectSize = i_target->GetObjectSize() + owner.GetObjectSize() + CONTACT_DISTANCE; - if (i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x,y,z) < bothObjectSize) + if (i_destinationHolder.HasDestination() && i_destinationHolder.GetDestinationDiff(x, y, z) < bothObjectSize) return; */ i_destinationHolder.SetDestination(traveller, x, y, z); @@ -230,7 +230,7 @@ TargetedMovementGenerator<T>::Update(T &owner, const uint32 & time_diff) owner.StopMoving(); if (owner.IsWithinMeleeRange(i_target.getTarget()) && !owner.HasUnitState(UNIT_STAT_FOLLOW)) - owner.Attack(i_target.getTarget(),true); + owner.Attack(i_target.getTarget(), true); } } diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h index 60ced2e8e41..fc7dc50622f 100755 --- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h @@ -54,7 +54,7 @@ class TargetedMovementGenerator bool GetDestination(float &x, float &y, float &z) const { if (i_destinationHolder.HasArrived() || !i_destinationHolder.HasDestination()) return false; - i_destinationHolder.GetDestination(x,y,z); + i_destinationHolder.GetDestination(x, y, z); return true; } diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp index e3599b73cbd..74e67642891 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp @@ -199,7 +199,7 @@ WaypointMovementGenerator<Creature>::Update(Creature &unit, const uint32 &diff) i_nextMoveTime.Reset(node->delay); //note: disable "start" for mtmap - if (node->event_id && urand(0,99) < node->event_chance) + if (node->event_id && urand(0, 99) < node->event_chance) unit.GetMap()->ScriptsStart(sWaypointScripts, node->event_id, &unit, NULL/*, false*/); i_destinationHolder.ResetTravelTime(); @@ -280,13 +280,13 @@ bool FlightPathMovementGenerator::Update(Player &player, const uint32 &diff) i_destinationHolder.ResetUpdate(FLIGHT_TRAVEL_UPDATE); if (i_destinationHolder.HasArrived()) { - DoEventIfAny(player,(*i_path)[i_currentNode], false); + DoEventIfAny(player, (*i_path)[i_currentNode], false); uint32 curMap = (*i_path)[i_currentNode].mapid; ++i_currentNode; if (MovementInProgress()) { - DoEventIfAny(player,(*i_path)[i_currentNode], true); + DoEventIfAny(player, (*i_path)[i_currentNode], true); sLog->outStaticDebug("loading node %u for player %s", i_currentNode, player.GetName()); if ((*i_path)[i_currentNode].mapid == curMap) diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h index 3139f8cf104..c7821a847fd 100755 --- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h +++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.h @@ -53,8 +53,8 @@ class PathMovementBase void ReloadPath(T &); uint32 GetCurrentNode() const { return i_currentNode; } - bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; } - bool GetPosition(float& x, float& y, float& z) const { i_destinationHolder.GetLocationNowNoMicroMovement(x,y,z); return true; } + bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x, y, z); return true; } + bool GetPosition(float& x, float& y, float& z) const { i_destinationHolder.GetLocationNowNoMicroMovement(x, y, z); return true; } protected: uint32 i_currentNode; @@ -94,7 +94,7 @@ class WaypointMovementGenerator */ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, FlightPathMovementGenerator >, -public PathMovementBase<Player,TaxiPathNodeList const*> +public PathMovementBase<Player, TaxiPathNodeList const*> { public: explicit FlightPathMovementGenerator(TaxiPathNodeList const& pathnodes, uint32 startNode = 0) @@ -115,7 +115,7 @@ public PathMovementBase<Player,TaxiPathNodeList const*> void SkipCurrentNode() { ++i_currentNode; } void DoEventIfAny(Player& player, TaxiPathNodeEntry const& node, bool departure); - bool GetDestination(float& x, float& y, float& z) const { return PathMovementBase<Player,TaxiPathNodeList const*>::GetDestination(x,y,z); } + bool GetDestination(float& x, float& y, float& z) const { return PathMovementBase<Player, TaxiPathNodeList const*>::GetDestination(x, y, z); } void PreloadEndGrid(); void InitEndGridInfo(); diff --git a/src/server/game/Movement/Traveller.h b/src/server/game/Movement/Traveller.h index 51fff4a8df3..17fb44edcaf 100755 --- a/src/server/game/Movement/Traveller.h +++ b/src/server/game/Movement/Traveller.h @@ -60,7 +60,7 @@ struct Traveller template<class T> inline uint32 Traveller<T>::GetTotalTrevelTimeTo(float x, float y, float z) { - float dist = GetMoveDestinationTo(x,y,z); + float dist = GetMoveDestinationTo(x, y, z); float speed = Speed(); if (speed < 0.0f) return 0xfffffffe; // almost infinity-unit should stop diff --git a/src/server/game/Movement/Waypoints/Path.h b/src/server/game/Movement/Waypoints/Path.h index bf25dc4b856..bb874d67413 100755 --- a/src/server/game/Movement/Waypoints/Path.h +++ b/src/server/game/Movement/Waypoints/Path.h @@ -52,11 +52,11 @@ class Path return len; } - float GetTotalLength() const { return GetTotalLength(0,size()); } + float GetTotalLength() const { return GetTotalLength(0, size()); } float GetPassedLength(uint32 curnode, float x, float y, float z) { - float len = GetTotalLength(0,curnode); + float len = GetTotalLength(0, curnode); if (curnode > 0) { diff --git a/src/server/game/Movement/Waypoints/WaypointManager.cpp b/src/server/game/Movement/Waypoints/WaypointManager.cpp index 58db32882c8..67c1f9edb8a 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.cpp +++ b/src/server/game/Movement/Waypoints/WaypointManager.cpp @@ -37,7 +37,7 @@ void WaypointStore::Load() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT id,point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data ORDER BY id, point"); + QueryResult result = WorldDatabase.Query("SELECT id, point, position_x, position_y, position_z, move_flag, delay, action, action_chance FROM waypoint_data ORDER BY id, point"); if (!result) { @@ -61,7 +61,7 @@ void WaypointStore::Load() if (last_id != id) path_data = new WaypointPath; - float x,y,z; + float x, y, z; x = fields[2].GetFloat(); y = fields[3].GetFloat(); z = fields[4].GetFloat(); @@ -99,7 +99,7 @@ void WaypointStore::UpdatePath(uint32 id) QueryResult result; - result = WorldDatabase.PQuery("SELECT point,position_x,position_y,position_z,move_flag,delay,action,action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id); + result = WorldDatabase.PQuery("SELECT point, position_x, position_y, position_z, move_flag, delay, action, action_chance FROM waypoint_data WHERE id = %u ORDER BY point", id); if (!result) return; @@ -114,7 +114,7 @@ void WaypointStore::UpdatePath(uint32 id) WaypointData *wp = new WaypointData; - float x,y,z; + float x, y, z; x = fields[1].GetFloat(); y = fields[2].GetFloat(); z = fields[3].GetFloat(); diff --git a/src/server/game/Movement/Waypoints/WaypointManager.h b/src/server/game/Movement/Waypoints/WaypointManager.h index d62dee653b1..d14133ea844 100755 --- a/src/server/game/Movement/Waypoints/WaypointManager.h +++ b/src/server/game/Movement/Waypoints/WaypointManager.h @@ -26,7 +26,7 @@ struct WaypointData { uint32 id; - float x,y,z; + float x, y, z; bool run; uint32 delay; uint32 event_id; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.cpp b/src/server/game/OutdoorPvP/OutdoorPvP.cpp index 8002c990281..ff0f7af71d1 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvP.cpp @@ -144,7 +144,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) { if (!m_Creatures[type]) { - sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted",type); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "opvp creature type %u was already deleted", type); return false; } @@ -155,7 +155,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) m_Creatures[type] = 0; return false; } - sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u",type); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "deleting opvp creature type %u", type); uint32 guid = cr->GetDBTableGUIDLow(); // Don't save respawn time cr->SetRespawnTime(0); @@ -164,7 +164,7 @@ bool OPvPCapturePoint::DelCreature(uint32 type) // beats me why this is needed, but with the recent removal "cleanup" some creatures stay in the map if "properly" deleted // so this is a big fat workaround, if AddObjectToRemoveList and DoDelayedMovesAndRemoves worked correctly, this wouldn't be needed //if (Map * map = sMapMgr->FindMap(cr->GetMapId())) - // map->Remove(cr,false); + // map->Remove(cr, false); // delete respawn time for this creature PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CREATURE_RESPAWN_BY_GUID); stmt->setUInt32(0, guid); @@ -213,9 +213,9 @@ bool OPvPCapturePoint::DelCapturePoint() void OPvPCapturePoint::DeleteSpawns() { - for (std::map<uint32,uint64>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i) + for (std::map<uint32, uint64>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i) DelObject(i->first); - for (std::map<uint32,uint64>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i) + for (std::map<uint32, uint64>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i) DelCreature(i->first); DelCapturePoint(); } @@ -405,12 +405,12 @@ void OPvPCapturePoint::SendUpdateWorldState(uint32 field, uint32 value) // send to all players present in the area for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr) { - (*itr)->SendUpdateWorldState(field,value); + (*itr)->SendUpdateWorldState(field, value); } } } -void OPvPCapturePoint::SendObjectiveComplete(uint32 id,uint64 guid) +void OPvPCapturePoint::SendObjectiveComplete(uint32 id, uint64 guid) { uint32 team; switch(m_State) @@ -480,7 +480,7 @@ bool OPvPCapturePoint::IsInsideObjective(Player *plr) const bool OutdoorPvP::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go) { for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) - if (itr->second->HandleCustomSpell(plr,spellId,go)) + if (itr->second->HandleCustomSpell(plr, spellId, go)) return true; return false; @@ -496,7 +496,7 @@ bool OPvPCapturePoint::HandleCustomSpell(Player *plr, uint32 /*spellId*/, GameOb bool OutdoorPvP::HandleOpenGo(Player *plr, uint64 guid) { for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr) - if (itr->second->HandleOpenGo(plr,guid) >= 0) + if (itr->second->HandleOpenGo(plr, guid) >= 0) return true; return false; @@ -546,7 +546,7 @@ bool OPvPCapturePoint::HandleDropFlag(Player * /*plr*/, uint32 /*id*/) int32 OPvPCapturePoint::HandleOpenGo(Player * /*plr*/, uint64 guid) { - std::map<uint64,uint32>::iterator itr = m_ObjectTypes.find(guid); + std::map<uint64, uint32>::iterator itr = m_ObjectTypes.find(guid); if (itr != m_ObjectTypes.end()) { return itr->second; diff --git a/src/server/game/OutdoorPvP/OutdoorPvP.h b/src/server/game/OutdoorPvP/OutdoorPvP.h index 2a8927d1bb5..362217b1575 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvP.h +++ b/src/server/game/OutdoorPvP/OutdoorPvP.h @@ -179,10 +179,10 @@ class OPvPCapturePoint // map to store the various gameobjects and creatures spawned by the objective // type , guid - std::map<uint32,uint64> m_Objects; - std::map<uint32,uint64> m_Creatures; - std::map<uint64,uint32> m_ObjectTypes; - std::map<uint64,uint32> m_CreatureTypes; + std::map<uint32, uint64> m_Objects; + std::map<uint32, uint64> m_Creatures; + std::map<uint64, uint32> m_ObjectTypes; + std::map<uint64, uint32> m_CreatureTypes; }; // base class for specific outdoor pvp handlers diff --git a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp index ac79831a1da..dc03129c34e 100755 --- a/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp +++ b/src/server/game/OutdoorPvP/OutdoorPvPMgr.cpp @@ -139,7 +139,7 @@ void OutdoorPvPMgr::HandlePlayerLeaveZone(Player *plr, uint32 zoneid) return; itr->second->HandlePlayerLeaveZone(plr, zoneid); - sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u",plr->GetGUIDLow(), itr->second->GetTypeId()); + sLog->outDebug(LOG_FILTER_OUTDOORPVP, "Player %u left outdoorpvp id %u", plr->GetGUIDLow(), itr->second->GetTypeId()); } OutdoorPvP * OutdoorPvPMgr::GetOutdoorPvPToZoneId(uint32 zoneid) @@ -168,7 +168,7 @@ bool OutdoorPvPMgr::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * { for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) { - if ((*itr)->HandleCustomSpell(plr,spellId,go)) + if ((*itr)->HandleCustomSpell(plr, spellId, go)) return true; } return false; @@ -187,7 +187,7 @@ bool OutdoorPvPMgr::HandleOpenGo(Player *plr, uint64 guid) { for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) { - if ((*itr)->HandleOpenGo(plr,guid)) + if ((*itr)->HandleOpenGo(plr, guid)) return true; } return false; @@ -197,7 +197,7 @@ void OutdoorPvPMgr::HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid { for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) { - if ((*itr)->HandleGossipOption(plr,guid,gossipid)) + if ((*itr)->HandleGossipOption(plr, guid, gossipid)) return; } } @@ -206,7 +206,7 @@ bool OutdoorPvPMgr::CanTalkTo(Player * plr, Creature * c, GossipMenuItems gso) { for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) { - if ((*itr)->CanTalkTo(plr,c,gso)) + if ((*itr)->CanTalkTo(plr, c, gso)) return true; } return false; @@ -216,7 +216,7 @@ void OutdoorPvPMgr::HandleDropFlag(Player *plr, uint32 spellId) { for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr) { - if ((*itr)->HandleDropFlag(plr,spellId)) + if ((*itr)->HandleDropFlag(plr, spellId)) return; } } diff --git a/src/server/game/Pools/PoolMgr.cpp b/src/server/game/Pools/PoolMgr.cpp index 9aead213ea4..e2a5bdfef91 100755 --- a/src/server/game/Pools/PoolMgr.cpp +++ b/src/server/game/Pools/PoolMgr.cpp @@ -193,7 +193,7 @@ void PoolGroup<T>::DespawnObject(ActivePoolData& spawns, uint32 guid) if (!guid || EqualChanced[i].guid == guid) { Despawn1Object(EqualChanced[i].guid); - spawns.RemoveObject<T>(EqualChanced[i].guid,poolId); + spawns.RemoveObject<T>(EqualChanced[i].guid, poolId); } } } @@ -206,7 +206,7 @@ void PoolGroup<T>::DespawnObject(ActivePoolData& spawns, uint32 guid) if (!guid || ExplicitlyChanced[i].guid == guid) { Despawn1Object(ExplicitlyChanced[i].guid); - spawns.RemoveObject<T>(ExplicitlyChanced[i].guid,poolId); + spawns.RemoveObject<T>(ExplicitlyChanced[i].guid, poolId); } } } @@ -364,7 +364,7 @@ void PoolGroup<Creature>::Spawn1Object(PoolObject* obj) if (!map->Instanceable() && map->IsLoaded(data->posX, data->posY)) { Creature* pCreature = new Creature; - //sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning creature %u",guid); + //sLog->outDebug(LOG_FILTER_POOLSYS, "Spawning creature %u", guid); if (!pCreature->LoadFromDB(obj->guid, map)) { delete pCreature; @@ -566,7 +566,7 @@ void PoolMgr::LoadFromDB() { uint32 oldMSTime = getMSTime(); - QueryResult result = WorldDatabase.Query("SELECT entry,max_limit FROM pool_template"); + QueryResult result = WorldDatabase.Query("SELECT entry, max_limit FROM pool_template"); if (!result) { mPoolTemplate.clear(); @@ -626,7 +626,7 @@ void PoolMgr::LoadFromDB() } if (pool_id > max_pool_id) { - sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); + sLog->outErrorDb("`pool_creature` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id); continue; } if (chance < 0 || chance > 100) @@ -694,7 +694,7 @@ void PoolMgr::LoadFromDB() if (pool_id > max_pool_id) { - sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); + sLog->outErrorDb("`pool_gameobject` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id); continue; } @@ -748,17 +748,17 @@ void PoolMgr::LoadFromDB() if (mother_pool_id > max_pool_id) { - sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",mother_pool_id); + sLog->outErrorDb("`pool_pool` mother_pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", mother_pool_id); continue; } if (child_pool_id > max_pool_id) { - sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.",child_pool_id); + sLog->outErrorDb("`pool_pool` included pool_id (%u) is out of range compared to max pool id in `pool_template`, skipped.", child_pool_id); continue; } if (mother_pool_id == child_pool_id) { - sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.",child_pool_id); + sLog->outErrorDb("`pool_pool` pool_id (%u) includes itself, dead-lock detected, skipped.", child_pool_id); continue; } if (chance < 0 || chance > 100) @@ -849,7 +849,7 @@ void PoolMgr::LoadFromDB() if (pool_id > max_pool_id) { - sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.",pool_id); + sLog->outErrorDb("`pool_quest` pool id (%u) is out of range compared to max pool id in `pool_template`, skipped.", pool_id); continue; } diff --git a/src/server/game/Pools/PoolMgr.h b/src/server/game/Pools/PoolMgr.h index 3f8fa81d488..96f4632769c 100755 --- a/src/server/game/Pools/PoolMgr.h +++ b/src/server/game/Pools/PoolMgr.h @@ -42,7 +42,7 @@ class Pool // for Pool of Pool }; typedef std::set<uint32> ActivePoolObjects; -typedef std::map<uint32,uint32> ActivePoolPools; +typedef std::map<uint32, uint32> ActivePoolPools; class ActivePoolData { diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp index e175ebcb48c..e285f5e1589 100755 --- a/src/server/game/Reputation/ReputationMgr.cpp +++ b/src/server/game/Reputation/ReputationMgr.cpp @@ -45,7 +45,7 @@ int32 ReputationMgr::GetReputation(uint32 faction_id) const if (!factionEntry) { - sLog->outError("ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.",m_player->GetName(), faction_id); + sLog->outError("ReputationMgr::GetReputation: Can't get reputation of %s for unknown faction (faction id) #%u.", m_player->GetName(), faction_id); return 0; } @@ -98,7 +98,7 @@ ReputationRank ReputationMgr::GetBaseRank(FactionEntry const* factionEntry) cons return ReputationToRank(reputation); } -void ReputationMgr::ApplyForceReaction(uint32 faction_id,ReputationRank rank,bool apply) +void ReputationMgr::ApplyForceReaction(uint32 faction_id, ReputationRank rank, bool apply) { if (apply) m_forcedReactions[faction_id] = rank; @@ -248,7 +248,7 @@ void ReputationMgr::Initialize() if (newFaction.Flags & FACTION_FLAG_VISIBLE) ++m_visibleFactionCount; - UpdateRankCounters(REP_HOSTILE,GetBaseRank(factionEntry)); + UpdateRankCounters(REP_HOSTILE, GetBaseRank(factionEntry)); m_factions[newFaction.ReputationListID] = newFaction; } @@ -354,16 +354,16 @@ bool ReputationMgr::SetOneFactionReputation(FactionEntry const* factionEntry, in SetVisible(&itr->second); if (new_rank <= REP_HOSTILE) - SetAtWar(&itr->second,true); + SetAtWar(&itr->second, true); UpdateRankCounters(old_rank, new_rank); m_player->ReputationChanged(factionEntry); m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KNOWN_FACTIONS, factionEntry->ID); m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->ID); - m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION,factionEntry->ID); - m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION,factionEntry->ID); - m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION,factionEntry->ID); + m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, factionEntry->ID); + m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REVERED_REPUTATION, factionEntry->ID); + m_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_HONORED_REPUTATION, factionEntry->ID); return true; } @@ -423,7 +423,7 @@ void ReputationMgr::SetAtWar(RepListID repListID, bool on) if (itr->second.Flags & (FACTION_FLAG_INVISIBLE_FORCED|FACTION_FLAG_HIDDEN)) return; - SetAtWar(&itr->second,on); + SetAtWar(&itr->second, on); } void ReputationMgr::SetAtWar(FactionState* faction, bool atWar) const @@ -451,7 +451,7 @@ void ReputationMgr::SetInactive(RepListID repListID, bool on) if (itr == m_factions.end()) return; - SetInactive(&itr->second,on); + SetInactive(&itr->second, on); } void ReputationMgr::SetInactive(FactionState* faction, bool inactive) const @@ -478,7 +478,7 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) // Set initial reputations (so everything is nifty before DB data load) Initialize(); - //QueryResult *result = CharacterDatabase.PQuery("SELECT faction,standing,flags FROM character_reputation WHERE guid = '%u'",GetGUIDLow()); + //QueryResult *result = CharacterDatabase.PQuery("SELECT faction, standing, flags FROM character_reputation WHERE guid = '%u'", GetGUIDLow()); if (result) { @@ -506,20 +506,20 @@ void ReputationMgr::LoadFromDB(PreparedQueryResult result) SetVisible(faction); // have internal checks for forced invisibility if (dbFactionFlags & FACTION_FLAG_INACTIVE) - SetInactive(faction,true); // have internal checks for visibility requirement + SetInactive(faction, true); // have internal checks for visibility requirement if (dbFactionFlags & FACTION_FLAG_AT_WAR) // DB at war - SetAtWar(faction,true); // have internal checks for FACTION_FLAG_PEACE_FORCED + SetAtWar(faction, true); // have internal checks for FACTION_FLAG_PEACE_FORCED else // DB not at war { // allow remove if visible (and then not FACTION_FLAG_INVISIBLE_FORCED or FACTION_FLAG_HIDDEN) if (faction->Flags & FACTION_FLAG_VISIBLE) - SetAtWar(faction,false); // have internal checks for FACTION_FLAG_PEACE_FORCED + SetAtWar(faction, false); // have internal checks for FACTION_FLAG_PEACE_FORCED } // set atWar for hostile if (GetRank(factionEntry) <= REP_HOSTILE) - SetAtWar(faction,true); + SetAtWar(faction, true); // reset changed flag if values similar to saved in DB if (faction->Flags == dbFactionFlags) @@ -540,7 +540,7 @@ void ReputationMgr::SaveToDB(SQLTransaction& trans) if (itr->second.needSave) { trans->PAppend("DELETE FROM character_reputation WHERE guid = '%u' AND faction='%u'", m_player->GetGUIDLow(), itr->second.ID); - trans->PAppend("INSERT INTO character_reputation (guid,faction,standing,flags) VALUES ('%u', '%u', '%i', '%u')", m_player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags); + trans->PAppend("INSERT INTO character_reputation (guid, faction, standing, flags) VALUES ('%u', '%u', '%i', '%u')", m_player->GetGUIDLow(), itr->second.ID, itr->second.Standing, itr->second.Flags); itr->second.needSave = false; } } diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h index 28181e8ecb1..4a6c60456eb 100755 --- a/src/server/game/Reputation/ReputationMgr.h +++ b/src/server/game/Reputation/ReputationMgr.h @@ -56,8 +56,8 @@ struct FactionState bool needSave; }; -typedef std::map<RepListID,FactionState> FactionStateList; -typedef std::map<uint32,ReputationRank> ForcedReactions; +typedef std::map<RepListID, FactionState> FactionStateList; +typedef std::map<uint32, ReputationRank> ForcedReactions; class Player; @@ -127,7 +127,7 @@ class ReputationMgr void SetAtWar(RepListID repListID, bool on); void SetInactive(RepListID repListID, bool on); - void ApplyForceReaction(uint32 faction_id,ReputationRank rank,bool apply); + void ApplyForceReaction(uint32 faction_id, ReputationRank rank, bool apply); public: // senders void SendInitialReputations(); diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 7430f04f7fc..e6426051d96 100755 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -32,12 +32,12 @@ #define SCR_REG_LST(T) ScriptRegistry<T>::ScriptPointerList // Utility macros for looping over scripts. -#define FOR_SCRIPTS(T,C,E) \ +#define FOR_SCRIPTS(T, C, E) \ if (SCR_REG_LST(T).empty()) \ return; \ for (SCR_REG_ITR(T) C = SCR_REG_LST(T).begin(); \ C != SCR_REG_LST(T).end(); ++C) -#define FOR_SCRIPTS_RET(T,C,E,R) \ +#define FOR_SCRIPTS_RET(T, C, E, R) \ if (SCR_REG_LST(T).empty()) \ return R; \ for (SCR_REG_ITR(T) C = SCR_REG_LST(T).begin(); \ @@ -47,11 +47,11 @@ itr->second // Utility macros for finding specific scripts. -#define GET_SCRIPT(T,I,V) \ +#define GET_SCRIPT(T, I, V) \ T* V = ScriptRegistry<T>::GetScriptById(I); \ if (!V) \ return; -#define GET_SCRIPT_RET(T,I,V,R) \ +#define GET_SCRIPT_RET(T, I, V, R) \ T* V = ScriptRegistry<T>::GetScriptById(I); \ if (!V) \ return R; @@ -463,7 +463,7 @@ void ScriptMgr::OnGroupRateCalculation(float& rate, uint32 count, bool isRaid) FOREACH_SCRIPT(FormulaScript)->OnGroupRateCalculation(rate, count, isRaid); } -#define SCR_MAP_BGN(M,V,I,E,C,T) \ +#define SCR_MAP_BGN(M, V, I, E, C, T) \ if (V->GetEntry()->T()) \ { \ FOR_SCRIPTS(M, I, E) \ diff --git a/src/server/game/Scripting/ScriptSystem.cpp b/src/server/game/Scripting/ScriptSystem.cpp index 53e42784f84..40e5e64af1a 100755 --- a/src/server/game/Scripting/ScriptSystem.cpp +++ b/src/server/game/Scripting/ScriptSystem.cpp @@ -43,7 +43,7 @@ void SystemMgr::LoadVersion() void SystemMgr::LoadScriptTexts() { sLog->outString("TSCR: Loading Script Texts..."); - LoadTrinityStrings("script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); + LoadTrinityStrings("script_texts", TEXT_SOURCE_RANGE, 1+(TEXT_SOURCE_RANGE*2)); sLog->outString("TSCR: Loading Script Texts additional data..."); uint32 oldMSTime = getMSTime(); @@ -105,7 +105,7 @@ void SystemMgr::LoadScriptTexts() void SystemMgr::LoadScriptTextsCustom() { sLog->outString("TSCR: Loading Custom Texts..."); - LoadTrinityStrings("custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3)); + LoadTrinityStrings("custom_texts", TEXT_SOURCE_RANGE*2, 1+(TEXT_SOURCE_RANGE*3)); sLog->outString("TSCR: Loading Custom Texts additional data..."); diff --git a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp index 7886b9e45cc..8fd112d81c2 100755 --- a/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ArenaTeamHandler.cpp @@ -33,7 +33,7 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket & recvData) uint64 guid; recvData >> guid; - sLog->outDebug(LOG_FILTER_NETWORKIO, "Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Inspect Arena stats (GUID: %u TypeId: %u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); if (Player* player = sObjectMgr->GetPlayer(guid)) { @@ -176,7 +176,7 @@ void WorldSession::HandleArenaTeamAcceptOpcode(WorldPacket & /*recv_data*/) // Add player to team if (!arenaTeam->AddMember(_player->GetGUID())) { - SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S,"","",ERR_ARENA_TEAM_INTERNAL); + SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", "", ERR_ARENA_TEAM_INTERNAL); return; } @@ -354,7 +354,7 @@ void WorldSession::SendNotInArenaTeamPacket(uint8 type) uint32 unk = 0; data << uint32(unk); // unk(0) if (!unk) - data << uint8(type); // team type (2=2v2,3=3v3,5=5v5), can be used for custom types... + data << uint8(type); // team type (2=2v2, 3=3v3, 5=5v5), can be used for custom types... SendPacket(&data); } diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp index 4f4e7bf0a42..4d2445cba26 100755 --- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp @@ -37,7 +37,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket & recv_data) uint64 guid; //NPC guid recv_data >> guid; - Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); @@ -129,7 +129,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) if (!item || !bid || !etime) return; //check for cheaters - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); @@ -206,8 +206,8 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data) if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", - GetPlayerName(),GetAccountId(),it->GetTemplate()->Name1.c_str(),it->GetEntry(),count); + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)", + GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), count); } pl->ModifyMoney(-int32(deposit)); @@ -334,7 +334,7 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket & recv_data) auction->bid = price; GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID, price); - trans->PAppend("UPDATE auctionhouse SET buyguid = '%u',lastbid = '%u' WHERE id = '%u'", auction->bidder, auction->bid, auction->Id); + trans->PAppend("UPDATE auctionhouse SET buyguid = '%u', lastbid = '%u' WHERE id = '%u'", auction->bidder, auction->bid, auction->Id); SendAuctionCommandResult(auction->Id, AUCTION_PLACE_BID, AUCTION_OK, 0); } @@ -379,7 +379,7 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket & recv_data) recv_data >> auctionId; //sLog->outDebug("Cancel AUCTION AuctionID: %u", auctionId); - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer,UNIT_NPC_FLAG_AUCTIONEER); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(auctioneer, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer))); @@ -460,11 +460,11 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) recv_data >> outbiddedCount; if (recv_data.size() != (16 + outbiddedCount * 4)) { - sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(),(16 + outbiddedCount * 4)); + sLog->outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount, (unsigned long)recv_data.size(), (16 + outbiddedCount * 4)); outbiddedCount = 0; } - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); @@ -495,7 +495,7 @@ void WorldSession::HandleAuctionListBidderItems(WorldPacket & recv_data) } } - auctionHouse->BuildListBidderItems(data,pl,count,totalcount); + auctionHouse->BuildListBidderItems(data, pl, count, totalcount); data.put<uint32>(0, count); // add count to placeholder data << totalcount; data << (uint32)300; //unk 2.3.0 @@ -511,7 +511,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) recv_data >> guid; recv_data >> listfrom; // not used in fact (this list not have page control in client) - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); @@ -530,7 +530,7 @@ void WorldSession::HandleAuctionListOwnerItems(WorldPacket & recv_data) uint32 count = 0; uint32 totalcount = 0; - auctionHouse->BuildListOwnerItems(data,_player,count,totalcount); + auctionHouse->BuildListOwnerItems(data, _player, count, totalcount); data.put<uint32>(0, count); data << (uint32) totalcount; data << (uint32) 0; @@ -564,7 +564,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) recv_data.read_skip<uint8>(); } - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_AUCTIONEER); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_AUCTIONEER); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); @@ -578,7 +578,7 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(pCreature->getFaction()); //sLog->outDebug("Auctionhouse search (GUID: %u TypeId: %u)", , list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u", - // GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable); + // GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable); WorldPacket data(SMSG_AUCTION_LIST_RESULT, (4+4+4)); uint32 count = 0; @@ -587,15 +587,15 @@ void WorldSession::HandleAuctionListItems(WorldPacket & recv_data) // converting string that we try to find to lower case std::wstring wsearchedname; - if (!Utf8toWStr(searchedname,wsearchedname)) + if (!Utf8toWStr(searchedname, wsearchedname)) return; wstrToLower(wsearchedname); - auctionHouse->BuildListAuctionItems(data,_player, + auctionHouse->BuildListAuctionItems(data, _player, wsearchedname, listfrom, levelmin, levelmax, usable, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, - count,totalcount); + count, totalcount); data.put<uint32>(0, count); data << (uint32) totalcount; diff --git a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp index 51ca4d9d959..89ce740a228 100755 --- a/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/BattleGroundHandler.cpp @@ -39,7 +39,7 @@ void WorldSession::HandleBattlemasterHelloOpcode(WorldPacket & recv_data) { uint64 guid; recv_data >> guid; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Recvd CMSG_BATTLEMASTER_HELLO Message from (GUID: %u TypeId:%u)", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) @@ -86,7 +86,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (!sBattlemasterListStore.LookupEntry(bgTypeId_)) { - sLog->outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u",bgTypeId_,_player->GetGUIDLow()); + sLog->outError("Battleground: invalid bgtype (%u) received. possible cheater? player guid %u", bgTypeId_, _player->GetGUIDLow()); return; } @@ -119,7 +119,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) return; // expected bracket entry - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); if (!bracketEntry) return; @@ -189,7 +189,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, ginfo->ArenaType); SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } else { @@ -208,7 +208,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) if (err > 0) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: the following players are joining as group:"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: the following players are joining as group:"); ginfo = bgQueue.AddGroup(_player, grp, bgTypeId, bracketEntry, 0, false, isPremade, 0, 0); avgTime = bgQueue.GetAverageQueueWaitTime(ginfo, bracketEntry->GetBracketId()); } @@ -235,9 +235,9 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket & recv_data) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName()); } - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: group end"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: group end"); } sBattlegroundMgr->ScheduleQueueUpdate(0, 0, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); @@ -404,7 +404,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) } // expected bracket entry - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); if (!bracketEntry) return; @@ -419,7 +419,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data2, ERR_GROUP_JOIN_BATTLEGROUND_DESERTERS); _player->GetSession()->SendPacket(&data2); action = 0; - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUIDLow()); } //if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue if (_player->getLevel() > bg->GetMaxLevel()) @@ -469,8 +469,8 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) // bg->HandleBeforeTeleportToBattleground(_player); sBattlegroundMgr->SendToBattleground(_player, ginfo.IsInvitedToBGInstanceGUID, bgTypeId); // add only in HandleMoveWorldPortAck() - // bg->AddPlayer(_player,team); - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); + // bg->AddPlayer(_player, team); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) joined battle for bg %u, bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetInstanceID(), bg->GetTypeID(), bgQueueTypeId); break; case 0: // leave queue // if player leaves rated arena match before match start, it is counted as he played but he lost @@ -479,7 +479,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) ArenaTeam * at = sObjectMgr->GetArenaTeamById(ginfo.Team); if (at) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "UPDATING memberLost's personal arena rating for %u by opponents rating: %u, because he has left queue!", GUID_LOPART(_player->GetGUID()), ginfo.OpponentsTeamRating); at->MemberLost(_player, ginfo.OpponentsMatchmakerRating); at->SaveToDB(); } @@ -491,7 +491,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket &recv_data) if (!ginfo.ArenaType) sBattlegroundMgr->ScheduleQueueUpdate(ginfo.ArenaMatchmakerRating, ginfo.ArenaType, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player %s (%u) left queue for bgtype %u, queue type %u.", _player->GetName(), _player->GetGUIDLow(), bg->GetTypeID(), bgQueueTypeId); break; default: sLog->outError("Battleground port: unknown action %u", action); @@ -569,7 +569,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket & /*recv_data*/) continue; // expected bracket entry - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); if (!bracketEntry) continue; @@ -681,7 +681,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) BattlegroundTypeId bgTypeId = bg->GetTypeID(); BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, arenatype); - PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(),_player->getLevel()); + PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel()); if (!bracketEntry) return; @@ -736,10 +736,10 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) if (err > 0) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: arena join as group start"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena join as group start"); if (isRated) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u",_player->GetArenaTeamId(arenaslot),_player->GetName(),matchmakerRating,arenatype); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: arena team id %u, leader %s queued with matchmaker rating %u for type %u", _player->GetArenaTeamId(arenaslot), _player->GetName(), matchmakerRating, arenatype); bg->SetRated(true); } else @@ -772,7 +772,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) member->GetSession()->SendPacket(&data); sBattlegroundMgr->BuildGroupJoinedBattlegroundPacket(&data, err); member->GetSession()->SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,member->GetGUIDLow(), member->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena as group bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, member->GetGUIDLow(), member->GetName()); } } else @@ -785,7 +785,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket & recv_data) // send status packet (in queue) sBattlegroundMgr->BuildBattlegroundStatusPacket(&data, bg, queueSlot, STATUS_WAIT_QUEUE, avgTime, 0, arenatype); SendPacket(&data); - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s",bgQueueTypeId,bgTypeId,_player->GetGUIDLow(), _player->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "Battleground: player joined queue for arena, skirmish, bg queue type %u bg type %u: GUID %u, NAME %s", bgQueueTypeId, bgTypeId, _player->GetGUIDLow(), _player->GetName()); } sBattlegroundMgr->ScheduleQueueUpdate(matchmakerRating, arenatype, bgQueueTypeId, bgTypeId, bracketEntry->GetBracketId()); } @@ -798,11 +798,11 @@ void WorldSession::HandleReportPvPAFK(WorldPacket & recv_data) if (!reportedPlayer) { - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"WorldSession::HandleReportPvPAFK: player not found"); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: player not found"); return; } - sLog->outDebug(LOG_FILTER_BATTLEGROUND,"WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName(), reportedPlayer->GetName()); + sLog->outDebug(LOG_FILTER_BATTLEGROUND, "WorldSession::HandleReportPvPAFK: %s reported %s", _player->GetName(), reportedPlayer->GetName()); reportedPlayer->ReportedAfkBy(_player); } diff --git a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp index 6553f2b3f93..1dd87a39986 100755 --- a/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CalendarHandler.cpp @@ -31,7 +31,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket & /*recv_data*/) time_t cur_time = time(NULL); - WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR,4+4*0+4+4*0+4+4); + WorldPacket data(SMSG_CALENDAR_SEND_CALENDAR, 4+4*0+4+4*0+4+4); data << uint32(0); // invite count /* @@ -178,7 +178,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data) // recv_data >> (uint32)count; // if (count) // { - // uint8 unk12,unk13; + // uint8 unk12, unk13; // uint64 guid; // for (int i=0; i<count; i++) // { diff --git a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp index f117d3306fe..145a9e88443 100755 --- a/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CharacterHandler.cpp @@ -207,7 +207,7 @@ void WorldSession::HandleCharEnum(QueryResult result) do { uint32 guidlow = (*result)[0].GetUInt32(); - sLog->outDetail("Loading char guid %u from account %u.",guidlow,GetAccountId()); + sLog->outDetail("Loading char guid %u from account %u.", guidlow, GetAccountId()); if (Player::BuildEnumData(result, &data)) { _allowedCharsToLogin.insert(guidlow); @@ -263,7 +263,7 @@ void WorldSession::HandleCharEnumOpcode(WorldPacket & /*recv_data*/) void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) { std::string name; - uint8 race_,class_; + uint8 race_, class_; recv_data >> name; @@ -321,7 +321,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) if (raceEntry->expansion > Expansion()) { data << (uint8)CHAR_CREATE_EXPANSION; - sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)",Expansion(),GetAccountId(),raceEntry->expansion,race_); + sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u race (%u)", Expansion(), GetAccountId(), raceEntry->expansion, race_); SendPacket(&data); return; } @@ -330,7 +330,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) if (classEntry->expansion > Expansion()) { data << (uint8)CHAR_CREATE_EXPANSION_CLASS; - sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)",Expansion(),GetAccountId(),classEntry->expansion,class_); + sLog->outError("Expansion %u account:[%d] tried to Create character with expansion %u class (%u)", Expansion(), GetAccountId(), classEntry->expansion, class_); SendPacket(&data); return; } @@ -359,12 +359,12 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) { data << (uint8)CHAR_NAME_NO_NAME; SendPacket(&data); - sLog->outError("Account:[%d] but tried to Create character with empty [name] ",GetAccountId()); + sLog->outError("Account:[%d] but tried to Create character with empty [name] ", GetAccountId()); return; } // check name limitations - uint8 res = ObjectMgr::CheckPlayerName(name,true); + uint8 res = ObjectMgr::CheckPlayerName(name, true); if (res != CHAR_NAME_SUCCESS) { data << uint8(res); @@ -443,7 +443,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data) if (!AllowTwoSideAccounts || skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT) { - QueryResult result2 = CharacterDatabase.PQuery("SELECT level,race,class FROM characters WHERE account = '%u' %s", + QueryResult result2 = CharacterDatabase.PQuery("SELECT level, race, class FROM characters WHERE account = '%u' %s", GetAccountId(), (skipCinematics == 1 || class_ == CLASS_DEATH_KNIGHT) ? "" : "LIMIT 1"); if (result2) { @@ -614,7 +614,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) return; } - QueryResult result = CharacterDatabase.PQuery("SELECT account,name FROM characters WHERE guid='%u'", GUID_LOPART(guid)); + QueryResult result = CharacterDatabase.PQuery("SELECT account, name FROM characters WHERE guid='%u'", GUID_LOPART(guid)); if (result) { Field *fields = result->Fetch(); @@ -627,15 +627,15 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data) return; std::string IP_str = GetRemoteAddress(); - sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid)); - sLog->outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)",GetAccountId(),IP_str.c_str(),name.c_str(),GUID_LOPART(guid)); + sLog->outDetail("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); + sLog->outChar("Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid)); sScriptMgr->OnPlayerDelete(guid); if (sLog->IsOutCharDump()) // optimize GetPlayerDump call { std::string dump; if (PlayerDumpWriter().GetDump(GUID_LOPART(guid), dump)) - sLog->outCharDump(dump.c_str(),GetAccountId(),GUID_LOPART(guid),name.c_str()); + sLog->outCharDump(dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str()); } Player::DeleteFromDB(guid, GetAccountId()); @@ -649,7 +649,7 @@ void WorldSession::HandlePlayerLoginOpcode(WorldPacket & recv_data) { if (PlayerLoading() || GetPlayer() != NULL) { - sLog->outError("Player tryes to login again, AccountId = %d",GetAccountId()); + sLog->outError("Player tryes to login again, AccountId = %d", GetAccountId()); return; } @@ -729,11 +729,11 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) std::string::size_type pos, nextpos; pos = 0; - while ((nextpos= str_motd.find('@',pos)) != std::string::npos) + while ((nextpos= str_motd.find('@', pos)) != std::string::npos) { if (nextpos != pos) { - data << str_motd.substr(pos,nextpos-pos); + data << str_motd.substr(pos, nextpos-pos); ++linecount; } pos = nextpos+1; @@ -757,7 +757,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) sLog->outStaticDebug("WORLD: Sent server info"); } - //QueryResult *result = CharacterDatabase.PQuery("SELECT guildid,rank FROM guild_member WHERE guid = '%u'",pCurrChar->GetGUIDLow()); + //QueryResult *result = CharacterDatabase.PQuery("SELECT guildid, rank FROM guild_member WHERE guid = '%u'", pCurrChar->GetGUIDLow()); if (PreparedQueryResult resultGuild = holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOADGUILD)) { Field* fields = resultGuild->Fetch(); @@ -777,7 +777,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) else { // remove wrong guild data - sLog->outError("Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.",pCurrChar->GetName(),pCurrChar->GetGUIDLow(),pCurrChar->GetGuildId()); + sLog->outError("Player %s (GUID: %u) marked as member of not existing guild (id: %u), removing guild membership for player.", pCurrChar->GetName(), pCurrChar->GetGUIDLow(), pCurrChar->GetGuildId()); pCurrChar->SetInGuild(0); } } @@ -817,7 +817,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) } sObjectAccessor->AddObject(pCurrChar); - //sLog->outDebug("Player %s added to Map.",pCurrChar->GetName()); + //sLog->outDebug("Player %s added to Map.", pCurrChar->GetName()); pCurrChar->SendInitialPacketsAfterAddToMap(); @@ -860,7 +860,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) pCurrChar->LoadPet(); // Set FFA PvP for non GM in non-rest mode - if (sWorld->IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_RESTING)) + if (sWorld->IsFFAPvPRealm() && !pCurrChar->isGameMaster() && !pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING)) pCurrChar->SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP); if (pCurrChar->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP)) @@ -885,7 +885,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) // show time before shutdown if shutdown planned. if (sWorld->IsShutdowning()) - sWorld->ShutdownMsg(true,pCurrChar); + sWorld->ShutdownMsg(true, pCurrChar); if (sWorld->getBoolConfig(CONFIG_ALL_TAXI_PATHS)) pCurrChar->SetTaxiCheater(true); @@ -895,7 +895,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder * holder) std::string IP_str = GetRemoteAddress(); sLog->outChar("Account: %d (IP: %s) Login Character:[%s] (GUID: %u)", - GetAccountId(),IP_str.c_str(),pCurrChar->GetName() ,pCurrChar->GetGUIDLow()); + GetAccountId(), IP_str.c_str(), pCurrChar->GetName() , pCurrChar->GetGUIDLow()); if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STAT_STUNNED)) pCurrChar->SetStandState(UNIT_STAND_STATE_STAND); @@ -916,7 +916,7 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket & recv_data) recv_data >> repListID; recv_data >> flag; - GetPlayer()->GetReputationMgr().SetAtWar(repListID,flag); + GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag); } //I think this function is never used :/ I dunno, but i guess this opcode not exists @@ -1027,7 +1027,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data) return; } - uint8 res = ObjectMgr::CheckPlayerName(newname,true); + uint8 res = ObjectMgr::CheckPlayerName(newname, true); if (res != CHAR_NAME_SUCCESS) { WorldPacket data(SMSG_CHAR_RENAME, 1); @@ -1162,7 +1162,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data) SQLTransaction trans = CharacterDatabase.BeginTransaction(); trans->PAppend("DELETE FROM character_declinedname WHERE guid = '%u'", GUID_LOPART(guid)); - trans->PAppend("INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u','%s','%s','%s','%s','%s')", + trans->PAppend("INSERT INTO character_declinedname (guid, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u', '%s', '%s', '%s', '%s', '%s')", GUID_LOPART(guid), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str()); CharacterDatabase.CommitTransaction(trans); @@ -1197,7 +1197,7 @@ void WorldSession::HandleAlterAppearance(WorldPacket & recv_data) uint32 Cost = _player->GetBarberShopCost(bs_hair->hair_id, Color, bs_facialHair->hair_id, bs_skinColor); // 0 - ok - // 1,3 - not enough money + // 1, 3 - not enough money // 2 - you have to seat on barber chair if (!_player->HasEnoughMoney(Cost)) { @@ -1289,7 +1289,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data) return; } - uint8 res = ObjectMgr::CheckPlayerName(newname,true); + uint8 res = ObjectMgr::CheckPlayerName(newname, true); if (res != CHAR_NAME_SUCCESS) { WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1); @@ -1509,7 +1509,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) return; } - uint8 res = ObjectMgr::CheckPlayerName(newname,true); + uint8 res = ObjectMgr::CheckPlayerName(newname, true); if (res != CHAR_NAME_SUCCESS) { WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1); @@ -1654,7 +1654,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) } // Delete all current quests - trans->PAppend("DELETE FROM `character_queststatus` WHERE guid ='%u'",GUID_LOPART(guid)); + trans->PAppend("DELETE FROM `character_queststatus` WHERE guid ='%u'", GUID_LOPART(guid)); // Delete record of the faction old completed quests { @@ -1669,7 +1669,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (requiredRaces & RACEMASK_ALLIANCE) { quests << uint32(qinfo->GetQuestId()); - quests << ","; + quests << ", "; } } else // if (team == BG_TEAM_HORDE) @@ -1677,7 +1677,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data) if (requiredRaces & RACEMASK_HORDE) { quests << uint32(qinfo->GetQuestId()); - quests << ","; + quests << ", "; } } } diff --git a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp index ebaef36fe30..e4db813fe62 100755 --- a/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ChatHandler.cpp @@ -163,7 +163,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data) if (!_player->CanSpeak()) { std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); - SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str()); + SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); return; } @@ -519,7 +519,7 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket & recv_data) if (!GetPlayer()->CanSpeak()) { std::string timeStr = secsToTimeString(m_muteTime - time(NULL)); - SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING),timeStr.c_str()); + SendNotification(GetTrinityString(LANG_WAIT_BEFORE_SPEAKING), timeStr.c_str()); return; } diff --git a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp b/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp index 6ef0671b679..f2840d4c73f 100755 --- a/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/CombatHandler.cpp @@ -36,9 +36,9 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data) if (!pEnemy) { if (!IS_UNIT_GUID(guid)) - sLog->outError("WORLD: Object %u (TypeID: %u) isn't player, pet or creature",GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid))); + sLog->outError("WORLD: Object %u (TypeID: %u) isn't player, pet or creature", GUID_LOPART(guid), GuidHigh2TypeId(GUID_HIPART(guid))); else - sLog->outError("WORLD: Enemy %s %u not found",GetLogNameForGuid(guid),GUID_LOPART(guid)); + sLog->outError("WORLD: Enemy %s %u not found", GetLogNameForGuid(guid), GUID_LOPART(guid)); // stop attack state at client SendAttackStop(NULL); @@ -52,7 +52,7 @@ void WorldSession::HandleAttackSwingOpcode(WorldPacket & recv_data) return; } - _player->Attack(pEnemy,true); + _player->Attack(pEnemy, true); } void WorldSession::HandleAttackStopOpcode(WorldPacket & /*recv_data*/) @@ -69,7 +69,7 @@ void WorldSession::HandleSetSheathedOpcode(WorldPacket & recv_data) if (sheathed >= MAX_SHEATH_STATE) { - sLog->outError("Unknown sheath state %u ??",sheathed); + sLog->outError("Unknown sheath state %u ??", sheathed); return; } diff --git a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp index 9703c3716a9..ded520d84f0 100755 --- a/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/DuelHandler.cpp @@ -42,8 +42,8 @@ void WorldSession::HandleDuelAcceptedOpcode(WorldPacket& recvPacket) return; //sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: Received CMSG_DUEL_ACCEPTED"); - sLog->outStaticDebug("Player 1 is: %u (%s)", pl->GetGUIDLow(),pl->GetName()); - sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(),plTarget->GetName()); + sLog->outStaticDebug("Player 1 is: %u (%s)", pl->GetGUIDLow(), pl->GetName()); + sLog->outStaticDebug("Player 2 is: %u (%s)", plTarget->GetGUIDLow(), plTarget->GetName()); time_t now = time(NULL); pl->duel->startTimer = now; diff --git a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp index 6feda854699..c66ea546cb7 100755 --- a/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/GroupHandler.cpp @@ -930,7 +930,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) data << (uint8) 1; } } - data.put<uint64>(maskPos,auramask); // GROUP_UPDATE_FLAG_AURAS + data.put<uint64>(maskPos, auramask); // GROUP_UPDATE_FLAG_AURAS if (pet) { @@ -956,7 +956,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket &recv_data) data << (uint8) 1; } } - data.put<uint64>(petMaskPos,petauramask); // GROUP_UPDATE_FLAG_PET_AURAS + data.put<uint64>(petMaskPos, petauramask); // GROUP_UPDATE_FLAG_PET_AURAS } else { diff --git a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp index 52177bd0c24..db2c76b422a 100755 --- a/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/ItemHandler.cpp @@ -493,7 +493,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket & recv_data) if (!itemguid) return; - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleSellItemOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); @@ -604,7 +604,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data) recv_data >> vendorguid >> slot; - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBuybackItem - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); @@ -683,7 +683,7 @@ void WorldSession::HandleBuyItemInSlotOpcode(WorldPacket & recv_data) if (bag == NULL_BAG) return; - GetPlayer()->BuyItemFromVendorSlot(vendorguid,slot,item,count,bag,bagslot); + GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, bag, bagslot); } void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) @@ -701,7 +701,7 @@ void WorldSession::HandleBuyItemOpcode(WorldPacket & recv_data) else return; // cheating - GetPlayer()->BuyItemFromVendorSlot(vendorguid,slot,item,count,NULL_BAG,NULL_SLOT); + GetPlayer()->BuyItemFromVendorSlot(vendorguid, slot, item, count, NULL_BAG, NULL_SLOT); } void WorldSession::HandleListInventoryOpcode(WorldPacket & recv_data) @@ -722,7 +722,7 @@ void WorldSession::SendListInventory(uint64 vendorguid) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_LIST_INVENTORY"); - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid,UNIT_NPC_FLAG_VENDOR); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendListInventory - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(vendorguid))); @@ -993,7 +993,7 @@ void WorldSession::HandleSetAmmoOpcode(WorldPacket & recv_data) GetPlayer()->SetAmmo(item); } -void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster,uint32 ItemID,uint32 SpellID) +void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID) { WorldPacket data(SMSG_ENCHANTMENTLOG, (8+8+4+4+1)); // last check 2.0.10 data << uint64(Target); @@ -1004,7 +1004,7 @@ void WorldSession::SendEnchantmentLog(uint64 Target, uint64 Caster,uint32 ItemID SendPacket(&data); } -void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid,uint32 slot,uint32 Duration) +void WorldSession::SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, uint32 slot, uint32 Duration) { // last check 2.0.10 WorldPacket data(SMSG_ITEM_ENCHANT_TIME_UPDATE, (8+4+4+8)); @@ -1315,21 +1315,21 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data) { if (GemEnchants[i]) { - itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i],0,0); + itemTarget->SetEnchantment(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i), GemEnchants[i], 0, 0); if (Item* guidItem = _player->GetItemByGuid(gem_guids[i])) _player->DestroyItem(guidItem->GetBagSlot(), guidItem->GetSlot(), true); } } for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot) - _player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true); + _player->ApplyEnchantment(itemTarget, EnchantmentSlot(enchant_slot), true); bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state if (SocketBonusActivated ^ SocketBonusToBeActivated) //if there was a change... { - _player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT,false); + _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, false); itemTarget->SetEnchantment(BONUS_ENCHANTMENT_SLOT, (SocketBonusToBeActivated ? itemTarget->GetTemplate()->socketBonus : 0), 0, 0); - _player->ApplyEnchantment(itemTarget,BONUS_ENCHANTMENT_SLOT,true); + _player->ApplyEnchantment(itemTarget, BONUS_ENCHANTMENT_SLOT, true); //it is not displayed, client has an inbuilt system to determine if the bonus is activated } @@ -1347,7 +1347,7 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) recv_data >> eslot; // apply only to equipped item - if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0,eslot)) + if (!Player::IsEquipmentPos(INVENTORY_SLOT_BAG_0, eslot)) return; Item* item = GetPlayer()->GetItemByPos(INVENTORY_SLOT_BAG_0, eslot); @@ -1358,7 +1358,7 @@ void WorldSession::HandleCancelTempEnchantmentOpcode(WorldPacket& recv_data) if (!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT)) return; - GetPlayer()->ApplyEnchantment(item,TEMP_ENCHANTMENT_SLOT,false); + GetPlayer()->ApplyEnchantment(item, TEMP_ENCHANTMENT_SLOT, false); item->ClearEnchantment(TEMP_ENCHANTMENT_SLOT); } diff --git a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp index 748b9a08589..c19045f55ce 100755 --- a/src/server/game/Server/Protocol/Handlers/LootHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/LootHandler.cpp @@ -45,7 +45,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) GameObject *go = player->GetMap()->GetGameObject(lguid); // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO - if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE))) + if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player, INTERACTION_DISTANCE))) { player->SendLootRelease(lguid); return; @@ -82,7 +82,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket & recv_data) bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed); - if (!ok_loot || !pCreature->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) + if (!ok_loot || !pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) { player->SendLootRelease(lguid); return; @@ -112,7 +112,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) GameObject *pGameObject = GetPlayer()->GetMap()->GetGameObject(guid); // not check distance for GO in case owned GO (fishing bobber case, for example) - if (pGameObject && ((pGameObject->GetOwnerGUID() == _player->GetGUID() || pGameObject->IsWithinDistInMap(_player,INTERACTION_DISTANCE)))) + if (pGameObject && ((pGameObject->GetOwnerGUID() == _player->GetGUID() || pGameObject->IsWithinDistInMap(_player, INTERACTION_DISTANCE)))) pLoot = &pGameObject->loot; break; @@ -121,7 +121,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) { Corpse *bones = ObjectAccessor::GetCorpse(*GetPlayer(), guid); - if (bones && bones->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) + if (bones && bones->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) pLoot = &bones->loot; break; @@ -138,7 +138,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed); - if (ok_loot && pCreature->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) + if (ok_loot && pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) pLoot = &pCreature->loot ; break; @@ -159,7 +159,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPacket & /*recv_data*/) Player* playerGroup = itr->getSource(); if (!playerGroup) continue; - if (player->IsWithinDistInMap(playerGroup,sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE),false)) + if (player->IsWithinDistInMap(playerGroup, sWorld->getFloatConfig(CONFIG_GROUP_XP_DISTANCE), false)) playersNear.push_back(playerGroup); } @@ -233,7 +233,7 @@ void WorldSession::DoLootRelease(uint64 lguid) GameObject *go = GetPlayer()->GetMap()->GetGameObject(lguid); // not check distance for GO in case owned GO (fishing bobber case, for example) or Fishing hole GO - if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player,INTERACTION_DISTANCE))) + if (!go || ((go->GetOwnerGUID() != _player->GetGUID() && go->GetGoType() != GAMEOBJECT_TYPE_FISHINGHOLE) && !go->IsWithinDistInMap(_player, INTERACTION_DISTANCE))) return; loot = &go->loot; @@ -272,7 +272,7 @@ void WorldSession::DoLootRelease(uint64 lguid) if (lockInfo) ReqValue = lockInfo->Skill[0]; float skill = float(player->GetSkillValue(SKILL_MINING))/(ReqValue+25); - double chance = pow(0.8*chance_rate,4*(1/double(max_amount))*double(uses)); + double chance = pow(0.8*chance_rate, 4*(1/double(max_amount))*double(uses)); if (roll_chance_f((float)(100*chance+skill))) { go->SetLootState(GO_READY); @@ -327,7 +327,7 @@ void WorldSession::DoLootRelease(uint64 lguid) else if (IS_CORPSE_GUID(lguid)) // ONLY remove insignia at BG { Corpse *corpse = ObjectAccessor::GetCorpse(*player, lguid); - if (!corpse || !corpse->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) + if (!corpse || !corpse->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; loot = &corpse->loot; @@ -362,7 +362,7 @@ void WorldSession::DoLootRelease(uint64 lguid) } else // FIXME: item must not be deleted in case not fully looted state. But this pre-request implement loot saving in DB at item save. Or cheating possible. - player->DestroyItem(pItem->GetBagSlot(),pItem->GetSlot(), true); + player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); return; // item can be looted only single player } else @@ -370,7 +370,7 @@ void WorldSession::DoLootRelease(uint64 lguid) Creature* pCreature = GetPlayer()->GetMap()->GetCreature(lguid); bool ok_loot = pCreature && pCreature->isAlive() == (player->getClass() == CLASS_ROGUE && pCreature->lootForPickPocketed); - if (!ok_loot || !pCreature->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) + if (!ok_loot || !pCreature->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; loot = &pCreature->loot; @@ -455,7 +455,7 @@ void WorldSession::HandleLootMasterGiveOpcode(WorldPacket & recv_data) if (slotid > pLoot->items.size()) { - sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)",GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); + sLog->outDebug(LOG_FILTER_LOOT, "MasterLootItem: Player %s might be using a hack! (slot %d, size %lu)", GetPlayer()->GetName(), slotid, (unsigned long)pLoot->items.size()); return; } diff --git a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp index b94d7e43c5d..a6bbb182fdf 100755 --- a/src/server/game/Server/Protocol/Handlers/MailHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MailHandler.cpp @@ -272,7 +272,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data) if (money > 0 && GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(GetAccountId(),"GM %s (Account: %u) mail money: %u to player: %s (Account: %u)", + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)", GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account); } } @@ -456,11 +456,11 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) // can be calculated early sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid); - if (!sObjectMgr->GetPlayerNameByGUID(sender_guid,sender_name)) + if (!sObjectMgr->GetPlayerNameByGUID(sender_guid, sender_name)) sender_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN); } - sLog->outCommand(GetAccountId(),"GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)", - GetPlayerName(),GetAccountId(),it->GetTemplate()->Name1.c_str(), it->GetEntry(),it->GetCount(),m->COD,sender_name.c_str(),sender_accId); + sLog->outCommand(GetAccountId(), "GM %s (Account: %u) receive mail item: %s (Entry: %u Count: %u) and send COD money: %u to player: %s (Account: %u)", + GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), it->GetCount(), m->COD, sender_name.c_str(), sender_accId); } else if (!receive) sender_accId = sObjectMgr->GetPlayerAccountIdByGUID(sender_guid); @@ -481,7 +481,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data) pl->RemoveMItem(it->GetGUIDLow()); uint32 count = it->GetCount(); // save counts before store and possible merge with deleting - pl->MoveItemToInventory(dest,it,true); + pl->MoveItemToInventory(dest, it, true); pl->SaveInventoryAndGoldToDB(trans); pl->_SaveMail(trans); @@ -694,7 +694,7 @@ void WorldSession::HandleMailCreateTextItem(WorldPacket & recv_data) bodyItem->SetUInt32Value(ITEM_FIELD_CREATOR, m->sender); bodyItem->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_MAIL_TEXT_MASK); - sLog->outDetail("HandleMailCreateTextItem mailid=%u",mailId); + sLog->outDetail("HandleMailCreateTextItem mailid=%u", mailId); ItemPosCountVec dest; uint8 msg = _player->CanStoreItem(NULL_BAG, NULL_SLOT, dest, bodyItem, false); diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index 34f8c1046d3..ae51b2335ed 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -71,7 +71,7 @@ void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data) } //this is spirit release confirm? - GetPlayer()->RemovePet(NULL,PET_SAVE_NOT_IN_SLOT, true); + GetPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); GetPlayer()->BuildPlayerRepop(); GetPlayer()->RepopAtGraveyard(); } @@ -205,7 +205,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) std::string temp; recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)? - if (!Utf8toWStr(temp,str[i])) + if (!Utf8toWStr(temp, str[i])) continue; wstrToLower(str[i]); @@ -292,7 +292,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) std::string pname = itr->second->GetName(); std::wstring wpname; - if (!Utf8toWStr(pname,wpname)) + if (!Utf8toWStr(pname, wpname)) continue; wstrToLower(wpname); @@ -301,7 +301,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data) std::string gname = sObjectMgr->GetGuildNameById(itr->second->GetGuildId()); std::wstring wgname; - if (!Utf8toWStr(gname,wgname)) + if (!Utf8toWStr(gname, wgname)) continue; wstrToLower(wgname); @@ -483,9 +483,9 @@ void WorldSession::HandleZoneUpdateOpcode(WorldPacket & recv_data) // use server size data uint32 newzone, newarea; - GetPlayer()->GetZoneAndAreaId(newzone,newarea); - GetPlayer()->UpdateZone(newzone,newarea); - //GetPlayer()->SendInitWorldStates(true,newZone); + GetPlayer()->GetZoneAndAreaId(newzone, newarea); + GetPlayer()->UpdateZone(newzone, newarea); + //GetPlayer()->SendInitWorldStates(true, newZone); } void WorldSession::HandleSetTargetOpcode(WorldPacket & recv_data) @@ -729,7 +729,7 @@ void WorldSession::HandleBugOpcode(WorldPacket & recv_data) CharacterDatabase.escape_string(type); CharacterDatabase.escape_string(content); - CharacterDatabase.PExecute ("INSERT INTO bugreport (type,content) VALUES('%s', '%s')", type.c_str(), content.c_str()); + CharacterDatabase.PExecute ("INSERT INTO bugreport (type, content) VALUES('%s', '%s')", type.c_str(), content.c_str()); } void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data) @@ -817,18 +817,18 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) uint32 Trigger_ID; recv_data >> Trigger_ID; - sLog->outDebug(LOG_FILTER_NETWORKIO, "Trigger ID:%u",Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Trigger ID:%u", Trigger_ID); if (GetPlayer()->isInFlight()) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore Area Trigger ID:%u", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), Trigger_ID); return; } AreaTriggerEntry const* atEntry = sAreaTriggerStore.LookupEntry(Trigger_ID); if (!atEntry) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow(), Trigger_ID); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) send unknown (by DBC) Area Trigger ID:%u", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), Trigger_ID); return; } @@ -846,7 +846,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if (atEntry->radius > 0) { // if we have radius check it - float dist = pl->GetDistance(atEntry->x,atEntry->y,atEntry->z); + float dist = pl->GetDistance(atEntry->x, atEntry->y, atEntry->z); if (dist > atEntry->radius + delta) { sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) too far (radius: %f distance: %f), ignore Area Trigger ID: %u", @@ -946,7 +946,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data) if (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->isLFGGroup() && GetPlayer()->GetMap()->IsDungeon() && at->target_mapId != GetPlayer()->GetMapId()) GetPlayer()->TeleportToBGEntryPoint(); else - GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT); + GetPlayer()->TeleportTo(at->target_mapId, at->target_X, at->target_Y, at->target_Z, at->target_Orientation, TELE_TO_NOT_LEAVE_TRANSPORT); } void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) @@ -1183,7 +1183,7 @@ void WorldSession::HandleSetActionBarToggles(WorldPacket& recv_data) if (!GetPlayer()) // ignore until not logged (check needed because STATUS_AUTHED) { if (ActionBar != 0) - sLog->outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored",uint32(ActionBar)); + sLog->outError("WorldSession::HandleSetActionBarToggles in not logged state with value: %u, ignored", uint32(ActionBar)); return; } @@ -1196,7 +1196,7 @@ void WorldSession::HandleWardenDataOpcode(WorldPacket& recv_data) /* uint8 tmp; recv_data >> tmp; - sLog->outDebug("Received opcode CMSG_WARDEN_DATA, not resolve.uint8 = %u",tmp); + sLog->outDebug("Received opcode CMSG_WARDEN_DATA, not resolve.uint8 = %u", tmp); */ } @@ -1290,14 +1290,14 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data) //sLog->outDebug("Received opcode CMSG_WORLD_TELEPORT"); if (GetPlayer()->isInFlight()) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.",GetPlayer()->GetName(),GetPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "Player '%s' (GUID: %u) in flight, ignore worldport command.", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow()); return; } sLog->outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation); if (GetSecurity() >= SEC_ADMINISTRATOR) - GetPlayer()->TeleportTo(mapid,PositionX,PositionY,PositionZ,Orientation); + GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation); else SendNotification(LANG_YOU_NOT_HAVE_PERMISSION); sLog->outDebug(LOG_FILTER_NETWORKIO, "Received worldport command from player %s", GetPlayer()->GetName()); @@ -1331,7 +1331,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data) uint32 accid = plr->GetSession()->GetAccountId(); - QueryResult result = LoginDatabase.PQuery("SELECT username,email,last_ip FROM account WHERE id=%u", accid); + QueryResult result = LoginDatabase.PQuery("SELECT username, email, last_ip FROM account WHERE id=%u", accid); if (!result) { SendNotification(LANG_ACCOUNT_FOR_PLAYER_NOT_FOUND, charname.c_str()); @@ -1496,7 +1496,7 @@ void WorldSession::HandleResetInstancesOpcode(WorldPacket & /*recv_data*/) if (pGroup->IsLeader(_player->GetGUID())) { pGroup->ResetInstances(INSTANCE_RESET_ALL, false, _player); - pGroup->ResetInstances(INSTANCE_RESET_ALL, true,_player); + pGroup->ResetInstances(INSTANCE_RESET_ALL, true, _player); } } else diff --git a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp index 9d877441f94..30b1dc78280 100755 --- a/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MovementHandler.cpp @@ -141,7 +141,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() { if (mEntry->IsDungeon()) { - GetPlayer()->ResurrectPlayer(0.5f,false); + GetPlayer()->ResurrectPlayer(0.5f, false); GetPlayer()->SpawnCorpseBones(); } } @@ -178,7 +178,7 @@ void WorldSession::HandleMoveWorldportAckOpcode() GetPlayer()->CastSpell(GetPlayer(), 2479, true); // in friendly area - else if (GetPlayer()->IsPvP() && !GetPlayer()->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_IN_PVP)) + else if (GetPlayer()->IsPvP() && !GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP)) GetPlayer()->UpdatePvP(false, false); // resummon pet @@ -215,7 +215,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) WorldLocation const& dest = plMover->GetTeleportDest(); - plMover->SetPosition(dest,true); + plMover->SetPosition(dest, true); uint32 newzone, newarea; plMover->GetZoneAndAreaId(newzone, newarea); @@ -229,7 +229,7 @@ void WorldSession::HandleMoveTeleportAck(WorldPacket& recv_data) plMover->CastSpell(plMover, 2479, true); // in friendly area - else if (plMover->IsPvP() && !plMover->HasFlag(PLAYER_FLAGS,PLAYER_FLAGS_IN_PVP)) + else if (plMover->IsPvP() && !plMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP)) plMover->UpdatePvP(false, false); } @@ -459,12 +459,12 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { sLog->outError("%sSpeedChange player %s is NOT correct (must be %f instead %f), force set to correct value", move_type_name[move_type], _player->GetName(), _player->GetSpeed(move_type), newspeed); - _player->SetSpeed(move_type,_player->GetSpeedRate(move_type),true); + _player->SetSpeed(move_type, _player->GetSpeedRate(move_type), true); } else // must be lesser - cheating { sLog->outBasic("Player %s from account id %u kicked for incorrect speed (must be %f instead %f)", - _player->GetName(),_player->GetSession()->GetAccountId(),_player->GetSpeed(move_type), newspeed); + _player->GetName(), _player->GetSession()->GetAccountId(), _player->GetSpeed(move_type), newspeed); _player->GetSession()->KickPlayer(); } } diff --git a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp index cf4b0ac1896..7118170390d 100755 --- a/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/NPCHandler.cpp @@ -51,7 +51,7 @@ void WorldSession::HandleTabardVendorActivateOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TABARDDESIGNER); + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TABARDDESIGNER); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTabardVendorActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); @@ -80,7 +80,7 @@ void WorldSession::HandleBankerActivateOpcode(WorldPacket & recv_data) recv_data >> guid; - Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_BANKER); + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_BANKER); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBankerActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); @@ -119,7 +119,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList"); - Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(guid))); @@ -131,14 +131,14 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); // trainer list loaded at check; - if (!unit->isCanTrainingOf(_player,true)) + if (!unit->isCanTrainingOf(_player, true)) return; CreatureTemplate const *ci = unit->GetCreatureInfo(); if (!ci) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!",GUID_LOPART(guid)); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: SendTrainerList - (GUID: %u) NO CREATUREINFO!", GUID_LOPART(guid)); return; } @@ -231,7 +231,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle) data << strTitle; - data.put<uint32>(count_pos,count); + data.put<uint32>(count_pos, count); SendPacket(&data); } @@ -241,7 +241,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) uint32 spellId = 0; recv_data >> guid >> spellId; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u",uint32(GUID_LOPART(guid)), spellId); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_TRAINER_BUY_SPELL NpcGUID=%u, learn spell id is: %u", uint32(GUID_LOPART(guid)), spellId); Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) @@ -254,7 +254,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) if (GetPlayer()->HasUnitState(UNIT_STAT_DIED)) GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH); - if (!unit->isCanTrainingOf(_player,true)) + if (!unit->isCanTrainingOf(_player, true)) return; // check present spell in trainer spell list @@ -292,7 +292,7 @@ void WorldSession::HandleTrainerBuySpellOpcode(WorldPacket & recv_data) // learn explicitly or cast explicitly if (trainer_spell->IsCastable()) - _player->CastSpell(_player,trainer_spell->spell,true); + _player->CastSpell(_player, trainer_spell->spell, true); else _player->learnSpell(spellId, false); @@ -414,7 +414,7 @@ void WorldSession::SendSpiritResurrect() { _player->ResurrectPlayer(0.5f, true); - _player->DurabilityLossAll(0.25f,true); + _player->DurabilityLossAll(0.25f, true); // get corpse nearest graveyard WorldSafeLocsEntry const *corpseGrave = NULL; @@ -451,7 +451,7 @@ void WorldSession::HandleBinderActivateOpcode(WorldPacket & recv_data) if (!GetPlayer()->IsInWorld() || !GetPlayer()->isAlive()) return; - Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID,UNIT_NPC_FLAG_INNKEEPER); + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(npcGUID, UNIT_NPC_FLAG_INNKEEPER); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleBinderActivateOpcode - Unit (GUID: %u) not found or you can not interact with him.", uint32(GUID_LOPART(npcGUID))); @@ -557,7 +557,7 @@ void WorldSession::SendStablePetCallback(QueryResult result, uint64 guid) data << uint32(pet->GetEntry()); data << uint32(pet->getLevel()); data << pet->GetName(); // petname - data << uint8(1); // 1 = current, 2/3 = in stable (any from 4,5,... create problems with proper show) + data << uint8(1); // 1 = current, 2/3 = in stable (any from 4, 5, ... create problems with proper show) ++num; } @@ -571,7 +571,7 @@ void WorldSession::SendStablePetCallback(QueryResult result, uint64 guid) data << uint32(fields[2].GetUInt32()); // creature entry data << uint32(fields[3].GetUInt16()); // level data << fields[4].GetString(); // name - data << uint8(2); // 1 = current, 2/3 = in stable (any from 4,5,... create problems with proper show) + data << uint8(2); // 1 = current, 2/3 = in stable (any from 4, 5, ... create problems with proper show) ++num; } @@ -622,8 +622,8 @@ void WorldSession::HandleStablePet(WorldPacket & recv_data) return; } - m_stablePetCallback = CharacterDatabase.AsyncPQuery("SELECT owner,slot,id FROM character_pet WHERE owner = '%u' AND slot >= '%u' AND slot <= '%u' ORDER BY slot ", - _player->GetGUIDLow(),PET_SAVE_FIRST_STABLE_SLOT,PET_SAVE_LAST_STABLE_SLOT); + m_stablePetCallback = CharacterDatabase.AsyncPQuery("SELECT owner, slot, id FROM character_pet WHERE owner = '%u' AND slot >= '%u' AND slot <= '%u' ORDER BY slot ", + _player->GetGUIDLow(), PET_SAVE_FIRST_STABLE_SLOT, PET_SAVE_LAST_STABLE_SLOT); } @@ -724,10 +724,10 @@ void WorldSession::HandleUnstablePetCallback(QueryResult result, uint32 petnumbe // delete dead pet if (pet) - _player->RemovePet(pet,PET_SAVE_AS_DELETED); + _player->RemovePet(pet, PET_SAVE_AS_DELETED); Pet *newpet = new Pet(_player, HUNTER_PET); - if (!newpet->LoadPetFromDB(_player,creature_id,petnumber)) + if (!newpet->LoadPetFromDB(_player, creature_id, petnumber)) { delete newpet; newpet = NULL; @@ -805,7 +805,7 @@ void WorldSession::HandleStableSwapPet(WorldPacket & recv_data) // find swapped pet slot in stable m_stableSwapCallback.SetParam(pet_number); m_stableSwapCallback.SetFutureResult( - CharacterDatabase.PQuery("SELECT slot,entry FROM character_pet WHERE owner = '%u' AND id = '%u'", + CharacterDatabase.PQuery("SELECT slot, entry FROM character_pet WHERE owner = '%u' AND id = '%u'", _player->GetGUIDLow(), pet_number) ); } @@ -850,7 +850,7 @@ void WorldSession::HandleStableSwapPetCallback(QueryResult result, uint32 petnum // summon unstabled pet Pet *newpet = new Pet(_player); - if (!newpet->LoadPetFromDB(_player,creature_id, petnumber)) + if (!newpet->LoadPetFromDB(_player, creature_id, petnumber)) { delete newpet; SendStableResult(STABLE_ERR_STABLE); diff --git a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp index 5ad3889ba2d..fde83d0ffeb 100755 --- a/src/server/game/Server/Protocol/Handlers/PetHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetHandler.cpp @@ -166,7 +166,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid case COMMAND_FOLLOW: //spellid=1792 //FOLLOW pet->AttackStop(); pet->InterruptNonMeleeSpells(false); - pet->GetMotionMaster()->MoveFollow(_player,PET_FOLLOW_DIST,pet->GetFollowAngle()); + pet->GetMotionMaster()->MoveFollow(_player, PET_FOLLOW_DIST, pet->GetFollowAngle()); charmInfo->SetCommandState(COMMAND_FOLLOW); charmInfo->SetIsCommandAttack(false); @@ -235,7 +235,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid charmInfo->SetIsFollowing(false); charmInfo->SetIsReturning(false); - pet->Attack(TargetUnit,true); + pet->Attack(TargetUnit, true); pet->SendPetAIReaction(guid1); } } @@ -285,7 +285,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid Unit* unit_target = NULL; if (guid2) - unit_target = ObjectAccessor::GetUnit(*_player,guid2); + unit_target = ObjectAccessor::GetUnit(*_player, guid2); // do not cast unknown spells SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellid); @@ -377,7 +377,7 @@ void WorldSession::HandlePetActionHelper(Unit *pet, uint64 guid1, uint16 spellid else { if (pet->isPossessed() || pet->IsVehicle()) - Spell::SendCastResult(GetPlayer(),spellInfo,0,result); + Spell::SendCastResult(GetPlayer(), spellInfo, 0, result); else pet->SendPetCastFail(spellid, result); @@ -408,7 +408,7 @@ void WorldSession::HandlePetNameQuery(WorldPacket & recv_data) recv_data >> petnumber; recv_data >> petguid; - SendPetNameQuery(petguid,petnumber); + SendPetNameQuery(petguid, petnumber); } void WorldSession::SendPetNameQuery(uint64 petguid, uint32 petnumber) @@ -572,7 +572,7 @@ void WorldSession::HandlePetSetAction(WorldPacket & recv_data) } - charmInfo->SetActionBar(position[i],spell_id,ActiveStates(act_state)); + charmInfo->SetActionBar(position[i], spell_id, ActiveStates(act_state)); } } } @@ -628,7 +628,7 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) std::wstring wname; Utf8toWStr(name, wname); - if (!ObjectMgr::CheckDeclinedNames(GetMainPartOfName(wname,0),declinedname)) + if (!ObjectMgr::CheckDeclinedNames(GetMainPartOfName(wname, 0), declinedname)) { SendPetNameInvalid(PET_NAME_DECLENSION_DOESNT_MATCH_BASE_NAME, name, &declinedname); return; @@ -641,7 +641,7 @@ void WorldSession::HandlePetRename(WorldPacket & recv_data) for (uint8 i = 0; i < MAX_DECLINED_NAME_CASES; ++i) CharacterDatabase.escape_string(declinedname.name[i]); trans->PAppend("DELETE FROM character_pet_declinedname WHERE owner = '%u' AND id = '%u'", _player->GetGUIDLow(), pet->GetCharmInfo()->GetPetNumber()); - trans->PAppend("INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u','%u','%s','%s','%s','%s','%s')", + trans->PAppend("INSERT INTO character_pet_declinedname (id, owner, genitive, dative, accusative, instrumental, prepositional) VALUES ('%u', '%u', '%s', '%s', '%s', '%s', '%s')", pet->GetCharmInfo()->GetPetNumber(), _player->GetGUIDLow(), declinedname.name[0].c_str(), declinedname.name[1].c_str(), declinedname.name[2].c_str(), declinedname.name[3].c_str(), declinedname.name[4].c_str()); } @@ -670,10 +670,10 @@ void WorldSession::HandlePetAbandon(WorldPacket & recv_data) if (pet->GetGUID() == _player->GetPetGUID()) { uint32 feelty = pet->GetPower(POWER_HAPPINESS); - pet->SetPower(POWER_HAPPINESS ,(feelty-50000) > 0 ?(feelty-50000) : 0); + pet->SetPower(POWER_HAPPINESS , (feelty-50000) > 0 ?(feelty-50000) : 0); } - _player->RemovePet((Pet*)pet,PET_SAVE_AS_DELETED); + _player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED); } else if (pet->GetGUID() == _player->GetCharmGUID()) _player->StopCastingCharm(); @@ -694,11 +694,11 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) if (ObjectAccessor::FindPlayer(guid)) return; - Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid); + Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet || (pet != _player->GetGuardianPet() && pet != _player->GetCharm())) { - sLog->outError("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName()); + sLog->outError("HandlePetSpellAutocastOpcode.Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName()); return; } @@ -718,7 +718,7 @@ void WorldSession::HandlePetSpellAutocastOpcode(WorldPacket& recvPacket) else pet->GetCharmInfo()->ToggleCreatureAutocast(spellid, state); - charmInfo->SetSpellAutocast(spellid,state); + charmInfo->SetSpellAutocast(spellid, state); } void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) @@ -742,7 +742,7 @@ void WorldSession::HandlePetCastSpellOpcode(WorldPacket& recvPacket) if (!caster || (caster != _player->GetGuardianPet() && caster != _player->GetCharm())) { - sLog->outError("HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)),GetPlayer()->GetName()); + sLog->outError("HandlePetCastSpellOpcode: Pet %u isn't pet of player %s .", uint32(GUID_LOPART(guid)), GetPlayer()->GetName()); return; } diff --git a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp index eb301660c0a..882bd487132 100755 --- a/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/PetitionsHandler.cpp @@ -89,7 +89,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "Petitioner with GUID %u tried sell petition: name %s", GUID_LOPART(guidNPC), name.c_str()); // prevent cheating - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC,UNIT_NPC_FLAG_PETITIONER); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guidNPC, UNIT_NPC_FLAG_PETITIONER); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandlePetitionBuyOpcode - Unit (GUID: %u) not found or you can't interact with him.", GUID_LOPART(guidNPC)); @@ -544,9 +544,9 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket & recv_data) return; } - CharacterDatabase.PExecute("INSERT INTO petition_sign (ownerguid,petitionguid, playerguid, player_account) VALUES ('%u', '%u', '%u','%u')", GUID_LOPART(ownerguid),GUID_LOPART(petitionguid), plguidlo,GetAccountId()); + CharacterDatabase.PExecute("INSERT INTO petition_sign (ownerguid, petitionguid, playerguid, player_account) VALUES ('%u', '%u', '%u', '%u')", GUID_LOPART(ownerguid), GUID_LOPART(petitionguid), plguidlo, GetAccountId()); - sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionguid), _player->GetName(),plguidlo,GetAccountId()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "PETITION SIGN: GUID %u by player: %s (GUID: %u Account: %u)", GUID_LOPART(petitionguid), _player->GetName(), plguidlo, GetAccountId()); WorldPacket data(SMSG_PETITION_SIGN_RESULTS, (8+8+4)); data << uint64(petitionguid); @@ -807,7 +807,7 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket & recv_data) // Proceed with guild/arena team creation // Delete charter item - _player->DestroyItem(item->GetBagSlot(),item->GetSlot(), true); + _player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); if (type == GUILD_CHARTER_TYPE) { diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 85b64679764..24cfea3949d 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -43,10 +43,10 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) uint8 questStatus = DIALOG_STATUS_NONE; uint8 defstatus = DIALOG_STATUS_NONE; - Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + Object* questgiver = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!questgiver) { - sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)",GuidHigh2TypeId(GUID_HIPART(guid)),GUID_LOPART(guid)); + sLog->outDetail("Error in CMSG_QUESTGIVER_STATUS_QUERY, called for not found questgiver (Typeid: %u GUID: %u)", GuidHigh2TypeId(GUID_HIPART(guid)), GUID_LOPART(guid)); return; } @@ -54,7 +54,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) { case TYPEID_UNIT: { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u",uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc, guid = %u", uint32(GUID_LOPART(guid))); Creature* cr_questgiver=questgiver->ToCreature(); if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies { @@ -66,7 +66,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data) } case TYPEID_GAMEOBJECT: { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid))); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u", uint32(GUID_LOPART(guid))); GameObject* go_questgiver=(GameObject*)questgiver; questStatus = sScriptMgr->GetDialogStatus(_player, go_questgiver); if (questStatus > 6) @@ -89,7 +89,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_HELLO npc = %u", GUID_LOPART(guid)); - Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_NONE); + Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE); if (!pCreature) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleQuestgiverHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", @@ -124,7 +124,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_ACCEPT_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); + Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM|TYPEMASK_PLAYER); // no or incorrect quest giver if (!pObject || (pObject->GetTypeId() != TYPEID_PLAYER && !pObject->hasQuest(quest)) || @@ -139,7 +139,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) if (qInfo) { // prevent cheating - if (!GetPlayer()->CanTakeQuest(qInfo,true)) + if (!GetPlayer()->CanTakeQuest(qInfo, true)) { _player->PlayerTalkClass->CloseGossip(); _player->SetDivider(0); @@ -210,7 +210,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data) } if (destroyItem) - _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(),true); + _player->DestroyItem(((Item*)pObject)->GetBagSlot(), ((Item*)pObject)->GetSlot(), true); break; } @@ -242,7 +242,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket & recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_QUERY_QUEST npc = %u, quest = %u, unk1 = %u", uint32(GUID_LOPART(guid)), quest, unk1); // Verify that the guid is valid and is a questgiver or involved in the requested quest - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM); + Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT|TYPEMASK_ITEM); if (!pObject || (!pObject->hasQuest(quest) && !pObject->hasInvolvedQuest(quest))) { _player->PlayerTalkClass->CloseGossip(); @@ -273,7 +273,7 @@ void WorldSession::HandleQuestQueryOpcode(WorldPacket & recv_data) uint32 quest; recv_data >> quest; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u",quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUEST_QUERY quest = %u", quest); Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) @@ -297,9 +297,9 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u",uint32(GUID_LOPART(guid)),quest,reward); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_CHOOSE_REWARD npc = %u, quest = %u, reward = %u", uint32(GUID_LOPART(guid)), quest, reward); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!pObject) return; @@ -319,8 +319,8 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) if (!(sScriptMgr->OnQuestReward(_player, (pObject->ToCreature()), pQuest, reward))) { // Send next quest - if (Quest const* nextquest = _player->GetNextQuest(guid ,pQuest)) - _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextquest,guid,true); + if (Quest const* nextquest = _player->GetNextQuest(guid , pQuest)) + _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextquest, guid, true); (pObject->ToCreature())->AI()->sQuestReward(_player, pQuest, reward); } @@ -329,8 +329,8 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data) if (!sScriptMgr->OnQuestReward(_player, ((GameObject*)pObject), pQuest, reward)) { // Send next quest - if (Quest const* nextquest = _player->GetNextQuest(guid ,pQuest)) - _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextquest,guid,true); + if (Quest const* nextquest = _player->GetNextQuest(guid , pQuest)) + _player->PlayerTalkClass->SendQuestGiverQuestDetails(nextquest, guid, true); pObject->ToGameObject()->AI()->QuestReward(_player, pQuest, reward); } break; @@ -352,9 +352,9 @@ void WorldSession::HandleQuestgiverRequestRewardOpcode(WorldPacket & recv_data) if (!GetPlayer()->isAlive()) return; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_REQUEST_REWARD npc = %u, quest = %u", uint32(GUID_LOPART(guid)), quest); - Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); + Object* pObject = ObjectAccessor::GetObjectByTypeMask(*_player, guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT); if (!pObject||!pObject->hasInvolvedQuest(quest)) return; @@ -385,7 +385,7 @@ void WorldSession::HandleQuestLogSwapQuest(WorldPacket& recv_data) sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_SWAP_QUEST slot 1 = %u, slot 2 = %u", slot1, slot2); - GetPlayer()->SwapQuestSlot(slot1,slot2); + GetPlayer()->SwapQuestSlot(slot1, slot2); } void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) @@ -393,7 +393,7 @@ void WorldSession::HandleQuestLogRemoveQuest(WorldPacket& recv_data) uint8 slot; recv_data >> slot; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u",slot); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTLOG_REMOVE_QUEST slot = %u", slot); if (slot < MAX_QUEST_LOG_SIZE) { @@ -465,7 +465,7 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) if (!_player->isAlive()) return; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u",uint32(GUID_LOPART(guid)),quest); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_QUESTGIVER_COMPLETE_QUEST npc = %u, quest = %u", uint32(GUID_LOPART(guid)), quest); Quest const *pQuest = sObjectMgr->GetQuestTemplate(quest); if (pQuest) @@ -487,12 +487,12 @@ void WorldSession::HandleQuestgiverCompleteQuest(WorldPacket& recv_data) if (pQuest->IsRepeatable()) _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanCompleteRepeatableQuest(pQuest), false); else - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest,false), false); + _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest, false), false); } else { if (pQuest->GetReqItemsCount()) // some items required - _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest,false), false); + _player->PlayerTalkClass->SendQuestGiverRequestItems(pQuest, guid, _player->CanRewardQuest(pQuest, false), false); else // no items required _player->PlayerTalkClass->SendQuestGiverOfferReward(pQuest, guid, true); } @@ -697,7 +697,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket if (IS_CRE_OR_VEH_OR_PET_GUID(*itr)) { // need also pet quests case support - Creature *questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*GetPlayer(),*itr); + Creature *questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*GetPlayer(), *itr); if (!questgiver || questgiver->IsHostileTo(_player)) continue; if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER)) diff --git a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp index ac98830dd2b..457f6d8ac53 100755 --- a/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SkillHandler.cpp @@ -60,7 +60,7 @@ void WorldSession::HandleTalentWipeConfirmOpcode(WorldPacket & recv_data) uint64 guid; recv_data >> guid; - Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid,UNIT_NPC_FLAG_TRAINER); + Creature *unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER); if (!unit) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleTalentWipeConfirmOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid))); diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index 3b5e6871632..1d47275929a 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -138,7 +138,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { if (IsNonCombatSpell(spellInfo)) { - pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT,pItem,NULL); + pUser->SendEquipError(EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL); return; } } @@ -169,19 +169,19 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) { // for implicit area/coord target spells if (!targets.getUnitTarget()) - Spell::SendCastResult(_player,spellInfo,castCount,SPELL_FAILED_NO_VALID_TARGETS); + Spell::SendCastResult(_player, spellInfo, castCount, SPELL_FAILED_NO_VALID_TARGETS); // for explicit target spells else - Spell::SendCastResult(_player,spellInfo,castCount,SPELL_FAILED_BAD_TARGETS); + Spell::SendCastResult(_player, spellInfo, castCount, SPELL_FAILED_BAD_TARGETS); } return; } // Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state. - if (!sScriptMgr->OnItemUse(pUser,pItem,targets)) + if (!sScriptMgr->OnItemUse(pUser, pItem, targets)) { // no script or script not process request by self - pUser->CastItemUseSpell(pItem,targets,castCount,glyphIndex); + pUser->CastItemUseSpell(pItem, targets, castCount, glyphIndex); } } @@ -193,7 +193,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { - sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i",(uint32)recvPacket.size()); + sLog->outDetail("WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); Player* pUser = _player; @@ -205,7 +205,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) recvPacket >> bagIndex >> slot; - sLog->outDetail("bagIndex: %u, slot: %u",bagIndex,slot); + sLog->outDetail("bagIndex: %u, slot: %u", bagIndex, slot); Item *pItem = pUser->GetItemByPos(bagIndex, slot); if (!pItem) @@ -274,7 +274,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) CharacterDatabase.PExecute("DELETE FROM character_gifts WHERE item_guid = '%u'", pItem->GetGUIDLow()); } else - pUser->SendLoot(pItem->GetGUID(),LOOT_CORPSE); + pUser->SendLoot(pItem->GetGUID(), LOOT_CORPSE); } void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data) @@ -312,7 +312,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) if (!go) return; - if (!go->IsWithinDistInMap(_player,INTERACTION_DISTANCE)) + if (!go->IsWithinDistInMap(_player, INTERACTION_DISTANCE)) return; go->AI()->GossipHello(_player); @@ -390,7 +390,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) // auto-selection buff level base at target level (in spellInfo) if (targets.getUnitTarget()) { - SpellEntry const *actualSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(spellInfo,targets.getUnitTarget()->getLevel()); + SpellEntry const *actualSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(spellInfo, targets.getUnitTarget()->getLevel()); // if rank not found then function return NULL but in explicit cast case original spell can be casted and later failed with appropriate error message if (actualSpellInfo) @@ -410,7 +410,7 @@ void WorldSession::HandleCancelCastOpcode(WorldPacket& recvPacket) recvPacket >> spellId; if (_player->IsNonMeleeSpellCasted(false)) - _player->InterruptNonMeleeSpells(false,spellId,false); + _player->InterruptNonMeleeSpells(false, spellId, false); } void WorldSession::HandleCancelAuraOpcode(WorldPacket& recvPacket) @@ -459,7 +459,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPacket& recvPacket) return; } - Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player,guid); + Creature* pet=ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid); if (!pet) { @@ -538,7 +538,7 @@ void WorldSession::HandleSelfResOpcode(WorldPacket & /*recv_data*/) { SpellEntry const *spellInfo = sSpellStore.LookupEntry(_player->GetUInt32Value(PLAYER_SELF_RES_SPELL)); if (spellInfo) - _player->CastSpell(_player,spellInfo,false,0); + _player->CastSpell(_player, spellInfo, false, 0); _player->SetUInt32Value(PLAYER_SELF_RES_SPELL, 0); } @@ -574,7 +574,7 @@ void WorldSession::HandleMirrrorImageDataRequest(WorldPacket & recv_data) return; // Get creator of the unit - Unit *creator = ObjectAccessor::GetObjectInWorld(unit->GetCreatorGUID(),(Unit*)NULL); + Unit *creator = ObjectAccessor::GetObjectInWorld(unit->GetCreatorGUID(), (Unit*)NULL); if (!creator) return; diff --git a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp index a7bc65143be..eb63cfa8eb0 100755 --- a/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TaxiHandler.cpp @@ -49,13 +49,13 @@ void WorldSession::SendTaxiStatus(uint64 guid) return; } - uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); + uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam()); // not found nearest if (curloc == 0) return; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: current location %u ",curloc); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: current location %u ", curloc); WorldPacket data(SMSG_TAXINODE_STATUS, 9); data << guid; @@ -94,7 +94,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes(WorldPacket & recv_data) void WorldSession::SendTaxiMenu(Creature* unit) { // find current node - uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); + uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam()); if (curloc == 0) return; @@ -102,13 +102,13 @@ void WorldSession::SendTaxiMenu(Creature* unit) bool lastTaxiCheaterState = GetPlayer()->isTaxiCheater(); if (unit->GetEntry() == 29480) GetPlayer()->SetTaxiCheater(true); // Grimwing in Ebon Hold, special case. NOTE: Not perfect, Zul'Aman should not be included according to WoWhead, and I think taxicheat includes it. - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ",curloc); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_TAXINODE_STATUS_QUERY %u ", curloc); WorldPacket data(SMSG_SHOWTAXINODES, (4+8+4+8*4)); data << uint32(1); data << uint64(unit->GetGUID()); data << uint32(curloc); - GetPlayer()->m_taxi.AppendTaximaskTo(data,GetPlayer()->isTaxiCheater()); + GetPlayer()->m_taxi.AppendTaximaskTo(data, GetPlayer()->isTaxiCheater()); SendPacket(&data); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_SHOWTAXINODES"); @@ -128,13 +128,13 @@ void WorldSession::SendDoFlight(uint32 mountDisplayId, uint32 path, uint32 pathN if (mountDisplayId) GetPlayer()->Mount(mountDisplayId); - GetPlayer()->GetMotionMaster()->MoveTaxiFlight(path,pathNode); + GetPlayer()->GetMotionMaster()->MoveTaxiFlight(path, pathNode); } bool WorldSession::SendLearnNewTaxiNode(Creature* unit) { // find current node - uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(),unit->GetPositionY(),unit->GetPositionZ(),unit->GetMapId(),GetPlayer()->GetTeam()); + uint32 curloc = sObjectMgr->GetNearestTaxiNode(unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ(), unit->GetMapId(), GetPlayer()->GetTeam()); if (curloc == 0) return true; // `true` send to avoid WorldSession::SendTaxiMenu call with one more curlock seartch with same false result. @@ -191,7 +191,7 @@ void WorldSession::HandleActivateTaxiExpressOpcode (WorldPacket & recv_data) if (nodes.empty()) return; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" ,nodes.front(),nodes.back()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXIEXPRESS from %d to %d" , nodes.front(), nodes.back()); GetPlayer()->ActivateTaxiPathTo(nodes, npc); } @@ -231,7 +231,7 @@ void WorldSession::HandleMoveSplineDoneOpcode(WorldPacket& recv_data) TaxiPathNodeEntry const& node = flight->GetPath()[flight->GetCurrentNode()]; flight->SkipCurrentNode(); - GetPlayer()->TeleportTo(curDestNode->map_id,node.x,node.y,node.z,GetPlayer()->GetOrientation()); + GetPlayer()->TeleportTo(curDestNode->map_id, node.x, node.y, node.z, GetPlayer()->GetOrientation()); } return; } @@ -283,7 +283,7 @@ void WorldSession::HandleActivateTaxiOpcode(WorldPacket & recv_data) nodes.resize(2); recv_data >> guid >> nodes[0] >> nodes[1]; - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d" ,nodes[0],nodes[1]); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_ACTIVATETAXI from %d to %d" , nodes[0], nodes[1]); Creature *npc = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_FLIGHTMASTER); if (!npc) { diff --git a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp index 98656d539ec..17b63f80d89 100755 --- a/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/TradeHandler.cpp @@ -69,13 +69,13 @@ void WorldSession::SendTradeStatus(TradeStatus status) void WorldSession::HandleIgnoreTradeOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u",_player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Ignore Trade %u", _player->GetGUIDLow()); // recvPacket.print_storage(); } void WorldSession::HandleBusyTradeOpcode(WorldPacket& /*recvPacket*/) { - sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u",_player->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Busy Trade %u", _player->GetGUIDLow()); // recvPacket.print_storage(); } @@ -150,7 +150,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { // logging - sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u",myItems[i]->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow()); if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", @@ -168,10 +168,10 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (hisItems[i]) { // logging - sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u",hisItems[i]->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow()); if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", + sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)", trader->GetName(), trader->GetSession()->GetAccountId(), hisItems[i]->GetTemplate()->Name1.c_str(), hisItems[i]->GetEntry(), hisItems[i]->GetCount(), _player->GetName(), _player->GetSession()->GetAccountId()); @@ -191,21 +191,21 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) if (myItems[i]) { if (!traderCanTrade) - sLog->outError("trader can't store item: %u",myItems[i]->GetGUIDLow()); + sLog->outError("trader can't store item: %u", myItems[i]->GetGUIDLow()); if (_player->CanStoreItem(NULL_BAG, NULL_SLOT, playerDst, myItems[i], false) == EQUIP_ERR_OK) _player->MoveItemToInventory(playerDst, myItems[i], true, true); else - sLog->outError("player can't take item back: %u",myItems[i]->GetGUIDLow()); + sLog->outError("player can't take item back: %u", myItems[i]->GetGUIDLow()); } // return the already removed items to the original owner if (hisItems[i]) { if (!playerCanTrade) - sLog->outError("player can't store item: %u",hisItems[i]->GetGUIDLow()); + sLog->outError("player can't store item: %u", hisItems[i]->GetGUIDLow()); if (trader->CanStoreItem(NULL_BAG, NULL_SLOT, traderDst, hisItems[i], false) == EQUIP_ERR_OK) trader->MoveItemToInventory(traderDst, hisItems[i], true, true); else - sLog->outError("trader can't take item back: %u",hisItems[i]->GetGUIDLow()); + sLog->outError("trader can't take item back: %u", hisItems[i]->GetGUIDLow()); } } } @@ -461,14 +461,14 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/) { if (_player->GetSession()->GetSecurity() > SEC_PLAYER && my_trade->GetMoney() > 0) { - sLog->outCommand(_player->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", _player->GetName(), _player->GetSession()->GetAccountId(), my_trade->GetMoney(), trader->GetName(), trader->GetSession()->GetAccountId()); } if (trader->GetSession()->GetSecurity() > SEC_PLAYER && his_trade->GetMoney() > 0) { - sLog->outCommand(trader->GetSession()->GetAccountId(),"GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", + sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)", trader->GetName(), trader->GetSession()->GetAccountId(), his_trade->GetMoney(), _player->GetName(), _player->GetSession()->GetAccountId()); @@ -632,7 +632,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket) return; } - if (!pOther->IsWithinDistInMap(_player,10.0f,false)) + if (!pOther->IsWithinDistInMap(_player, 10.0f, false)) { SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR); return; diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 27bd2872f7e..6920f157ec7 100755 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -666,7 +666,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x27D*/ { "CMSG_ENABLE_DAMAGE_LOG", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x27E*/ { "CMSG_GROUP_CHANGE_SUB_GROUP", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupChangeSubGroupOpcode }, /*0x27F*/ { "CMSG_REQUEST_PARTY_MEMBER_STATS", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleRequestPartyMemberStatsOpcode}, - /*0x280*/ { "CMSG_GROUP_SWAP_SUB_GROUP", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x280*/ { "CMSG_GROUP_SWAP_SUB_GROUP", STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x281*/ { "CMSG_RESET_FACTION_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x282*/ { "CMSG_AUTOSTORE_BANK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoStoreBankItemOpcode }, /*0x283*/ { "CMSG_AUTOBANK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleAutoBankItemOpcode }, @@ -684,7 +684,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x28F*/ { "CMSG_GROUP_ASSISTANT_LEADER", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleGroupAssistantLeaderOpcode}, /*0x290*/ { "CMSG_BUYBACK_ITEM", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleBuybackItem }, /*0x291*/ { "SMSG_SERVER_MESSAGE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL }, + /*0x292*/ { "CMSG_SET_SAVED_INSTANCE_EXTEND", STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x293*/ { "SMSG_LFG_OFFER_CONTINUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x294*/ { "CMSG_MEETINGSTONE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x295*/ { "SMSG_MEETINGSTONE_SETQUEUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, @@ -950,7 +950,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x399*/ { "CMSG_ACTIVE_PVP_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x39A*/ { "CMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x39B*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x39C*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE",STATUS_NEVER,PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x39C*/ { "SMSG_CHEAT_DUMP_ITEMS_DEBUG_ONLY_RESPONSE_WRITE_FILE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x39D*/ { "SMSG_UPDATE_COMBO_POINTS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x39E*/ { "SMSG_VOICE_SESSION_ROSTER_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x39F*/ { "SMSG_VOICE_SESSION_LEAVE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, @@ -959,7 +959,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x3A2*/ { "SMSG_VOICE_SET_TALKER_MUTED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3A3*/ { "SMSG_INIT_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3A4*/ { "SMSG_SET_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, - /*0x3A5*/ { "SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE",STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x3A5*/ { "SMSG_SET_EXTRA_AURA_INFO_NEED_UPDATE_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3A6*/ { "SMSG_CLEAR_EXTRA_AURA_INFO_OBSOLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x3A7*/ { "MSG_MOVE_START_DESCEND", STATUS_LOGGEDIN, PROCESS_THREADSAFE, &WorldSession::HandleMovementOpcodes }, /*0x3A8*/ { "CMSG_IGNORE_REQUIREMENTS_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 0596fb64d9c..1ee0cee1eed 100755 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -545,8 +545,8 @@ enum Opcodes SMSG_ENVIRONMENTALDAMAGELOG = 0x1FC, CMSG_PLAYER_DIFFICULTY_CHANGE = 0x1FD, SMSG_RWHOIS = 0x1FE, - SMSG_LFG_PLAYER_REWARD = 0x1FF, // uint32, uint8, uint32, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32,uint32,uint32} - SMSG_LFG_TELEPORT_DENIED = 0x200, // uint32 (1,2,4,6;0,5,7) + SMSG_LFG_PLAYER_REWARD = 0x1FF, // uint32, uint8, uint32, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32, uint32, uint32} + SMSG_LFG_TELEPORT_DENIED = 0x200, // uint32 (1, 2, 4, 6;0, 5, 7) CMSG_UNLEARN_SPELL = 0x201, CMSG_UNLEARN_SKILL = 0x202, SMSG_REMOVED_SPELL = 0x203, @@ -699,7 +699,7 @@ enum Opcodes CMSG_MEETINGSTONE_INFO = 0x296, // EVENT_LFG_UPDATE SMSG_MEETINGSTONE_COMPLETE = 0x297, // EVENT_MAIL_SHOW SMSG_MEETINGSTONE_IN_PROGRESS = 0x298, // uint32, some UPDATE_COOLDOWN events - SMSG_MEETINGSTONE_MEMBER_ADDED = 0x299, // uint32, errors: ERR_NOT_IN_GROUP (2,51) and ERR_NOT_IN_RAID (3,39,40) + SMSG_MEETINGSTONE_MEMBER_ADDED = 0x299, // uint32, errors: ERR_NOT_IN_GROUP (2, 51) and ERR_NOT_IN_RAID (3, 39, 40) CMSG_GMTICKETSYSTEM_TOGGLE = 0x29A, CMSG_CANCEL_GROWTH_AURA = 0x29B, SMSG_CANCEL_AUTO_REPEAT = 0x29C, @@ -899,7 +899,7 @@ enum Opcodes CMSG_SEARCH_LFG_JOIN = 0x35E, // CMSG SearchLFGJoin CMSG_SEARCH_LFG_LEAVE = 0x35F, // CMSG SearchLFGLeave SMSG_UPDATE_LFG_LIST = 0x360, // SMSG uint32, uint32, if (uint8) { uint32 count, for (count) { uint64} }, uint32 count2, uint32, for (count2) { uint64, uint32 flags, if (flags & 0x2) {string}, if (flags & 0x10) {for (3) uint8}, if (flags & 0x80) {uint64, uint32}}, uint32 count3, uint32, for (count3) {uint64, uint32 flags, if (flags & 0x1) {uint8, uint8, uint8, for (3) uint8, uint32, uint32, uint32, uint32, uint32, uint32, float, float, uint32, uint32, uint32, uint32, uint32, float, uint32, uint32, uint32, uint32, uint32, uint32}, if (flags&0x2) string, if (flags&0x4) uint8, if (flags&0x8) uint64, if (flags&0x10) uint8, if (flags&0x20) uint32, if (flags&0x40) uint8, if (flags& 0x80) {uint64, uint32}} - SMSG_LFG_PROPOSAL_UPDATE = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for (uint8) {uint32,uint8,uint8,uint8,uint8} + SMSG_LFG_PROPOSAL_UPDATE = 0x361, // SMSG uint32, uint8, uint32, uint32, uint8, for (uint8) {uint32, uint8, uint8, uint8, uint8} CMSG_LFG_PROPOSAL_RESULT = 0x362, // CMSG AcceptProposal, RejectProposal SMSG_LFG_ROLE_CHECK_UPDATE = 0x363, // SMSG uint32, uint8, for (uint8) uint32, uint8, for (uint8) { uint64, uint8, uint32, uint8, } SMSG_LFG_JOIN_RESULT = 0x364, // SMSG uint32 unk, uint32, if (unk == 6) { uint8 count, for (count) uint64 } @@ -913,7 +913,7 @@ enum Opcodes CMSG_LFG_SET_BOOT_VOTE = 0x36C, // CMSG SetLFGBootVote SMSG_LFG_BOOT_PLAYER = 0x36D, // SMSG uint8, uint8, uint8, uint64, uint32, uint32, uint32, uint32 CMSG_LFD_PLAYER_LOCK_INFO_REQUEST = 0x36E, // CMSG RequestLFDPlayerLockInfo - SMSG_LFG_PLAYER_INFO = 0x36F, // SMSG uint8, for (uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32,uint32, uint32}}, uint32, for (uint32) {uint32,uint32} + SMSG_LFG_PLAYER_INFO = 0x36F, // SMSG uint8, for (uint8) { uint32, uint8, uint32, uint32, uint32, uint32, uint8, for (uint8) {uint32, uint32, uint32}}, uint32, for (uint32) {uint32, uint32} CMSG_LFG_TELEPORT = 0x370, // CMSG LFGTeleport CMSG_LFD_PARTY_LOCK_INFO_REQUEST = 0x371, // CMSG RequestLFDPartyLockInfo SMSG_LFG_PARTY_INFO = 0x372, // SMSG uint8, for (uint8) uint64 diff --git a/src/server/game/Server/Protocol/WorldLog.cpp b/src/server/game/Server/Protocol/WorldLog.cpp index ceaf6fa196e..1a11a1efb88 100755 --- a/src/server/game/Server/Protocol/WorldLog.cpp +++ b/src/server/game/Server/Protocol/WorldLog.cpp @@ -40,7 +40,7 @@ WorldLog::~WorldLog() /// Open the log file (if specified so in the configuration file) void WorldLog::Initialize() { - std::string logsDir = sConfig->GetStringDefault("LogsDir",""); + std::string logsDir = sConfig->GetStringDefault("LogsDir", ""); if (!logsDir.empty()) { diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 4a42ae695ea..0e767cb00f8 100755 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -169,8 +169,8 @@ void WorldSession::SendPacket(WorldPacket const *packet) { uint64 minTime = uint64(cur_time - lastTime); uint64 fullTime = uint64(lastTime - firstTime); - sLog->outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u",sendPacketCount,sendPacketBytes,float(sendPacketCount)/fullTime,float(sendPacketBytes)/fullTime,uint32(fullTime)); - sLog->outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f",sendLastPacketCount,sendLastPacketBytes,float(sendLastPacketCount)/minTime,float(sendLastPacketBytes)/minTime); + sLog->outDetail("Send all time packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f time: %u", sendPacketCount, sendPacketBytes, float(sendPacketCount)/fullTime, float(sendPacketBytes)/fullTime, uint32(fullTime)); + sLog->outDetail("Send last min packets count: " UI64FMTD " bytes: " UI64FMTD " avr.count/sec: %f avr.bytes/sec: %f", sendLastPacketCount, sendLastPacketBytes, float(sendLastPacketCount)/minTime, float(sendLastPacketBytes)/minTime); lastTime = cur_time; sendLastPacketCount = 1; @@ -420,7 +420,7 @@ void WorldSession::LogoutPlayer(bool Save) if (!_player->m_InstanceValid && !_player->isGameMaster()) _player->TeleportTo(_player->m_homebindMapId, _player->m_homebindX, _player->m_homebindY, _player->m_homebindZ, _player->GetOrientation()); - sOutdoorPvPMgr->HandlePlayerLeaveZone(_player,_player->GetZoneId()); + sOutdoorPvPMgr->HandlePlayerLeaveZone(_player, _player->GetZoneId()); for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i) { @@ -441,7 +441,7 @@ void WorldSession::LogoutPlayer(bool Save) pGuild->HandleMemberLogout(this); ///- Remove pet - _player->RemovePet(NULL,PET_SAVE_AS_CURRENT, true); + _player->RemovePet(NULL, PET_SAVE_AS_CURRENT, true); ///- empty buyback items and save the player in the database // some save parts only correctly work in case player present in map/player_lists (pets, etc) @@ -488,7 +488,7 @@ void WorldSession::LogoutPlayer(bool Save) // e.g if he got disconnected during a transfer to another map // calls to GetMap in this case may cause crashes _player->CleanupsBeforeDelete(); - sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() ,_player->GetGUIDLow()); + sLog->outChar("Account: %d (IP: %s) Logout Character:[%s] (GUID: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() , _player->GetGUIDLow()); Map *_map = _player->GetMap(); _map->Remove(_player, true); SetPlayer(NULL); // deleted in Remove call @@ -516,7 +516,7 @@ void WorldSession::KickPlayer() m_Socket->CloseSocket(); } -void WorldSession::SendNotification(const char *format,...) +void WorldSession::SendNotification(const char *format, ...) { if (format) { @@ -533,7 +533,7 @@ void WorldSession::SendNotification(const char *format,...) } } -void WorldSession::SendNotification(uint32 string_id,...) +void WorldSession::SendNotification(uint32 string_id, ...) { char const *format = GetTrinityString(string_id); if (format) diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index ffc82198abc..69b8006ee6f 100755 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -195,11 +195,11 @@ class WorldSession void WriteMovementInfo(WorldPacket *data, MovementInfo *mi); void SendPacket(WorldPacket const* packet); - void SendNotification(const char *format,...) ATTR_PRINTF(2,3); - void SendNotification(uint32 string_id,...); + void SendNotification(const char *format, ...) ATTR_PRINTF(2, 3); + void SendNotification(uint32 string_id, ...); void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName); void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res, uint32 val = 0); - void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2,3); + void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2, 3); void SendSetPhaseShift(uint32 phaseShift); void SendQueryTimeResponse(); @@ -303,8 +303,8 @@ class WorldSession void SendAuctionOwnerNotification(AuctionEntry * auction); //Item Enchantment - void SendEnchantmentLog(uint64 Target, uint64 Caster,uint32 ItemID,uint32 SpellID); - void SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid,uint32 slot,uint32 Duration); + void SendEnchantmentLog(uint64 Target, uint64 Caster, uint32 ItemID, uint32 SpellID); + void SendItemEnchantTimeUpdate(uint64 Playerguid, uint64 Itemguid, uint32 slot, uint32 Duration); //Taxi void SendTaxiStatus(uint64 guid); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index f1ea340cd4b..b2c8164d6f5 100755 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -48,7 +48,7 @@ #if defined(__GNUC__) #pragma pack(1) #else -#pragma pack(push,1) +#pragma pack(push, 1) #endif struct ServerPktHeader @@ -206,7 +206,7 @@ int WorldSocket::SendPacket (const WorldPacket& pct) if (!pct.empty()) mb->copy((const char*)pct.contents(), pct.size()); - if (msg_queue()->enqueue_tail(mb,(ACE_Time_Value*)&ACE_Time_Value::zero) == -1) + if (msg_queue()->enqueue_tail(mb, (ACE_Time_Value*)&ACE_Time_Value::zero) == -1) { sLog->outError("WorldSocket::SendPacket enqueue_tail failed"); mb->release(); @@ -309,7 +309,7 @@ int WorldSocket::handle_input (ACE_HANDLE) if ((errno == EWOULDBLOCK) || (errno == EAGAIN)) { - return Update(); // interesting line ,isn't it ? + return Update(); // interesting line , isn't it ? } sLog->outStaticDebug("WorldSocket::handle_input: Peer error closing connection errno = %s", ACE_OS::strerror (errno)); @@ -598,7 +598,7 @@ int WorldSocket::handle_input_missing_data (void) // Its possible on some error situations that this happens // for example on closing when epoll receives more chunked data and stuff - // hope this is not hack ,as proper m_RecvWPct is asserted around + // hope this is not hack , as proper m_RecvWPct is asserted around if (!m_RecvWPct) { sLog->outError ("Forcing close on input m_RecvWPct = NULL"); @@ -721,7 +721,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return HandleAuthSession (*new_pct); case CMSG_KEEP_ALIVE: - sLog->outStaticDebug ("CMSG_KEEP_ALIVE ,size: " UI64FMTD, uint64(new_pct->size())); + sLog->outStaticDebug ("CMSG_KEEP_ALIVE , size: " UI64FMTD, uint64(new_pct->size())); sScriptMgr->OnPacketReceive(this, WorldPacket(*new_pct)); return 0; default: @@ -734,7 +734,7 @@ int WorldSocket::ProcessIncoming (WorldPacket* new_pct) // Catches people idling on the login screen and any lingering ingame connections. m_Session->ResetTimeOutTime(); - // OK ,give the packet to WorldSession + // OK , give the packet to WorldSession aptr.release(); // WARNINIG here we call it with locks held. // Its possible to cause deadlock if QueuePacket calls back @@ -860,7 +860,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket) const char* sStr = s.AsHexStr(); //Must be freed by OPENSSL_free() const char* vStr = v.AsHexStr(); //Must be freed by OPENSSL_free() - sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s,v) check s: %s v: %s", + sLog->outStaticDebug ("WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s", sStr, vStr); @@ -1058,7 +1058,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket) else { sLog->outError ("WorldSocket::HandlePing: peer sent CMSG_PING, " - "but is not authenticated or got recently kicked," + "but is not authenticated or got recently kicked, " " address = %s", GetRemoteAddress().c_str()); return -1; diff --git a/src/server/game/Server/WorldSocket.h b/src/server/game/Server/WorldSocket.h index 85dd29f89ec..7e87b38f737 100755 --- a/src/server/game/Server/WorldSocket.h +++ b/src/server/game/Server/WorldSocket.h @@ -74,7 +74,7 @@ typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> WorldHandler; * The calls to Update() method are managed by WorldSocketMgr * and ReactorRunnable. * - * For input ,the class uses one 1024 bytes buffer on stack + * For input , the class uses one 1024 bytes buffer on stack * to which it does recv() calls. And then received data is * distributed where its needed. 1024 matches pretty well the * traffic generated by client for now. @@ -126,7 +126,7 @@ class WorldSocket : protected WorldHandler WorldSocket (void); virtual ~WorldSocket (void); - /// Called on open ,the void* is the acceptor. + /// Called on open , the void* is the acceptor. virtual int open (void *); /// Called on failures inside of the acceptor, don't call from your code. @@ -160,7 +160,7 @@ class WorldSocket : protected WorldHandler int handle_output_queue (GuardType& g); /// process one incoming packet. - /// @param new_pct received packet ,note that you need to delete it. + /// @param new_pct received packet , note that you need to delete it. int ProcessIncoming (WorldPacket* new_pct); /// Called by ProcessIncoming() on CMSG_AUTH_SESSION. @@ -173,7 +173,7 @@ class WorldSocket : protected WorldHandler /// Time in which the last ping was received ACE_Time_Value m_LastPingTime; - /// Keep track of over-speed pings ,to prevent ping flood. + /// Keep track of over-speed pings , to prevent ping flood. uint32 m_OverSpeedPings; /// Address of the remote peer diff --git a/src/server/game/Server/WorldSocketMgr.cpp b/src/server/game/Server/WorldSocketMgr.cpp index 91586137853..2454f6df5d0 100755 --- a/src/server/game/Server/WorldSocketMgr.cpp +++ b/src/server/game/Server/WorldSocketMgr.cpp @@ -46,7 +46,7 @@ #include "ScriptMgr.h" /** -* This is a helper class to WorldSocketMgr ,that manages +* This is a helper class to WorldSocketMgr , that manages * network threads, and assigning connections from acceptor thread * to other network threads */ @@ -263,7 +263,7 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address) if (acc->open(listen_addr, m_NetThreads[0].GetReactor(), ACE_NONBLOCK) == -1) { - sLog->outError ("Failed to open acceptor ,check if the port is free"); + sLog->outError ("Failed to open acceptor , check if the port is free"); return -1; } diff --git a/src/server/game/Server/WorldSocketMgr.h b/src/server/game/Server/WorldSocketMgr.h index 0a6c517b5db..eb6ee9efbe6 100755 --- a/src/server/game/Server/WorldSocketMgr.h +++ b/src/server/game/Server/WorldSocketMgr.h @@ -68,7 +68,7 @@ private: ACE_Event_Handler* m_Acceptor; }; -#define sWorldSocketMgr ACE_Singleton<WorldSocketMgr,ACE_Thread_Mutex>::instance() +#define sWorldSocketMgr ACE_Singleton<WorldSocketMgr, ACE_Thread_Mutex>::instance() #endif /// @} diff --git a/src/server/game/Skills/SkillDiscovery.cpp b/src/server/game/Skills/SkillDiscovery.cpp index 973d37b90cc..bdd635eb192 100755 --- a/src/server/game/Skills/SkillDiscovery.cpp +++ b/src/server/game/Skills/SkillDiscovery.cpp @@ -88,7 +88,7 @@ void LoadSkillDiscoveryTable() { if (reportedReqSpells.find(absReqSkillOrSpell) == reportedReqSpells.end()) { - sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table",spellId,reqSkillOrSpell); + sLog->outErrorDb("Spell (ID: %u) have not existed spell (ID: %i) in `reqSpell` field in `skill_discovery_template` table", spellId, reqSkillOrSpell); reportedReqSpells.insert(absReqSkillOrSpell); } continue; @@ -117,7 +117,7 @@ void LoadSkillDiscoveryTable() if (bounds.first == bounds.second) { - sLog->outErrorDb("Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table",spellId); + sLog->outErrorDb("Spell (ID: %u) not listed in `SkillLineAbility.dbc` but listed with `reqSpell`=0 in `skill_discovery_template` table", spellId); continue; } @@ -126,7 +126,7 @@ void LoadSkillDiscoveryTable() } else { - sLog->outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table",spellId); + sLog->outErrorDb("Spell (ID: %u) have negative value in `reqSpell` field in `skill_discovery_template` table", spellId); continue; } @@ -134,7 +134,7 @@ void LoadSkillDiscoveryTable() } while (result->NextRow()); if (!ssNonDiscoverableEntries.str().empty()) - sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s",ssNonDiscoverableEntries.str().c_str()); + sLog->outErrorDb("Some items can't be successfully discovered: have in chance field value < 0.000001 in `skill_discovery_template` DB table . List:\n%s", ssNonDiscoverableEntries.str().c_str()); // report about empty data for explicit discovery spells for (uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id) @@ -148,7 +148,7 @@ void LoadSkillDiscoveryTable() continue; if (SkillDiscoveryStore.find(int32(spell_id)) == SkillDiscoveryStore.end()) - sLog->outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table",spell_id); + sLog->outErrorDb("Spell (ID: %u) is 100%% chance random discovery ability but not have data in `skill_discovery_template` table", spell_id); } sLog->outString(">> Loaded %u skill discovery definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); diff --git a/src/server/game/Skills/SkillExtraItems.cpp b/src/server/game/Skills/SkillExtraItems.cpp index 5aa6561adee..f4aaa26a251 100755 --- a/src/server/game/Skills/SkillExtraItems.cpp +++ b/src/server/game/Skills/SkillExtraItems.cpp @@ -44,7 +44,7 @@ struct SkillExtraItemEntry }; // map to store the extra item creation info, the key is the spellId of the creation spell, the mapped value is the assigned SkillExtraItemEntry -typedef std::map<uint32,SkillExtraItemEntry> SkillExtraItemMap; +typedef std::map<uint32, SkillExtraItemEntry> SkillExtraItemMap; SkillExtraItemMap SkillExtraItemStore; @@ -82,7 +82,7 @@ void LoadSkillExtraItemTable() uint32 requiredSpecialization = fields[1].GetUInt32(); if (!sSpellStore.LookupEntry(requiredSpecialization)) { - sLog->outError("Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId,requiredSpecialization); + sLog->outError("Skill specialization %u have not existed required specialization spell id %u in `skill_extra_item_template`!", spellId, requiredSpecialization); continue; } diff --git a/src/server/game/Spells/Auras/SpellAuraDefines.h b/src/server/game/Spells/Auras/SpellAuraDefines.h index f597ce35ffe..9e9f965d96c 100755 --- a/src/server/game/Spells/Auras/SpellAuraDefines.h +++ b/src/server/game/Spells/Auras/SpellAuraDefines.h @@ -74,7 +74,7 @@ enum AuraType SPELL_AURA_MOD_STEALTH_DETECT = 17, SPELL_AURA_MOD_INVISIBILITY = 18, SPELL_AURA_MOD_INVISIBILITY_DETECT = 19, - SPELL_AURA_OBS_MOD_HEALTH = 20, //20,21 unofficial + SPELL_AURA_OBS_MOD_HEALTH = 20, //20, 21 unofficial SPELL_AURA_OBS_MOD_POWER = 21, SPELL_AURA_MOD_RESISTANCE = 22, SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23, diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 5a9977ff2b6..8fd24da80a8 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -632,7 +632,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster) uint8 cp = caster->ToPlayer()->GetComboPoints(); // Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs - if (AuraEffect const * aurEff = caster->GetAuraEffect(34241,0)) + if (AuraEffect const * aurEff = caster->GetAuraEffect(34241, 0)) amount += cp * aurEff->GetAmount(); amount += uint32(CalculatePctU(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp)); @@ -644,8 +644,8 @@ int32 AuraEffect::CalculateAmount(Unit * caster) // $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); int32 mws = caster->GetAttackTime(BASE_ATTACK); - float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK,MINDAMAGE); - float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK,MAXDAMAGE); + float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE); + float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE); float mwb = ((mwb_min + mwb_max) / 2 + ap * mws / 14000) * 0.2f; amount += int32(caster->ApplyEffectModifiers(m_spellProto, m_effIndex, mwb)); // "If used while your target is above 75% health, Rend does 35% more damage." @@ -1269,7 +1269,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const // Consecrate ticks can miss and will not show up in the combat log if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA && - caster->SpellHitResult(target,GetSpellProto(),false) != SPELL_MISS_NONE) + caster->SpellHitResult(target, GetSpellProto(), false) != SPELL_MISS_NONE) break; // Check for immune (not use charges) @@ -1296,7 +1296,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const { uint32 percent = GetEffIndex() < 2 && GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_DUMMY ? - caster->CalculateSpellDamage(target, GetSpellProto(),GetEffIndex()+1) : + caster->CalculateSpellDamage(target, GetSpellProto(), GetEffIndex()+1) : 100; if (!target->HealthBelowPct(percent)) { @@ -1383,9 +1383,9 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const caster->CalcAbsorbResist(target, GetSpellSchoolMask(GetSpellProto()), DOT, damage, &absorb, &resist, m_spellProto); sLog->outDetail("PeriodicTick: %u (TypeId: %u) attacked %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", - GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(),absorb); + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); - caster->DealDamageMods(target,damage,&absorb); + caster->DealDamageMods(target, damage, &absorb); // Set trigger flag uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; @@ -1425,7 +1425,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const } if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA && - caster->SpellHitResult(target,GetSpellProto(),false) != SPELL_MISS_NONE) + caster->SpellHitResult(target, GetSpellProto(), false) != SPELL_MISS_NONE) return; // Check for immune @@ -1465,7 +1465,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const damage = uint32(target->GetHealth()); sLog->outDetail("PeriodicTick: %u (TypeId: %u) health leech of %u (TypeId: %u) for %u dmg inflicted by %u abs is %u", - GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(),absorb); + GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), damage, GetId(), absorb); caster->SendSpellNonMeleeDamageLog(target, GetId(), damage, GetSpellSchoolMask(GetSpellProto()), absorb, resist, false, 0, crit); @@ -1620,7 +1620,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const if ((int32)damage > gain) damage = gain; uint32 absorb = 0; - caster->DealDamageMods(caster,damage,&absorb); + caster->DealDamageMods(caster, damage, &absorb); caster->SendSpellNonMeleeDamageLog(caster, GetId(), damage, GetSpellSchoolMask(GetSpellProto()), absorb, 0, false, 0, false); CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL); @@ -1659,7 +1659,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const break; if (GetSpellProto()->Effect[GetEffIndex()] == SPELL_EFFECT_PERSISTENT_AREA_AURA && - caster->SpellHitResult(target,GetSpellProto(),false) != SPELL_MISS_NONE) + caster->SpellHitResult(target, GetSpellProto(), false) != SPELL_MISS_NONE) break; // Check for immune (not use charges) @@ -1781,7 +1781,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const SpellPeriodicAuraLogInfo pInfo(this, amount, 0, 0, 0, 0.0f, false); target->SendPeriodicAuraLog(&pInfo); - int32 gain = target->ModifyPower(power,amount); + int32 gain = target->ModifyPower(power, amount); if (caster) target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto()); @@ -1818,7 +1818,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const sLog->outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), target->GetGUIDLow(), target->GetTypeId(), amount, GetId()); - int32 gain = target->ModifyPower(power,amount); + int32 gain = target->ModifyPower(power, amount); if (caster) target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto()); @@ -1866,7 +1866,7 @@ void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const //no SpellDamageBonus for burn mana caster->CalculateSpellDamageTaken(&damageInfo, int32(gain * dmgMultiplier), spellProto); - caster->DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb); + caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); caster->SendSpellNonMeleeDamageLog(&damageInfo); @@ -2048,12 +2048,12 @@ void AuraEffect::PeriodicDummyTick(Unit * target, Unit * caster) const // eff_radius == 0 float radius = GetSpellMaxRange(GetSpellProto(), false); - CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(),caster->GetPositionY())); + CellPair p(Trinity::ComputeCellPair(caster->GetPositionX(), caster->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT; Trinity::AnyUnfriendlyVisibleUnitInObjectRangeCheck u_check(caster, caster, radius); - Trinity::UnitListSearcher<Trinity::AnyUnfriendlyVisibleUnitInObjectRangeCheck> checker(caster,targets, u_check); + Trinity::UnitListSearcher<Trinity::AnyUnfriendlyVisibleUnitInObjectRangeCheck> checker(caster, targets, u_check); TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyVisibleUnitInObjectRangeCheck>, GridTypeMapContainer > grid_object_checker(checker); TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyUnfriendlyVisibleUnitInObjectRangeCheck>, WorldTypeMapContainer > world_object_checker(checker); @@ -2251,7 +2251,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const if (!creature->GetCreatureInfo()->SkinLootId) return; - player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId,LootTemplates_Skinning,true); + player->AutoStoreLoot(creature->GetCreatureInfo()->SkinLootId, LootTemplates_Skinning, true); creature->DespawnOrUnsummon(); } @@ -2264,7 +2264,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const // so instakill will be naturally done before trigger spell case 31347: { - target->CastSpell(target,31350,true, NULL, this); + target->CastSpell(target, 31350, true, NULL, this); target->Kill(target); return; } @@ -2280,9 +2280,9 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const { // cast 24 spells 34269-34289, 34314-34316 for (uint32 spell_id = 34269; spell_id != 34290; ++spell_id) - caster->CastSpell(target,spell_id,true, NULL, this); + caster->CastSpell(target, spell_id, true, NULL, this); for (uint32 spell_id = 34314; spell_id != 34317; ++spell_id) - caster->CastSpell(target,spell_id,true, NULL, this); + caster->CastSpell(target, spell_id, true, NULL, this); return; } // Remote Toy @@ -2306,7 +2306,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const creatureTarget->DespawnOrUnsummon(); return; } - // Tear of Azzinoth Summon Channel - it's not really supposed to do anything,and this only prevents the console spam + // Tear of Azzinoth Summon Channel - it's not really supposed to do anything, and this only prevents the console spam case 39857: triggerSpellId = 39856; break; @@ -2356,7 +2356,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const case 28820: { // Need remove self if Lightning Shield not active - if (!target->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN,0x400)) + if (!target->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x400)) target->RemoveAurasDueToSpell(28820); return; } @@ -2374,7 +2374,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const } if (all) - caster->CastSpell(target,38437,true, NULL, this); + caster->CastSpell(target, 38437, true, NULL, this); else target->RemoveAurasDueToSpell(38437); return; @@ -2460,7 +2460,7 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const Creature* c = triggerTarget->ToCreature(); if (!c || (c && !sScriptMgr->OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) || (c && !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex())))) - sLog->outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); + sLog->outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?", GetId(), GetEffIndex()); } } @@ -2482,7 +2482,7 @@ void AuraEffect::TriggerSpellWithValue(Unit * target, Unit * caster) const triggerCaster->CastCustomSpell(triggerTarget, triggerSpellId, &basepoints0, 0, 0, true, 0, this); } else - sLog->outError("AuraEffect::TriggerSpellWithValue: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex()); + sLog->outError("AuraEffect::TriggerSpellWithValue: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?", GetId(), GetEffIndex()); } bool AuraEffect::IsAffectedOnSpell(SpellEntry const *spell) const @@ -2733,7 +2733,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit * target, bool apply) const if (pl->HasSpell(63410) || pl->HasSpell(63411)) { target->RemoveAurasDueToSpell(66530); - target->CastSpell(target,66530,true); + target->CastSpell(target, 66530, true); } } @@ -3145,7 +3145,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const * aurApp, uint8 m break; case FORM_BEAR: case FORM_DIREBEAR: - if (urand(0,99) < FurorChance) + if (urand(0, 99) < FurorChance) target->CastSpell(target, 17057, true); default: { @@ -3206,7 +3206,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const * aurApp, uint8 m // Defensive Tactics if (form == FORM_DEFENSIVESTANCE) { - if (AuraEffect const * aurEff = target->IsScriptOverriden(m_spellProto,831)) + if (AuraEffect const * aurEff = target->IsScriptOverriden(m_spellProto, 831)) Rage_val += aurEff->GetAmount() * 10; } // Stance mastery + Tactical mastery (both passive, and last have aura only in defense stance, but need apply at any stance switch) @@ -3218,11 +3218,11 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const * aurApp, uint8 m if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled) continue; SpellEntry const *spellInfo = sSpellStore.LookupEntry(itr->first); if (spellInfo && spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellIconID == 139) - Rage_val += target->CalculateSpellDamage(target,spellInfo,0) * 10; + Rage_val += target->CalculateSpellDamage(target, spellInfo, 0) * 10; } } if (target->GetPower(POWER_RAGE) > Rage_val) - target->SetPower(POWER_RAGE,Rage_val); + target->SetPower(POWER_RAGE, Rage_val); break; } default: @@ -3374,7 +3374,7 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode, // Dragonmaw Illusion (set mount model also) if (GetId() == 42016 && target->GetMountID() && !target->GetAuraEffectsByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED).empty()) - target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314); + target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314); } } } @@ -3416,11 +3416,11 @@ void AuraEffect::HandleAuraTransform(AuraApplication const * aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) team = target->ToPlayer()->GetTeam(); - uint32 displayID = sObjectMgr->ChooseDisplayId(team,ci); + uint32 displayID = sObjectMgr->ChooseDisplayId(team, ci); CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID); - target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,displayID); + target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayID); } } } @@ -3434,7 +3434,7 @@ void AuraEffect::HandleAuraModScale(AuraApplication const * aurApp, uint8 mode, Unit * target = aurApp->GetTarget(); - target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X,(float)GetAmount(),apply); + target->ApplyPercentModFloatValue(OBJECT_FIELD_SCALE_X, (float)GetAmount(), apply); } void AuraEffect::HandleAuraCloneCaster(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -3483,7 +3483,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9); data<<target->GetGUID(); data<<uint8(0); - target->SendMessageToSet(&data,true); + target->SendMessageToSet(&data, true); */ UnitList targets; @@ -3531,7 +3531,7 @@ void AuraEffect::HandleFeignDeath(AuraApplication const * aurApp, uint8 mode, bo WorldPacket data(SMSG_FEIGN_DEATH_RESISTED, 9); data<<target->GetGUID(); data<<uint8(1); - target->SendMessageToSet(&data,true); + target->SendMessageToSet(&data, true); */ // blizz like 2.0.x target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_29); @@ -3767,7 +3767,7 @@ void AuraEffect::HandleAuraTrackStealthed(AuraApplication const * aurApp, uint8 if (target->HasAuraType(GetAuraType())) return; } - target->ApplyModFlag(PLAYER_FIELD_BYTES,PLAYER_FIELD_BYTE_TRACK_STEALTHED,apply); + target->ApplyModFlag(PLAYER_FIELD_BYTES, PLAYER_FIELD_BYTE_TRACK_STEALTHED, apply); } void AuraEffect::HandleAuraModStalked(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -3837,7 +3837,7 @@ void AuraEffect::HandleAuraModSkill(AuraApplication const * aurApp, uint8 /*mode uint32 prot = GetMiscValue(); int32 points = GetAmount(); - target->ToPlayer()->ModifySkillBonus(prot,((apply) ? points: -points),GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT); + target->ToPlayer()->ModifySkillBonus(prot, ((apply) ? points: -points), GetAuraType() == SPELL_AURA_MOD_SKILL_TALENT); if (prot == SKILL_DEFENSE) target->ToPlayer()->UpdateDefenseBonusesMod(); } @@ -3869,7 +3869,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry); if (!ci) { - sLog->outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)",GetMiscValue()); + sLog->outErrorDb("AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue()); return; } @@ -3877,7 +3877,7 @@ void AuraEffect::HandleAuraMounted(AuraApplication const * aurApp, uint8 mode, b if (target->GetTypeId() == TYPEID_PLAYER) team = target->ToPlayer()->GetTeam(); - uint32 displayID = sObjectMgr->ChooseDisplayId(team,ci); + uint32 displayID = sObjectMgr->ChooseDisplayId(team, ci); CreatureModelInfo const *minfo = sObjectMgr->GetCreatureModelRandomGender(displayID); //some spell has one aura of mount and one of vehicle @@ -3951,7 +3951,7 @@ void AuraEffect::HandleAuraWaterWalk(AuraApplication const * aurApp, uint8 mode, data.Initialize(SMSG_MOVE_LAND_WALK, 8+4); data.append(target->GetPackGUID()); data << uint32(0); - target->SendMessageToSet(&data,true); + target->SendMessageToSet(&data, true); } void AuraEffect::HandleAuraFeatherFall(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -4003,7 +4003,7 @@ void AuraEffect::HandleAuraHover(AuraApplication const * aurApp, uint8 mode, boo data.Initialize(SMSG_MOVE_UNSET_HOVER, 8+4); data.append(target->GetPackGUID()); data << uint32(0); - target->SendMessageToSet(&data,true); + target->SendMessageToSet(&data, true); } void AuraEffect::HandleWaterBreathing(AuraApplication const * aurApp, uint8 mode, bool /*apply*/) const @@ -4334,11 +4334,11 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(AuraApplication const * aurApp { //Players on flying mounts must be immune to polymorph if (target->GetTypeId() == TYPEID_PLAYER) - target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,MECHANIC_POLYMORPH,apply); + target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply); // Dragonmaw Illusion (overwrite mount model, mounted aura already applied) - if (apply && target->HasAuraEffect(42016,0) && target->GetMountID()) - target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314); + if (apply && target->HasAuraEffect(42016, 0) && target->GetMountID()) + target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 16314); } } @@ -4504,14 +4504,14 @@ void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const * aurApp, uin bg->EventPlayerDroppedFlag(target->ToPlayer()); } else - sOutdoorPvPMgr->HandleDropFlag((Player*)target,GetSpellProto()->Id); + sOutdoorPvPMgr->HandleDropFlag((Player*)target, GetSpellProto()->Id); } } // stop handling the effect if it was removed by linked event if (apply && aurApp->GetRemoveMode()) return; - target->ApplySpellImmune(GetId(),IMMUNITY_EFFECT,GetMiscValue(),apply); + target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply); } void AuraEffect::HandleAuraModStateImmunity(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -4545,7 +4545,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin if (apply && aurApp->GetRemoveMode()) return; - target->ApplySpellImmune(GetId(),IMMUNITY_SCHOOL,GetMiscValue(),(apply)); + target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply)); // remove all flag auras (they are positive, but they must be removed when you are immune) if (GetSpellProto()->AttributesEx & SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY @@ -4563,7 +4563,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const * aurApp, uin { SpellEntry const *spell = iter->second->GetBase()->GetSpellProto(); if ((GetSpellSchoolMask(spell) & school_mask)//Check for school mask - && CanSpellDispelAura(GetSpellProto(),spell) + && CanSpellDispelAura(GetSpellProto(), spell) && !iter->second->IsPositive() //Don't remove positive spells && spell->Id != GetId()) //Don't remove self { @@ -4605,7 +4605,7 @@ void AuraEffect::HandleAuraModDmgImmunity(AuraApplication const * aurApp, uint8 Unit * target = aurApp->GetTarget(); - target->ApplySpellImmune(GetId(),IMMUNITY_DAMAGE,GetMiscValue(), apply); + target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply); } void AuraEffect::HandleAuraModDispelImmunity(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -4661,7 +4661,7 @@ void AuraEffect::HandleAuraModResistance(AuraApplication const * aurApp, uint8 m { target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(GetAmount()), apply); if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet()) - target->ApplyResistanceBuffModsMod(SpellSchools(x),GetAmount() > 0,(float)GetAmount(), apply); + target->ApplyResistanceBuffModsMod(SpellSchools(x), GetAmount() > 0, (float)GetAmount(), apply); } } } @@ -4704,8 +4704,8 @@ void AuraEffect::HandleModResistancePercent(AuraApplication const * aurApp, uint target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + i), TOTAL_PCT, float(GetAmount()), apply); if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet()) { - target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),true,(float)GetAmount(), apply); - target->ApplyResistanceBuffModsPercentMod(SpellSchools(i),false,(float)GetAmount(), apply); + target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), true, (float)GetAmount(), apply); + target->ApplyResistanceBuffModsPercentMod(SpellSchools(i), false, (float)GetAmount(), apply); } } } @@ -4744,11 +4744,11 @@ void AuraEffect::HandleModTargetResistance(AuraApplication const * aurApp, uint8 // show armor penetration if (target->GetTypeId() == TYPEID_PLAYER && (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)) - target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE,GetAmount(), apply); + target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_PHYSICAL_RESISTANCE, GetAmount(), apply); // show as spell penetration only full spell penetration bonuses (all resistances except armor and holy if (target->GetTypeId() == TYPEID_PLAYER && (GetMiscValue() & SPELL_SCHOOL_MASK_SPELL) == SPELL_SCHOOL_MASK_SPELL) - target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,GetAmount(), apply); + target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE, GetAmount(), apply); } /********************************/ @@ -4764,7 +4764,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const * aurApp, uint8 mode, b if (GetMiscValue() < -2 || GetMiscValue() > 4) { - sLog->outError("WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ",GetId(),GetEffIndex(),GetMiscValue()); + sLog->outError("WARNING: Spell %u effect %u has an unsupported misc value (%i) for SPELL_AURA_MOD_STAT ", GetId(), GetEffIndex(), GetMiscValue()); return; } @@ -4773,10 +4773,10 @@ void AuraEffect::HandleAuraModStat(AuraApplication const * aurApp, uint8 mode, b // -1 or -2 is all stats (misc < -2 checked in function beginning) if (GetMiscValue() < 0 || GetMiscValue() == i) { - //target->ApplyStatMod(Stats(i), m_amount,apply); + //target->ApplyStatMod(Stats(i), m_amount, apply); target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_VALUE, float(GetAmount()), apply); if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->isPet()) - target->ApplyStatBuffMod(Stats(i),(float)GetAmount(),apply); + target->ApplyStatBuffMod(Stats(i), (float)GetAmount(), apply); } } } @@ -5162,7 +5162,7 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const * aurApp, for (int i = 0; i < MAX_ATTACK; ++i) if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem,WeaponAttackType(i),this,apply); + target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply); // mods must be applied base at equipped weapon class and subclass comparison // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask @@ -5272,7 +5272,7 @@ void AuraEffect::HandleModCastingSpeed(AuraApplication const * aurApp, uint8 mod Unit * target = aurApp->GetTarget(); - target->ApplyCastTimePercentMod((float)GetAmount(),apply); + target->ApplyCastTimePercentMod((float)GetAmount(), apply); } void AuraEffect::HandleModMeleeRangedSpeedPct(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -5282,8 +5282,8 @@ void AuraEffect::HandleModMeleeRangedSpeedPct(AuraApplication const * aurApp, ui Unit * target = aurApp->GetTarget(); - target->ApplyAttackTimePercentMod(BASE_ATTACK,(float)GetAmount(),apply); - target->ApplyAttackTimePercentMod(OFF_ATTACK,(float)GetAmount(),apply); + target->ApplyAttackTimePercentMod(BASE_ATTACK, (float)GetAmount(), apply); + target->ApplyAttackTimePercentMod(OFF_ATTACK, (float)GetAmount(), apply); target->ApplyAttackTimePercentMod(RANGED_ATTACK, (float)GetAmount(), apply); } @@ -5294,9 +5294,9 @@ void AuraEffect::HandleModCombatSpeedPct(AuraApplication const * aurApp, uint8 m Unit * target = aurApp->GetTarget(); - target->ApplyCastTimePercentMod(float(m_amount),apply); - target->ApplyAttackTimePercentMod(BASE_ATTACK,float(GetAmount()),apply); - target->ApplyAttackTimePercentMod(OFF_ATTACK,float(GetAmount()),apply); + target->ApplyCastTimePercentMod(float(m_amount), apply); + target->ApplyAttackTimePercentMod(BASE_ATTACK, float(GetAmount()), apply); + target->ApplyAttackTimePercentMod(OFF_ATTACK, float(GetAmount()), apply); target->ApplyAttackTimePercentMod(RANGED_ATTACK, float(GetAmount()), apply); } @@ -5475,7 +5475,7 @@ void AuraEffect::HandleModDamageDone(AuraApplication const * aurApp, uint8 mode, { for (int i = 0; i < MAX_ATTACK; ++i) if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true)) - target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem,WeaponAttackType(i),this,apply); + target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply); } // GetMiscValue() is bitmask of spell schools @@ -5499,9 +5499,9 @@ void AuraEffect::HandleModDamageDone(AuraApplication const * aurApp, uint8 mode, if (target->GetTypeId() == TYPEID_PLAYER) { if (GetAmount() > 0) - target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,GetAmount(),apply); + target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, GetAmount(), apply); else - target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,GetAmount(),apply); + target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, GetAmount(), apply); } } else @@ -5532,7 +5532,7 @@ void AuraEffect::HandleModDamageDone(AuraApplication const * aurApp, uint8 mode, for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++) { if ((GetMiscValue() & (1<<i)) != 0) - target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i,GetAmount(),apply); + target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, GetAmount(), apply); } } else @@ -5540,7 +5540,7 @@ void AuraEffect::HandleModDamageDone(AuraApplication const * aurApp, uint8 mode, for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++) { if ((GetMiscValue() & (1<<i)) != 0) - target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i,GetAmount(),apply); + target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i, GetAmount(), apply); } } if (Guardian* pet = target->ToPlayer()->GetGuardianPet()) @@ -5612,7 +5612,7 @@ void AuraEffect::HandleModPowerCost(AuraApplication const * aurApp, uint8 mode, for (int i = 0; i < MAX_SPELL_SCHOOL; ++i) if (GetMiscValue() & (1<<i)) - target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i,GetAmount(),apply); + target->ApplyModInt32Value(UNIT_FIELD_POWER_COST_MODIFIER+i, GetAmount(), apply); } void AuraEffect::HandleArenaPreparation(AuraApplication const * aurApp, uint8 mode, bool apply) const @@ -5666,7 +5666,7 @@ void AuraEffect::HandleAuraRetainComboPoints(AuraApplication const * aurApp, uin // combo points was added in SPELL_EFFECT_ADD_COMBO_POINTS handler // remove only if aura expire by time (in case combo points amount change aura removed without combo points lost) if (!(apply) && GetBase()->GetDuration() == 0 && target->ToPlayer()->GetComboTarget()) - if (Unit* unit = ObjectAccessor::GetUnit(*target,target->ToPlayer()->GetComboTarget())) + if (Unit* unit = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget())) target->ToPlayer()->AddComboPoints(unit, -GetAmount()); } @@ -5702,11 +5702,11 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo { // Unrelenting Assault, rank 1 case 46859: - target->CastSpell(target,64849,true,NULL,aurEff); + target->CastSpell(target, 64849, true, NULL, aurEff); break; // Unrelenting Assault, rank 2 case 46860: - target->CastSpell(target,64850,true,NULL,aurEff); + target->CastSpell(target, 64850, true, NULL, aurEff); break; } } @@ -5720,7 +5720,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo case 13139: // net-o-matic // root to self part of (root_target->charge->root_self sequence if (caster) - caster->CastSpell(caster,13138,true,NULL,this); + caster->CastSpell(caster, 13138, true, NULL, this); break; case 34026: // kill command { @@ -5728,10 +5728,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo if (!pet) break; - target->CastSpell(target,34027,true,NULL,this); + target->CastSpell(target, 34027, true, NULL, this); // set 3 stacks and 3 charges (to make all auras not disappear at once) - Aura * owner_aura = target->GetAura(34027,GetCasterGUID()); + Aura * owner_aura = target->GetAura(34027, GetCasterGUID()); Aura * pet_aura = pet->GetAura(58914, GetCasterGUID()); if (owner_aura) { @@ -5751,10 +5751,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo switch(caster->getGender()) { case GENDER_FEMALE: - caster->CastSpell(target,37095,true,NULL,this); // Blood Elf Disguise + caster->CastSpell(target, 37095, true, NULL, this); // Blood Elf Disguise break; case GENDER_MALE: - caster->CastSpell(target,37093,true,NULL,this); + caster->CastSpell(target, 37093, true, NULL, this); break; default: break; @@ -5764,9 +5764,9 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo } case 55198: // Tidal Force { - target->CastSpell(target,55166,true,NULL,this); + target->CastSpell(target, 55166, true, NULL, this); // set 3 stacks and 3 charges (to make all auras not disappear at once) - Aura * owner_aura = target->GetAura(55166,GetCasterGUID()); + Aura * owner_aura = target->GetAura(55166, GetCasterGUID()); if (owner_aura) { // This aura lasts 2 sec, need this hack to properly proc spells @@ -5791,10 +5791,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo switch(caster->getGender()) { case GENDER_FEMALE: - caster->CastSpell(target,46356,true,NULL,this); + caster->CastSpell(target, 46356, true, NULL, this); break; case GENDER_MALE: - caster->CastSpell(target,46355,true,NULL,this); + caster->CastSpell(target, 46355, true, NULL, this); break; } } @@ -5818,7 +5818,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo break; case 52916: // Honor Among Thieves if (target->GetTypeId() == TYPEID_PLAYER) - if (Unit * spellTarget = ObjectAccessor::GetUnit(*target,target->ToPlayer()->GetComboTarget())) + if (Unit * spellTarget = ObjectAccessor::GetUnit(*target, target->ToPlayer()->GetComboTarget())) target->CastSpell(spellTarget, 51699, true); break; case 28832: // Mark of Korth'azz @@ -5914,10 +5914,10 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo break; } case 42783: // Wrath of the Astromancer - target->CastSpell(target,GetAmount(),true,NULL,this); + target->CastSpell(target, GetAmount(), true, NULL, this); break; case 46308: // Burning Winds casted only at creatures at spawn - target->CastSpell(target,47287,true,NULL,this); + target->CastSpell(target, 47287, true, NULL, this); break; case 52172: // Coyote Spirit Despawn Aura case 60244: // Blood Parrot Despawn Aura @@ -5974,7 +5974,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo { int32 damage = aurEff->GetAmount()*4; // backfire damage - target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL,GetCasterGUID()); + target->CastCustomSpell(target, 64085, &damage, NULL, NULL, true, NULL, NULL, GetCasterGUID()); } } break; @@ -5986,7 +5986,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo case SPELLFAMILY_DEATHKNIGHT: // Summon Gargoyle (will start feeding gargoyle) if (GetId() == 61777) - target->CastSpell(target,m_spellProto->EffectTriggerSpell[m_effIndex],true); + target->CastSpell(target, m_spellProto->EffectTriggerSpell[m_effIndex], true); break; default: break; @@ -6054,7 +6054,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo if (owner && owner->GetTypeId() == TYPEID_PLAYER) { if (apply) - owner->CastSpell(owner,8985,true); + owner->CastSpell(owner, 8985, true); else owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); } @@ -6070,7 +6070,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const * aurApp, uint8 mode, boo if (owner && owner->GetTypeId() == TYPEID_PLAYER) { if (apply) - owner->CastSpell(owner,19704,true); + owner->CastSpell(owner, 19704, true); else owner->ToPlayer()->RemovePet(NULL, PET_SAVE_NOT_IN_SLOT, true); } @@ -6364,7 +6364,7 @@ void AuraEffect::HandleForceReaction(AuraApplication const * aurApp, uint8 mode, uint32 faction_id = GetMiscValue(); ReputationRank faction_rank = ReputationRank(m_amount); - player->GetReputationMgr().ApplyForceReaction(faction_id,faction_rank,apply); + player->GetReputationMgr().ApplyForceReaction(faction_id, faction_rank, apply); player->GetReputationMgr().SendForceReactions(); // stop fighting if at apply forced rank friendly or at remove real rank friendly @@ -6484,7 +6484,7 @@ void AuraEffect::HandleAuraLinked(AuraApplication const * aurApp, uint8 mode, bo if (GetAmount()) caster->CastCustomSpell(target, m_spellProto->EffectTriggerSpell[m_effIndex], &m_amount, NULL, NULL, true, NULL, this); else - caster->CastSpell(target, m_spellProto->EffectTriggerSpell[m_effIndex],true, NULL, this); + caster->CastSpell(target, m_spellProto->EffectTriggerSpell[m_effIndex], true, NULL, this); } else target->RemoveAura(m_spellProto->EffectTriggerSpell[m_effIndex], GetCasterGUID(), 0, AuraRemoveMode(aurApp->GetRemoveMode())); diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index ccfa848811f..b8967aa1845 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -190,7 +190,7 @@ void AuraApplication::ClientUpdate(bool remove) { ASSERT(!m_target->GetVisibleAura(m_slot)); data << uint32(0); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u removed slot %u",GetBase()->GetId(), m_slot); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Aura %u removed slot %u", GetBase()->GetId(), m_slot); m_target->SendMessageToSet(&data, true); return; } @@ -245,7 +245,7 @@ Aura * Aura::TryCreate(SpellEntry const* spellproto, uint8 tryEffMask, WorldObje break; } if (uint8 realMask = effMask & tryEffMask) - return Create(spellproto,realMask,owner,caster,baseAmount,castItem,casterGUID); + return Create(spellproto, realMask, owner, caster, baseAmount, castItem, casterGUID); return NULL; } @@ -276,7 +276,7 @@ Aura * Aura::TryCreate(SpellEntry const* spellproto, WorldObject * owner, Unit * break; } if (effMask) - return Create(spellproto,effMask,owner,caster,baseAmount,castItem,casterGUID); + return Create(spellproto, effMask, owner, caster, baseAmount, castItem, casterGUID); return NULL; } @@ -424,7 +424,7 @@ void Aura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * auraA if (m_spellProto->Attributes & SPELL_ATTR0_DISABLED_WHILE_ACTIVE) { Item* castItem = m_castItemGuid ? caster->ToPlayer()->GetItemByGuid(m_castItemGuid) : NULL; - caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellProto,castItem ? castItem->GetEntry() : 0, NULL,true); + caster->ToPlayer()->AddSpellAndCategoryCooldowns(m_spellProto, castItem ? castItem->GetEntry() : 0, NULL, true); } } } @@ -902,18 +902,18 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (saBounds.first != saBounds.second) { uint32 zone, area; - target->GetZoneAndAreaId(zone,area); + target->GetZoneAndAreaId(zone, area); for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) { // some auras remove at aura remove - if (!itr->second->IsFitToRequirements((Player*)target,zone,area)) + if (!itr->second->IsFitToRequirements((Player*)target, zone, area)) target->RemoveAurasDueToSpell(itr->second->spellId); // some auras applied at aura apply else if (itr->second->autocast) { if (!target->HasAura(itr->second->spellId)) - target->CastSpell(target,itr->second->spellId,true); + target->CastSpell(target, itr->second->spellId, true); } } } @@ -978,9 +978,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, { // Glyph of the Penguin if (caster->HasAura(52648)) - caster->CastSpell(target,61635,true); + caster->CastSpell(target, 61635, true); else - caster->CastSpell(target,61634,true); + caster->CastSpell(target, 61634, true); } } switch(GetId()) @@ -1026,7 +1026,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (target->GetTypeId() == TYPEID_PLAYER) if (GameObject* obj = target->GetGameObject(48018)) { - target->ToPlayer()->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation()); + target->ToPlayer()->TeleportTo(obj->GetMapId(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation()); target->ToPlayer()->RemoveMovementImpairingAuras(); } break; @@ -1059,7 +1059,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, else if (m_spellProto->SpellFamilyFlags[0] & 0x1 && m_spellProto->SpellFamilyFlags[2] & 0x400 && GetEffect(0)) { // Glyph of Power Word: Shield - if (AuraEffect* glyph = caster->GetAuraEffect(55672,0)) + if (AuraEffect* glyph = caster->GetAuraEffect(55672, 0)) { // instantly heal m_amount% of the absorb-value int32 heal = glyph->GetAmount() * GetEffect(0)->GetAmount()/100; @@ -1217,7 +1217,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (removeMode != AURA_REMOVE_BY_DEFAULT) { // Improved Spell Reflection - if (caster->GetDummyAuraEffect(SPELLFAMILY_WARRIOR,1935, 1)) + if (caster->GetDummyAuraEffect(SPELLFAMILY_WARRIOR, 1935, 1)) { // aura remove - remove auras from all party members std::list<Unit*> PartyMembers; @@ -1413,7 +1413,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (apply) target->CastSpell(caster, 59665, true, 0, 0, caster->GetGUID()); else - target->SetReducedThreatPercent(0,0); + target->SetReducedThreatPercent(0, 0); break; } break; @@ -1425,20 +1425,20 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (AuraEffect const * aurEff = target->GetAuraEffectOfRankedSpell(31221, 0)) { if (!apply) - target->CastSpell(target,31666,true); + target->CastSpell(target, 31666, true); else { int32 basepoints0 = aurEff->GetAmount(); - target->CastCustomSpell(target,31665, &basepoints0, NULL, NULL ,true); + target->CastCustomSpell(target, 31665, &basepoints0, NULL, NULL , true); } } // Overkill if (target->HasAura(58426)) { if (!apply) - target->CastSpell(target,58428,true); + target->CastSpell(target, 58428, true); else - target->CastSpell(target,58427,true); + target->CastSpell(target, 58427, true); } break; } @@ -1477,7 +1477,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, if (apply) { if ((GetSpellProto()->Id == 31821 && target->HasAura(19746, GetCasterGUID())) || (GetSpellProto()->Id == 19746 && target->HasAura(31821))) - target->CastSpell(target,64364,true); + target->CastSpell(target, 64364, true); } else target->RemoveAurasDueToSpell(64364, GetCasterGUID()); @@ -1530,7 +1530,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, else if (bloodPresenceAura) { int32 basePoints1=bloodPresenceAura->GetAmount(); - target->CastCustomSpell(target,63611,NULL,&basePoints1,NULL,true,0,bloodPresenceAura); + target->CastCustomSpell(target, 63611, NULL, &basePoints1, NULL, true, 0, bloodPresenceAura); } // Frost Presence bonus if (presence == 48263) @@ -1538,7 +1538,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, else if (frostPresenceAura) { int32 basePoints0=frostPresenceAura->GetAmount(); - target->CastCustomSpell(target,61261,&basePoints0,NULL,NULL,true,0,frostPresenceAura); + target->CastCustomSpell(target, 61261, &basePoints0, NULL, NULL, true, 0, frostPresenceAura); } // Unholy Presence bonus if (presence == 48265) @@ -1547,15 +1547,15 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster, { // Not listed as any effect, only base points set int32 basePoints0 = SpellMgr::CalculateSpellEffectAmount(unholyPresenceAura->GetSpellProto(), 1); - target->CastCustomSpell(target,63622,&basePoints0 ,&basePoints0,&basePoints0,true,0,unholyPresenceAura); - target->CastCustomSpell(target,65095,&basePoints0 ,NULL,NULL,true,0,unholyPresenceAura); + target->CastCustomSpell(target, 63622, &basePoints0 , &basePoints0, &basePoints0, true, 0, unholyPresenceAura); + target->CastCustomSpell(target, 65095, &basePoints0 , NULL, NULL, true, 0, unholyPresenceAura); } - target->CastSpell(target,49772, true); + target->CastSpell(target, 49772, true); } else if (unholyPresenceAura) { int32 basePoints0=unholyPresenceAura->GetAmount(); - target->CastCustomSpell(target,49772,&basePoints0,NULL,NULL,true,0,unholyPresenceAura); + target->CastCustomSpell(target, 49772, &basePoints0, NULL, NULL, true, 0, unholyPresenceAura); } } else @@ -1880,7 +1880,7 @@ void UnitAura::_ApplyForTarget(Unit * target, Unit * caster, AuraApplication * a // register aura diminishing on apply if (DiminishingGroup group = GetDiminishGroup()) - target->ApplyDiminishingAura(group,true); + target->ApplyDiminishingAura(group, true); } void UnitAura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aurApp) @@ -1889,7 +1889,7 @@ void UnitAura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * // unregister aura diminishing (and store last time) if (DiminishingGroup group = GetDiminishGroup()) - target->ApplyDiminishingAura(group,false); + target->ApplyDiminishingAura(group, false); } void UnitAura::Remove(AuraRemoveMode removeMode) diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 0b4de8fab74..79b671c9202 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -770,7 +770,7 @@ void Spell::SelectSpellTargets() AddUnitTarget(m_targets.getUnitTarget(), i); else if (m_targets.getCorpseTargetGUID()) { - Corpse *corpse = ObjectAccessor::GetCorpse(*m_caster,m_targets.getCorpseTargetGUID()); + Corpse *corpse = ObjectAccessor::GetCorpse(*m_caster, m_targets.getCorpseTargetGUID()); if (corpse) { Player* owner = ObjectAccessor::FindPlayer(corpse->GetOwnerGUID()); @@ -1111,7 +1111,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Get mask of effects for target uint8 mask = target->effectMask; - Unit* unit = m_caster->GetGUID() == target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster,target->targetGUID); + Unit* unit = m_caster->GetGUID() == target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target->targetGUID); if (!unit) { uint8 farMask = 0; @@ -1133,7 +1133,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) for(uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { if (farMask & (1<<i)) - HandleEffects(unit,NULL,NULL,i); + HandleEffects(unit, NULL, NULL, i); } return; } @@ -1286,7 +1286,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // Add bonuses and fill damageInfo struct caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo, m_attackType, target->crit); - caster->DealDamageMods(damageInfo.target,damageInfo.damage,&damageInfo.absorb); + caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); // Send log damage message to client caster->SendSpellNonMeleeDamageLog(&damageInfo); @@ -1354,7 +1354,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) // ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm...) if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->isPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive()) if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself()) - p->CastedCreatureOrGO(spellHitTarget->GetEntry(),spellHitTarget->GetGUID(),m_spellInfo->Id); + p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id); } if (m_caster && m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled) @@ -1441,7 +1441,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool } // Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add - m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo,m_triggeredByAuraSpell); + m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo, m_triggeredByAuraSpell); if (m_diminishGroup) { m_diminishLevel = unit->GetDiminishing(m_diminishGroup); @@ -1464,7 +1464,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool int32 basePoints[3]; if (scaleAura) { - aurSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(m_spellInfo,unitTarget->getLevel()); + aurSpellInfo = sSpellMgr->SelectAuraRankForPlayerLevel(m_spellInfo, unitTarget->getLevel()); ASSERT(aurSpellInfo); for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { @@ -1480,13 +1480,13 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool if (m_originalCaster) { m_spellAura = Aura::TryCreate(aurSpellInfo, effectMask, unit, - m_originalCaster,(aurSpellInfo == m_spellInfo)? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem); + m_originalCaster, (aurSpellInfo == m_spellInfo)? &m_spellValue->EffectBasePoints[0] : &basePoints[0], m_CastItem); if (m_spellAura) { // Now Reduce spell duration using data received at spell hit int32 duration = m_spellAura->GetMaxDuration(); - int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup,aurSpellInfo); - float diminishMod = unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel,limitduration); + int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup, aurSpellInfo); + float diminishMod = unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel, limitduration); // unit is immune to aura if it was diminished to 0 duration if (diminishMod == 0.0f) @@ -1525,7 +1525,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask, bool for (uint32 effectNumber = 0; effectNumber < MAX_SPELL_EFFECTS; ++effectNumber) { if (effectMask & (1<<effectNumber)) - HandleEffects(unit,NULL,NULL,effectNumber); + HandleEffects(unit, NULL, NULL, effectNumber); } return SPELL_MISS_NONE; @@ -1623,7 +1623,7 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo *target) if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive()) { if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself()) - p->CastedCreatureOrGO(go->GetEntry(),go->GetGUID(),m_spellInfo->Id); + p->CastedCreatureOrGO(go->GetEntry(), go->GetGUID(), m_spellInfo->Id); } CallScriptAfterHitHandlers(); } @@ -1683,7 +1683,7 @@ bool Spell::UpdateChanneledTargetList() { if (AuraApplication * aurApp = unit->GetAuraApplication(m_spellInfo->Id, m_originalCasterGUID)) { - if (m_caster != unit && !m_caster->IsWithinDistInMap(unit,range)) + if (m_caster != unit && !m_caster->IsWithinDistInMap(unit, range)) { ihit->effectMask &= ~aurApp->GetEffectMask(); unit->RemoveAura(aurApp); @@ -2307,7 +2307,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) break; case TARGET_DST_HOME: if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_targets.setDst(m_caster->ToPlayer()->m_homebindX,m_caster->ToPlayer()->m_homebindY,m_caster->ToPlayer()->m_homebindZ, m_caster->ToPlayer()->GetOrientation(), m_caster->ToPlayer()->m_homebindMapId); + m_targets.setDst(m_caster->ToPlayer()->m_homebindX, m_caster->ToPlayer()->m_homebindY, m_caster->ToPlayer()->m_homebindZ, m_caster->ToPlayer()->GetOrientation(), m_caster->ToPlayer()->m_homebindMapId); break; case TARGET_DST_NEARBY_ENTRY: { @@ -2559,7 +2559,7 @@ void Spell::SelectEffectTargets(uint32 i, uint32 cur) else { if (m_caster->GetTypeId() == TYPEID_PLAYER) - m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id,true); + m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true); SendCastResult(SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW); finish(false); } @@ -3057,7 +3057,7 @@ void Spell::cancel() m_caster->ToPlayer()->RemoveGlobalCooldown(m_spellInfo); m_caster->RemoveDynObject(m_spellInfo->Id); - m_caster->RemoveGameObject(m_spellInfo->Id,true); + m_caster->RemoveGameObject(m_spellInfo->Id, true); //set state back so finish will be processed m_spellState = oldState; @@ -3265,7 +3265,7 @@ void Spell::cast(bool skipCheck) case SPELL_EFFECT_JUMP_DEST: case SPELL_EFFECT_LEAP_BACK: case SPELL_EFFECT_ACTIVATE_RUNE: - HandleEffects(NULL,NULL,NULL,i); + HandleEffects(NULL, NULL, NULL, i); m_effectMask |= (1<<i); break; } @@ -3544,7 +3544,7 @@ void Spell::SendSpellCooldown() if (m_spellInfo->Attributes & (SPELL_ATTR0_DISABLED_WHILE_ACTIVE | SPELL_ATTR0_PASSIVE) || m_IsTriggeredSpell) return; - _player->AddSpellAndCategoryCooldowns(m_spellInfo,m_CastItem ? m_CastItem->GetEntry() : 0, this); + _player->AddSpellAndCategoryCooldowns(m_spellInfo, m_CastItem ? m_CastItem->GetEntry() : 0, this); } void Spell::update(uint32 difftime) @@ -4313,7 +4313,7 @@ void Spell::TakeCastItem() { // This code is to avoid a crash // I'm not sure, if this is really an error, but I guess every item needs a prototype - sLog->outError("Cast item has no item prototype highId=%d, lowId=%d",m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow()); + sLog->outError("Cast item has no item prototype highId=%d, lowId=%d", m_CastItem->GetGUIDHigh(), m_CastItem->GetGUIDLow()); return; } @@ -4641,7 +4641,7 @@ void Spell::HandleThreatSpells(uint32 spellId) sLog->outStaticDebug("Spell %u, rank %u, added an additional %i threat", spellId, sSpellMgr->GetSpellRank(spellId), threat); } -void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i) +void Spell::HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGOTarget, uint32 i) { //effect has been handled, skip it if (m_effectMask & (1<<i)) @@ -4904,7 +4904,7 @@ SpellCastResult Spell::CheckCast(bool strict) } // who can give me an example to show what is the use of this - // even if we need check, check by effect rather than whole spell, otherwise 57108,57143 are broken + // even if we need check, check by effect rather than whole spell, otherwise 57108, 57143 are broken /* // TODO: this check can be applied and for player to prevent cheating when IsPositiveSpell will return always correct result. // check target for pet/charmed casts (not self targeted), self targeted cast used for area effects and etc @@ -4933,7 +4933,7 @@ SpellCastResult Spell::CheckCast(bool strict) //Must be behind the target. if (m_spellInfo->AttributesEx2 == SPELL_ATTR2_UNK20 && m_spellInfo->AttributesEx & SPELL_ATTR1_UNK9 && target->HasInArc(static_cast<float>(M_PI), m_caster) //Exclusion for Pounce: Facing Limitation was removed in 2.0.1, but it still uses the same, old Ex-Flags - && (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags.IsEqual(0x20000,0,0))) + && (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags.IsEqual(0x20000, 0, 0))) //Mutilate no longer requires you be behind the target as of patch 3.0.3 && (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellInfo->SpellFamilyFlags[1] & 0x200000)) //Exclusion for Throw: Facing limitation was added in 3.2.x, but that shouldn't be @@ -4973,9 +4973,9 @@ SpellCastResult Spell::CheckCast(bool strict) if (m_caster->GetTypeId() == TYPEID_UNIT || !m_caster->ToPlayer()->isGameMaster()) { uint32 zone, area; - m_caster->GetZoneAndAreaId(zone,area); + m_caster->GetZoneAndAreaId(zone, area); - SpellCastResult locRes= sSpellMgr->GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),zone,area, + SpellCastResult locRes= sSpellMgr->GetSpellAllowedInLocationError(m_spellInfo, m_caster->GetMapId(), zone, area, m_caster->GetTypeId() == TYPEID_PLAYER ? m_caster->ToPlayer() : NULL); if (locRes != SPELL_CAST_OK) return locRes; @@ -5061,7 +5061,7 @@ SpellCastResult Spell::CheckCast(bool strict) } else if (m_spellInfo->Id == 52264) // Deliver Stolen Horse { - if (!m_caster->FindNearestCreature(28653,5)) + if (!m_caster->FindNearestCreature(28653, 5)) return SPELL_FAILED_OUT_OF_RANGE; } else if (m_spellInfo->Id == 31789) // Righteous Defense @@ -5989,7 +5989,7 @@ SpellCastResult Spell::CheckItems() cell.data.Part.reserved = ALL_DISTRICT; GameObject* ok = NULL; - Trinity::GameObjectFocusCheck go_check(m_caster,m_spellInfo->RequiresSpellFocus); + Trinity::GameObjectFocusCheck go_check(m_caster, m_spellInfo->RequiresSpellFocus); Trinity::GameObjectSearcher<Trinity::GameObjectFocusCheck> checker(m_caster, ok, go_check); TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectFocusCheck>, GridTypeMapContainer > object_checker(checker); @@ -6051,7 +6051,7 @@ SpellCastResult Spell::CheckItems() { if (m_spellInfo->Totem[i] != 0) { - if (p_caster->HasItemCount(m_spellInfo->Totem[i],1)) + if (p_caster->HasItemCount(m_spellInfo->Totem[i], 1)) { totems -= 1; continue; @@ -6106,10 +6106,10 @@ SpellCastResult Spell::CheckItems() { if (!(m_spellInfo->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellInfo->SpellFamilyFlags[0] & 0x40000000))) return SPELL_FAILED_TOO_MANY_OF_ITEM; - else if (!(p_caster->HasItemCount(m_spellInfo->EffectItemType[i],1))) + else if (!(p_caster->HasItemCount(m_spellInfo->EffectItemType[i], 1))) return SPELL_FAILED_TOO_MANY_OF_ITEM; else - p_caster->CastSpell(m_caster,SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1),false); // move this to anywhere + p_caster->CastSpell(m_caster, SpellMgr::CalculateSpellEffectAmount(m_spellInfo, 1), false); // move this to anywhere return SPELL_FAILED_DONT_REPORT; } } @@ -6479,7 +6479,7 @@ void Spell::UpdatePointers() m_originalCaster = m_caster; else { - m_originalCaster = ObjectAccessor::GetUnit(*m_caster,m_originalCasterGUID); + m_originalCaster = ObjectAccessor::GetUnit(*m_caster, m_originalCasterGUID); if (m_originalCaster && !m_originalCaster->IsInWorld()) m_originalCaster = NULL; } diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h index 8bcbf656474..9b6d48624dd 100755 --- a/src/server/game/Spells/Spell.h +++ b/src/server/game/Spells/Spell.h @@ -492,7 +492,7 @@ class Spell void SendResurrectRequest(Player* target); void SendPlaySpellVisual(uint32 SpellID); - void HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i); + void HandleEffects(Unit *pUnitTarget, Item *pItemTarget, GameObject *pGOTarget, uint32 i); void HandleThreatSpells(uint32 spellId); const SpellEntry * const m_spellInfo; diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 9ac7521dd28..fb78807d15f 100755 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -577,7 +577,7 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex) // We are in Shadow Form if (m_caster->GetShapeshiftForm() == FORM_SHADOW) // We have Improved Mind Blast - if (AuraEffect * aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST,95,0)) + if (AuraEffect * aurEff = m_caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 95, 0)) // Chance has been successfully rolled if (roll_chance_i(aurEff->GetAmount())) m_caster->CastSpell(unitTarget, 48301, true); @@ -809,7 +809,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) case 12850: damage *= 0.32f; break; // Rank 2 case 12868: damage *= 0.48f; break; // Rank 3 default: - sLog->outError("Spell::EffectDummy: Spell %u not handled in DW",m_spellInfo->Id); + sLog->outError("Spell::EffectDummy: Spell %u not handled in DW", m_spellInfo->Id); return; }; @@ -838,7 +838,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) m_caster->CastCustomSpell(unitTarget, 26470, &damage, NULL, NULL, true); break; default: - sLog->outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u",m_triggeredByAuraSpell->Id); + sLog->outError("EffectDummy: Non-handled case for spell 13567 for triggered aura %u", m_triggeredByAuraSpell->Id); break; } return; @@ -942,13 +942,13 @@ void Spell::EffectDummy(SpellEffIndex effIndex) ? 29277 // Summon Purified Helboar Meat : 29278; // Summon Toxic Helboar Meat - m_caster->CastSpell(m_caster,spell_id,true,NULL); + m_caster->CastSpell(m_caster, spell_id, true, NULL); return; } case 29858: // Soulshatter if (unitTarget && unitTarget->CanHaveThreatList() && unitTarget->getThreatManager().getThreat(m_caster) > 0.0f) - m_caster->CastSpell(unitTarget,32835,true); + m_caster->CastSpell(unitTarget, 32835, true); return; case 30458: // Nigh Invulnerability if (!m_CastItem) return; @@ -1196,10 +1196,10 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } case 64385: // Unusual Compass { - m_caster->SetOrientation(float(urand(0,62832)) / 10000.0f); + m_caster->SetOrientation(float(urand(0, 62832)) / 10000.0f); WorldPacket data; m_caster->BuildHeartBeatMsg(&data); - m_caster->SendMessageToSet(&data,true); + m_caster->SendMessageToSet(&data, true); return; } case 53808: // Pygmy Oil @@ -1542,7 +1542,7 @@ void Spell::EffectDummy(SpellEffIndex effIndex) } // pet auras - if (PetAura const* petSpell = sSpellMgr->GetPetAura(m_spellInfo->Id,effIndex)) + if (PetAura const* petSpell = sSpellMgr->GetPetAura(m_spellInfo->Id, effIndex)) { m_caster->AddPetAura(petSpell); return; @@ -1571,14 +1571,14 @@ void Spell::EffectTriggerSpellWithValue(SpellEffIndex effIndex) if (!spellInfo) { - sLog->outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectTriggerSpellWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id); return; } int32 bp = damage; Unit * caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget); - caster->CastCustomSpell(unitTarget,triggered_spell_id,&bp,&bp,&bp,true); + caster->CastCustomSpell(unitTarget, triggered_spell_id, &bp, &bp, &bp, true); } void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex) @@ -1588,13 +1588,13 @@ void Spell::EffectTriggerRitualOfSummoning(SpellEffIndex effIndex) if (!spellInfo) { - sLog->outError("EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectTriggerRitualOfSummoning of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id); return; } finish(); - m_caster->CastSpell(unitTarget,spellInfo,false); + m_caster->CastSpell(unitTarget, spellInfo, false); } void Spell::EffectForceCast(SpellEffIndex effIndex) @@ -1609,7 +1609,7 @@ void Spell::EffectForceCast(SpellEffIndex effIndex) if (!spellInfo) { - sLog->outError("EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectForceCast of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id); return; } @@ -1649,7 +1649,7 @@ void Spell::EffectForceCastWithValue(SpellEffIndex effIndex) if (!spellInfo) { - sLog->outError("EffectForceCastWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectForceCastWithValue of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id); return; } int32 bp = damage; @@ -1664,7 +1664,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) if (!unitTarget) { if (gameObjTarget || itemTarget) - sLog->outError("Spell::EffectTriggerSpell (Spell: %u): Unsupported non-unit case!",m_spellInfo->Id); + sLog->outError("Spell::EffectTriggerSpell (Spell: %u): Unsupported non-unit case!", m_spellInfo->Id); return; } @@ -1793,7 +1793,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) SpellEntry const *spellInfo = sSpellStore.LookupEntry(triggered_spell_id); if (!spellInfo) { - sLog->outError("EffectTriggerSpell of spell %u: triggering unknown spell id %i", m_spellInfo->Id,triggered_spell_id); + sLog->outError("EffectTriggerSpell of spell %u: triggering unknown spell id %i", m_spellInfo->Id, triggered_spell_id); return; } @@ -1807,7 +1807,7 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) // so this just for speedup places in else Unit * caster = GetTriggeredSpellCaster(spellInfo, m_caster, unitTarget); - caster->CastSpell(unitTarget,spellInfo,true, 0, 0, (originalCaster ? originalCaster->GetGUID() : 0)); + caster->CastSpell(unitTarget, spellInfo, true, 0, 0, (originalCaster ? originalCaster->GetGUID() : 0)); } void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) @@ -1820,7 +1820,7 @@ void Spell::EffectTriggerMissileSpell(SpellEffIndex effIndex) if (!spellInfo) { sLog->outError("EffectTriggerMissileSpell of spell %u (eff: %u): triggering unknown spell id %u", - m_spellInfo->Id,effIndex,triggered_spell_id); + m_spellInfo->Id, effIndex, triggered_spell_id); return; } @@ -1843,15 +1843,15 @@ void Spell::EffectJump(SpellEffIndex effIndex) if (m_caster->isInFlight()) return; - float x,y,z,o; + float x, y, z, o; if (m_targets.getUnitTarget()) { - m_targets.getUnitTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE); + m_targets.getUnitTarget()->GetContactPoint(m_caster, x, y, z, CONTACT_DISTANCE); o = m_caster->GetOrientation(); } else if (m_targets.getGOTarget()) { - m_targets.getGOTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE); + m_targets.getGOTarget()->GetContactPoint(m_caster, x, y, z, CONTACT_DISTANCE); o = m_caster->GetOrientation(); } else @@ -1871,7 +1871,7 @@ void Spell::EffectJumpDest(SpellEffIndex effIndex) return; // Init dest coordinates - float x,y,z,o; + float x, y, z, o; if (m_targets.HasDst()) { m_targets.m_dstPos.GetPosition(x, y, z); @@ -1935,7 +1935,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) if (unitTarget->getLevel() > uiMaxSafeLevel) { - unitTarget->AddAura(60444,unitTarget); //Apply Lost! Aura + unitTarget->AddAura(60444, unitTarget); //Apply Lost! Aura return; } break; @@ -1943,18 +1943,18 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) if (Player* pTarget = unitTarget->ToPlayer()) { if (pTarget->GetTeamId() == TEAM_ALLIANCE) - m_targets.setDst(442.24f,-835.25f,44.30f,0.06f,628); + m_targets.setDst(442.24f, -835.25f, 44.30f, 0.06f, 628); else - m_targets.setDst(1120.43f,-762.11f,47.92f,2.94f,628); + m_targets.setDst(1120.43f, -762.11f, 47.92f, 2.94f, 628); } break; case 66551: // teleports inside (Isle of Conquest) if (Player* pTarget = unitTarget->ToPlayer()) { if (pTarget->GetTeamId() == TEAM_ALLIANCE) - m_targets.setDst(389.57f,-832.38f,48.65f,3.00f,628); + m_targets.setDst(389.57f, -832.38f, 48.65f, 3.00f, 628); else - m_targets.setDst(1174.85f,-763.24f,48.72f,6.26f,628); + m_targets.setDst(1174.85f, -763.24f, 48.72f, 6.26f, 628); } break; } @@ -2276,7 +2276,7 @@ void Spell::SpellDamageHeal(SpellEffIndex /*effIndex*/) unitTarget->RemoveAura(targetAura->GetId(), targetAura->GetCasterGUID()); //addhealth += tickheal * tickcount; - //addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget); + //addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth, HEAL, unitTarget); } // Glyph of Nourish else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x2000000) @@ -2482,7 +2482,7 @@ void Spell::DoCreateItem(uint32 /*i*/, uint32 itemtype) void Spell::EffectCreateItem(SpellEffIndex effIndex) { - DoCreateItem(effIndex,m_spellInfo->EffectItemType[effIndex]); + DoCreateItem(effIndex, m_spellInfo->EffectItemType[effIndex]); ExecuteLogEffectCreateItem(effIndex, m_spellInfo->EffectItemType[effIndex]); } @@ -2660,10 +2660,10 @@ void Spell::EffectEnergize(SpellEffIndex effIndex) if (!avalibleElixirs.empty()) { // cast random elixir on target - uint32 rand_spell = urand(0,avalibleElixirs.size()-1); + uint32 rand_spell = urand(0, avalibleElixirs.size()-1); std::set<uint32>::iterator itr = avalibleElixirs.begin(); std::advance(itr, rand_spell); - m_caster->CastSpell(unitTarget,*itr,true,m_CastItem); + m_caster->CastSpell(unitTarget, *itr, true, m_CastItem); } } } @@ -2732,20 +2732,20 @@ void Spell::SendLoot(uint64 guid, LootType loottype) case GAMEOBJECT_TYPE_SPELL_FOCUS: // triggering linked GO if (uint32 trapEntry = gameObjTarget->GetGOInfo()->spellFocus.linkedTrapId) - gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster); + gameObjTarget->TriggeringLinkedGameObject(trapEntry, m_caster); return; case GAMEOBJECT_TYPE_CHEST: // TODO: possible must be moved to loot release (in different from linked triggering) if (gameObjTarget->GetGOInfo()->chest.eventId) { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId,gameObjTarget->GetDBTableGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "Chest ScriptStart id %u for GO %u", gameObjTarget->GetGOInfo()->chest.eventId, gameObjTarget->GetDBTableGUIDLow()); player->GetMap()->ScriptsStart(sEventScripts, gameObjTarget->GetGOInfo()->chest.eventId, player, gameObjTarget); } // triggering linked GO if (uint32 trapEntry = gameObjTarget->GetGOInfo()->chest.linkedTrapId) - gameObjTarget->TriggeringLinkedGameObject(trapEntry,m_caster); + gameObjTarget->TriggeringLinkedGameObject(trapEntry, m_caster); // Don't return, let loots been taken default: @@ -3351,7 +3351,7 @@ void Spell::EffectPickPocket(SpellEffIndex /*effIndex*/) // victim have to be alive and humanoid or undead if (unitTarget->isAlive() && (unitTarget->GetCreatureTypeMask() &CREATURE_TYPEMASK_HUMANOID_OR_UNDEAD) != 0) - m_caster->ToPlayer()->SendLoot(unitTarget->GetGUID(),LOOT_PICKPOCKETING); + m_caster->ToPlayer()->SendLoot(unitTarget->GetGUID(), LOOT_PICKPOCKETING); } void Spell::EffectAddFarsight(SpellEffIndex effIndex) @@ -3398,10 +3398,10 @@ void Spell::EffectTeleUnitsFaceCaster(SpellEffIndex effIndex) float dis = (float)m_caster->GetSpellRadiusForTarget(unitTarget, sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[effIndex])); - float fx,fy,fz; - m_caster->GetClosePoint(fx,fy,fz,unitTarget->GetObjectSize(),dis); + float fx, fy, fz; + m_caster->GetClosePoint(fx, fy, fz, unitTarget->GetObjectSize(), dis); - unitTarget->NearTeleportTo(fx,fy,fz,-m_caster->GetOrientation(),unitTarget == m_caster); + unitTarget->NearTeleportTo(fx, fy, fz, -m_caster->GetOrientation(), unitTarget == m_caster); } void Spell::EffectLearnSkill(SpellEffIndex effIndex) @@ -3426,7 +3426,7 @@ void Spell::EffectAddHonor(SpellEffIndex /*effIndex*/) if (m_CastItem) { unitTarget->ToPlayer()->RewardHonor(NULL, 1, damage/10); - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(),unitTarget->ToPlayer()->GetGUIDLow()); + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "SpellEffect::AddHonor (spell_id %u) rewards %d honor points (item %u) for player: %u", m_spellInfo->Id, damage/10, m_CastItem->GetEntry(), unitTarget->ToPlayer()->GetGUIDLow()); return; } @@ -3451,7 +3451,7 @@ void Spell::EffectTradeSkill(SpellEffIndex /*effIndex*/) return; // uint32 skillid = m_spellInfo->EffectMiscValue[i]; // uint16 skillmax = unitTarget->ToPlayer()->(skillid); - // unitTarget->ToPlayer()->SetSkill(skillid,skillval?skillval:1,skillmax+75); + // unitTarget->ToPlayer()->SetSkill(skillid, skillval?skillval:1, skillmax+75); } void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) @@ -3468,10 +3468,10 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) { // destroy one vellum from stack uint32 count = 1; - p_caster->DestroyItemCount(itemTarget,count,true); + p_caster->DestroyItemCount(itemTarget, count, true); unitTarget=p_caster; // and add a scroll - DoCreateItem(effIndex,m_spellInfo->EffectItemType[effIndex]); + DoCreateItem(effIndex, m_spellInfo->EffectItemType[effIndex]); itemTarget=NULL; m_targets.setItemTarget(NULL); } @@ -3496,19 +3496,19 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", - p_caster->GetName(),p_caster->GetSession()->GetAccountId(), + sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", + p_caster->GetName(), p_caster->GetSession()->GetAccountId(), itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(), - item_owner->GetName(),item_owner->GetSession()->GetAccountId()); + item_owner->GetName(), item_owner->GetSession()->GetAccountId()); } // remove old enchanting before applying new if equipped - item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,false); + item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, false); itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0); // add new enchanting if equipped - item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true); + item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, true); itemTarget->SetSoulboundTradeable(NULL, item_owner, false); } @@ -3545,7 +3545,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (!add_socket) { sLog->outError("Spell::EffectEnchantItemPrismatic: attempt apply enchant spell %u with SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC (%u) but without ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET (%u), not suppoted yet.", - m_spellInfo->Id,SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC,ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET); + m_spellInfo->Id, SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC, ITEM_ENCHANTMENT_TYPE_PRISMATIC_SOCKET); return; } } @@ -3557,19 +3557,19 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", - p_caster->GetName(),p_caster->GetSession()->GetAccountId(), + sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)", + p_caster->GetName(), p_caster->GetSession()->GetAccountId(), itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(), - item_owner->GetName(),item_owner->GetSession()->GetAccountId()); + item_owner->GetName(), item_owner->GetSession()->GetAccountId()); } // remove old enchanting before applying new if equipped - item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,false); + item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, false); itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0); // add new enchanting if equipped - item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,true); + item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true); itemTarget->SetSoulboundTradeable(NULL, item_owner, false); } @@ -3606,7 +3606,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) case 10: spell_id = 36758; break; // 14% case 11: spell_id = 36760; break; // 20% default: - sLog->outError("Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW",damage); + sLog->outError("Spell::EffectEnchantItemTmp: Damage %u not handled in S'RW", damage); return; } @@ -3640,14 +3640,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (!enchant_id) { - sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id",m_spellInfo->Id,effIndex); + sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have 0 as enchanting id", m_spellInfo->Id, effIndex); return; } SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); if (!pEnchant) { - sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ",m_spellInfo->Id,effIndex,enchant_id); + sLog->outError("Spell %u Effect %u (SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) have not existed enchanting id %u ", m_spellInfo->Id, effIndex, enchant_id); return; } @@ -3687,14 +3687,14 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE)) { - sLog->outCommand(p_caster->GetSession()->GetAccountId(),"GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", + sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)", p_caster->GetName(), p_caster->GetSession()->GetAccountId(), itemTarget->GetTemplate()->Name1.c_str(), itemTarget->GetEntry(), item_owner->GetName(), item_owner->GetSession()->GetAccountId()); } // remove old enchanting before applying new if equipped - item_owner->ApplyEnchantment(itemTarget,TEMP_ENCHANTMENT_SLOT, false); + item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, false); itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0); @@ -3725,7 +3725,7 @@ void Spell::EffectTameCreature(SpellEffIndex /*effIndex*/) //SendChannelUpdate(0); finish(); - Pet* pet = m_caster->CreateTamedPetFrom(creatureTarget,m_spellInfo->Id); + Pet* pet = m_caster->CreateTamedPetFrom(creatureTarget, m_spellInfo->Id); if (!pet) // in very specific state like near world end/etc. return; @@ -3789,7 +3789,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) ASSERT(OldSummon->GetMap() == owner->GetMap()); - //OldSummon->GetMap()->Remove(OldSummon->ToCreature(),false); + //OldSummon->GetMap()->Remove(OldSummon->ToCreature(), false); float px, py, pz; owner->GetClosePoint(px, py, pz, OldSummon->GetObjectSize()); @@ -3806,7 +3806,7 @@ void Spell::EffectSummonPet(SpellEffIndex effIndex) } if (owner->GetTypeId() == TYPEID_PLAYER) - owner->ToPlayer()->RemovePet(OldSummon,(OldSummon->getPetType() == HUNTER_PET ? PET_SAVE_AS_DELETED : PET_SAVE_NOT_IN_SLOT),false); + owner->ToPlayer()->RemovePet(OldSummon, (OldSummon->getPetType() == HUNTER_PET ? PET_SAVE_AS_DELETED : PET_SAVE_NOT_IN_SLOT), false); else return; } @@ -4318,7 +4318,7 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex) if (pl->GetTeam() == team) team = HORDE; - ((BattlegroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(),team); + ((BattlegroundWS*)bg)->SetDroppedFlagGUID(pGameObj->GetGUID(), team); } break; } @@ -4369,7 +4369,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) // Glyph of Backstab case 63975: { - if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE,SPELLFAMILY_ROGUE,0x00100000,0,0,m_caster->GetGUID())) + if (AuraEffect const * aurEff = unitTarget->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_ROGUE, 0x00100000, 0, 0, m_caster->GetGUID())) { uint32 countMin = aurEff->GetBase()->GetMaxDuration(); uint32 countMax = 12000; @@ -4399,11 +4399,11 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) // check presence for (uint8 j = 0; j < 4; ++j) - if (unitTarget->HasAuraEffect(spells[j],0)) + if (unitTarget->HasAuraEffect(spells[j], 0)) return; // select spell - uint32 iTmpSpellId = spells[urand(0,3)]; + uint32 iTmpSpellId = spells[urand(0, 3)]; // cast unitTarget->CastSpell(unitTarget, iTmpSpellId, true); @@ -4422,7 +4422,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) default: spell_id = 8855; break; } - m_caster->CastSpell(m_caster,spell_id,true,NULL); + m_caster->CastSpell(m_caster, spell_id, true, NULL); return; } // Brittle Armor - need remove one 24575 Brittle Armor aura @@ -4498,7 +4498,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) item = 23586; break; // Aerie Peak Pale Ale } if (item) - DoCreateItem(effIndex,item); + DoCreateItem(effIndex, item); break; } // Improved Sprint @@ -4642,8 +4642,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } if (bag) { - if (m_caster->ToPlayer()->GetItemByPos(bag,slot)->GetCount() == 1) m_caster->ToPlayer()->RemoveItem(bag,slot,true); - else m_caster->ToPlayer()->GetItemByPos(bag,slot)->SetCount(m_caster->ToPlayer()->GetItemByPos(bag,slot)->GetCount()-1); + if (m_caster->ToPlayer()->GetItemByPos(bag, slot)->GetCount() == 1) m_caster->ToPlayer()->RemoveItem(bag, slot, true); + else m_caster->ToPlayer()->GetItemByPos(bag, slot)->SetCount(m_caster->ToPlayer()->GetItemByPos(bag, slot)->GetCount()-1); // Spell 42518 (Braufest - Gratisprobe des Braufest herstellen) m_caster->CastSpell(m_caster, 42518, true); return; @@ -4678,7 +4678,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) unitTarget->CastSpell(unitTarget, spellId, true); break; } - // 5,000 Gold + // 5, 000 Gold case 46642: { if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) @@ -4695,7 +4695,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) const char *gender = "his"; if (m_caster->getGender() > 0) gender = "her"; - sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName(), gender, gender, urand(1,10), urand(1,10)); + sprintf(buf, "%s rubs %s [Decahedral Dwarven Dice] between %s hands and rolls. One %u and one %u.", m_caster->GetName(), gender, gender, urand(1, 10), urand(1, 10)); m_caster->MonsterTextEmote(buf, 0); break; } @@ -4706,7 +4706,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) const char *gender = "his"; if (m_caster->getGender() > 0) gender = "her"; - sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName(), gender, urand(1,6), urand(1,6)); + sprintf(buf, "%s causually tosses %s [Worn Troll Dice]. One %u and one %u.", m_caster->GetName(), gender, urand(1, 6), urand(1, 6)); m_caster->MonsterTextEmote(buf, 0); break; } @@ -5187,10 +5187,10 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } case 66545: //Summon Memory { - uint8 uiRandom = urand(0,25); - uint32 uiSpells[26] = {66704,66705,66706,66707,66709,66710,66711,66712,66713,66714,66715,66708,66708,66691,66692,66694,66695,66696,66697,66698,66699,66700,66701,66702,66703,66543}; + uint8 uiRandom = urand(0, 25); + uint32 uiSpells[26] = {66704, 66705, 66706, 66707, 66709, 66710, 66711, 66712, 66713, 66714, 66715, 66708, 66708, 66691, 66692, 66694, 66695, 66696, 66697, 66698, 66699, 66700, 66701, 66702, 66703, 66543}; - m_caster->CastSpell(m_caster,uiSpells[uiRandom],true); + m_caster->CastSpell(m_caster, uiSpells[uiRandom], true); break; } case 45668: // Ultra-Advanced Proto-Typical Shortening Blaster @@ -5218,8 +5218,8 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) 45683 // Polymorph }; - m_caster->CastSpell(m_caster, spellPlayer[urand(0,4)], true); - unitTarget->CastSpell(unitTarget, spellTarget[urand(0,4)], true); + m_caster->CastSpell(m_caster, spellPlayer[urand(0, 4)], true); + unitTarget->CastSpell(unitTarget, spellTarget[urand(0, 4)], true); break; } case 64142: // Upper Deck - Create Foam Sword @@ -5231,7 +5231,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) for (uint32 const *itr = &itemId[0]; *itr; ++itr) if (plr->HasItemCount(*itr, 1, true)) return; - DoCreateItem(effIndex, itemId[urand(0,4)]); + DoCreateItem(effIndex, itemId[urand(0, 4)]); return; } break; @@ -5255,7 +5255,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) case 57774: spellId1 = 20185; break; // Judgement of Light case 53408: spellId1 = 20186; break; // Judgement of Wisdom default: - sLog->outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect",m_spellInfo->Id); + sLog->outError("Unsupported Judgement (seal trigger) spell (Id: %u) in Spell::EffectScriptEffect", m_spellInfo->Id); return; } // all seals have aura dummy in 2 effect @@ -5544,7 +5544,7 @@ void Spell::EffectStuck(SpellEffIndex /*effIndex*/) pTarget->TeleportTo(pTarget->GetStartPosition(), unitTarget == m_caster ? TELE_TO_SPELL : 0); // homebind location is loaded always - // pTarget->TeleportTo(pTarget->m_homebindMapId,pTarget->m_homebindX,pTarget->m_homebindY,pTarget->m_homebindZ,pTarget->GetOrientation(), (unitTarget == m_caster ? TELE_TO_SPELL : 0)); + // pTarget->TeleportTo(pTarget->m_homebindMapId, pTarget->m_homebindX, pTarget->m_homebindY, pTarget->m_homebindZ, pTarget->GetOrientation(), (unitTarget == m_caster ? TELE_TO_SPELL : 0)); // Stuck spell trigger Hearthstone cooldown SpellEntry const *spellInfo = sSpellStore.LookupEntry(8690); @@ -5566,7 +5566,7 @@ void Spell::EffectSummonPlayer(SpellEffIndex /*effIndex*/) float x, y, z; m_caster->GetClosePoint(x, y, z, unitTarget->GetObjectSize()); - unitTarget->ToPlayer()->SetSummonPoint(m_caster->GetMapId(),x,y,z); + unitTarget->ToPlayer()->SetSummonPoint(m_caster->GetMapId(), x, y, z); WorldPacket data(SMSG_SUMMON_REQUEST, 8+4+4); data << uint64(m_caster->GetGUID()); // summoner guid @@ -5702,7 +5702,7 @@ void Spell::EffectDisEnchant(SpellEffIndex /*effIndex*/) p_caster->UpdateCraftSkill(m_spellInfo->Id); - m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(),LOOT_DISENCHANTING); + m_caster->ToPlayer()->SendLoot(itemTarget->GetGUID(), LOOT_DISENCHANTING); // item will be removed at disenchanting end } @@ -5817,7 +5817,7 @@ void Spell::EffectSummonObject(SpellEffIndex effIndex) return; } - //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL,m_caster->getLevel()); + //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); int32 duration = GetSpellDuration(m_spellInfo); pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0); pGameObj->SetSpellId(m_spellInfo->Id); @@ -6023,7 +6023,7 @@ void Spell::EffectSkinning(SpellEffIndex /*effIndex*/) uint32 skill = creature->GetCreatureInfo()->GetRequiredLootSkill(); - m_caster->ToPlayer()->SendLoot(creature->GetGUID(),LOOT_SKINNING); + m_caster->ToPlayer()->SendLoot(creature->GetGUID(), LOOT_SKINNING); creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE); int32 reqValue = targetLevel < 10 ? 0 : targetLevel < 20 ? (targetLevel-10)*10 : targetLevel*5; @@ -6170,7 +6170,7 @@ void Spell::EffectSendTaxi(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - unitTarget->ToPlayer()->ActivateTaxiPathTo(m_spellInfo->EffectMiscValue[effIndex],m_spellInfo->Id); + unitTarget->ToPlayer()->ActivateTaxiPathTo(m_spellInfo->EffectMiscValue[effIndex], m_spellInfo->Id); } void Spell::EffectPullTowards(SpellEffIndex effIndex) @@ -6236,7 +6236,7 @@ void Spell::EffectSummonDeadPet(SpellEffIndex /*effIndex*/) if (damage < 0) return; - float x,y,z; + float x, y, z; _player->GetPosition(x, y, z); _player->GetMap()->CreatureRelocation(pet, x, y, z, _player->GetOrientation()); @@ -6344,7 +6344,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) if (!goinfo) { - sLog->outErrorDb("Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast",name_id, m_spellInfo->Id); + sLog->outErrorDb("Gameobject (Entry: %u) not exist and not created at spell (ID: %u) cast", name_id, m_spellInfo->Id); return; } @@ -6404,7 +6404,7 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex) { case GAMEOBJECT_TYPE_FISHINGNODE: { - m_caster->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT,pGameObj->GetGUID()); + m_caster->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, pGameObj->GetGUID()); m_caster->AddGameObject(pGameObj); // will removed at spell cancel // end time of range when possible catch fish (FISHING_BOBBER_READY_TIME..GetDuration(m_spellInfo)) @@ -6967,7 +6967,7 @@ void Spell::GetSummonPosition(uint32 i, Position &pos, float radius, uint32 coun else { float x, y, z; - m_caster->GetClosePoint(x,y,z,3.0f); + m_caster->GetClosePoint(x, y, z, 3.0f); pos.Relocate(x, y, z); } } @@ -6990,7 +6990,7 @@ void Spell::EffectPlayMusic(SpellEffIndex effIndex) if (!sSoundEntriesStore.LookupEntry(soundid)) { - sLog->outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.",soundid,m_spellInfo->Id); + sLog->outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.", soundid, m_spellInfo->Id); return; } @@ -7105,8 +7105,8 @@ void Spell::EffectRechargeManaGem(SpellEffIndex /*effIndex*/) if (Item* pItem = player->GetItemByEntry(item_id)) { for (int x = 0; x < MAX_ITEM_PROTO_SPELLS; ++x) - pItem->SetSpellCharges(x,pProto->Spells[x].SpellCharges); - pItem->SetState(ITEM_CHANGED,player); + pItem->SetSpellCharges(x, pProto->Spells[x].SpellCharges); + pItem->SetState(ITEM_CHANGED, player); } } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 7997ae0c05c..a144bd7b491 100755 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -668,7 +668,7 @@ SpellSpecific GetSpellSpecific(SpellEntry const * spellInfo) } // target not allow have more one spell specific from same caster -bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1,SpellSpecific spellSpec2) +bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1, SpellSpecific spellSpec2) { switch(spellSpec1) { @@ -872,7 +872,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con continue; // if non-positive trigger cast targeted to positive target this main cast is non-positive // this will place this spell auras as debuffs - if (IsPositiveTarget(spellTriggeredProto->EffectImplicitTargetA[effIndex],spellTriggeredProto->EffectImplicitTargetB[effIndex]) && !_isPositiveEffect(spellTriggeredId,i, true)) + if (IsPositiveTarget(spellTriggeredProto->EffectImplicitTargetA[effIndex], spellTriggeredProto->EffectImplicitTargetB[effIndex]) && !_isPositiveEffect(spellTriggeredId, i, true)) return false; } } @@ -963,7 +963,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con } // non-positive targets - if (!IsPositiveTarget(spellproto->EffectImplicitTargetA[effIndex],spellproto->EffectImplicitTargetB[effIndex])) + if (!IsPositiveTarget(spellproto->EffectImplicitTargetA[effIndex], spellproto->EffectImplicitTargetB[effIndex])) return false; // AttributesEx check @@ -972,7 +972,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con if (!deep && spellproto->EffectTriggerSpell[effIndex] && !spellproto->EffectApplyAuraName[effIndex] - && IsPositiveTarget(spellproto->EffectImplicitTargetA[effIndex],spellproto->EffectImplicitTargetB[effIndex]) + && IsPositiveTarget(spellproto->EffectImplicitTargetA[effIndex], spellproto->EffectImplicitTargetB[effIndex]) && !_isPositiveSpell(spellproto->EffectTriggerSpell[effIndex], true)) return false; @@ -1144,20 +1144,20 @@ void SpellMgr::LoadSpellTargetPositions() MapEntry const* mapEntry = sMapStore.LookupEntry(st.target_mapId); if (!mapEntry) { - sLog->outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.",Spell_ID,st.target_mapId); + sLog->outErrorDb("Spell (ID:%u) target map (ID: %u) does not exist in `Map.dbc`.", Spell_ID, st.target_mapId); continue; } if (st.target_X==0 && st.target_Y==0 && st.target_Z==0) { - sLog->outErrorDb("Spell (ID:%u) target coordinates not provided.",Spell_ID); + sLog->outErrorDb("Spell (ID:%u) target coordinates not provided.", Spell_ID); continue; } SpellEntry const* spellInfo = sSpellStore.LookupEntry(Spell_ID); if (!spellInfo) { - sLog->outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.",Spell_ID); + sLog->outErrorDb("Spell (ID:%u) listed in `spell_target_position` does not exist.", Spell_ID); continue; } @@ -1172,7 +1172,7 @@ void SpellMgr::LoadSpellTargetPositions() uint32 area_id = sMapMgr->GetAreaId(st.target_mapId, st.target_X, st.target_Y, st.target_Z); if (area_id != uint32(spellInfo->EffectMiscValue[i])) { - sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.",Spell_ID, spellInfo->EffectMiscValue[i], area_id); + sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` expected point to zone %u bit point to zone %u.", Spell_ID, spellInfo->EffectMiscValue[i], area_id); break; } } @@ -1183,7 +1183,7 @@ void SpellMgr::LoadSpellTargetPositions() } if (!found) { - sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DST_DB (17).",Spell_ID); + sLog->outErrorDb("Spell (Id: %u) listed in `spell_target_position` does not have target TARGET_DST_DB (17).", Spell_ID); continue; } @@ -1658,7 +1658,7 @@ void SpellMgr::LoadSpellThreats() sLog->outString(); } -bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellId_2) const +bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1, uint32 spellId_2) const { SpellEntry const *spellInfo_2 = sSpellStore.LookupEntry(spellId_2); if (!spellInfo_1 || !spellInfo_2) return false; @@ -2016,7 +2016,7 @@ void SpellMgr::LoadSpellLearnSpells() continue; } - mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell_id,node)); + mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell_id, node)); ++count; } while (result->NextRow()); @@ -2045,7 +2045,7 @@ void SpellMgr::LoadSpellLearnSpells() // talent or passive spells or skill-step spells auto-casted and not need dependent learning, // pet teaching spells don't must be dependent learning (casted) // other required explicit dependent learning - dbc_node.autoLearned = entry->EffectImplicitTargetA[i] == TARGET_UNIT_PET || GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry,SPELL_EFFECT_SKILL_STEP); + dbc_node.autoLearned = entry->EffectImplicitTargetA[i] == TARGET_UNIT_PET || GetTalentSpellCost(spell) > 0 || IsPassiveSpell(spell) || IsSpellHaveEffect(entry, SPELL_EFFECT_SKILL_STEP); SpellLearnSpellMapBounds db_node_bounds = GetSpellLearnSpellMapBounds(spell); @@ -2055,7 +2055,7 @@ void SpellMgr::LoadSpellLearnSpells() if (itr->second.spell == dbc_node.spell) { sLog->outErrorDb("Spell %u auto-learn spell %u in spell.dbc then the record in `spell_learn_spell` is redundant, please fix DB.", - spell,dbc_node.spell); + spell, dbc_node.spell); found = true; break; } @@ -2063,7 +2063,7 @@ void SpellMgr::LoadSpellLearnSpells() if (!found) // add new spell-spell pair if not found { - mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell,dbc_node)); + mSpellLearnSpells.insert(SpellLearnSpellMap::value_type(spell, dbc_node)); ++dbc_count; } } @@ -2185,7 +2185,7 @@ void SpellMgr::LoadPetLevelupSpellMap() if (spellSet.empty()) ++family_count; - spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel,spell->Id)); + spellSet.insert(PetLevelupSpellSet::value_type(spell->spellLevel, spell->Id)); ++count; } } @@ -2354,9 +2354,9 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (msg) { if (pl) - ChatHandler(pl).PSendSysMessage("Craft spell %u not have create item entry.",spellInfo->Id); + ChatHandler(pl).PSendSysMessage("Craft spell %u not have create item entry.", spellInfo->Id); else - sLog->outErrorDb("Craft spell %u not have create item entry.",spellInfo->Id); + sLog->outErrorDb("Craft spell %u not have create item entry.", spellInfo->Id); } return false; } @@ -2368,9 +2368,9 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (msg) { if (pl) - ChatHandler(pl).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]); + ChatHandler(pl).PSendSysMessage("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->EffectItemType[i]); else - sLog->outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->EffectItemType[i]); + sLog->outErrorDb("Craft spell %u create not-exist in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->EffectItemType[i]); } return false; } @@ -2381,14 +2381,14 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) case SPELL_EFFECT_LEARN_SPELL: { SpellEntry const *spellInfo2 = sSpellStore.LookupEntry(spellInfo->EffectTriggerSpell[i]); - if (!IsSpellValid(spellInfo2,pl,msg)) + if (!IsSpellValid(spellInfo2, pl, msg)) { if (msg) { if (pl) - ChatHandler(pl).PSendSysMessage("Spell %u learn to broken spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]); + ChatHandler(pl).PSendSysMessage("Spell %u learn to broken spell %u, and then...", spellInfo->Id, spellInfo->EffectTriggerSpell[i]); else - sLog->outErrorDb("Spell %u learn to invalid spell %u, and then...",spellInfo->Id,spellInfo->EffectTriggerSpell[i]); + sLog->outErrorDb("Spell %u learn to invalid spell %u, and then...", spellInfo->Id, spellInfo->EffectTriggerSpell[i]); } return false; } @@ -2406,9 +2406,9 @@ bool SpellMgr::IsSpellValid(SpellEntry const *spellInfo, Player *pl, bool msg) if (msg) { if (pl) - ChatHandler(pl).PSendSysMessage("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->Reagent[j]); + ChatHandler(pl).PSendSysMessage("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]); else - sLog->outErrorDb("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...",spellInfo->Id,spellInfo->Reagent[j]); + sLog->outErrorDb("Craft spell %u have not-exist reagent in DB item (Entry: %u) and then...", spellInfo->Id, spellInfo->Reagent[j]); } return false; } @@ -2499,13 +2499,13 @@ void SpellMgr::LoadSpellAreas() if (spellArea.areaId && !GetAreaEntryByAreaID(spellArea.areaId)) { - sLog->outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell,spellArea.areaId); + sLog->outErrorDb("Spell %u listed in `spell_area` have wrong area (%u) requirement", spell, spellArea.areaId); continue; } if (spellArea.questStart && !sObjectMgr->GetQuestTemplate(spellArea.questStart)) { - sLog->outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell,spellArea.questStart); + sLog->outErrorDb("Spell %u listed in `spell_area` have wrong start quest (%u) requirement", spell, spellArea.questStart); continue; } @@ -2513,13 +2513,13 @@ void SpellMgr::LoadSpellAreas() { if (!sObjectMgr->GetQuestTemplate(spellArea.questEnd)) { - sLog->outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell,spellArea.questEnd); + sLog->outErrorDb("Spell %u listed in `spell_area` have wrong end quest (%u) requirement", spell, spellArea.questEnd); continue; } if (spellArea.questEnd == spellArea.questStart && !spellArea.questStartCanActive) { - sLog->outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell,spellArea.questEnd); + sLog->outErrorDb("Spell %u listed in `spell_area` have quest (%u) requirement for start and end in same time", spell, spellArea.questEnd); continue; } } @@ -2529,13 +2529,13 @@ void SpellMgr::LoadSpellAreas() SpellEntry const* spellInfo = sSpellStore.LookupEntry(abs(spellArea.auraSpell)); if (!spellInfo) { - sLog->outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell,abs(spellArea.auraSpell)); + sLog->outErrorDb("Spell %u listed in `spell_area` have wrong aura spell (%u) requirement", spell, abs(spellArea.auraSpell)); continue; } if (uint32(abs(spellArea.auraSpell)) == spellArea.spellId) { - sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell,abs(spellArea.auraSpell)); + sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement for itself", spell, abs(spellArea.auraSpell)); continue; } @@ -2555,7 +2555,7 @@ void SpellMgr::LoadSpellAreas() if (chain) { - sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); + sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell); continue; } @@ -2571,7 +2571,7 @@ void SpellMgr::LoadSpellAreas() if (chain) { - sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell,spellArea.auraSpell); + sLog->outErrorDb("Spell %u listed in `spell_area` have aura spell (%u) requirement that itself autocast from aura", spell, spellArea.auraSpell); continue; } } @@ -2579,7 +2579,7 @@ void SpellMgr::LoadSpellAreas() if (spellArea.raceMask && (spellArea.raceMask & RACEMASK_ALL_PLAYABLE) == 0) { - sLog->outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell,spellArea.raceMask); + sLog->outErrorDb("Spell %u listed in `spell_area` have wrong race mask (%u) requirement", spell, spellArea.raceMask); continue; } @@ -2589,28 +2589,28 @@ void SpellMgr::LoadSpellAreas() continue; } - SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell,spellArea))->second; + SpellArea const* sa = &mSpellAreaMap.insert(SpellAreaMap::value_type(spell, spellArea))->second; // for search by current zone/subzone at zone/subzone change if (spellArea.areaId) - mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId,sa)); + mSpellAreaForAreaMap.insert(SpellAreaForAreaMap::value_type(spellArea.areaId, sa)); // for search at quest start/reward if (spellArea.questStart) { if (spellArea.questStartCanActive) - mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa)); + mSpellAreaForActiveQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa)); else - mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart,sa)); + mSpellAreaForQuestMap.insert(SpellAreaForQuestMap::value_type(spellArea.questStart, sa)); } // for search at quest start/reward if (spellArea.questEnd) - mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd,sa)); + mSpellAreaForQuestEndMap.insert(SpellAreaForQuestMap::value_type(spellArea.questEnd, sa)); // for search at aura apply if (spellArea.auraSpell) - mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell),sa)); + mSpellAreaForAuraMap.insert(SpellAreaForAuraMap::value_type(abs(spellArea.auraSpell), sa)); ++count; } while (result->NextRow()); @@ -2664,7 +2664,7 @@ SpellCastResult SpellMgr::GetSpellAllowedInLocationError(SpellEntry const *spell { for (SpellAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr) { - if (itr->second.IsFitToRequirements(player,zone_id,area_id)) + if (itr->second.IsFitToRequirements(player, zone_id, area_id)) return SPELL_CAST_OK; } return SPELL_FAILED_INCORRECT_AREA; @@ -2766,7 +2766,7 @@ void SpellMgr::LoadSkillLineAbilityMap() if (!SkillInfo) continue; - mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId,SkillInfo)); + mSkillLineAbilityMap.insert(SkillLineAbilityMap::value_type(SkillInfo->spellId, SkillInfo)); ++count; } diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 51361c99700..ac6fcc1789a 100755 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -288,7 +288,7 @@ inline bool IsLootCraftingSpell(SpellEntry const *spellInfo) (spellInfo->TotemCategory[0] != 0 || spellInfo->EffectItemType[0]==0))); } -bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2); +bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2); bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1, SpellSpecific spellSpec2); bool IsSingleFromSpellSpecificPerTarget(SpellSpecific spellSpec1, SpellSpecific spellSpec2); bool IsPassiveSpell(uint32 spellId); @@ -302,7 +302,7 @@ inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto) if (!IsPassiveSpell(spellProto->Id)) return false; - return !IsSpellHaveEffect(spellProto,SPELL_EFFECT_APPLY_AURA); + return !IsSpellHaveEffect(spellProto, SPELL_EFFECT_APPLY_AURA); } inline bool IsDeathPersistentSpell(SpellEntry const *spellInfo) @@ -679,11 +679,11 @@ enum SpellGroup // spell_id, group_id typedef std::multimap<uint32, SpellGroup > SpellSpellGroupMap; -typedef std::pair<SpellSpellGroupMap::const_iterator,SpellSpellGroupMap::const_iterator> SpellSpellGroupMapBounds; +typedef std::pair<SpellSpellGroupMap::const_iterator, SpellSpellGroupMap::const_iterator> SpellSpellGroupMapBounds; // group_id, spell_id typedef std::multimap<SpellGroup, int32> SpellGroupSpellMap; -typedef std::pair<SpellGroupSpellMap::const_iterator,SpellGroupSpellMap::const_iterator> SpellGroupSpellMapBounds; +typedef std::pair<SpellGroupSpellMap::const_iterator, SpellGroupSpellMap::const_iterator> SpellGroupSpellMapBounds; enum SpellGroupStackRule { @@ -784,12 +784,12 @@ struct SpellArea bool IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const; }; -typedef std::multimap<uint32,SpellArea> SpellAreaMap; -typedef std::multimap<uint32,SpellArea const*> SpellAreaForQuestMap; -typedef std::multimap<uint32,SpellArea const*> SpellAreaForAuraMap; -typedef std::multimap<uint32,SpellArea const*> SpellAreaForAreaMap; -typedef std::pair<SpellAreaMap::const_iterator,SpellAreaMap::const_iterator> SpellAreaMapBounds; -typedef std::pair<SpellAreaForQuestMap::const_iterator,SpellAreaForQuestMap::const_iterator> SpellAreaForQuestMapBounds; +typedef std::multimap<uint32, SpellArea> SpellAreaMap; +typedef std::multimap<uint32, SpellArea const*> SpellAreaForQuestMap; +typedef std::multimap<uint32, SpellArea const*> SpellAreaForAuraMap; +typedef std::multimap<uint32, SpellArea const*> SpellAreaForAreaMap; +typedef std::pair<SpellAreaMap::const_iterator, SpellAreaMap::const_iterator> SpellAreaMapBounds; +typedef std::pair<SpellAreaForQuestMap::const_iterator, SpellAreaForQuestMap::const_iterator> SpellAreaForQuestMapBounds; typedef std::pair<SpellAreaForAuraMap::const_iterator, SpellAreaForAuraMap::const_iterator> SpellAreaForAuraMapBounds; typedef std::pair<SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::const_iterator> SpellAreaForAreaMapBounds; @@ -807,11 +807,11 @@ typedef UNORDERED_MAP<uint32, SpellChainNode> SpellChainMap; // spell_id req_spell typedef std::multimap<uint32, uint32> SpellRequiredMap; -typedef std::pair<SpellRequiredMap::const_iterator,SpellRequiredMap::const_iterator> SpellRequiredMapBounds; +typedef std::pair<SpellRequiredMap::const_iterator, SpellRequiredMap::const_iterator> SpellRequiredMapBounds; // req_spell spell_id typedef std::multimap<uint32, uint32> SpellsRequiringSpellMap; -typedef std::pair<SpellsRequiringSpellMap::const_iterator,SpellsRequiringSpellMap::const_iterator> SpellsRequiringSpellMapBounds; +typedef std::pair<SpellsRequiringSpellMap::const_iterator, SpellsRequiringSpellMap::const_iterator> SpellsRequiringSpellMapBounds; // Spell learning properties (accessed using SpellMgr functions) struct SpellLearnSkillNode @@ -832,10 +832,10 @@ struct SpellLearnSpellNode }; typedef std::multimap<uint32, SpellLearnSpellNode> SpellLearnSpellMap; -typedef std::pair<SpellLearnSpellMap::const_iterator,SpellLearnSpellMap::const_iterator> SpellLearnSpellMapBounds; +typedef std::pair<SpellLearnSpellMap::const_iterator, SpellLearnSpellMap::const_iterator> SpellLearnSpellMapBounds; typedef std::multimap<uint32, SkillLineAbilityEntry const*> SkillLineAbilityMap; -typedef std::pair<SkillLineAbilityMap::const_iterator,SkillLineAbilityMap::const_iterator> SkillLineAbilityMapBounds; +typedef std::pair<SkillLineAbilityMap::const_iterator, SkillLineAbilityMap::const_iterator> SkillLineAbilityMapBounds; typedef std::multimap<uint32, uint32> PetLevelupSpellSet; typedef std::map<uint32, PetLevelupSpellSet> PetLevelupSpellMap; @@ -918,7 +918,7 @@ class SpellMgr SpellSpellGroupMapBounds GetSpellSpellGroupMapBounds(uint32 spell_id) const { spell_id = GetFirstSpellInChain(spell_id); - return SpellSpellGroupMapBounds(mSpellSpellGroup.lower_bound(spell_id),mSpellSpellGroup.upper_bound(spell_id)); + return SpellSpellGroupMapBounds(mSpellSpellGroup.lower_bound(spell_id), mSpellSpellGroup.upper_bound(spell_id)); } uint32 IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const { @@ -933,7 +933,7 @@ class SpellMgr SpellGroupSpellMapBounds GetSpellGroupSpellMapBounds(SpellGroup group_id) const { - return SpellGroupSpellMapBounds(mSpellGroupSpell.lower_bound(group_id),mSpellGroupSpell.upper_bound(group_id)); + return SpellGroupSpellMapBounds(mSpellGroupSpell.lower_bound(group_id), mSpellGroupSpell.upper_bound(group_id)); } void GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>& foundSpells) const { @@ -1152,12 +1152,12 @@ class SpellMgr SpellRequiredMapBounds GetSpellsRequiredForSpellBounds(uint32 spell_id) const { - return SpellRequiredMapBounds(mSpellReq.lower_bound(spell_id),mSpellReq.upper_bound(spell_id)); + return SpellRequiredMapBounds(mSpellReq.lower_bound(spell_id), mSpellReq.upper_bound(spell_id)); } SpellsRequiringSpellMapBounds GetSpellsRequiringSpellBounds(uint32 spell_id) const { - return SpellsRequiringSpellMapBounds(mSpellsReqSpell.lower_bound(spell_id),mSpellsReqSpell.upper_bound(spell_id)); + return SpellsRequiringSpellMapBounds(mSpellsReqSpell.lower_bound(spell_id), mSpellsReqSpell.upper_bound(spell_id)); } bool IsSpellRequiringSpell(uint32 spellid, uint32 req_spellid) const { @@ -1191,7 +1191,7 @@ class SpellMgr return mEnchantCustomAttr[ench_id]; } - uint8 IsHighRankOfSpell(uint32 spell1,uint32 spell2) const + uint8 IsHighRankOfSpell(uint32 spell1, uint32 spell2) const { SpellChainMap::const_iterator itr1 = mSpellChains.find(spell1); SpellChainMap::const_iterator itr2 = mSpellChains.find(spell2); @@ -1204,7 +1204,7 @@ class SpellMgr return false; } - bool IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellId_2) const; + bool IsRankSpellDueToSpell(SpellEntry const *spellInfo_1, uint32 spellId_2) const; static bool canStackSpellRanks(SpellEntry const *spellInfo); bool CanAurasStack(Aura const *aura1, Aura const *aura2, bool sameCaster) const; @@ -1227,10 +1227,10 @@ class SpellMgr SpellLearnSpellMapBounds GetSpellLearnSpellMapBounds(uint32 spell_id) const { - return SpellLearnSpellMapBounds(mSpellLearnSpells.lower_bound(spell_id),mSpellLearnSpells.upper_bound(spell_id)); + return SpellLearnSpellMapBounds(mSpellLearnSpells.lower_bound(spell_id), mSpellLearnSpells.upper_bound(spell_id)); } - bool IsSpellLearnToSpell(uint32 spell_id1,uint32 spell_id2) const + bool IsSpellLearnToSpell(uint32 spell_id1, uint32 spell_id2) const { SpellLearnSpellMapBounds bounds = GetSpellLearnSpellMapBounds(spell_id1); for (SpellLearnSpellMap::const_iterator i = bounds.first; i != bounds.second; ++i) @@ -1256,7 +1256,7 @@ class SpellMgr SkillLineAbilityMapBounds GetSkillLineAbilityMapBounds(uint32 spell_id) const { - return SkillLineAbilityMapBounds(mSkillLineAbilityMap.lower_bound(spell_id),mSkillLineAbilityMap.upper_bound(spell_id)); + return SkillLineAbilityMapBounds(mSkillLineAbilityMap.lower_bound(spell_id), mSkillLineAbilityMap.upper_bound(spell_id)); } PetAura const* GetPetAura(uint32 spell_id, uint8 eff) @@ -1304,30 +1304,30 @@ class SpellMgr SpellAreaMapBounds GetSpellAreaMapBounds(uint32 spell_id) const { - return SpellAreaMapBounds(mSpellAreaMap.lower_bound(spell_id),mSpellAreaMap.upper_bound(spell_id)); + return SpellAreaMapBounds(mSpellAreaMap.lower_bound(spell_id), mSpellAreaMap.upper_bound(spell_id)); } SpellAreaForQuestMapBounds GetSpellAreaForQuestMapBounds(uint32 quest_id, bool active) const { if (active) - return SpellAreaForQuestMapBounds(mSpellAreaForActiveQuestMap.lower_bound(quest_id),mSpellAreaForActiveQuestMap.upper_bound(quest_id)); + return SpellAreaForQuestMapBounds(mSpellAreaForActiveQuestMap.lower_bound(quest_id), mSpellAreaForActiveQuestMap.upper_bound(quest_id)); else - return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id),mSpellAreaForQuestMap.upper_bound(quest_id)); + return SpellAreaForQuestMapBounds(mSpellAreaForQuestMap.lower_bound(quest_id), mSpellAreaForQuestMap.upper_bound(quest_id)); } SpellAreaForQuestMapBounds GetSpellAreaForQuestEndMapBounds(uint32 quest_id) const { - return SpellAreaForQuestMapBounds(mSpellAreaForQuestEndMap.lower_bound(quest_id),mSpellAreaForQuestEndMap.upper_bound(quest_id)); + return SpellAreaForQuestMapBounds(mSpellAreaForQuestEndMap.lower_bound(quest_id), mSpellAreaForQuestEndMap.upper_bound(quest_id)); } SpellAreaForAuraMapBounds GetSpellAreaForAuraMapBounds(uint32 spell_id) const { - return SpellAreaForAuraMapBounds(mSpellAreaForAuraMap.lower_bound(spell_id),mSpellAreaForAuraMap.upper_bound(spell_id)); + return SpellAreaForAuraMapBounds(mSpellAreaForAuraMap.lower_bound(spell_id), mSpellAreaForAuraMap.upper_bound(spell_id)); } SpellAreaForAreaMapBounds GetSpellAreaForAreaMapBounds(uint32 area_id) const { - return SpellAreaForAreaMapBounds(mSpellAreaForAreaMap.lower_bound(area_id),mSpellAreaForAreaMap.upper_bound(area_id)); + return SpellAreaForAreaMapBounds(mSpellAreaForAreaMap.lower_bound(area_id), mSpellAreaForAreaMap.upper_bound(area_id)); } bool IsSrcTargetSpell(SpellEntry const *spellInfo) const; diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp index 8844dc3db32..2e9cf6ab6f4 100755 --- a/src/server/game/Spells/SpellScript.cpp +++ b/src/server/game/Spells/SpellScript.cpp @@ -119,7 +119,7 @@ std::string _SpellScript::EffectNameCheck::ToString() return "SPELL_EFFECT_ANY"; default: char num[10]; - sprintf (num,"%u",effName); + sprintf (num, "%u", effName); return num; } } @@ -141,7 +141,7 @@ std::string _SpellScript::EffectAuraNameCheck::ToString() return "SPELL_AURA_ANY"; default: char num[10]; - sprintf (num,"%u",effAurName); + sprintf (num, "%u", effAurName); return num; } } @@ -156,7 +156,7 @@ SpellCastResult SpellScript::CheckCastHandler::Call(SpellScript* spellScript) return (spellScript->*_checkCastHandlerScript)(); } -SpellScript::EffectHandler::EffectHandler(SpellEffectFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) +SpellScript::EffectHandler::EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : _SpellScript::EffectNameCheck(_effName), _SpellScript::EffectHook(_effIndex) { pEffectHandlerScript = _pEffectHandlerScript; @@ -530,7 +530,7 @@ std::string AuraScript::EffectBase::ToString() return "Index: " + EffIndexToString() + " AuraName: " +_SpellScript::EffectAuraNameCheck::ToString(); } -AuraScript::EffectPeriodicHandler::EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) +AuraScript::EffectPeriodicHandler::EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; @@ -541,7 +541,7 @@ void AuraScript::EffectPeriodicHandler::Call(AuraScript* auraScript, AuraEffect (auraScript->*pEffectHandlerScript)(_aurEff); } -AuraScript::EffectUpdatePeriodicHandler::EffectUpdatePeriodicHandler(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) +AuraScript::EffectUpdatePeriodicHandler::EffectUpdatePeriodicHandler(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; @@ -552,7 +552,7 @@ void AuraScript::EffectUpdatePeriodicHandler::Call(AuraScript* auraScript, AuraE (auraScript->*pEffectHandlerScript)(aurEff); } -AuraScript::EffectCalcAmountHandler::EffectCalcAmountHandler(AuraEffectCalcAmountFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) +AuraScript::EffectCalcAmountHandler::EffectCalcAmountHandler(AuraEffectCalcAmountFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectBase(_effIndex, _effName) { pEffectHandlerScript = _pEffectHandlerScript; @@ -598,7 +598,7 @@ void AuraScript::EffectApplyHandler::Call(AuraScript* auraScript, AuraEffect con (auraScript->*pEffectHandlerScript)(_aurEff, _mode); } -AuraScript::EffectAbsorbHandler::EffectAbsorbHandler(AuraEffectAbsorbFnType _pEffectHandlerScript,uint8 _effIndex) +AuraScript::EffectAbsorbHandler::EffectAbsorbHandler(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectBase(_effIndex, SPELL_AURA_SCHOOL_ABSORB) { pEffectHandlerScript = _pEffectHandlerScript; diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h index b7020bf7d53..188a7cde4ec 100755 --- a/src/server/game/Spells/SpellScript.h +++ b/src/server/game/Spells/SpellScript.h @@ -159,7 +159,7 @@ class SpellScript : public _SpellScript class EffectHandler : public _SpellScript::EffectNameCheck, public _SpellScript::EffectHook { public: - EffectHandler(SpellEffectFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName); + EffectHandler(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); std::string ToString(); bool CheckEffect(SpellEntry const* spellEntry, uint8 effIndex); void Call(SpellScript* spellScript, SpellEffIndex effIndex); @@ -190,7 +190,7 @@ class SpellScript : public _SpellScript #define SPELLSCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \ class CheckCastHandlerFunction : public SpellScript::CheckCastHandler { public: CheckCastHandlerFunction(SpellCheckCastFnType _checkCastHandlerScript) : SpellScript::CheckCastHandler((SpellScript::SpellCheckCastFnType)_checkCastHandlerScript) {} }; \ - class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ + class EffectHandlerFunction : public SpellScript::EffectHandler { public: EffectHandlerFunction(SpellEffectFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : SpellScript::EffectHandler((SpellScript::SpellEffectFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ class HitHandlerFunction : public SpellScript::HitHandler { public: HitHandlerFunction(SpellHitFnType _pHitHandlerScript) : SpellScript::HitHandler((SpellScript::SpellHitFnType)_pHitHandlerScript) {} }; \ class UnitTargetHandlerFunction : public SpellScript::UnitTargetHandler { public: UnitTargetHandlerFunction(SpellUnitTargetFnType _pUnitTargetHandlerScript, uint8 _effIndex, uint16 _targetType) : SpellScript::UnitTargetHandler((SpellScript::SpellUnitTargetFnType)_pUnitTargetHandlerScript, _effIndex, _targetType) {} }; \ @@ -337,7 +337,7 @@ enum AuraScriptHookType AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, /*AURA_SCRIPT_HOOK_APPLY, - AURA_SCRIPT_HOOK_REMOVE,*/ + AURA_SCRIPT_HOOK_REMOVE, */ }; #define HOOK_AURA_EFFECT_START HOOK_AURA_EFFECT_APPLY #define HOOK_AURA_EFFECT_END HOOK_AURA_EFFECT_CALC_SPELLMOD + 1 @@ -370,7 +370,7 @@ class AuraScript : public _SpellScript class EffectPeriodicHandler : public EffectBase { public: - EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName); + EffectPeriodicHandler(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); void Call(AuraScript * auraScript, AuraEffect const * _aurEff); private: AuraEffectPeriodicFnType pEffectHandlerScript; @@ -378,7 +378,7 @@ class AuraScript : public _SpellScript class EffectUpdatePeriodicHandler : public EffectBase { public: - EffectUpdatePeriodicHandler(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName); + EffectUpdatePeriodicHandler(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); void Call(AuraScript * auraScript, AuraEffect * aurEff); private: AuraEffectUpdatePeriodicFnType pEffectHandlerScript; @@ -386,7 +386,7 @@ class AuraScript : public _SpellScript class EffectCalcAmountHandler : public EffectBase { public: - EffectCalcAmountHandler(AuraEffectCalcAmountFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName); + EffectCalcAmountHandler(AuraEffectCalcAmountFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); void Call(AuraScript * auraScript, AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated); private: AuraEffectCalcAmountFnType pEffectHandlerScript; @@ -394,7 +394,7 @@ class AuraScript : public _SpellScript class EffectCalcPeriodicHandler : public EffectBase { public: - EffectCalcPeriodicHandler(AuraEffectCalcPeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName); + EffectCalcPeriodicHandler(AuraEffectCalcPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); void Call(AuraScript * auraScript, AuraEffect const* aurEff, bool & isPeriodic, int32 & periodicTimer); private: AuraEffectCalcPeriodicFnType pEffectHandlerScript; @@ -402,7 +402,7 @@ class AuraScript : public _SpellScript class EffectCalcSpellModHandler : public EffectBase { public: - EffectCalcSpellModHandler(AuraEffectCalcSpellModFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName); + EffectCalcSpellModHandler(AuraEffectCalcSpellModFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName); void Call(AuraScript * auraScript, AuraEffect const* aurEff, SpellModifier *& spellMod); private: AuraEffectCalcSpellModFnType pEffectHandlerScript; @@ -410,7 +410,7 @@ class AuraScript : public _SpellScript class EffectApplyHandler : public EffectBase { public: - EffectApplyHandler(AuraEffectApplicationModeFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode); + EffectApplyHandler(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode); void Call(AuraScript * auraScript, AuraEffect const * _aurEff, AuraEffectHandleModes _mode); private: AuraEffectApplicationModeFnType pEffectHandlerScript; @@ -434,14 +434,14 @@ class AuraScript : public _SpellScript }; #define AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) \ - class EffectPeriodicHandlerFunction : public AuraScript::EffectPeriodicHandler { public: EffectPeriodicHandlerFunction(AuraEffectPeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : AuraScript::EffectPeriodicHandler((AuraScript::AuraEffectPeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ - class EffectUpdatePeriodicHandlerFunction : public AuraScript::EffectUpdatePeriodicHandler { public: EffectUpdatePeriodicHandlerFunction(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : AuraScript::EffectUpdatePeriodicHandler((AuraScript::AuraEffectUpdatePeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ - class EffectCalcAmountHandlerFunction : public AuraScript::EffectCalcAmountHandler { public: EffectCalcAmountHandlerFunction(AuraEffectCalcAmountFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcAmountHandler((AuraScript::AuraEffectCalcAmountFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ - class EffectCalcPeriodicHandlerFunction : public AuraScript::EffectCalcPeriodicHandler { public: EffectCalcPeriodicHandlerFunction(AuraEffectCalcPeriodicFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcPeriodicHandler((AuraScript::AuraEffectCalcPeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ - class EffectCalcSpellModHandlerFunction : public AuraScript::EffectCalcSpellModHandler { public: EffectCalcSpellModHandlerFunction(AuraEffectCalcSpellModFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcSpellModHandler((AuraScript::AuraEffectCalcSpellModFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ - class EffectApplyHandlerFunction : public AuraScript::EffectApplyHandler { public: EffectApplyHandlerFunction(AuraEffectApplicationModeFnType _pEffectHandlerScript,uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode) : AuraScript::EffectApplyHandler((AuraScript::AuraEffectApplicationModeFnType)_pEffectHandlerScript, _effIndex, _effName, _mode) {} }; \ - class EffectAbsorbFunction : public AuraScript::EffectAbsorbHandler { public: EffectAbsorbFunction(AuraEffectAbsorbFnType _pEffectHandlerScript,uint8 _effIndex) : AuraScript::EffectAbsorbHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \ - class EffectManaShieldFunction : public AuraScript::EffectManaShieldHandler { public: EffectManaShieldFunction(AuraEffectAbsorbFnType _pEffectHandlerScript,uint8 _effIndex) : AuraScript::EffectManaShieldHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \ + class EffectPeriodicHandlerFunction : public AuraScript::EffectPeriodicHandler { public: EffectPeriodicHandlerFunction(AuraEffectPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectPeriodicHandler((AuraScript::AuraEffectPeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ + class EffectUpdatePeriodicHandlerFunction : public AuraScript::EffectUpdatePeriodicHandler { public: EffectUpdatePeriodicHandlerFunction(AuraEffectUpdatePeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectUpdatePeriodicHandler((AuraScript::AuraEffectUpdatePeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ + class EffectCalcAmountHandlerFunction : public AuraScript::EffectCalcAmountHandler { public: EffectCalcAmountHandlerFunction(AuraEffectCalcAmountFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcAmountHandler((AuraScript::AuraEffectCalcAmountFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ + class EffectCalcPeriodicHandlerFunction : public AuraScript::EffectCalcPeriodicHandler { public: EffectCalcPeriodicHandlerFunction(AuraEffectCalcPeriodicFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcPeriodicHandler((AuraScript::AuraEffectCalcPeriodicFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ + class EffectCalcSpellModHandlerFunction : public AuraScript::EffectCalcSpellModHandler { public: EffectCalcSpellModHandlerFunction(AuraEffectCalcSpellModFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName) : AuraScript::EffectCalcSpellModHandler((AuraScript::AuraEffectCalcSpellModFnType)_pEffectHandlerScript, _effIndex, _effName) {} }; \ + class EffectApplyHandlerFunction : public AuraScript::EffectApplyHandler { public: EffectApplyHandlerFunction(AuraEffectApplicationModeFnType _pEffectHandlerScript, uint8 _effIndex, uint16 _effName, AuraEffectHandleModes _mode) : AuraScript::EffectApplyHandler((AuraScript::AuraEffectApplicationModeFnType)_pEffectHandlerScript, _effIndex, _effName, _mode) {} }; \ + class EffectAbsorbFunction : public AuraScript::EffectAbsorbHandler { public: EffectAbsorbFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectAbsorbHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \ + class EffectManaShieldFunction : public AuraScript::EffectManaShieldHandler { public: EffectManaShieldFunction(AuraEffectAbsorbFnType _pEffectHandlerScript, uint8 _effIndex) : AuraScript::EffectManaShieldHandler((AuraScript::AuraEffectAbsorbFnType)_pEffectHandlerScript, _effIndex) {} }; \ #define PrepareAuraScript(CLASSNAME) AURASCRIPT_FUNCTION_TYPE_DEFINES(CLASSNAME) AURASCRIPT_FUNCTION_CAST_DEFINES(CLASSNAME) diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index daf68906249..4b813317ea1 100755 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -111,18 +111,18 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp CreatureTextMap::const_iterator sList = mTextMap.find(source->GetEntry()); if (sList == mTextMap.end()) { - sLog->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.",source->GetName(), source->GetEntry()); + sLog->outErrorDb("CreatureTextMgr: Could not find Text for Creature(%s) Entry %u in 'creature_text' table. Ignoring.", source->GetName(), source->GetEntry()); return 0; } CreatureTextHolder TextHolder = (*sList).second; CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); if (itr == TextHolder.end()) { - sLog->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.",uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry()); + sLog->outErrorDb("CreatureTextMgr: Could not find TextGroup %u for Creature(%s) GuidLow %u Entry %u. Ignoring.", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry()); return 0; } CreatureTextGroup TextGroup = (*itr).second;//has all texts in the group - CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source,textGroup);//has all textIDs from the group that were already said + CreatureTextRepeatIds repeatGroup = GetRepeatGroup(source, textGroup);//has all textIDs from the group that were already said CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup for (CreatureTextGroup::const_iterator giter = TextGroup.begin(); giter != TextGroup.end(); ++giter) @@ -169,7 +169,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp } uint32 pos = 0; if (isEqualChanced || offset < 0) - pos = urand(0,count - 1); + pos = urand(0, count - 1); else if (offset >= 0) pos = offset; CreatureTextGroup::const_iterator iter = tempGroup.begin() + pos; @@ -191,7 +191,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, uint64 whisp return (*iter).duration; } -void CreatureTextMgr::SendSound(Creature* source,uint32 sound, ChatType msgtype, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) +void CreatureTextMgr::SendSound(Creature* source, uint32 sound, ChatType msgtype, uint64 whisperGuid, TextRange range, Team team, bool gmOnly) { if (!sound || !source) return; @@ -225,7 +225,7 @@ void CreatureTextMgr::SetRepeatId(Creature* source, uint8 textGroup, uint8 id) mTextRepeatMap[source->GetGUID()][textGroup].push_back(id); } else - sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added",uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id)); + sLog->outErrorDb("CreatureTextMgr: TextGroup %u for Creature(%s) GuidLow %u Entry %u, id %u already added", uint32(textGroup), source->GetName(), source->GetGUIDLow(), source->GetEntry(), uint32(id)); } CreatureTextRepeatIds CreatureTextMgr::GetRepeatGroup(Creature* source, uint8 textGroup) @@ -277,7 +277,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C sendType = CHAT_MSG_MONSTER_WHISPER; else { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); + sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); return; } break; @@ -286,7 +286,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C sendType = CHAT_MSG_RAID_BOSS_WHISPER; else { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); + sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent CHAT_TYPE_BOSS_WHISPER with targetGuid 0. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); return; } break; @@ -303,7 +303,7 @@ void CreatureTextMgr::BuildMonsterChat(WorldPacket *data, WorldObject* source, C *data << (uint64)whisperGuid; // Unit Target if (whisperGuid && !IS_PLAYER_GUID(whisperGuid)) //can only whisper players { - sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.",source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); + sLog->outError("CreatureTextMgr: WorldObject(%s) TypeId %u GuidLow %u sent WHISPER msg to Non-Player target. Ignoring.", source->GetName(), uint32(source->GetTypeId()), source->GetGUIDLow()); return; // *data << (uint32)1; // target name length // *data << (uint8)0; // target name @@ -423,7 +423,7 @@ bool CreatureTextMgr::TextExist(uint32 sourceEntry, uint8 textGroup) CreatureTextHolder::const_iterator itr = TextHolder.find(textGroup); if (itr == TextHolder.end()) { - sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).",uint32(textGroup), sourceEntry); + sLog->outDebug(LOG_FILTER_UNITS, "CreatureTextMgr::TextExist: Could not find TextGroup %u for Creature (entry %u).", uint32(textGroup), sourceEntry); return false; } return true; diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index caa3b3783f1..5267b4c4f53 100755 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -62,7 +62,7 @@ class CreatureTextMgr void LoadCreatureTexts(); CreatureTextMap const& GetTextMap() const { return mTextMap; } - void SendSound(Creature* source,uint32 sound, ChatType msgtype, uint64 whisperGuid, TextRange range, Team team, bool gmOnly); + void SendSound(Creature* source, uint32 sound, ChatType msgtype, uint64 whisperGuid, TextRange range, Team team, bool gmOnly); void SendEmote(Unit* source, uint32 emote); //if sent, returns the 'duration' of the text else 0 if error diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index f1682012c9c..69494e4b782 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -92,7 +92,7 @@ void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table found = true; } else - ss << ","; + ss << ", "; ss << id; } diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 9bb844a3ed3..7f4dc15c5c3 100755 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -91,7 +91,7 @@ bool findnth(std::string &str, int n, std::string::size_type &s, std::string::si do { - e = str.find("'",s); + e = str.find("'", s); if (e == std::string::npos) return false; } while (str[e-1] == '\\'); @@ -100,7 +100,7 @@ bool findnth(std::string &str, int n, std::string::size_type &s, std::string::si do { s = e+4; - e = str.find("'",s); + e = str.find("'", s); if (e == std::string::npos) return false; } while (str[e-1] == '\\'); } @@ -120,13 +120,13 @@ std::string gettablename(std::string &str) bool changenth(std::string &str, int n, const char *with, bool insert = false, bool nonzero = false) { std::string::size_type s, e; - if (!findnth(str,n,s,e)) + if (!findnth(str, n, s, e)) return false; - if (nonzero && str.substr(s,e-s) == "0") + if (nonzero && str.substr(s, e-s) == "0") return true; // not an error if (!insert) - str.replace(s,e-s, with); + str.replace(s, e-s, with); else str.insert(s, with); @@ -136,7 +136,7 @@ bool changenth(std::string &str, int n, const char *with, bool insert = false, b std::string getnth(std::string &str, int n) { std::string::size_type s, e; - if (!findnth(str,n,s,e)) + if (!findnth(str, n, s, e)) return ""; return str.substr(s, e-s); @@ -147,7 +147,7 @@ bool changetoknth(std::string &str, int n, const char *with, bool insert = false std::string::size_type s = 0, e = 0; if (!findtoknth(str, n, s, e)) return false; - if (nonzero && str.substr(s,e-s) == "0") + if (nonzero && str.substr(s, e-s) == "0") return true; // not an error if (!insert) str.replace(s, e-s, with); @@ -238,13 +238,13 @@ std::string PlayerDumpWriter::GenerateWhereStr(char const* field, GUIDs const& g GUIDs::const_iterator itr2 = itr; if (++itr2 != guids.end()) - wherestr << "','"; + wherestr << "', '"; } wherestr << "')"; return wherestr.str(); } -void StoreGUID(QueryResult result,uint32 field,std::set<uint32>& guids) +void StoreGUID(QueryResult result, uint32 field, std::set<uint32>& guids) { Field* fields = result->Fetch(); uint32 guid = fields[field].GetUInt32(); @@ -252,7 +252,7 @@ void StoreGUID(QueryResult result,uint32 field,std::set<uint32>& guids) guids.insert(guid); } -void StoreGUID(QueryResult result,uint32 data,uint32 field, std::set<uint32>& guids) +void StoreGUID(QueryResult result, uint32 data, uint32 field, std::set<uint32>& guids) { Field* fields = result->Fetch(); std::string dataStr = fields[data].GetString(); @@ -292,9 +292,9 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl std::string wherestr; if (guids) // set case, get next guids string - wherestr = GenerateWhereStr(fieldname,*guids,guids_itr); + wherestr = GenerateWhereStr(fieldname, *guids, guids_itr); else // not set case, get single guid string - wherestr = GenerateWhereStr(fieldname,guid); + wherestr = GenerateWhereStr(fieldname, guid); QueryResult result = CharacterDatabase.PQuery("SELECT * FROM %s WHERE %s", tableFrom, wherestr.c_str()); if (!result) @@ -306,13 +306,13 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl switch (type) { case DTT_INVENTORY: - StoreGUID(result,3,items); break; // item guid collection (character_inventory.item) + StoreGUID(result, 3, items); break; // item guid collection (character_inventory.item) case DTT_PET: - StoreGUID(result,0,pets); break; // pet petnumber collection (character_pet.id) + StoreGUID(result, 0, pets); break; // pet petnumber collection (character_pet.id) case DTT_MAIL: - StoreGUID(result,0,mails); // mail id collection (mail.id) + StoreGUID(result, 0, mails); // mail id collection (mail.id) case DTT_MAIL_ITEM: - StoreGUID(result,1,items); break; // item guid collection (mail_items.item_guid) + StoreGUID(result, 1, items); break; // item guid collection (mail_items.item_guid) case DTT_CHARACTER: { if (result->GetFieldCount() <= 67) // avoid crashes on next check @@ -409,7 +409,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s if (!normalizePlayerName(name)) name = ""; - if (ObjectMgr::CheckPlayerName(name,true) == CHAR_NAME_SUCCESS) + if (ObjectMgr::CheckPlayerName(name, true) == CHAR_NAME_SUCCESS) { CharacterDatabase.escape_string(name); // for safe, we use name only for sql quearies anyway result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str()); @@ -426,8 +426,8 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s snprintf(newpetid, 20, "%d", sObjectMgr->GeneratePetNumber()); snprintf(lastpetid, 20, "%s", ""); - std::map<uint32,uint32> items; - std::map<uint32,uint32> mails; + std::map<uint32, uint32> items; + std::map<uint32, uint32> mails; char buf[32000] = ""; typedef std::map<uint32, uint32> PetIds; // old->new petid relation @@ -451,14 +451,14 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s continue; // skip logfile-side dump start notice, the important notes and dump end notices - if ((line.substr(nw_pos,16) == "== START DUMP ==") || - (line.substr(nw_pos,15) == "IMPORTANT NOTE:") || - (line.substr(nw_pos,14) == "== END DUMP ==")) + if ((line.substr(nw_pos, 16) == "== START DUMP ==") || + (line.substr(nw_pos, 15) == "IMPORTANT NOTE:") || + (line.substr(nw_pos, 14) == "== END DUMP ==")) continue; // add required_ check /* - if (line.substr(nw_pos,41) == "UPDATE character_db_version SET required_") + if (line.substr(nw_pos, 41) == "UPDATE character_db_version SET required_") { if (!CharacterDatabase.Execute(line.c_str())) ROLLBACK(DUMP_FILE_BROKEN); @@ -597,7 +597,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s snprintf(currpetid, 20, "%s", getnth(line, 1).c_str()); if (*lastpetid == '\0') snprintf(lastpetid, 20, "%s", currpetid); - if (strcmp(lastpetid,currpetid) != 0) + if (strcmp(lastpetid, currpetid) != 0) { snprintf(newpetid, 20, "%d", sObjectMgr->GeneratePetNumber()); snprintf(lastpetid, 20, "%s", currpetid); @@ -634,7 +634,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s break; } default: - sLog->outError("Unknown dump table type: %u",type); + sLog->outError("Unknown dump table type: %u", type); break; } diff --git a/src/server/game/Weather/Weather.cpp b/src/server/game/Weather/Weather.cpp index d21de1c1fad..c52cb0c2ec9 100755 --- a/src/server/game/Weather/Weather.cpp +++ b/src/server/game/Weather/Weather.cpp @@ -134,7 +134,7 @@ bool Weather::ReGenerate() if (m_grade > 0.6666667f) { // Severe change, but how severe? - uint32 rnd = urand(0,99); + uint32 rnd = urand(0, 99); if (rnd < 50) { m_grade -= 0.6666667f; diff --git a/src/server/game/Weather/WeatherMgr.cpp b/src/server/game/Weather/WeatherMgr.cpp index 79600b482df..2c1b7e5fc54 100755 --- a/src/server/game/Weather/WeatherMgr.cpp +++ b/src/server/game/Weather/WeatherMgr.cpp @@ -66,7 +66,7 @@ Weather* WeatherMgr::AddWeather(uint32 zone_id) if (!weatherChances) return NULL; - Weather* w = new Weather(zone_id,weatherChances); + Weather* w = new Weather(zone_id, weatherChances); m_weathers[w->GetZone()] = w; w->ReGenerate(); w->UpdateWeather(); @@ -106,19 +106,19 @@ void WeatherMgr::LoadWeatherData() if (wzc.data[season].rainChance > 100) { wzc.data[season].rainChance = 25; - sLog->outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%%",zone_id,season); + sLog->outErrorDb("Weather for zone %u season %u has wrong rain chance > 100%%", zone_id, season); } if (wzc.data[season].snowChance > 100) { wzc.data[season].snowChance = 25; - sLog->outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%%",zone_id,season); + sLog->outErrorDb("Weather for zone %u season %u has wrong snow chance > 100%%", zone_id, season); } if (wzc.data[season].stormChance > 100) { wzc.data[season].stormChance = 25; - sLog->outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%",zone_id,season); + sLog->outErrorDb("Weather for zone %u season %u has wrong storm chance > 100%%", zone_id, season); } } diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 7af625facc7..e2942495cb3 100755 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -392,7 +392,7 @@ void World::LoadConfigSettings(bool reload) { if (!sConfig->Reload()) { - sLog->outError("World settings reload fail: can't read settings from %s.",sConfig->GetFilename().c_str()); + sLog->outError("World settings reload fail: can't read settings from %s.", sConfig->GetFilename().c_str()); return; } } @@ -414,27 +414,27 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_HEALTH] = sConfig->GetFloatDefault("Rate.Health", 1); if (rate_values[RATE_HEALTH] < 0) { - sLog->outError("Rate.Health (%f) must be > 0. Using 1 instead.",rate_values[RATE_HEALTH]); + sLog->outError("Rate.Health (%f) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]); rate_values[RATE_HEALTH] = 1; } rate_values[RATE_POWER_MANA] = sConfig->GetFloatDefault("Rate.Mana", 1); if (rate_values[RATE_POWER_MANA] < 0) { - sLog->outError("Rate.Mana (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_MANA]); + sLog->outError("Rate.Mana (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]); rate_values[RATE_POWER_MANA] = 1; } rate_values[RATE_POWER_RAGE_INCOME] = sConfig->GetFloatDefault("Rate.Rage.Income", 1); rate_values[RATE_POWER_RAGE_LOSS] = sConfig->GetFloatDefault("Rate.Rage.Loss", 1); if (rate_values[RATE_POWER_RAGE_LOSS] < 0) { - sLog->outError("Rate.Rage.Loss (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_RAGE_LOSS]); + sLog->outError("Rate.Rage.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]); rate_values[RATE_POWER_RAGE_LOSS] = 1; } rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfig->GetFloatDefault("Rate.RunicPower.Income", 1); rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfig->GetFloatDefault("Rate.RunicPower.Loss", 1); if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0) { - sLog->outError("Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_RUNICPOWER_LOSS]); + sLog->outError("Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]); rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1; } rate_values[RATE_POWER_FOCUS] = sConfig->GetFloatDefault("Rate.Focus", 1.0f); @@ -458,7 +458,7 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_REPAIRCOST] = sConfig->GetFloatDefault("Rate.RepairCost", 1.0f); if (rate_values[RATE_REPAIRCOST] < 0.0f) { - sLog->outError("Rate.RepairCost (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_REPAIRCOST]); + sLog->outError("Rate.RepairCost (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]); rate_values[RATE_REPAIRCOST] = 0.0f; } rate_values[RATE_REPUTATION_GAIN] = sConfig->GetFloatDefault("Rate.Reputation.Gain", 1.0f); @@ -488,73 +488,73 @@ void World::LoadConfigSettings(bool reload) rate_values[RATE_AUCTION_TIME] = sConfig->GetFloatDefault("Rate.Auction.Time", 1.0f); rate_values[RATE_AUCTION_DEPOSIT] = sConfig->GetFloatDefault("Rate.Auction.Deposit", 1.0f); rate_values[RATE_AUCTION_CUT] = sConfig->GetFloatDefault("Rate.Auction.Cut", 1.0f); - rate_values[RATE_HONOR] = sConfig->GetFloatDefault("Rate.Honor",1.0f); - rate_values[RATE_MINING_AMOUNT] = sConfig->GetFloatDefault("Rate.Mining.Amount",1.0f); - rate_values[RATE_MINING_NEXT] = sConfig->GetFloatDefault("Rate.Mining.Next",1.0f); - rate_values[RATE_INSTANCE_RESET_TIME] = sConfig->GetFloatDefault("Rate.InstanceResetTime",1.0f); - rate_values[RATE_TALENT] = sConfig->GetFloatDefault("Rate.Talent",1.0f); + rate_values[RATE_HONOR] = sConfig->GetFloatDefault("Rate.Honor", 1.0f); + rate_values[RATE_MINING_AMOUNT] = sConfig->GetFloatDefault("Rate.Mining.Amount", 1.0f); + rate_values[RATE_MINING_NEXT] = sConfig->GetFloatDefault("Rate.Mining.Next", 1.0f); + rate_values[RATE_INSTANCE_RESET_TIME] = sConfig->GetFloatDefault("Rate.InstanceResetTime", 1.0f); + rate_values[RATE_TALENT] = sConfig->GetFloatDefault("Rate.Talent", 1.0f); if (rate_values[RATE_TALENT] < 0.0f) { - sLog->outError("Rate.Talent (%f) must be > 0. Using 1 instead.",rate_values[RATE_TALENT]); + sLog->outError("Rate.Talent (%f) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]); rate_values[RATE_TALENT] = 1.0f; } - rate_values[RATE_MOVESPEED] = sConfig->GetFloatDefault("Rate.MoveSpeed",1.0f); + rate_values[RATE_MOVESPEED] = sConfig->GetFloatDefault("Rate.MoveSpeed", 1.0f); if (rate_values[RATE_MOVESPEED] < 0) { - sLog->outError("Rate.MoveSpeed (%f) must be > 0. Using 1 instead.",rate_values[RATE_MOVESPEED]); + sLog->outError("Rate.MoveSpeed (%f) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]); rate_values[RATE_MOVESPEED] = 1.0f; } for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED]; - rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig->GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f); + rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig->GetFloatDefault("Rate.Corpse.Decay.Looted", 0.5f); - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig->GetFloatDefault("TargetPosRecalculateRange",1.5f); + rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig->GetFloatDefault("TargetPosRecalculateRange", 1.5f); if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE) { - sLog->outError("TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.",rate_values[RATE_TARGET_POS_RECALCULATION_RANGE],CONTACT_DISTANCE,CONTACT_DISTANCE); + sLog->outError("TargetPosRecalculateRange (%f) must be >= %f. Using %f instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE); rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = CONTACT_DISTANCE; } else if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] > NOMINAL_MELEE_RANGE) { sLog->outError("TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.", - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE],NOMINAL_MELEE_RANGE,NOMINAL_MELEE_RANGE); + rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE); rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE; } rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfig->GetFloatDefault("DurabilityLoss.OnDeath", 10.0f); if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f) { - sLog->outError("DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); + sLog->outError("DurabilityLoss.OnDeath (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f; } if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] > 100.0f) { - sLog->outError("DurabilityLoss.OnDeath (%f) must be <= 100. Using 100.0 instead.",rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); + sLog->outError("DurabilityLoss.OnDeath (%f) must be <= 100. Using 100.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f; } rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f; - rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfig->GetFloatDefault("DurabilityLossChance.Damage",0.5f); + rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfig->GetFloatDefault("DurabilityLossChance.Damage", 0.5f); if (rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f) { - sLog->outError("DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_DURABILITY_LOSS_DAMAGE]); + sLog->outError("DurabilityLossChance.Damage (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]); rate_values[RATE_DURABILITY_LOSS_DAMAGE] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfig->GetFloatDefault("DurabilityLossChance.Absorb",0.5f); + rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfig->GetFloatDefault("DurabilityLossChance.Absorb", 0.5f); if (rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f) { - sLog->outError("DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_DURABILITY_LOSS_ABSORB]); + sLog->outError("DurabilityLossChance.Absorb (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]); rate_values[RATE_DURABILITY_LOSS_ABSORB] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfig->GetFloatDefault("DurabilityLossChance.Parry",0.05f); + rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfig->GetFloatDefault("DurabilityLossChance.Parry", 0.05f); if (rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f) { - sLog->outError("DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_DURABILITY_LOSS_PARRY]); + sLog->outError("DurabilityLossChance.Parry (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]); rate_values[RATE_DURABILITY_LOSS_PARRY] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfig->GetFloatDefault("DurabilityLossChance.Block",0.05f); + rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfig->GetFloatDefault("DurabilityLossChance.Block", 0.05f); if (rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f) { - sLog->outError("DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_DURABILITY_LOSS_BLOCK]); + sLog->outError("DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]); rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f; } ///- Read other configuration items from the config file @@ -564,7 +564,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_COMPRESSION] = sConfig->GetIntDefault("Compression", 1); if (m_int_configs[CONFIG_COMPRESSION] < 1 || m_int_configs[CONFIG_COMPRESSION] > 9) { - sLog->outError("Compression level (%i) must be in range 1..9. Using default compression level (1).",m_int_configs[CONFIG_COMPRESSION]); + sLog->outError("Compression level (%i) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]); m_int_configs[CONFIG_COMPRESSION] = 1; } m_bool_configs[CONFIG_ADDON_CHANNEL] = sConfig->GetBoolDefault("AddonChannel", true); @@ -588,14 +588,14 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfig->GetIntDefault("PlayerSave.Stats.MinLevel", 0); if (m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] > MAX_LEVEL) { - sLog->outError("PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).",m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]); + sLog->outError("PlayerSave.Stats.MinLevel (%i) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]); m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0; } m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig->GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILLISECONDS); if (m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY) { - sLog->outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.",m_int_configs[CONFIG_INTERVAL_GRIDCLEAN],MIN_GRID_DELAY); + sLog->outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_GRIDCLEAN], MIN_GRID_DELAY); m_int_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY; } if (reload) @@ -604,7 +604,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig->GetIntDefault("MapUpdateInterval", 100); if (m_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) { - sLog->outError("MapUpdateInterval (%i) must be greater %u. Use this minimal value.",m_int_configs[CONFIG_INTERVAL_MAPUPDATE],MIN_MAP_UPDATE_DELAY); + sLog->outError("MapUpdateInterval (%i) must be greater %u. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY); m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; } if (reload) @@ -616,7 +616,7 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig->GetIntDefault("WorldServerPort", 8085); if (val != m_int_configs[CONFIG_PORT_WORLD]) - sLog->outError("WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).",m_int_configs[CONFIG_PORT_WORLD]); + sLog->outError("WorldServerPort option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_PORT_WORLD]); } else m_int_configs[CONFIG_PORT_WORLD] = sConfig->GetIntDefault("WorldServerPort", 8085); @@ -635,7 +635,7 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig->GetIntDefault("GameType", 0); if (val != m_int_configs[CONFIG_GAME_TYPE]) - sLog->outError("GameType option can't be changed at worldserver.conf reload, using current value (%u).",m_int_configs[CONFIG_GAME_TYPE]); + sLog->outError("GameType option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_GAME_TYPE]); } else m_int_configs[CONFIG_GAME_TYPE] = sConfig->GetIntDefault("GameType", 0); @@ -644,18 +644,18 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig->GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); if (val != m_int_configs[CONFIG_REALM_ZONE]) - sLog->outError("RealmZone option can't be changed at worldserver.conf reload, using current value (%u).",m_int_configs[CONFIG_REALM_ZONE]); + sLog->outError("RealmZone option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_REALM_ZONE]); } else m_int_configs[CONFIG_REALM_ZONE] = sConfig->GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfig->GetBoolDefault("AllowTwoSide.Accounts", true); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Chat",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Channel",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Group",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Guild",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Auction",false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Mail",false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Chat", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Channel", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Group", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Guild", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Auction", false); + m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfig->GetBoolDefault("AllowTwoSide.Interaction.Mail", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfig->GetBoolDefault("AllowTwoSide.WhoList", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfig->GetBoolDefault("AllowTwoSide.AddFriend", false); m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfig->GetBoolDefault("AllowTwoSide.trade", false); @@ -666,21 +666,21 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_MIN_PLAYER_NAME] = sConfig->GetIntDefault ("MinPlayerName", 2); if (m_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME) { - sLog->outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.",m_int_configs[CONFIG_MIN_PLAYER_NAME],MAX_PLAYER_NAME); + sLog->outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME); m_int_configs[CONFIG_MIN_PLAYER_NAME] = 2; } m_int_configs[CONFIG_MIN_CHARTER_NAME] = sConfig->GetIntDefault ("MinCharterName", 2); if (m_int_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_int_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME) { - sLog->outError("MinCharterName (%i) must be in range 1..%u. Set to 2.",m_int_configs[CONFIG_MIN_CHARTER_NAME],MAX_CHARTER_NAME); + sLog->outError("MinCharterName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME); m_int_configs[CONFIG_MIN_CHARTER_NAME] = 2; } m_int_configs[CONFIG_MIN_PET_NAME] = sConfig->GetIntDefault ("MinPetName", 2); if (m_int_configs[CONFIG_MIN_PET_NAME] < 1 || m_int_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME) { - sLog->outError("MinPetName (%i) must be in range 1..%u. Set to 2.",m_int_configs[CONFIG_MIN_PET_NAME],MAX_PET_NAME); + sLog->outError("MinPetName (%i) must be in range 1..%u. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME); m_int_configs[CONFIG_MIN_PET_NAME] = 2; } @@ -691,7 +691,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig->GetIntDefault("CharactersPerRealm", 10); if (m_int_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_int_configs[CONFIG_CHARACTERS_PER_REALM] > 10) { - sLog->outError("CharactersPerRealm (%i) must be in range 1..10. Set to 10.",m_int_configs[CONFIG_CHARACTERS_PER_REALM]); + sLog->outError("CharactersPerRealm (%i) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]); m_int_configs[CONFIG_CHARACTERS_PER_REALM] = 10; } @@ -699,14 +699,14 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfig->GetIntDefault("CharactersPerAccount", 50); if (m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_int_configs[CONFIG_CHARACTERS_PER_REALM]) { - sLog->outError("CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).",m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT],m_int_configs[CONFIG_CHARACTERS_PER_REALM]); + sLog->outError("CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]); m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_int_configs[CONFIG_CHARACTERS_PER_REALM]; } m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfig->GetIntDefault("HeroicCharactersPerRealm", 1); if (int32(m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10) { - sLog->outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.",m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]); + sLog->outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]); m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1; } @@ -715,7 +715,7 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_SKIP_CINEMATICS] = sConfig->GetIntDefault("SkipCinematics", 0); if (int32(m_int_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_int_configs[CONFIG_SKIP_CINEMATICS] > 2) { - sLog->outError("SkipCinematics (%i) must be in range 0..2. Set to 0.",m_int_configs[CONFIG_SKIP_CINEMATICS]); + sLog->outError("SkipCinematics (%i) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]); m_int_configs[CONFIG_SKIP_CINEMATICS] = 0; } @@ -723,14 +723,14 @@ void World::LoadConfigSettings(bool reload) { uint32 val = sConfig->GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); if (val != m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) - sLog->outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).",m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); + sLog->outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); } else m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfig->GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL); if (m_int_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL) { - sLog->outError("MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.",m_int_configs[CONFIG_MAX_PLAYER_LEVEL],MAX_LEVEL,MAX_LEVEL); + sLog->outError("MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.", m_int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL); m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL; } @@ -739,12 +739,12 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_START_PLAYER_LEVEL] = sConfig->GetIntDefault("StartPlayerLevel", 1); if (m_int_configs[CONFIG_START_PLAYER_LEVEL] < 1) { - sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.",m_int_configs[CONFIG_START_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); + sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); m_int_configs[CONFIG_START_PLAYER_LEVEL] = 1; } else if (m_int_configs[CONFIG_START_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { - sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",m_int_configs[CONFIG_START_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); + sLog->outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); m_int_configs[CONFIG_START_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL]; } @@ -752,33 +752,33 @@ void World::LoadConfigSettings(bool reload) if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1) { sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.", - m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); + m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55; } else if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.", - m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); + m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL]; } m_int_configs[CONFIG_START_PLAYER_MONEY] = sConfig->GetIntDefault("StartPlayerMoney", 0); if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0) { - sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",m_int_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,0); + sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; } else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT) { sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", - m_int_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,MAX_MONEY_AMOUNT); + m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT); m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT; } m_int_configs[CONFIG_MAX_HONOR_POINTS] = sConfig->GetIntDefault("MaxHonorPoints", 75000); if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0) { - sLog->outError("MaxHonorPoints (%i) can't be negative. Set to 0.",m_int_configs[CONFIG_MAX_HONOR_POINTS]); + sLog->outError("MaxHonorPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]); m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0; } @@ -786,20 +786,20 @@ void World::LoadConfigSettings(bool reload) if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0) { sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_HONOR_POINTS],m_int_configs[CONFIG_MAX_HONOR_POINTS],0); + m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0); m_int_configs[CONFIG_START_HONOR_POINTS] = 0; } else if (m_int_configs[CONFIG_START_HONOR_POINTS] > m_int_configs[CONFIG_MAX_HONOR_POINTS]) { sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_HONOR_POINTS],m_int_configs[CONFIG_MAX_HONOR_POINTS],m_int_configs[CONFIG_MAX_HONOR_POINTS]); + m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS]); m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS]; } m_int_configs[CONFIG_MAX_ARENA_POINTS] = sConfig->GetIntDefault("MaxArenaPoints", 10000); if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0) { - sLog->outError("MaxArenaPoints (%i) can't be negative. Set to 0.",m_int_configs[CONFIG_MAX_ARENA_POINTS]); + sLog->outError("MaxArenaPoints (%i) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]); m_int_configs[CONFIG_MAX_ARENA_POINTS] = 0; } @@ -807,13 +807,13 @@ void World::LoadConfigSettings(bool reload) if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0) { sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_ARENA_POINTS],m_int_configs[CONFIG_MAX_ARENA_POINTS],0); + m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0); m_int_configs[CONFIG_START_ARENA_POINTS] = 0; } else if (m_int_configs[CONFIG_START_ARENA_POINTS] > m_int_configs[CONFIG_MAX_ARENA_POINTS]) { sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.", - m_int_configs[CONFIG_START_ARENA_POINTS],m_int_configs[CONFIG_MAX_ARENA_POINTS],m_int_configs[CONFIG_MAX_ARENA_POINTS]); + m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS]); m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS]; } @@ -821,7 +821,7 @@ void World::LoadConfigSettings(bool reload) if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) { sLog->outError("RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.", - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL],m_int_configs[CONFIG_MAX_PLAYER_LEVEL],60); + m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 60); m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60; } @@ -856,7 +856,7 @@ void World::LoadConfigSettings(bool reload) if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL]) { sLog->outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.", - m_int_configs[CONFIG_START_GM_LEVEL],m_int_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, m_int_configs[CONFIG_START_PLAYER_LEVEL]); + m_int_configs[CONFIG_START_GM_LEVEL], m_int_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, m_int_configs[CONFIG_START_PLAYER_LEVEL]); m_int_configs[CONFIG_START_GM_LEVEL] = m_int_configs[CONFIG_START_PLAYER_LEVEL]; } else if (m_int_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL) @@ -872,12 +872,12 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_GROUP_VISIBILITY] = sConfig->GetIntDefault("Visibility.GroupMode", 1); - m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig->GetIntDefault("MailDeliveryDelay",HOUR); + m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig->GetIntDefault("MailDeliveryDelay", HOUR); m_int_configs[CONFIG_UPTIME_UPDATE] = sConfig->GetIntDefault("UpdateUptimeInterval", 10); if (int32(m_int_configs[CONFIG_UPTIME_UPDATE]) <= 0) { - sLog->outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.",m_int_configs[CONFIG_UPTIME_UPDATE]); + sLog->outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]); m_int_configs[CONFIG_UPTIME_UPDATE] = 10; } if (reload) @@ -902,16 +902,16 @@ void World::LoadConfigSettings(bool reload) sLog->outString("Will clear `logs` table of entries older than %i seconds every %u minutes.", m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]); - m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfig->GetIntDefault("SkillChance.Orange",100); - m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfig->GetIntDefault("SkillChance.Yellow",75); - m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfig->GetIntDefault("SkillChance.Green",25); - m_int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfig->GetIntDefault("SkillChance.Grey",0); + m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfig->GetIntDefault("SkillChance.Orange", 100); + m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfig->GetIntDefault("SkillChance.Yellow", 75); + m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfig->GetIntDefault("SkillChance.Green", 25); + m_int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfig->GetIntDefault("SkillChance.Grey", 0); - m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfig->GetIntDefault("SkillChance.MiningSteps",75); - m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfig->GetIntDefault("SkillChance.SkinningSteps",75); + m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfig->GetIntDefault("SkillChance.MiningSteps", 75); + m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfig->GetIntDefault("SkillChance.SkinningSteps", 75); - m_bool_configs[CONFIG_SKILL_PROSPECTING] = sConfig->GetBoolDefault("SkillChance.Prospecting",false); - m_bool_configs[CONFIG_SKILL_MILLING] = sConfig->GetBoolDefault("SkillChance.Milling",false); + m_bool_configs[CONFIG_SKILL_PROSPECTING] = sConfig->GetBoolDefault("SkillChance.Prospecting", false); + m_bool_configs[CONFIG_SKILL_MILLING] = sConfig->GetBoolDefault("SkillChance.Milling", false); m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfig->GetIntDefault("SkillGain.Crafting", 1); @@ -921,15 +921,15 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfig->GetIntDefault("SkillGain.Weapon", 1); - m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig->GetIntDefault("MaxOverspeedPings",2); + m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig->GetIntDefault("MaxOverspeedPings", 2); if (m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2) { - sLog->outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.",m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]); + sLog->outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]); m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2; } - m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfig->GetBoolDefault("SaveRespawnTimeImmediately",true); - m_bool_configs[CONFIG_WEATHER] = sConfig->GetBoolDefault("ActivateWeather",true); + m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfig->GetBoolDefault("SaveRespawnTimeImmediately", true); + m_bool_configs[CONFIG_WEATHER] = sConfig->GetBoolDefault("ActivateWeather", true); m_int_configs[CONFIG_DISABLE_BREATHING] = sConfig->GetIntDefault("DisableWaterBreath", SEC_CONSOLE); @@ -937,25 +937,25 @@ void World::LoadConfigSettings(bool reload) if (reload) { - uint32 val = sConfig->GetIntDefault("Expansion",1); + uint32 val = sConfig->GetIntDefault("Expansion", 1); if (val != m_int_configs[CONFIG_EXPANSION]) - sLog->outError("Expansion option can't be changed at worldserver.conf reload, using current value (%u).",m_int_configs[CONFIG_EXPANSION]); + sLog->outError("Expansion option can't be changed at worldserver.conf reload, using current value (%u).", m_int_configs[CONFIG_EXPANSION]); } else - m_int_configs[CONFIG_EXPANSION] = sConfig->GetIntDefault("Expansion",1); + m_int_configs[CONFIG_EXPANSION] = sConfig->GetIntDefault("Expansion", 1); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig->GetIntDefault("ChatFlood.MessageCount",10); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig->GetIntDefault("ChatFlood.MessageDelay",1); - m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfig->GetIntDefault("ChatFlood.MuteTime",10); + m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig->GetIntDefault("ChatFlood.MessageCount", 10); + m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig->GetIntDefault("ChatFlood.MessageDelay", 1); + m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfig->GetIntDefault("ChatFlood.MuteTime", 10); - m_int_configs[CONFIG_EVENT_ANNOUNCE] = sConfig->GetIntDefault("Event.Announce",0); + m_int_configs[CONFIG_EVENT_ANNOUNCE] = sConfig->GetIntDefault("Event.Announce", 0); - m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfig->GetFloatDefault("CreatureFamilyFleeAssistanceRadius",30.0f); - m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfig->GetFloatDefault("CreatureFamilyAssistanceRadius",10.0f); - m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfig->GetIntDefault("CreatureFamilyAssistanceDelay",1500); - m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfig->GetIntDefault("CreatureFamilyFleeDelay",7000); + m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfig->GetFloatDefault("CreatureFamilyFleeAssistanceRadius", 30.0f); + m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfig->GetFloatDefault("CreatureFamilyAssistanceRadius", 10.0f); + m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfig->GetIntDefault("CreatureFamilyAssistanceDelay", 1500); + m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfig->GetIntDefault("CreatureFamilyFleeDelay", 7000); - m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfig->GetIntDefault("WorldBossLevelDiff",3); + m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfig->GetIntDefault("WorldBossLevelDiff", 3); // note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100) m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfig->GetIntDefault("Quests.LowLevelHideDiff", 4); @@ -1059,7 +1059,7 @@ void World::LoadConfigSettings(bool reload) } else if (m_MaxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE) { - sLog->outError("Visibility.Distance.Continents can't be greater %f",MAX_VISIBILITY_DISTANCE); + sLog->outError("Visibility.Distance.Continents can't be greater %f", MAX_VISIBILITY_DISTANCE); m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE; } @@ -1067,12 +1067,12 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistanceInInstances = sConfig->GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); if (m_MaxVisibleDistanceInInstances < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) { - sLog->outError("Visibility.Distance.Instances can't be less max aggro radius %f",45*sWorld->getRate(RATE_CREATURE_AGGRO)); + sLog->outError("Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); m_MaxVisibleDistanceInInstances = 45*sWorld->getRate(RATE_CREATURE_AGGRO); } else if (m_MaxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE) { - sLog->outError("Visibility.Distance.Instances can't be greater %f",MAX_VISIBILITY_DISTANCE); + sLog->outError("Visibility.Distance.Instances can't be greater %f", MAX_VISIBILITY_DISTANCE); m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE; } @@ -1080,12 +1080,12 @@ void World::LoadConfigSettings(bool reload) m_MaxVisibleDistanceInBGArenas = sConfig->GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); if (m_MaxVisibleDistanceInBGArenas < 45*sWorld->getRate(RATE_CREATURE_AGGRO)) { - sLog->outError("Visibility.Distance.BGArenas can't be less max aggro radius %f",45*sWorld->getRate(RATE_CREATURE_AGGRO)); + sLog->outError("Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO)); m_MaxVisibleDistanceInBGArenas = 45*sWorld->getRate(RATE_CREATURE_AGGRO); } else if (m_MaxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE) { - sLog->outError("Visibility.Distance.BGArenas can't be greater %f",MAX_VISIBILITY_DISTANCE); + sLog->outError("Visibility.Distance.BGArenas can't be greater %f", MAX_VISIBILITY_DISTANCE); m_MaxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE; } @@ -1099,19 +1099,19 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfig->GetIntDefault("CharDelete.KeepDays", 30); ///- Read the "Data" directory from the config file - std::string dataPath = sConfig->GetStringDefault("DataDir","./"); + std::string dataPath = sConfig->GetStringDefault("DataDir", "./"); if (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\') dataPath.append("/"); if (reload) { if (dataPath != m_dataPath) - sLog->outError("DataDir option can't be changed at worldserver.conf reload, using current value (%s).",m_dataPath.c_str()); + sLog->outError("DataDir option can't be changed at worldserver.conf reload, using current value (%s).", m_dataPath.c_str()); } else { m_dataPath = dataPath; - sLog->outString("Using DataDir %s",m_dataPath.c_str()); + sLog->outString("Using DataDir %s", m_dataPath.c_str()); } m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfig->GetBoolDefault("vmap.enableIndoorCheck", 0); @@ -1128,7 +1128,7 @@ void World::LoadConfigSettings(bool reload) VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight); VMAP::VMapFactory::preventSpellsFromBeingTestedForLoS(ignoreSpellIds.c_str()); sLog->outString("WORLD: VMap support included. LineOfSight:%i, getHeight:%i, indoorCheck:%i PetLOS:%i", enableLOS, enableHeight, enableIndoor, enablePetLOS); - sLog->outString("WORLD: VMap data directory is: %svmaps",m_dataPath.c_str()); + sLog->outString("WORLD: VMap data directory is: %svmaps", m_dataPath.c_str()); m_int_configs[CONFIG_MAX_WHO] = sConfig->GetIntDefault("MaxWhoListReturns", 49); m_bool_configs[CONFIG_PET_LOS] = sConfig->GetBoolDefault("vmap.petLOS", true); @@ -1203,17 +1203,17 @@ void World::SetInitialWorldSettings() sObjectMgr->SetHighestGuids(); ///- Check the existence of the map files for all races' startup areas. - if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f) - || !MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f) - || !MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f) + if (!MapManager::ExistMapAndVMap(0, -6240.32f, 331.033f) + || !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f) + || !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f) || !MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f) || !MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f) - || !MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f) + || !MapManager::ExistMapAndVMap(1, -2917.58f, -257.98f) || (m_int_configs[CONFIG_EXPANSION] && ( - !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || - !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f)))) + !MapManager::ExistMapAndVMap(530, 10349.6f, -6357.29f) || + !MapManager::ExistMapAndVMap(530, -3961.64f, -13931.2f)))) { - sLog->outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.",m_dataPath.c_str(),m_dataPath.c_str()); + sLog->outError("Correct *.map files not found in path '%smaps' or *.vmtree/*.vmtile files in '%svmaps'. Please place *.map/*.vmtree/*.vmtile files in appropriate directories or correct the DataDir value in the worldserver.conf file.", m_dataPath.c_str(), m_dataPath.c_str()); exit(1); } @@ -1767,7 +1767,7 @@ void World::DetectDBCLang() m_defaultDbcLocale = LocaleConstant(default_locale); - sLog->outString("Using %s DBC Locale as default. All available DBC locales: %s",localeNames[m_defaultDbcLocale],availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str()); + sLog->outString("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[m_defaultDbcLocale], availableLocalsStr.empty() ? "<none>" : availableLocalsStr.c_str()); sLog->outString(); } @@ -1925,7 +1925,7 @@ void World::Update(uint32 diff) } /// <li> Handle all other objects - ///- Update objects when the timer has passed (maps, transport, creatures,...) + ///- Update objects when the timer has passed (maps, transport, creatures, ...) sMapMgr->Update(diff); if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST)) @@ -2044,7 +2044,7 @@ namespace Trinity explicit WorldWorldTextBuilder(int32 textId, va_list* args = NULL) : i_textId(textId), i_args(args) {} void operator()(WorldPacketList& data_list, LocaleConstant loc_idx) { - char const* text = sObjectMgr->GetTrinityString(i_textId,loc_idx); + char const* text = sObjectMgr->GetTrinityString(i_textId, loc_idx); if (i_args) { @@ -2174,7 +2174,7 @@ void World::SendZoneText(uint32 zone, const char* text, WorldSession *self, uint { WorldPacket data; ChatHandler::FillMessageData(&data, NULL, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, NULL, 0, text, NULL); - SendZoneMessage(zone, &data, self,team); + SendZoneMessage(zone, &data, self, team); } /// Kick (and save) all players @@ -2451,8 +2451,8 @@ void World::ShutdownMsg(bool show, Player* player) ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME; - SendServerMessage(msgid,str.c_str(),player); - sLog->outStaticDebug("Server is %s in %s",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"),str.c_str()); + SendServerMessage(msgid, str.c_str(), player); + sLog->outStaticDebug("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str.c_str()); } } @@ -2470,7 +2470,7 @@ void World::ShutdownCancel() m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value SendServerMessage(msgid); - sLog->outStaticDebug("Server %s cancelled.",(m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); + sLog->outStaticDebug("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); sScriptMgr->OnShutdownCancel(); } @@ -2569,7 +2569,7 @@ void World::SendAutoBroadcast() sWorld->SendGlobalMessage(&data); } - sLog->outDetail("AutoBroadcast: '%s'",msg.c_str()); + sLog->outDetail("AutoBroadcast: '%s'", msg.c_str()); } void World::UpdateRealmCharCount(uint32 accountId) @@ -2725,8 +2725,8 @@ void World::ResetRandomBG() void World::UpdateMaxSessionCounters() { - m_maxActiveSessionCount = std::max(m_maxActiveSessionCount,uint32(m_sessions.size()-m_QueuedPlayer.size())); - m_maxQueuedSessionCount = std::max(m_maxQueuedSessionCount,uint32(m_QueuedPlayer.size())); + m_maxActiveSessionCount = std::max(m_maxActiveSessionCount, uint32(m_sessions.size()-m_QueuedPlayer.size())); + m_maxQueuedSessionCount = std::max(m_maxQueuedSessionCount, uint32(m_QueuedPlayer.size())); } void World::LoadDBVersion() @@ -2804,7 +2804,7 @@ void World::setWorldState(uint32 index, uint64 value) if (it != m_worldstates.end()) CharacterDatabase.PExecute("UPDATE worldstates SET value="UI64FMTD" where entry=%u", value, index); else - CharacterDatabase.PExecute("INSERT INTO worldstates (entry, value) VALUES (%u,"UI64FMTD")", index, value); + CharacterDatabase.PExecute("INSERT INTO worldstates (entry, value) VALUES (%u, "UI64FMTD")", index, value); m_worldstates[index] = value; } diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index b793325b17b..5a6f85a8b1e 100755 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -637,7 +637,7 @@ class World void UpdateSessions(uint32 diff); /// Set a server rate (see #Rates) - void setRate(Rates rate,float value) { rate_values[rate]=value; } + void setRate(Rates rate, float value) { rate_values[rate]=value; } /// Get a server rate (see #Rates) float getRate(Rates rate) const { return rate_values[rate]; } @@ -668,7 +668,7 @@ class World } /// Set a server configuration element (see #WorldConfigs) - void setIntConfig(WorldIntConfigs index,uint32 value) + void setIntConfig(WorldIntConfigs index, uint32 value) { if (index < INT_CONFIG_VALUE_COUNT) m_int_configs[index] = value; @@ -776,7 +776,7 @@ class World uint32 m_int_configs[INT_CONFIG_VALUE_COUNT]; bool m_bool_configs[BOOL_CONFIG_VALUE_COUNT]; float m_float_configs[FLOAT_CONFIG_VALUE_COUNT]; - typedef std::map<uint32,uint64> WorldStatesMap; + typedef std::map<uint32, uint64> WorldStatesMap; WorldStatesMap m_worldstates; uint32 m_playerLimit; AccountTypes m_allowedSecurityLevel; @@ -797,7 +797,7 @@ class World static int32 m_visibility_notify_periodInBGArenas; // CLI command holder to be thread safe - ACE_Based::LockedQueue<CliCommandHolder*,ACE_Thread_Mutex> cliCmdQueue; + ACE_Based::LockedQueue<CliCommandHolder*, ACE_Thread_Mutex> cliCmdQueue; // next daily quests and random bg reset time time_t m_NextDailyQuestReset; |
