mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
*Fix the bug that proc stun aura is applied on self.
--HG-- branch : trunk
This commit is contained in:
@@ -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)
|
||||
{
|
||||
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(tempSpell->EffectApplyAuraName[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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user