diff options
| author | Shauren <shauren.trinity@gmail.com> | 2025-11-22 20:47:38 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2025-11-22 20:47:38 +0100 |
| commit | b1ab5b7d624d337ae421fe8da536f6958ac5fa08 (patch) | |
| tree | 241e0a085ff99128d2e808b173a7a24627897511 /src | |
| parent | 30a16448046b4e60c3b989ce1277e3f0e366af73 (diff) | |
Scripts/Battlegrounds: Correct Isle of Conquest catapult launch movement
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp | 46 | ||||
| -rw-r--r-- | src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.h | 2 |
2 files changed, 31 insertions, 17 deletions
diff --git a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp index 77160ec7e4f..c70ee68865e 100644 --- a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp +++ b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.cpp @@ -243,40 +243,39 @@ class spell_ioc_parachute_ic : public AuraScript class StartLaunchEvent : public BasicEvent { public: - StartLaunchEvent(Map const* map, Position const& pos, ObjectGuid const& guid) : _map(map), _pos(pos), _guid(guid) + StartLaunchEvent(Unit* target, Position const& pos, float speedXY, float speedZ) + : _target(target), _pos(pos), _speedXY(speedXY), _speedZ(speedZ) { } bool Execute(uint64 /*time*/, uint32 /*diff*/) override { - Player* player = ObjectAccessor::GetPlayer(_map, _guid); - if (!player || !player->GetVehicle()) - return true; - - player->AddAura(SPELL_LAUNCH_NO_FALLING_DAMAGE, player); // prevents falling damage - float speedZ = 10.0f; - float dist = player->GetExactDist2d(&_pos); - - player->ExitVehicle(); - player->GetMotionMaster()->MoveJump(_pos, dist, speedZ, EVENT_JUMP, _pos.GetOrientation()); + _target->KnockbackFrom(_pos, _speedXY, _speedZ, 0); return true; } private: - Map const* _map; + Unit* _target; Position _pos; - ObjectGuid _guid; + float _speedXY; + float _speedZ; }; // 66218 - Launch class spell_ioc_launch : public SpellScript { - void Launch() + void Launch() const { - if (!GetCaster()->IsCreature() || !GetExplTargetDest()) + if (!GetExplTargetDest()) return; - GetCaster()->m_Events.AddEventAtOffset(new StartLaunchEvent(GetCaster()->GetMap(), *GetExplTargetDest(), GetHitUnit()->GetGUID()), 2500ms); + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + + caster->CastSpell(caster, SPELL_LAUNCH_NO_FALLING_DAMAGE, true); + + target->m_Events.AddEventAtOffset(new StartLaunchEvent(target, *GetExplTargetDest(), + GetSpell()->m_targets.GetSpeedXY(), GetSpell()->m_targets.GetSpeedZ()), 2500ms); } void Register() override @@ -285,6 +284,20 @@ class spell_ioc_launch : public SpellScript } }; +// 66251 - Launch +class spell_ioc_launch_exit_vehicle : public SpellScript +{ + void ExitVehicle() const + { + GetHitUnit()->ExitVehicle(); + } + + void Register() override + { + AfterHit += SpellHitFn(spell_ioc_launch_exit_vehicle::ExitVehicle); + } +}; + enum SeaforiumBombSpells { SPELL_SEAFORIUM_BLAST = 66676, @@ -384,6 +397,7 @@ void AddSC_isle_of_conquest() RegisterSpellScript(spell_ioc_gunship_portal); RegisterSpellScript(spell_ioc_parachute_ic); RegisterSpellScript(spell_ioc_launch); + RegisterSpellScript(spell_ioc_launch_exit_vehicle); RegisterSpellScript(spell_ioc_seaforium_blast_credit); new at_ioc_exploit(); new at_ioc_backdoor_job(); diff --git a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.h b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.h index ab4c92abae6..a0f73047a3b 100644 --- a/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.h +++ b/src/server/scripts/Battlegrounds/IsleOfConquest/isle_of_conquest.h @@ -62,7 +62,7 @@ enum Spells SPELL_SIMPLE_TELEPORT = 12980, SPELL_TELEPORT_VISUAL_ONLY = 51347, SPELL_PARACHUTE_IC = 66657, - SPELL_LAUNCH_NO_FALLING_DAMAGE = 66251 + SPELL_LAUNCH_NO_FALLING_DAMAGE = 66227 }; enum ICWorldStates |
