aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-22 11:36:13 -0600
committermegamage <none@none>2008-12-22 11:36:13 -0600
commitd1a83bcaf80d9938e1c256c0e87b602b8b32e2c8 (patch)
treececcf9c050aa30bf9f468787ee1348c53d39e280
parent65ef38963ddc60e05491ca9d3e2685913c0038bb (diff)
*Fix the bug that proc stun aura is applied on self.
--HG-- branch : trunk
-rw-r--r--src/game/SpellMgr.cpp36
-rw-r--r--src/game/SpellMgr.h1
-rw-r--r--src/game/Unit.cpp21
-rw-r--r--src/game/Unit.h1
4 files changed, 47 insertions, 12 deletions
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 43bb112360c..e713116ac15 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -1987,17 +1987,29 @@ void SpellMgr::LoadSpellCustomAttr()
{
mSpellCustomAttr.resize(GetSpellStore()->GetNumRows());
- SpellEntry *tempSpell;
+ SpellEntry *spellInfo;
for(uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i)
{
mSpellCustomAttr[i] = 0;
- tempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(i);
- if(!tempSpell)
+ spellInfo = (SpellEntry*)GetSpellStore()->LookupEntry(i);
+ if(!spellInfo)
continue;
+ bool auraSpell = true;
for(uint32 j = 0; j < 3; ++j)
{
- switch(tempSpell->EffectApplyAuraName[j])
+ if(spellInfo->Effect[j] && spellInfo->Effect[j] != SPELL_EFFECT_APPLY_AURA)
+ {
+ auraSpell = false;
+ break;
+ }
+ }
+ if(auraSpell)
+ mSpellCustomAttr[i] |= SPELL_ATTR_CU_AURA_SPELL;
+
+ for(uint32 j = 0; j < 3; ++j)
+ {
+ switch(spellInfo->EffectApplyAuraName[j])
{
case SPELL_AURA_PERIODIC_DAMAGE:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
@@ -2021,7 +2033,7 @@ void SpellMgr::LoadSpellCustomAttr()
}
}
- if(tempSpell->SpellVisual == 3879)
+ if(spellInfo->SpellVisual == 3879)
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CONE_BACK;
switch(i)
@@ -2048,22 +2060,22 @@ void SpellMgr::LoadSpellCustomAttr()
case 44869: // Spectral Blast
case 45027: // Revitalize
case 45976: // Muru Portal Channel
- tempSpell->MaxAffectedTargets = 1;
+ spellInfo->MaxAffectedTargets = 1;
break;
case 41376: // Spite
case 39992: // Needle Spine
- tempSpell->MaxAffectedTargets = 3;
+ spellInfo->MaxAffectedTargets = 3;
break;
case 42005: // Bloodboil
- tempSpell->MaxAffectedTargets = 5;
+ spellInfo->MaxAffectedTargets = 5;
break;
case 8122: case 8124: case 10888: case 10890: // Psychic Scream
case 12494: // Frostbite
- tempSpell->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE;
- break;
- case 5530: // Mace spec (this will not be needed in 303
- tempSpell->rangeIndex = 13; //inf
+ spellInfo->Attributes |= SPELL_ATTR_BREAKABLE_BY_DAMAGE;
break;
+ //case 5530: // Mace spec (this will not be needed in 303
+ // spellInfo->rangeIndex = 13; //inf
+ // break;
default:
break;
}
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index abe0c39d9d0..51e6fbd1d56 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -711,6 +711,7 @@ inline bool IsProfessionSkill(uint32 skill)
#define SPELL_ATTR_CU_AURA_HOT 0x00000010
#define SPELL_ATTR_CU_AURA_DOT 0x00000020
#define SPELL_ATTR_CU_AURA_CC 0x00000040
+#define SPELL_ATTR_CU_AURA_SPELL 0x00000080
typedef std::vector<uint32> SpellCustomAttribute;
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 50691592983..1603c458932 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7693,6 +7693,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB
if(basepoints0)
CastCustomSpell(target,trigger_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura);
+ else if(spellmgr.GetSpellCustomAttr(trigger_spell_id) & SPELL_ATTR_CU_AURA_SPELL)
+ AddAura(trigger_spell_id, target);
else
CastSpell(target,trigger_spell_id,true,castItem,triggeredByAura);
@@ -12939,4 +12941,23 @@ bool Unit::IsInRaidWith(Unit const *unit) const
return p1->IsInSameRaidWith(p2);
else
return false;
+}
+
+void Unit::AddAura(uint32 spellId, Unit* target)
+{
+ if(!target)
+ return;
+
+ SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
+ if(!spellInfo)
+ return;
+
+ for(uint32 i = 0; i < 3; ++i)
+ {
+ if(spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA)
+ {
+ Aura *Aur = CreateAura(spellInfo, i, NULL, target, this);
+ target->AddAura(Aur);
+ }
+ }
} \ No newline at end of file
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 0b5e4249df6..4ef9fafe7b5 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1006,6 +1006,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
+ void AddAura(uint32 spellId, Unit *target);
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;