mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
fix(Core/Spell): Recall destination for Insignia trinkets using CFBG (#8679)
This commit is contained in:
@@ -4462,6 +4462,52 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
enum RecallSpellIds
|
||||
{
|
||||
SPELL_RECALL_HORDE = 22563,
|
||||
SPELL_RECALL_ALLIANCE = 22564
|
||||
};
|
||||
|
||||
class spell_item_recall : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_item_recall() : SpellScriptLoader("spell_item_recall") { }
|
||||
|
||||
class spell_item_recall_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_recall_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
if (!player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TeamId bgTeam = player->GetBgTeamId();
|
||||
if (player->GetTeamId(true) != bgTeam)
|
||||
{
|
||||
if (SpellTargetPosition const* recallSpellTarget = sSpellMgr->GetSpellTargetPosition(bgTeam == TEAM_HORDE ? SPELL_RECALL_HORDE : SPELL_RECALL_ALLIANCE, EFFECT_0))
|
||||
{
|
||||
Position pos = Position(recallSpellTarget->target_X, recallSpellTarget->target_Y, recallSpellTarget->target_Z, recallSpellTarget->target_Orientation);
|
||||
dest.Relocate(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_item_recall_SpellScript::SetDest, EFFECT_0, TARGET_DEST_DB);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_item_recall_SpellScript();
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_item_spell_scripts()
|
||||
{
|
||||
// Ours
|
||||
@@ -4572,4 +4618,5 @@ void AddSC_item_spell_scripts()
|
||||
new spell_item_eggnog();
|
||||
new spell_item_goblin_bomb();
|
||||
new spell_item_linken_boomerang();
|
||||
new spell_item_recall();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user