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 committed Feb 4, 2024
1 parent 35c803c commit 2f13fea
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 7 deletions.
4 changes: 4 additions & 0 deletions sql/base/dbc/cmangos_fixes/Spell.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3172,6 +3172,10 @@ INSERT INTO spell_template(Id, SchoolMask, Category, Dispel, Mechanic, Attribute
INSERT INTO spell_template(Id, SchoolMask, Category, Dispel, Mechanic, Attributes, AttributesEx, AttributesEx2, AttributesEx3, AttributesEx4, AttributesEx5, Stances, StancesNot, Targets, TargetCreatureType, RequiresSpellFocus, CasterAuraState, TargetAuraState, CasterAuraStateNot, TargetAuraStateNot, CastingTimeIndex, RecoveryTime, CategoryRecoveryTime, InterruptFlags, AuraInterruptFlags, ChannelInterruptFlags, procFlags, procChance, procCharges, maxLevel, baseLevel, spellLevel, DurationIndex, powerType, manaCost, manaCostPerLevel, manaPerSecond, manaPerSecondPerLevel, rangeIndex, speed, StackAmount, Totem1, Totem2, Reagent1, Reagent2, Reagent3, Reagent4, Reagent5, Reagent6, Reagent7, Reagent8, ReagentCount1, ReagentCount2, ReagentCount3, ReagentCount4, ReagentCount5, ReagentCount6, ReagentCount7, ReagentCount8, EquippedItemClass, EquippedItemSubClassMask, EquippedItemInventoryTypeMask, Effect1, Effect2, Effect3, EffectDieSides1, EffectDieSides2, EffectDieSides3, EffectBaseDice1, EffectBaseDice2, EffectBaseDice3, EffectDicePerLevel1, EffectDicePerLevel2, EffectDicePerLevel3, EffectRealPointsPerLevel1, EffectRealPointsPerLevel2, EffectRealPointsPerLevel3, EffectBasePoints1, EffectBasePoints2, EffectBasePoints3, EffectMechanic1, EffectMechanic2, EffectMechanic3, EffectImplicitTargetA1, EffectImplicitTargetA2, EffectImplicitTargetA3, EffectImplicitTargetB1, EffectImplicitTargetB2, EffectImplicitTargetB3, EffectRadiusIndex1, EffectRadiusIndex2, EffectRadiusIndex3, EffectApplyAuraName1, EffectApplyAuraName2, EffectApplyAuraName3, EffectAmplitude1, EffectAmplitude2, EffectAmplitude3, EffectMultipleValue1, EffectMultipleValue2, EffectMultipleValue3, EffectChainTarget1, EffectChainTarget2, EffectChainTarget3, EffectItemType1, EffectItemType2, EffectItemType3, EffectMiscValue1, EffectMiscValue2, EffectMiscValue3, EffectMiscValueB1, EffectMiscValueB2, EffectMiscValueB3, EffectTriggerSpell1, EffectTriggerSpell2, EffectTriggerSpell3, EffectPointsPerComboPoint1, EffectPointsPerComboPoint2, EffectPointsPerComboPoint3, SpellVisual, SpellIconID, activeIconID, spellPriority, SpellName, SpellName2, SpellName3, SpellName4, SpellName5, SpellName6, SpellName7, SpellName8, ManaCostPercentage, StartRecoveryCategory, StartRecoveryTime, MaxTargetLevel, SpellFamilyName, SpellFamilyFlags, MaxAffectedTargets, DmgClass, PreventionType, DmgMultiplier1, DmgMultiplier2, DmgMultiplier3, TotemCategory1, TotemCategory2, AreaId, IsServerSide) VALUES
('44288', '8', '0', '4', '11', '786880', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '20', '20', '0', '0', '70', '70', '21', '0', '0', '0', '0', '0', '2', '30', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '0', '6', '0', '0', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '42', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '44289', '0', '0', '0', '0', '0', '0', '163', '0', '0', 'Crippling Poison', '', '', '', '', '', '', '', '0', '0', '0', '0', '8', '0', '0', '1', '0', '1', '1', '1', '0', '0', '0', 2);

-- Pet Bomb Passive used by Pet Bomb (item Goblin Bomb Dispenser)
INSERT INTO spell_template (Id, Category, CastUI, Dispel, Mechanic, Attributes, AttributesEx, AttributesEx2, AttributesEx3, AttributesEx4, Stances, StancesNot, Targets, TargetCreatureType, RequiresSpellFocus, CasterAuraState, TargetAuraState, CastingTimeIndex, RecoveryTime, CategoryRecoveryTime, InterruptFlags, AuraInterruptFlags, ChannelInterruptFlags, ProcFlags, ProcChance, ProcCharges, MaxLevel, BaseLevel, SpellLevel, DurationIndex, PowerType, ManaCost, ManaCostPerlevel, ManaPerSecond, ManaPerSecondPerLevel, RangeIndex, Speed, ModalNextSpell, StackAmount, Totem1, Totem2, Reagent1, Reagent2, Reagent3, Reagent4, Reagent5, Reagent6, Reagent7, Reagent8, ReagentCount1, ReagentCount2, ReagentCount3, ReagentCount4, ReagentCount5, ReagentCount6, ReagentCount7, ReagentCount8, EquippedItemClass, EquippedItemSubClassMask, EquippedItemInventoryTypeMask, Effect1, Effect2, Effect3, EffectDieSides1, EffectDieSides2, EffectDieSides3, EffectBaseDice1, EffectBaseDice2, EffectBaseDice3, EffectDicePerLevel1, EffectDicePerLevel2, EffectDicePerLevel3, EffectRealPointsPerLevel1, EffectRealPointsPerLevel2, EffectRealPointsPerLevel3, EffectBasePoints1, EffectBasePoints2, EffectBasePoints3, EffectMechanic1, EffectMechanic2, EffectMechanic3, EffectImplicitTargetA1, EffectImplicitTargetA2, EffectImplicitTargetA3, EffectImplicitTargetB1, EffectImplicitTargetB2, EffectImplicitTargetB3, EffectRadiusIndex1, EffectRadiusIndex2, EffectRadiusIndex3, EffectApplyAuraName1, EffectApplyAuraName2, EffectApplyAuraName3, EffectAmplitude1, EffectAmplitude2, EffectAmplitude3, EffectMultipleValue1, EffectMultipleValue2, EffectMultipleValue3, EffectChainTarget1, EffectChainTarget2, EffectChainTarget3, EffectItemType1, EffectItemType2, EffectItemType3, EffectMiscValue1, EffectMiscValue2, EffectMiscValue3, EffectTriggerSpell1, EffectTriggerSpell2, EffectTriggerSpell3, EffectPointsPerComboPoint1, EffectPointsPerComboPoint2, EffectPointsPerComboPoint3, SpellVisual, SpellIconID, ActiveIconID, SpellPriority, SpellName, SpellName2, SpellName3, SpellName4, SpellName5, SpellName6, SpellName7, SpellName8, Rank1, Rank2, Rank3, Rank4, Rank5, Rank6, Rank7, Rank8, ManaCostPercentage, StartRecoveryCategory, StartRecoveryTime, MaxTargetLevel, SpellFamilyName, SpellFamilyFlags, MaxAffectedTargets, DmgClass, PreventionType, StanceBarOrder, DmgMultiplier1, DmgMultiplier2, DmgMultiplier3, MinFactionId, MinReputation, RequiredAuraVision, SchoolMask, IsServerSide, AttributesServerside) VALUES
('13260', '0', '0', '0', '0', '262608', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '4', '100', '1', '0', '30', '30', '21', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '-1', '0', '6', '0', '0', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '42', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '13259', '0', '0', '0', '0', '0', '0', '11', '0', '0', 'Pet Bomb Passive', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '-1', '1', '1', '1', '0', '0', '0', '1', '0', '0');

-- ============================================================
-- WOTLK section
-- ============================================================
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 @@ -332,6 +332,42 @@ struct ArgussianCompass : public AuraScript
if (max_absorb < currentAbsorb)
currentAbsorb = max_absorb;
}
};

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()
Expand Down Expand Up @@ -367,4 +403,6 @@ void AddSC_item_scripts()
RegisterSpellScript<BanishExile>("spell_banish_exile");
RegisterSpellScript<OrbOfDeception>("spell_orb_of_deception");
RegisterSpellScript<ArgussianCompass>("spell_argussian_compass");
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 @@ -1168,13 +1168,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 @@ -614,6 +614,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 2f13fea

Please sign in to comment.