mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 20:02:25 +01:00
Scripts/VP: corrected Catch Fall mechanic. Players will always get teleported back to the entrance
This commit is contained in:
7
sql/updates/world/custom/custom_2019_08_15_00_world.sql
Normal file
7
sql/updates/world/custom/custom_2019_08_15_00_world.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName`= 'spell_vp_catch_fall';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(89522, 'spell_vp_catch_fall');
|
||||
|
||||
DELETE FROM `spell_target_position` WHERE `ID`= 89526;
|
||||
INSERT INTO `spell_target_position` (`ID`, `EffectIndex`, `MapID`, `PositionX`, `PositionY`, `PositionZ`, `Orientation`) VALUES
|
||||
(89526, 0, 657, -361.0174, -6.359375, 632.7807, 0.0);
|
||||
@@ -4291,6 +4291,18 @@ void SpellMgr::LoadSpellInfoCorrections()
|
||||
spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DB);
|
||||
});
|
||||
|
||||
// Catch Fall
|
||||
ApplySpellFix({ 89526 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo(TARGET_DEST_DB);
|
||||
});
|
||||
|
||||
// Catch Fall
|
||||
ApplySpellFix({ 89522 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_DEST_CASTER);
|
||||
});
|
||||
|
||||
// Summon Skyfall Star
|
||||
ApplySpellFix({ 96260 }, [](SpellInfo* spellInfo)
|
||||
{
|
||||
|
||||
@@ -1035,36 +1035,14 @@ class spell_vp_catch_fall : public SpellScript
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
InstanceScript* instance = GetCaster()->GetInstanceScript();
|
||||
Creature* slipstream = GetCaster()->FindNearestCreature(NPC_SLIPSTREAM, 300.0f);
|
||||
if (!slipstream || !instance)
|
||||
{
|
||||
dest.Relocate(EntranceTeleportPos);
|
||||
return;
|
||||
}
|
||||
float zOffset = 650.0f - GetCaster()->GetPositionZ();
|
||||
|
||||
ObjectGuid guid = slipstream->GetGUID();
|
||||
if (guid == instance->GetGuidData(DATA_SLIPSTREAM_ERTAN_1) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ERTAN_2) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ERTAN_3) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ENTRANCE_1) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ENTRANCE_2))
|
||||
dest.Relocate(EntranceTeleportPos);
|
||||
else if (guid == instance->GetGuidData(DATA_SLIPSTREAM_ALTAIRUS_1) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ALTAIRUS_2) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ALTAIRUS_3) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ALTAIRUS_4) ||
|
||||
guid == instance->GetGuidData(DATA_SLIPSTREAM_ALTAIRUS_5))
|
||||
dest.Relocate(AltairusTeleportPos);
|
||||
else if (guid == instance->GetGuidData(DATA_SLIPSTREAM_ASAAD_1))
|
||||
dest.Relocate(AsaadTeleportPos);
|
||||
else // Safeguard to prevent any fall to death case
|
||||
dest.Relocate(EntranceTeleportPos);
|
||||
dest.RelocateOffset({ 0.0f, 0.0f, zOffset, 0.0f });
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_vp_catch_fall::SetDest, EFFECT_0, TARGET_DEST_NEARBY_ENTRY);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_vp_catch_fall::SetDest, EFFECT_0, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user