Scripts/Items: Fix Goblin Bomb Dispenser (#27749)

Closes #26523

(cherry picked from commit 2cb970c66387137c3593184a0d392afb153cf56d)
This commit is contained in:
offl
2022-03-26 14:13:43 +01:00
committed by Shauren
parent be0cdecb43
commit 68df48acaa
2 changed files with 45 additions and 0 deletions
@@ -0,0 +1,16 @@
--
DELETE FROM `spell_script_names` WHERE `spell_id` = 23134 AND `ScriptName` = 'spell_item_goblin_bomb_dispenser';
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
(23134,'spell_item_goblin_bomb_dispenser');
UPDATE `creature_template` SET `minlevel` = 45, `maxlevel` = 45, `speed_walk` = 1, `speed_run` = 0.714286, `AIName` = 'SmartAI' WHERE `entry` = 8937;
UPDATE `serverside_spell` SET `SpellName` = 'Quiet Suicide' WHERE `Id` = 3617;
DELETE FROM `creature_template_addon` WHERE `entry` = 8937;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `MountCreatureID`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES
(8937, 0, 0, 0, 0, 1, 0, 0, '13260 8327');
DELETE FROM `smart_scripts` WHERE `entryorguid` = 8937 AND `source_type` = 0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
-- Despawn time is different if killed by explosion, assumedly handled by dummy effect
(8937,0,0,0,8,0,100,0,13259,0,0,0,0,41,1000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Pet Bomb - On Spellhit 'Explosion' - Delayed Despawn");
+29
View File
@@ -745,6 +745,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,
@@ -4439,6 +4467,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);