mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
Apply diminishing only on 1 spell aura add/begin timing only on last spell aura removed
Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
parent
d469a604eb
commit
c9ae3b8b5c
2 changed files with 15 additions and 19 deletions
|
|
@ -941,10 +941,6 @@ void Aura::_AddAura()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// register aura
|
|
||||||
if (getDiminishGroup() != DIMINISHING_NONE )
|
|
||||||
m_target->ApplyDiminishingAura(getDiminishGroup(),true);
|
|
||||||
|
|
||||||
Unit* caster = GetCaster();
|
Unit* caster = GetCaster();
|
||||||
|
|
||||||
// passive auras (except totem auras) do not get placed in the slots
|
// passive auras (except totem auras) do not get placed in the slots
|
||||||
|
|
@ -967,6 +963,10 @@ void Aura::_AddAura()
|
||||||
//*****************************************************
|
//*****************************************************
|
||||||
if (!secondaura)
|
if (!secondaura)
|
||||||
{
|
{
|
||||||
|
// register aura diminishing on apply
|
||||||
|
if (getDiminishGroup() != DIMINISHING_NONE )
|
||||||
|
m_target->ApplyDiminishingAura(getDiminishGroup(),true);
|
||||||
|
|
||||||
// Update Seals information
|
// Update Seals information
|
||||||
if (IsSealSpell(m_spellProto))
|
if (IsSealSpell(m_spellProto))
|
||||||
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);
|
m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true);
|
||||||
|
|
@ -1010,10 +1010,6 @@ void Aura::_RemoveAura()
|
||||||
dynObj->RemoveAffected(m_target);
|
dynObj->RemoveAffected(m_target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// unregister aura
|
|
||||||
if (getDiminishGroup() != DIMINISHING_NONE )
|
|
||||||
m_target->ApplyDiminishingAura(getDiminishGroup(),false);
|
|
||||||
|
|
||||||
//passive auras do not get put in slots
|
//passive auras do not get put in slots
|
||||||
// Note: but totem can be not accessible for aura target in time remove (to far for find in grid)
|
// Note: but totem can be not accessible for aura target in time remove (to far for find in grid)
|
||||||
//if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem()))
|
//if(m_isPassive && !(caster && caster->GetTypeId() == TYPEID_UNIT && ((Creature*)caster)->isTotem()))
|
||||||
|
|
@ -1048,6 +1044,10 @@ void Aura::_RemoveAura()
|
||||||
// only remove icon when the last aura of the spell is removed (current aura already removed from list)
|
// only remove icon when the last aura of the spell is removed (current aura already removed from list)
|
||||||
if (lastaura)
|
if (lastaura)
|
||||||
{
|
{
|
||||||
|
// unregister aura diminishing (and store last time)
|
||||||
|
if (getDiminishGroup() != DIMINISHING_NONE )
|
||||||
|
m_target->ApplyDiminishingAura(getDiminishGroup(),false);
|
||||||
|
|
||||||
SetAura(true);
|
SetAura(true);
|
||||||
SetAuraFlags(AFLAG_NONE);
|
SetAuraFlags(AFLAG_NONE);
|
||||||
SetAuraLevel(0);
|
SetAuraLevel(0);
|
||||||
|
|
|
||||||
|
|
@ -9457,21 +9457,15 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
|
||||||
void Unit::IncrDiminishing(DiminishingGroup group)
|
void Unit::IncrDiminishing(DiminishingGroup group)
|
||||||
{
|
{
|
||||||
// Checking for existing in the table
|
// Checking for existing in the table
|
||||||
bool IsExist = false;
|
|
||||||
for(Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i)
|
for(Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i)
|
||||||
{
|
{
|
||||||
if(i->DRGroup != group)
|
if(i->DRGroup != group)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
IsExist = true;
|
|
||||||
if(i->hitCount < DIMINISHING_LEVEL_IMMUNE)
|
if(i->hitCount < DIMINISHING_LEVEL_IMMUNE)
|
||||||
i->hitCount += 1;
|
i->hitCount += 1;
|
||||||
|
return;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
m_Diminishing.push_back(DiminishingReturn(group,getMSTime(),DIMINISHING_LEVEL_2));
|
||||||
if(!IsExist)
|
|
||||||
m_Diminishing.push_back(DiminishingReturn(group,getMSTime(),DIMINISHING_LEVEL_2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level)
|
void Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration,Unit* caster,DiminishingLevels Level)
|
||||||
|
|
@ -9520,13 +9514,15 @@ void Unit::ApplyDiminishingAura( DiminishingGroup group, bool apply )
|
||||||
if(i->DRGroup != group)
|
if(i->DRGroup != group)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
i->hitTime = getMSTime();
|
|
||||||
|
|
||||||
if(apply)
|
if(apply)
|
||||||
i->stack += 1;
|
i->stack += 1;
|
||||||
else if(i->stack)
|
else if(i->stack)
|
||||||
|
{
|
||||||
i->stack -= 1;
|
i->stack -= 1;
|
||||||
|
// Remember time after last aura from group removed
|
||||||
|
if (i->stack == 0)
|
||||||
|
i->hitTime = getMSTime();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue