fix(Core/Spell): Recall destination for Insignia trinkets using CFBG (#8679)
This commit is contained in:
@@ -0,0 +1,6 @@
|
|||||||
|
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1634891525914970200');
|
||||||
|
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id` IN (22563, 22564) AND `ScriptName` = 'spell_item_recall';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||||
|
(22563, 'spell_item_recall'),
|
||||||
|
(22564, 'spell_item_recall');
|
||||||
@@ -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()
|
void AddSC_item_spell_scripts()
|
||||||
{
|
{
|
||||||
// Ours
|
// Ours
|
||||||
@@ -4572,4 +4618,5 @@ void AddSC_item_spell_scripts()
|
|||||||
new spell_item_eggnog();
|
new spell_item_eggnog();
|
||||||
new spell_item_goblin_bomb();
|
new spell_item_goblin_bomb();
|
||||||
new spell_item_linken_boomerang();
|
new spell_item_linken_boomerang();
|
||||||
|
new spell_item_recall();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user