mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Script/Item): Elixir of Shadows for pets (#14514)
* closes https://github.com/azerothcore/azerothcore-wotlk/issues/13067
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
--
|
||||
DELETE FROM `spell_script_names` WHERE `spell_id`=37678 AND `ScriptName`='spell_item_elixir_of_shadows';
|
||||
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
|
||||
(37678, 'spell_item_elixir_of_shadows');
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "GameTime.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "Pet.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SkillDiscovery.h"
|
||||
@@ -3758,6 +3759,26 @@ class spell_item_green_whelp_armor : public AuraScript
|
||||
}
|
||||
};
|
||||
|
||||
// 37678 - elixir of shadows
|
||||
/// @todo Temporary fix until pet restrictions vs player restrictions are investigated
|
||||
class spell_item_elixir_of_shadows : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_item_elixir_of_shadows);
|
||||
|
||||
void HandleEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Player* player = GetCaster()->ToPlayer())
|
||||
if (Pet* pet = player->GetPet())
|
||||
pet->AddAura(37678 /*Elixir of Shadows*/, pet);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_elixir_of_shadows::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_item_elixir_of_shadows::HandleEffect, EFFECT_1, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
enum TrollDice
|
||||
{
|
||||
TEXT_WORN_TROLL_DICE = 26152
|
||||
@@ -3914,5 +3935,6 @@ void AddSC_item_spell_scripts()
|
||||
RegisterSpellScript(spell_item_snowman);
|
||||
RegisterSpellScript(spell_item_freeze_rookery_egg);
|
||||
RegisterSpellScript(spell_item_green_whelp_armor);
|
||||
RegisterSpellScript(spell_item_elixir_of_shadows);
|
||||
RegisterSpellScript(spell_item_worn_troll_dice);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user