mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[9276] Prevent gain/lost health/powers form death persistent periodic affects.
This must solve bugs with inconsistent death states also. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
cc7a53ae16
commit
dfd5299d7e
2 changed files with 38 additions and 2 deletions
|
|
@ -6604,6 +6604,10 @@ void Aura::PeriodicTick()
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE:
|
case SPELL_AURA_PERIODIC_DAMAGE:
|
||||||
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
|
||||||
{
|
{
|
||||||
|
// don't damage target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
Unit *pCaster = GetCaster();
|
Unit *pCaster = GetCaster();
|
||||||
if(!pCaster)
|
if(!pCaster)
|
||||||
return;
|
return;
|
||||||
|
|
@ -6735,6 +6739,10 @@ void Aura::PeriodicTick()
|
||||||
case SPELL_AURA_PERIODIC_LEECH:
|
case SPELL_AURA_PERIODIC_LEECH:
|
||||||
case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
|
case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
|
||||||
{
|
{
|
||||||
|
// don't damage target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
Unit *pCaster = GetCaster();
|
Unit *pCaster = GetCaster();
|
||||||
if(!pCaster)
|
if(!pCaster)
|
||||||
return;
|
return;
|
||||||
|
|
@ -6815,10 +6823,14 @@ void Aura::PeriodicTick()
|
||||||
case SPELL_AURA_PERIODIC_HEAL:
|
case SPELL_AURA_PERIODIC_HEAL:
|
||||||
case SPELL_AURA_OBS_MOD_HEALTH:
|
case SPELL_AURA_OBS_MOD_HEALTH:
|
||||||
{
|
{
|
||||||
|
// don't heal target if not alive, mostly death persistent effects from items
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
Unit *pCaster = GetCaster();
|
Unit *pCaster = GetCaster();
|
||||||
if(!pCaster)
|
if(!pCaster)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// heal for caster damage (must be alive)
|
// heal for caster damage (must be alive)
|
||||||
if(m_target != pCaster && GetSpellProto()->SpellVisual[0] == 163 && !pCaster->isAlive())
|
if(m_target != pCaster && GetSpellProto()->SpellVisual[0] == 163 && !pCaster->isAlive())
|
||||||
return;
|
return;
|
||||||
|
|
@ -6903,6 +6915,10 @@ void Aura::PeriodicTick()
|
||||||
}
|
}
|
||||||
case SPELL_AURA_PERIODIC_MANA_LEECH:
|
case SPELL_AURA_PERIODIC_MANA_LEECH:
|
||||||
{
|
{
|
||||||
|
// don't damage target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS)
|
if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -6976,6 +6992,10 @@ void Aura::PeriodicTick()
|
||||||
}
|
}
|
||||||
case SPELL_AURA_PERIODIC_ENERGIZE:
|
case SPELL_AURA_PERIODIC_ENERGIZE:
|
||||||
{
|
{
|
||||||
|
// don't energize target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
// ignore non positive values (can be result apply spellmods to aura damage
|
// ignore non positive values (can be result apply spellmods to aura damage
|
||||||
uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
|
uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
|
||||||
|
|
||||||
|
|
@ -7001,6 +7021,10 @@ void Aura::PeriodicTick()
|
||||||
}
|
}
|
||||||
case SPELL_AURA_OBS_MOD_MANA:
|
case SPELL_AURA_OBS_MOD_MANA:
|
||||||
{
|
{
|
||||||
|
// don't energize target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
// ignore non positive values (can be result apply spellmods to aura damage
|
// ignore non positive values (can be result apply spellmods to aura damage
|
||||||
uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
|
uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0;
|
||||||
|
|
||||||
|
|
@ -7023,6 +7047,10 @@ void Aura::PeriodicTick()
|
||||||
}
|
}
|
||||||
case SPELL_AURA_POWER_BURN_MANA:
|
case SPELL_AURA_POWER_BURN_MANA:
|
||||||
{
|
{
|
||||||
|
// don't mana burn target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
Unit *pCaster = GetCaster();
|
Unit *pCaster = GetCaster();
|
||||||
if(!pCaster)
|
if(!pCaster)
|
||||||
return;
|
return;
|
||||||
|
|
@ -7069,6 +7097,10 @@ void Aura::PeriodicTick()
|
||||||
}
|
}
|
||||||
case SPELL_AURA_MOD_REGEN:
|
case SPELL_AURA_MOD_REGEN:
|
||||||
{
|
{
|
||||||
|
// don't heal target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
int32 gain = m_target->ModifyHealth(m_modifier.m_amount);
|
int32 gain = m_target->ModifyHealth(m_modifier.m_amount);
|
||||||
if (Unit *caster = GetCaster())
|
if (Unit *caster = GetCaster())
|
||||||
m_target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto());
|
m_target->getHostileRefManager().threatAssist(caster, float(gain) * 0.5f, GetSpellProto());
|
||||||
|
|
@ -7076,6 +7108,10 @@ void Aura::PeriodicTick()
|
||||||
}
|
}
|
||||||
case SPELL_AURA_MOD_POWER_REGEN:
|
case SPELL_AURA_MOD_POWER_REGEN:
|
||||||
{
|
{
|
||||||
|
// don't energize target if not alive, possible death persistent effects
|
||||||
|
if (!m_target->isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
Powers pt = m_target->getPowerType();
|
Powers pt = m_target->getPowerType();
|
||||||
if(int32(pt) != m_modifier.m_miscvalue)
|
if(int32(pt) != m_modifier.m_miscvalue)
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9275"
|
#define REVISION_NR "9276"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue