aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroffl <11556157+offl@users.noreply.github.com>2021-12-13 22:38:57 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-24 11:39:27 +0100
commit69ee7582fcb9b2cdf759fd5c29f3cc4f3d224288 (patch)
tree18c4e187e520fc57cba42e4dc5b68490d6466764
parent0bb13b5dbdbe0d6af785c80b82a2c7b5e8a2ef57 (diff)
Scripts/MFF: Update Ahune's Ice Spear behavior (#27384)
(cherry picked from commit 751a8b9e17d2bd39785850295abb1d08917b0b24)
-rw-r--r--sql/updates/world/master/2022_03_24_05_world_2021_12_13_02_world.sql6
-rw-r--r--src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp92
2 files changed, 69 insertions, 29 deletions
diff --git a/sql/updates/world/master/2022_03_24_05_world_2021_12_13_02_world.sql b/sql/updates/world/master/2022_03_24_05_world_2021_12_13_02_world.sql
new file mode 100644
index 00000000000..a6bae8dfe74
--- /dev/null
+++ b/sql/updates/world/master/2022_03_24_05_world_2021_12_13_02_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `gameobject_template` SET `ScriptName` = 'go_ahune_ice_spear' WHERE `entry` = 188077;
+
+UPDATE `creature_template` SET `AIName` = '', `ScriptName` = 'npc_ahune_ice_spear_bunny' WHERE `entry` = 25985;
+UPDATE `creature_template` SET `unit_flags` = 33554432 WHERE `entry` IN (25985,26337);
+DELETE FROM `smart_scripts` WHERE `entryorguid` = 25985 AND `source_type` = 0;
diff --git a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
index 1c5008cebab..7a00a469cf5 100644
--- a/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
+++ b/src/server/scripts/Outland/CoilfangReservoir/TheSlavePens/boss_ahune.cpp
@@ -71,11 +71,8 @@ enum Spells
SPELL_ICE_BOMBARDMENT = 46396,
// Ice Spear
- SPELL_SUMMON_ICE_SPEAR_BUNNY = 46359,
SPELL_ICE_SPEAR_KNOCKBACK = 46360,
SPELL_SUMMON_ICE_SPEAR_GO = 46369,
- SPELL_ICE_SPEAR_AURA = 46371,
- SPELL_ICE_SPEAR_TARGET_PICKER = 46372,
SPELL_ICE_SPEAR_DELAY = 46878,
SPELL_ICE_SPEAR_VISUAL = 75498,
@@ -86,9 +83,13 @@ enum Spells
SPELL_SLIPPERY_FLOOR_YOU_SLIPPED = 45946,
// Frozen Core
+ SPELL_ICE_SPEAR_CONTROL_AURA = 46371,
+ SPELL_FROZEN_CORE_GETS_HIT = 46810,
+ SPELL_IS_DEAD_CHECK = 61976, // NYI
+ SPELL_ICE_SPEAR_TARGET_PICKER = 46372,
+ SPELL_SUMMON_ICE_SPEAR_BUNNY = 46359,
SPELL_SUICIDE = 45254,
SPELL_SUMMON_LOOT_MISSILE = 45941,
- SPELL_FROZEN_CORE_GETS_HIT = 46810,
SPELL_MINION_DESPAWNER = 46843,
SPELL_GHOST_DISGUISE = 46786
};
@@ -283,8 +284,9 @@ struct npc_frozen_core : public ScriptedAI
{
me->SetReactState(REACT_PASSIVE);
me->SetRegenerateHealth(false);
+ DoCastSelf(SPELL_ICE_SPEAR_CONTROL_AURA);
DoCastSelf(SPELL_FROZEN_CORE_GETS_HIT);
- DoCastSelf(SPELL_ICE_SPEAR_AURA);
+ DoCastSelf(SPELL_IS_DEAD_CHECK);
}
void JustDied(Unit* /*killer*/) override
@@ -302,13 +304,13 @@ struct npc_frozen_core : public ScriptedAI
{
me->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetImmuneToPC(false);
- me->RemoveAurasDueToSpell(SPELL_ICE_SPEAR_AURA);
+ me->RemoveAurasDueToSpell(SPELL_ICE_SPEAR_CONTROL_AURA);
_events.ScheduleEvent(EVENT_SYNCH_HEALTH, 3s, 0, PHASE_TWO);
}
else if (action == ACTION_AHUNE_RESURFACE)
{
_events.Reset();
- DoCastSelf(SPELL_ICE_SPEAR_AURA);
+ DoCastSelf(SPELL_ICE_SPEAR_CONTROL_AURA);
me->AddUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
me->SetImmuneToPC(true);
}
@@ -592,6 +594,53 @@ private:
uint8 _mySpot;
};
+struct npc_ahune_ice_spear_bunny : public ScriptedAI
+{
+ npc_ahune_ice_spear_bunny(Creature* creature) : ScriptedAI(creature) { }
+
+ void JustAppeared() override
+ {
+ DoCastSelf(SPELL_SUMMON_ICE_SPEAR_GO);
+ DoCastSelf(SPELL_ICE_SPEAR_VISUAL);
+
+ _scheduler.Schedule(2500ms, [this](TaskContext /*task*/)
+ {
+ DoCastSelf(SPELL_ICE_SPEAR_DELAY);
+ me->DespawnOrUnsummon(3500ms);
+ });
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
+struct go_ahune_ice_spear : public GameObjectAI
+{
+ go_ahune_ice_spear(GameObject* go) : GameObjectAI(go) { }
+
+ void Reset() override
+ {
+ _scheduler.Schedule(2500ms, [this](TaskContext /*context*/)
+ {
+ me->UseDoorOrButton();
+ me->DespawnOrUnsummon(3500ms);
+ });
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ _scheduler.Update(diff);
+ }
+
+private:
+ TaskScheduler _scheduler;
+};
+
struct go_ahune_ice_stone : public GameObjectAI
{
go_ahune_ice_stone(GameObject* go) : GameObjectAI(go), _instance(go->GetInstanceScript()) { }
@@ -681,31 +730,14 @@ class spell_summon_ice_spear_delayer : public AuraScript
bool Validate(SpellInfo const* /*spellInfo*/) override
{
- return ValidateSpellInfo({ SPELL_SUMMON_ICE_SPEAR_GO, SPELL_ICE_SPEAR_KNOCKBACK });
+ return ValidateSpellInfo({ SPELL_ICE_SPEAR_KNOCKBACK });
}
- void PeriodicTick(AuraEffect const* aurEff)
+ void PeriodicTick(AuraEffect const* /*aurEff*/)
{
- if (Unit* tmpCaster = GetCaster())
- if (Creature* caster = tmpCaster->ToCreature())
- switch (aurEff->GetTickNumber())
- {
- case 1:
- caster->CastSpell(caster, SPELL_SUMMON_ICE_SPEAR_GO);
- break;
- case 3:
- if (GameObject* spike = caster->FindNearestGameObject(GO_ICE_SPEAR, 3.0f))
- spike->UseDoorOrButton();
- caster->AI()->DoCastAOE(SPELL_ICE_SPEAR_KNOCKBACK, true);
- break;
- case 5:
- if (GameObject* spike = caster->FindNearestGameObject(GO_ICE_SPEAR, 3.0f))
- spike->Delete();
- caster->DespawnOrUnsummon();
- break;
- default:
- break;
- }
+ Unit* target = GetTarget();
+ target->CastSpell(target, SPELL_ICE_SPEAR_KNOCKBACK);
+ Remove();
}
void Register() override
@@ -860,6 +892,8 @@ void AddSC_boss_ahune()
RegisterSlavePensCreatureAI(npc_frozen_core);
RegisterSlavePensCreatureAI(npc_earthen_ring_flamecaller);
RegisterSlavePensCreatureAI(npc_ahune_bunny);
+ RegisterSlavePensCreatureAI(npc_ahune_ice_spear_bunny);
+ RegisterSlavePensGameObjectAI(go_ahune_ice_spear);
RegisterSlavePensGameObjectAI(go_ahune_ice_stone);
RegisterSpellScript(spell_ahune_synch_health);
RegisterSpellScript(spell_summoning_rhyme_aura);