mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[11998] Implement fail chance for spell 54732
Ths to stfx for porting Signed-off-by: Schmoozerd <schmoozerd@scriptdev2.com>
This commit is contained in:
parent
007420b615
commit
f13213018c
2 changed files with 20 additions and 19 deletions
|
|
@ -8563,34 +8563,35 @@ void Spell::EffectSummonObject(SpellEffectIndex eff_idx)
|
||||||
|
|
||||||
void Spell::EffectResurrect(SpellEffectIndex /*eff_idx*/)
|
void Spell::EffectResurrect(SpellEffectIndex /*eff_idx*/)
|
||||||
{
|
{
|
||||||
if(!unitTarget)
|
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
|
||||||
if(unitTarget->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(unitTarget->isAlive())
|
if (unitTarget->isAlive() || !unitTarget->IsInWorld())
|
||||||
return;
|
|
||||||
if(!unitTarget->IsInWorld())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (m_spellInfo->Id)
|
switch (m_spellInfo->Id)
|
||||||
{
|
{
|
||||||
// Defibrillate (Goblin Jumper Cables) have 33% chance on success
|
case 8342: // Defibrillate (Goblin Jumper Cables) has 33% chance on success
|
||||||
case 8342:
|
case 22999: // Defibrillate (Goblin Jumper Cables XL) has 50% chance on success
|
||||||
if (roll_chance_i(67))
|
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);
|
case 8342: failChance=67; failSpellId = 8338; break;
|
||||||
return;
|
case 22999: failChance=50; failSpellId = 23055; break;
|
||||||
}
|
case 54732: failChance=33; failSpellId = 0; break;
|
||||||
break;
|
}
|
||||||
// Defibrillate (Goblin Jumper Cables XL) have 50% chance on success
|
|
||||||
case 22999:
|
if (roll_chance_i(failChance))
|
||||||
if (roll_chance_i(50))
|
{
|
||||||
{
|
if (failSpellId)
|
||||||
m_caster->CastSpell(m_caster, 23055, true, m_CastItem);
|
m_caster->CastSpell(m_caster, failSpellId, true, m_CastItem);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11997"
|
#define REVISION_NR "11998"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue