diff options
author | offl <11556157+offl@users.noreply.github.com> | 2022-02-09 15:13:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-09 15:13:12 +0200 |
commit | 2cb970c66387137c3593184a0d392afb153cf56d (patch) | |
tree | aab72aa9f3dd60c3ce8d7d43d16c62747e0b6fe9 /src | |
parent | f872d6eb3402eeb868f5f2e1cd7eb706f7852028 (diff) |
Scripts/Items: Fix Goblin Bomb Dispenser (#27749)
Closes #26523
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 952a7bb4d1a..1fd8036c825 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -680,6 +680,34 @@ class spell_item_decahedral_dwarven_dice : public SpellScript } }; +enum GoblinBombDispenser +{ + SPELL_SUMMON_GOBLIN_BOMB = 13258, + SPELL_MALFUNCTION_EXPLOSION = 13261 +}; + +// 23134 - Goblin Bomb +class spell_item_goblin_bomb_dispenser : public SpellScript +{ + PrepareSpellScript(spell_item_goblin_bomb_dispenser); + + bool Validate(SpellInfo const* /*spell*/) override + { + return ValidateSpellInfo({ SPELL_SUMMON_GOBLIN_BOMB, SPELL_MALFUNCTION_EXPLOSION }); + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Item* item = GetCastItem()) + GetCaster()->CastSpell(GetCaster(), roll_chance_i(95) ? SPELL_SUMMON_GOBLIN_BOMB : SPELL_MALFUNCTION_EXPLOSION, item); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_item_goblin_bomb_dispenser::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } +}; + enum GoblinWeatherMachine { SPELL_PERSONALIZED_WEATHER1 = 46740, @@ -4197,6 +4225,7 @@ void AddSC_item_spell_scripts() new spell_item_deathbringers_will<SPELL_STRENGTH_OF_THE_TAUNKA, SPELL_AGILITY_OF_THE_VRYKUL, SPELL_POWER_OF_THE_TAUNKA, SPELL_AIM_OF_THE_IRON_DWARVES, SPELL_SPEED_OF_THE_VRYKUL>("spell_item_deathbringers_will_normal"); new spell_item_deathbringers_will<SPELL_STRENGTH_OF_THE_TAUNKA_HERO, SPELL_AGILITY_OF_THE_VRYKUL_HERO, SPELL_POWER_OF_THE_TAUNKA_HERO, SPELL_AIM_OF_THE_IRON_DWARVES_HERO, SPELL_SPEED_OF_THE_VRYKUL_HERO>("spell_item_deathbringers_will_heroic"); RegisterSpellScript(spell_item_decahedral_dwarven_dice); + RegisterSpellScript(spell_item_goblin_bomb_dispenser); RegisterSpellScript(spell_item_goblin_weather_machine); new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL); new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL); |