fix(Scripts/Items): Bloodsail Admiral's hat should despawn parrot on … (#22327)

This commit is contained in:
avarishd
2025-06-16 18:39:03 +03:00
committed by GitHub
parent dd96b57be4
commit 080e9e05da
2 changed files with 26 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
--
DELETE FROM `spell_script_names` WHERE `spell_id`=60244 AND `ScriptName`='spell_item_bloodsail_admiral_hat';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (60244, 'spell_item_bloodsail_admiral_hat');

View File

@@ -4187,6 +4187,28 @@ class spell_item_multiphase_goggles : public AuraScript
}
};
// 60244 - Blood Parrot Despawn Aura (Item: 12185 - Bloodsail Admiral's Hat)
enum BloodsailAdmiralHat
{
NPC_ADMIRAL_HAT_PARROT = 11236, // Blood Parrot
};
class spell_item_bloodsail_admiral_hat : public AuraScript
{
PrepareAuraScript(spell_item_bloodsail_admiral_hat);
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetCaster()->ToPlayer())
player->RemoveAllMinionsByEntry(NPC_ADMIRAL_HAT_PARROT);
}
void Register() override
{
OnEffectRemove += AuraEffectRemoveFn(spell_item_bloodsail_admiral_hat::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
}
};
void AddSC_item_spell_scripts()
{
RegisterSpellScript(spell_item_massive_seaforium_charge);
@@ -4315,4 +4337,5 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_luffa);
RegisterSpellScript(spell_item_spell_reflectors);
RegisterSpellScript(spell_item_multiphase_goggles);
RegisterSpellScript(spell_item_bloodsail_admiral_hat);
}