diff options
| author | offl <11556157+offl@users.noreply.github.com> | 2025-07-12 15:55:24 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-12 14:55:24 +0200 |
| commit | 53daa087aedcc0f68c935628f181256d89914ae2 (patch) | |
| tree | 071367620770ded1bc3db854c142d337c1ed8b38 /src/server/scripts/Outland | |
| parent | a2a3c6531152fc5e8b7fabb51e932caa7b8e94f5 (diff) | |
Scripts/Spells: Migrate & update non-generic quest spell scripts to zone files (#31100)
Diffstat (limited to 'src/server/scripts/Outland')
| -rw-r--r-- | src/server/scripts/Outland/zone_blades_edge_mountains.cpp | 118 | ||||
| -rw-r--r-- | src/server/scripts/Outland/zone_terokkar_forest.cpp | 86 |
2 files changed, 204 insertions, 0 deletions
diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index b4a8fae14ab..e3edce057eb 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -1195,6 +1195,119 @@ class spell_bem_q10720_poison_keg : public SpellScript } }; +/*###### +## Quest 11010: Bombing Run / 11102: Bombing Run / 11023: Bomb Them Again! +######*/ + +enum BombingRun +{ + SPELL_FLAK_CANNON_TRIGGER = 40110, + SPELL_CHOOSE_LOC = 40056, + SPELL_AGGRO_CHECK = 40112, + + NPC_FEL_CANNON2 = 23082 +}; + +// 40113 - Knockdown Fel Cannon: The Aggro Check Aura +class spell_bem_aggro_check_aura : public AuraScript +{ + PrepareAuraScript(spell_bem_aggro_check_aura); + + void HandleTriggerSpell(AuraEffect const* /*aurEff*/) + { + if (Unit* target = GetTarget()) + // On trigger proccing + target->CastSpell(target, SPELL_AGGRO_CHECK); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_bem_aggro_check_aura::HandleTriggerSpell, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } +}; + +// 40112 - Knockdown Fel Cannon: The Aggro Check +class spell_bem_aggro_check : public SpellScript +{ + PrepareSpellScript(spell_bem_aggro_check); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Player* playerTarget = GetHitPlayer()) + // Check if found player target is on fly mount or using flying form + if (playerTarget->HasAuraType(SPELL_AURA_FLY) || playerTarget->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + playerTarget->CastSpell(playerTarget, SPELL_FLAK_CANNON_TRIGGER, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_bem_aggro_check::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 40119 - Knockdown Fel Cannon: The Aggro Burst +class spell_bem_aggro_burst : public AuraScript +{ + PrepareAuraScript(spell_bem_aggro_burst); + + void HandleEffectPeriodic(AuraEffect const* /*aurEff*/) + { + if (Unit* target = GetTarget()) + // On each tick cast Choose Loc to trigger summon + target->CastSpell(target, SPELL_CHOOSE_LOC); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_bem_aggro_burst::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } +}; + +// 40056 - Knockdown Fel Cannon: Choose Loc +class spell_bem_choose_loc : public SpellScript +{ + PrepareSpellScript(spell_bem_choose_loc); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + // Check for player that is in 65 y range + std::vector<Player*> playerList; + caster->GetPlayerListInGrid(playerList, 65.0f); + for (Player* player : playerList) + // Check if found player target is on fly mount or using flying form + if (player->HasAuraType(SPELL_AURA_FLY) || player->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED)) + // Summom Fel Cannon (bunny version) at found player + caster->SummonCreature(NPC_FEL_CANNON2, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ()); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_bem_choose_loc::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + +// 39844 - Skyguard Blasting Charge +// 40160 - Throw Bomb +class spell_bem_check_fly_mount : public SpellScript +{ + PrepareSpellScript(spell_bem_check_fly_mount); + + SpellCastResult CheckRequirement() + { + Unit* caster = GetCaster(); + // This spell will be cast only if caster has one of these auras + if (!(caster->HasAuraType(SPELL_AURA_FLY) || caster->HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))) + return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_bem_check_fly_mount::CheckRequirement); + } +}; + void AddSC_blades_edge_mountains() { new npc_nether_drake(); @@ -1211,4 +1324,9 @@ void AddSC_blades_edge_mountains() RegisterSpellScript(spell_bem_coax_marmot); RegisterSpellScript(spell_bem_charm_rexxars_rodent); RegisterSpellScript(spell_bem_q10720_poison_keg); + RegisterSpellScript(spell_bem_aggro_check_aura); + RegisterSpellScript(spell_bem_aggro_check); + RegisterSpellScript(spell_bem_aggro_burst); + RegisterSpellScript(spell_bem_choose_loc); + RegisterSpellScript(spell_bem_check_fly_mount); } diff --git a/src/server/scripts/Outland/zone_terokkar_forest.cpp b/src/server/scripts/Outland/zone_terokkar_forest.cpp index 31df4f40c06..458f431e696 100644 --- a/src/server/scripts/Outland/zone_terokkar_forest.cpp +++ b/src/server/scripts/Outland/zone_terokkar_forest.cpp @@ -17,6 +17,7 @@ #include "ScriptMgr.h" #include "Containers.h" +#include "CreatureAIImpl.h" #include "GameObject.h" #include "Group.h" #include "Map.h" @@ -354,6 +355,89 @@ public: explicit spell_terokkar_translocation_firewing_point(Translocation triggeredSpellId) : _triggeredSpellId(triggeredSpellId) { } }; +/*###### +## Quest 10929: Fumping / 10930: The Big Bone Worm +######*/ + +enum Fumping +{ + SPELL_SUMMON_SAND_GNOME = 39240, + SPELL_SUMMON_BONE_SLICER = 39241, + + SPELL_SUMMON_SAND_GNOME_1 = 39247, + SPELL_SUMMON_BONE_SLICER_1 = 39245, + SPELL_SUMMON_HAISHULUD = 39248, + SPELL_DESPAWN_CLEFTHOOF = 39250 +}; + +// 39238 - Fumping +class spell_terokkar_fumping : public SpellScript +{ + PrepareSpellScript(spell_terokkar_fumping); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER }); + } + + void SetDest(SpellDestination& dest) + { + Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f }; + dest.RelocateOffset(offset); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_SAND_GNOME, SPELL_SUMMON_BONE_SLICER), true); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_terokkar_fumping::SetDest, EFFECT_1, TARGET_DEST_CASTER); + OnEffectHit += SpellEffectFn(spell_terokkar_fumping::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } +}; + +// 39246 - Fumping +class spell_terokkar_fumping_the_big_bone_worm : public SpellScript +{ + PrepareSpellScript(spell_terokkar_fumping_the_big_bone_worm); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo( + { + SPELL_SUMMON_SAND_GNOME_1, + SPELL_SUMMON_BONE_SLICER_1, + SPELL_SUMMON_HAISHULUD, + SPELL_DESPAWN_CLEFTHOOF + }); + } + + void SetDest(SpellDestination& dest) + { + Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f }; + dest.RelocateOffset(offset); + } + + void HandleSummon(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_SAND_GNOME_1, SPELL_SUMMON_BONE_SLICER_1, SPELL_SUMMON_HAISHULUD), true); + } + + void HandleDespawn(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), SPELL_DESPAWN_CLEFTHOOF, true); + } + + void Register() override + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_terokkar_fumping_the_big_bone_worm::SetDest, EFFECT_1, TARGET_DEST_CASTER); + OnEffectHit += SpellEffectFn(spell_terokkar_fumping_the_big_bone_worm::HandleSummon, EFFECT_1, SPELL_EFFECT_DUMMY); + OnEffectHit += SpellEffectFn(spell_terokkar_fumping_the_big_bone_worm::HandleDespawn, EFFECT_2, SPELL_EFFECT_DUMMY); + } +}; + void AddSC_terokkar_forest() { new npc_unkor_the_ruthless(); @@ -367,4 +451,6 @@ void AddSC_terokkar_forest() RegisterSpellScriptWithArgs(spell_terokkar_translocation_firewing_point, "spell_terokkar_translocation_firewing_point_building_up", SPELL_TRANSLOCATION_FIREWING_POINT_BUILDING_UP); RegisterSpellScriptWithArgs(spell_terokkar_translocation_firewing_point, "spell_terokkar_translocation_firewing_point_tower_down", SPELL_TRANSLOCATION_FIREWING_POINT_TOWER_DOWN); RegisterSpellScriptWithArgs(spell_terokkar_translocation_firewing_point, "spell_terokkar_translocation_firewing_point_tower_up", SPELL_TRANSLOCATION_FIREWING_POINT_TOWER_UP); + RegisterSpellScript(spell_terokkar_fumping); + RegisterSpellScript(spell_terokkar_fumping_the_big_bone_worm); } |
