mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 01:59:09 +00:00
feat(Scripts/Spell): Teleporting to Script
Co-authored-by: Nefertumm <nefertum.dev@protonmail.com>
This commit is contained in:
committed by
GitHub
parent
b680ea3dae
commit
7a294787d3
@@ -1828,6 +1828,38 @@ class spell_gen_creature_permanent_feign_death : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
enum Teleporting
|
||||
{
|
||||
AREA_VIOLET_CITADEL_SPIRE = 4637,
|
||||
|
||||
SPELL_TELEPORT_SPIRE_DOWN = 59316,
|
||||
SPELL_TELEPORT_SPIRE_UP = 59314
|
||||
};
|
||||
|
||||
class spell_gen_teleporting : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gen_teleporting);
|
||||
|
||||
void HandleScript(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// return from top
|
||||
if (target->ToPlayer()->GetAreaId() == AREA_VIOLET_CITADEL_SPIRE)
|
||||
target->CastSpell(target, SPELL_TELEPORT_SPIRE_DOWN, true);
|
||||
// teleport atop
|
||||
else
|
||||
target->CastSpell(target, SPELL_TELEPORT_SPIRE_UP, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gen_teleporting::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
enum PvPTrinketTriggeredSpells
|
||||
{
|
||||
SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER = 72752,
|
||||
@@ -4452,6 +4484,7 @@ void AddSC_generic_spell_scripts()
|
||||
RegisterSpellScript(spell_gen_throw_shield);
|
||||
RegisterSpellScript(spell_gen_on_tournament_mount);
|
||||
RegisterSpellScript(spell_gen_tournament_pennant);
|
||||
RegisterSpellScript(spell_gen_teleporting);
|
||||
RegisterSpellScript(spell_gen_ds_flush_knockback);
|
||||
RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_default_count_pct_from_max_hp");
|
||||
RegisterSpellScriptWithArgs(spell_gen_count_pct_from_max_hp, "spell_gen_50pct_count_pct_from_max_hp", 50);
|
||||
|
||||
Reference in New Issue
Block a user