Skip to content

Commit

Permalink
Spell/Engineering: Goblin Bomb Dispenser
Browse files Browse the repository at this point in the history
* Use item 10587 "Goblin Bomb Dispenser" - casts spell 23134 "Goblin Bomb"
* 10% chance to malfunction with spell 13261 "Malfunction Explosion or 90% chance to proceed with spell 13258 "Summon Goblin Bomb"
* Creature 8937 "Pet Bomb" is summoned - level is player's engineering skill divided by 5
* Pet Bomb has aura 13260 "Pet Bomb Passive" on spawn - triggers 13259 "Explosion" on successful melee hit

cmangos/issues#637
  • Loading branch information
MantisLord authored and killerwife committed Mar 24, 2024
1 parent c441d89 commit cefb196
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 7 deletions.
2 changes: 2 additions & 0 deletions sql/scriptdev2/spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(11889,'spell_capture_mountain_giant'),
(11610,'spell_gammerita_turtle_camera'),
(12479,'spell_hex_of_jammalan'),
(13258,'spell_summon_goblin_bomb'),
(16380,'spell_greater_invisibility_mob'),
(17016,'spell_placing_beacon_torch'),
(17244,'spell_anastari_possess'),
Expand All @@ -61,6 +62,7 @@ INSERT INTO spell_scripts(Id, ScriptName) VALUES
(20038,'spell_explosion_razorgore'),
(21651,'spell_opening_capping'),
(22858,'spell_retaliation_creature'),
(23134,'spell_goblin_bomb'),
(23226,'spell_ritual_candle_aura'),
(24228,'spell_arlokk_vanish'),
(24314,'spell_threatening_gaze'),
Expand Down
38 changes: 38 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/world/item_scripts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,42 @@ struct OrbOfDeception : public AuraScript
}
};

enum
{
SPELL_MALFUNCTION_EXPLOSION = 13261,
SPELL_SUMMON_GOBLIN_BOMB = 13258,
SPELL_PET_BOMB_PASSIVE = 13260, // triggers 13259 Explosion on successful melee hit
};

// 13258 - Summon Goblin Bomb
struct SummonGoblinBomb : public SpellScript
{
void OnSummon(Spell* spell, Creature* summon) const override
{
if (Player* player = dynamic_cast<Player*>(spell->GetCaster()))
summon->SelectLevel(uint16(player->GetSkillValue(SKILL_ENGINEERING) / 5));
summon->AI()->SetReactState(REACT_AGGRESSIVE);
summon->CastSpell(summon, SPELL_PET_BOMB_PASSIVE, TRIGGERED_OLD_TRIGGERED);
}
};

// 23134 - Goblin Bomb
struct GoblinBomb : public SpellScript
{
void OnEffectExecute(Spell* spell, SpellEffectIndex /*effIdx*/) const override
{
Unit* target = spell->GetUnitTarget();
Unit* caster = spell->GetCaster();
if (!target || !caster)
return;
uint32 roll = urand(0, 99);
if (roll < 10)
target->CastSpell(caster, SPELL_MALFUNCTION_EXPLOSION, TRIGGERED_OLD_TRIGGERED);
else
caster->CastSpell(caster, SPELL_SUMMON_GOBLIN_BOMB, TRIGGERED_OLD_TRIGGERED);
}
};

void AddSC_item_scripts()
{
Script* pNewScript = new Script;
Expand All @@ -200,4 +236,6 @@ void AddSC_item_scripts()
RegisterSpellScript<GDRPeriodicDamage>("spell_gdr_periodic");
RegisterSpellScript<BanishExile>("spell_banish_exile");
RegisterSpellScript<OrbOfDeception>("spell_orb_of_deception");
RegisterSpellScript<SummonGoblinBomb>("spell_summon_goblin_bomb");
RegisterSpellScript<GoblinBomb>("spell_goblin_bomb");
}
7 changes: 0 additions & 7 deletions src/game/Spells/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -925,13 +925,6 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)

return;
}
case 23134: // Goblin Bomb Dispenser
{
if (m_CastItem)
m_caster->CastSpell(m_caster, 13258, TRIGGERED_OLD_TRIGGERED, m_CastItem);

return;
}
case 23138: // Gate of Shazzrah
{
if (!unitTarget || m_scriptValue > 0)
Expand Down
1 change: 1 addition & 0 deletions src/game/Spells/SpellMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ inline bool IsSpellRemovedOnEvade(SpellEntry const* spellInfo)
case 12627: // Disease Cloud
case 12787: // Thrash
case 12898: // Smoke Aura Visual
case 13260: // Pet Bomb Passive
case 13299: // Poison Proc
case 13616: // Wracking Pains Proc
case 13767: // Hate to Zero (Hate to Zero)
Expand Down

0 comments on commit cefb196

Please sign in to comment.