diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Spell.cpp | 25 | ||||
| -rw-r--r-- | src/game/SpellAuras.cpp | 24 | ||||
| -rw-r--r-- | src/game/SpellEffects.cpp | 6 | ||||
| -rw-r--r-- | src/game/SpellMgr.cpp | 33 | ||||
| -rw-r--r-- | src/game/SpellMgr.h | 25 | ||||
| -rw-r--r-- | src/game/Unit.cpp | 92 |
6 files changed, 112 insertions, 93 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 99d568ee09a..f2dfb8715b7 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -757,8 +757,16 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura) default: if (IsPositiveSpell(m_spellInfo->Id)) // Check for positive spell { - m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; - m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; + if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE) + { + m_procAttacker = PROC_FLAG_SUCCESSFUL_HEALING_SPELL; + m_procVictim = PROC_FLAG_TAKEN_HEALING_SPELL; + } + else + { + m_procAttacker = PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL; + m_procVictim = PROC_FLAG_TAKEN_POSITIVE_SPELL; + } } else if (m_spellInfo->AttributesEx2 & SPELL_ATTR_EX2_AUTOREPEAT_FLAG) // Wands auto attack { @@ -767,10 +775,17 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura) } else // Negative spell { - m_procAttacker = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT; - m_procVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT; + if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE) + { + m_procAttacker = PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; + m_procVictim = PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; + } + else + { + m_procAttacker = PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT; + m_procVictim = PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT; + } } - break; } m_procEx= PROC_EX_NONE; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 7b92d6c924b..f7eb73c7b72 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5994,9 +5994,9 @@ void AuraEffect::PeriodicTick() SpellEntry const* spellProto = GetSpellProto(); // Set trigger flag - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; - uint32 procEx = PROC_EX_INTERNAL_DOT | PROC_EX_NORMAL_HIT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; + uint32 procEx = PROC_EX_NORMAL_HIT; pdamage = (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist); if (pdamage) procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE; @@ -6060,9 +6060,9 @@ void AuraEffect::PeriodicTick() int32 stackAmount = GetParentAura()->GetStackAmount(); // Set trigger flag - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; - uint32 procEx = PROC_EX_INTERNAL_DOT | PROC_EX_NORMAL_HIT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; + uint32 procEx = PROC_EX_NORMAL_HIT; pdamage = (pdamage <= absorb+resist) ? 0 : (pdamage-absorb-resist); if (pdamage) procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE; @@ -6161,9 +6161,9 @@ void AuraEffect::PeriodicTick() } } - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; - uint32 procEx = PROC_EX_INTERNAL_HOT | PROC_EX_NORMAL_HIT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_HEALING_SPELL; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_HEALING_SPELL; + uint32 procEx = PROC_EX_NORMAL_HIT; // ignore item heals if(!haveCastItem) pCaster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, pdamage, BASE_ATTACK, spellProto); @@ -6358,9 +6358,9 @@ void AuraEffect::PeriodicTick() pCaster->SendSpellNonMeleeDamageLog(&damageInfo); // Set trigger flag - uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC; - uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC; - uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE) | PROC_EX_INTERNAL_DOT; + uint32 procAttacker = PROC_FLAG_ON_DO_PERIODIC | PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT; + uint32 procVictim = PROC_FLAG_ON_TAKE_PERIODIC | PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT; + uint32 procEx = createProcExtendMask(&damageInfo, SPELL_MISS_NONE); if (damageInfo.damage) procVictim|=PROC_FLAG_TAKEN_ANY_DAMAGE; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 35e52f2208c..fc6f0625da3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1908,6 +1908,12 @@ void Spell::EffectDummy(uint32 i) unitTarget->CastSpell(m_caster, damage, true); return; } + // Hungering Cold + else if (m_spellInfo->SpellFamilyFlags[1] & 0x1000) + { + unitTarget->CastSpell(m_caster, 51209, true); + return; + } break; } diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index d5c611a4cbe..98c64dac31c 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1249,7 +1249,7 @@ void SpellMgr::LoadSpellBonusess() sLog.outString( ">> Loaded %u extra spell bonus data", count); } -bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active) +bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra) { // No extra req need uint32 procEvent_procEx = PROC_EX_NONE; @@ -1262,36 +1262,36 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr /* Check Periodic Auras - * Both hots and dots can trigger if spell has no PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL - nor PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT + * Both hots and dots can trigger if spell has no PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT + nor PROC_FLAG_SUCCESSFUL_HEALING_SPELL - *Only Hots can trigger if spell has PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL + *Only Hots can trigger if spell has PROC_FLAG_SUCCESSFUL_HEALING_SPELL - *Only dots can trigger if spell has both positivity flags or PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT + *Only dots can trigger if spell has both positivity flags or PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT */ if (procFlags & PROC_FLAG_ON_DO_PERIODIC) { - if (EventProcFlag & PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT) + if (EventProcFlag & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT) { - if (!(procExtra & PROC_EX_INTERNAL_DOT)) + if (!(procFlags & PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT)) return false; } - else if (EventProcFlag & PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL - && !(procExtra & PROC_EX_INTERNAL_HOT)) + else if (EventProcFlag & PROC_FLAG_SUCCESSFUL_HEALING_SPELL + && !(procFlags & PROC_FLAG_SUCCESSFUL_HEALING_SPELL)) return false; } if (procFlags & PROC_FLAG_ON_TAKE_PERIODIC) { - if (EventProcFlag & PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT) + if (EventProcFlag & PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT) { - if (!(procExtra & PROC_EX_INTERNAL_DOT)) + if (!(procFlags & PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT)) return false; } - else if (EventProcFlag & PROC_FLAG_TAKEN_POSITIVE_SPELL - && !(procExtra & PROC_EX_INTERNAL_HOT)) + else if (EventProcFlag & PROC_FLAG_TAKEN_HEALING_SPELL + && !(procFlags & PROC_FLAG_TAKEN_HEALING_SPELL)) return false; } @@ -1325,7 +1325,6 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr { if ((spellProcEvent->spellFamilyMask & procSpell->SpellFamilyFlags ) == 0) return false; - active = true; // Spell added manualy -> so its active spell hasFamilyMask = true; } } @@ -1340,8 +1339,8 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr // Check for extra req (if none) and hit/crit if (procEvent_procEx == PROC_EX_NONE) { - // No extra req, so can trigger only for active (damage/healing present) and hit/crit - if((procExtra & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT)) && active) + // No extra req, so can trigger only for hit/crit + if((procExtra & (PROC_EX_NORMAL_HIT|PROC_EX_CRITICAL_HIT))) return true; } else // Passive spells hits here only if resist/reflect/immune/evade @@ -1350,7 +1349,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr if ((procExtra & AURA_SPELL_PROC_EX_MASK) && (procEvent_procEx & PROC_EX_EX_TRIGGER_ALWAYS)) return true; // Passive spells can`t trigger if need hit - if ((procEvent_procEx & PROC_EX_NORMAL_HIT) && !active) + if ((procEvent_procEx & PROC_EX_NORMAL_HIT)) return false; // Check Extra Requirement like (hit/crit/miss/resist/parry/dodge/block/immune/reflect/absorb and other) if (procEvent_procEx & procExtra) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index a1f52a07eaa..330dfd56eee 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -405,17 +405,17 @@ enum ProcFlags PROC_FLAG_SUCCESSFUL_RANGED_SPELL_HIT = 0x00000100, // 08 Successful Ranged attack by Spell that use ranged weapon PROC_FLAG_TAKEN_RANGED_SPELL_HIT = 0x00000200, // 09 Taken damage by Spell that use ranged weapon - PROC_FLAG_SUCCESSFUL_POSITIVE_AOE_HIT = 0x00000400, // 10 Successful AoE (not 100% shure unused) - PROC_FLAG_TAKEN_POSITIVE_AOE = 0x00000800, // 11 Taken AoE (not 100% shure unused) + PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL = 0x00000400, // 10 Successful Positive spell hit + PROC_FLAG_TAKEN_POSITIVE_SPELL = 0x00000800, // 11 Taken Positive spell hit - PROC_FLAG_SUCCESSFUL_AOE_SPELL_HIT = 0x00001000, // 12 Successful AoE damage spell hit (not 100% shure unused) - PROC_FLAG_TAKEN_AOE_SPELL_HIT = 0x00002000, // 13 Taken AoE damage spell hit (not 100% shure unused) + PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00001000, // 12 Successful Negative spell hit + PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00002000, // 13 Taken Negative spell hit - PROC_FLAG_SUCCESSFUL_POSITIVE_SPELL = 0x00004000, // 14 Successful cast positive spell (by default only on healing) - PROC_FLAG_TAKEN_POSITIVE_SPELL = 0x00008000, // 15 Taken positive spell hit (by default only on healing) + PROC_FLAG_SUCCESSFUL_HEALING_SPELL = 0x00004000, // 14 Successful Direct Heal spell hit + PROC_FLAG_TAKEN_HEALING_SPELL = 0x00008000, // 15 Taken Direct Heal spell hit - PROC_FLAG_SUCCESSFUL_NEGATIVE_SPELL_HIT = 0x00010000, // 16 Successful negative spell cast (by default only on damage) - PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT = 0x00020000, // 17 Taken negative spell (by default only on damage) + PROC_FLAG_SUCCESSFUL_DAMAGING_SPELL_HIT = 0x00010000, // 16 Successful Direct Damage spell hit + PROC_FLAG_TAKEN_DAMAGING_SPELL_HIT = 0x00020000, // 17 Taken Direct Damage spell hit PROC_FLAG_ON_DO_PERIODIC = 0x00040000, // 18 Successful do periodic (damage / healing, determined from 14,16 flags) PROC_FLAG_ON_TAKE_PERIODIC = 0x00080000, // 19 Taken spell periodic (damage / healing, determined from 15,17 flags) @@ -424,8 +424,9 @@ enum ProcFlags PROC_FLAG_ON_TRAP_ACTIVATION = 0x00200000, // 21 On trap activation PROC_FLAG_TAKEN_OFFHAND_HIT = 0x00400000, // 22 Taken off-hand melee attacks(not used) - PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000 // 23 Successful off-hand melee attacks -// PROC_FLAG_DEATH = 0x01000000 + PROC_FLAG_SUCCESSFUL_OFFHAND_HIT = 0x00800000, // 23 Successful off-hand melee attacks + + PROC_FLAG_DEATH = 0x01000000 // 24 Died in any way }; #define MELEE_BASED_TRIGGER_MASK (PROC_FLAG_SUCCESSFUL_MILEE_HIT | \ @@ -458,8 +459,6 @@ enum ProcFlagsEx PROC_EX_EX_TRIGGER_ALWAYS = 0x0010000, // If set trigger always ( no matter another flags) used for drop charges PROC_EX_EX_ONE_TIME_TRIGGER = 0x0020000, // If set trigger always but only one time (not used) PROC_EX_INTERNAL_CANT_PROC = 0x0800000, - PROC_EX_INTERNAL_DOT = 0x1000000, // Only for internal use - PROC_EX_INTERNAL_HOT = 0x2000000, // Only for internal use PROC_EX_INTERNAL_TRIGGERED = 0x4000000, // Only for internal use PROC_EX_INTERNAL_REQ_FAMILY = 0x8000000 // Only for internal use }; @@ -768,7 +767,7 @@ class SpellMgr return NULL; } - bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active); + bool IsSpellProcEventCanTriggeredBy( SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra); SpellEnchantProcEntry const* GetSpellEnchantProcEvent(uint32 enchId) const { diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 285fa93ef90..8cf9b7136e2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2080,36 +2080,6 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe } } } - // no break here, rapture can proc with reflective shield - // Rapture - if (spellProto->SpellFamilyFlags.HasFlag(0x1, 0x1000000)) - { - if (pVictim == this) - break; - healCaster = (*i)->GetCaster(); - if (!healCaster) - break; - - AuraEffectList const& lOverRideCS = pVictim->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); - for(AuraEffectList::const_iterator k = lOverRideCS.begin(); k != lOverRideCS.end(); ++k) - { - switch((*k)->GetMiscValue()) - { - case 7556: // Rank 1 - case 7555: // Rank 2 - case 7554: // Rank 3 - case 7553: // Rank 4 - case 7552: // Rank 5 - { - healSpell = 47755; - healAmount += ((pVictim->getLevel() * (-0.2) + 18) / 1000000) * currentAbsorb * pVictim->GetMaxPower(POWER_MANA); - // limitation based on aura amount - if(healAmount > pVictim->GetMaxPower(POWER_MANA) * (*k)->GetAmount() / 1000) - healAmount = pVictim->GetMaxPower(POWER_MANA) * (*k)->GetAmount() / 1000; - } break; - } - } - } break; } case SPELLFAMILY_SHAMAN: @@ -3064,7 +3034,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool if (reflectchance > 0 && roll_chance_i(reflectchance)) { // Start triggers for remove charges if need (trigger only for victim, and mark as active spell) - ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT, PROC_EX_REFLECT, 1, BASE_ATTACK, spell); + ProcDamageAndSpell(pVictim, PROC_FLAG_NONE, PROC_FLAG_TAKEN_NEGATIVE_SPELL_HIT, PROC_EX_REFLECT, 0, BASE_ATTACK, spell); return SPELL_MISS_REFLECT; } } @@ -5646,6 +5616,14 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } switch(dummySpell->Id) { + // Siphon Life + case 63108: + { + triggered_spell_id = 63106; + target = this; + basepoints0 = int32(damage*triggerAmount/100); + break; + } // Nightfall case 18094: case 18095: @@ -5823,6 +5801,40 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_DECREASE_SPEED); break; } + // Rapture + case 47535: // Rank 1 1.5% of max mana + case 47536: // Rank 2 2% of max mana + case 47537: // Rank 3 2.5% of max mana + { + // Effect 0 - proc on self + if (effIndex == 0) + { + float multiplier = triggerAmount; + if (dummySpell->Id == 47535) + multiplier -= 0.5f; + else if (dummySpell->Id == 47537) + multiplier += 0.5f; + + int32 basepoints0 = (multiplier * GetMaxPower(POWER_MANA) / 100); + CastCustomSpell(this, 47755, &basepoints0, 0, 0, true, 0, triggeredByAura); + return false; + } + if (!roll_chance_i(triggerAmount)) + return false; + + switch(pVictim->getPowerType()) + { + target = pVictim; + case POWER_MANA: + triggered_spell_id = 63654; + basepoints0 = 2 * (pVictim->GetMaxPower(POWER_MANA) / 100); + break; + case POWER_RAGE: triggered_spell_id = 63653; break; + case POWER_ENERGY: triggered_spell_id = 63655; break; + case POWER_RUNIC_POWER: triggered_spell_id = 63652; break; + } + break; + } // Psychic Horror case 47571: { @@ -7692,7 +7704,8 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig { if (AuraEffect * aurEff = owner->GetDummyAura(SPELLFAMILY_WARLOCK, 3220)) { - basepoints0 = aurEff->GetAmount(); + if (owner->GetTypeId() == TYPEID_PLAYER) + basepoints0 = aurEff->GetAmount() * ((Player*)owner)->GetBaseSpellDamageBonus() / 100; CastCustomSpell(this,trigger_spell_id,&basepoints0,&basepoints0,NULL,true,castItem,triggeredByAura); return true; } @@ -7871,19 +7884,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE CastCustomSpell(this, 47762, &basepoints0, 0, 0, true, 0, triggeredByAura); return true; } - // Rapture - case 7556: // Rank 1 - case 7555: // Rank 2 - case 7554: // Rank 3 - case 7553: // Rank 4 - case 7552: // Rank 5 - { - int32 basepoints0 = ((getLevel() * (-0.2) + 18) / 1000000) * damage * GetMaxPower(POWER_MANA); - if(basepoints0 > (GetMaxPower(POWER_MANA) / 100) * (triggeredByAura->GetAmount() / 10)) - basepoints0 = (GetMaxPower(POWER_MANA) / 100) * (triggeredByAura->GetAmount() / 10); - CastCustomSpell(this, 47755, &basepoints0, 0, 0, true, 0, triggeredByAura); - return true; - } } // not processed @@ -13300,7 +13300,7 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co } // Check spellProcEvent data requirements - if(!spellmgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra, active)) + if(!spellmgr.IsSpellProcEventCanTriggeredBy(spellProcEvent, EventProcFlag, procSpell, procFlag, procExtra)) return false; // In most cases req get honor or XP from kill if (EventProcFlag & PROC_FLAG_KILL && GetTypeId() == TYPEID_PLAYER) |
