aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms/ScarletMonastery
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-09-03 21:44:45 +0200
committerjackpoz <giacomopoz@gmail.com>2014-09-03 22:11:41 +0200
commit53d3becf3c5bbefa0d078379decbbc76b2840996 (patch)
tree83bfedf7f9fa34c6f5508bc5fd9cc2f21f7cbb20 /src/server/scripts/EasternKingdoms/ScarletMonastery
parentbeaf778a3024c6d13d7c1708ce27c6c48568c709 (diff)
Core/Misc: Refactor scripts to fix static analysis warnings
Diffstat (limited to 'src/server/scripts/EasternKingdoms/ScarletMonastery')
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp56
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp20
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp12
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp37
4 files changed, 81 insertions, 44 deletions
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index cad46b84748..307bcd5add6 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -232,7 +232,20 @@ public:
struct npc_headAI : public ScriptedAI
{
- npc_headAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_headAI(Creature* creature) : ScriptedAI(creature)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ Phase = 0;
+ bodyGUID = 0;
+ die = false;
+ withbody = true;
+ wait = 1000;
+ laugh = urand(15000, 30000);
+ }
uint64 bodyGUID;
@@ -245,12 +258,7 @@ public:
void Reset() override
{
- Phase = 0;
- bodyGUID = 0;
- die = false;
- withbody = true;
- wait = 1000;
- laugh = urand(15000, 30000);
+ Initialize();
}
void EnterCombat(Unit* /*who*/) override { }
@@ -380,10 +388,29 @@ public:
{
boss_headless_horsemanAI(Creature* creature) : ScriptedAI(creature)
{
+ Initialize();
instance = creature->GetInstanceScript();
headGUID = 0;
}
+ void Initialize()
+ {
+ Phase = 1;
+ conflagrate = 15000;
+ summonadds = 15000;
+ laugh = urand(16000, 20000);
+ cleave = 2000;
+ regen = 1000;
+ burn = 6000;
+ count = 0;
+ say_timer = 3000;
+
+ withhead = true;
+ returned = true;
+ burned = false;
+ IsFlying = false;
+ }
+
InstanceScript* instance;
uint64 headGUID;
@@ -410,20 +437,7 @@ public:
void Reset() override
{
- Phase = 1;
- conflagrate = 15000;
- summonadds = 15000;
- laugh = urand(16000, 20000);
- cleave = 2000;
- regen = 1000;
- burn = 6000;
- count = 0;
- say_timer = 3000;
-
- withhead = true;
- returned = true;
- burned = false;
- IsFlying = false;
+ Initialize();
DoCast(me, SPELL_HEAD);
if (headGUID)
{
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
index a4a3660b360..78a317b216e 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_high_inquisitor_fairbanks.cpp
@@ -51,9 +51,21 @@ public:
{
boss_high_inquisitor_fairbanksAI(Creature* creature) : ScriptedAI(creature)
{
+ Initialize();
instance = creature->GetInstanceScript();
}
+ void Initialize()
+ {
+ CurseOfBlood_Timer = 10000;
+ DispelMagic_Timer = 30000;
+ Fear_Timer = 40000;
+ Heal_Timer = 30000;
+ Sleep_Timer = 30000;
+ Dispel_Timer = 20000;
+ PowerWordShield = false;
+ }
+
uint32 CurseOfBlood_Timer;
uint32 DispelMagic_Timer;
uint32 Fear_Timer;
@@ -65,13 +77,7 @@ public:
void Reset() override
{
- CurseOfBlood_Timer = 10000;
- DispelMagic_Timer = 30000;
- Fear_Timer = 40000;
- Heal_Timer = 30000;
- Sleep_Timer = 30000;
- Dispel_Timer = 20000;
- PowerWordShield = false;
+ Initialize();
me->SetStandState(UNIT_STAND_STATE_DEAD);
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 7);
instance->SetBossState(DATA_HIGH_INQUISITOR_FAIRBANKS, NOT_STARTED);
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
index a73cf946a7c..c05de1bb800 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp
@@ -55,9 +55,17 @@ public:
{
boss_interrogator_vishasAI(Creature* creature) : ScriptedAI(creature)
{
+ Initialize();
instance = me->GetInstanceScript();
}
+ void Initialize()
+ {
+ ShadowWordPain_Timer = 5000;
+ Yell60 = false;
+ Yell30 = false;
+ }
+
InstanceScript* instance;
bool Yell30;
@@ -66,9 +74,7 @@ public:
void Reset() override
{
- ShadowWordPain_Timer = 5000;
- Yell60 = false;
- Yell30 = false;
+ Initialize();
instance->SetBossState(DATA_INTERROGATOR_VISHAS, NOT_STARTED);
}
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
index a9988584edd..02f7c815414 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_mograine_and_whitemane.cpp
@@ -72,9 +72,19 @@ public:
{
boss_scarlet_commander_mograineAI(Creature* creature) : ScriptedAI(creature)
{
+ Initialize();
instance = creature->GetInstanceScript();
}
+ void Initialize()
+ {
+ CrusaderStrike_Timer = 10000;
+ HammerOfJustice_Timer = 10000;
+ _bHasDied = false;
+ _bHeal = false;
+ _bFakeDeath = false;
+ }
+
InstanceScript* instance;
uint32 CrusaderStrike_Timer;
@@ -86,8 +96,7 @@ public:
void Reset() override
{
- CrusaderStrike_Timer = 10000;
- HammerOfJustice_Timer = 10000;
+ Initialize();
//Incase wipe during phase that mograine fake death
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
@@ -96,10 +105,6 @@ public:
if (me->IsAlive())
instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);
-
- _bHasDied = false;
- _bHeal = false;
- _bFakeDeath = false;
}
void JustReachedHome() override
@@ -230,9 +235,21 @@ public:
{
boss_high_inquisitor_whitemaneAI(Creature* creature) : ScriptedAI(creature)
{
+ Initialize();
instance = creature->GetInstanceScript();
}
+ void Initialize()
+ {
+ Wait_Timer = 7000;
+ Heal_Timer = 10000;
+ PowerWordShield_Timer = 15000;
+ HolySmite_Timer = 6000;
+
+ _bCanResurrectCheck = false;
+ _bCanResurrect = false;
+ }
+
InstanceScript* instance;
uint32 Heal_Timer;
@@ -245,13 +262,7 @@ public:
void Reset() override
{
- Wait_Timer = 7000;
- Heal_Timer = 10000;
- PowerWordShield_Timer = 15000;
- HolySmite_Timer = 6000;
-
- _bCanResurrectCheck = false;
- _bCanResurrect = false;
+ Initialize();
if (me->IsAlive())
instance->SetBossState(DATA_MOGRAINE_AND_WHITE_EVENT, NOT_STARTED);