mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[10291] Use new fast/safe way for access aura in drink item spells.
Access useing aura->holder->some_effect_aura let have always pointer to exactly expected aura from same cast if this need.
This commit is contained in:
parent
ccd8f4f825
commit
b1cbb1634d
2 changed files with 21 additions and 37 deletions
|
|
@ -6917,44 +6917,9 @@ void Aura::PeriodicDummyTick()
|
||||||
switch (spell->SpellFamilyName)
|
switch (spell->SpellFamilyName)
|
||||||
{
|
{
|
||||||
case SPELLFAMILY_GENERIC:
|
case SPELLFAMILY_GENERIC:
|
||||||
|
{
|
||||||
switch (spell->Id)
|
switch (spell->Id)
|
||||||
{
|
{
|
||||||
// Drink
|
|
||||||
case 430:
|
|
||||||
case 431:
|
|
||||||
case 432:
|
|
||||||
case 1133:
|
|
||||||
case 1135:
|
|
||||||
case 1137:
|
|
||||||
case 10250:
|
|
||||||
case 22734:
|
|
||||||
case 27089:
|
|
||||||
case 34291:
|
|
||||||
case 43182:
|
|
||||||
case 43183:
|
|
||||||
case 43706:
|
|
||||||
case 46755:
|
|
||||||
case 49472: // Drink Coffee
|
|
||||||
case 57073:
|
|
||||||
case 61830:
|
|
||||||
{
|
|
||||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
|
||||||
return;
|
|
||||||
// Search SPELL_AURA_MOD_POWER_REGEN aura for this spell and add bonus
|
|
||||||
Unit::AuraList const& aura = target->GetAurasByType(SPELL_AURA_MOD_POWER_REGEN);
|
|
||||||
for(Unit::AuraList::const_iterator i = aura.begin(); i != aura.end(); ++i)
|
|
||||||
{
|
|
||||||
if ((*i)->GetId() == GetId())
|
|
||||||
{
|
|
||||||
(*i)->GetModifier()->m_amount = m_modifier.m_amount;
|
|
||||||
((Player*)target)->UpdateManaRegen();
|
|
||||||
// Disable continue
|
|
||||||
m_isPeriodic = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Forsaken Skills
|
// Forsaken Skills
|
||||||
case 7054:
|
case 7054:
|
||||||
{
|
{
|
||||||
|
|
@ -7184,6 +7149,24 @@ void Aura::PeriodicDummyTick()
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Drink (item drink spells)
|
||||||
|
if (GetEffIndex() > EFFECT_INDEX_0 && spell->EffectApplyAuraName[GetEffIndex()-1] == SPELL_AURA_MOD_POWER_REGEN)
|
||||||
|
{
|
||||||
|
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||||
|
return;
|
||||||
|
// Search SPELL_AURA_MOD_POWER_REGEN aura for this spell and add bonus
|
||||||
|
if (Aura* aura = GetHolder()->GetAuraByEffectIndex(SpellEffectIndex(GetEffIndex() - 1)))
|
||||||
|
{
|
||||||
|
aura->GetModifier()->m_amount = m_modifier.m_amount;
|
||||||
|
((Player*)target)->UpdateManaRegen();
|
||||||
|
// Disable continue
|
||||||
|
m_isPeriodic = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Prey on the Weak
|
// Prey on the Weak
|
||||||
if (spell->SpellIconID == 2983)
|
if (spell->SpellIconID == 2983)
|
||||||
{
|
{
|
||||||
|
|
@ -7200,6 +7183,7 @@ void Aura::PeriodicDummyTick()
|
||||||
target->RemoveAurasDueToSpell(58670);
|
target->RemoveAurasDueToSpell(58670);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case SPELLFAMILY_MAGE:
|
case SPELLFAMILY_MAGE:
|
||||||
{
|
{
|
||||||
// Mirror Image
|
// Mirror Image
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "10290"
|
#define REVISION_NR "10291"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue