diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index bf1666c8c..aa365f4c4 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -8563,34 +8563,35 @@ void Spell::EffectSummonObject(SpellEffectIndex eff_idx) void Spell::EffectResurrect(SpellEffectIndex /*eff_idx*/) { - if(!unitTarget) - return; - if(unitTarget->GetTypeId() != TYPEID_PLAYER) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - if(unitTarget->isAlive()) - return; - if(!unitTarget->IsInWorld()) + if (unitTarget->isAlive() || !unitTarget->IsInWorld()) return; switch (m_spellInfo->Id) { - // Defibrillate (Goblin Jumper Cables) have 33% chance on success - case 8342: - if (roll_chance_i(67)) + case 8342: // Defibrillate (Goblin Jumper Cables) has 33% chance on success + case 22999: // Defibrillate (Goblin Jumper Cables XL) has 50% chance on success + case 54732: // Defibrillate (Gnomish Army Knife) has 67% chance on success + { + uint32 failChance = 0; + uint32 failSpellId = 0; + switch (m_spellInfo->Id) { - m_caster->CastSpell(m_caster, 8338, true, m_CastItem); - return; - } - break; - // Defibrillate (Goblin Jumper Cables XL) have 50% chance on success - case 22999: - if (roll_chance_i(50)) - { - m_caster->CastSpell(m_caster, 23055, true, m_CastItem); + case 8342: failChance=67; failSpellId = 8338; break; + case 22999: failChance=50; failSpellId = 23055; break; + case 54732: failChance=33; failSpellId = 0; break; + } + + if (roll_chance_i(failChance)) + { + if (failSpellId) + m_caster->CastSpell(m_caster, failSpellId, true, m_CastItem); return; } break; + } default: break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 05e92c4bd..d0a9222ae 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11997" + #define REVISION_NR "11998" #endif // __REVISION_NR_H__