Scripts/Pet: Lil' K.T (#24528)

* Lil' K.T.

* Rename 9999_99_99_99_world_335.sql to 2020_05_10_00_world.sql

Co-authored-by: Giacomo Pozzoni <[email protected]>
(cherry picked from commit 34fecde022e6e2a228111ee79a0e9f5f8a7bed12)
This commit is contained in:
Sorikoff
2022-01-02 19:24:18 +01:00
committed by Shauren
parent d30e4a20e5
commit 74174332c6
3 changed files with 109 additions and 0 deletions
@@ -1876,6 +1876,80 @@ class spell_gen_increase_stats_buff : public SpellScriptLoader
}
};
enum LichPet
{
NPC_LICH_PET = 36979,
SPELL_LICH_PET_AURA = 69732,
SPELL_LICH_PET_AURA_ONKILL = 69731
};
// 69732 - Lich Pet Aura
class spell_gen_lich_pet_aura : public AuraScript
{
PrepareAuraScript(spell_gen_lich_pet_aura);
bool CheckProc(ProcEventInfo& eventInfo)
{
return (eventInfo.GetProcTarget()->GetTypeId() == TYPEID_PLAYER);
}
void HandleProc(AuraEffect* /* aurEff */, ProcEventInfo& /* eventInfo */)
{
PreventDefaultAction();
std::list<TempSummon*> minionList;
GetUnitOwner()->GetAllMinionsByEntry(minionList, NPC_LICH_PET);
for (Creature* minion : minionList)
if (minion->IsAIEnabled())
minion->AI()->DoCastSelf(SPELL_LICH_PET_AURA_ONKILL);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_gen_lich_pet_aura::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_gen_lich_pet_aura::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
}
};
// 69735 - Lich Pet OnSummon
class spell_gen_lich_pet_onsummon : public SpellScript
{
PrepareSpellScript(spell_gen_lich_pet_onsummon);
bool Validate(SpellInfo const* /* spellInfo */) override
{
return ValidateSpellInfo({ SPELL_LICH_PET_AURA });
}
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
Unit* target = GetHitUnit();
target->CastSpell(target, SPELL_LICH_PET_AURA, true);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_lich_pet_onsummon::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
// 69736 - Lich Pet Aura Remove
class spell_gen_lich_pet_aura_remove : public SpellScript
{
PrepareSpellScript(spell_gen_lich_pet_aura_remove);
void HandleScriptEffect(SpellEffIndex /* effIndex */)
{
GetHitUnit()->RemoveAurasDueToSpell(SPELL_LICH_PET_AURA);
}
void Register() override
{
OnEffectHitTarget += SpellEffectFn(spell_gen_lich_pet_aura_remove::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
enum GenericLifebloom
{
SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL = 43422,
@@ -4713,6 +4787,9 @@ void AddSC_generic_spell_scripts()
new spell_gen_increase_stats_buff("spell_pri_power_word_fortitude");
new spell_gen_increase_stats_buff("spell_pri_shadow_protection");
RegisterAuraScript(spell_gen_interrupt);
RegisterAuraScript(spell_gen_lich_pet_aura);
RegisterSpellScript(spell_gen_lich_pet_onsummon);
RegisterSpellScript(spell_gen_lich_pet_aura_remove);
new spell_gen_lifebloom("spell_hexlord_lifebloom", SPELL_HEXLORD_MALACRASS_LIFEBLOOM_FINAL_HEAL);
new spell_gen_lifebloom("spell_tur_ragepaw_lifebloom", SPELL_TUR_RAGEPAW_LIFEBLOOM_FINAL_HEAL);
new spell_gen_lifebloom("spell_cenarion_scout_lifebloom", SPELL_CENARION_SCOUT_LIFEBLOOM_FINAL_HEAL);