aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp28
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp10
-rw-r--r--src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp2
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp79
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp1
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp8
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h2
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp37
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPEP.h15
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp42
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPHP.h8
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp15
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPNA.h5
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp53
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPTF.h10
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp51
-rwxr-xr-xsrc/server/scripts/OutdoorPvP/OutdoorPvPZM.h14
17 files changed, 221 insertions, 159 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 17bc0daec5b..11238850958 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -99,11 +99,11 @@ public:
if (!szAcc || !szPassword)
return false;
- // normalized in sAccountMgr->CreateAccount
+ // normalized in AccountMgr::CreateAccount
std::string account_name = szAcc;
std::string password = szPassword;
- AccountOpResult result = sAccountMgr->CreateAccount(account_name, password);
+ AccountOpResult result = AccountMgr::CreateAccount(account_name, password);
switch(result)
{
case AOR_OK:
@@ -150,7 +150,7 @@ public:
return false;
}
- uint32 account_id = sAccountMgr->GetId(account_name);
+ uint32 account_id = AccountMgr::GetId(account_name);
if (!account_id)
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -164,7 +164,7 @@ public:
if (handler->HasLowerSecurityAccount (NULL, account_id, true))
return false;
- AccountOpResult result = sAccountMgr->DeleteAccount(account_id);
+ AccountOpResult result = AccountMgr::DeleteAccount(account_id);
switch(result)
{
case AOR_OK:
@@ -282,7 +282,7 @@ public:
return false;
}
- if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), std::string(old_pass)))
+ if (!AccountMgr::CheckPassword(handler->GetSession()->GetAccountId(), std::string(old_pass)))
{
handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD);
handler->SetSentErrorMessage(true);
@@ -296,7 +296,7 @@ public:
return false;
}
- AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), std::string(new_pass));
+ AccountOpResult result = AccountMgr::ChangePassword(handler->GetSession()->GetAccountId(), std::string(new_pass));
switch(result)
{
case AOR_OK:
@@ -342,7 +342,7 @@ public:
return false;
account_id = player->GetSession()->GetAccountId();
- sAccountMgr->GetName(account_id, account_name);
+ AccountMgr::GetName(account_id, account_name);
szExp = szAcc;
}
else
@@ -356,7 +356,7 @@ public:
return false;
}
- account_id = sAccountMgr->GetId(account_name);
+ account_id = AccountMgr::GetId(account_name);
if (!account_id)
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -429,17 +429,17 @@ public:
}
// handler->getSession() == NULL only for console
- targetAccountId = (isAccountNameGiven) ? sAccountMgr->GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId();
+ targetAccountId = (isAccountNameGiven) ? AccountMgr::GetId(targetAccountName) : handler->getSelectedPlayer()->GetSession()->GetAccountId();
int32 gmRealmID = (isAccountNameGiven) ? atoi(arg3) : atoi(arg2);
uint32 plSecurity;
if (handler->GetSession())
- plSecurity = sAccountMgr->GetSecurity(handler->GetSession()->GetAccountId(), gmRealmID);
+ plSecurity = AccountMgr::GetSecurity(handler->GetSession()->GetAccountId(), gmRealmID);
else
plSecurity = SEC_CONSOLE;
// can set security level only for target with less security and to less security that we have
// This is also reject self apply in fact
- targetSecurity = sAccountMgr->GetSecurity(targetAccountId, gmRealmID);
+ targetSecurity = AccountMgr::GetSecurity(targetAccountId, gmRealmID);
if (targetSecurity >= plSecurity || gm >= plSecurity)
{
handler->SendSysMessage(LANG_YOURS_SECURITY_IS_LOW);
@@ -448,7 +448,7 @@ public:
}
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
- if (gmRealmID == -1 && plSecurity != SEC_CONSOLE)
+ if (gmRealmID == -1 && !AccountMgr::IsConsoleAccount(plSecurity))
{
QueryResult result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm);
if (result)
@@ -501,7 +501,7 @@ public:
return false;
}
- uint32 targetAccountId = sAccountMgr->GetId(account_name);
+ uint32 targetAccountId = AccountMgr::GetId(account_name);
if (!targetAccountId)
{
handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, account_name.c_str());
@@ -521,7 +521,7 @@ public:
return false;
}
- AccountOpResult result = sAccountMgr->ChangePassword(targetAccountId, szPassword1);
+ AccountOpResult result = AccountMgr::ChangePassword(targetAccountId, szPassword1);
switch (result)
{
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index a520eac1ee7..780b4e549a9 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -25,6 +25,7 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ObjectMgr.h"
#include "Chat.h"
+#include "AccountMgr.h"
class gm_commandscript : public CommandScript
{
@@ -56,10 +57,11 @@ public:
{
if (!*args)
{
- if (handler->GetSession()->GetPlayer()->isGMChat())
- handler->GetSession()->SendNotification(LANG_GM_CHAT_ON);
+ WorldSession* session = handler->GetSession();
+ if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->isGMChat())
+ session->SendNotification(LANG_GM_CHAT_ON);
else
- handler->GetSession()->SendNotification(LANG_GM_CHAT_OFF);
+ session->SendNotification(LANG_GM_CHAT_OFF);
return true;
}
@@ -120,7 +122,7 @@ public:
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
- if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
+ if ((itr->second->isGameMaster() || (!AccountMgr::IsPlayerAccount(itr_sec) && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
{
if (first)
diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
index b99cd3b180f..472c5922460 100644
--- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp
@@ -42,7 +42,7 @@ enum eSpells
SPELL_RESURRECT = 24173, //We will not use this spell.
//Zealot Lor'Khan Spells
- SPELL_SHIELD = 25045,
+ SPELL_SHIELD = 20545,
SPELL_BLOODLUST = 24185,
SPELL_GREATERHEAL = 24208,
SPELL_DISARM = 6713,
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
index 3bbe7b125af..2558b03beb6 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp
@@ -116,6 +116,7 @@ class boss_baltharus_the_warborn : public CreatureScript
{
me->InterruptNonMeleeSpells(false);
_EnterCombat();
+ events.Reset();
events.SetPhase(PHASE_COMBAT);
events.ScheduleEvent(EVENT_CLEAVE, 11000, 0, PHASE_COMBAT);
events.ScheduleEvent(EVENT_ENERVATING_BRAND, 13000, 0, PHASE_COMBAT);
@@ -228,16 +229,18 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
struct npc_baltharus_the_warborn_cloneAI : public ScriptedAI
{
- npc_baltharus_the_warborn_cloneAI(Creature* creature) : ScriptedAI(creature)
+ npc_baltharus_the_warborn_cloneAI(Creature* creature) : ScriptedAI(creature),
+ _instance(creature->GetInstanceScript())
{
- _instance = (InstanceScript*)creature->GetInstanceScript();
}
void EnterCombat(Unit* /*who*/)
{
DoZoneInCombat();
+ _events.Reset();
_events.ScheduleEvent(EVENT_CLEAVE, urand(5000, 10000));
_events.ScheduleEvent(EVENT_BLADE_TEMPEST, urand(18000, 25000));
+ _events.ScheduleEvent(EVENT_ENERVATING_BRAND, urand(10000, 15000));
}
void DamageTaken(Unit* /*attacker*/, uint32& damage)
@@ -280,6 +283,12 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
DoCastVictim(SPELL_BLADE_TEMPEST);
_events.ScheduleEvent(EVENT_BLADE_TEMPEST, 24000);
break;
+ case EVENT_ENERVATING_BRAND:
+ for (uint8 i = 0; i < RAID_MODE<uint8>(4, 8, 8, 10); i++)
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45.0f, true))
+ DoCast(target, SPELL_ENERVATING_BRAND);
+ _events.ScheduleEvent(EVENT_ENERVATING_BRAND, 26000);
+ break;
default:
break;
}
@@ -299,59 +308,6 @@ class npc_baltharus_the_warborn_clone : public CreatureScript
}
};
-class spell_baltharus_enervating_brand : public SpellScriptLoader
-{
- public:
- spell_baltharus_enervating_brand() : SpellScriptLoader("spell_baltharus_enervating_brand") { }
-
- class spell_baltharus_enervating_brand_AuraScript : public AuraScript
- {
- PrepareAuraScript(spell_baltharus_enervating_brand_AuraScript);
-
- void HandleTriggerSpell(AuraEffect const* aurEff)
- {
- PreventDefaultAction();
- Unit* target = GetTarget();
- uint32 triggerSpellId = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
- target->CastSpell(target, triggerSpellId, true);
-
- if (Unit* caster = GetCaster())
- if (target->GetDistance(caster) <= 12.0f)
- target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
- }
-
- void Register()
- {
- OnEffectPeriodic += AuraEffectPeriodicFn(spell_baltharus_enervating_brand_AuraScript::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
- }
- };
-
- AuraScript* GetAuraScript() const
- {
- return new spell_baltharus_enervating_brand_AuraScript();
- }
-};
-
-class EnervatingBrandSelector
-{
- public:
- explicit EnervatingBrandSelector(Unit* caster) : _caster(caster) {}
-
- bool operator()(Unit* unit)
- {
- if (_caster->GetDistance(unit) > 12.0f)
- return true;
-
- if (unit->GetTypeId() != TYPEID_PLAYER)
- return true;
-
- return false;
- }
-
- private:
- Unit* _caster;
-};
-
class spell_baltharus_enervating_brand_trigger : public SpellScriptLoader
{
public:
@@ -361,16 +317,18 @@ class spell_baltharus_enervating_brand_trigger : public SpellScriptLoader
{
PrepareSpellScript(spell_baltharus_enervating_brand_trigger_SpellScript);
- void FilterTargets(std::list<Unit*>& unitList)
+ void CheckDistance()
{
- unitList.remove_if(EnervatingBrandSelector(GetCaster()));
- unitList.push_back(GetCaster());
+ if (Unit* caster = GetOriginalCaster())
+ {
+ if (Unit* target = GetHitUnit())
+ target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
+ }
}
void Register()
{
- OnUnitTargetSelect += SpellUnitTargetFn(spell_baltharus_enervating_brand_trigger_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
- OnUnitTargetSelect += SpellUnitTargetFn(spell_baltharus_enervating_brand_trigger_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ALLY);
+ OnHit += SpellHitFn(spell_baltharus_enervating_brand_trigger_SpellScript::CheckDistance);
}
};
@@ -384,6 +342,5 @@ void AddSC_boss_baltharus_the_warborn()
{
new boss_baltharus_the_warborn();
new npc_baltharus_the_warborn_clone();
- new spell_baltharus_enervating_brand();
new spell_baltharus_enervating_brand_trigger();
}
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
index cc1e4051bbc..d0c59627be7 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp
@@ -81,6 +81,7 @@ class boss_saviana_ragefire : public CreatureScript
{
_EnterCombat();
Talk(SAY_AGGRO);
+ events.Reset();
events.ScheduleEvent(EVENT_ENRAGE, 20000, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLAME_BREATH, 14000, EVENT_GROUP_LAND_PHASE);
events.ScheduleEvent(EVENT_FLIGHT, 60000);
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
index ca6509060c3..abfaaa0229d 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp
@@ -206,9 +206,17 @@ class instance_ruby_sanctum : public InstanceMapScript
case DATA_GENERAL_ZARITHRIAN:
if (GetBossState(DATA_SAVIANA_RAGEFIRE) == DONE && GetBossState(DATA_BALTHARUS_THE_WARBORN) == DONE)
HandleGameObject(FlameWallsGUID, state != IN_PROGRESS);
+ /*
if (state == DONE)
if (Creature* halionController = instance->SummonCreature(NPC_HALION_CONTROLLER, HalionControllerSpawnPos))
halionController->AI()->DoAction(ACTION_INTRO_HALION);
+ */
+ break;
+ case DATA_HALION:
+ /*
+ if (state != IN_PROGRESS)
+ HandleGameObject(FlameRingGUID, true);
+ */
break;
default:
break;
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
index 0acffc50272..52a4c67e544 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/ruby_sanctum.h
@@ -81,11 +81,13 @@ enum CreaturesIds
NPC_ORB_ROTATION_FOCUS = 40091,
NPC_SHADOW_ORB_N = 40083,
NPC_SHADOW_ORB_S = 40100,
+ NPC_METEOR_STRIKE_MARK = 40029,
NPC_METEOR_STRIKE_NORTH = 40041,
NPC_METEOR_STRIKE_EAST = 40042,
NPC_METEOR_STRIKE_WEST = 40043,
NPC_METEOR_STRIKE_SOUTH = 40044,
NPC_METEOR_STRIKE_FLAME = 40055,
+ NPC_COMBUSTION = 40001,
// Xerestrasza
NPC_XERESTRASZA = 40429,
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
index 7fc24a75d61..1cc10ed475d 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.cpp
@@ -41,12 +41,12 @@ void OPvPCapturePointEP_EWT::ChangeState()
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_A));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_EWT_H));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, 0);
}
uint32 artkit = 21;
@@ -57,14 +57,14 @@ void OPvPCapturePointEP_EWT::ChangeState()
m_TowerState = EP_TS_A;
artkit = 2;
SummonSupportUnitAtNorthpassTower(ALLIANCE);
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = ALLIANCE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
artkit = 1;
SummonSupportUnitAtNorthpassTower(HORDE);
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_EWT] = HORDE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_EWT, HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_EWT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
@@ -179,12 +179,12 @@ void OPvPCapturePointEP_NPT::ChangeState()
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_A));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_NPT_H));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, 0);
}
uint32 artkit = 21;
@@ -195,14 +195,14 @@ void OPvPCapturePointEP_NPT::ChangeState()
m_TowerState = EP_TS_A;
artkit = 2;
SummonGO(ALLIANCE);
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = ALLIANCE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
artkit = 1;
SummonGO(HORDE);
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_NPT] = HORDE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_NPT, HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_NPT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
@@ -322,12 +322,12 @@ void OPvPCapturePointEP_CGT::ChangeState()
if( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_A));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_CGT_H));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, 0);
}
uint32 artkit = 21;
@@ -338,14 +338,14 @@ void OPvPCapturePointEP_CGT::ChangeState()
m_TowerState = EP_TS_A;
artkit = 2;
LinkGraveYard(ALLIANCE);
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = ALLIANCE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
artkit = 1;
LinkGraveYard(HORDE);
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_CGT] = HORDE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_CGT, HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_CGT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
@@ -451,12 +451,12 @@ void OPvPCapturePointEP_PWT::ChangeState()
if ( m_OldState == OBJECTIVESTATE_ALLIANCE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_A));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0);
}
else if ( m_OldState == OBJECTIVESTATE_HORDE && m_OldState != m_State )
{
sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_LOSE_PWT_H));
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = 0;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, 0);
}
uint32 artkit = 21;
@@ -467,14 +467,14 @@ void OPvPCapturePointEP_PWT::ChangeState()
m_TowerState = EP_TS_A;
SummonFlightMaster(ALLIANCE);
artkit = 2;
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = ALLIANCE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, ALLIANCE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_A));
break;
case OBJECTIVESTATE_HORDE:
m_TowerState = EP_TS_H;
SummonFlightMaster(HORDE);
artkit = 1;
- ((OutdoorPvPEP*)m_PvP)->EP_Controls[EP_PWT] = HORDE;
+ ((OutdoorPvPEP*)m_PvP)->SetControlledState(EP_PWT, HORDE);
if (m_OldState != m_State) sWorld->SendZoneText(EP_GraveYardZone, sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_EP_CAPTURE_PWT_H));
break;
case OBJECTIVESTATE_NEUTRAL:
@@ -714,6 +714,11 @@ void OutdoorPvPEP::BuffTeams()
}
}
+void OutdoorPvPEP::SetControlledState(uint32 index, uint32 state)
+{
+ EP_Controls[index] = state;
+}
+
void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data)
{
data << EP_UI_TOWER_COUNT_A << m_AllianceTowersControlled;
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
index f196e65725c..042d2b70f58 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPEP.h
@@ -184,8 +184,6 @@ class OutdoorPvPEP;
class OPvPCapturePointEP_EWT : public OPvPCapturePoint
{
- friend class OutdoorPvPEP;
-
public:
OPvPCapturePointEP_EWT(OutdoorPvP * pvp);
@@ -215,8 +213,6 @@ class OPvPCapturePointEP_EWT : public OPvPCapturePoint
class OPvPCapturePointEP_NPT : public OPvPCapturePoint
{
- friend class OutdoorPvPEP;
-
public:
OPvPCapturePointEP_NPT(OutdoorPvP * pvp);
@@ -246,8 +242,6 @@ class OPvPCapturePointEP_NPT : public OPvPCapturePoint
class OPvPCapturePointEP_CGT : public OPvPCapturePoint
{
- friend class OutdoorPvPEP;
-
public:
OPvPCapturePointEP_CGT(OutdoorPvP * pvp);
@@ -277,8 +271,6 @@ class OPvPCapturePointEP_CGT : public OPvPCapturePoint
class OPvPCapturePointEP_PWT : public OPvPCapturePoint
{
- friend class OutdoorPvPEP;
-
public:
OPvPCapturePointEP_PWT(OutdoorPvP * pvp);
@@ -308,11 +300,6 @@ class OPvPCapturePointEP_PWT : public OPvPCapturePoint
class OutdoorPvPEP : public OutdoorPvP
{
- friend class OPvPCapturePointEP_EWT;
- friend class OPvPCapturePointEP_NPT;
- friend class OPvPCapturePointEP_PWT;
- friend class OPvPCapturePointEP_CGT;
-
public:
OutdoorPvPEP();
@@ -330,6 +317,8 @@ class OutdoorPvPEP : public OutdoorPvP
void BuffTeams();
+ void SetControlledState(uint32 index, uint32 state);
+
private:
// how many towers are controlled
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
index 2d26ab80e5c..3c7c473e663 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.cpp
@@ -173,14 +173,14 @@ void OPvPCapturePointHP::ChangeState()
break;
case OBJECTIVESTATE_ALLIANCE:
field = HP_MAP_A[m_TowerType];
- if (((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled)
- ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled--;
+ if (uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled())
+ ((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_A[m_TowerType]));
break;
case OBJECTIVESTATE_HORDE:
field = HP_MAP_H[m_TowerType];
- if (((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled)
- ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled--;
+ if (uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled())
+ ((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(--horde_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_LOSE_H[m_TowerType]));
break;
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
@@ -211,21 +211,27 @@ void OPvPCapturePointHP::ChangeState()
field = HP_MAP_N[m_TowerType];
break;
case OBJECTIVESTATE_ALLIANCE:
+ {
field = HP_MAP_A[m_TowerType];
artkit = 2;
artkit2 = HP_TowerArtKit_A[m_TowerType];
- if (((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled<3)
- ((OutdoorPvPHP*)m_PvP)->m_AllianceTowersControlled++;
+ uint32 alliance_towers = ((OutdoorPvPHP*)m_PvP)->GetAllianceTowersControlled();
+ if (alliance_towers < 3)
+ ((OutdoorPvPHP*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_A[m_TowerType]));
break;
+ }
case OBJECTIVESTATE_HORDE:
+ {
field = HP_MAP_H[m_TowerType];
artkit = 1;
artkit2 = HP_TowerArtKit_H[m_TowerType];
- if (((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled<3)
- ((OutdoorPvPHP*)m_PvP)->m_HordeTowersControlled++;
+ uint32 horde_towers = ((OutdoorPvPHP*)m_PvP)->GetHordeTowersControlled();
+ if (horde_towers < 3)
+ ((OutdoorPvPHP*)m_PvP)->SetHordeTowersControlled(++horde_towers);
sWorld->SendZoneText(OutdoorPvPHPBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(HP_LANG_CAPTURE_H[m_TowerType]));
break;
+ }
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
field = HP_MAP_N[m_TowerType];
break;
@@ -331,6 +337,26 @@ void OutdoorPvPHP::HandleKillImpl(Player* player, Unit* killed)
player->CastSpell(player, HordePlayerKillReward, true);
}
+uint32 OutdoorPvPHP::GetAllianceTowersControlled() const
+{
+ return m_AllianceTowersControlled;
+}
+
+void OutdoorPvPHP::SetAllianceTowersControlled(uint32 count)
+{
+ m_AllianceTowersControlled = count;
+}
+
+uint32 OutdoorPvPHP::GetHordeTowersControlled() const
+{
+ return m_HordeTowersControlled;
+}
+
+void OutdoorPvPHP::SetHordeTowersControlled(uint32 count)
+{
+ m_HordeTowersControlled = count;
+}
+
class OutdoorPvP_hellfire_peninsula : public OutdoorPvPScript
{
public:
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
index da18f639ba1..1d19652d5b1 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPHP.h
@@ -108,8 +108,6 @@ class OPvPCapturePointHP : public OPvPCapturePoint
class OutdoorPvPHP : public OutdoorPvP
{
- friend class OPvPCapturePointHP;
-
public:
OutdoorPvPHP();
@@ -127,6 +125,12 @@ class OutdoorPvPHP : public OutdoorPvP
void HandleKillImpl(Player* player, Unit* killed);
+ uint32 GetAllianceTowersControlled() const;
+ void SetAllianceTowersControlled(uint32 count);
+
+ uint32 GetHordeTowersControlled() const;
+ void SetHordeTowersControlled(uint32 count);
+
private:
// how many towers are controlled
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
index 03b50f77a50..dacd63e93a6 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.cpp
@@ -63,14 +63,10 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount()
case NA_NPC_GUARD_13:
case NA_NPC_GUARD_14:
case NA_NPC_GUARD_15:
- {
- if (Creature* cr = HashMapHolder<Creature>::Find(itr->second))
- {
+ if (Creature const * const cr = HashMapHolder<Creature>::Find(itr->second))
if (cr->isAlive())
++cnt;
- }
- }
- break;
+ break;
default:
break;
}
@@ -78,6 +74,11 @@ uint32 OPvPCapturePointNA::GetAliveGuardsCount()
return cnt;
}
+uint32 OPvPCapturePointNA::GetControllingFaction() const
+{
+ return m_ControllingFaction;
+}
+
void OPvPCapturePointNA::SpawnNPCsForTeam(uint32 team)
{
const creature_type * creatures = NULL;
@@ -223,7 +224,7 @@ bool OutdoorPvPNA::SetupOutdoorPvP()
void OutdoorPvPNA::HandlePlayerEnterZone(Player* player, uint32 zone)
{
// add buffs
- if (player->GetTeam() == m_obj->m_ControllingFaction)
+ if (player->GetTeam() == m_obj->GetControllingFaction())
player->CastSpell(player, NA_CAPTURE_BUFF, true);
OutdoorPvP::HandlePlayerEnterZone(player, zone);
}
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
index 7ddb47ac437..8d706ecdd23 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPNA.h
@@ -252,8 +252,6 @@ class OutdoorPvPNA;
class OPvPCapturePointNA : public OPvPCapturePoint
{
- friend class OutdoorPvPNA;
-
public:
OPvPCapturePointNA(OutdoorPvP * pvp);
@@ -275,6 +273,7 @@ class OPvPCapturePointNA : public OPvPCapturePoint
int32 HandleOpenGo(Player* player, uint64 guid);
uint32 GetAliveGuardsCount();
+ uint32 GetControllingFaction() const;
protected:
@@ -312,8 +311,6 @@ class OPvPCapturePointNA : public OPvPCapturePoint
class OutdoorPvPNA : public OutdoorPvP
{
- friend class OPvPCapturePointNA;
-
public:
OutdoorPvPNA();
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
index 666df2360c5..63214ecebef 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.cpp
@@ -208,6 +208,31 @@ void OutdoorPvPTF::HandlePlayerLeaveZone(Player* player, uint32 zone)
OutdoorPvP::HandlePlayerLeaveZone(player, zone);
}
+uint32 OutdoorPvPTF::GetAllianceTowersControlled() const
+{
+ return m_AllianceTowersControlled;
+}
+
+void OutdoorPvPTF::SetAllianceTowersControlled(uint32 count)
+{
+ m_AllianceTowersControlled = count;
+}
+
+uint32 OutdoorPvPTF::GetHordeTowersControlled() const
+{
+ return m_HordeTowersControlled;
+}
+
+void OutdoorPvPTF::SetHordeTowersControlled(uint32 count)
+{
+ m_HordeTowersControlled = count;
+}
+
+bool OutdoorPvPTF::IsLocked() const
+{
+ return m_IsLocked;
+}
+
bool OutdoorPvPTF::SetupOutdoorPvP()
{
m_AllianceTowersControlled = 0;
@@ -236,10 +261,10 @@ bool OutdoorPvPTF::SetupOutdoorPvP()
bool OPvPCapturePointTF::Update(uint32 diff)
{
// can update even in locked state if gathers the controlling faction
- bool canupdate = ((((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled > 0) && m_activePlayers[0].size() > m_activePlayers[1].size()) ||
- ((((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled > 0) && m_activePlayers[0].size() < m_activePlayers[1].size());
+ bool canupdate = ((((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled() > 0) && m_activePlayers[0].size() > m_activePlayers[1].size()) ||
+ ((((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled() > 0) && m_activePlayers[0].size() < m_activePlayers[1].size());
// if gathers the other faction, then only update if the pvp is unlocked
- canupdate = canupdate || !((OutdoorPvPTF*)m_PvP)->m_IsLocked;
+ canupdate = canupdate || !((OutdoorPvPTF*)m_PvP)->IsLocked();
return canupdate && OPvPCapturePoint::Update(diff);
}
@@ -248,15 +273,15 @@ void OPvPCapturePointTF::ChangeState()
// if changing from controlling alliance to horde
if (m_OldState == OBJECTIVESTATE_ALLIANCE)
{
- if (((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled)
- ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled--;
+ if (uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled())
+ ((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_A));
}
// if changing from controlling horde to alliance
else if (m_OldState == OBJECTIVESTATE_HORDE)
{
- if (((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled)
- ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled--;
+ if (uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled())
+ ((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(--horde_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_LOSE_H));
}
@@ -265,23 +290,29 @@ void OPvPCapturePointTF::ChangeState()
switch(m_State)
{
case OBJECTIVESTATE_ALLIANCE:
+ {
m_TowerState = TF_TOWERSTATE_A;
artkit = 2;
- if (((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled<TF_TOWER_NUM)
- ((OutdoorPvPTF*)m_PvP)->m_AllianceTowersControlled++;
+ uint32 alliance_towers = ((OutdoorPvPTF*)m_PvP)->GetAllianceTowersControlled();
+ if (alliance_towers < TF_TOWER_NUM)
+ ((OutdoorPvPTF*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_A));
for (PlayerSet::iterator itr = m_activePlayers[0].begin(); itr != m_activePlayers[0].end(); ++itr)
(*itr)->AreaExploredOrEventHappens(TF_ALLY_QUEST);
break;
+ }
case OBJECTIVESTATE_HORDE:
+ {
m_TowerState = TF_TOWERSTATE_H;
artkit = 1;
- if (((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled<TF_TOWER_NUM)
- ((OutdoorPvPTF*)m_PvP)->m_HordeTowersControlled++;
+ uint32 horde_towers = ((OutdoorPvPTF*)m_PvP)->GetHordeTowersControlled();
+ if (horde_towers < TF_TOWER_NUM)
+ ((OutdoorPvPTF*)m_PvP)->SetHordeTowersControlled(++horde_towers);
sWorld->SendZoneText(OutdoorPvPTFBuffZones[0], sObjectMgr->GetTrinityStringForDBCLocale(LANG_OPVP_TF_CAPTURE_H));
for (PlayerSet::iterator itr = m_activePlayers[1].begin(); itr != m_activePlayers[1].end(); ++itr)
(*itr)->AreaExploredOrEventHappens(TF_HORDE_QUEST);
break;
+ }
case OBJECTIVESTATE_NEUTRAL:
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
index f8257e490f6..cf85c41c4dd 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPTF.h
@@ -150,8 +150,6 @@ class OPvPCapturePointTF : public OPvPCapturePoint
class OutdoorPvPTF : public OutdoorPvP
{
- friend class OPvPCapturePointTF;
-
public:
OutdoorPvPTF();
@@ -167,6 +165,14 @@ class OutdoorPvPTF : public OutdoorPvP
void SendRemoveWorldStates(Player* player);
+ uint32 GetAllianceTowersControlled() const;
+ void SetAllianceTowersControlled(uint32 count);
+
+ uint32 GetHordeTowersControlled() const;
+ void SetHordeTowersControlled(uint32 count);
+
+ bool IsLocked() const;
+
private:
bool m_IsLocked;
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
index 22811b84f75..f631e39e119 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.cpp
@@ -76,32 +76,38 @@ void OPvPCapturePointZM_Beacon::ChangeState()
// if changing from controlling alliance to horde
if (m_OldState == OBJECTIVESTATE_ALLIANCE)
{
- if (((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled)
- ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled--;
+ if (uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled())
+ ((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(--alliance_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseA[m_TowerType]));
}
// if changing from controlling horde to alliance
else if (m_OldState == OBJECTIVESTATE_HORDE)
{
- if (((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled)
- ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled--;
+ if (uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled())
+ ((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(--horde_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconLoseH[m_TowerType]));
}
switch(m_State)
{
case OBJECTIVESTATE_ALLIANCE:
+ {
m_TowerState = ZM_TOWERSTATE_A;
- if (((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled<ZM_NUM_BEACONS)
- ((OutdoorPvPZM*)m_PvP)->m_AllianceTowersControlled++;
+ uint32 alliance_towers = ((OutdoorPvPZM*)m_PvP)->GetAllianceTowersControlled();
+ if (alliance_towers < ZM_NUM_BEACONS)
+ ((OutdoorPvPZM*)m_PvP)->SetAllianceTowersControlled(++alliance_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureA[m_TowerType]));
break;
+ }
case OBJECTIVESTATE_HORDE:
+ {
m_TowerState = ZM_TOWERSTATE_H;
- if (((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled<ZM_NUM_BEACONS)
- ((OutdoorPvPZM*)m_PvP)->m_HordeTowersControlled++;
+ uint32 horde_towers = ((OutdoorPvPZM*)m_PvP)->GetHordeTowersControlled();
+ if (horde_towers < ZM_NUM_BEACONS)
+ ((OutdoorPvPZM*)m_PvP)->SetHordeTowersControlled(++horde_towers);
sWorld->SendZoneText(ZM_GRAVEYARD_ZONE, sObjectMgr->GetTrinityStringForDBCLocale(ZMBeaconCaptureH[m_TowerType]));
break;
+ }
case OBJECTIVESTATE_NEUTRAL:
case OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE:
case OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE:
@@ -143,12 +149,12 @@ void OutdoorPvPZM::HandlePlayerEnterZone(Player* player, uint32 zone)
{
if (player->GetTeam() == ALLIANCE)
{
- if (m_GraveYard->m_GraveYardState & ZM_GRAVEYARD_A)
+ if (m_GraveYard->GetGraveYardState() & ZM_GRAVEYARD_A)
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
}
else
{
- if (m_GraveYard->m_GraveYardState & ZM_GRAVEYARD_H)
+ if (m_GraveYard->GetGraveYardState() & ZM_GRAVEYARD_H)
player->CastSpell(player, ZM_CAPTURE_BUFF, true);
}
OutdoorPvP::HandlePlayerEnterZone(player, zone);
@@ -382,6 +388,31 @@ bool OPvPCapturePointZM_GraveYard::HandleDropFlag(Player* /*player*/, uint32 spe
return false;
}
+uint32 OPvPCapturePointZM_GraveYard::GetGraveYardState() const
+{
+ return m_GraveYardState;
+}
+
+uint32 OutdoorPvPZM::GetAllianceTowersControlled() const
+{
+ return m_AllianceTowersControlled;
+}
+
+void OutdoorPvPZM::SetAllianceTowersControlled(uint32 count)
+{
+ m_AllianceTowersControlled = count;
+}
+
+uint32 OutdoorPvPZM::GetHordeTowersControlled() const
+{
+ return m_HordeTowersControlled;
+}
+
+void OutdoorPvPZM::SetHordeTowersControlled(uint32 count)
+{
+ m_HordeTowersControlled = count;
+}
+
void OutdoorPvPZM::FillInitialWorldStates(WorldPacket &data)
{
data << ZM_WORLDSTATE_UNK_1 << uint32(1);
diff --git a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
index ed181f81bef..e703090990c 100755
--- a/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
+++ b/src/server/scripts/OutdoorPvP/OutdoorPvPZM.h
@@ -168,8 +168,6 @@ class OutdoorPvPZM;
class OPvPCapturePointZM_Beacon : public OPvPCapturePoint
{
- friend class OutdoorPvPZM;
-
public:
OPvPCapturePointZM_Beacon(OutdoorPvP * pvp, ZM_BeaconType type);
@@ -201,8 +199,6 @@ enum ZM_GraveYardState
class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
{
- friend class OutdoorPvPZM;
-
public:
OPvPCapturePointZM_GraveYard(OutdoorPvP * pvp);
@@ -225,6 +221,8 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
bool CanTalkTo(Player* player, Creature* c, GossipMenuItems const& gso);
+ uint32 GetGraveYardState() const;
+
private:
uint32 m_GraveYardState;
@@ -238,8 +236,6 @@ class OPvPCapturePointZM_GraveYard : public OPvPCapturePoint
class OutdoorPvPZM : public OutdoorPvP
{
- friend class OPvPCapturePointZM_Beacon;
-
public:
OutdoorPvPZM();
@@ -257,6 +253,12 @@ class OutdoorPvPZM : public OutdoorPvP
void HandleKillImpl(Player* player, Unit* killed);
+ uint32 GetAllianceTowersControlled() const;
+ void SetAllianceTowersControlled(uint32 count);
+
+ uint32 GetHordeTowersControlled() const;
+ void SetHordeTowersControlled(uint32 count);
+
private:
OPvPCapturePointZM_GraveYard * m_GraveYard;