aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/world/3.3.5/2022_02_09_04_world.sql16
-rw-r--r--src/server/scripts/Spells/spell_item.cpp29
2 files changed, 45 insertions, 0 deletions
diff --git a/sql/updates/world/3.3.5/2022_02_09_04_world.sql b/sql/updates/world/3.3.5/2022_02_09_04_world.sql
new file mode 100644
index 00000000000..23270828415
--- /dev/null
+++ b/sql/updates/world/3.3.5/2022_02_09_04_world.sql
@@ -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 `spell_dbc` 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");
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);