diff options
author | QAston <none@none> | 2009-05-18 19:00:20 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-05-18 19:00:20 +0200 |
commit | 6c7f2d2b242f950ab0e80a9da546806e672d37c1 (patch) | |
tree | 905e7a9a829721f2c65cbf075c86f4f5b6d724d4 /src | |
parent | e45c57f298acfb496947be150dd379e3f39bc673 (diff) |
*Spell_proc_event entries for Malestorm Weapon - by throneinc
*Fix bug that some spells can't proc
*Add spell_proc_event entries for some items.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SharedDefines.h | 6 | ||||
-rw-r--r-- | src/game/Spell.cpp | 6 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 4 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 6 | ||||
-rw-r--r-- | src/game/Unit.cpp | 13 |
5 files changed, 20 insertions, 15 deletions
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index fd7a6840ca8..b11f86a7408 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -304,7 +304,7 @@ enum SpellCategory #define SPELL_ATTR_EX2_NOT_NEED_SHAPESHIFT 0x00080000 // 19 does not necessarly need shapeshift #define SPELL_ATTR_EX2_UNK20 0x00100000 // 20 #define SPELL_ATTR_EX2_DAMAGE_REDUCED_SHIELD 0x00200000 // 21 for ice blocks, pala immunity buffs, priest absorb shields, but used also for other spells -> not sure! -#define SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER 0x00400000 // 22 spell can trigger even if triggered +#define SPELL_ATTR_EX2_UNK22 0x00400000 // 22 spell can trigger even if triggered #define SPELL_ATTR_EX2_UNK23 0x00800000 // 23 Only mage Arcane Concentration have this flag #define SPELL_ATTR_EX2_UNK24 0x01000000 // 24 #define SPELL_ATTR_EX2_UNK25 0x02000000 // 25 @@ -312,7 +312,7 @@ enum SpellCategory #define SPELL_ATTR_EX2_UNK27 0x08000000 // 27 #define SPELL_ATTR_EX2_UNK28 0x10000000 // 28 no breaks stealth if it fails?? #define SPELL_ATTR_EX2_CANT_CRIT 0x20000000 // 29 Spell can't crit -#define SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER_2 0x40000000 // 30 spell can trigger even if triggered +#define SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER 0x40000000 // 30 spell can trigger even if triggered #define SPELL_ATTR_EX2_FOOD 0x80000000 // 31 food, well-fed, and a few others #define SPELL_ATTR_EX3_UNK0 0x00000001 // 0 @@ -324,7 +324,7 @@ enum SpellCategory #define SPELL_ATTR_EX3_UNK6 0x00000040 // 6 #define SPELL_ATTR_EX3_UNK7 0x00000080 // 7 #define SPELL_ATTR_EX3_PLAYERS_ONLY 0x00000100 // 8 Player only? -#define SPELL_ATTR_EX3_UNK9 0x00000200 // 9 +#define SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2 0x00000200 // 9 triggered from effect? #define SPELL_ATTR_EX3_MAIN_HAND 0x00000400 // 10 Main hand weapon required #define SPELL_ATTR_EX3_BATTLEGROUND 0x00000800 // 11 Can casted only on battleground #define SPELL_ATTR_EX3_UNK12 0x00001000 // 12 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 33a3e4e1599..5a68a5dee95 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -745,10 +745,12 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura) m_procEx = (m_IsTriggeredSpell) && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER) - && !(m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER_2) + && !(m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2) ? PROC_EX_INTERNAL_TRIGGERED : PROC_EX_NONE; - if (m_IsTriggeredSpell && (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER_2 | SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER)) + if (m_IsTriggeredSpell && + (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_TRIGGERED_CAN_TRIGGER || + m_spellInfo->AttributesEx3 & SPELL_ATTR_EX3_TRIGGERED_CAN_TRIGGER_2)) m_procEx |= PROC_EX_INTERNAL_CANT_PROC; // Totem casts require spellfamilymask defined in spell_proc_event to proc diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6ca43844c76..19d4b43bb38 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -346,7 +346,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= Aura::Aura(SpellEntry const* spellproto, uint32 effMask, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem, Unit * formalCaster) : m_caster_guid(0), m_castItemGuid(castItem?castItem->GetGUID():0), m_target(target), m_timeCla(1000), m_removeMode(AURA_REMOVE_BY_DEFAULT), m_AuraDRGroup(DIMINISHING_NONE), -m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false), m_isRemoved(false), m_canProc(true) +m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false), m_isRemoved(false), m_procDeep(0) { assert(target); @@ -613,8 +613,6 @@ Unit* AreaAuraEffect::GetFormalCaster() const void Aura::Update(uint32 diff) { - // Reset can proc requirement-prevent use of outdated value - m_canProc = true; if (m_duration > 0) { m_duration -= diff; diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index fc0b42f58bf..254d297a9f1 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -107,8 +107,8 @@ class TRINITY_DLL_SPEC Aura bool IsRemoved() const { return m_isRemoved; } void SetUpdated(bool val) { m_updated = val; } - bool CanProc(){return m_canProc;} - void SetCanProc(bool val){ m_canProc = val; } + bool CanProc(){return !m_procDeep;} + void SetCantProc( bool apply) {if (apply) --m_procDeep; else ++m_procDeep; assert(m_procDeep>=0);} bool IsPersistent() const; bool IsAreaAura() const; bool IsAuraType(AuraType type) const; @@ -159,7 +159,7 @@ class TRINITY_DLL_SPEC Aura AuraEffect * m_partAuras[3]; uint32 m_procDamage; // used in aura proc code - bool m_canProc:1; + int32 m_procDeep; bool m_isDeathPersist:1; bool m_isRemovedOnShapeLost:1; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8b7677e6d2f..7cfb6a1d16c 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -12012,14 +12012,14 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag if (!isTriggerAura[aurEff->GetAuraName()] && triggerData.spellProcEvent==NULL) continue; triggerData.effMask |= 1<<i; - if (procExtra & (PROC_EX_INTERNAL_TRIGGERED | PROC_EX_INTERNAL_CANT_PROC)) - itr->second->SetCanProc(false); - else - itr->second->SetCanProc(true); } } if (triggerData.effMask) + { procTriggered.push_front(triggerData); + if (procExtra & (PROC_EX_INTERNAL_TRIGGERED | PROC_EX_INTERNAL_CANT_PROC)) + itr->second->SetCantProc(true); + } } // Nothing found @@ -12189,6 +12189,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag i->aura->DropAuraCharge(); } } + + // Cleanup proc requirements + if (procExtra & (PROC_EX_INTERNAL_TRIGGERED | PROC_EX_INTERNAL_CANT_PROC)) + for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i) + i->aura->SetCantProc(false); } SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const |