aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-09-07 20:08:05 +0200
committerjackpoz <giacomopoz@gmail.com>2014-09-07 20:12:54 +0200
commitdf7f188cfe1b407520549f7374bfd070d83140e5 (patch)
treec21f0eb0120682d2bbae9714223958a65a6985ae /src/server/scripts/EasternKingdoms
parent62cfca23cec79e9804bb02111c722d8b566a9e5a (diff)
Core/Misc: Refactor scripts to fix static analysis warnings
Fourth batch of fixes targeting 100 issues reported by Coverity
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp3
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp1
-rw-r--r--src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp56
6 files changed, 54 insertions, 14 deletions
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
index 1a97f668558..9a6d0e9c224 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp
@@ -75,6 +75,9 @@ public:
{
Initialize();
+ Breath1_Spell = 0;
+ Breath2_Spell = 0;
+
// Select the 2 breaths that we are going to use until despawned
// 5 possiblities for the first breath, 4 for the second, 20 total possiblites
// This way we don't end up casting 2 of the same breath
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
index 9084a6b0371..7ce11653567 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp
@@ -81,6 +81,9 @@ public:
Initialize();
instance = creature->GetInstanceScript();
Intro = true;
+ RainBones = false;
+ Skeletons = false;
+ FlyTimer = 0;
}
void Initialize()
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
index ce8223c90cf..7b51b61ba0a 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp
@@ -1068,6 +1068,7 @@ public:
EntryYellTimer = 1000;
AggroYellTimer = 10000;
IsFakingDeath = false;
+ ResurrectTimer = 0;
}
void Initialize()
diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
index 307bcd5add6..0733640f4c3 100644
--- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
+++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp
@@ -391,6 +391,10 @@ public:
Initialize();
instance = creature->GetInstanceScript();
headGUID = 0;
+ PlayerGUID = 0;
+ id = 0;
+ whirlwind = 0;
+ wp_reached = false;
}
void Initialize()
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
index 5df2d683e21..79ebfa7b62b 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp
@@ -503,6 +503,7 @@ public:
{
Initialize();
instance = creature->GetInstanceScript();
+ speechPhaseEnd = 0;
SetCombatMovement(false);
}
diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
index ec0bae0f27f..823423fc3a8 100644
--- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
+++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp
@@ -301,10 +301,19 @@ public:
{
npc_muru_portalAI(Creature* creature) : ScriptedAI(creature), Summons(creature)
{
+ Initialize();
SetCombatMovement(false);
instance = creature->GetInstanceScript();
}
+ void Initialize()
+ {
+ SummonTimer = 5000;
+
+ InAction = false;
+ SummonSentinel = false;
+ }
+
InstanceScript* instance;
SummonList Summons;
@@ -316,10 +325,7 @@ public:
void Reset() override
{
- SummonTimer = 5000;
-
- InAction = false;
- SummonSentinel = false;
+ Initialize();
me->AddUnitState(UNIT_STATE_STUNNED);
@@ -383,15 +389,23 @@ public:
struct npc_dark_fiendAI : public ScriptedAI
{
- npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ WaitTimer = 2000;
+ InAction = false;
+ }
uint32 WaitTimer;
bool InAction;
void Reset() override
{
- WaitTimer = 2000;
- InAction = false;
+ Initialize();
me->AddUnitState(UNIT_STATE_STUNNED);
}
@@ -444,15 +458,23 @@ public:
struct npc_void_sentinelAI : public ScriptedAI
{
- npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature) { }
+ npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature)
+ {
+ Initialize();
+ }
+
+ void Initialize()
+ {
+ PulseTimer = 3000;
+ VoidBlastTimer = 45000; //is this a correct timer?
+ }
uint32 PulseTimer;
uint32 VoidBlastTimer;
void Reset() override
{
- PulseTimer = 3000;
- VoidBlastTimer = 45000; //is this a correct timer?
+ Initialize();
float x, y, z, o;
me->GetHomePosition(x, y, z, o);
@@ -502,9 +524,18 @@ public:
{
npc_blackholeAI(Creature* creature) : ScriptedAI(creature)
{
+ Initialize();
instance = creature->GetInstanceScript();
}
+ void Initialize()
+ {
+ DespawnTimer = 15000;
+ SpellTimer = 5000;
+ Phase = 0;
+ NeedForAHack = 0;
+ }
+
InstanceScript* instance;
uint32 DespawnTimer;
@@ -514,10 +545,7 @@ public:
void Reset() override
{
- DespawnTimer = 15000;
- SpellTimer = 5000;
- Phase = 0;
- NeedForAHack = 0;
+ Initialize();
me->AddUnitState(UNIT_STATE_STUNNED);
DoCastAOE(SPELL_BLACKHOLE_SPAWN, true);