aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-09 22:31:53 -0500
committermegamage <none@none>2009-05-09 22:31:53 -0500
commit883c2ef77da57f12887cfcdbaed03bf1ea50e6b9 (patch)
tree9af1daa29cfacf371ef41a4b36a3ab9b976fa8ca
parent67876f9dfe14783e9c81bf5a8bab6843d30b22bc (diff)
*Do not allow persistant auras from the same caster stack on target.
--HG-- branch : trunk
-rw-r--r--src/game/Creature.cpp6
-rw-r--r--src/game/GridNotifiersImpl.h7
-rw-r--r--src/game/SpellAuras.cpp6
-rw-r--r--src/game/Unit.cpp14
-rw-r--r--src/game/Unit.h2
5 files changed, 18 insertions, 17 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 01f43ac8163..a47afda5cd2 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -164,8 +164,8 @@ Creature::~Creature()
i_AI = NULL;
}
- if(m_uint32Values)
- sLog.outDetail("Deconstruct Creature Entry = %u", GetEntry());
+ //if(m_uint32Values)
+ // sLog.outDetail("Deconstruct Creature Entry = %u", GetEntry());
}
void Creature::AddToWorld()
@@ -2105,7 +2105,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
continue;
}
- AddAuraEffect(AdditionalSpellInfo->Id, cAura->effect_idx, this);
+ AddAuraEffect(AdditionalSpellInfo, cAura->effect_idx, this);
sLog.outDebug("Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[cAura->effect_idx],GetGUIDLow(),GetEntry());
}
}
diff --git a/src/game/GridNotifiersImpl.h b/src/game/GridNotifiersImpl.h
index 7726d5647bd..7b7911820c6 100644
--- a/src/game/GridNotifiersImpl.h
+++ b/src/game/GridNotifiersImpl.h
@@ -178,8 +178,11 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
if (i_dynobject.IsAffecting(target))
return;
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
uint32 eff_index = i_dynobject.GetEffIndex();
+ if(target->HasAuraEffect(i_dynobject.GetSpellId(), eff_index, i_check->GetGUID()))
+ return;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(i_dynobject.GetSpellId());
if(spellInfo->EffectImplicitTargetB[eff_index] == TARGET_DEST_DYNOBJ_ALLY
|| spellInfo->EffectImplicitTargetB[eff_index] == TARGET_UNIT_AREA_ALLY_DST)
{
@@ -205,7 +208,7 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index))
return;
// Apply PersistentAreaAura on target
- target->AddAuraEffect(spellInfo->Id, eff_index, i_dynobject.GetCaster());
+ target->AddAuraEffect(spellInfo, eff_index, i_dynobject.GetCaster());
i_dynobject.AddAffected(target);
}
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index f9bdc6fcd88..b8f65626e7d 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -750,7 +750,7 @@ void AreaAuraEffect::Update(uint32 diff)
// recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?)
//if(actualSpellInfo != GetSpellProto())
// actualBasePoints = actualSpellInfo->EffectBasePoints[m_effIndex];
- Aura * aur = (*tIter)->AddAuraEffect(actualSpellInfo->Id, GetEffIndex(), caster, &m_currentBasePoints);
+ (*tIter)->AddAuraEffect(actualSpellInfo, GetEffIndex(), caster, &m_currentBasePoints);
if(m_areaAuraType == AREA_AURA_ENEMY)
caster->CombatStart(*tIter);
@@ -5698,6 +5698,7 @@ void AuraEffect::PeriodicTick()
if(!pCaster)
return;
+ // Consecrate ticks can miss and will not show up in the combat log
if( GetSpellProto()->Effect[GetEffIndex()]==SPELL_EFFECT_PERSISTENT_AREA_AURA &&
pCaster->SpellHitResult(m_target,GetSpellProto(),false)!=SPELL_MISS_NONE)
return;
@@ -5746,7 +5747,8 @@ void AuraEffect::PeriodicTick()
}
}
m_amount = 100 * m_tickNumber;
- }break;
+ break;
+ }
default:
break;
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 6bd9c52c7d5..7a3385acabf 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -13610,16 +13610,12 @@ void Unit::AddAura(uint32 spellId, Unit* target)
target->AddAura(Aur);
}
-Aura * Unit::AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster, int32 * basePoints)
+Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints)
{
- SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
- if(!spellInfo || !caster)
- return NULL;
-
// can't do that for passive auras - they stack from same caster so there is no way to get exact aura which should get effect
//assert (!IsPassiveSpell(spellInfo));
- Aura * aur = GetAura(spellId, caster->GetGUID());
+ Aura *aur = GetAura(spellInfo->Id, caster->GetGUID());
if (aur)
{
@@ -13636,10 +13632,10 @@ Aura * Unit::AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster, int32 *
aur = new Aura(spellInfo, 1<<effIndex, amount, this ,caster);
}
else
- {
aur = new Aura(spellInfo, 1<<effIndex, NULL, this ,caster);
- }
- AddAura(aur);
+
+ if(!AddAura(aur))
+ return NULL;
}
return aur;
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 49e8264b277..5d08cbfa2fb 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1188,7 +1188,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void AddAura(uint32 spellId, Unit *target);
void HandleAuraEffect(AuraEffect * aureff, bool apply);
- Aura *AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster, int32 * basePoints=NULL);
+ Aura *AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints=NULL);
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;