mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
[11697] fix damage and duration of reflected spells
This commit is contained in:
parent
b3b1257625
commit
178654bbba
5 changed files with 13 additions and 9 deletions
|
|
@ -1003,7 +1003,10 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||||
else if (missInfo == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
|
else if (missInfo == SPELL_MISS_REFLECT) // In case spell reflect from target, do all effect on caster (if hit)
|
||||||
{
|
{
|
||||||
if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
|
if (target->reflectResult == SPELL_MISS_NONE) // If reflected spell hit caster -> do all effect on him
|
||||||
DoSpellHitOnUnit(m_caster, mask);
|
{
|
||||||
|
DoSpellHitOnUnit(m_caster, mask, true);
|
||||||
|
unitTarget = m_caster;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(missInfo == SPELL_MISS_MISS || missInfo == SPELL_MISS_RESIST)
|
else if(missInfo == SPELL_MISS_MISS || missInfo == SPELL_MISS_RESIST)
|
||||||
{
|
{
|
||||||
|
|
@ -1144,7 +1147,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
|
||||||
((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
|
((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::DoSpellHitOnUnit(Unit *unit, uint32 effectMask)
|
void Spell::DoSpellHitOnUnit(Unit *unit, uint32 effectMask, bool isReflected)
|
||||||
{
|
{
|
||||||
if (!unit || !effectMask)
|
if (!unit || !effectMask)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1295,7 +1298,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, uint32 effectMask)
|
||||||
if (duration > 0)
|
if (duration > 0)
|
||||||
{
|
{
|
||||||
int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup, m_spellInfo);
|
int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup, m_spellInfo);
|
||||||
unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_caster, m_diminishLevel, limitduration);
|
unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_caster, m_diminishLevel, limitduration, isReflected);
|
||||||
|
|
||||||
// Fully diminished
|
// Fully diminished
|
||||||
if (duration == 0)
|
if (duration == 0)
|
||||||
|
|
@ -1384,7 +1387,8 @@ void Spell::HandleDelayedSpellLaunch(TargetInfo *target)
|
||||||
// Fill base damage struct (unitTarget - is real spell target)
|
// Fill base damage struct (unitTarget - is real spell target)
|
||||||
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
|
||||||
|
|
||||||
if (missInfo == SPELL_MISS_NONE)
|
// keep damage amount for reflected spells
|
||||||
|
if (missInfo == SPELL_MISS_NONE || missInfo == SPELL_MISS_REFLECT)
|
||||||
{
|
{
|
||||||
for (int32 effectNumber = 0; effectNumber < MAX_EFFECT_INDEX; ++effectNumber)
|
for (int32 effectNumber = 0; effectNumber < MAX_EFFECT_INDEX; ++effectNumber)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -617,7 +617,7 @@ class Spell
|
||||||
void HandleDelayedSpellLaunch(TargetInfo *target);
|
void HandleDelayedSpellLaunch(TargetInfo *target);
|
||||||
void InitializeDamageMultipliers();
|
void InitializeDamageMultipliers();
|
||||||
void ResetEffectDamageAndHeal();
|
void ResetEffectDamageAndHeal();
|
||||||
void DoSpellHitOnUnit(Unit *unit, uint32 effectMask);
|
void DoSpellHitOnUnit(Unit *unit, uint32 effectMask, bool isReflected = false);
|
||||||
void DoAllEffectOnTarget(GOTargetInfo *target);
|
void DoAllEffectOnTarget(GOTargetInfo *target);
|
||||||
void DoAllEffectOnTarget(ItemTargetInfo *target);
|
void DoAllEffectOnTarget(ItemTargetInfo *target);
|
||||||
bool IsAliveUnitPresentInTargetList();
|
bool IsAliveUnitPresentInTargetList();
|
||||||
|
|
|
||||||
|
|
@ -8909,9 +8909,9 @@ void Unit::IncrDiminishing(DiminishingGroup group)
|
||||||
m_Diminishing.push_back(DiminishingReturn(group,WorldTimer::getMSTime(),DIMINISHING_LEVEL_2));
|
m_Diminishing.push_back(DiminishingReturn(group,WorldTimer::getMSTime(),DIMINISHING_LEVEL_2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level, int32 limitduration)
|
void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level, int32 limitduration, bool isReflected)
|
||||||
{
|
{
|
||||||
if(duration == -1 || group == DIMINISHING_NONE || caster->IsFriendlyTo(this) )
|
if(duration == -1 || group == DIMINISHING_NONE || (!isReflected && caster->IsFriendlyTo(this)) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Duration of crowd control abilities on pvp target is limited by 10 sec. (2.2.0)
|
// Duration of crowd control abilities on pvp target is limited by 10 sec. (2.2.0)
|
||||||
|
|
|
||||||
|
|
@ -1149,7 +1149,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
|
||||||
|
|
||||||
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
DiminishingLevels GetDiminishing(DiminishingGroup group);
|
||||||
void IncrDiminishing(DiminishingGroup group);
|
void IncrDiminishing(DiminishingGroup group);
|
||||||
void ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration);
|
void ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster, DiminishingLevels Level, int32 limitduration, bool isReflected);
|
||||||
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
|
void ApplyDiminishingAura(DiminishingGroup group, bool apply);
|
||||||
void ClearDiminishings() { m_Diminishing.clear(); }
|
void ClearDiminishings() { m_Diminishing.clear(); }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11696"
|
#define REVISION_NR "11697"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue