diff options
author | Yehonal <yehonal.azeroth@gmail.com> | 2017-09-17 04:07:32 +0200 |
---|---|---|
committer | Yehonal <yehonal.azeroth@gmail.com> | 2017-09-17 04:07:32 +0200 |
commit | cf627d832717c990b02da5e5ba06b4f218079321 (patch) | |
tree | a1e5549767423abba94b93df6c7af363233e800f | |
parent | 82be574cdadbede505741805c809f7bb6d056036 (diff) |
Scripts: Step 4 - Fixed all warnings inside scripts
issue #121
Next step: enabling -DWITH_WARNINGS and fix
47 files changed, 173 insertions, 146 deletions
diff --git a/src/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index 9fc14205fe..3e6ccf55d7 100644 --- a/src/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -474,7 +474,7 @@ public: me->SetCanDualWield(true); } - void Reset() + void Reset() override { } diff --git a/src/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp b/src/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp index 0e081e2d64..fc555b4722 100644 --- a/src/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp +++ b/src/scripts/EasternKingdoms/Karazhan/instance_karazhan.cpp @@ -255,7 +255,7 @@ public: } - uint64 GetData64(uint32 data) const + uint64 GetData64(uint32 data) const override { switch (data) { @@ -355,7 +355,8 @@ public: void PeriodicTick(AuraEffect const* auraEffect) { PreventDefaultAction(); - GetUnitOwner()->CastCustomSpell(SPELL_OVERLOAD, SPELLVALUE_BASE_POINT0, int32(auraEffect->GetAmount() * (2.0, auraEffect->GetTickNumber())), GetUnitOwner(), true); + //Should stop at 3200 damage, maybe check needed(?) + GetUnitOwner()->CastCustomSpell(SPELL_OVERLOAD, SPELLVALUE_BASE_POINT0, int32(auraEffect->GetAmount() * pow(2.0, auraEffect->GetTickNumber())), GetUnitOwner(), true); } void Register() diff --git a/src/scripts/Events/brewfest.cpp b/src/scripts/Events/brewfest.cpp index 7b0426bd4e..ec8fbf91c8 100644 --- a/src/scripts/Events/brewfest.cpp +++ b/src/scripts/Events/brewfest.cpp @@ -145,7 +145,7 @@ public: for (int i = 0; i < 3; ++i) { float o = rand_norm()*2*M_PI; - if (cr = me->SummonCreature(NPC_ANTAGONIST, me->GetPositionX()+3*cos(o), me->GetPositionY()+3*sin(o), me->GetPositionZ(), me->GetOrientation())) + if ((cr = me->SummonCreature(NPC_ANTAGONIST, me->GetPositionX()+3*cos(o), me->GetPositionY()+3*sin(o), me->GetPositionZ(), me->GetOrientation()))) { if (i == 0) cr->MonsterSay("Time to die.", LANG_UNIVERSAL, 0); @@ -811,24 +811,24 @@ class npc_dark_iron_attack_generator : public CreatureScript Creature* cr; if (me->GetMapId() == 1) // Kalimdor { - if (cr = me->SummonCreature(NPC_DROHN_KEG, 1183.69f, -4315.15f, 21.1875f, 0.750492f)) + if ((cr = me->SummonCreature(NPC_DROHN_KEG, 1183.69f, -4315.15f, 21.1875f, 0.750492f))) summons.Summon(cr); - if (cr = me->SummonCreature(NPC_VOODOO_KEG, 1182.42f, -4272.45f, 21.1182f, -1.02974f)) + if ((cr = me->SummonCreature(NPC_VOODOO_KEG, 1182.42f, -4272.45f, 21.1182f, -1.02974f))) summons.Summon(cr); - if (cr = me->SummonCreature(NPC_GORDOK_KEG, 1223.78f, -4296.48f, 21.1707f, -2.86234f)) + if ((cr = me->SummonCreature(NPC_GORDOK_KEG, 1223.78f, -4296.48f, 21.1707f, -2.86234f))) summons.Summon(cr); } else if (me->GetMapId() == 0) // Eastern Kingdom { - if (cr = me->SummonCreature(NPC_BARLEYBREW_KEG, -5187.23f, -599.779f, 397.176f, 0.017453f)) + if ((cr = me->SummonCreature(NPC_BARLEYBREW_KEG, -5187.23f, -599.779f, 397.176f, 0.017453f))) summons.Summon(cr); - if (cr = me->SummonCreature(NPC_THUNDERBREW_KEG, -5160.05f, -632.632f, 397.178f, 1.39626f)) + if ((cr = me->SummonCreature(NPC_THUNDERBREW_KEG, -5160.05f, -632.632f, 397.178f, 1.39626f))) summons.Summon(cr); - if (cr = me->SummonCreature(NPC_GORDOK_KEG, -5145.75f, -575.667f, 397.176f, -2.28638f)) + if ((cr = me->SummonCreature(NPC_GORDOK_KEG, -5145.75f, -575.667f, 397.176f, -2.28638f))) summons.Summon(cr); } - if (cr = me->SummonCreature(NPC_DARK_IRON_HERALD, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000)) + if ((cr = me->SummonCreature(NPC_DARK_IRON_HERALD, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000))) summons.Summon(cr); kegCounter = 0; @@ -1621,20 +1621,20 @@ public: if (caster->GetMapId() == 1) // Kalimdor { - if (cr = caster->FindNearestCreature(NPC_NORMAL_VOODOO, 40.0f)) + if ((cr = caster->FindNearestCreature(NPC_NORMAL_VOODOO, 40.0f))) cr->CastSpell(caster, SPELL_THROW_MUG_TO_PLAYER, true); - else if (cr = caster->FindNearestCreature(NPC_NORMAL_DROHN, 40.0f)) + else if ((cr = caster->FindNearestCreature(NPC_NORMAL_DROHN, 40.0f))) cr->CastSpell(caster, SPELL_THROW_MUG_TO_PLAYER, true); - else if (cr = caster->FindNearestCreature(NPC_NORMAL_GORDOK, 40.0f)) + else if ((cr = caster->FindNearestCreature(NPC_NORMAL_GORDOK, 40.0f))) cr->CastSpell(caster, SPELL_THROW_MUG_TO_PLAYER, true); } else // EK { - if (cr = caster->FindNearestCreature(NPC_NORMAL_THUNDERBREW, 40.0f)) + if ((cr = caster->FindNearestCreature(NPC_NORMAL_THUNDERBREW, 40.0f))) cr->CastSpell(caster, SPELL_THROW_MUG_TO_PLAYER, true); - else if (cr = caster->FindNearestCreature(NPC_NORMAL_BARLEYBREW, 40.0f)) + else if ((cr = caster->FindNearestCreature(NPC_NORMAL_BARLEYBREW, 40.0f))) cr->CastSpell(caster, SPELL_THROW_MUG_TO_PLAYER, true); - else if (cr = caster->FindNearestCreature(NPC_NORMAL_GORDOK, 40.0f)) + else if ((cr = caster->FindNearestCreature(NPC_NORMAL_GORDOK, 40.0f))) cr->CastSpell(caster, SPELL_THROW_MUG_TO_PLAYER, true); } diff --git a/src/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp b/src/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp index 022108187b..e0d6e6c7ff 100644 --- a/src/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp +++ b/src/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/culling_of_stratholme.cpp @@ -436,11 +436,11 @@ public: SetRun(false); Creature* cr = NULL; - if (cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1])) + if ((cr = me->SummonCreature(NPC_CITY_MAN3, EventPos[EVENT_SRC_HALL_CITYMAN1]))) cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK); - if (cr = me->SummonCreature(NPC_CITY_MAN4, EventPos[EVENT_SRC_HALL_CITYMAN2])) + if ((cr = me->SummonCreature(NPC_CITY_MAN4, EventPos[EVENT_SRC_HALL_CITYMAN2]))) cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK); - if (cr = me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_HALL_CITYMAN3])) + if ((cr = me->SummonCreature(NPC_CITY_MAN, EventPos[EVENT_SRC_HALL_CITYMAN3]))) cr->AI()->DoAction(ACTION_FORCE_CHANGE_LOCK); } else if (param == ACTION_START_SECRET_PASSAGE) diff --git a/src/scripts/Kalimdor/zone_desolace.cpp b/src/scripts/Kalimdor/zone_desolace.cpp index 08b25db864..edf7070a85 100644 --- a/src/scripts/Kalimdor/zone_desolace.cpp +++ b/src/scripts/Kalimdor/zone_desolace.cpp @@ -189,14 +189,14 @@ class npc_cork_gizelton : public CreatureScript me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); Creature* cr = NULL; - if (cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me)) + if ((cr = me->SummonCreature(NPC_RIGGER_GIZELTON, *me))) { cr->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); summons[0] = cr->GetGUID(); } - if (cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)) + if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me))) summons[1] = cr->GetGUID(); - if (cr = me->SummonCreature(NPC_CARAVAN_KODO, *me)) + if ((cr = me->SummonCreature(NPC_CARAVAN_KODO, *me))) summons[2] = cr->GetGUID(); SummonsFollow(); @@ -334,8 +334,8 @@ class npc_cork_gizelton : public CreatureScript float o = (i*M_PI/2)+(M_PI/4); float x = me->GetPositionX()+cos(o)*15.0f; float y = me->GetPositionY()+sin(o)*15.0f; - if (cr = me->SummonCreature((i%2 == 0 ? NPC_KOLKAR_WAYLAYER : NPC_KOLKAR_AMBUSHER), - x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = me->SummonCreature((i%2 == 0 ? NPC_KOLKAR_WAYLAYER : NPC_KOLKAR_AMBUSHER), + x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) cr->AI()->AttackStart(me); } if (cr) @@ -363,7 +363,7 @@ class npc_cork_gizelton : public CreatureScript if (i) entry = i == 1 ? NPC_DOOMWARDER : NPC_NETHER; - if (cr = me->SummonCreature(entry, x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = me->SummonCreature(entry, x, y, me->GetMap()->GetHeight(x, y, MAX_HEIGHT), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) cr->AI()->AttackStart(me); } if (cr) diff --git a/src/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 78d2211cb7..92a83451ca 100644 --- a/src/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -332,8 +332,8 @@ class spell_hadronox_summon_periodic : public SpellScriptLoader } private: - uint32 _spellEntry; uint32 _delay; + uint32 _spellEntry; }; AuraScript* GetAuraScript() const @@ -342,8 +342,8 @@ class spell_hadronox_summon_periodic : public SpellScriptLoader } private: - uint32 _spellEntry; uint32 _delay; + uint32 _spellEntry; }; class spell_hadronox_leech_poison : public SpellScriptLoader diff --git a/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp b/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp index 3732021a70..de6313817b 100644 --- a/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp +++ b/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_elder_nadox.cpp @@ -80,14 +80,14 @@ public: Creature *cr; if (swarm) { - if (cr = me->SummonCreature(NPC_AHNKAHAR_SWARMER, 640.425f, -919.544f, 25.8701f, 2.56563f)) + if ((cr = me->SummonCreature(NPC_AHNKAHAR_SWARMER, 640.425f, -919.544f, 25.8701f, 2.56563f))) summons.Summon(cr); - if (cr = me->SummonCreature(NPC_AHNKAHAR_SWARMER, 655.891f, -930.445f, 25.6978f, 3.64774f)) + if ((cr = me->SummonCreature(NPC_AHNKAHAR_SWARMER, 655.891f, -930.445f, 25.6978f, 3.64774f))) summons.Summon(cr); } else { - if (cr = me->SummonCreature(NPC_AHNKAHAR_GUARDIAN_ENTRY, 658.677f, -934.332f, 25.6978f, 3.03687f)) + if ((cr = me->SummonCreature(NPC_AHNKAHAR_GUARDIAN_ENTRY, 658.677f, -934.332f, 25.6978f, 3.03687f))) summons.Summon(cr); } } diff --git a/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp b/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp index 60b9851d2c..98c858d18a 100644 --- a/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp +++ b/src/scripts/Northrend/AzjolNerub/ahnkahet/boss_prince_taldaram.cpp @@ -158,15 +158,15 @@ public: me->CastSpell(me->GetVictim(), SPELL_CONJURE_FLAME_SPHERE, false); events.RescheduleEvent(EVENT_PRINCE_VANISH, 14000); Creature *cr; - if (cr = me->SummonCreature(CREATURE_FLAME_SPHERE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS)) + if ((cr = me->SummonCreature(CREATURE_FLAME_SPHERE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS))) summons.Summon(cr); if (me->GetMap()->IsHeroic()) { - if (cr = me->SummonCreature(CREATURE_FLAME_SPHERE_1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS)) + if ((cr = me->SummonCreature(CREATURE_FLAME_SPHERE_1, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS))) summons.Summon(cr); - if (cr = me->SummonCreature(CREATURE_FLAME_SPHERE_2, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS)) + if ((cr = me->SummonCreature(CREATURE_FLAME_SPHERE_2, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10*IN_MILLISECONDS))) summons.Summon(cr); } events.RepeatEvent(15000); diff --git a/src/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 6b459a5939..e2af8e2018 100644 --- a/src/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -262,7 +262,7 @@ public: { Unit* cr = NULL; for (uint8 i = 0; i < 3; ++i) - if (cr = ObjectAccessor::GetUnit(*me, pInstance->GetData64(DATA_TENEBRON+i))) + if ((cr = ObjectAccessor::GetUnit(*me, pInstance->GetData64(DATA_TENEBRON+i)))) { if (!cr->IsAlive()) continue; @@ -301,7 +301,7 @@ public: Creature* cr = NULL; for (uint8 i = 0; i < 3; ++i) if (dragons[i]) - if (cr = ObjectAccessor::GetCreature(*me, dragons[i])) + if ((cr = ObjectAccessor::GetCreature(*me, dragons[i]))) { if (combat && cr->IsInCombat()) continue; @@ -478,7 +478,7 @@ void boss_sartharion::boss_sartharionAI::HandleSartharionAbilities() uint8 iter = 0; for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i) { - if (cr = ObjectAccessor::GetCreature(*me, *i)) + if ((cr = ObjectAccessor::GetCreature(*me, *i))) if (cr->GetEntry() == NPC_FIRE_CYCLONE) { if (iter == rand) @@ -508,7 +508,7 @@ void boss_sartharion::boss_sartharionAI::HandleSartharionAbilities() summons.RemoveNotExisting(); for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i) { - if (cr = ObjectAccessor::GetCreature(*me, *i)) + if ((cr = ObjectAccessor::GetCreature(*me, *i))) if (cr->GetEntry() == NPC_FIRE_CYCLONE) cr->CastSpell(cr, SPELL_CYCLONE_AURA_PERIODIC, true); } @@ -754,12 +754,12 @@ public: Creature* cr = NULL; for (uint8 i = 0; i < 6; ++i) { - if (cr = me->SummonCreature(NPC_TWILIGHT_EGG, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000)) + if ((cr = me->SummonCreature(NPC_TWILIGHT_EGG, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))) { summons.Summon(cr); cr->SetPhaseMask(16, true); } - if (cr = me->SummonCreature(NPC_TWILIGHT_WHELP, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000)) + if ((cr = me->SummonCreature(NPC_TWILIGHT_WHELP, EggsPos[isSartharion ? i+6 : i].GetPositionX(), EggsPos[isSartharion ? i+6 : i].GetPositionY(), EggsPos[isSartharion ? i+6 : i].GetPositionZ(), EggsPos[isSartharion ? i+6 : i].GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))) { summons.Summon(cr); cr->SetPhaseMask(16, true); @@ -777,13 +777,13 @@ public: summons.DespawnEntry(NPC_TWILIGHT_WHELP); for (SummonList::iterator i = summons.begin(); i != summons.end(); ++i) { - if (cr = ObjectAccessor::GetCreature(*me, *i)) + if ((cr = ObjectAccessor::GetCreature(*me, *i))) { if (!cr->IsAlive()) continue; if (cr->GetEntry() == NPC_TWILIGHT_EGG) - if (cr = me->SummonCreature(NPC_TWILIGHT_WHELP, cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ(), cr->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000)) + if ((cr = me->SummonCreature(NPC_TWILIGHT_WHELP, cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ(), cr->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000))) summons2.Summon(cr); } } diff --git a/src/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 0c43f9c51d..f226397357 100644 --- a/src/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -697,6 +697,8 @@ class npc_halion_controller : public CreatureScript --_corporeality; break; } + default: + break; } _instance->DoUpdateWorldState(WORLDSTATE_CORPOREALITY_MATERIAL, _corporeality * 10); diff --git a/src/scripts/Northrend/DraktharonKeep/boss_dred.cpp b/src/scripts/Northrend/DraktharonKeep/boss_dred.cpp index a01e94acb9..ee5cd92e57 100644 --- a/src/scripts/Northrend/DraktharonKeep/boss_dred.cpp +++ b/src/scripts/Northrend/DraktharonKeep/boss_dred.cpp @@ -58,7 +58,7 @@ class boss_dred : public CreatureScript uint32 GetData(uint32 data) const { if (data == me->GetEntry()) - return uint32(_raptorCount >= _raptorCount); + return uint32(_raptorCount); return 0; } diff --git a/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 2798b21a13..39afc6c04d 100644 --- a/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -394,8 +394,8 @@ public: { if (pInstance && pInstance->GetData(DATA_INSTANCE_PROGRESS) == INSTANCE_PROGRESS_NONE) { - if (me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 192.0f && me->GetPositionY() < 206.0f || - me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 240.0f && me->GetPositionY() < 254.0f) + if ((me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 192.0f && me->GetPositionY() < 206.0f) || + (me->GetPositionX() > 490.0f && me->GetPositionX() < 504.0f && me->GetPositionY() > 240.0f && me->GetPositionY() < 254.0f)) { isInvincible = true; if (SPELL_NECROLYTE_CHANNELING) diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp index b3708177d1..d347688dc6 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_festergut.cpp @@ -158,8 +158,8 @@ class boss_festergut : public CreatureScript else if (Player* p = target->ToPlayer()) { // Gaseous Blight damage - if ((spell->Id == 69159 || spell->Id == 70136 || spell->Id == 69161 || spell->Id == 70139 || spell->Id == 69163 || spell->Id == 70469) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) == QUEST_STATUS_INCOMPLETE || - (spell->Id == 70135 || spell->Id == 70138 || spell->Id == 70468 || spell->Id == 70137 || spell->Id == 70140 || spell->Id == 70470) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) == QUEST_STATUS_INCOMPLETE) + if (((spell->Id == 69159 || spell->Id == 70136 || spell->Id == 69161 || spell->Id == 70139 || spell->Id == 69163 || spell->Id == 70469) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_10) == QUEST_STATUS_INCOMPLETE) || + ((spell->Id == 70135 || spell->Id == 70138 || spell->Id == 70468 || spell->Id == 70137 || spell->Id == 70140 || spell->Id == 70470) && p->GetQuestStatus(QUEST_RESIDUE_RENDEZVOUS_25) == QUEST_STATUS_INCOMPLETE)) p->CastSpell(p, SPELL_ORANGE_BLIGHT_RESIDUE, true); } } diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index d71f52c664..816f443900 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -646,10 +646,10 @@ class boss_lady_deathwhisper : public CreatureScript } private: + bool _introDone; uint64 _darnavanGUID; std::deque<uint64> _reanimationQueue; uint32 _waveCounter; - bool _introDone; }; CreatureAI* GetAI(Creature* creature) const diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index cb6071d6ee..c42d2d9aca 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -211,7 +211,7 @@ class boss_lord_marrowgar : public CreatureScript Unit* unit = SelectTarget(SELECT_TARGET_RANDOM, 0, BoneStormMoveTargetSelector(me)); if (!unit) { - if (unit = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 175.0f, true)) + if ((unit = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 175.0f, true))) if (unit->GetPositionX() > -337.0f) { EnterEvadeMode(); diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 514986d189..a966d55d7a 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -411,7 +411,7 @@ class boss_professor_putricide : public CreatureScript switch (id) { case POINT_FESTERGUT: - if (Creature* c = instance->instance->GetCreature(instance->GetData64(DATA_FESTERGUT))) + if (Creature* c = instance->instance->GetCreature(instance->GetData64(DATA_FESTERGUT))) { if (c->IsInCombat()) { instance->SetBossState(DATA_FESTERGUT, IN_PROGRESS); @@ -419,18 +419,24 @@ class boss_professor_putricide : public CreatureScript DoAction(ACTION_FESTERGUT_GAS); c->CastSpell(c, SPELL_GASEOUS_BLIGHT_LARGE, true, NULL, NULL, c->GetGUID()); } - else + else + { bCallEvade = true; + } + } break; case POINT_ROTFACE: - if (Creature* c = instance->instance->GetCreature(instance->GetData64(DATA_ROTFACE))) + if (Creature* c = instance->instance->GetCreature(instance->GetData64(DATA_ROTFACE))) { if (c->IsInCombat()) { instance->SetBossState(DATA_ROTFACE, IN_PROGRESS); me->SetFacingTo(rotfaceWatchPos.GetOrientation()); } - else + else + { bCallEvade = true; + } + } break; case POINT_TABLE: me->SetFacingTo(tablePos.GetOrientation()); @@ -982,7 +988,7 @@ class spell_putricide_unstable_experiment : public SpellScriptLoader std::list<Creature*> creList; GetCreatureListWithEntryInGrid(creList, GetCaster(), NPC_ABOMINATION_WING_MAD_SCIENTIST_STALKER, 200.0f); for (std::list<Creature*>::iterator itr = creList.begin(); itr != creList.end(); ++itr) - if ((*itr)->GetPositionX() > 4350.0f && stage == 0 || (*itr)->GetPositionX() < 4350.0f && stage == 1) + if (((*itr)->GetPositionX() > 4350.0f && stage == 0) || ((*itr)->GetPositionX() < 4350.0f && stage == 1)) { target = (*itr); break; diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 592025da8d..464c2be67b 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -881,9 +881,9 @@ public: if (p->getClass() == CLASS_HUNTER) return true; uint8 maxIndex = p->GetMostPointsTalentTree(); - if (p->getClass() == CLASS_PALADIN && maxIndex >= 1 || p->getClass() == CLASS_SHAMAN && maxIndex == 1 || p->getClass() == CLASS_DRUID && maxIndex == 1) + if ((p->getClass() == CLASS_PALADIN && maxIndex >= 1) || (p->getClass() == CLASS_SHAMAN && maxIndex == 1) || (p->getClass() == CLASS_DRUID && maxIndex == 1)) return true; - if (_removeHealers == (p->getClass() == CLASS_DRUID && maxIndex == 2 || p->getClass() == CLASS_PALADIN && maxIndex == 0 || p->getClass() == CLASS_PRIEST && maxIndex <= 1 || p->getClass() == CLASS_SHAMAN && maxIndex == 2)) + if (_removeHealers == ((p->getClass() == CLASS_DRUID && maxIndex == 2) || (p->getClass() == CLASS_PALADIN && maxIndex == 0) || (p->getClass() == CLASS_PRIEST && maxIndex <= 1) || (p->getClass() == CLASS_SHAMAN && maxIndex == 2))) return true; return false; diff --git a/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 3012c4c1db..f97fed1fc4 100644 --- a/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -377,7 +377,7 @@ public: return false; if (_maxDist && _source->GetExactDist(target) > _maxDist) return false; - if (_exclude1 && target->HasAura(_exclude1) || _exclude2 && target->HasAura(_exclude2)) + if ((_exclude1 && target->HasAura(_exclude1)) || (_exclude2 && target->HasAura(_exclude2))) return false; if (_reqLOS && !_source->IsWithinLOSInMap(target)) return false; @@ -1238,7 +1238,7 @@ class npc_tirion_fordring_tft : public CreatureScript void Reset() { _events.Reset(); - if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE || me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE)) + if (_instance->GetBossState(DATA_THE_LICH_KING) == DONE || (me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE))) me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetReactState(REACT_PASSIVE); } @@ -1310,7 +1310,7 @@ class npc_tirion_fordring_tft : public CreatureScript void JustReachedHome() { ScriptedAI::JustReachedHome(); - if (!(_instance->GetBossState(DATA_THE_LICH_KING) == DONE || me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE))) + if (!(_instance->GetBossState(DATA_THE_LICH_KING) == DONE || (me->GetMap()->IsHeroic() && !_instance->GetData(DATA_LK_HC_AVAILABLE)))) me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); } @@ -2485,11 +2485,11 @@ class npc_valkyr_shadowguard : public CreatureScript } EventMap _events; - InstanceScript* _instance; Position _destPoint; uint64 _grabbedPlayer; bool didbelow50pct; bool dropped; + InstanceScript* _instance; bool IsHeroic() { return me->GetMap()->IsHeroic(); } diff --git a/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 8b4f825996..5ef09649ba 100644 --- a/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -2004,7 +2004,7 @@ class spell_icc_geist_alarm : public SpellScriptLoader { bool hasTarget = false; Unit* target = NULL; - if (target = l->SelectNearestTarget(20.0f)) + if ((target = l->SelectNearestTarget(20.0f))) hasTarget = true; else { @@ -3231,7 +3231,7 @@ public: --currPipeWP; } me->SetHomePosition(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), me->GetOrientation()); - if (forward && currPipeWP == 3 || !forward && currPipeWP == 2) + if ((forward && currPipeWP == 3) || (!forward && currPipeWP == 2)) me->GetMotionMaster()->MoveJump(VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ(), 10.0f, 6.0f, 1); else me->GetMotionMaster()->MovePoint(1, VengefulWP[currPipeWP].GetPositionX(), VengefulWP[currPipeWP].GetPositionY(), VengefulWP[currPipeWP].GetPositionZ()); @@ -3275,7 +3275,7 @@ public: bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) { - if (creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206 || creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204) + if ((creature->GetEntry() == NPC_GARROSH_HELLSCREAM && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11206) || (creature->GetEntry() == NPC_KING_VARIAN_WRYNN && player->PlayerTalkClass->GetGossipMenu().GetMenuId() == 11204)) { if (!player->GetGroup() || !player->GetGroup()->isRaidGroup() || !player->GetGroup()->IsLeader(player->GetGUID())) { diff --git a/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index c49bcb1982..7d16bff495 100644 --- a/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -526,7 +526,7 @@ class instance_icecrown_citadel : public InstanceMapScript return entry; return 0; case NPC_SPIRE_FROSTWYRM: - if (TeamIdInInstance == TEAM_ALLIANCE && data->posY < 2200.0f || TeamIdInInstance == TEAM_HORDE && data->posY > 2200.0f) + if ((TeamIdInInstance == TEAM_ALLIANCE && data->posY < 2200.0f) || (TeamIdInInstance == TEAM_HORDE && data->posY > 2200.0f)) return 0; break; } diff --git a/src/scripts/Northrend/Naxxramas/instance_naxxramas.cpp b/src/scripts/Northrend/Naxxramas/instance_naxxramas.cpp index ec39a667f8..e5c49a7cf6 100644 --- a/src/scripts/Northrend/Naxxramas/instance_naxxramas.cpp +++ b/src/scripts/Northrend/Naxxramas/instance_naxxramas.cpp @@ -493,25 +493,25 @@ public: { Creature* cr; _horsemanKilled = 0; - if (cr = instance->GetCreature(_blaumeuxGUID)) + if ((cr = instance->GetCreature(_blaumeuxGUID))) if (!cr->IsAlive()) { cr->SetPosition(cr->GetHomePosition()); cr->Respawn(); } - if (cr = instance->GetCreature(_rivendareGUID)) + if ((cr = instance->GetCreature(_rivendareGUID))) if (!cr->IsAlive()) { cr->SetPosition(cr->GetHomePosition()); cr->Respawn(); } - if (cr = instance->GetCreature(_zeliekGUID)) + if ((cr = instance->GetCreature(_zeliekGUID))) if (!cr->IsAlive()) { cr->SetPosition(cr->GetHomePosition()); cr->Respawn(); } - if (cr = instance->GetCreature(_korthazzGUID)) + if ((cr = instance->GetCreature(_korthazzGUID))) if (!cr->IsAlive()) { cr->SetPosition(cr->GetHomePosition()); @@ -521,13 +521,13 @@ public: else if (data == IN_PROGRESS) { Creature* cr; - if (cr = instance->GetCreature(_blaumeuxGUID)) + if ((cr = instance->GetCreature(_blaumeuxGUID))) cr->SetInCombatWithZone(); - if (cr = instance->GetCreature(_rivendareGUID)) + if ((cr = instance->GetCreature(_rivendareGUID))) cr->SetInCombatWithZone(); - if (cr = instance->GetCreature(_zeliekGUID)) + if ((cr = instance->GetCreature(_zeliekGUID))) cr->SetInCombatWithZone(); - if (cr = instance->GetCreature(_korthazzGUID)) + if ((cr = instance->GetCreature(_korthazzGUID))) cr->SetInCombatWithZone(); } diff --git a/src/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp index 6a88539fb1..103d5fd0ce 100644 --- a/src/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp +++ b/src/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp @@ -141,7 +141,7 @@ public: Creature* spark; for (uint8 i = 0; i < 5; ++i) { - if (spark = me->SummonCreature(NPC_SPARK_OF_IONAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + if ((spark = me->SummonCreature(NPC_SPARK_OF_IONAR, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000))) { summons.Summon(spark); spark->CastSpell(spark, me->GetMap()->IsHeroic() ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true); diff --git a/src/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp b/src/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp index cef8ede3e7..9510358355 100644 --- a/src/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp +++ b/src/scripts/Northrend/Ulduar/HallsOfStone/brann_bronzebeard.cpp @@ -243,9 +243,9 @@ public: void DespawnHeads() { Creature *cr; - if (cr = GetAbedneum()) cr->DespawnOrUnsummon(); - if (cr = GetMarnak()) cr->DespawnOrUnsummon(); - if (cr = GetKaddrak()) cr->DespawnOrUnsummon(); + if ((cr = GetAbedneum())) cr->DespawnOrUnsummon(); + if ((cr = GetMarnak())) cr->DespawnOrUnsummon(); + if ((cr = GetKaddrak())) cr->DespawnOrUnsummon(); SwitchHeadVisaul(0x7, false); } @@ -256,15 +256,15 @@ public: GameObject *go = NULL; if (headMask & 0x1) // Kaddrak - if (go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_KADDRAK))) + if ((go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_KADDRAK)))) activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY); if (headMask & 0x2) // Marnak - if (go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_MARNAK))) + if ((go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_MARNAK)))) activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY); if (headMask & 0x4) // Abedneum - if (go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_ABEDNEUM))) + if ((go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_ABEDNEUM)))) activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY); } @@ -596,17 +596,17 @@ public: void brann_bronzebeard::brann_bronzebeardAI::InitializeEvent() { Creature* cr = NULL; - if (cr = me->SummonCreature(NPC_KADDRAK, 923.7f, 326.9f, 219.5f, 2.1f, TEMPSUMMON_TIMED_DESPAWN, 580000)) + if ((cr = me->SummonCreature(NPC_KADDRAK, 923.7f, 326.9f, 219.5f, 2.1f, TEMPSUMMON_TIMED_DESPAWN, 580000))) { cr->SetInCombatWithZone(); KaddrakGUID = cr->GetGUID(); } - if (cr = me->SummonCreature(NPC_MARNAK, 895.974f, 363.571f, 219.337f, 5.5f, TEMPSUMMON_TIMED_DESPAWN, 580000)) + if ((cr = me->SummonCreature(NPC_MARNAK, 895.974f, 363.571f, 219.337f, 5.5f, TEMPSUMMON_TIMED_DESPAWN, 580000))) { cr->SetInCombatWithZone(); MarnakGUID = cr->GetGUID(); } - if (cr = me->SummonCreature(NPC_ABEDNEUM, 892.25f, 331.25f, 223.86f, 0.6f, TEMPSUMMON_TIMED_DESPAWN, 580000)) + if ((cr = me->SummonCreature(NPC_ABEDNEUM, 892.25f, 331.25f, 223.86f, 0.6f, TEMPSUMMON_TIMED_DESPAWN, 580000))) { cr->SetInCombatWithZone(); AbedneumGUID = cr->GetGUID(); diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp index b30263d76c..e25e332c3f 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_algalon_the_observer.cpp @@ -275,11 +275,11 @@ class boss_algalon_the_observer : public CreatureScript { if (!item) // should not happen, but checked in GetAverageItemLevel() return true; - if (item->ItemLevel <= 226 || item->ItemLevel <= 232 && ( + if (item->ItemLevel <= 226 || (item->ItemLevel <= 232 && ( item->InventoryType == INVTYPE_SHIELD || item->Class == ITEM_CLASS_WEAPON || - item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE) - )) + (item->Class == ITEM_CLASS_ARMOR && (item->InventoryType == INVTYPE_RELIC || item->InventoryType == INVTYPE_HOLDABLE)) + ))) return true; return false; } diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp index 5f0b74b204..f693fc4924 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_flame_leviathan.cpp @@ -537,24 +537,24 @@ void boss_flame_leviathan::boss_flame_leviathanAI::TurnGates(bool _start, bool _ { // first one is ALWAYS turned on, unless leviathan is beaten GameObject* go = NULL; - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_LIGHTNING_WALL2))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_LIGHTNING_WALL2)))) go->SetGoState(GO_STATE_READY); if (m_pInstance->GetData(TYPE_LEVIATHAN) == NOT_STARTED) - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_LEVIATHAN_DOORS))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_LEVIATHAN_DOORS)))) go->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); } else { GameObject* go = NULL; if (_death) - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_LIGHTNING_WALL1))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_LIGHTNING_WALL1)))) go->SetGoState(GO_STATE_ACTIVE); - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_LIGHTNING_WALL2))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_LIGHTNING_WALL2)))) go->SetGoState(GO_STATE_ACTIVE); - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_LEVIATHAN_DOORS))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_LEVIATHAN_DOORS)))) { if (m_pInstance->GetData(TYPE_LEVIATHAN) == SPECIAL || m_pInstance->GetData(TYPE_LEVIATHAN) == DONE) go->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); @@ -572,16 +572,16 @@ void boss_flame_leviathan::boss_flame_leviathanAI::TurnHealStations(bool _apply) GameObject* go = NULL; if (_apply) { - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION1))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION1)))) go->SetLootState(GO_READY); - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION2))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION2)))) go->SetLootState(GO_READY); } else { - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION1))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION1)))) go->SetLootState(GO_ACTIVATED); - if (go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION2))) + if ((go = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(DATA_REPAIR_STATION2)))) go->SetLootState(GO_ACTIVATED); } } diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp index 6988722eff..42333ac61e 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_hodir.cpp @@ -470,8 +470,8 @@ public: if( faction ) for( uint8 k=0; k<4; ++k ) { - if( faction == 'A' && ( k>1 || k==1 && RAID_MODE(1,0) ) || - faction == 'H' && ( k<2 || k==3 && RAID_MODE(1,0) ) ) + if( (faction == 'A' && ( k>1 || (k==1 && RAID_MODE(1,0)) )) || + (faction == 'H' && ( k<2 || (k==3 && RAID_MODE(1,0)) )) ) continue; for( uint8 i=0; i<4; ++i ) @@ -636,10 +636,10 @@ public: if (timer <= diff) { timer = 2500; - if (me->IsSummon()) + if (me->IsSummon()) { if (Unit* s = me->ToTempSummon()->GetSummoner()) { - if (s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER) || s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC)) + if ((s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || (s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC))) me->DespawnOrUnsummon(2000); else if (s->GetTypeId() == TYPEID_PLAYER) if (InstanceScript* pInstance = me->GetInstanceScript()) @@ -650,7 +650,10 @@ public: } } else + { me->DespawnOrUnsummon(2000); + } + } } else timer -= diff; diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp index 38d0b42a3e..acfebbb62f 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_mimiron.cpp @@ -491,11 +491,11 @@ public: Creature* VX001 = NULL; Creature* LMK2 = NULL; Creature* ACU = NULL; - if (VX001 = GetVX001()) + if ((VX001 = GetVX001())) VX001->CastSpell(VX001, SPELL_BERSERK, true); - if (LMK2 = GetLMK2()) + if ((LMK2 = GetLMK2())) LMK2->CastSpell(LMK2, SPELL_BERSERK, true); - if (ACU = GetACU()) + if ((ACU = GetACU())) ACU->CastSpell(ACU, SPELL_BERSERK, true); events.RepeatEvent(30000); } diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp index eb38ca94be..6f643b1517 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp @@ -317,7 +317,7 @@ public: boss_thorimAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me) { m_pInstance = pCreature->GetInstanceScript(); - if (_encounterFinished = (!me->IsAlive())) + if ((_encounterFinished = (!me->IsAlive()))) if (m_pInstance) m_pInstance->SetData(TYPE_THORIM, DONE); } @@ -406,18 +406,18 @@ public: void CloseDoors() { GameObject* go; - if (go = GetThorimObject(DATA_THORIM_LEVER)) + if ((go = GetThorimObject(DATA_THORIM_LEVER))) { go->SetUInt32Value(GAMEOBJECT_FLAGS, 48); go->SetGoState(GO_STATE_READY); } - if (go = GetThorimObject(DATA_THORIM_FIRST_DOORS)) + if ((go = GetThorimObject(DATA_THORIM_FIRST_DOORS))) go->SetGoState(GO_STATE_READY); - if (go = GetThorimObject(DATA_THORIM_SECOND_DOORS)) + if ((go = GetThorimObject(DATA_THORIM_SECOND_DOORS))) go->SetGoState(GO_STATE_READY); - if (go = GetThorimObject(DATA_THORIM_FENCE)) + if ((go = GetThorimObject(DATA_THORIM_FENCE))) go->SetGoState(GO_STATE_ACTIVE); } @@ -572,14 +572,14 @@ public: events.ScheduleEvent(EVENT_THORIM_OUTRO1, 2000, 0, EVENT_PHASE_OUTRO); GameObject* go = NULL; - if (go = GetThorimObject(DATA_THORIM_FENCE)) + if ((go = GetThorimObject(DATA_THORIM_FENCE))) go->SetGoState(GO_STATE_ACTIVE); uint32 chestId = me->GetMap()->Is25ManRaid() ? GO_THORIM_CHEST_HERO : GO_THORIM_CHEST; if (_hardMode) chestId += 1; // hard mode offset - if (go = me->SummonGameObject(chestId, 2134.73f, -286.32f, 419.51f, 0.0f, 0, 0, 0, 0, 0)) + if ((go = me->SummonGameObject(chestId, 2134.73f, -286.32f, 419.51f, 0.0f, 0, 0, 0, 0, 0))) go->SetUInt32Value(GAMEOBJECT_FLAGS, 0); // Defeat credit @@ -602,7 +602,7 @@ public: for (uint8 i = 0; i < (_spawnCommoners ? 7 : 2); ++i) { rnd = urand(0, 13); - if (cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0,2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)) + if ((cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0,2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))) cr->GetMotionMaster()->MoveJump( Middle.GetPositionX()+urand(19,24)*cos(Middle.GetAngle(cr)), Middle.GetPositionY()+urand(19,24)*sin(Middle.GetAngle(cr)), @@ -1405,14 +1405,14 @@ public: events.ScheduleEvent(EVENT_RC_RUNIC_SMASH, 0); Creature* c; - if (c = me->SummonCreature(33140, 2221, -385, me->GetPositionZ())) + if ((c = me->SummonCreature(33140, 2221, -385, me->GetPositionZ()))) _triggerRightGUID[0] = c->GetGUID(); - if (c = me->SummonCreature(33140, 2210, -385, me->GetPositionZ())) + if ((c = me->SummonCreature(33140, 2210, -385, me->GetPositionZ()))) _triggerRightGUID[1] = c->GetGUID(); - if (c = me->SummonCreature(33141, 2235, -385, me->GetPositionZ())) + if ((c = me->SummonCreature(33141, 2235, -385, me->GetPositionZ()))) _triggerLeftGUID[0] = c->GetGUID(); - if (c = me->SummonCreature(33141, 2246, -385, me->GetPositionZ())) + if ((c = me->SummonCreature(33141, 2246, -385, me->GetPositionZ()))) _triggerLeftGUID[1] = c->GetGUID(); } diff --git a/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 1920c9602e..f0bd15facb 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -484,7 +484,7 @@ public: if (!summon || summon->GetEntry() != NPC_OMINOUS_CLOUD || me->GetDistance(summon) < 20) continue; - if ((!cloud || urand(0,1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS))) + if ((!cloud || (urand(0,1) && !summon->HasAura(SPELL_SUMMON_GUARDIAN_OF_YS)))) cloud = summon; } @@ -525,7 +525,7 @@ public: for (uint8 i = 0; i < RAID_MODE(4, 10); ++i) { float ang = i ? (M_PI*2.0f/i) : M_PI*2.0f; - if (cr = me->SummonCreature(NPC_DESCEND_INTO_MADNESS, me->GetPositionX()+25*cos(ang), me->GetPositionY()+25*sin(ang), 326, 0, TEMPSUMMON_TIMED_DESPAWN, 15000)) + if ((cr = me->SummonCreature(NPC_DESCEND_INTO_MADNESS, me->GetPositionX()+25*cos(ang), me->GetPositionY()+25*sin(ang), 326, 0, TEMPSUMMON_TIMED_DESPAWN, 15000))) { cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_NON_ATTACKABLE); cr->SetArmor(_currentIllusion); diff --git a/src/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp index 6cd6e10273..92ad8661ef 100644 --- a/src/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp +++ b/src/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp @@ -618,9 +618,9 @@ public: instance->LoadGrid(364.0f, -16.0f); //make sure leviathan is loaded m_leviathanTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED] = data; GameObject* gobj = NULL; - if (gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][0])) + if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][0]))) gobj->SetGoState(GO_STATE_ACTIVE); - if (gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][1])) + if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][1]))) gobj->SetGoState(GO_STATE_ACTIVE); return; } @@ -1121,11 +1121,11 @@ void instance_ulduar::instance_ulduar_InstanceMapScript::SpawnLeviathanEncounter TempSummon* veh = NULL; for (uint8 i = 0; i < (instance->Is25ManRaid() ? 5 : 2); ++i) { - if (veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15*mode+i])) + if ((veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15*mode+i]))) _leviathanVehicles.push_back(veh->GetGUID()); - if (veh = instance->SummonCreature(NPC_VEHICLE_CHOPPER, vehiclePositions[15*mode+i+5])) + if ((veh = instance->SummonCreature(NPC_VEHICLE_CHOPPER, vehiclePositions[15*mode+i+5]))) _leviathanVehicles.push_back(veh->GetGUID()); - if (veh = instance->SummonCreature(NPC_SALVAGED_DEMOLISHER, vehiclePositions[15*mode+i+10])) + if ((veh = instance->SummonCreature(NPC_SALVAGED_DEMOLISHER, vehiclePositions[15*mode+i+10]))) _leviathanVehicles.push_back(veh->GetGUID()); } } diff --git a/src/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp b/src/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp index 8e91063652..2426ad36f7 100644 --- a/src/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp +++ b/src/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_skarvald_dalronn.cpp @@ -131,8 +131,8 @@ public: { if( me->GetEntry() != NPC_SKARVALD ) return; - if( pInstance ) - if( Creature* dalronn = pInstance->instance->GetCreature(pInstance->GetData64(DATA_DALRONN)) ) + if( pInstance ) { + if( Creature* dalronn = pInstance->instance->GetCreature(pInstance->GetData64(DATA_DALRONN)) ) { if( dalronn->isDead() ) { Talk(YELL_SKARVALD_SKA_DIEDFIRST); @@ -145,6 +145,9 @@ public: Talk(YELL_SKARVALD_DAL_DIED); dalronn->AI()->DoAction(1); } + } + } + me->CastSpell((Unit*)NULL, SPELL_SUMMON_SKARVALD_GHOST, true); } @@ -281,8 +284,8 @@ public: { if( me->GetEntry() != NPC_DALRONN ) return; - if( pInstance ) - if( Creature* skarvald = pInstance->instance->GetCreature(pInstance->GetData64(DATA_SKARVALD)) ) + if( pInstance ) { + if( Creature* skarvald = pInstance->instance->GetCreature(pInstance->GetData64(DATA_SKARVALD)) ) { if( skarvald->isDead() ) { Talk(YELL_DALRONN_DAL_DIEDFIRST); @@ -295,6 +298,8 @@ public: Talk(YELL_DALRONN_SKA_DIED); skarvald->AI()->DoAction(1); } + } + } me->CastSpell((Unit*)NULL, SPELL_SUMMON_DALRONN_GHOST, true); } diff --git a/src/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp b/src/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp index d3cbcb86a6..f02ff773ca 100644 --- a/src/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp +++ b/src/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_skadi.cpp @@ -329,13 +329,13 @@ public: if (point == 0) { Creature *cr; - if (cr = me->SummonCreature(NPC_BREATH_TRIGGER, 483, -484.9f, 105, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000)) + if ((cr = me->SummonCreature(NPC_BREATH_TRIGGER, 483, -484.9f, 105, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))) cr->CastSpell(cr, cr->GetMap()->IsHeroic() ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH_N, true); - if (cr = me->SummonCreature(NPC_BREATH_TRIGGER, 471.0f, -484.7f, 105, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000)) + if ((cr = me->SummonCreature(NPC_BREATH_TRIGGER, 471.0f, -484.7f, 105, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))) cr->CastSpell(cr, cr->GetMap()->IsHeroic() ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH_N, true); for (uint8 j = 0; j < 7; j++) - if (cr = me->SummonCreature(NPC_BREATH_TRIGGER, 477.0f, -507.0f+(j*3), 105.0f, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000)) + if ((cr = me->SummonCreature(NPC_BREATH_TRIGGER, 477.0f, -507.0f+(j*3), 105.0f, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000))) cr->CastSpell(cr, cr->GetMap()->IsHeroic() ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH_N, true); } } diff --git a/src/scripts/Northrend/VioletHold/boss_erekem.cpp b/src/scripts/Northrend/VioletHold/boss_erekem.cpp index 8222317ea7..52c2e4fc22 100644 --- a/src/scripts/Northrend/VioletHold/boss_erekem.cpp +++ b/src/scripts/Northrend/VioletHold/boss_erekem.cpp @@ -125,7 +125,7 @@ public: Creature *pGuard1 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_1_GUID)); Creature *pGuard2 = pInstance->instance->GetCreature(pInstance->GetData64(DATA_EREKEM_GUARD_2_GUID)); - if (pGuard1 && !pGuard1->IsAlive() || pGuard2 && !pGuard2->IsAlive()) + if ((pGuard1 && !pGuard1->IsAlive()) || (pGuard2 && !pGuard2->IsAlive())) { events.RepeatEvent(urand(3000,6000)); break; diff --git a/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp b/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp index 1db8fed934..ef8d16c821 100644 --- a/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp +++ b/src/scripts/Northrend/VioletHold/instance_violet_hold.cpp @@ -397,7 +397,7 @@ public: pBoss->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING); pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_NPC); pBoss->SetReactState(REACT_AGGRESSIVE); - if (WaveCount == 6 && m_auiEncounter[0] == DONE || WaveCount == 12 && m_auiEncounter[1] == DONE) + if ((WaveCount == 6 && m_auiEncounter[0] == DONE) || (WaveCount == 12 && m_auiEncounter[1] == DONE)) pBoss->SetLootMode(0); } } diff --git a/src/scripts/Northrend/isle_of_conquest.cpp b/src/scripts/Northrend/isle_of_conquest.cpp index d5d8dfe5ae..08c054d9cd 100644 --- a/src/scripts/Northrend/isle_of_conquest.cpp +++ b/src/scripts/Northrend/isle_of_conquest.cpp @@ -378,7 +378,7 @@ class spell_ioc_gunship_portal : public SpellScriptLoader { PreventHitDefaultEffect(effIndex); /*Player* caster = GetCaster()->ToPlayer(); - /* + * * HACK: GetWorldLocation() returns real position and not transportposition. * ServertoClient: SMSG_MOVE_TELEPORT (0x0B39) * counter: 45 diff --git a/src/scripts/Northrend/zone_dragonblight.cpp b/src/scripts/Northrend/zone_dragonblight.cpp index 817085fa73..fa92e33d8d 100644 --- a/src/scripts/Northrend/zone_dragonblight.cpp +++ b/src/scripts/Northrend/zone_dragonblight.cpp @@ -369,7 +369,7 @@ public: for (uint8 i = 0; i < count[phase]; ++i) { me->GetNearPoint(me, x, y, z, me->GetCombatReach(), 10.0f, rand_norm()*2*M_PI); - if (cr = me->SummonCreature(randEntry(), x, y, z+2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = me->SummonCreature(randEntry(), x, y, z+2.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) { cr->CastSpell(cr, SPELL_TELEPORT_EFFECT, true); cr->AI()->AttackStart(me); @@ -380,7 +380,7 @@ public: else if (phase == 3) { me->GetNearPoint(me, x, y, z, me->GetCombatReach(), 20.0f, rand_norm()*2*M_PI); - if (cr = me->SummonCreature(NPC_INFINITE_TIMERENDER, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = me->SummonCreature(NPC_INFINITE_TIMERENDER, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) { cr->CastSpell(cr, SPELL_TELEPORT_EFFECT, true); cr->AI()->AttackStart(me); diff --git a/src/scripts/Northrend/zone_sholazar_basin.cpp b/src/scripts/Northrend/zone_sholazar_basin.cpp index cc2db463ce..46e78224f8 100644 --- a/src/scripts/Northrend/zone_sholazar_basin.cpp +++ b/src/scripts/Northrend/zone_sholazar_basin.cpp @@ -121,13 +121,13 @@ public: me->SetControlled(false, UNIT_STATE_STUNNED); Creature *cr; - if (cr = me->SummonCreature(NPC_JALOOT, 5616.91f, 3772.67f, -94.26f, 1.78f)) + if ((cr = me->SummonCreature(NPC_JALOOT, 5616.91f, 3772.67f, -94.26f, 1.78f))) { summons.Summon(cr); cr->CastSpell(cr, SPELL_TOMB_OF_THE_HEARTLESS, true); cr->setFaction(me->getFaction()); } - if (cr = me->SummonCreature(NPC_ZEPIK, 5631.63f, 3794.36f, -92.24f, 3.45f)) + if ((cr = me->SummonCreature(NPC_ZEPIK, 5631.63f, 3794.36f, -92.24f, 3.45f))) { summons.Summon(cr); cr->CastSpell(cr, SPELL_TOMB_OF_THE_HEARTLESS, true); diff --git a/src/scripts/Northrend/zone_storm_peaks.cpp b/src/scripts/Northrend/zone_storm_peaks.cpp index 20c0d4b9db..a755584f8e 100644 --- a/src/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/scripts/Northrend/zone_storm_peaks.cpp @@ -496,7 +496,7 @@ public: if (checkTimer >= 2000) { checkTimer = 1; - if (me->HealthBelowPct(25)) + if (me->HealthBelowPct(25)) { if (Player* player = GetValidPlayer()) { Talk(3); @@ -513,6 +513,7 @@ public: EnterEvadeMode(); return; } + } } } else if (checkTimer < 20000) diff --git a/src/scripts/OutdoorPvP/OutdoorPvPGH.cpp b/src/scripts/OutdoorPvP/OutdoorPvPGH.cpp index 2f5a007254..c0b7610e31 100644 --- a/src/scripts/OutdoorPvP/OutdoorPvPGH.cpp +++ b/src/scripts/OutdoorPvP/OutdoorPvPGH.cpp @@ -22,7 +22,7 @@ OutdoorPvPGH::OutdoorPvPGH() bool OutdoorPvPGH::SetupOutdoorPvP() { RegisterZone(GH_ZONE); - if (m_obj = new OPvPCapturePointGH(this)) + if ((m_obj = new OPvPCapturePointGH(this))) { AddCapturePoint(m_obj); return true; @@ -95,6 +95,8 @@ void OPvPCapturePointGH::ChangeState() sGameEventMgr->StartEvent(GH_HORDE_DEFENSE_EVENT); artkit = 1; break; + default: + break; } if (GameObject* flag = HashMapHolder<GameObject>::Find(m_capturePointGUID)) diff --git a/src/scripts/OutdoorPvP/OutdoorPvPSI.cpp b/src/scripts/OutdoorPvP/OutdoorPvPSI.cpp index bf22248892..b67892f4d4 100644 --- a/src/scripts/OutdoorPvP/OutdoorPvPSI.cpp +++ b/src/scripts/OutdoorPvP/OutdoorPvPSI.cpp @@ -209,6 +209,8 @@ bool OutdoorPvPSI::HandleDropFlag(Player* player, uint32 spellId) } } break; + default: + break; } return true; } diff --git a/src/scripts/Outland/BlackTemple/illidari_council.cpp b/src/scripts/Outland/BlackTemple/illidari_council.cpp index 70a8950461..2bb81ceb29 100644 --- a/src/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/scripts/Outland/BlackTemple/illidari_council.cpp @@ -143,7 +143,7 @@ public: BossAI::Reset(); Creature* member = NULL; for (uint8 i = 0; i < 4; ++i) - if (member = ObjectAccessor::GetCreature(*me, councilGUIDs[i])) + if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))) member->AI()->EnterEvadeMode(); } @@ -179,7 +179,7 @@ public: { Creature* member = NULL; for (uint8 i = 0; i < 4; ++i) - if (member = ObjectAccessor::GetCreature(*me, councilGUIDs[i])) + if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))) member->AI()->DoAction(ACTION_ENRAGE); } else if (param == ACTION_END_ENCOUNTER) @@ -187,7 +187,7 @@ public: me->setActive(false); Creature* member = NULL; for (uint8 i = 0; i < 4; ++i) - if (member = ObjectAccessor::GetCreature(*me, councilGUIDs[i])) + if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))) if (member->IsAlive()) Unit::Kill(me, member); Unit::Kill(me, me); diff --git a/src/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp b/src/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp index bf9a115e3c..b777f3db03 100644 --- a/src/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp +++ b/src/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp @@ -186,7 +186,7 @@ class boss_the_lurker_below : public CreatureScript if (target) me->AttackerStateUpdate(target); - else if (target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + else if ((target = SelectTarget(SELECT_TARGET_RANDOM, 0))) me->CastSpell(target, SPELL_WATER_BOLT, false); me->resetAttackTimer(); diff --git a/src/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index 6ea8fbdaea..c219ea872c 100644 --- a/src/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -79,8 +79,8 @@ public: } private: - uint64 _targetGUID; Creature& _owner; + uint64 _targetGUID; }; class boss_magtheridon : public CreatureScript diff --git a/src/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index 1bdb79ac79..c88197c3cc 100644 --- a/src/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -221,6 +221,8 @@ class npc_millhouse_manastorm : public CreatureScript me->CastSpell(me->GetVictim(), SPELL_FROSTBOLT, false); events.ScheduleEvent(EVENT_MILL_BASE_SPELL, 4000); break; + default: + break; } break; diff --git a/src/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp b/src/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp index 005649cdb8..bdbcf81136 100644 --- a/src/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp +++ b/src/scripts/Outland/TempestKeep/botanica/instance_the_botanica.cpp @@ -160,6 +160,8 @@ class spell_botanica_shift_form : public SpellScriptLoader case SPELL_SCHOOL_FROST: form = SPELL_FROST_FORM; break; case SPELL_SCHOOL_ARCANE: form = SPELL_ARCANE_FORM; break; case SPELL_SCHOOL_SHADOW: form = SPELL_SHADOW_FORM; break; + default: + break; } if (form) diff --git a/src/scripts/Outland/zone_blades_edge_mountains.cpp b/src/scripts/Outland/zone_blades_edge_mountains.cpp index 6bdab78688..c9325bccd0 100644 --- a/src/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/scripts/Outland/zone_blades_edge_mountains.cpp @@ -88,7 +88,7 @@ public: if (timer) { timer += diff; - if ((timer >= 0 && timer < 10000) || (timer >= 20000 && timer < 30000)) + if (timer < 10000 || (timer >= 20000 && timer < 30000)) { for (uint8 i = 0; i < 3; ++i) if (Creature* cr = me->SummonCreature((roll_chance_i(50) ? 22474 : 22500), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) diff --git a/src/scripts/Outland/zone_zangarmarsh.cpp b/src/scripts/Outland/zone_zangarmarsh.cpp index ad64a6f09e..aca749ee56 100644 --- a/src/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/scripts/Outland/zone_zangarmarsh.cpp @@ -61,13 +61,14 @@ public: { creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC); Creature* cr; - if (cr = creature->SummonCreature(17957, -186, -790, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = creature->SummonCreature(17957, -186, -790, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) cr->AI()->AttackStart(creature); - if (cr = creature->SummonCreature(17960, -188, -783, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = creature->SummonCreature(17960, -188, -783, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) cr->AI()->AttackStart(player); - if (cr = creature->SummonCreature(17957, -196, -783, 43.8f, 4.4f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + if ((cr = creature->SummonCreature(17957, -196, -783, 43.8f, 4.4f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))) cr->AI()->AttackStart(player); - if (GameObject* cage = creature->FindNearestGameObject(GO_CAGE_ENTRY, 20.0f)) + GameObject* cage = creature->FindNearestGameObject(GO_CAGE_ENTRY, 20.0f); + if (cage) cage->SetGoState(GO_STATE_ACTIVE); creature->SetHomePosition(-195.39f, -795.91f, 43.8f, 1.0f); creature->AI()->Talk(1); |