diff options
author | maximius <none@none> | 2009-10-27 22:09:45 -0700 |
---|---|---|
committer | maximius <none@none> | 2009-10-27 22:09:45 -0700 |
commit | d2fe03dda7e12c11048a58163b934e860f2c6e46 (patch) | |
tree | 28849c5f4715c43c06911e8780cb7bf4f9d4b02a | |
parent | 291b255feed74e2706d760beccc9ad19174299b2 (diff) |
*Even more cleanup and optimization.
--HG--
branch : trunk
53 files changed, 274 insertions, 239 deletions
diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 4bf18585a00..5e7639656b3 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -184,15 +184,17 @@ void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID()); else - error_log("TSCR: DoScriptText entry %i cannot whisper without pTarget unit (TYPEID_PLAYER).", iTextEntry); - }break; + error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + } + break; case CHAT_TYPE_BOSS_WHISPER: { if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true); else - error_log("TSCR: DoScriptText entry %i cannot whisper without pTarget unit (TYPEID_PLAYER).", iTextEntry); - }break; + error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + } + break; case CHAT_TYPE_ZONE_YELL: pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); break; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp index 11812b92482..e50bde51a4c 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp @@ -720,12 +720,12 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI void EnterCombat(Unit* who) { - switch(rand()%3) - { - case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; - case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; - case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break; - } + switch (urand(0,2)) + { + case 0: m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; + case 1: m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; + case 2: m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; + } } void Reset() {} @@ -916,12 +916,12 @@ struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI void EnterCombat(Unit* who) { - switch(rand()%3) - { - case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; - case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; - case 2:m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID);break; - } + switch (urand(0,2)) + { + case 0: m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID); break; + case 1: m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID); break; + case 2: m_creature->Say(SAY_WINDSOR_AGGRO3, LANG_UNIVERSAL, PlayerGUID); break; + } } void Reset() {} diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp index ef5cac59b38..32ab314495b 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp @@ -76,12 +76,12 @@ struct TRINITY_DLL_DECL boss_draganthaurissanAI : public ScriptedAI //if (Counter < 3) //{ // HandOfThaurissan_Timer = 1000; - // Counter++; + // ++Counter; //} //else //{ HandOfThaurissan_Timer = 5000; - //Counter=0; + //Counter = 0; //} } else HandOfThaurissan_Timer -= diff; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp index c7739f5594b..b0b335960a6 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp @@ -399,7 +399,7 @@ struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance if (TombTimer <= diff) { TombTimer = TIMER_TOMBOFTHESEVEN; - TombEventCounter++; + ++TombEventCounter; TombOfSevenEvent(); } else TombTimer -= diff; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp index 2fb2047d27a..6e0cfc714e0 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp @@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL boss_terestianAI : public ScriptedAI if (pSummoned->GetEntry() == CREATURE_PORTAL) { PortalGUID[PortalsCount] = pSummoned->GetGUID(); - PortalsCount++; + ++PortalsCount; if (pSummoned->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SPELL_FIENDISH_PORTAL_1) { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter5.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter5.cpp index 7eabd81ca1a..8021ab397c0 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter5.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter5.cpp @@ -625,12 +625,12 @@ struct TRINITY_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); pTemp->setFaction(2084); uiGhoulGUID[uiSummon_counter] = pTemp->GetGUID(); - uiSummon_counter++; + ++uiSummon_counter; } else { uiSummon_counter = 0; - uiStep++; + ++uiStep; } break; @@ -643,12 +643,12 @@ struct TRINITY_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); pTemp->setFaction(2084); uiAbominationGUID[uiSummon_counter] = pTemp->GetGUID(); - uiSummon_counter++; + ++uiSummon_counter; } else { uiSummon_counter = 0; - uiStep++; + ++uiStep; } break; @@ -661,12 +661,12 @@ struct TRINITY_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); pTemp->setFaction(2084); uiWarriorGUID[uiSummon_counter] = pTemp->GetGUID(); - uiSummon_counter++; + ++uiSummon_counter; } else { uiSummon_counter = 0; - uiStep++; + ++uiStep; } break; @@ -679,12 +679,12 @@ struct TRINITY_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); pTemp->setFaction(2084); uiBehemothGUID[uiSummon_counter] = pTemp->GetGUID(); - uiSummon_counter++; + ++uiSummon_counter; } else { uiSummon_counter = 0; - uiStep++; + ++uiStep; } break; @@ -1472,7 +1472,7 @@ struct TRINITY_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI void JumpToNextStep(uint32 uiTimer) { uiPhase_timer = uiTimer; - uiStep++; + ++uiStep; } void NPCChangeTarget(uint64 ui_GUID) diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp index e70d4544c94..5bae4279882 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp @@ -107,7 +107,7 @@ struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI if (FlashCounter < 2) { FlashHeal_Timer = 5000; - FlashCounter++; + ++FlashCounter; } else { @@ -125,7 +125,7 @@ struct TRINITY_DLL_DECL boss_instructormaliciaAI : public ScriptedAI if (HealingTouch_Timer < 2) { HealingTouch_Timer = 5500; - TouchCounter++; + ++TouchCounter; } else { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp index 0a696959f01..14569cddbf7 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp @@ -123,12 +123,12 @@ struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI // if (Illusioncounter < 3) // { // Illusion_Timer = 500; - // Illusioncounter++; + // ++Illusioncounter; // } // else { // //15 seconds until we should cast this again // Illusion_Timer = 15000; - // Illusioncounter=0; + // Illusioncounter = 0; // } // // } else Illusion_Timer -= diff; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp index ab253a9c8cf..3fceca261b7 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp @@ -390,7 +390,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI break; case 8: m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH); - BreathCount++; + ++BreathCount; Timer[EVENT_SUMMON_FOG] = 0; Timer[EVENT_FLIGHT_SEQUENCE] = 1; if (BreathCount < 3) FlightCount = 4; @@ -419,7 +419,7 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI default: break; } - FlightCount++; + ++FlightCount; } void UpdateAI(const uint32 diff) @@ -471,7 +471,8 @@ struct TRINITY_DLL_DECL boss_felmystAI : public ScriptedAI { m_creature->CastSpell(pTarget, SPELL_ENCAPSULATE_CHANNEL, false); Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000; - }break; + } + break; case EVENT_FLIGHT: EnterPhase(PHASE_FLIGHT); break; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp index adb8057936a..375c212d3d7 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp @@ -210,7 +210,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI me->RemoveAllAuras(); me->DeleteThreatList(); me->CombatStop(); - TalkSequence++; + ++TalkSequence; } if (TalkTimer <= diff) { @@ -218,7 +218,7 @@ struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI GoodEnding(); else BadEnding(); - TalkSequence++; + ++TalkSequence; } else TalkTimer -= diff; } else @@ -690,20 +690,20 @@ struct TRINITY_DLL_DECL boss_kalecAI : public ScriptedAI { case 0: DoScriptText(SAY_GOOD_AGGRO, me); - YellSequence++; + ++YellSequence; break; case 1: if (HealthBelowPct(50)) { DoScriptText(SAY_GOOD_NEAR_DEATH, me); - YellSequence++; + ++YellSequence; } break; case 2: if (HealthBelowPct(10)) { DoScriptText(SAY_GOOD_NEAR_DEATH2, me); - YellSequence++; + ++YellSequence; } break; default: @@ -737,7 +737,7 @@ bool GOkalecgos_teleporter(Player* pPlayer, GameObject* pGo) for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) { if(i->getSource() && i->getSource()->GetPositionZ() < DEMON_REALM_Z + 5) - SpectralPlayers++; + ++SpectralPlayers; } if (pPlayer->HasAura(AURA_SPECTRAL_EXHAUSTION) || (MAX_PLAYERS_IN_SPECTRAL_REALM && SpectralPlayers >= MAX_PLAYERS_IN_SPECTRAL_REALM)) pPlayer->GetSession()->SendNotification(GO_FAILED); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp index c852849fa39..52cbad4ea1e 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp @@ -213,7 +213,8 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance HandleGameObject(KalecgosWall[1],false); } m_auiEncounter[0] = data; - }break; + } + break; case DATA_BRUTALLUS_EVENT: m_auiEncounter[1] = data; break; case DATA_FELMYST_EVENT: if (data == DONE) diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp index 203e26c3a77..40014471bc3 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp @@ -310,23 +310,25 @@ bool GOHello_go_altar_of_archaedas(Player* pPlayer, GameObject* pGo) pPlayer->CastSpell (pPlayer, SPELL_BOSS_OBJECT_VISUAL, false); /* - if (altarOfArchaedasCounter < NUMBER_NEEDED_TO_ACTIVATE) { + if (altarOfArchaedasCounter < NUMBER_NEEDED_TO_ACTIVATE) return false; // not enough people yet - } // Check to make sure at least three people are still casting - uint32 count=0; + uint8 count = 0; Unit *pTarget; - for (uint32 x=0; x<=5; x++) { + for (uint8 x = 0; x <= 5; ++x) + { pTarget = Unit::GetUnit(*pPlayer, altarOfArchaedasCount[x]); - if (!pTarget) continue; - if (pTarget->IsNonMeleeSpellCasted(true)) count++; - if (count >= NUMBER_NEEDED_TO_ACTIVATE) break; + if (!pTarget) + continue; + if (pTarget->IsNonMeleeSpellCasted(true)) + ++count; + if (count >= NUMBER_NEEDED_TO_ACTIVATE) + break; } - if (count < NUMBER_NEEDED_TO_ACTIVATE) { + if (count < NUMBER_NEEDED_TO_ACTIVATE) return false; // not enough people - } */ ScriptedInstance* pInstance = pPlayer->GetInstanceData(); @@ -420,7 +422,7 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* pGo) //bool alreadyUsed; - //pGo->AddUse (); + //pGo->AddUse(); //alreadyUsed = false; //for (uint32 loop=0; loop<5; ++loop) @@ -434,30 +436,33 @@ bool GOHello_go_altar_of_the_keepers(Player* pPlayer, GameObject* pGo) //if (altarOfTheKeeperCounter < NUMBER_NEEDED_TO_ACTIVATE) //{ - //error_log ("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); - // return false; // not enough people yet + //error_log("not enough people yet, altarOfTheKeeperCounter = %d", altarOfTheKeeperCounter); + // return false; // not enough people yet //} /* // Check to make sure at least three people are still casting - uint32 count=0; + uint8 count = 0; Unit *pTarget; - for (uint32 x = 0; x < 5; ++x) + for (uint8 x = 0; x < 5; ++x) { pTarget = Unit::GetUnit(*pPlayer, altarOfTheKeeperCount[x]); - //error_log ("number of people currently activating it: %d", x+1); - if (!pTarget) continue; - if (pTarget->IsNonMeleeSpellCasted(true)) count++; - if (count >= NUMBER_NEEDED_TO_ACTIVATE) break; + //error_log("number of people currently activating it: %d", x+1); + if (!pTarget) + continue; + if (pTarget->IsNonMeleeSpellCasted(true)) + ++count; + if (count >= NUMBER_NEEDED_TO_ACTIVATE) + break; } if (count < NUMBER_NEEDED_TO_ACTIVATE) { - // error_log ("still not enough people"); - return true; // not enough people + //error_log("still not enough people"); + return true; // not enough people } */ //error_log ("activating stone keepers"); - pInstance->SetData(NULL,1); // activate the Stone Keepers + pInstance->SetData(NULL,1); // activate the Stone Keepers return true; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp index 4d4f2e58d7a..9baa22e7cc1 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp @@ -185,17 +185,18 @@ struct TRINITY_DLL_DECL boss_halazziAI : public ScriptedAI TotemTimer = 12000; break; case PHASE_MERGE: - if (Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID)) + if (Unit *pLynx = Unit::GetUnit(*m_creature, LynxGUID)) { m_creature->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); DoPlaySoundToSet(m_creature, SOUND_MERGE); - Lynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Lynx->GetMotionMaster()->Clear(); - Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); + pLynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pLynx->GetMotionMaster()->Clear(); + pLynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); - TransformCount++; - }break; + m_creature->GetMotionMaster()->MoveFollow(pLynx, 0, 0); + ++TransformCount; + } + break; default: break; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp index d543c29c386..290eab2e69d 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp @@ -474,7 +474,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI if (m_creature->IsWithinMeleeRange(pTarget)) { m_creature->CastSpell(pTarget, SPELL_CLAW_RAGE_DAMAGE, true); - Claw_Counter++; + ++Claw_Counter; if (Claw_Counter == 12) { Claw_Rage_Timer = 15000 + rand()%5000; @@ -522,7 +522,7 @@ struct TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI if (m_creature->IsWithinMeleeRange(pTarget)) { m_creature->CastSpell(pTarget, SPELL_LYNX_RUSH_DAMAGE, true); - Claw_Counter++; + ++Claw_Counter; if (Claw_Counter == 9) { Lynx_Rush_Timer = 15000 + rand()%5000; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp index fa4e19f7479..0db6b494332 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp @@ -243,7 +243,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance HandleGameObject(ZulJinDoorGUID, data != IN_PROGRESS); break; case DATA_CHESTLOOTED: - ChestLooted++; + ++ChestLooted; SaveToDB(); break; case TYPE_RAND_VENDOR_1: @@ -256,7 +256,7 @@ struct TRINITY_DLL_DECL instance_zulaman : public ScriptedInstance if (data == DONE) { - BossKilled++; + ++BossKilled; if (QuestMinute && BossKilled >= 4) { QuestMinute = 0; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp index 88bbb115954..466c670eaf6 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp @@ -223,7 +223,7 @@ struct TRINITY_DLL_DECL boss_mandokirAI : public ScriptedAI { Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid()); if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) - TargetInRange++; + ++TargetInRange; } if (TargetInRange > 3) diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp index fea7426f3c4..0f3a170b7a6 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp @@ -112,11 +112,11 @@ struct TRINITY_DLL_DECL boss_venoxisAI : public ScriptedAI if (HolyNova_Timer <= diff) { TargetInRange = 0; - for (uint8 i=0; i<10; ++i) + for (uint8 i = 0; i < 10; ++i) { if (Unit *pTarget = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) if (m_creature->IsWithinMeleeRange(pTarget)) - TargetInRange++; + ++TargetInRange; } if (TargetInRange > 1) diff --git a/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp b/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp index 5dce0a0e9d9..d061a5811a8 100644 --- a/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp +++ b/src/bindings/scripts/scripts/kalimdor/bloodmyst_isle.cpp @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI { uint32 spawnCreatureID = 0; - switch(rand()%3) + switch (urand(0,2)) { case 0: spawnCreatureID = 17681; @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL mob_webbed_creatureAI : public ScriptedAI break; case 1: case 2: - spawnCreatureID = possibleSpawns[rand()%31]; + spawnCreatureID = possibleSpawns[urand(0,30)]; break; } diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp index 90e4a93df5b..1ef10fa853d 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -263,7 +263,7 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance if(Creature *summon = m_creature->SummonCreature(entry, pos, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) return summon; - debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); + debug_log("TSCR: Instance Dark Portal: What just happened there? No boss, no loot, no fun..."); return NULL; } @@ -271,36 +271,34 @@ struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance { if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) { - int tmp = rand()%(4-1); + uint8 tmp = urand(0,2); if (tmp >= CurrentRiftId) - tmp++; - debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + ++tmp; - CurrentRiftId = tmp; + debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); - Creature* pTemp = pMedivh->SummonCreature(C_TIME_RIFT, - PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], - TEMPSUMMON_CORPSE_DESPAWN,0); - if (pTemp) - { + CurrentRiftId = tmp; - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Creature *pTemp = pMedivh->SummonCreature(C_TIME_RIFT, + PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], + TEMPSUMMON_CORPSE_DESPAWN,0); + if (pTemp) + { + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (Creature* pBoss = SummonedPortalBoss(pTemp)) - { - if (pBoss->GetEntry() == C_AEONUS) - { - pBoss->AddThreat(pMedivh,0.0f); - } - else - { - pBoss->AddThreat(pTemp,0.0f); - pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false); - } - } + if (Creature *pBoss = SummonedPortalBoss(pTemp)) + { + if (pBoss->GetEntry() == C_AEONUS) + pBoss->AddThreat(pMedivh,0.0f); + else + { + pBoss->AddThreat(pTemp,0.0f); + pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false); } + } + } } } diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp index 34c014d4590..551682f5e5c 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp @@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI void KilledUnit(Unit *victim) { - switch(rand()%3) + switch (urand(0,2)) { case 0: DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp index fe1a2a443e8..69203245a18 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp @@ -380,7 +380,7 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI uint32 chargeSpell = 0; uint32 unleashSpell = 0; - switch(rand()%3) + switch (urand(0,2)) { case 0: chargeSpell = SPELL_SOUL_CHARGE_RED; diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp index 1e32b54e372..7488be3a5d5 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI void KilledUnit(Unit *victim) { - switch(rand()%3) + switch (urand(0,2)) { case 0: DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp index acfcb210b60..f16cc39ef08 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp @@ -68,7 +68,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI void KilledUnit(Unit *victim) { - switch(rand()%3) + switch (urand(0,2)) { case 0: DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI if (MarkTimerBase < 5500) MarkTimerBase = 5500; MarkTimer = MarkTimerBase; - switch(rand()%3) + switch (urand(0,2)) { case 0: DoPlaySoundToSet(m_creature, SOUND_MARK1); diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp index 402c3c8e0a9..0a0d134e08c 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp @@ -462,18 +462,19 @@ void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) } break; case 17907: //FROST_WYRM , - if (FirstBossDead && WaveCount == 1) - {//summon at gate + if (FirstBossDead && WaveCount == 1) //summon at gate pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - }else{ + else + { pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); if (pCreature) CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; } break; case 17908: //GIANT_INFERNAL - InfernalCount++; - if (InfernalCount > 7)InfernalCount = 0; + ++InfernalCount; + if (InfernalCount > 7) + InfernalCount = 0; pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); break; default: diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp index bf36d0dd27f..3db6c5a51d6 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp @@ -748,7 +748,7 @@ struct mob_necromancerAI : public hyjal_trashAI void KilledUnit(Unit* victim) { - switch (rand()%3) + switch (urand(0,2)) { case 0: DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); @@ -759,10 +759,7 @@ struct mob_necromancerAI : public hyjal_trashAI DoSpawnCreature(17903,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); break; case 2: - if (rand()%2) - DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - else - DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + DoSpawnCreature(RAND(17902,17903),3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); break; } } diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp index 9b100cd35ad..e7877eada9b 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -134,7 +134,7 @@ struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI if (CanPatrol && wpId == 0) { m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z); - wpId++; + ++wpId; } //Return since we have no target diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp index 50b2be37648..54d7fce4c12 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -146,7 +146,7 @@ struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance { if (mThrallEventCount <= 20) { - mThrallEventCount++; + ++mThrallEventCount; m_auiEncounter[1] = NOT_STARTED; debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); m_auiEncounter[2] = NOT_STARTED; diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp index 8d56159eb79..a34a83d7ba8 100644 --- a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -270,7 +270,7 @@ struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI)); Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM)); - switch(rand()%3) + switch (urand(0,2)) { case 0: if (pKri) diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp index c8c661756a5..76d0a1f5aaf 100644 --- a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp @@ -325,7 +325,7 @@ struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI m_creature->CastSpell(m_creature, SPELL_DARK_GLARE, false); //Increase tick - DarkGlareTick++; + ++DarkGlareTick; //1 second per tick DarkGlareTickTimer = 1000; @@ -628,7 +628,7 @@ struct TRINITY_DLL_DECL cthunAI : public ScriptedAI Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Spawned) - FleshTentaclesKilled++; + ++FleshTentaclesKilled; else CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); @@ -636,7 +636,7 @@ struct TRINITY_DLL_DECL cthunAI : public ScriptedAI Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); if (!Spawned) - FleshTentaclesKilled++; + ++FleshTentaclesKilled; else CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); @@ -821,7 +821,8 @@ struct TRINITY_DLL_DECL cthunAI : public ScriptedAI EyeTentacleTimer = 30000; } else EyeTentacleTimer -= diff; - }break; + } + break; //Weakened state case 4: @@ -905,7 +906,7 @@ struct TRINITY_DLL_DECL cthunAI : public ScriptedAI void FleshTentcleKilled() { - FleshTentaclesKilled++; + ++FleshTentaclesKilled; } }; diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp index d02a03b772e..619961c32d9 100644 --- a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp @@ -100,7 +100,7 @@ struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI //Summon 1-3 Spawns of Fankriss at random time. if (SpawnSpawns_Timer <= diff) { - switch(rand()%3) + switch (urand(0,2)) { case 0: SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp index c330d473f41..3affe840b41 100644 --- a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp @@ -144,7 +144,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI if (Blink_Timer <= diff) { //DoCast(m_creature, SPELL_BLINK); - switch(rand()%3) + switch (urand(0,2)) { case 0: m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f); @@ -206,7 +206,7 @@ struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; - switch(rand()%3) + switch (urand(0,2)) { case 0: bossc=place1; diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp index e907e3f1a04..09f52374ddb 100644 --- a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -132,7 +132,7 @@ struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance break; case DATA_BUG_TRIO_DEATH: - BugTrioDeathCount++; + ++BugTrioDeathCount; break; case DATA_VEKLOR_DEATH: diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp index b47e040e074..e445ee26e64 100644 --- a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp @@ -165,7 +165,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI case TYPE_NARALEX_PART1: if (eventProgress == 1) { - eventProgress++; + ++eventProgress; DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature); m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); @@ -174,7 +174,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI case TYPE_NARALEX_PART2: if (eventProgress == 1) { - eventProgress++; + ++eventProgress; DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature); DoCast(m_creature, SPELL_SERPENTINE_CLEANSING); //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); @@ -196,7 +196,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI case TYPE_NARALEX_PART3: if (eventProgress == 1) { - eventProgress++; + ++eventProgress; eventTimer = 4000; m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); DoScriptText(SAY_EMERALD_DREAM, m_creature); @@ -204,7 +204,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 2) { - eventProgress++; + ++eventProgress; eventTimer = 15000; //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) @@ -214,7 +214,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 3) { - eventProgress++; + ++eventProgress; eventTimer = 15000; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) DoScriptText(EMOTE_TROUBLED_SLEEP, naralex); @@ -225,7 +225,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 4) { - eventProgress++; + ++eventProgress; eventTimer = 30000; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex); @@ -240,7 +240,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 5) { - eventProgress++; + ++eventProgress; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) DoScriptText(EMOTE_HORRENDOUS_VISION, naralex); m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); @@ -250,7 +250,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 6 && pInstance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE) { - eventProgress++; + ++eventProgress; eventTimer = 3000; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) { @@ -275,7 +275,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 7) { - eventProgress++; + ++eventProgress; eventTimer = 6000; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) DoScriptText(SAY_THANK_YOU, naralex); @@ -283,7 +283,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 8) { - eventProgress++; + ++eventProgress; eventTimer = 8000; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) { @@ -297,7 +297,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 9) { - eventProgress++; + ++eventProgress; eventTimer = 1500; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ()); @@ -305,7 +305,7 @@ struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI else if (eventProgress == 10) { - eventProgress++; + ++eventProgress; eventTimer = 2500; if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) { diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp index 42fb7f9c055..39e90331092 100644 --- a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp @@ -337,7 +337,7 @@ struct TRINITY_DLL_DECL npc_brann_hosAI : public npc_escortAI void JumpToNextStep(uint32 uiTimer) { uiPhaseTimer = uiTimer; - uiStep++; + ++uiStep; } void StartWP() diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp index 0062673b212..1627e664d09 100644 --- a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp @@ -375,7 +375,7 @@ struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase(); m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30); - Resurect_Phase++; + ++Resurect_Phase; } } diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp index 6d4d42ff3e4..d87d4f1e16e 100644 --- a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -194,40 +194,40 @@ struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI void NextPhase() { - if(currentPhase==PHASE_NONE) + if(currentPhase == PHASE_NONE) { pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, IN_PROGRESS); m_creature->SummonCreature(MOB_STASIS_CONTROLLER,moveLocs[5].x,moveLocs[5].y,moveLocs[5].z,0,TEMPSUMMON_CORPSE_DESPAWN); } Phase move = PHASE_NONE; - if(AddCount>=(HeroicMode?4:2)) - { - move=PHASE_GORTOK_PALEHOOF; - } + if (AddCount >= HEROIC(2,4)) + move = PHASE_GORTOK_PALEHOOF; else { //select random not yet defeated add - uint8 next = rand()%4; - for(int i=0;i<16;i++) + uint8 next = urand(0,3); + for(uint8 i=0; i < 16; i++) { - if(!DoneAdds[i%4]&&next==0){ - move=(Phase)(i%4); + if(!DoneAdds[i%4] && next == 0) + { + move = (Phase)(i%4); break; - } else if(!DoneAdds[i%4]&&next>0) - next--; + } else if (!DoneAdds[i%4] && next > 0) + --next; } - AddCount++; - DoneAdds[move]=true; - move=(Phase)(move%4); + ++AddCount; + DoneAdds[move] = true; + move = (Phase)(move%4); } //send orb to summon spot Creature *pOrb = Unit::GetCreature((*m_creature), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0); - if (pOrb && pOrb->isAlive()){ - if(currentPhase==PHASE_NONE) + if (pOrb && pOrb->isAlive()) + { + if(currentPhase == PHASE_NONE) pOrb->CastSpell(m_creature,SPELL_ORB_VISUAL,true); pOrb->GetMotionMaster()->MovePoint(move,moveLocs[move].x,moveLocs[move].y,moveLocs[move].z); } - currentPhase=move; + currentPhase = move; } void JustReachedHome() diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp index 13f80dd3db5..22c7cc3f83c 100644 --- a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp @@ -220,7 +220,7 @@ struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI for (uint8 i = 0; i < uiMaxSpawn; ++i) { Creature* pTemp; - switch (rand()%3) + switch (urand(0,2)) { case 0: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_WARRIOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 1: pTemp = m_creature->SummonCreature(CREATURE_YMIRJAR_WITCH_DOCTOR, SpawnLoc[spot].x+rand()%5, SpawnLoc[spot].y+rand()%5, SpawnLoc[spot].z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp index 5dc0ddeb7a8..d7a3c8981e7 100644 --- a/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp @@ -640,7 +640,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI default: break; } - FlightCount++; + ++FlightCount; } void HandleTransformSequence() @@ -688,7 +688,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI } if (Phase == PHASE_TRANSFORM_SEQUENCE) Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; - TransformCount++; + ++TransformCount; } void UpdateAI(const uint32 diff) @@ -785,7 +785,8 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) m_creature->CastSpell(pTarget, SPELL_PARASITIC_SHADOWFIEND, true); Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; - }break; + } + break; case EVENT_PARASITE_CHECK: Timer[EVENT_PARASITE_CHECK] = 0; @@ -1156,7 +1157,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); EnterEvadeMode(); m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - WalkCount++; + ++WalkCount; } JustCreated = false; BeginWalk(); @@ -1222,7 +1223,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI EnterPhase(PHASE_WALK); break; } - TalkCount++; + ++TalkCount; } void HandleChannelSequence() @@ -1280,7 +1281,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI default: break; } - ChannelCount++; + ++ChannelCount; } void HandleWalkSequence() @@ -1306,7 +1307,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI if (Phase == PHASE_WALK) { Timer = 0; - WalkCount++; + ++WalkCount; m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); } } @@ -1359,7 +1360,8 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); Timer = 30000; } - }break; + } + break; case PHASE_FIGHT_MINIONS: { float x, y, z; @@ -1551,7 +1553,8 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI Timer[EVENT_MAIEV_STEALTH] = 0; BlinkToPlayer(); EnterPhase(Phase); - }break; + } + break; case EVENT_MAIEV_TAUNT: { uint32 random = rand()%4; @@ -1560,7 +1563,8 @@ struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI m_creature->MonsterYell(text, LANG_UNIVERSAL, 0); DoPlaySoundToSet(m_creature, sound); Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - }break; + } + break; case EVENT_MAIEV_SHADOW_STRIKE: DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE); Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; @@ -1880,13 +1884,15 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon) pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); if (pTarget) summon->AI()->AttackStart(pTarget); - }break; + } + break; case SHADOW_DEMON: if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. { summon->AddThreat(pTarget, 5000000.0f); summon->AI()->AttackStart(pTarget); - }break; + } + break; case MAIEV_SHADOWSONG: { summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk @@ -1894,11 +1900,13 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon) MaievGUID = summon->GetGUID(); CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID()); summon->AI()->DoAction(PHASE_TALK_SEQUENCE); - }break; + } + break; case FLAME_OF_AZZINOTH: { summon->AI()->AttackStart(summon->SelectNearestTarget(999)); - }break; + } + break; default: break; } @@ -1938,7 +1946,8 @@ void boss_illidan_stormrageAI::HandleTalkSequence() m_creature->SetInFront(Maiev); // Face her, so it's not rude =P Maiev->GetMotionMaster()->MoveIdle(); m_creature->GetMotionMaster()->MoveIdle(); - }break; + } + break; case 14: if (GETCRE(Maiev, MaievGUID)) { @@ -1947,7 +1956,8 @@ void boss_illidan_stormrageAI::HandleTalkSequence() Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us. EnterPhase(PHASE_NORMAL_MAIEV); - }break; + } + break; case 15: DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him Summons.DespawnAll(); @@ -1984,7 +1994,7 @@ void boss_illidan_stormrageAI::HandleTalkSequence() } if (Phase == PHASE_TALK_SEQUENCE) Talk(TalkCount); // This function does most of the talking - TalkCount++; + ++TalkCount; } void boss_illidan_stormrageAI::CastEyeBlast() diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp index d93952502e4..12dc7549ae1 100644 --- a/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp @@ -199,7 +199,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI DoCast(pTarget, SPELL_BEAM_SINFUL); break; } - BeamCount++; + ++BeamCount; uint32 Beam = CurrentBeam; if (BeamCount > 3) while(CurrentBeam == Beam) @@ -245,7 +245,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI } } - ExplosionCount++; + ++ExplosionCount; FatalAttractionExplodeTimer = 1000; } else diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp index 86159b8e049..b575e77c64e 100644 --- a/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp @@ -311,22 +311,23 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI if (SoulCount < NUMBER_ENSLAVED_SOUL) { if (SummonSoul()) - SoulCount++; + ++SoulCount; Timer = 500; return; - }break; + } + break; case 7: if (SoulDeathCount >= SoulCount) { Counter = 1; - Phase++; + ++Phase; Timer = 5000; } return; default: break; } - Counter++; + ++Counter; } else Timer -= diff; } }; @@ -627,11 +628,9 @@ struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI void npc_enslaved_soulAI::JustDied(Unit *killer) { if (ReliquaryGUID) - { - Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)); - if (Reliquary) - CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount++; - } + if (Creature *Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID))) + ++(CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount); + DoCast(m_creature, SPELL_SOUL_RELEASE, true); } diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp index a292a726207..b11bbd11fca 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -228,7 +228,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI { uint32 mark_spell; - switch(MarkOfCorruption_Count) + switch (MarkOfCorruption_Count) { case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; @@ -241,7 +241,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI DoCast(m_creature->getVictim(), mark_spell); if (MarkOfCorruption_Count < 5) - MarkOfCorruption_Count++; + ++MarkOfCorruption_Count; } MarkOfCorruption_Timer = 15000; @@ -308,7 +308,7 @@ struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI DoCast(m_creature->getVictim(), mark_spell); if (MarkOfHydross_Count < 5) - MarkOfHydross_Count++; + ++MarkOfHydross_Count; } MarkOfHydross_Timer = 15000; diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp index a10cd498e6e..ef5ef21603a 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -486,7 +486,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI if (EnchantedElemental_Pos == 7) EnchantedElemental_Pos = 0; else - EnchantedElemental_Pos++; + ++EnchantedElemental_Pos; EnchantedElemental_Timer = 10000+rand()%5000; } else EnchantedElemental_Timer -= diff; diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp index 83912b588fd..270b6c3383c 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -173,7 +173,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI float x,y,z; uint64 InnderDemon[5]; - uint32 InnderDemon_Count; + uint32 InnerDemon_Count; uint64 Demon; uint64 SpellBinderGUID[3]; @@ -193,7 +193,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI IsFinalForm = false; NeedThreatReset = false; EnrageUsed = false; - InnderDemon_Count = 0; + InnerDemon_Count = 0; m_creature->SetSpeed(MOVE_RUN, 2.0f, true); m_creature->SetDisplayId(MODEL_NIGHTELF); m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); @@ -259,7 +259,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI { Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); if (add && add->isAlive()) - AliveChannelers++; + ++AliveChannelers; } // channelers == 0 remove banish aura @@ -319,7 +319,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI } } - InnderDemon_Count = 0; + InnerDemon_Count = 0; } void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core @@ -505,13 +505,14 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI eff_mask|=1<<i; } (*itr)->AddAura(new Aura(spell, eff_mask, *itr, *itr, *itr)); - if (InnderDemon_Count > 4) InnderDemon_Count = 0; + if (InnerDemon_Count > 4) + InnerDemon_Count = 0; //Safe storing of creatures - InnderDemon[InnderDemon_Count] = demon->GetGUID(); + InnderDemon[InnerDemon_Count] = demon->GetGUID(); //Update demon count - InnderDemon_Count++; + ++InnerDemon_Count; } } } diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp index 670d003a7ef..c64fed7d11c 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -227,14 +227,20 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI for (uint8 i = 0; i < 4; ++i) { counter = 0; - do{pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only - if (counter < Playercount) - break; - if (pTarget) itr = list.find(pTarget->GetGUID()); - counter++; - }while(itr != list.end()); - if (pTarget){list.insert(pTarget->GetGUID()); - ApplyWateryGrave(pTarget, i); + do + { + pTarget = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + if (counter < Playercount) + break; + if (pTarget) + itr = list.find(pTarget->GetGUID()); + ++counter; + } while(itr != list.end()); + + if (pTarget) + { + list.insert(pTarget->GetGUID()); + ApplyWateryGrave(pTarget, i); } } diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp index b80d0f7f38e..b71aa887a63 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp @@ -238,7 +238,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance /*case TRASHMOB_COILFANG_PRIESTESS: case TRASHMOB_COILFANG_SHATTERER: if(pCreature->isAlive()) - TrashCount++; + ++TrashCount; break;*/ } } @@ -290,7 +290,7 @@ struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance case DATA_TRASH : { if(data == 1 && TrashCount < MIN_KILLS) - TrashCount++;//+1 died + ++TrashCount;//+1 died SaveToDB(); break; } diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp index c8b6647156a..49e5d3db33c 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -264,7 +264,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI { DebuffClicker(clicker); (*i).second = 0; - } else ClickerNum++; + } else ++ClickerNum; } // if 5 clickers from other cubes apply shadow cage diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp index 1cd7ab16a03..21e132961b5 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -147,7 +147,8 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance } CageTimer = 0; HandleGameObject(DoorGUID, true); - }break; + } + break; case IN_PROGRESS: // Event start. if (m_auiEncounter[1] != IN_PROGRESS) { @@ -167,7 +168,8 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance CageTimer = 120000; } HandleGameObject(DoorGUID, false); - }break; + } + break; case DONE: // Add buff and check if all channelers are dead. for (std::set<uint64>::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) { @@ -178,7 +180,8 @@ struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance data = IN_PROGRESS; break; } - }break; + } + break; } m_auiEncounter[1] = data; break; diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp index 6a2b20aa160..c16c2ef8772 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -247,15 +247,16 @@ struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI for (uint8 i = 0; i < summoned; ++i) { - switch(rand()%3) + switch (urand(0,2)) { case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; } } - if (rand()%100 < 20) summoned++; - Summon_Assistant_Timer = 25000 + (rand()%10000) ; + if (urand(0,9) < 2) + ++summoned; + Summon_Assistant_Timer = urand(25000,35000); } else Summon_Assistant_Timer -= diff; DoMeleeAttackIfReady(); diff --git a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp index e6ad3f0100c..70626f1401b 100644 --- a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp @@ -759,7 +759,8 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI return 5000; }else{ CAST_PLR(plr)->FailQuest(QUEST_LORD_ILLIDAN_STORMRAGE); Step = 30; return 100; - }break; + } + break; case 17: DoScriptText(LORD_ILLIDAN_SAY_5, Illi); return 5000; break; case 18: DoScriptText(LORD_ILLIDAN_SAY_6, Illi); return 5000; break; case 19: DoScriptText(LORD_ILLIDAN_SAY_7, Illi); return 5000; break; @@ -784,7 +785,8 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, PlayerGUID); - return 500; }break; + return 500; } + break; case 28: plr->RemoveAurasDueToSpell(SPELL_TWO); plr->RemoveAurasDueToSpell(41519); @@ -796,19 +798,22 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) DoScriptText(YARZILL_THE_MERC_SAY, Yarzill, plr); - return 5000; }break; + return 5000; } + break; case 30: { Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) Yarzill->SetUInt64Value(UNIT_FIELD_TARGET, 0); - return 5000; }break; + return 5000; } + break; case 31: { Unit* Yarzill = me->FindNearestCreature(C_YARZILL, 50); if (Yarzill) Yarzill->CastSpell(plr, 41540, true); - return 1000;}break; + return 1000;} +break; case 32: m_creature->GetMotionMaster()->MovePoint(0, -5085.77, 577.231, 86.6719); return 5000; break; case 33: Reset(); return 100; break; diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp index 1f27a7089a0..1d083692ccb 100644 --- a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp @@ -324,13 +324,13 @@ struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI } else { - if (rand()%5) // next platform + if (urand(0,4)) // next platform { DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); if (cur_wp == 3) cur_wp = 0; else - cur_wp++; + ++cur_wp; WaitEvent = WE_PLATFORM; } else // flame quill diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp index 07bc7c8740a..e6329c0fd68 100644 --- a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp @@ -624,7 +624,8 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI } break; } - }break; + } + break; case 2: { @@ -661,24 +662,25 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI PhaseSubphase = 0; } else Phase_Timer -= diff; } - }break; + } + break; case 3: { if (PhaseSubphase == 0) { //Respawn advisors - Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); + Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - Creature* Advisor; - for (uint32 i = 0; i < MAX_ADVISORS; ++i) + Creature *Advisor; + for (uint8 i = 0; i < MAX_ADVISORS; ++i) { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])); + Advisor = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i]); if (!Advisor) error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); else - CAST_AI(advisorbase_ai, Advisor->AI())->Revive(Target); + CAST_AI(advisorbase_ai, Advisor->AI())->Revive(pTarget); } PhaseSubphase = 1; diff --git a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp index 4c0f51bf39f..5bee73612ff 100644 --- a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp @@ -425,7 +425,8 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10); if (Cage) Cage->SetGoState(GO_STATE_ACTIVE); - }break; + } + break; case 2: DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); break; case 5: DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer); break; case 6: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); break; diff --git a/src/bindings/scripts/scripts/world/npcs_special.cpp b/src/bindings/scripts/scripts/world/npcs_special.cpp index 80821a776fe..81dfe5db684 100644 --- a/src/bindings/scripts/scripts/world/npcs_special.cpp +++ b/src/bindings/scripts/scripts/world/npcs_special.cpp @@ -770,7 +770,7 @@ void npc_doctorAI::UpdateAI(const uint32 diff) Coordinates.erase(itr); } SummonPatient_Timer = 10000; - SummonPatientCount++; + ++SummonPatientCount; } else SummonPatient_Timer -= diff; } } @@ -1442,11 +1442,11 @@ bool ReceiveEmote_npc_winter_reveler(Player* pPlayer, Creature* pCreature, uint3 { pCreature->CastSpell(pCreature, 26218, false); pPlayer->CastSpell(pPlayer, 26218, false); - switch(rand()%3) + switch (urand(0,2)) { - case 0: pCreature->CastSpell(pPlayer, 26207, false); break; - case 1: pCreature->CastSpell(pPlayer, 26206, false); break; - case 2: pCreature->CastSpell(pPlayer, 45036, false); break; + case 0: pCreature->CastSpell(pPlayer, 26207, false); break; + case 1: pCreature->CastSpell(pPlayer, 26206, false); break; + case 2: pCreature->CastSpell(pPlayer, 45036, false); break; } } return true; |