diff options
| author | jackpoz <giacomopoz@gmail.com> | 2014-09-03 21:44:45 +0200 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2014-09-03 22:11:41 +0200 |
| commit | 53d3becf3c5bbefa0d078379decbbc76b2840996 (patch) | |
| tree | 83bfedf7f9fa34c6f5508bc5fd9cc2f21f7cbb20 /src/server/scripts/EasternKingdoms/Uldaman | |
| parent | beaf778a3024c6d13d7c1708ce27c6c48568c709 (diff) | |
Core/Misc: Refactor scripts to fix static analysis warnings
Diffstat (limited to 'src/server/scripts/EasternKingdoms/Uldaman')
3 files changed, 46 insertions, 18 deletions
diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp index f06dc247883..f82d71901ac 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_archaedas.cpp @@ -64,9 +64,21 @@ class boss_archaedas : public CreatureScript { boss_archaedasAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = me->GetInstanceScript(); } + void Initialize() + { + uiTremorTimer = 60000; + iAwakenTimer = 0; + uiWallMinionTimer = 10000; + + bWakingUp = false; + bGuardiansAwake = false; + bVaultWalkersAwake = false; + } + uint32 uiTremorTimer; int32 iAwakenTimer; uint32 uiWallMinionTimer; @@ -78,13 +90,7 @@ class boss_archaedas : public CreatureScript void Reset() override { - uiTremorTimer = 60000; - iAwakenTimer = 0; - uiWallMinionTimer = 10000; - - bWakingUp = false; - bGuardiansAwake = false; - bVaultWalkersAwake = false; + Initialize(); instance->SetData(0, 5); // respawn any dead minions me->setFaction(35); @@ -224,9 +230,19 @@ class npc_archaedas_minions : public CreatureScript { npc_archaedas_minionsAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = me->GetInstanceScript(); } + void Initialize() + { + uiArcing_Timer = 3000; + iAwakenTimer = 0; + + bWakingUp = false; + bAmIAwake = false; + } + uint32 uiArcing_Timer; int32 iAwakenTimer; bool bWakingUp; @@ -236,11 +252,7 @@ class npc_archaedas_minions : public CreatureScript void Reset() override { - uiArcing_Timer = 3000; - iAwakenTimer = 0; - - bWakingUp = false; - bAmIAwake = false; + Initialize(); me->setFaction(35); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); diff --git a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp index 13a475604a7..6062f01691c 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/boss_ironaya.cpp @@ -45,7 +45,17 @@ class boss_ironaya : public CreatureScript struct boss_ironayaAI : public ScriptedAI { - boss_ironayaAI(Creature* creature) : ScriptedAI(creature) { } + boss_ironayaAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + uiArcingTimer = 3000; + bHasCastKnockaway = false; + bHasCastWstomp = false; + } uint32 uiArcingTimer; bool bHasCastWstomp; @@ -53,9 +63,7 @@ class boss_ironaya : public CreatureScript void Reset() override { - uiArcingTimer = 3000; - bHasCastKnockaway = false; - bHasCastWstomp = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp index fdb71cbbf83..236cc55eee8 100644 --- a/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp +++ b/src/server/scripts/EasternKingdoms/Uldaman/uldaman.cpp @@ -54,13 +54,21 @@ class npc_jadespine_basilisk : public CreatureScript struct npc_jadespine_basiliskAI : public ScriptedAI { - npc_jadespine_basiliskAI(Creature* creature) : ScriptedAI(creature) { } + npc_jadespine_basiliskAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + uiCslumberTimer = 2000; + } uint32 uiCslumberTimer; void Reset() override { - uiCslumberTimer = 2000; + Initialize(); } void EnterCombat(Unit* /*who*/) override |
