fix(Scripts/Item): Multiphase Goggles not showing disturbances on minimap (#20446)
* fix(Scripts/Item): Multiphase Goggles not showing disturbances on mimimap * Apply suggestions from code review
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
-- Multiphase Goggles
|
||||||
|
DELETE FROM `spell_script_names` WHERE `spell_id`=46273 AND `ScriptName`='spell_item_multiphase_goggles';
|
||||||
|
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (46273, 'spell_item_multiphase_goggles');
|
||||||
@@ -4162,6 +4162,30 @@ class spell_item_spell_reflectors: public AuraScript
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 46273 - Multiphase Goggles
|
||||||
|
class spell_item_multiphase_goggles : public AuraScript
|
||||||
|
{
|
||||||
|
PrepareAuraScript(spell_item_multiphase_goggles);
|
||||||
|
|
||||||
|
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
|
{
|
||||||
|
if (Player* player = GetTarget()->ToPlayer())
|
||||||
|
player->SetFlag(PLAYER_TRACK_CREATURES, uint32(1) << (CREATURE_TYPE_GAS_CLOUD - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||||
|
{
|
||||||
|
if (Player* player = GetTarget()->ToPlayer())
|
||||||
|
player->RemoveFlag(PLAYER_TRACK_CREATURES, uint32(1) << (CREATURE_TYPE_GAS_CLOUD - 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Register() override
|
||||||
|
{
|
||||||
|
OnEffectApply += AuraEffectApplyFn(spell_item_multiphase_goggles::OnApply, EFFECT_0, SPELL_AURA_MOD_INVISIBILITY_DETECT , AURA_EFFECT_HANDLE_REAL);
|
||||||
|
OnEffectRemove += AuraEffectRemoveFn(spell_item_multiphase_goggles::OnRemove, EFFECT_0, SPELL_AURA_MOD_INVISIBILITY_DETECT , AURA_EFFECT_HANDLE_REAL);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void AddSC_item_spell_scripts()
|
void AddSC_item_spell_scripts()
|
||||||
{
|
{
|
||||||
RegisterSpellScript(spell_item_massive_seaforium_charge);
|
RegisterSpellScript(spell_item_massive_seaforium_charge);
|
||||||
@@ -4289,4 +4313,5 @@ void AddSC_item_spell_scripts()
|
|||||||
RegisterSpellScript(spell_item_skyguard_blasting_charges);
|
RegisterSpellScript(spell_item_skyguard_blasting_charges);
|
||||||
RegisterSpellScript(spell_item_luffa);
|
RegisterSpellScript(spell_item_luffa);
|
||||||
RegisterSpellScript(spell_item_spell_reflectors);
|
RegisterSpellScript(spell_item_spell_reflectors);
|
||||||
|
RegisterSpellScript(spell_item_multiphase_goggles);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user