diff --git a/data/sql/updates/pending_db_world/rev_1587680634936830200.sql b/data/sql/updates/pending_db_world/rev_1587680634936830200.sql new file mode 100644 index 000000000..5d30ed04b --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1587680634936830200.sql @@ -0,0 +1,6 @@ +INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1587680634936830200'); + +DELETE FROM `creature_template` WHERE `entry`=38440; +INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `DamageModifier`, `BaseAttackTime`, `RangeAttackTime`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) +VALUES (38440, 0, 0, 0, 0, 0, 1126, 14501, 0, 0, 'Toravon Whiteout Ground Effect', '', '', 0, 1, 1, 0, 35, 0, 1, 1.14286, 0.3, 0, 0, 0, 0, 0, 1, 2000, 2000, 1, 0, 2048, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 1, 1, 1, 1, 0, 0, 1, 0, 128, '', 12340); + diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp index b53d9d32e..05d558b7d 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_toravon.cpp @@ -12,10 +12,11 @@ enum Spells { // Toravon - SPELL_FREEZING_GROUND = 72090, - SPELL_FROZEN_ORB = 72091, - SPELL_WHITEOUT = 72034, - SPELL_FROZEN_MALLET = 71993, + SPELL_FREEZING_GROUND = 72090, + SPELL_FROZEN_ORB = 72091, + SPELL_WHITEOUT = 72034, + SPELL_WHITEOUT_VISUAL = 72036, + SPELL_FROZEN_MALLET = 71993, // Frozen Orb SPELL_FROZEN_ORB_DMG = 72081, // priodic dmg aura @@ -23,13 +24,19 @@ enum Spells // Frozen Orb Stalker SPELL_FROZEN_ORB_STALKER_VISUAL = 72094, + + // Whiteout GroundEffect NPC + NPC_WHITEOUT_GROUND_EFFECT = 38440, }; enum Events { EVENT_FREEZING_GROUND = 1, EVENT_FROZEN_ORB_STALKER = 2, - EVENT_CHECK_SUMMONS = 3, + EVENT_CAST_WHITEOUT = 3, + EVENT_CAST_WHITEOUT_GROUND_EFFECT = 4, + + }; enum Misc @@ -41,122 +48,114 @@ enum Misc class boss_toravon : public CreatureScript { - public: - boss_toravon() : CreatureScript("boss_toravon") { } +public: + boss_toravon() : CreatureScript("boss_toravon") { } - struct boss_toravonAI : public ScriptedAI + struct boss_toravonAI : public ScriptedAI + { + boss_toravonAI(Creature* creature) : ScriptedAI(creature), summons(me) { - boss_toravonAI(Creature* creature) : ScriptedAI(creature), summons(me) - { - pInstance = me->GetInstanceScript(); - } - - InstanceScript* pInstance; - EventMap events; - SummonList summons; - - void Reset() - { - events.Reset(); - summons.DespawnAll(); - if (pInstance) - { - if (pInstance->GetData(DATA_STONED)) - { - if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me)) - { - aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS); - aur->SetDuration(60 * MINUTE* IN_MILLISECONDS); - } - } - pInstance->SetData(EVENT_TORAVON, NOT_STARTED); - } - } - - void AttackStart(Unit* who) - { - if (me->HasAura(SPELL_STONED_AURA)) - return; - - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit* /*who*/) - { - me->CastSpell(me, SPELL_FROZEN_MALLET, true); - - events.ScheduleEvent(EVENT_FROZEN_ORB_STALKER, 12000); - events.ScheduleEvent(EVENT_FREEZING_GROUND, 7000); - if (pInstance) - pInstance->SetData(EVENT_TORAVON, IN_PROGRESS); - } - - void JustDied(Unit* ) - { - if (pInstance) - { - pInstance->SetData(EVENT_TORAVON, DONE); - pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_WHITEOUT); - } - } - - void JustSummoned(Creature* cr) - { - summons.Summon(cr); - } - - void UpdateAI(uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - switch (events.GetEvent()) - { - case EVENT_FREEZING_GROUND: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) - me->CastSpell(target, SPELL_FREEZING_GROUND, false); - events.RepeatEvent(20000); - break; - case EVENT_FROZEN_ORB_STALKER: - me->CastCustomSpell(SPELL_FROZEN_ORB, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3), me, false); - events.RepeatEvent(35000); - events.ScheduleEvent(EVENT_CHECK_SUMMONS, 10000); - break; - case EVENT_CHECK_SUMMONS: - for (SummonList::iterator i = summons.begin(); i != summons.end();) - { - if (Creature* cr = ObjectAccessor::GetCreature(*me, *i)) - { - if (!cr->IsAlive()) - summons.erase(i++); - else - ++i; - } - else - summons.erase(i++); - } - if (summons.empty()) - { - events.PopEvent(); - me->CastSpell(me, SPELL_WHITEOUT, false); - break; - } - events.RepeatEvent(2000); - break; - } - - DoMeleeAttackIfReady(); - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new boss_toravonAI(creature); + pInstance = me->GetInstanceScript(); } + + InstanceScript* pInstance; + + EventMap events; + SummonList summons; + + void Reset() + { + events.Reset(); + summons.DespawnAll(); + if (pInstance) + { + if (pInstance->GetData(DATA_STONED)) + { + if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me)) + { + aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS); + aur->SetDuration(60 * MINUTE* IN_MILLISECONDS); + } + } + pInstance->SetData(EVENT_TORAVON, NOT_STARTED); + } + } + + void AttackStart(Unit* who) + { + if (me->HasAura(SPELL_STONED_AURA)) + return; + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit* /*who*/) + { + me->CastSpell(me, SPELL_FROZEN_MALLET, true); + + events.ScheduleEvent(EVENT_FROZEN_ORB_STALKER, 12000); + events.ScheduleEvent(EVENT_FREEZING_GROUND, 7000); + events.ScheduleEvent(EVENT_CAST_WHITEOUT, 25000); // schedule FIRST whiteout event in 25 seconds -1 for compesate updateai 2seconds check delay + + if (pInstance) + pInstance->SetData(EVENT_TORAVON, IN_PROGRESS); + } + + void JustDied(Unit*) + { + if (pInstance) + { + pInstance->SetData(EVENT_TORAVON, DONE); + pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_WHITEOUT); + } + } + + void JustSummoned(Creature* cr) + { + summons.Summon(cr); + } + + void UpdateAI(uint32 diff) + { + + + if (!UpdateVictim()) + return; + + events.Update(diff); + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; + + switch (events.GetEvent()) + { + case EVENT_FREEZING_GROUND: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) + me->CastSpell(target, SPELL_FREEZING_GROUND, false); + events.RepeatEvent(20000); + break; + case EVENT_FROZEN_ORB_STALKER: + me->CastCustomSpell(SPELL_FROZEN_ORB, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3), me, false); + events.RepeatEvent(30000); + break; + case EVENT_CAST_WHITEOUT: + me->CastSpell(me, SPELL_WHITEOUT, false); + events.ScheduleEvent(EVENT_CAST_WHITEOUT_GROUND_EFFECT, 1000); // triggers after 1 sec "plus 1 from trigger to cast visual" + events.RepeatEvent(40000); // next whiteout instead first 25 SEC is now 45 SEC + break; + case EVENT_CAST_WHITEOUT_GROUND_EFFECT: // Whiteout Ground effect trigger + if (Unit* whiteOutGround = me->SummonCreature(NPC_WHITEOUT_GROUND_EFFECT, -43.3316, -288.708, 92.2511, 1.58825, TEMPSUMMON_TIMED_DESPAWN, 4000)) + whiteOutGround->CastSpell(whiteOutGround, SPELL_WHITEOUT_VISUAL, false); // Cast the spell + events.PopEvent(); + break; + } + + DoMeleeAttackIfReady(); + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_toravonAI(creature); + } }; class npc_frozen_orb : public CreatureScript @@ -234,7 +233,6 @@ public: } }; - void AddSC_boss_toravon() { new boss_toravon();