From 8379f0f470a4e80ffcfd6c60075c58dde6c7f44a Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Sat, 6 Sep 2014 22:45:36 -0300 Subject: Scripts/Scholomance: Kormok - Updated to EventMaps - Replaced some hacks to summon adds with proper spells, but there might be still missing stuff --- .../EasternKingdoms/Scholomance/boss_kormok.cpp | 202 +++++++++++++++------ .../EasternKingdoms/Scholomance/scholomance.h | 3 +- 2 files changed, 146 insertions(+), 59 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 3864c598459..65125102e68 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,20 +15,31 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Kormok -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "scholomance.h" enum Spells { - SPELL_SHADOWBOLTVOLLEY = 20741, - SPELL_BONESHIELD = 27688 + SPELL_SHADOWBOLT_VOLLEY = 20741, + SPELL_BONE_SHIELD = 27688, + + SPELL_SUMMON_BONE_MAGES = 27695, + + SPELL_SUMMON_BONE_MAGE_FRONT_LEFT = 27696, + SPELL_SUMMON_BONE_MAGE_FRONT_RIGHT = 27697, + SPELL_SUMMON_BONE_MAGE_BACK_RIGHT = 27698, + SPELL_SUMMON_BONE_MAGE_BACK_LEFT = 27699, + + SPELL_SUMMON_BONE_MINIONS = 27687 +}; + +enum Events +{ + EVENT_SHADOWBOLT_VOLLEY = 1, + EVENT_BONE_SHIELD, + EVENT_SUMMON_MINIONS }; class boss_kormok : public CreatureScript @@ -37,11 +47,6 @@ class boss_kormok : public CreatureScript public: boss_kormok() : CreatureScript("boss_kormok") { } - CreatureAI* GetAI(Creature* creature) const override - { - return new boss_kormokAI(creature); - } - struct boss_kormokAI : public ScriptedAI { boss_kormokAI(Creature* creature) : ScriptedAI(creature) @@ -51,38 +56,34 @@ public: void Initialize() { - ShadowVolley_Timer = 10000; - BoneShield_Timer = 2000; - Minion_Timer = 15000; - Mage_Timer = 0; Mages = false; } - uint32 ShadowVolley_Timer; - uint32 BoneShield_Timer; - uint32 Minion_Timer; - uint32 Mage_Timer; - bool Mages; - void Reset() override { Initialize(); + events.Reset(); } void EnterCombat(Unit* /*who*/) override { + events.ScheduleEvent(EVENT_SHADOWBOLT_VOLLEY, 10000); + events.ScheduleEvent(EVENT_BONE_SHIELD, 2000); + events.ScheduleEvent(EVENT_SUMMON_MINIONS, 15000); } - void SummonMinions(Unit* victim) + void JustSummoned(Creature* summoned) override { - if (Creature* SummonedMinion = DoSpawnCreature(16119, float(irand(-7, 7)), float(irand(-7, 7)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) - SummonedMinion->AI()->AttackStart(victim); + summoned->AI()->AttackStart(me->GetVictim()); } - void SummonMages(Unit* victim) + void DamageTaken(Unit* /*attacker*/, uint32& damage) override { - if (Creature* SummonedMage = DoSpawnCreature(16120, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000)) - SummonedMage->AI()->AttackStart(victim); + if (me->HealthBelowPctDamaged(25, damage) && !Mages) + { + DoCast(SPELL_SUMMON_BONE_MAGES); + Mages = true; + } } void UpdateAI(uint32 diff) override @@ -90,48 +91,133 @@ public: if (!UpdateVictim()) return; - //ShadowVolley_Timer - if (ShadowVolley_Timer <= diff) - { - DoCastVictim(SPELL_SHADOWBOLTVOLLEY); - ShadowVolley_Timer = 15000; - } else ShadowVolley_Timer -= diff; + events.Update(diff); + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - //BoneShield_Timer - if (BoneShield_Timer <= diff) + while (uint32 eventId = events.ExecuteEvent()) { - DoCastVictim(SPELL_BONESHIELD); - BoneShield_Timer = 45000; - } else BoneShield_Timer -= diff; + switch (eventId) + { + case EVENT_SHADOWBOLT_VOLLEY: + DoCastVictim(SPELL_SHADOWBOLT_VOLLEY); + events.ScheduleEvent(EVENT_SHADOWBOLT_VOLLEY, 15000); + break; + case EVENT_BONE_SHIELD: + DoCastVictim(SPELL_BONE_SHIELD); + events.ScheduleEvent(EVENT_BONE_SHIELD, 45000); + break; + case EVENT_SUMMON_MINIONS: + DoCast(SPELL_SUMMON_BONE_MINIONS); + events.ScheduleEvent(EVENT_SUMMON_MINIONS, 12000); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + + private: + EventMap events; + bool Mages; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new boss_kormokAI(creature); + } +}; - //Minion_Timer - if (Minion_Timer <= diff) +uint32 const SummonMageSpells[4] = +{ + SPELL_SUMMON_BONE_MAGE_FRONT_LEFT, + SPELL_SUMMON_BONE_MAGE_FRONT_RIGHT, + SPELL_SUMMON_BONE_MAGE_BACK_RIGHT, + SPELL_SUMMON_BONE_MAGE_BACK_LEFT, +}; + +// 27695 - Summon Bone Mages +class spell_kormok_summon_bone_mages : SpellScriptLoader +{ + public: + spell_kormok_summon_bone_mages() : SpellScriptLoader("spell_kormok_summon_bone_mages") { } + + class spell_kormok_summon_bone_magesSpellScript : public SpellScript + { + PrepareSpellScript(spell_kormok_summon_bone_magesSpellScript); + + bool Validate(SpellInfo const* /*spell*/) override { - //Cast - SummonMinions(me->GetVictim()); - SummonMinions(me->GetVictim()); - SummonMinions(me->GetVictim()); - SummonMinions(me->GetVictim()); + for (int i = 0; i < 4; ++i) + if (!sSpellMgr->GetSpellInfo(SummonMageSpells[i])) + return false; + + return true; + } - Minion_Timer = 12000; - } else Minion_Timer -= diff; + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + for (int i = 0; i < 2; ++i) + GetCaster()->CastSpell(GetCaster(), SummonMageSpells[urand(0, 4)], true); + } - //Summon 2 Bone Mages - if (!Mages && HealthBelowPct(26)) + void Register() { - //Cast - SummonMages(me->GetVictim()); - SummonMages(me->GetVictim()); - Mages = true; + OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_magesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } + }; - DoMeleeAttackIfReady(); + SpellScript* GetSpellScript() const override + { + return new spell_kormok_summon_bone_magesSpellScript(); + } +}; + +// 27687 - Summon Bone Minions +class spell_kormok_summon_bone_minions : SpellScriptLoader +{ + public: + spell_kormok_summon_bone_minions() : SpellScriptLoader("spell_kormok_summon_bone_minions") { } + + class spell_kormok_summon_bone_minionsSpellScript : public SpellScript + { + PrepareSpellScript(spell_kormok_summon_bone_minionsSpellScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_BONE_MINIONS)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + // Possible spells to handle this not found. + for (int i = 0; i < 4; ++i) + GetCaster()->SummonCreature(NPC_BONE_MINION, GetCaster()->GetPositionX() + float(irand(-7, 7)), GetCaster()->GetPositionY() + float(irand(-7, 7)), GetCaster()->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_minionsSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } }; + SpellScript* GetSpellScript() const override + { + return new spell_kormok_summon_bone_minionsSpellScript(); + } }; void AddSC_boss_kormok() { new boss_kormok(); + new spell_kormok_summon_bone_mages(); + new spell_kormok_summon_bone_minions(); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h index 4b587bb6dde..30d0e978145 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h +++ b/src/server/scripts/EasternKingdoms/Scholomance/scholomance.h @@ -36,7 +36,8 @@ enum DataTypes enum CreatureIds { - NPC_DARKMASTER_GANDLING = 1853 + NPC_DARKMASTER_GANDLING = 1853, + NPC_BONE_MINION = 16119 }; enum GameobjectIds -- cgit v1.2.3 From c585ce5b3c68c1f8ad6b52cf87781bb474fdc89e Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Sat, 6 Sep 2014 22:51:59 -0300 Subject: Core/Misc: Clear some outdated SD2 notes from recently modified scripts --- src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp | 4 ++-- .../scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp | 8 -------- src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp | 8 -------- .../scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp | 8 -------- 4 files changed, 2 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 65125102e68..82a8e4e656d 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -165,7 +165,7 @@ class spell_kormok_summon_bone_mages : SpellScriptLoader GetCaster()->CastSpell(GetCaster(), SummonMageSpells[urand(0, 4)], true); } - void Register() + void Register() override { OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_magesSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } @@ -203,7 +203,7 @@ class spell_kormok_summon_bone_minions : SpellScriptLoader GetCaster()->SummonCreature(NPC_BONE_MINION, GetCaster()->GetPositionX() + float(irand(-7, 7)), GetCaster()->GetPositionY() + float(irand(-7, 7)), GetCaster()->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); } - void Register() + void Register() override { OnEffectHitTarget += SpellEffectFn(spell_kormok_summon_bone_minionsSpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); } diff --git a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp index 1b903fad188..d9a66f7b420 100644 --- a/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp +++ b/src/server/scripts/Outland/Auchindoun/ManaTombs/boss_pandemonius.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,13 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "mana_tombs.h" diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 6425675219f..b96228c1fb6 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,13 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Warlord_Najentus -SD%Complete: 95 -SDComment: -SDCategory: Black Temple -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "black_temple.h" diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 880efd0cfaf..bd16fe9edd2 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,13 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Broggok -SD%Complete: 70 -SDComment: pre-event not made -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellScript.h" -- cgit v1.2.3 From c7e1eae2ce5dfe99f76087b5607cc50cb84787ee Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Sun, 7 Sep 2014 04:06:50 +0200 Subject: Core: Remove again whitespace (meh :/) --- src/server/game/Entities/Player/Player.cpp | 6 +++--- src/server/game/Spells/Spell.cpp | 2 +- src/server/scripts/Commands/cs_ticket.cpp | 2 +- .../scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp | 2 +- .../EasternKingdoms/Scholomance/boss_jandice_barov.cpp | 2 +- .../scripts/EasternKingdoms/Scholomance/boss_kormok.cpp | 11 +++++------ .../EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp | 6 +++--- .../scripts/EasternKingdoms/Scholomance/boss_vectus.cpp | 2 +- .../scripts/Outland/BlackTemple/boss_mother_shahraz.cpp | 4 ++-- .../scripts/Outland/BlackTemple/boss_warlord_najentus.cpp | 2 +- src/server/scripts/World/boss_emerald_dragons.cpp | 2 +- 11 files changed, 20 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 0edc84a9796..0e1e53cfe4c 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -5888,7 +5888,7 @@ void Player::ApplyRatingMod(CombatRating combatRating, int32 value, bool apply) { float oldRating = m_baseRatingValue[combatRating]; m_baseRatingValue[combatRating] += (apply ? value : -value); - + // explicit affected values float const multiplier = GetRatingMultiplier(combatRating); float const oldVal = oldRating * multiplier; @@ -26493,13 +26493,13 @@ void Player::SendItemRetrievalMail(uint32 itemEntry, uint32 count) MailSender sender(MAIL_CREATURE, 34337 /* The Postmaster */); MailDraft draft("Recovered Item", "We recovered a lost item in the twisting nether and noted that it was yours.$B$BPlease find said object enclosed."); // This is the text used in Cataclysm, it probably wasn't changed. SQLTransaction trans = CharacterDatabase.BeginTransaction(); - + if (Item* item = Item::CreateItem(itemEntry, count, 0)) { item->SaveToDB(trans); draft.AddItem(item); } - + draft.SendMailTo(trans, MailReceiver(this, GetGUIDLow()), sender); CharacterDatabase.CommitTransaction(trans); } diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index de6effb8b14..bb68010ca12 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6449,7 +6449,7 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff, Position const* lo // check for ignore LOS on the effect itself if (m_spellInfo->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS || DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_spellInfo->Id, NULL, SPELL_DISABLE_LOS)) return true; - + // if spell is triggered, need to check for LOS disable on the aura triggering it and inherit that behaviour if (IsTriggered() && m_triggeredByAuraSpell && (m_triggeredByAuraSpell->AttributesEx2 & SPELL_ATTR2_CAN_TARGET_NOT_IN_LOS || DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, m_triggeredByAuraSpell->Id, NULL, SPELL_DISABLE_LOS))) return true; diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp index 364b698743a..cbf0ae51a82 100644 --- a/src/server/scripts/Commands/cs_ticket.cpp +++ b/src/server/scripts/Commands/cs_ticket.cpp @@ -239,7 +239,7 @@ public: ticket->SetCompleted(); ticket->SaveToDB(trans); - std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, + std::string msg = ticket->FormatMessageString(*handler, NULL, NULL, NULL, NULL, handler->GetSession() ? handler->GetSession()->GetPlayer()->GetName().c_str() : "Console"); handler->SendGlobalGMSysMessage(msg.c_str()); sTicketMgr->UpdateLastChange(); diff --git a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp index 7355674963a..58ebef77425 100644 --- a/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletEnclave/chapter1.cpp @@ -412,7 +412,7 @@ class npc_eye_of_acherus : public CreatureScript { if (movementType == WAYPOINT_MOTION_TYPE && pointId == POINT_EYE_MOVE_END - 1) { - me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + me->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); me->RemoveAllAuras(); if (Player* owner = me->GetCharmerOrOwner()->ToPlayer()) diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp index 44885a01270..b218e3f2978 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_jandice_barov.cpp @@ -105,7 +105,7 @@ public: DoMeleeAttackIfReady(); } - + private: EventMap events; SummonList Summons; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 82a8e4e656d..0594fbf63b3 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -151,18 +151,17 @@ class spell_kormok_summon_bone_mages : SpellScriptLoader bool Validate(SpellInfo const* /*spell*/) override { - for (int i = 0; i < 4; ++i) + for (uint32 i = 0; i < 4; ++i) if (!sSpellMgr->GetSpellInfo(SummonMageSpells[i])) return false; - - return true; + return true; } void HandleScript(SpellEffIndex effIndex) { PreventHitDefaultEffect(effIndex); - for (int i = 0; i < 2; ++i) - GetCaster()->CastSpell(GetCaster(), SummonMageSpells[urand(0, 4)], true); + for (uint32 i = 0; i < 2; ++i) + GetCaster()->CastSpell(GetCaster(), SummonMageSpells[urand(0, 4)], true); } void Register() override @@ -199,7 +198,7 @@ class spell_kormok_summon_bone_minions : SpellScriptLoader PreventHitDefaultEffect(effIndex); // Possible spells to handle this not found. - for (int i = 0; i < 4; ++i) + for (uint32 i = 0; i < 4; ++i) GetCaster()->SummonCreature(NPC_BONE_MINION, GetCaster()->GetPositionX() + float(irand(-7, 7)), GetCaster()->GetPositionY() + float(irand(-7, 7)), GetCaster()->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); } diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp index 41873d778ca..897799a708c 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_ras_frostwhisper.cpp @@ -53,8 +53,8 @@ public: DoCast(me, SPELL_ICE_ARMOR); } - void EnterCombat(Unit* /*who*/) override - { + void EnterCombat(Unit* /*who*/) override + { events.ScheduleEvent(EVENT_ICE_ARMOR, 2000); events.ScheduleEvent(EVENT_FROSTBOLT, 8000); events.ScheduleEvent(EVENT_CHILL_NOVA, 12000); @@ -108,7 +108,7 @@ public: DoMeleeAttackIfReady(); } - + private: EventMap events; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp index 654f06ad3ed..792649f2998 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_vectus.cpp @@ -101,7 +101,7 @@ public: DoMeleeAttackIfReady(); } - + private: EventMap events; }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 6c3e820e10f..60162188f7e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -204,7 +204,7 @@ public: default: break; } - + ++BeamCount; uint32 Beam = CurrentBeam; if (BeamCount > 3) @@ -265,7 +265,7 @@ public: break; } } - + private: uint64 TargetGUID[3]; uint32 BeamCount; diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index b96228c1fb6..c998bfed2dc 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -179,7 +179,7 @@ public: break; } } - + private: uint64 SpineTargetGUID; }; diff --git a/src/server/scripts/World/boss_emerald_dragons.cpp b/src/server/scripts/World/boss_emerald_dragons.cpp index 23e373312cb..a00c9465a05 100644 --- a/src/server/scripts/World/boss_emerald_dragons.cpp +++ b/src/server/scripts/World/boss_emerald_dragons.cpp @@ -587,7 +587,7 @@ class boss_taerar : public CreatureScript void Reset() override { me->RemoveAurasDueToSpell(SPELL_SHADE); - + Initialize(); emerald_dragonAI::Reset(); -- cgit v1.2.3 From 9e816c870177c46339a57b61366379a502c88090 Mon Sep 17 00:00:00 2001 From: Dr-J Date: Sun, 7 Sep 2014 03:45:50 +0100 Subject: Remove CPP script for Ethereal Teleport Pad Remove CPP script which was not using proper mechanism for activating (ie gossip) --- src/server/scripts/World/go_scripts.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'src') diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 3c3f0c2c26b..7ba043f2a2e 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -36,7 +36,6 @@ go_jotunheim_cage go_table_theka go_soulwell go_bashir_crystalforge -go_ethereal_teleport_pad go_soulwell go_dragonflayer_cage go_tadpole_cage @@ -840,32 +839,6 @@ public: } }; -/*###### -## go_ethereal_teleport_pad -######*/ - -enum EtherealTeleportPad -{ - NPC_IMAGE_WIND_TRADER = 20518, - ITEM_TELEPORTER_POWER_PACK = 28969, -}; - -class go_ethereal_teleport_pad : public GameObjectScript -{ -public: - go_ethereal_teleport_pad() : GameObjectScript("go_ethereal_teleport_pad") { } - - bool OnGossipHello(Player* player, GameObject* go) override - { - if (!player->HasItemCount(ITEM_TELEPORTER_POWER_PACK)) - return false; - - go->SummonCreature(NPC_IMAGE_WIND_TRADER, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), go->GetAngle(player), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); - - return true; - } -}; - /*###### ## go_soulwell ######*/ @@ -1334,7 +1307,6 @@ void AddSC_go_scripts() new go_jotunheim_cage(); new go_table_theka(); new go_inconspicuous_landmark(); - new go_ethereal_teleport_pad(); new go_soulwell(); new go_tadpole_cage(); new go_dragonflayer_cage(); -- cgit v1.2.3 From 2dc45fafe60c1df6bfb9bcca7c294638d0d3641b Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Sun, 7 Sep 2014 01:08:42 -0300 Subject: Scripts/Stratholme: Move Freed Soul AI to database and a small addition - They should follow players until they despawn --- sql/updates/world/2014_09_07_01_world_sai.sql | 5 +++ .../EasternKingdoms/Stratholme/stratholme.cpp | 36 ++-------------------- 2 files changed, 8 insertions(+), 33 deletions(-) create mode 100644 sql/updates/world/2014_09_07_01_world_sai.sql (limited to 'src') diff --git a/sql/updates/world/2014_09_07_01_world_sai.sql b/sql/updates/world/2014_09_07_01_world_sai.sql new file mode 100644 index 00000000000..b264087cda6 --- /dev/null +++ b/sql/updates/world/2014_09_07_01_world_sai.sql @@ -0,0 +1,5 @@ +SET @ENTRY := 11136; -- Freed Soul +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` = @ENTRY AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 0, 0, 11, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Freed Soul - On Respawn - Say Line 0'); diff --git a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp index 01ee7139ae5..889fbe8fdc9 100644 --- a/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp +++ b/src/server/scripts/EasternKingdoms/Stratholme/stratholme.cpp @@ -80,38 +80,6 @@ public: }; -/*###### -## npc_freed_soul -######*/ -enum FreedSoul -{ - SAY_ZAPPED = 0 -}; - -class npc_freed_soul : public CreatureScript -{ -public: - npc_freed_soul() : CreatureScript("npc_freed_soul") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_freed_soulAI(creature); - } - - struct npc_freed_soulAI : public ScriptedAI - { - npc_freed_soulAI(Creature* creature) : ScriptedAI(creature) { } - - void Reset() override - { - Talk(SAY_ZAPPED); - } - - void EnterCombat(Unit* /*who*/) override { } - }; - -}; - /*###### ## npc_restless_soul ######*/ @@ -181,6 +149,9 @@ public: void JustSummoned(Creature* summoned) override { summoned->CastSpell(summoned, SPELL_SOUL_FREED, false); + + if (Player* player = ObjectAccessor::GetPlayer(*me, Tagger)) + summoned->GetMotionMaster()->MoveFollow(player, 0.0f, 0.0f); } void JustDied(Unit* /*killer*/) override @@ -318,7 +289,6 @@ public: void AddSC_stratholme() { new go_gauntlet_gate(); - new npc_freed_soul(); new npc_restless_soul(); new npc_spectral_ghostly_citizen(); } -- cgit v1.2.3 From 46930876e23f0058541f061035fad5f884d340c0 Mon Sep 17 00:00:00 2001 From: MitchesD Date: Sun, 7 Sep 2014 18:43:58 +0200 Subject: Scripts/ScarletMonastery: Interrogator Vishas updated to BossAI and EventMap --- .../ScarletMonastery/boss_interrogator_vishas.cpp | 141 ++++++++++----------- 1 file changed, 66 insertions(+), 75 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index c05de1bb800..5d7c3afcc4f 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,13 +15,6 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Interrogator_Vishas -SD%Complete: 100 -SDComment: -SDCategory: Scarlet Monastery -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "scarlet_monastery.h" @@ -38,94 +30,93 @@ enum Says enum Spells { - SPELL_SHADOWWORDPAIN = 2767 + SPELL_SHADOW_WORD_PAIN = 2767 }; -class boss_interrogator_vishas : public CreatureScript +enum Events { -public: - boss_interrogator_vishas() : CreatureScript("boss_interrogator_vishas") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return GetInstanceAI(creature); - } - - struct boss_interrogator_vishasAI : public ScriptedAI - { - boss_interrogator_vishasAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - instance = me->GetInstanceScript(); - } - - void Initialize() - { - ShadowWordPain_Timer = 5000; - Yell60 = false; - Yell30 = false; - } - - InstanceScript* instance; + EVENT_SHADOW_WORD_PAIN = 1 +}; - bool Yell30; - bool Yell60; - uint32 ShadowWordPain_Timer; +class boss_interrogator_vishas : public CreatureScript +{ + public: + boss_interrogator_vishas() : CreatureScript("boss_interrogator_vishas") { } - void Reset() override + struct boss_interrogator_vishasAI : public BossAI { - Initialize(); - instance->SetBossState(DATA_INTERROGATOR_VISHAS, NOT_STARTED); - } + boss_interrogator_vishasAI(Creature* creature) : BossAI(creature, DATA_INTERROGATOR_VISHAS) + { + Initialize(); + } - void EnterCombat(Unit* /*who*/) override - { - Talk(SAY_AGGRO); - instance->SetBossState(DATA_INTERROGATOR_VISHAS, IN_PROGRESS); - } + void Initialize() + { + _yellCount = 0; + } - void KilledUnit(Unit* /*Victim*/) override - { - Talk(SAY_KILL); - } + void Reset() override + { + Initialize(); + _Reset(); + } - void JustDied(Unit* /*killer*/) override - { - //Any other Actions to do with vorrel? setStandState? - if (Creature* vorrel = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VORREL))) - vorrel->AI()->Talk(SAY_TRIGGER_VORREL); - instance->SetBossState(DATA_INTERROGATOR_VISHAS, DONE); - } + void EnterCombat(Unit* /*who*/) override + { + Talk(SAY_AGGRO); + _EnterCombat(); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 5000); + } - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; + void KilledUnit(Unit* victim) override + { + if (victim->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); + } - //If we are low on hp Do sayings - if (!Yell60 && !HealthAbovePct(60)) + void JustDied(Unit* /*killer*/) override { - Talk(SAY_HEALTH1); - Yell60 = true; + _JustDied(); + if (Creature* vorrel = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_VORREL))) + vorrel->AI()->Talk(SAY_TRIGGER_VORREL); } - if (!Yell30 && !HealthAbovePct(30)) + void DamageTaken(Unit* /*attacker*/, uint32 &damage) override { - Talk(SAY_HEALTH2); - Yell30 = true; + if (me->HealthBelowPctDamaged(60, damage) && _yellCount < 1) + { + Talk(SAY_HEALTH1); + ++_yellCount; + } + + if (me->HealthBelowPctDamaged(30, damage) && _yellCount < 2) + { + Talk(SAY_HEALTH1); + ++_yellCount; + } } - //ShadowWordPain_Timer - if (ShadowWordPain_Timer <= diff) + void ExecuteEvent(uint32 eventId) override { - DoCastVictim(SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = urand(5000, 15000); + switch (eventId) + { + case EVENT_SHADOW_WORD_PAIN: + DoCastVictim(SPELL_SHADOW_WORD_PAIN); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(5000, 15000)); + break; + default: + break; + } } - else ShadowWordPain_Timer -= diff; - DoMeleeAttackIfReady(); + private: + uint8 _yellCount; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return GetInstanceAI(creature); } - }; }; void AddSC_boss_interrogator_vishas() -- cgit v1.2.3 From 17be840d4d9b8e86ffdcae109069e8352b08cf4d Mon Sep 17 00:00:00 2001 From: MitchesD Date: Sun, 7 Sep 2014 18:47:25 +0200 Subject: Scripts/ScarletMonastery: fix typo caused by copy-paste --- .../EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp index 5d7c3afcc4f..3e752858e63 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_interrogator_vishas.cpp @@ -91,7 +91,7 @@ class boss_interrogator_vishas : public CreatureScript if (me->HealthBelowPctDamaged(30, damage) && _yellCount < 2) { - Talk(SAY_HEALTH1); + Talk(SAY_HEALTH2); ++_yellCount; } } -- cgit v1.2.3 From 93a01b6d50bfef7702533da5918f06f90a86ad3d Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Sun, 7 Sep 2014 14:20:26 -0300 Subject: Scripts/AV: Balinda Stonehearth - Updated to EventMaps - Removed manual spawning of Water Elemental by using proper spell * The Water Elemental has a duration, it'll despawn once it's over. She'll resummon it during the encounter if it dies or disappears. * Fixes it's level scalling with owner. - Moved Water Elemental AI to database. - Script update ** Patch 3.1.0 (14-Apr-2009): Now casts Ice Block. --- sql/updates/world/2014_09_07_04_world_sai.sql | 128 ------------ sql/updates/world/2014_09_07_05_world_sai.sql | 128 ++++++++++++ sql/updates/world/2014_09_07_06_world_sai.sql | 6 + .../EasternKingdoms/AlteracValley/boss_balinda.cpp | 215 +++++++++------------ 4 files changed, 222 insertions(+), 255 deletions(-) delete mode 100644 sql/updates/world/2014_09_07_04_world_sai.sql create mode 100644 sql/updates/world/2014_09_07_05_world_sai.sql create mode 100644 sql/updates/world/2014_09_07_06_world_sai.sql (limited to 'src') diff --git a/sql/updates/world/2014_09_07_04_world_sai.sql b/sql/updates/world/2014_09_07_04_world_sai.sql deleted file mode 100644 index 104e9d3d015..00000000000 --- a/sql/updates/world/2014_09_07_04_world_sai.sql +++ /dev/null @@ -1,128 +0,0 @@ - -DELETE FROM `smart_scripts` WHERE `entryorguid` IN(19546,19579,19545,19580,19543,19544,-70107,-70108,-70109,-70110,-70111) AND `source_type`=0; -DELETE FROM `smart_scripts` WHERE `entryorguid` IN(1954600,1954500,1954400,1954300) AND `source_type`=9; - -INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES -(19546, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Store Targetlist'), -(19546, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Set Faction 7'), -(19546, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Set Flags Immune to NPC/PC'), -(19546, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19546, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Start WP'), -(19546, 0, 4, 0, 40, 0, 100, 0, 5, 19546, 0, 0, 80, 1954600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Reached WP5 - Run Script'), -(19546, 0, 5, 0, 4, 0, 100, 0, 0, 0, 0, 0, 11, 12544, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Aggro - Cast \'Frost Armor\''), -(19546, 0, 6, 0, 0, 0, 100, 0, 2000, 5000, 12000, 22000, 11, 17740, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - In Combat - Cast \'Mana Shield\''), -(19546, 0, 7, 0, 0, 0, 100, 0, 0, 6000, 2500, 8000, 11, 34447, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - In Combat - Cast \'Arcane Missiles\''), -(19546, 0, 8, 0, 25, 0, 100, 0, 0, 0, 0, 0, 28, 12544, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Reset - Remove Aura \'Frost Armor\''), -(19545, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Store Targetlist'), -(19545, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Set Faction 7'), -(19545, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Set Flags Immune to NPC/PC'), -(19545, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19545, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Start WP'), -(19545, 0, 4, 0, 40, 0, 100, 0, 6, 19545, 0, 0, 80, 1954500, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Reached WP6 - Run Script'), -(19545, 0, 5, 0, 0, 0, 100, 0, 0, 1000, 25000, 30000, 11, 33245, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - In Combat - Cast \'Ice Barrier\''), -(19545, 0, 6, 0, 0, 0, 100, 0, 0, 10000, 2500, 9500, 11, 11831, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - In Combat - Cast \'Frost Nova\''), -(19545, 0, 7, 0, 0, 0, 100, 0, 0, 2500, 2500, 11000, 11, 9672, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - In Combat - Cast \'Frostbolt\''), -(19544, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Store Targetlist'), -(19544, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Set Faction 7'), -(19544, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Set Flags Immune to NPC/PC'), -(19544, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19544, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Start WP'), -(19544, 0, 4, 0, 40, 0, 100, 0, 3, 19544, 0, 0, 80, 1954400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Reached WP3 - Run Script'), -(19544, 0, 5, 0, 0, 0, 100, 0, 0, 2500, 1000, 7500, 11, 9532, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - In Combat - Cast \'Lightning Bolt\''), -(19544, 0, 6, 0, 0, 0, 100, 0, 0, 5000, 15000, 30000, 11, 36110, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - In Combat - Cast \'Summon Dancing Sword\''), -(19544, 0, 7, 0, 0, 0, 100, 0, 0, 10000, 5000, 15000, 11, 36109, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - In Combat - Cast \'Blink\''), -(19543, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Store Targetlist'), -(19543, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Remove Weapon'), -(19543, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Set Faction 7'), -(19543, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Set Flags Immune to NPC/PC'), -(19543, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19543, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Start WP'), -(19543, 0, 5, 0, 40, 0, 100, 0, 5, 19543, 0, 0, 80, 1954300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Reached WP5 - Run Script'), -(19543, 0, 6, 0, 0, 0, 100, 0, 0, 3000, 3000, 8000, 11, 36104, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - In Combat - Cast \'Torrent of Flames\''), -(19543, 0, 7, 0, 0, 0, 100, 0, 0, 2500, 8500, 12000, 11, 17273, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - In Combat - Cast \'Pyroblast\''), -(-70109, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34212, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), -(-70107, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34211, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), -(-70110, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34209, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), -(-70108, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34212, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), -(-70111, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34211, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), -(1954600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 4.014257, 'Abjurist Belmara - Script - Set Orientation'), -(1954600, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Play Emote Use_standing'), -(1954600, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Play Emote none'), -(1954600, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 12742, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Equip Item'), -(1954600, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Say Line'), -(1954600, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19547, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Give Kill Credit'), -(1954500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1.902409, 'Cohlien Frostweaver - Script - Set Orientation'), -(1954500, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Play Emote Use_standing'), -(1954500, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Say Line'), -(1954500, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Play Emote none'), -(1954500, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 36, 19579, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Change Entry to Cohlien Frostweaver with Hat'), -(1954500, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Set Faction'), -(1954500, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19550, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Give Kill Credit'), -(1954400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 3.961897, 'Conjurer Luminrath - Script - Set Orientation'), -(1954400, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Say Line'), -(1954400, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Play Emote Use_standing'), -(1954400, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Play Emote none'), -(1954400, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Say Line 2'), -(1954400, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 36, 19580, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Change Entry to Luminrath with Cape'), -(1954400, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Set Faction'), -(1954400, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19548, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Give Kill Credit'), -(1954300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 4.537856, 'Battle-Mage Dathric - Script - Set Orientation'), -(1954300, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Play Emote Use_standing'), -(1954300, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Play Emote none'), -(1954300, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 18983, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Equip Item'), -(1954300, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Say Line'), -(1954300, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19549, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Give Kill Credit'); - -DELETE FROM `creature_text` WHERE `entry` IN(19545,19544,19543,19546); -INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES -(19545, 0, 0, 'Phew! There''s my lucky hat. I''ve been looking for it everywhere.', 12, 0, 100, 0, 0, 0, 'Cohlien Frostweaver',16926), -(19544, 0, 0, 'I can''t possibly go out without my cloak. I hope it''s in here...', 12, 0, 100, 0, 0, 0, 'Conjurer Luminrath',16927), -(19544, 1, 0, 'There it is! I could''ve sworn it wasn''t here last time I checked...', 12, 0, 100, 0, 0, 0, 'Conjurer Luminrath',16929), -(19543, 0, 0, 'I don''t know what I was thinking, going out without my sword. I would''ve put it on if I''d seen it here...', 12, 0, 100, 0, 0, 0, 'Battle-Mage Dathric',16931), -(19546, 0, 0, 'I can''t sleep without a good bedtime story. Now I''m certain to rest well.', 12, 0, 100, 0, 0, 0, 'Abjurist Belmara',16932); - -DELETE FROM `waypoints` WHERE `entry` IN(19546,19545,19544,19543); - -INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES -(19546, 1,2237.667, 2393.5, 112.7383, 'Abjurist Belmara'), -(19546, 2,2238.667, 2393.75, 112.9883, 'Abjurist Belmara'), -(19546, 3,2239.417, 2393.25, 112.9883, 'Abjurist Belmara'), -(19546, 4,2239.917, 2392.5, 112.9883, 'Abjurist Belmara'), -(19546, 5,2240.365, 2390.882, 112.6025, 'Abjurist Belmara'), -(19545, 1,2214.206, 2400.794, 108.8995, 'Cohlien Frostweaver'), -(19545, 2,2213.218, 2400.951, 108.8995, 'Cohlien Frostweaver'), -(19545, 3,2204.71, 2408.806, 108.6094, 'Cohlien Frostweaver'), -(19545, 4,2204.71, 2408.806, 108.6094, 'Cohlien Frostweaver'), -(19545, 5,2204.652, 2408.992, 108.6537, 'Cohlien Frostweaver'), -(19545, 6,2202.912, 2411.269, 108.6577, 'Cohlien Frostweaver'), -(19544, 1,2198.386, 2334.958, 89.4724, 'Conjurer Luminrath'), -(19544, 2,2197.577, 2334.37, 89.4724, 'Conjurer Luminrath'), -(19544, 3,2193.663, 2339.085, 90.02818, 'Conjurer Luminrath'), -(19543, 1,2235.705, 2320.857, 92.30136, 'Battle-Mage Dathric'), -(19543, 2,2235.67, 2319.858, 92.30136, 'Battle-Mage Dathric'), -(19543, 3,2233.228, 2317.592, 91.34792, 'Battle-Mage Dathric'), -(19543, 4,2230.454, 2316.294, 90.59956, 'Battle-Mage Dathric'), -(19543, 5,2228.403, 2313.777, 89.63835, 'Battle-Mage Dathric'); - -DELETE FROM `event_scripts` WHERE `id` IN(12607,12610,12609,12608); -INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES -(12607, 0, 10, 19546, 25000, 0, 2236.969, 2393.117, 112.374, 5.811946), -(12610, 0, 10, 19545, 25000, 0, 2212.535, 2401.582, 108.8762, 2.396056), -(12609, 0, 10, 19544, 25000, 0, 2197.269, 2334.741, 89.5162, 2.263612), -(12608, 0, 10, 19543, 25000, 0, 2235.094, 2319.323, 92.07642, 3.889618); - -DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(34209,34211,34212); -INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES -(13, 1, 34209, 0, 0, 31, 0, 3, 19656, 0, 0, 0, 0, '', 'Blue Beam Targets Invisible Location trigger'), -(13, 1, 34211, 0, 0, 31, 0, 3, 19656, 0, 0, 0, 0, '', 'Blue Beam Targets Invisible Location trigger'), -(13, 1, 34212, 0, 0, 31, 0, 3, 19656, 0, 0, 0, 0, '', 'Blue Beam Targets Invisible Location trigger'); - -UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=28503 AND `source_type`=0 AND `id`=7 AND `link`=8; -UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=9098 AND `source_type`=0 AND `id`=0 AND `link`=0; -UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=14389 AND `source_type`=0 AND `id`=0 AND `link`=0; - -DELETE FROM `spell_area` WHERE `spell`=34102; -INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES -(34102, 3733, 0, 0, 0, 0, 2, 1, 64, 11); -- Curse of the Violet Tower - -DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN(34209,34211,34212); -INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES -(0, 34209, 64, '', '', 'Ignore LOS on Blue Beam'), -(0, 34211, 64, '', '', 'Ignore LOS on Blue Beam'), -(0, 34212, 64, '', '', 'Ignore LOS on Blue Beam'); diff --git a/sql/updates/world/2014_09_07_05_world_sai.sql b/sql/updates/world/2014_09_07_05_world_sai.sql new file mode 100644 index 00000000000..104e9d3d015 --- /dev/null +++ b/sql/updates/world/2014_09_07_05_world_sai.sql @@ -0,0 +1,128 @@ + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(19546,19579,19545,19580,19543,19544,-70107,-70108,-70109,-70110,-70111) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN(1954600,1954500,1954400,1954300) AND `source_type`=9; + +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(19546, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Store Targetlist'), +(19546, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Set Faction 7'), +(19546, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Set Flags Immune to NPC/PC'), +(19546, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19546, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Just Summoned - Start WP'), +(19546, 0, 4, 0, 40, 0, 100, 0, 5, 19546, 0, 0, 80, 1954600, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Reached WP5 - Run Script'), +(19546, 0, 5, 0, 4, 0, 100, 0, 0, 0, 0, 0, 11, 12544, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Aggro - Cast \'Frost Armor\''), +(19546, 0, 6, 0, 0, 0, 100, 0, 2000, 5000, 12000, 22000, 11, 17740, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - In Combat - Cast \'Mana Shield\''), +(19546, 0, 7, 0, 0, 0, 100, 0, 0, 6000, 2500, 8000, 11, 34447, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - In Combat - Cast \'Arcane Missiles\''), +(19546, 0, 8, 0, 25, 0, 100, 0, 0, 0, 0, 0, 28, 12544, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - On Reset - Remove Aura \'Frost Armor\''), +(19545, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Store Targetlist'), +(19545, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Set Faction 7'), +(19545, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Set Flags Immune to NPC/PC'), +(19545, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19545, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Just Summoned - Start WP'), +(19545, 0, 4, 0, 40, 0, 100, 0, 6, 19545, 0, 0, 80, 1954500, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - On Reached WP6 - Run Script'), +(19545, 0, 5, 0, 0, 0, 100, 0, 0, 1000, 25000, 30000, 11, 33245, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - In Combat - Cast \'Ice Barrier\''), +(19545, 0, 6, 0, 0, 0, 100, 0, 0, 10000, 2500, 9500, 11, 11831, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - In Combat - Cast \'Frost Nova\''), +(19545, 0, 7, 0, 0, 0, 100, 0, 0, 2500, 2500, 11000, 11, 9672, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - In Combat - Cast \'Frostbolt\''), +(19544, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Store Targetlist'), +(19544, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Set Faction 7'), +(19544, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Set Flags Immune to NPC/PC'), +(19544, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19544, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Just Summoned - Start WP'), +(19544, 0, 4, 0, 40, 0, 100, 0, 3, 19544, 0, 0, 80, 1954400, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - On Reached WP3 - Run Script'), +(19544, 0, 5, 0, 0, 0, 100, 0, 0, 2500, 1000, 7500, 11, 9532, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - In Combat - Cast \'Lightning Bolt\''), +(19544, 0, 6, 0, 0, 0, 100, 0, 0, 5000, 15000, 30000, 11, 36110, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - In Combat - Cast \'Summon Dancing Sword\''), +(19544, 0, 7, 0, 0, 0, 100, 0, 0, 10000, 5000, 15000, 11, 36109, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - In Combat - Cast \'Blink\''), +(19543, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Store Targetlist'), +(19543, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Remove Weapon'), +(19543, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Set Faction 7'), +(19543, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 18, 768, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Set Flags Immune to NPC/PC'), +(19543, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 53, 0, 19543, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Just Summoned - Start WP'), +(19543, 0, 5, 0, 40, 0, 100, 0, 5, 19543, 0, 0, 80, 1954300, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - On Reached WP5 - Run Script'), +(19543, 0, 6, 0, 0, 0, 100, 0, 0, 3000, 3000, 8000, 11, 36104, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - In Combat - Cast \'Torrent of Flames\''), +(19543, 0, 7, 0, 0, 0, 100, 0, 0, 2500, 8500, 12000, 11, 17273, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - In Combat - Cast \'Pyroblast\''), +(-70109, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34212, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), +(-70107, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34211, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), +(-70110, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34209, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), +(-70108, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34212, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), +(-70111, 0, 0, 0, 1, 0, 100, 0, 0, 0, 5000, 5000, 11, 34211, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Invisible Location Trigger - OOC - Cast Blue beam'), +(1954600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 4.014257, 'Abjurist Belmara - Script - Set Orientation'), +(1954600, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Play Emote Use_standing'), +(1954600, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Play Emote none'), +(1954600, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 12742, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Equip Item'), +(1954600, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Say Line'), +(1954600, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19547, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Abjurist Belmara - Script - Give Kill Credit'), +(1954500, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1.902409, 'Cohlien Frostweaver - Script - Set Orientation'), +(1954500, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Play Emote Use_standing'), +(1954500, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Say Line'), +(1954500, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Play Emote none'), +(1954500, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 36, 19579, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Change Entry to Cohlien Frostweaver with Hat'), +(1954500, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Set Faction'), +(1954500, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19550, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Cohlien Frostweaver - Script - Give Kill Credit'), +(1954400, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 3.961897, 'Conjurer Luminrath - Script - Set Orientation'), +(1954400, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Say Line'), +(1954400, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Play Emote Use_standing'), +(1954400, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Play Emote none'), +(1954400, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Say Line 2'), +(1954400, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 36, 19580, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Change Entry to Luminrath with Cape'), +(1954400, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Set Faction'), +(1954400, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19548, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Conjurer Luminrath - Script - Give Kill Credit'), +(1954300, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 4.537856, 'Battle-Mage Dathric - Script - Set Orientation'), +(1954300, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 5, 69, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Play Emote Use_standing'), +(1954300, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Play Emote none'), +(1954300, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 71, 0, 0, 18983, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Equip Item'), +(1954300, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Say Line'), +(1954300, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 19549, 0, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Battle-Mage Dathric - Script - Give Kill Credit'); + +DELETE FROM `creature_text` WHERE `entry` IN(19545,19544,19543,19546); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `BroadcastTextID`) VALUES +(19545, 0, 0, 'Phew! There''s my lucky hat. I''ve been looking for it everywhere.', 12, 0, 100, 0, 0, 0, 'Cohlien Frostweaver',16926), +(19544, 0, 0, 'I can''t possibly go out without my cloak. I hope it''s in here...', 12, 0, 100, 0, 0, 0, 'Conjurer Luminrath',16927), +(19544, 1, 0, 'There it is! I could''ve sworn it wasn''t here last time I checked...', 12, 0, 100, 0, 0, 0, 'Conjurer Luminrath',16929), +(19543, 0, 0, 'I don''t know what I was thinking, going out without my sword. I would''ve put it on if I''d seen it here...', 12, 0, 100, 0, 0, 0, 'Battle-Mage Dathric',16931), +(19546, 0, 0, 'I can''t sleep without a good bedtime story. Now I''m certain to rest well.', 12, 0, 100, 0, 0, 0, 'Abjurist Belmara',16932); + +DELETE FROM `waypoints` WHERE `entry` IN(19546,19545,19544,19543); + +INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES +(19546, 1,2237.667, 2393.5, 112.7383, 'Abjurist Belmara'), +(19546, 2,2238.667, 2393.75, 112.9883, 'Abjurist Belmara'), +(19546, 3,2239.417, 2393.25, 112.9883, 'Abjurist Belmara'), +(19546, 4,2239.917, 2392.5, 112.9883, 'Abjurist Belmara'), +(19546, 5,2240.365, 2390.882, 112.6025, 'Abjurist Belmara'), +(19545, 1,2214.206, 2400.794, 108.8995, 'Cohlien Frostweaver'), +(19545, 2,2213.218, 2400.951, 108.8995, 'Cohlien Frostweaver'), +(19545, 3,2204.71, 2408.806, 108.6094, 'Cohlien Frostweaver'), +(19545, 4,2204.71, 2408.806, 108.6094, 'Cohlien Frostweaver'), +(19545, 5,2204.652, 2408.992, 108.6537, 'Cohlien Frostweaver'), +(19545, 6,2202.912, 2411.269, 108.6577, 'Cohlien Frostweaver'), +(19544, 1,2198.386, 2334.958, 89.4724, 'Conjurer Luminrath'), +(19544, 2,2197.577, 2334.37, 89.4724, 'Conjurer Luminrath'), +(19544, 3,2193.663, 2339.085, 90.02818, 'Conjurer Luminrath'), +(19543, 1,2235.705, 2320.857, 92.30136, 'Battle-Mage Dathric'), +(19543, 2,2235.67, 2319.858, 92.30136, 'Battle-Mage Dathric'), +(19543, 3,2233.228, 2317.592, 91.34792, 'Battle-Mage Dathric'), +(19543, 4,2230.454, 2316.294, 90.59956, 'Battle-Mage Dathric'), +(19543, 5,2228.403, 2313.777, 89.63835, 'Battle-Mage Dathric'); + +DELETE FROM `event_scripts` WHERE `id` IN(12607,12610,12609,12608); +INSERT INTO `event_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `dataint`, `x`, `y`, `z`, `o`) VALUES +(12607, 0, 10, 19546, 25000, 0, 2236.969, 2393.117, 112.374, 5.811946), +(12610, 0, 10, 19545, 25000, 0, 2212.535, 2401.582, 108.8762, 2.396056), +(12609, 0, 10, 19544, 25000, 0, 2197.269, 2334.741, 89.5162, 2.263612), +(12608, 0, 10, 19543, 25000, 0, 2235.094, 2319.323, 92.07642, 3.889618); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN(34209,34211,34212); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 34209, 0, 0, 31, 0, 3, 19656, 0, 0, 0, 0, '', 'Blue Beam Targets Invisible Location trigger'), +(13, 1, 34211, 0, 0, 31, 0, 3, 19656, 0, 0, 0, 0, '', 'Blue Beam Targets Invisible Location trigger'), +(13, 1, 34212, 0, 0, 31, 0, 3, 19656, 0, 0, 0, 0, '', 'Blue Beam Targets Invisible Location trigger'); + +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=28503 AND `source_type`=0 AND `id`=7 AND `link`=8; +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=9098 AND `source_type`=0 AND `id`=0 AND `link`=0; +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=14389 AND `source_type`=0 AND `id`=0 AND `link`=0; + +DELETE FROM `spell_area` WHERE `spell`=34102; +INSERT INTO `spell_area` (`spell`, `area`, `quest_start`, `quest_end`, `aura_spell`, `racemask`, `gender`, `autocast`, `quest_start_status`, `quest_end_status`) VALUES +(34102, 3733, 0, 0, 0, 0, 2, 1, 64, 11); -- Curse of the Violet Tower + +DELETE FROM `disables` WHERE `sourceType`=0 AND `entry` IN(34209,34211,34212); +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(0, 34209, 64, '', '', 'Ignore LOS on Blue Beam'), +(0, 34211, 64, '', '', 'Ignore LOS on Blue Beam'), +(0, 34212, 64, '', '', 'Ignore LOS on Blue Beam'); diff --git a/sql/updates/world/2014_09_07_06_world_sai.sql b/sql/updates/world/2014_09_07_06_world_sai.sql new file mode 100644 index 00000000000..fded7b73948 --- /dev/null +++ b/sql/updates/world/2014_09_07_06_world_sai.sql @@ -0,0 +1,6 @@ +SET @ENTRY := 25040; -- Greater Water Elemental +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = @ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid` = @ENTRY AND `source_type` = 0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 3000, 3000, 5000, 5000, 11, 46983, 64, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Greater Water Elemental - In Combat - Cast Waterbolt'); + diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 8bc969e9020..4aaf364eea7 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -23,19 +23,16 @@ enum Spells SPELL_ARCANE_EXPLOSION = 46608, SPELL_CONE_OF_COLD = 38384, SPELL_FIREBALL = 46988, - SPELL_FROSTBOLT = 46987 + SPELL_FROSTBOLT = 46987, + SPELL_SUMMON_WATER_ELEMENTAL = 45067, + SPELL_ICEBLOCK = 46604 }; -enum Yells +enum Texts { - YELL_AGGRO = 0, - YELL_EVADE = 1, - YELL_SALVATION = 2, -}; - -enum Creatures -{ - NPC_WATER_ELEMENTAL = 25040 + SAY_AGGRO = 0, + SAY_EVADE = 1, + SAY_SALVATION = 2, }; enum Action @@ -43,64 +40,15 @@ enum Action ACTION_BUFF_YELL = -30001 // shared from Battleground }; -enum WaterElementalSpells -{ - SPELL_WATERBOLT = 46983 -}; - -class npc_water_elemental : public CreatureScript +enum Events { -public: - npc_water_elemental() : CreatureScript("npc_water_elemental") { } - - struct npc_water_elementalAI : public ScriptedAI - { - npc_water_elementalAI(Creature* creature) : ScriptedAI(creature) - { - waterBoltTimer = 3 * IN_MILLISECONDS; - resetTimer = 5 * IN_MILLISECONDS; - balindaGUID = 0; - } - - uint32 waterBoltTimer; - uint64 balindaGUID; - uint32 resetTimer; - - void Reset() override - { - waterBoltTimer = 3 * IN_MILLISECONDS; - resetTimer = 5 * IN_MILLISECONDS; - balindaGUID = 0; - } - - void UpdateAI(uint32 diff) override - { - if (!UpdateVictim()) - return; - - if (waterBoltTimer < diff) - { - DoCastVictim(SPELL_WATERBOLT); - waterBoltTimer = 5 * IN_MILLISECONDS; - } else waterBoltTimer -= diff; - - // check if creature is not outside of building - if (resetTimer < diff) - { - if (Creature* pBalinda = ObjectAccessor::GetCreature(*me, balindaGUID)) - if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50) - EnterEvadeMode(); - resetTimer = 5 * IN_MILLISECONDS; - } else resetTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_water_elementalAI(creature); - } + // Balinda + EVENT_ARCANE_EXPLOSION = 1, + EVENT_CONE_OF_COLD, + EVENT_FIREBOLT, + EVENT_FROSTBOLT, + EVENT_SUMMON_WATER_ELEMENTAL, + EVENT_CHECK_RESET, // Checks if Balinda or the Water Elemental are outside of building. }; class boss_balinda : public CreatureScript @@ -117,23 +65,10 @@ public: void Initialize() { - arcaneExplosionTimer = urand(5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS); - coneOfColdTimer = 8 * IN_MILLISECONDS; - fireBoltTimer = 1 * IN_MILLISECONDS; - frostboltTimer = 4 * IN_MILLISECONDS; - resetTimer = 5 * IN_MILLISECONDS; - waterElementalTimer = 0; + WaterElementalGUID = 0; + HasCastIceblock = false; } - uint32 arcaneExplosionTimer; - uint32 coneOfColdTimer; - uint32 fireBoltTimer; - uint32 frostboltTimer; - uint32 resetTimer; - uint32 waterElementalTimer; - - SummonList summons; - void Reset() override { Initialize(); @@ -143,22 +78,28 @@ public: void EnterCombat(Unit* /*who*/) override { - Talk(YELL_AGGRO); - } - - void JustRespawned() override - { - Reset(); + Talk(SAY_AGGRO); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS)); + events.ScheduleEvent(EVENT_CONE_OF_COLD, 8 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FIREBOLT, 1 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_FROSTBOLT, 4 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_SUMMON_WATER_ELEMENTAL, 3 * IN_MILLISECONDS); + events.ScheduleEvent(EVENT_CHECK_RESET, 5 * IN_MILLISECONDS); } void JustSummoned(Creature* summoned) override { - ENSURE_AI(npc_water_elemental::npc_water_elementalAI, summoned->AI())->balindaGUID = me->GetGUID(); summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true)); summoned->setFaction(me->getFaction()); + WaterElementalGUID = summoned->GetGUID(); summons.Summon(summoned); } + void SummonedCreatureDespawn(Creature* summoned) override + { + summons.Despawn(summoned); + } + void JustDied(Unit* /*killer*/) override { summons.DespawnAll(); @@ -167,7 +108,16 @@ public: void DoAction(int32 actionId) override { if (actionId == ACTION_BUFF_YELL) - Talk(YELL_AGGRO); + Talk(SAY_AGGRO); + } + + void DamageTaken(Unit* /*attacker*/, uint32& damage) override + { + if (me->HealthBelowPctDamaged(40, damage) && !HasCastIceblock) + { + DoCast(SPELL_ICEBLOCK); + HasCastIceblock = true; + } } void UpdateAI(uint32 diff) override @@ -175,50 +125,62 @@ public: if (!UpdateVictim()) return; - if (waterElementalTimer < diff) - { - if (summons.empty()) - me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45 * IN_MILLISECONDS); - waterElementalTimer = 50 * IN_MILLISECONDS; - } else waterElementalTimer -= diff; - - if (arcaneExplosionTimer < diff) - { - DoCastVictim(SPELL_ARCANE_EXPLOSION); - arcaneExplosionTimer = urand(5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS); - } else arcaneExplosionTimer -= diff; - - if (coneOfColdTimer < diff) - { - DoCastVictim(SPELL_CONE_OF_COLD); - coneOfColdTimer = urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS); - } else coneOfColdTimer -= diff; - - if (fireBoltTimer < diff) - { - DoCastVictim(SPELL_FIREBALL); - fireBoltTimer = urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS); - } else fireBoltTimer -= diff; + events.Update(diff); - if (frostboltTimer < diff) - { - DoCastVictim(SPELL_FROSTBOLT); - frostboltTimer = urand(4 * IN_MILLISECONDS, 12 * IN_MILLISECONDS); - } else frostboltTimer -= diff; + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - // check if creature is not outside of building - if (resetTimer < diff) + while (uint32 eventId = events.ExecuteEvent()) { - if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + switch (eventId) { - EnterEvadeMode(); - Talk(YELL_EVADE); + case EVENT_ARCANE_EXPLOSION: + DoCastVictim(SPELL_ARCANE_EXPLOSION); + events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, urand(5 * IN_MILLISECONDS, 15 * IN_MILLISECONDS)); + break; + case EVENT_CONE_OF_COLD: + DoCastVictim(SPELL_CONE_OF_COLD); + events.ScheduleEvent(EVENT_CONE_OF_COLD, urand(10 * IN_MILLISECONDS, 20 * IN_MILLISECONDS)); + break; + case EVENT_FIREBOLT: + DoCastVictim(SPELL_FIREBALL); + events.ScheduleEvent(EVENT_FIREBOLT, urand(5 * IN_MILLISECONDS, 9 * IN_MILLISECONDS)); + break; + case EVENT_FROSTBOLT: + DoCastVictim(SPELL_FROSTBOLT); + events.ScheduleEvent(EVENT_FROSTBOLT, urand(4 * IN_MILLISECONDS, 12 * IN_MILLISECONDS)); + break; + case EVENT_SUMMON_WATER_ELEMENTAL: + if (summons.empty()) + DoCast(SPELL_SUMMON_WATER_ELEMENTAL); + events.ScheduleEvent(EVENT_SUMMON_WATER_ELEMENTAL, 50 * IN_MILLISECONDS); + break; + case EVENT_CHECK_RESET: + if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + { + EnterEvadeMode(); + Talk(SAY_EVADE); + } + if (Creature* elemental = ObjectAccessor::GetCreature(*me, WaterElementalGUID)) + if (elemental->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50) + elemental->AI()->EnterEvadeMode(); + events.ScheduleEvent(EVENT_CHECK_RESET, 5 * IN_MILLISECONDS); + break; + default: + break; } - resetTimer = 5 * IN_MILLISECONDS; - } else resetTimer -= diff; + } DoMeleeAttackIfReady(); } + + private: + EventMap events; + SummonList summons; + + uint64 WaterElementalGUID; + + bool HasCastIceblock; }; CreatureAI* GetAI(Creature* creature) const override @@ -230,5 +192,4 @@ public: void AddSC_boss_balinda() { new boss_balinda; - new npc_water_elemental; } -- cgit v1.2.3 From 62cfca23cec79e9804bb02111c722d8b566a9e5a Mon Sep 17 00:00:00 2001 From: Nyeriah Date: Sun, 7 Sep 2014 14:29:04 -0300 Subject: Core/Misc: Meh some white lines, an addition to last sql's comment and a spotted typo --- sql/updates/world/2014_09_07_06_world_sai.sql | 2 +- src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp | 2 -- src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/sql/updates/world/2014_09_07_06_world_sai.sql b/sql/updates/world/2014_09_07_06_world_sai.sql index fded7b73948..b668a881591 100644 --- a/sql/updates/world/2014_09_07_06_world_sai.sql +++ b/sql/updates/world/2014_09_07_06_world_sai.sql @@ -2,5 +2,5 @@ SET @ENTRY := 25040; -- Greater Water Elemental UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = @ENTRY; DELETE FROM `smart_scripts` WHERE `entryorguid` = @ENTRY AND `source_type` = 0; INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES -(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 3000, 3000, 5000, 5000, 11, 46983, 64, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Greater Water Elemental - In Combat - Cast Waterbolt'); +(@ENTRY, 0, 1, 0, 0, 0, 100, 0, 3000, 3000, 5000, 5000, 11, 46983, 64, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Greater Water Elemental - In Combat CMC - Cast Waterbolt'); diff --git a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp index 4aaf364eea7..87272037755 100644 --- a/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp +++ b/src/server/scripts/EasternKingdoms/AlteracValley/boss_balinda.cpp @@ -177,9 +177,7 @@ public: private: EventMap events; SummonList summons; - uint64 WaterElementalGUID; - bool HasCastIceblock; }; diff --git a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp index 0594fbf63b3..099a69782b8 100644 --- a/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp +++ b/src/server/scripts/EasternKingdoms/Scholomance/boss_kormok.cpp @@ -161,7 +161,7 @@ class spell_kormok_summon_bone_mages : SpellScriptLoader { PreventHitDefaultEffect(effIndex); for (uint32 i = 0; i < 2; ++i) - GetCaster()->CastSpell(GetCaster(), SummonMageSpells[urand(0, 4)], true); + GetCaster()->CastSpell(GetCaster(), SummonMageSpells[urand(0, 3)], true); } void Register() override -- cgit v1.2.3 From df7f188cfe1b407520549f7374bfd070d83140e5 Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sun, 7 Sep 2014 20:08:05 +0200 Subject: Core/Misc: Refactor scripts to fix static analysis warnings Fourth batch of fixes targeting 100 issues reported by Coverity --- .../BlackwingLair/boss_chromaggus.cpp | 3 + .../EasternKingdoms/Karazhan/boss_nightbane.cpp | 3 + .../EasternKingdoms/Karazhan/bosses_opera.cpp | 1 + .../ScarletMonastery/boss_headless_horseman.cpp | 4 ++ .../SunwellPlateau/boss_kiljaeden.cpp | 1 + .../EasternKingdoms/SunwellPlateau/boss_muru.cpp | 56 +++++++++++---- .../CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp | 1 + .../Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp | 10 ++- .../TempleOfAhnQiraj/boss_twinemperors.cpp | 4 -- .../ObsidianSanctum/obsidian_sanctum.cpp | 14 ++-- .../RubySanctum/boss_baltharus_the_warborn.cpp | 8 ++- .../RubySanctum/boss_general_zarithrian.cpp | 8 ++- .../ChamberOfAspects/RubySanctum/boss_halion.cpp | 25 +++++-- .../RubySanctum/instance_ruby_sanctum.cpp | 1 + .../TrialOfTheChampion/boss_argent_challenge.cpp | 56 ++++++++++----- .../TrialOfTheChampion/boss_black_knight.cpp | 52 +++++++++----- .../TrialOfTheChampion/boss_grand_champions.cpp | 84 +++++++++++++++------- .../TrialOfTheChampion/trial_of_the_champion.cpp | 2 - .../TrialOfTheCrusader/boss_anubarak_trial.cpp | 34 +++++++-- .../TrialOfTheCrusader/boss_faction_champions.cpp | 36 ++++++++-- .../TrialOfTheCrusader/boss_lord_jaraxxus.cpp | 8 ++- .../TrialOfTheCrusader/boss_northrend_beasts.cpp | 36 ++++++++-- .../TrialOfTheCrusader/boss_twin_valkyr.cpp | 42 +++++++++-- .../TrialOfTheCrusader/trial_of_the_crusader.cpp | 25 +++---- .../Northrend/DraktharonKeep/boss_king_dred.cpp | 27 ++++++- .../Northrend/DraktharonKeep/boss_novos.cpp | 27 +++++-- .../Northrend/DraktharonKeep/boss_trollgore.cpp | 12 +++- .../FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp | 10 +-- .../ForgeOfSouls/boss_devourer_of_souls.cpp | 15 ++-- .../FrozenHalls/ForgeOfSouls/forge_of_souls.cpp | 16 ++++- .../FrozenHalls/HallsOfReflection/boss_falric.cpp | 12 +++- .../PitOfSaron/boss_forgemaster_garfrost.cpp | 12 +++- .../FrozenHalls/PitOfSaron/boss_krickandick.cpp | 11 ++- .../PitOfSaron/boss_scourgelord_tyrannus.cpp | 10 ++- .../PitOfSaron/instance_pit_of_saron.cpp | 1 + .../FrozenHalls/PitOfSaron/pit_of_saron.cpp | 16 ++++- .../Northrend/Gundrak/boss_drakkari_colossus.cpp | 18 +++-- src/server/scripts/Northrend/Gundrak/boss_eck.cpp | 18 +++-- .../scripts/Northrend/Gundrak/boss_gal_darah.cpp | 31 ++++---- .../scripts/Northrend/Gundrak/boss_moorabi.cpp | 16 +++-- .../scripts/Northrend/Gundrak/boss_slad_ran.cpp | 16 +++-- .../IcecrownCitadel/boss_blood_prince_council.cpp | 18 ++++- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 12 +++- .../IcecrownCitadel/boss_deathbringer_saurfang.cpp | 10 ++- .../IcecrownCitadel/boss_lady_deathwhisper.cpp | 22 ++++-- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 1 + .../IcecrownCitadel/boss_professor_putricide.cpp | 1 + .../Northrend/IcecrownCitadel/boss_sindragosa.cpp | 30 ++++++-- .../IcecrownCitadel/boss_the_lich_king.cpp | 10 ++- .../IcecrownCitadel/boss_valithria_dreamwalker.cpp | 25 +++++-- .../Northrend/IcecrownCitadel/icecrown_citadel.cpp | 28 ++++++-- .../IcecrownCitadel/instance_icecrown_citadel.cpp | 3 + .../Northrend/Naxxramas/boss_anubrekhan.cpp | 12 +++- .../Northrend/Naxxramas/boss_four_horsemen.cpp | 23 +++--- .../scripts/Northrend/Naxxramas/boss_gothik.cpp | 17 +++-- .../scripts/Northrend/Naxxramas/boss_heigan.cpp | 8 ++- .../scripts/Northrend/Naxxramas/boss_kelthuzad.cpp | 18 +++-- .../scripts/Northrend/Naxxramas/boss_loatheb.cpp | 10 ++- src/tools/vmap4_extractor/model.cpp | 2 +- 59 files changed, 767 insertions(+), 265 deletions(-) (limited to 'src') diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp index 1a97f668558..9a6d0e9c224 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_chromaggus.cpp @@ -75,6 +75,9 @@ public: { Initialize(); + Breath1_Spell = 0; + Breath2_Spell = 0; + // Select the 2 breaths that we are going to use until despawned // 5 possiblities for the first breath, 4 for the second, 20 total possiblites // This way we don't end up casting 2 of the same breath diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp index 9084a6b0371..7ce11653567 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp @@ -81,6 +81,9 @@ public: Initialize(); instance = creature->GetInstanceScript(); Intro = true; + RainBones = false; + Skeletons = false; + FlyTimer = 0; } void Initialize() diff --git a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp index ce8223c90cf..7b51b61ba0a 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/bosses_opera.cpp @@ -1068,6 +1068,7 @@ public: EntryYellTimer = 1000; AggroYellTimer = 10000; IsFakingDeath = false; + ResurrectTimer = 0; } void Initialize() diff --git a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp index 307bcd5add6..0733640f4c3 100644 --- a/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp +++ b/src/server/scripts/EasternKingdoms/ScarletMonastery/boss_headless_horseman.cpp @@ -391,6 +391,10 @@ public: Initialize(); instance = creature->GetInstanceScript(); headGUID = 0; + PlayerGUID = 0; + id = 0; + whirlwind = 0; + wp_reached = false; } void Initialize() diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 5df2d683e21..79ebfa7b62b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -503,6 +503,7 @@ public: { Initialize(); instance = creature->GetInstanceScript(); + speechPhaseEnd = 0; SetCombatMovement(false); } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index ec0bae0f27f..823423fc3a8 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -301,10 +301,19 @@ public: { npc_muru_portalAI(Creature* creature) : ScriptedAI(creature), Summons(creature) { + Initialize(); SetCombatMovement(false); instance = creature->GetInstanceScript(); } + void Initialize() + { + SummonTimer = 5000; + + InAction = false; + SummonSentinel = false; + } + InstanceScript* instance; SummonList Summons; @@ -316,10 +325,7 @@ public: void Reset() override { - SummonTimer = 5000; - - InAction = false; - SummonSentinel = false; + Initialize(); me->AddUnitState(UNIT_STATE_STUNNED); @@ -383,15 +389,23 @@ public: struct npc_dark_fiendAI : public ScriptedAI { - npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature) { } + npc_dark_fiendAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + WaitTimer = 2000; + InAction = false; + } uint32 WaitTimer; bool InAction; void Reset() override { - WaitTimer = 2000; - InAction = false; + Initialize(); me->AddUnitState(UNIT_STATE_STUNNED); } @@ -444,15 +458,23 @@ public: struct npc_void_sentinelAI : public ScriptedAI { - npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature) { } + npc_void_sentinelAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + PulseTimer = 3000; + VoidBlastTimer = 45000; //is this a correct timer? + } uint32 PulseTimer; uint32 VoidBlastTimer; void Reset() override { - PulseTimer = 3000; - VoidBlastTimer = 45000; //is this a correct timer? + Initialize(); float x, y, z, o; me->GetHomePosition(x, y, z, o); @@ -502,9 +524,18 @@ public: { npc_blackholeAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + DespawnTimer = 15000; + SpellTimer = 5000; + Phase = 0; + NeedForAHack = 0; + } + InstanceScript* instance; uint32 DespawnTimer; @@ -514,10 +545,7 @@ public: void Reset() override { - DespawnTimer = 15000; - SpellTimer = 5000; - Phase = 0; - NeedForAHack = 0; + Initialize(); me->AddUnitState(UNIT_STATE_STUNNED); DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp index 34b55da72de..a7fa54b12e1 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/hyjalAI.cpp @@ -335,6 +335,7 @@ hyjalAI::hyjalAI(Creature* creature) : npc_escortAI(creature), Summons(me) DoRespawn = false; MassTeleportTimer = 0; DoMassTeleport = false; + DummyGuid = 0; } void hyjalAI::Initialize() diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp index a98f3843d97..b916f93aef7 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_fankriss.cpp @@ -69,9 +69,6 @@ public: uint32 SpawnHatchlings_Timer; uint32 SpawnSpawns_Timer; - Creature* Hatchling; - Creature* Spawn; - void Reset() override { Initialize(); @@ -99,7 +96,7 @@ public: case 1: RandY = 0.0f + Rand; break; } Rand = 0; - Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + Creature* Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); if (Spawn) Spawn->AI()->AttackStart(victim); } @@ -155,6 +152,7 @@ public: if (DoGetThreat(target)) DoModifyThreatPercent(target, -100); + Creature* Hatchling = nullptr; switch (urand(0, 2)) { case 0: @@ -174,7 +172,7 @@ public: break; case 1: DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f); - Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); @@ -189,7 +187,7 @@ public: break; case 2: DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f); - Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Hatchling = me->SummonCreature(15962, target->GetPositionX() - 3, target->GetPositionY() - 3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); if (Hatchling) Hatchling->AI()->AttackStart(target); Hatchling = me->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp index cd250a50fb7..e65dbacc1f2 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_twinemperors.cpp @@ -417,8 +417,6 @@ public: uint32 UnbalancingStrike_Timer; uint32 Scarabs_Timer; - Creature* Summoned; - void Reset() override { TwinReset(); @@ -509,8 +507,6 @@ public: uint32 ArcaneBurst_Timer; uint32 Scorpions_Timer; - Creature* Summoned; - void Reset() override { TwinReset(); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp index 0a712b69771..58d7c6141b4 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/obsidian_sanctum.cpp @@ -161,19 +161,25 @@ struct dummy_dragonAI : public ScriptedAI { dummy_dragonAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + waypointId = 0; + portalRespawnTime = 30000; + _canMoveFree = false; + _canLoot = true; + } + void Reset() override { if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); events.Reset(); - waypointId = 0; - portalRespawnTime = 30000; - _canMoveFree = false; - _canLoot = true; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 0c96a982997..4e02b3ad2e8 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -73,15 +73,21 @@ class boss_baltharus_the_warborn : public CreatureScript { boss_baltharus_the_warbornAI(Creature* creature) : BossAI(creature, DATA_BALTHARUS_THE_WARBORN) { + Initialize(); _introDone = false; } + void Initialize() + { + _cloneCount = RAID_MODE(1, 2, 2, 2); + } + void Reset() override { _Reset(); events.SetPhase(PHASE_INTRO); events.ScheduleEvent(EVENT_OOC_CHANNEL, 0, 0, PHASE_INTRO); - _cloneCount = RAID_MODE(1, 2, 2, 2); + Initialize(); instance->SetData(DATA_BALTHARUS_SHARED_HEALTH, me->GetMaxHealth()); } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index b5c20e95278..e41ea8de38b 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -204,12 +204,18 @@ class npc_onyx_flamecaller : public CreatureScript { npc_onyx_flamecallerAI(Creature* creature) : npc_escortAI(creature), _instance(creature->GetInstanceScript()) { + Initialize(); npc_escortAI::SetDespawnAtEnd(false); } - void Reset() override + void Initialize() { _lavaGoutCount = 0; + } + + void Reset() override + { + Initialize(); me->setActive(true); AddWaypoints(); Start(true, true); diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index d08c6f66903..dbf3a185120 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -596,16 +596,22 @@ class npc_halion_controller : public CreatureScript npc_halion_controllerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summons(me) { + Initialize(); me->SetPhaseMask(me->GetPhaseMask() | 0x20, true); } - void Reset() override + void Initialize() { - _summons.DespawnAll(); - _events.Reset(); _materialCorporealityValue = 5; _materialDamageTaken = 0; _twilightDamageTaken = 0; + } + + void Reset() override + { + _summons.DespawnAll(); + _events.Reset(); + Initialize(); DoCast(me, SPELL_CLEAR_DEBUFFS); } @@ -1208,13 +1214,22 @@ class npc_living_ember : public CreatureScript struct npc_living_emberAI : public ScriptedAI { - npc_living_emberAI(Creature* creature) : ScriptedAI(creature) { } + npc_living_emberAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + _enrageTimer = 0; + } - void Reset() override + void Initialize() { _hasEnraged = false; } + void Reset() override + { + Initialize(); + } + void EnterCombat(Unit* /*who*/) override { _enrageTimer = 20000; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp index 28bf3a3d531..be756a8ab36 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/instance_ruby_sanctum.cpp @@ -54,6 +54,7 @@ class instance_ruby_sanctum : public InstanceMapScript BaltharusSharedHealth = 0; FlameWallsGUID = 0; FlameRingGUID = 0; + TwilightFlameRingGUID = 0; memset(ZarithrianSpawnStalkerGUID, 0, 2 * sizeof(uint64)); memset(BurningTreeGUID, 0, 4 * sizeof(uint64)); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp index 7e9e351ae9c..f2d2c3e3d5b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_argent_challenge.cpp @@ -156,11 +156,22 @@ public: { boss_eadricAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); creature->SetReactState(REACT_PASSIVE); creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); } + void Initialize() + { + uiVenganceTimer = 10000; + uiRadianceTimer = 16000; + uiHammerJusticeTimer = 25000; + uiResetTimer = 5000; + + bDone = false; + } + InstanceScript* instance; uint32 uiVenganceTimer; @@ -172,12 +183,7 @@ public: void Reset() override { - uiVenganceTimer = 10000; - uiRadianceTimer = 16000; - uiHammerJusticeTimer = 25000; - uiResetTimer = 5000; - - bDone = false; + Initialize(); } void DamageTaken(Unit* /*done_by*/, uint32 &damage) override @@ -260,6 +266,7 @@ public: { boss_paletressAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); MemoryGUID = 0; @@ -268,6 +275,18 @@ public: creature->RestoreFaction(); } + void Initialize() + { + uiHolyFireTimer = urand(9000, 12000); + uiHolySmiteTimer = urand(5000, 7000); + uiRenewTimer = urand(2000, 5000); + + uiResetTimer = 7000; + + bHealth = false; + bDone = false; + } + InstanceScript* instance; uint64 MemoryGUID; @@ -283,14 +302,7 @@ public: { me->RemoveAllAuras(); - uiHolyFireTimer = urand(9000, 12000); - uiHolySmiteTimer = urand(5000, 7000); - uiRenewTimer = urand(2000, 5000); - - uiResetTimer = 7000; - - bHealth = false; - bDone = false; + Initialize(); if (Creature* pMemory = ObjectAccessor::GetCreature(*me, MemoryGUID)) if (pMemory->IsAlive()) @@ -415,7 +427,17 @@ public: struct npc_memoryAI : public ScriptedAI { - npc_memoryAI(Creature* creature) : ScriptedAI(creature) { } + npc_memoryAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + uiOldWoundsTimer = 12000; + uiShadowPastTimer = 5000; + uiWakingNightmare = 7000; + } uint32 uiOldWoundsTimer; uint32 uiShadowPastTimer; @@ -423,9 +445,7 @@ public: void Reset() override { - uiOldWoundsTimer = 12000; - uiShadowPastTimer = 5000; - uiWakingNightmare = 7000; + Initialize(); } void UpdateAI(uint32 uiDiff) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp index a8aff70b034..e342b3bbfb1 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_black_knight.cpp @@ -83,9 +83,31 @@ public: { boss_black_knightAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + bEventInProgress = false; + bEvent = false; + bSummonArmy = false; + bDeathArmyDone = false; + + uiPhase = PHASE_UNDEAD; + + uiIcyTouchTimer = urand(5000, 9000); + uiPlagueStrikeTimer = urand(10000, 13000); + uiDeathRespiteTimer = urand(15000, 16000); + uiObliterateTimer = urand(17000, 19000); + uiDesecration = urand(15000, 16000); + uiDeathArmyCheckTimer = 7000; + uiResurrectTimer = 4000; + uiGhoulExplodeTimer = 8000; + uiDeathBiteTimer = urand(2000, 4000); + uiMarkedDeathTimer = urand(5000, 7000); + } + InstanceScript* instance; std::list SummonList; @@ -114,23 +136,7 @@ public: me->SetDisplayId(me->GetNativeDisplayId()); me->ClearUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED); - bEventInProgress = false; - bEvent = false; - bSummonArmy = false; - bDeathArmyDone = false; - - uiPhase = PHASE_UNDEAD; - - uiIcyTouchTimer = urand(5000, 9000); - uiPlagueStrikeTimer = urand(10000, 13000); - uiDeathRespiteTimer = urand(15000, 16000); - uiObliterateTimer = urand(17000, 19000); - uiDesecration = urand(15000, 16000); - uiDeathArmyCheckTimer = 7000; - uiResurrectTimer = 4000; - uiGhoulExplodeTimer = 8000; - uiDeathBiteTimer = urand(2000, 4000); - uiMarkedDeathTimer = urand(5000, 7000); + Initialize(); } void RemoveSummons() @@ -310,13 +316,21 @@ public: struct npc_risen_ghoulAI : public ScriptedAI { - npc_risen_ghoulAI(Creature* creature) : ScriptedAI(creature) { } + npc_risen_ghoulAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } + + void Initialize() + { + uiAttackTimer = 3500; + } uint32 uiAttackTimer; void Reset() override { - uiAttackTimer = 3500; + Initialize(); } void UpdateAI(uint32 uiDiff) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp index 7dd935e86f0..027238be6d3 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/boss_grand_champions.cpp @@ -155,12 +155,20 @@ public: { generic_vehicleAI_toc5AI(Creature* creature) : npc_escortAI(creature) { + Initialize(); SetDespawnAtEnd(false); uiWaypointPath = 0; instance = creature->GetInstanceScript(); } + void Initialize() + { + uiChargeTimer = 5000; + uiShieldBreakerTimer = 8000; + uiBuffTimer = urand(30000, 60000); + } + InstanceScript* instance; uint32 uiChargeTimer; @@ -171,9 +179,7 @@ public: void Reset() override { - uiChargeTimer = 5000; - uiShieldBreakerTimer = 8000; - uiBuffTimer = urand(30000, 60000); + Initialize(); } void SetData(uint32 uiType, uint32 /*uiData*/) override @@ -311,6 +317,7 @@ public: { boss_warrior_toc5AI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); bDone = false; @@ -324,6 +331,13 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } + void Initialize() + { + uiBladeStormTimer = urand(15000, 20000); + uiInterceptTimer = 7000; + uiMortalStrikeTimer = urand(8000, 12000); + } + InstanceScript* instance; uint8 uiPhase; @@ -339,9 +353,7 @@ public: void Reset() override { - uiBladeStormTimer = urand(15000, 20000); - uiInterceptTimer = 7000; - uiMortalStrikeTimer = urand(8000, 12000); + Initialize(); } void JustReachedHome() override @@ -443,6 +455,7 @@ public: { boss_mage_toc5AI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); bDone = false; @@ -456,6 +469,14 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } + void Initialize() + { + uiFireBallTimer = 5000; + uiPolymorphTimer = 8000; + uiBlastWaveTimer = 12000; + uiHasteTimer = 22000; + } + InstanceScript* instance; uint8 uiPhase; @@ -471,10 +492,7 @@ public: void Reset() override { - uiFireBallTimer = 5000; - uiPolymorphTimer = 8000; - uiBlastWaveTimer = 12000; - uiHasteTimer = 22000; + Initialize(); } void JustReachedHome() override @@ -580,6 +598,7 @@ public: { boss_shaman_toc5AI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); bDone = false; @@ -593,6 +612,14 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } + void Initialize() + { + uiChainLightningTimer = 16000; + uiHealingWaveTimer = 12000; + uiEartShieldTimer = urand(30000, 35000); + uiHexMendingTimer = urand(20000, 25000); + } + InstanceScript* instance; uint8 uiPhase; @@ -608,10 +635,7 @@ public: void Reset() override { - uiChainLightningTimer = 16000; - uiHealingWaveTimer = 12000; - uiEartShieldTimer = urand(30000, 35000); - uiHexMendingTimer = urand(20000, 25000); + Initialize(); } void EnterCombat(Unit* who) override @@ -725,6 +749,7 @@ public: { boss_hunter_toc5AI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); bDone = false; @@ -738,6 +763,17 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } + void Initialize() + { + uiShootTimer = 12000; + uiMultiShotTimer = 0; + uiLightningArrowsTimer = 7000; + + uiTargetGUID = 0; + + bShoot = false; + } + InstanceScript* instance; uint8 uiPhase; @@ -755,13 +791,7 @@ public: void Reset() override { - uiShootTimer = 12000; - uiMultiShotTimer = 0; - uiLightningArrowsTimer = 7000; - - uiTargetGUID = 0; - - bShoot = false; + Initialize(); } void JustReachedHome() override @@ -879,6 +909,7 @@ public: { boss_rouge_toc5AI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); bDone = false; @@ -892,6 +923,13 @@ public: me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC); } + void Initialize() + { + uiEviscerateTimer = 8000; + uiFanKivesTimer = 14000; + uiPosionBottleTimer = 19000; + } + InstanceScript* instance; uint8 uiPhase; @@ -905,9 +943,7 @@ public: void Reset() override { - uiEviscerateTimer = 8000; - uiFanKivesTimer = 14000; - uiPosionBottleTimer = 19000; + Initialize(); } void JustReachedHome() override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index e0930a1ae2e..e073d08ef1d 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -115,8 +115,6 @@ public: uint64 uiVehicle2GUID; uint64 uiVehicle3GUID; - uint64 uiGrandChampionBoss1; - std::list Champion1List; std::list Champion2List; std::list Champion3List; diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp index 7af55ec37ea..2f29e03a2f2 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp @@ -166,6 +166,13 @@ class boss_anubarak_trial : public CreatureScript { boss_anubarak_trialAI(Creature* creature) : BossAI(creature, BOSS_ANUBARAK) { + Initialize(); + } + + void Initialize() + { + _intro = true; + _reachedPhase3 = false; } void Reset() override @@ -183,8 +190,7 @@ class boss_anubarak_trial : public CreatureScript if (!IsHeroic()) events.ScheduleEvent(EVENT_SUMMON_FROST_SPHERE, 20*IN_MILLISECONDS); - _intro = true; - _reachedPhase3 = false; + Initialize(); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); // clean up spawned Frost Spheres std::list FrostSphereList; @@ -436,13 +442,19 @@ class npc_swarm_scarab : public CreatureScript { npc_swarm_scarabAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); _instance = creature->GetInstanceScript(); } + void Initialize() + { + _determinationTimer = urand(5 * IN_MILLISECONDS, 60 * IN_MILLISECONDS); + } + void Reset() override { me->SetCorpseDelay(0); - _determinationTimer = urand(5*IN_MILLISECONDS, 60*IN_MILLISECONDS); + Initialize(); DoCast(me, SPELL_ACID_MANDIBLE); me->SetInCombatWithZone(); if (me->IsInCombat()) @@ -508,13 +520,19 @@ class npc_nerubian_burrower : public CreatureScript { npc_nerubian_burrowerAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); _instance = creature->GetInstanceScript(); } + void Initialize() + { + _submergeTimer = 30 * IN_MILLISECONDS; + } + void Reset() override { me->SetCorpseDelay(10); - _submergeTimer = 30*IN_MILLISECONDS; + Initialize(); DoCast(me, SPELL_EXPOSE_WEAKNESS); DoCast(me, SPELL_SPIDER_FRENZY); DoCast(me, SPELL_AWAKENED); @@ -669,12 +687,18 @@ class npc_anubarak_spike : public CreatureScript { npc_anubarak_spikeAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); } - void Reset() override + void Initialize() { _phase = PHASE_NO_MOVEMENT; _phaseSwitchTimer = 1; + } + + void Reset() override + { + Initialize(); // make sure the spike has everyone on threat list me->SetInCombatWithZone(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 0a43c01081f..3d59f24b6dd 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -348,10 +348,11 @@ class boss_toc_champion_controller : public CreatureScript { boss_toc_champion_controllerAI(Creature* creature) : ScriptedAI(creature), _summons(me) { + Initialize(); _instance = creature->GetInstanceScript(); } - void Reset() override + void Initialize() { _championsNotStarted = 0; _championsFailed = 0; @@ -359,6 +360,11 @@ class boss_toc_champion_controller : public CreatureScript _inProgress = false; } + void Reset() override + { + Initialize(); + } + std::vector SelectChampions(Team playerTeam) { std::vector vHealersEntries; @@ -1908,7 +1914,17 @@ class npc_toc_enh_shaman : public CreatureScript struct npc_toc_enh_shamanAI : public boss_faction_championsAI { - npc_toc_enh_shamanAI(Creature* creature) : boss_faction_championsAI(creature, AI_MELEE) { } + npc_toc_enh_shamanAI(Creature* creature) : boss_faction_championsAI(creature, AI_MELEE) + { + Initialize(); + } + + void Initialize() + { + _totemCount = 0; + _totemOldCenterX = me->GetPositionX(); + _totemOldCenterY = me->GetPositionY(); + } void Reset() override { @@ -1920,9 +1936,7 @@ class npc_toc_enh_shaman : public CreatureScript events.ScheduleEvent(EVENT_DEPLOY_TOTEM, 1*IN_MILLISECONDS); events.ScheduleEvent(EVENT_WINDFURY, urand(20*IN_MILLISECONDS, 50*IN_MILLISECONDS)); - _totemCount = 0; - _totemOldCenterX = me->GetPositionX(); - _totemOldCenterY = me->GetPositionY(); + Initialize(); SetEquipmentSlots(false, 51803, 48013, EQUIP_NO_CHANGE); summons.DespawnAll(); } @@ -2192,12 +2206,20 @@ class npc_toc_pet_hunter : public CreatureScript struct npc_toc_pet_hunterAI : public boss_faction_championsAI { - npc_toc_pet_hunterAI(Creature* creature) : boss_faction_championsAI(creature, AI_PET) { } + npc_toc_pet_hunterAI(Creature* creature) : boss_faction_championsAI(creature, AI_PET) + { + Initialize(); + } + + void Initialize() + { + _clawTimer = urand(5 * IN_MILLISECONDS, 10 * IN_MILLISECONDS); + } void Reset() override { boss_faction_championsAI::Reset(); - _clawTimer = urand(5*IN_MILLISECONDS, 10*IN_MILLISECONDS); + Initialize(); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp index c0f7b2f1856..a8a370076a8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_lord_jaraxxus.cpp @@ -315,12 +315,18 @@ class npc_fel_infernal : public CreatureScript { npc_fel_infernalAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); _instance = creature->GetInstanceScript(); } + void Initialize() + { + _felStreakTimer = 30 * IN_MILLISECONDS; + } + void Reset() override { - _felStreakTimer = 30*IN_MILLISECONDS; + Initialize(); me->SetInCombatWithZone(); } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 9e75bef9735..f4112b7a43b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -492,6 +492,18 @@ struct boss_jormungarAI : public BossAI { boss_jormungarAI(Creature* creature) : BossAI(creature, BOSS_BEASTS) { + OtherWormEntry = 0; + ModelStationary = 0; + ModelMobile = 0; + + BiteSpell = 0; + SpewSpell = 0; + SpitSpell = 0; + SpraySpell = 0; + + Phase = PHASE_MOBILE; + Enraged = false; + WasMobile = false; } void Reset() override @@ -780,12 +792,18 @@ class npc_slime_pool : public CreatureScript { npc_slime_poolAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); _instance = creature->GetInstanceScript(); } - void Reset() override + void Initialize() { _cast = false; + } + + void Reset() override + { + Initialize(); me->SetReactState(REACT_PASSIVE); } @@ -851,14 +869,11 @@ class boss_icehowl : public CreatureScript { boss_icehowlAI(Creature* creature) : BossAI(creature, BOSS_BEASTS) { + Initialize(); } - void Reset() override + void Initialize() { - events.ScheduleEvent(EVENT_FEROCIOUS_BUTT, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); - events.ScheduleEvent(EVENT_ARCTIC_BREATH, urand(15*IN_MILLISECONDS, 25*IN_MILLISECONDS)); - events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); - events.ScheduleEvent(EVENT_MASSIVE_CRASH, 30*IN_MILLISECONDS); _movementStarted = false; _movementFinish = false; _trampleCast = false; @@ -869,6 +884,15 @@ class boss_icehowl : public CreatureScript _stage = 0; } + void Reset() override + { + events.ScheduleEvent(EVENT_FEROCIOUS_BUTT, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); + events.ScheduleEvent(EVENT_ARCTIC_BREATH, urand(15*IN_MILLISECONDS, 25*IN_MILLISECONDS)); + events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); + events.ScheduleEvent(EVENT_MASSIVE_CRASH, 30*IN_MILLISECONDS); + Initialize(); + } + void JustDied(Unit* /*killer*/) override { _JustDied(); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index 68de65f9f7b..1118c1ec27b 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -143,6 +143,33 @@ struct boss_twin_baseAI : public BossAI { boss_twin_baseAI(Creature* creature) : BossAI(creature, BOSS_VALKIRIES) { + Initialize(); + AuraState = AURA_STATE_NONE; + + Stage = 0; + + Weapon = 0; + + VortexEmote = 0; + SisterNpcId = 0; + MyEmphatySpellId = 0; + OtherEssenceSpellId = 0; + SurgeSpellId = 0; + VortexSpellId = 0; + ShieldSpellId = 0; + TwinPactSpellId = 0; + SpikeSpellId = 0; + TouchSpellId = 0; + } + + void Initialize() + { + IsBerserk = false; + + SpecialAbilityTimer = 1 * MINUTE*IN_MILLISECONDS; + SpikeTimer = 20 * IN_MILLISECONDS; + TouchTimer = urand(10 * IN_MILLISECONDS, 15 * IN_MILLISECONDS); + BerserkTimer = IsHeroic() ? 6 * MINUTE*IN_MILLISECONDS : 10 * MINUTE*IN_MILLISECONDS; } void Reset() override @@ -153,12 +180,7 @@ struct boss_twin_baseAI : public BossAI /* Uncomment this once that they are floating above the ground me->SetLevitate(true); me->SetFlying(true); */ - IsBerserk = false; - - SpecialAbilityTimer = 1*MINUTE*IN_MILLISECONDS; - SpikeTimer = 20*IN_MILLISECONDS; - TouchTimer = urand(10*IN_MILLISECONDS, 15*IN_MILLISECONDS); - BerserkTimer = IsHeroic() ? 6*MINUTE*IN_MILLISECONDS : 10*MINUTE*IN_MILLISECONDS; + Initialize(); summons.DespawnAll(); } @@ -524,6 +546,12 @@ struct npc_unleashed_ballAI : public ScriptedAI { npc_unleashed_ballAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); + } + + void Initialize() + { + RangeCheckTimer = 0.5*IN_MILLISECONDS; } void MoveToNextPoint() @@ -548,7 +576,7 @@ struct npc_unleashed_ballAI : public ScriptedAI me->SetCanFly(true); SetCombatMovement(false); MoveToNextPoint(); - RangeCheckTimer = 0.5*IN_MILLISECONDS; + Initialize(); } void MovementInform(uint32 uiType, uint32 uiId) override diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp index 11548ba4b1c..7829d1be627 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/trial_of_the_crusader.cpp @@ -240,7 +240,6 @@ class boss_lich_king_toc : public CreatureScript void Reset() override { - _updateTimer = 0; me->SetReactState(REACT_PASSIVE); if (Creature* summoned = me->SummonCreature(NPC_TRIGGER, ToCCommonLoc[2].GetPositionX(), ToCCommonLoc[2].GetPositionY(), ToCCommonLoc[2].GetPositionZ(), 5, TEMPSUMMON_TIMED_DESPAWN, 1*MINUTE*IN_MILLISECONDS)) { @@ -278,7 +277,7 @@ class boss_lich_king_toc : public CreatureScript if (_instance->GetData(TYPE_EVENT_NPC) != NPC_LICH_KING) return; - _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); + uint32 _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); if (_updateTimer <= uiDiff) { switch (_instance->GetData(TYPE_EVENT)) @@ -352,7 +351,6 @@ class boss_lich_king_toc : public CreatureScript private: InstanceScript* _instance; - uint32 _updateTimer; }; CreatureAI* GetAI(Creature* creature) const override @@ -370,7 +368,14 @@ class npc_fizzlebang_toc : public CreatureScript { npc_fizzlebang_tocAI(Creature* creature) : ScriptedAI(creature), _summons(me) { + Initialize(); _instance = me->GetInstanceScript(); + _triggerGUID = 0; + } + + void Initialize() + { + _portalGUID = 0; } void JustDied(Unit* killer) override @@ -388,7 +393,7 @@ class npc_fizzlebang_toc : public CreatureScript void Reset() override { me->SetWalk(true); - _portalGUID = 0; + Initialize(); me->GetMotionMaster()->MovePoint(1, ToCCommonLoc[10].GetPositionX(), ToCCommonLoc[10].GetPositionY()-60, ToCCommonLoc[10].GetPositionZ()); } @@ -423,7 +428,7 @@ class npc_fizzlebang_toc : public CreatureScript if (_instance->GetData(TYPE_EVENT_NPC) != NPC_FIZZLEBANG) return; - _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); + uint32 _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); if (_updateTimer <= uiDiff) { switch (_instance->GetData(TYPE_EVENT)) @@ -521,7 +526,6 @@ class npc_fizzlebang_toc : public CreatureScript private: InstanceScript* _instance; SummonList _summons; - uint32 _updateTimer; uint64 _portalGUID; uint64 _triggerGUID; }; @@ -556,7 +560,7 @@ class npc_tirion_toc : public CreatureScript if (_instance->GetData(TYPE_EVENT_NPC) != NPC_TIRION) return; - _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); + uint32 _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); if (_updateTimer <= uiDiff) { switch (_instance->GetData(TYPE_EVENT)) @@ -811,7 +815,6 @@ class npc_tirion_toc : public CreatureScript } private: InstanceScript* _instance; - uint32 _updateTimer; }; CreatureAI* GetAI(Creature* creature) const override @@ -844,7 +847,7 @@ class npc_garrosh_toc : public CreatureScript if (_instance->GetData(TYPE_EVENT_NPC) != NPC_GARROSH) return; - _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); + uint32 _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); if (_updateTimer <= uiDiff) { switch (_instance->GetData(TYPE_EVENT)) @@ -895,7 +898,6 @@ class npc_garrosh_toc : public CreatureScript } private: InstanceScript* _instance; - uint32 _updateTimer; }; CreatureAI* GetAI(Creature* creature) const override @@ -928,7 +930,7 @@ class npc_varian_toc : public CreatureScript if (_instance->GetData(TYPE_EVENT_NPC) != NPC_VARIAN) return; - _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); + uint32 _updateTimer = _instance->GetData(TYPE_EVENT_TIMER); if (_updateTimer <= uiDiff) { switch (_instance->GetData(TYPE_EVENT)) @@ -979,7 +981,6 @@ class npc_varian_toc : public CreatureScript } private: InstanceScript* _instance; - uint32 _updateTimer; }; CreatureAI* GetAI(Creature* creature) const override diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp index a1690598532..694e502e508 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_king_dred.cpp @@ -58,10 +58,19 @@ class boss_king_dred : public CreatureScript struct boss_king_dredAI : public BossAI { - boss_king_dredAI(Creature* creature) : BossAI(creature, DATA_KING_DRED) { } + boss_king_dredAI(Creature* creature) : BossAI(creature, DATA_KING_DRED) + { + Initialize(); + } + + void Initialize() + { + raptorsKilled = 0; + } void Reset() override { + Initialize(); _Reset(); } @@ -166,16 +175,22 @@ class npc_drakkari_gutripper : public CreatureScript { npc_drakkari_gutripperAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = me->GetInstanceScript(); } + void Initialize() + { + GutRipTimer = urand(10000, 15000); + } + InstanceScript* instance; uint32 GutRipTimer; void Reset() override { - GutRipTimer = urand(10000, 15000); + Initialize(); } void UpdateAI(uint32 diff) override @@ -216,16 +231,22 @@ class npc_drakkari_scytheclaw : public CreatureScript { npc_drakkari_scytheclawAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = me->GetInstanceScript(); } + void Initialize() + { + uiRendTimer = urand(10000, 15000); + } + InstanceScript* instance; uint32 uiRendTimer; void Reset() override { - uiRendTimer = urand(10000, 15000); + Initialize(); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 4e9462a447f..6b26143745b 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -80,14 +80,23 @@ public: struct boss_novosAI : public BossAI { - boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS) { } + boss_novosAI(Creature* creature) : BossAI(creature, DATA_NOVOS) + { + Initialize(); + _bubbled = false; + } + + void Initialize() + { + _ohNovos = true; + _crystalHandlerCount = 0; + } void Reset() override { _Reset(); - _ohNovos = true; - _crystalHandlerCount = 0; + Initialize(); SetCrystalsStatus(false); SetSummonerStatus(false); SetBubbled(false); @@ -280,15 +289,23 @@ public: struct npc_crystal_channel_targetAI : public ScriptedAI { - npc_crystal_channel_targetAI(Creature* creature) : ScriptedAI(creature) { } + npc_crystal_channel_targetAI(Creature* creature) : ScriptedAI(creature) + { + Initialize(); + } - void Reset() override + void Initialize() { _spell = 0; _timer = 0; _temp = 0; } + void Reset() override + { + Initialize(); + } + void UpdateAI(uint32 diff) override { if (_spell) diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 13d968d9e06..a8f083c97ee 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -73,12 +73,20 @@ class boss_trollgore : public CreatureScript struct boss_trollgoreAI : public BossAI { - boss_trollgoreAI(Creature* creature) : BossAI(creature, DATA_TROLLGORE) { } + boss_trollgoreAI(Creature* creature) : BossAI(creature, DATA_TROLLGORE) + { + Initialize(); + } + + void Initialize() + { + _consumptionJunction = true; + } void Reset() override { _Reset(); - _consumptionJunction = true; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp index fe98f005bca..670591a058c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_bronjahm.cpp @@ -71,14 +71,6 @@ class boss_bronjahm : public CreatureScript DoCast(me, SPELL_SOULSTORM_CHANNEL, true); } - void InitializeAI() override - { - if (!instance || static_cast(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(FoSScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); - } - void Reset() override { events.Reset(); @@ -188,7 +180,7 @@ class boss_bronjahm : public CreatureScript CreatureAI* GetAI(Creature* creature) const override { - return GetInstanceAI(creature); + return GetInstanceAI(creature, FoSScriptName); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index a048abd6554..4b4fd398e72 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -130,14 +130,15 @@ class boss_devourer_of_souls : public CreatureScript { boss_devourer_of_soulsAI(Creature* creature) : BossAI(creature, DATA_DEVOURER_EVENT) { + Initialize(); + beamAngle = 0.f; + beamAngleDiff = 0.f; + wailingSoulTick = 0; } - void InitializeAI() override + void Initialize() { - if (!instance || static_cast(me->GetMap())->GetScriptId() != sObjectMgr->GetScriptId(FoSScriptName)) - me->IsAIEnabled = false; - else if (!me->isDead()) - Reset(); + threeFaced = true; } void Reset() override @@ -149,7 +150,7 @@ class boss_devourer_of_souls : public CreatureScript events.Reset(); summons.DespawnAll(); - threeFaced = true; + Initialize(); instance->SetData(DATA_DEVOURER_EVENT, NOT_STARTED); } @@ -345,7 +346,7 @@ class boss_devourer_of_souls : public CreatureScript CreatureAI* GetAI(Creature* creature) const override { - return GetInstanceAI(creature); + return GetInstanceAI(creature, FoSScriptName); } }; diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp index fc9a786aab9..7a36dfe7fae 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/forge_of_souls.cpp @@ -80,10 +80,16 @@ public: { npc_sylvanas_fosAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = me->GetInstanceScript(); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } + void Initialize() + { + phase = PHASE_NORMAL; + } + InstanceScript* instance; EventMap events; @@ -92,7 +98,7 @@ public: void Reset() override { events.Reset(); - phase = PHASE_NORMAL; + Initialize(); } void DoAction(int32 actionId) override @@ -203,10 +209,16 @@ public: { npc_jaina_fosAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = me->GetInstanceScript(); me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); } + void Initialize() + { + phase = PHASE_NORMAL; + } + InstanceScript* instance; EventMap events; @@ -215,7 +227,7 @@ public: void Reset() override { events.Reset(); - phase = PHASE_NORMAL; + Initialize(); } void DoAction(int32 actionId) override diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp index a5577b6a0ea..a014be4369e 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/boss_falric.cpp @@ -55,12 +55,20 @@ class boss_falric : public CreatureScript struct boss_falricAI : public boss_horAI { - boss_falricAI(Creature* creature) : boss_horAI(creature, DATA_FALRIC) { } + boss_falricAI(Creature* creature) : boss_horAI(creature, DATA_FALRIC) + { + Initialize(); + } + + void Initialize() + { + _hopelessnessCount = 0; + } void Reset() override { boss_horAI::Reset(); - _hopelessnessCount = 0; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 783f9e245c8..62a6ac41074 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -82,14 +82,22 @@ class boss_garfrost : public CreatureScript struct boss_garfrostAI : public BossAI { - boss_garfrostAI(Creature* creature) : BossAI(creature, DATA_GARFROST) { } + boss_garfrostAI(Creature* creature) : BossAI(creature, DATA_GARFROST) + { + Initialize(); + } + + void Initialize() + { + _permafrostStack = 0; + } void Reset() override { _Reset(); events.SetPhase(PHASE_ONE); SetEquipmentSlots(true); - _permafrostStack = 0; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 3f8e1cc6ee0..5b147344a59 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -140,6 +140,7 @@ class boss_ick : public CreatureScript boss_ickAI(Creature* creature) : BossAI(creature, DATA_ICK), _vehicle(creature->GetVehicleKit()) { ASSERT(_vehicle); + _tempThreat = 0; } void Reset() override @@ -286,14 +287,20 @@ class boss_krick : public CreatureScript { boss_krickAI(Creature* creature) : ScriptedAI(creature), _instanceScript(creature->GetInstanceScript()), _summons(creature) { + Initialize(); } - void Reset() override + void Initialize() { - _events.Reset(); _phase = PHASE_COMBAT; _outroNpcGUID = 0; _tyrannusGUID = 0; + } + + void Reset() override + { + _events.Reset(); + Initialize(); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp index c4f46136bd9..f392b21b173 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_scourgelord_tyrannus.cpp @@ -293,14 +293,20 @@ class boss_rimefang : public CreatureScript boss_rimefangAI(Creature* creature) : ScriptedAI(creature), _vehicle(creature->GetVehicleKit()) { ASSERT(_vehicle); + Initialize(); + } + + void Initialize() + { + _currentWaypoint = 0; + _hoarfrostTargetGUID = 0; } void Reset() override { _events.Reset(); _events.SetPhase(PHASE_NONE); - _currentWaypoint = 0; - _hoarfrostTargetGUID = 0; + Initialize(); me->SetCanFly(true); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp index 9b9376c34f2..d829b98f926 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/instance_pit_of_saron.cpp @@ -52,6 +52,7 @@ class instance_pit_of_saron : public InstanceMapScript _jainaOrSylvanas1GUID = 0; _jainaOrSylvanas2GUID = 0; _teamInInstance = 0; + _tyrannusEventGUID = 0; } void OnPlayerEnter(Player* player) override diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp index 7bd9325dd97..4d2ebd44db8 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/pit_of_saron.cpp @@ -113,13 +113,19 @@ class npc_iceborn_protodrake : public CreatureScript npc_iceborn_protodrakeAI(Creature* creature) : ScriptedAI(creature), _vehicle(creature->GetVehicleKit()) { ASSERT(_vehicle); + Initialize(); } - void Reset() override + void Initialize() { _frostBreathCooldown = 5000; } + void Reset() override + { + Initialize(); + } + void EnterCombat(Unit* /*who*/) override { _vehicle->RemoveAllPassengers(); @@ -161,13 +167,19 @@ class npc_geist_ambusher : public CreatureScript { npc_geist_ambusherAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); } - void Reset() override + void Initialize() { _leapingFaceMaulCooldown = 9000; } + void Reset() override + { + Initialize(); + } + void EnterCombat(Unit* who) override { if (who->GetTypeId() != TYPEID_PLAYER) diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index 68929d2aa01..001f19679c4 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -82,14 +82,14 @@ class boss_drakkari_colossus : public CreatureScript { boss_drakkari_colossusAI(Creature* creature) : BossAI(creature, DATA_DRAKKARI_COLOSSUS_EVENT) { + Initialize(); me->SetReactState(REACT_PASSIVE); introDone = false; } - void InitializeAI() override + void Initialize() { - if (!me->isDead()) - Reset(); + phase = COLOSSUS_PHASE_NORMAL; } void Reset() override @@ -106,7 +106,7 @@ class boss_drakkari_colossus : public CreatureScript //events.Reset(); -> done in _Reset(); events.ScheduleEvent(EVENT_MIGHTY_BLOW, urand(10000, 30000)); - phase = COLOSSUS_PHASE_NORMAL; + Initialize(); // Note: This should not be called, but before use SetBossState function we should use BossAI // in all the bosses of the instance @@ -393,13 +393,19 @@ public: { npc_living_mojoAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + mojoWaveTimer = 2 * IN_MILLISECONDS; + mojoPuddleTimer = 7 * IN_MILLISECONDS; + } + void Reset() override { - mojoWaveTimer = 2*IN_MILLISECONDS; - mojoPuddleTimer = 7*IN_MILLISECONDS; + Initialize(); } void MoveMojos(Creature* boss) diff --git a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp index 8e0ff54e161..0783a79b381 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_eck.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_eck.cpp @@ -44,9 +44,20 @@ public: { boss_eckAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + uiBerserkTimer = urand(60 * IN_MILLISECONDS, 90 * IN_MILLISECONDS); //60-90 secs according to wowwiki + uiBiteTimer = 5 * IN_MILLISECONDS; + uiSpitTimer = 10 * IN_MILLISECONDS; + uiSpringTimer = 8 * IN_MILLISECONDS; + + bBerserk = false; + } + uint32 uiBerserkTimer; uint32 uiBiteTimer; uint32 uiSpitTimer; @@ -58,12 +69,7 @@ public: void Reset() override { - uiBerserkTimer = urand(60*IN_MILLISECONDS, 90*IN_MILLISECONDS); //60-90 secs according to wowwiki - uiBiteTimer = 5*IN_MILLISECONDS; - uiSpitTimer = 10*IN_MILLISECONDS; - uiSpringTimer = 8*IN_MILLISECONDS; - - bBerserk = false; + Initialize(); instance->SetData(DATA_ECK_THE_FEROCIOUS_EVENT, NOT_STARTED); } diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index f1c246dbbea..22e7ac280fd 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -77,9 +77,26 @@ public: { boss_gal_darahAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + uiStampedeTimer = 10 * IN_MILLISECONDS; + uiWhirlingSlashTimer = 21 * IN_MILLISECONDS; + uiPunctureTimer = 10 * IN_MILLISECONDS; + uiEnrageTimer = 15 * IN_MILLISECONDS; + uiImpalingChargeTimer = 21 * IN_MILLISECONDS; + uiStompTimer = 25 * IN_MILLISECONDS; + uiTransformationTimer = 9 * IN_MILLISECONDS; + uiPhaseCounter = 0; + + shareTheLove = 0; + bStartOfTransformation = true; + Phase = TROLL; + } + uint32 uiStampedeTimer; uint32 uiWhirlingSlashTimer; uint32 uiPunctureTimer; @@ -100,21 +117,9 @@ public: void Reset() override { - uiStampedeTimer = 10*IN_MILLISECONDS; - uiWhirlingSlashTimer = 21*IN_MILLISECONDS; - uiPunctureTimer = 10*IN_MILLISECONDS; - uiEnrageTimer = 15*IN_MILLISECONDS; - uiImpalingChargeTimer = 21*IN_MILLISECONDS; - uiStompTimer = 25*IN_MILLISECONDS; - uiTransformationTimer = 9*IN_MILLISECONDS; - uiPhaseCounter = 0; + Initialize(); impaledList.clear(); - shareTheLove = 0; - - bStartOfTransformation = true; - - Phase = TROLL; me->SetDisplayId(DISPLAY_TROLL); diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp index 7645d984aac..255a5ece261 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp @@ -61,9 +61,19 @@ public: { boss_moorabiAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + uiGroundTremorTimer = 18 * IN_MILLISECONDS; + uiNumblingShoutTimer = 10 * IN_MILLISECONDS; + uiDeterminedStabTimer = 20 * IN_MILLISECONDS; + uiTransformationTImer = 12 * IN_MILLISECONDS; + bPhase = false; + } + InstanceScript* instance; bool bPhase; @@ -75,11 +85,7 @@ public: void Reset() override { - uiGroundTremorTimer = 18*IN_MILLISECONDS; - uiNumblingShoutTimer = 10*IN_MILLISECONDS; - uiDeterminedStabTimer = 20*IN_MILLISECONDS; - uiTransformationTImer = 12*IN_MILLISECONDS; - bPhase = false; + Initialize(); instance->SetData(DATA_MOORABI_EVENT, NOT_STARTED); } diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 98c8481b5ae..5db49415604 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -83,9 +83,19 @@ public: { boss_slad_ranAI(Creature* creature) : ScriptedAI(creature), lSummons(me) { + Initialize(); instance = creature->GetInstanceScript(); } + void Initialize() + { + uiPoisonNovaTimer = 10 * IN_MILLISECONDS; + uiPowerfullBiteTimer = 3 * IN_MILLISECONDS; + uiVenomBoltTimer = 15 * IN_MILLISECONDS; + uiSpawnTimer = 5 * IN_MILLISECONDS; + uiPhase = 0; + } + uint32 uiPoisonNovaTimer; uint32 uiPowerfullBiteTimer; uint32 uiVenomBoltTimer; @@ -100,11 +110,7 @@ public: void Reset() override { - uiPoisonNovaTimer = 10*IN_MILLISECONDS; - uiPowerfullBiteTimer = 3*IN_MILLISECONDS; - uiVenomBoltTimer = 15*IN_MILLISECONDS; - uiSpawnTimer = 5*IN_MILLISECONDS; - uiPhase = 0; + Initialize(); lWrappedPlayers.clear(); lSummons.DespawnAll(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp index a9088207ebe..3aebed81f0b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_prince_council.cpp @@ -182,14 +182,20 @@ class boss_blood_council_controller : public CreatureScript { boss_blood_council_controllerAI(Creature* creature) : BossAI(creature, DATA_BLOOD_PRINCE_COUNCIL) { + Initialize(); + } + + void Initialize() + { + _invocationStage = 0; + _resetCounter = 0; } void Reset() override { events.Reset(); me->SetReactState(REACT_PASSIVE); - _invocationStage = 0; - _resetCounter = 0; + Initialize(); instance->SetBossState(DATA_BLOOD_PRINCE_COUNCIL, NOT_STARTED); } @@ -1142,6 +1148,7 @@ class npc_ball_of_flame : public CreatureScript npc_ball_of_flameAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { _despawnTimer = 0; + _chaseGUID = 0; } void Reset() override @@ -1224,7 +1231,12 @@ class npc_kinetic_bomb : public CreatureScript struct npc_kinetic_bombAI : public ScriptedAI { - npc_kinetic_bombAI(Creature* creature) : ScriptedAI(creature) { } + npc_kinetic_bombAI(Creature* creature) : ScriptedAI(creature) + { + _x = 0.f; + _y = 0.f; + _groundZ = 0.f; + } void Reset() override { diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index 104a8357917..29d50f1db2a 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -143,6 +143,14 @@ class boss_blood_queen_lana_thel : public CreatureScript { boss_blood_queen_lana_thelAI(Creature* creature) : BossAI(creature, DATA_BLOOD_QUEEN_LANA_THEL) { + Initialize(); + } + + void Initialize() + { + _offtankGUID = 0; + _creditBloodQuickening = false; + _killMinchar = false; } void Reset() override @@ -157,10 +165,8 @@ class boss_blood_queen_lana_thel : public CreatureScript events.ScheduleEvent(EVENT_TWILIGHT_BLOODBOLT, urand(20000, 25000), EVENT_GROUP_NORMAL); events.ScheduleEvent(EVENT_AIR_PHASE, 124000 + uint32(Is25ManRaid() ? 3000 : 0)); CleanAuras(); - _offtankGUID = 0; _vampires.clear(); - _creditBloodQuickening = false; - _killMinchar = false; + Initialize(); } void EnterCombat(Unit* who) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp index 5ef84c7bb40..4b9308fc12d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_deathbringer_saurfang.cpp @@ -249,18 +249,24 @@ class boss_deathbringer_saurfang : public CreatureScript { boss_deathbringer_saurfangAI(Creature* creature) : BossAI(creature, DATA_DEATHBRINGER_SAURFANG) { + Initialize(); ASSERT(creature->GetVehicleKit()); // we dont actually use it, just check if exists _introDone = false; _fallenChampionCastCount = 0; } + void Initialize() + { + _frenzied = false; + _dead = false; + } + void Reset() override { _Reset(); me->SetReactState(REACT_DEFENSIVE); events.SetPhase(PHASE_COMBAT); - _frenzied = false; - _dead = false; + Initialize(); me->SetPower(POWER_ENERGY, 0); DoCast(me, SPELL_ZERO_POWER, true); DoCast(me, SPELL_BLOOD_LINK, true); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index d59e723d070..bbdca1fa8c5 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -218,6 +218,14 @@ class boss_lady_deathwhisper : public CreatureScript boss_lady_deathwhisperAI(Creature* creature) : BossAI(creature, DATA_LADY_DEATHWHISPER), _dominateMindCount(RAID_MODE(0, 1, 1, 3)), _introDone(false) { + Initialize(); + } + + void Initialize() + { + _waveCounter = 0; + _nextVengefulShadeTargetGUID = 0; + _darnavanGUID = 0; } void Reset() override @@ -225,9 +233,7 @@ class boss_lady_deathwhisper : public CreatureScript _Reset(); me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)); events.SetPhase(PHASE_ONE); - _waveCounter = 0; - _nextVengefulShadeTargetGUID = 0; - _darnavanGUID = 0; + Initialize(); DoCast(me, SPELL_SHADOW_CHANNELING); me->RemoveAurasDueToSpell(SPELL_BERSERK); me->RemoveAurasDueToSpell(SPELL_MANA_BARRIER); @@ -837,6 +843,13 @@ class npc_darnavan : public CreatureScript { npc_darnavanAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); + } + + void Initialize() + { + _canCharge = true; + _canShatter = true; } void Reset() override @@ -846,8 +859,7 @@ class npc_darnavan : public CreatureScript _events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, urand(20000, 25000)); _events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, urand(25000, 30000)); _events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, urand(5000, 8000)); - _canCharge = true; - _canShatter = true; + Initialize(); } void JustDied(Unit* killer) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 9d24ad062df..b7bf27177ea 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -133,6 +133,7 @@ class boss_lord_marrowgar : public CreatureScript _coldflameLastPos.Relocate(creature); _introDone = false; _boneSlice = false; + _coldflameTarget = 0; } void Reset() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 11f20129b3e..c1a13c90780 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -223,6 +223,7 @@ class boss_professor_putricide : public CreatureScript _baseSpeed(creature->GetSpeedRate(MOVE_RUN)), _experimentState(EXPERIMENT_STATE_OOZE) { _phase = PHASE_NONE; + _oozeFloodStage = 0; } void Reset() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 76c5a93f9c5..3b65c10aaa9 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -221,6 +221,14 @@ class boss_sindragosa : public CreatureScript { boss_sindragosaAI(Creature* creature) : BossAI(creature, DATA_SINDRAGOSA), _summoned(false) { + Initialize(); + } + + void Initialize() + { + _mysticBuffetStack = 0; + _isInAirPhase = false; + _isThirdPhase = false; } void Reset() override @@ -235,9 +243,7 @@ class boss_sindragosa : public CreatureScript events.ScheduleEvent(EVENT_UNCHAINED_MAGIC, urand(9000, 14000), EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_ICY_GRIP, 33500, EVENT_GROUP_LAND_PHASE); events.ScheduleEvent(EVENT_AIR_PHASE, 50000); - _mysticBuffetStack = 0; - _isInAirPhase = false; - _isThirdPhase = false; + Initialize(); if (!_summoned) { @@ -558,6 +564,7 @@ class npc_ice_tomb : public CreatureScript npc_ice_tombAI(Creature* creature) : ScriptedAI(creature) { _trappedPlayerGUID = 0; + _existenceCheckTimer = 0; SetCombatMovement(false); } @@ -765,6 +772,12 @@ class npc_rimefang : public CreatureScript { npc_rimefangAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _summoned(false) { + Initialize(); + } + + void Initialize() + { + _icyBlastCounter = 0; } void InitializeAI() override @@ -783,7 +796,7 @@ class npc_rimefang : public CreatureScript _events.ScheduleEvent(EVENT_FROST_BREATH_RIMEFANG, urand(12000, 15000)); _events.ScheduleEvent(EVENT_ICY_BLAST, urand(30000, 35000)); me->SetReactState(REACT_DEFENSIVE); - _icyBlastCounter = 0; + Initialize(); if (!_summoned) { @@ -922,7 +935,14 @@ class npc_sindragosa_trash : public CreatureScript { npc_sindragosa_trashAI(Creature* creature) : ScriptedAI(creature) { + Initialize(); _instance = creature->GetInstanceScript(); + _frostwyrmId = 0; + } + + void Initialize() + { + _isTaunted = false; } void InitializeAI() override @@ -946,7 +966,7 @@ class npc_sindragosa_trash : public CreatureScript _events.ScheduleEvent(EVENT_CONCUSSIVE_SHOCK, urand(8000, 10000)); } - _isTaunted = false; + Initialize(); } void JustRespawned() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index b72b953efb4..e2fe441dae2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -504,6 +504,13 @@ class boss_the_lich_king : public CreatureScript { boss_the_lich_kingAI(Creature* creature) : BossAI(creature, DATA_THE_LICH_KING) { + Initialize(); + } + + void Initialize() + { + _necroticPlagueStack = 0; + _vileSpiritExplosions = 0; } void Reset() override @@ -511,8 +518,7 @@ class boss_the_lich_king : public CreatureScript _Reset(); me->SetReactState(REACT_PASSIVE); events.SetPhase(PHASE_INTRO); - _necroticPlagueStack = 0; - _vileSpiritExplosions = 0; + Initialize(); SetEquipmentSlots(true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp index 0c504842c08..2d58a6eeb26 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_valithria_dreamwalker.cpp @@ -282,6 +282,17 @@ class boss_valithria_dreamwalker : public CreatureScript boss_valithria_dreamwalkerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _portalCount(RAID_MODE(3, 8, 3, 8)) { + Initialize(); + _spawnHealth = me->GetHealth(); + } + + void Initialize() + { + _missedPortals = 0; + _under25PercentTalkDone = false; + _over75PercentTalkDone = false; + _justDied = false; + _done = false; } void InitializeAI() override @@ -305,11 +316,7 @@ class boss_valithria_dreamwalker : public CreatureScript // Glyph of Dispel Magic - not a percent heal by effect, its cast with custom basepoints me->ApplySpellImmune(0, IMMUNITY_ID, 56131, true); _instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me); - _missedPortals = 0; - _under25PercentTalkDone = false; - _over75PercentTalkDone = false; - _justDied = false; - _done = false; + Initialize(); } void AttackStart(Unit* /*target*/) override @@ -680,6 +687,12 @@ class npc_risen_archmage : public CreatureScript npc_risen_archmageAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { + Initialize(); + } + + void Initialize() + { + _canCallEnterCombat = true; } bool CanAIAttack(Unit const* target) const override @@ -693,7 +706,7 @@ class npc_risen_archmage : public CreatureScript _events.ScheduleEvent(EVENT_FROSTBOLT_VOLLEY, urand(5000, 15000)); _events.ScheduleEvent(EVENT_MANA_VOID, urand(20000, 25000)); _events.ScheduleEvent(EVENT_COLUMN_OF_FROST, urand(10000, 20000)); - _canCallEnterCombat = true; + Initialize(); } void EnterCombat(Unit* /*target*/) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index e85ddc21dda..e403e37835c 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -385,17 +385,23 @@ class npc_highlord_tirion_fordring_lh : public CreatureScript { npc_highlord_tirion_fordringAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { + Initialize(); } - void Reset() override + void Initialize() { - _events.Reset(); _theLichKing = 0; _bolvarFordragon = 0; _factionNPC = 0; _damnedKills = 0; } + void Reset() override + { + _events.Reset(); + Initialize(); + } + // IMPORTANT NOTE: This is triggered from per-GUID scripts // of The Damned SAI void SetData(uint32 type, uint32 data) override @@ -939,11 +945,18 @@ class npc_crok_scourgebane : public CreatureScript _instance(creature->GetInstanceScript()), _respawnTime(creature->GetRespawnDelay()), _corpseDelay(creature->GetCorpseDelay()) { + Initialize(); SetDespawnAtEnd(false); SetDespawnAtFar(false); _isEventActive = false; _isEventDone = _instance->GetBossState(DATA_SISTER_SVALNA) == DONE; + _currentWPid = 0; + } + + void Initialize() + { _didUnderTenPercentText = false; + _wipeCheckTimer = 1000; } void Reset() override @@ -952,8 +965,7 @@ class npc_crok_scourgebane : public CreatureScript _events.ScheduleEvent(EVENT_SCOURGE_STRIKE, urand(7500, 12500)); _events.ScheduleEvent(EVENT_DEATH_STRIKE, urand(25000, 30000)); me->SetReactState(REACT_DEFENSIVE); - _didUnderTenPercentText = false; - _wipeCheckTimer = 1000; + Initialize(); } void DoAction(int32 action) override @@ -1647,12 +1659,18 @@ class npc_impaling_spear : public CreatureScript { npc_impaling_spearAI(Creature* creature) : CreatureAI(creature) { + Initialize(); + } + + void Initialize() + { + _vehicleCheckTimer = 500; } void Reset() override { me->SetReactState(REACT_PASSIVE); - _vehicleCheckTimer = 500; + Initialize(); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp index 64e1d788695..f5f59e5d1fe 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/instance_icecrown_citadel.cpp @@ -174,6 +174,9 @@ class instance_icecrown_citadel : public InstanceMapScript UpperSpireTeleporterActiveState = NOT_STARTED; BloodQuickeningState = NOT_STARTED; BloodQuickeningMinutes = 0; + FrozenBolvarGUID = 0; + PillarsChainedGUID = 0; + PillarsUnchainedGUID = 0; } // A function to help reduce the number of lines for teleporter management. diff --git a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp index 676e4134f11..35402771494 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_anubrekhan.cpp @@ -62,7 +62,15 @@ public: struct boss_anubrekhanAI : public BossAI { - boss_anubrekhanAI(Creature* creature) : BossAI(creature, BOSS_ANUBREKHAN) { } + boss_anubrekhanAI(Creature* creature) : BossAI(creature, BOSS_ANUBREKHAN) + { + Initialize(); + } + + void Initialize() + { + hasTaunted = false; + } bool hasTaunted; @@ -70,7 +78,7 @@ public: { _Reset(); - hasTaunted = false; + Initialize(); if (GetDifficulty() == RAID_DIFFICULTY_25MAN_NORMAL) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp index e2ff68ab851..a8de1418cc4 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_four_horsemen.cpp @@ -96,12 +96,25 @@ public: { boss_four_horsemenAI(Creature* creature) : BossAI(creature, BOSS_HORSEMEN) { + Initialize(); id = Horsemen(0); for (uint8 i = 0; i < 4; ++i) if (me->GetEntry() == NPC_HORSEMEN[i]) id = Horsemen(i); caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR); + } + + void Initialize() + { + uiEventStarterGUID = 0; + nextWP = 0; + punishTimer = 2000; + nextMovementStarted = false; + movementCompleted = false; + movementStarted = false; + encounterActionAttack = false; encounterActionReset = false; + doDelayPunish = false; } Horsemen id; @@ -124,15 +137,7 @@ public: instance->SetData(DATA_HORSEMEN0 + id, NOT_STARTED); me->SetReactState(REACT_AGGRESSIVE); - uiEventStarterGUID = 0; - nextWP = 0; - punishTimer = 2000; - nextMovementStarted = false; - movementCompleted = false; - movementStarted = false; - encounterActionAttack = false; - encounterActionReset = false; - doDelayPunish = false; + Initialize(); _Reset(); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp index 648fc3c87d2..de9d85db70b 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_gothik.cpp @@ -162,7 +162,18 @@ class boss_gothik : public CreatureScript struct boss_gothikAI : public BossAI { - boss_gothikAI(Creature* creature) : BossAI(creature, BOSS_GOTHIK) { } + boss_gothikAI(Creature* creature) : BossAI(creature, BOSS_GOTHIK) + { + Initialize(); + waveCount = 0; + } + + void Initialize() + { + mergedSides = false; + phaseTwo = false; + thirtyPercentReached = false; + } uint32 waveCount; typedef std::vector TriggerVct; @@ -182,9 +193,7 @@ class boss_gothik : public CreatureScript me->SetReactState(REACT_PASSIVE); instance->SetData(DATA_GOTHIK_GATE, GO_STATE_ACTIVE); _Reset(); - mergedSides = false; - phaseTwo = false; - thirtyPercentReached = false; + Initialize(); } void EnterCombat(Unit* /*who*/) override diff --git a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp index 648da29ca66..2d0e8a6d2b2 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_heigan.cpp @@ -66,7 +66,13 @@ public: struct boss_heiganAI : public BossAI { - boss_heiganAI(Creature* creature) : BossAI(creature, BOSS_HEIGAN) { } + boss_heiganAI(Creature* creature) : BossAI(creature, BOSS_HEIGAN) + { + eruptSection = 0; + eruptDirection = false; + safetyDance = false; + phase = PHASE_FIGHT; + } uint32 eruptSection; bool eruptDirection; diff --git a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp index 61ee650b37a..1c4320fd48b 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_kelthuzad.cpp @@ -263,9 +263,20 @@ public: { boss_kelthuzadAI(Creature* creature) : BossAI(creature, BOSS_KELTHUZAD), spawns(creature) { + Initialize(); uiFaction = me->getFaction(); } + void Initialize() + { + nGuardiansOfIcecrownCount = 0; + uiGuardiansOfIcecrownTimer = 5000; // 5 seconds for summoning each Guardian of Icecrown in phase 3 + + Phase = 0; + nAbomination = 0; + nWeaver = 0; + } + uint32 Phase; uint32 uiGuardiansOfIcecrownTimer; uint32 uiFaction; @@ -315,12 +326,7 @@ public: portal->ResetDoorOrButton(); } - nGuardiansOfIcecrownCount = 0; - uiGuardiansOfIcecrownTimer = 5000; // 5 seconds for summoning each Guardian of Icecrown in phase 3 - - Phase = 0; - nAbomination = 0; - nWeaver = 0; + Initialize(); } void KilledUnit(Unit* /*victim*/) override diff --git a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp index 9987802a165..736941949d1 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_loatheb.cpp @@ -60,15 +60,21 @@ class boss_loatheb : public CreatureScript { boss_loathebAI(Creature* creature) : BossAI(creature, BOSS_LOATHEB) { + Initialize(); } - void Reset() override + void Initialize() { - _Reset(); _doomCounter = 0; _sporeLoserData = true; } + void Reset() override + { + _Reset(); + Initialize(); + } + void EnterCombat(Unit* /*who*/) override { _EnterCombat(); diff --git a/src/tools/vmap4_extractor/model.cpp b/src/tools/vmap4_extractor/model.cpp index 519f59cb086..64b2923b345 100644 --- a/src/tools/vmap4_extractor/model.cpp +++ b/src/tools/vmap4_extractor/model.cpp @@ -143,7 +143,7 @@ Vec3D fixCoordSystem2(Vec3D v) } ModelInstance::ModelInstance(MPQFile& f, char const* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile) - : scale(0), flags(0) + : id(0), scale(0), flags(0) { float ff[3]; f.read(&id, 4); -- cgit v1.2.3