fix(Script/Quest): Protecting Our Own (#19247)

* fix(Core/Spells): Gor'drek's Ointment

* Update spell_item.cpp

* ;
This commit is contained in:
avarishd
2024-07-17 14:19:48 +03:00
committed by GitHub
parent 290482e76c
commit f510e122a0
4 changed files with 57 additions and 33 deletions

View File

@@ -4021,6 +4021,36 @@ class spell_item_fel_mana_potion : public AuraScript
}
};
// 32578 - Gor'drek's Ointment
enum DreksOintment
{
NPC_THUNDERLORD_DIRE_WOLF = 20748,
SPELL_GOR_DREKS_OINTMENT = 32578
};
class spell_item_gor_dreks_ointment : public SpellScript
{
PrepareSpellScript(spell_item_gor_dreks_ointment)
SpellCastResult CheckCast()
{
if (Unit* target = GetExplTargetUnit())
{
if (target->GetEntry() == NPC_THUNDERLORD_DIRE_WOLF && !target->HasAura(SPELL_GOR_DREKS_OINTMENT))
return SPELL_CAST_OK;
if (target->GetEntry() != NPC_THUNDERLORD_DIRE_WOLF)
return SPELL_FAILED_BAD_TARGETS;
}
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
}
void Register() override
{
OnCheckCast += SpellCheckCastFn(spell_item_gor_dreks_ointment::CheckCast);
}
};
void AddSC_item_spell_scripts()
{
RegisterSpellScript(spell_item_massive_seaforium_charge);
@@ -4144,5 +4174,6 @@ void AddSC_item_spell_scripts()
RegisterSpellScript(spell_item_scroll_of_retribution);
RegisterSpellAndAuraScriptPair(spell_item_eye_of_grillok, spell_item_eye_of_grillok_aura);
RegisterSpellScript(spell_item_fel_mana_potion);
RegisterSpellScript(spell_item_gor_dreks_ointment);
}