mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 23:26:23 +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
@@ -0,0 +1,5 @@
|
||||
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1647762263757948026');
|
||||
|
||||
DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gen_teleporting');
|
||||
INSERT INTO `spell_script_names` VALUES
|
||||
(59317,'spell_gen_teleporting');
|
||||
@@ -3951,26 +3951,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
||||
if (unitTarget->ToPlayer()->GetQuestStatus(questID) == QUEST_STATUS_COMPLETE)
|
||||
unitTarget->CastSpell(unitTarget, spellID, true);
|
||||
|
||||
return;
|
||||
}
|
||||
case 59317: // Teleporting
|
||||
{
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
Player* player = unitTarget->ToPlayer();
|
||||
if (!player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// return from top
|
||||
if (player->GetAreaId() == 4637)
|
||||
unitTarget->CastSpell(unitTarget, 59316, true);
|
||||
// teleport atop
|
||||
else
|
||||
unitTarget->CastSpell(unitTarget, 59314, true);
|
||||
|
||||
return;
|
||||
}
|
||||
// Stoneclaw Totem
|
||||
|
||||
@@ -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