mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 07:36:23 +00:00
fix(Spells/Scripts): Gnomish Poultryizer (#15554)
fix(Spells/Scripts): Gnomish Poultryizer not breaking on damage
This commit is contained in:
@@ -2975,8 +2975,9 @@ class spell_item_nigh_invulnerability : public SpellScript
|
||||
|
||||
enum Poultryzer
|
||||
{
|
||||
SPELL_POULTRYIZER_SUCCESS = 30501,
|
||||
SPELL_POULTRYIZER_BACKFIRE = 30504,
|
||||
SPELL_POULTRYIZER_SUCCESS_1 = 30501,
|
||||
SPELL_POULTRYIZER_SUCCESS_2 = 30504, // malfunction
|
||||
SPELL_POULTRYIZER_BACKFIRE = 30506, // Not removed on damage
|
||||
};
|
||||
|
||||
class spell_item_poultryizer : public SpellScript
|
||||
@@ -2985,13 +2986,22 @@ class spell_item_poultryizer : public SpellScript
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_POULTRYIZER_SUCCESS, SPELL_POULTRYIZER_BACKFIRE });
|
||||
return ValidateSpellInfo({ SPELL_POULTRYIZER_SUCCESS_1, SPELL_POULTRYIZER_SUCCESS_2, SPELL_POULTRYIZER_BACKFIRE });
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /* effIndex */)
|
||||
{
|
||||
if (GetCastItem() && GetHitUnit())
|
||||
GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS : SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem());
|
||||
{
|
||||
if (roll_chance_i(80))
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), roll_chance_i(80) ? SPELL_POULTRYIZER_SUCCESS_1 : SPELL_POULTRYIZER_SUCCESS_2, true, GetCastItem());
|
||||
}
|
||||
else
|
||||
{
|
||||
GetCaster()->CastSpell(GetCaster(), SPELL_POULTRYIZER_BACKFIRE, true, GetCastItem());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
|
||||
Reference in New Issue
Block a user