From ab06dcc442dffeaf21478b49d6a4d0ba9d9d1f9c Mon Sep 17 00:00:00 2001 From: QAston Date: Tue, 16 Jun 2009 22:46:17 +0200 Subject: "*Fix Kindred Spirits. *Fix typo causing auras SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR to modify ap with too big amount. --HG-- branch : trunk --- src/game/Unit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game/Unit.cpp') diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 4cef59a9037..e12b7ecd7ca 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -13340,6 +13340,12 @@ void Unit::AddPetAura(PetAura const* petSpell) if(GetTypeId() != TYPEID_PLAYER) return; + // Aura already added - not need to add it twice + // This check is to prevent existing pet having aura applied twice (passive auras can stack) + // if aura has more than 1 dummy effect + if (m_petAuras.find(petSpell)!= m_petAuras.end()) + return; + m_petAuras.insert(petSpell); if(Pet* pet = ((Player*)this)->GetPet()) pet->CastPetAura(petSpell); -- cgit v1.2.3 From 9bb07ab5a9725ccc002540300c6caddf969daef7 Mon Sep 17 00:00:00 2001 From: QAston Date: Wed, 17 Jun 2009 01:12:40 +0200 Subject: *Use amount check instead of positivity check for aura effects. *Fix Overkill and Master of subtlety. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 10 +++++----- src/game/SpellMgr.cpp | 10 +++++++--- src/game/Unit.cpp | 24 +++++++++++------------- 3 files changed, 23 insertions(+), 21 deletions(-) (limited to 'src/game/Unit.cpp') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 520d1bd87ef..d55510b47ff 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -960,7 +960,7 @@ void Aura::SendAuraUpdate() data << uint32(GetId()); data << uint8(m_auraFlags); data << uint8(m_auraLevel); - data << uint8(m_stackAmount > 1 ? (m_procCharges > 1 ? m_stackAmount * m_procCharges : m_stackAmount) : m_procCharges); + data << uint8(m_stackAmount > 1 ? m_stackAmount : m_procCharges); if(!(m_auraFlags & AFLAG_CASTER)) { @@ -4804,7 +4804,7 @@ void AuraEffect::HandleAuraModResistance(bool apply, bool Real, bool /*changeAmo { m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), TOTAL_VALUE, float(m_amount), apply); if(m_target->GetTypeId() == TYPEID_PLAYER || ((Creature*)m_target)->isPet()) - m_target->ApplyResistanceBuffModsMod(SpellSchools(x),GetParentAura()->IsPositive(),m_amount, apply); + m_target->ApplyResistanceBuffModsMod(SpellSchools(x),m_amount > 0,m_amount, apply); } } @@ -5441,7 +5441,7 @@ void AuraEffect::HandleModDamageDone(bool apply, bool Real, bool changeAmount) if(m_target->GetTypeId() == TYPEID_PLAYER) { - if(GetParentAura()->IsPositive()) + if(m_amount > 0) m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS,m_amount,apply); else m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG,m_amount,apply); @@ -5465,7 +5465,7 @@ void AuraEffect::HandleModDamageDone(bool apply, bool Real, bool changeAmount) // This information for client side use only if(m_target->GetTypeId() == TYPEID_PLAYER) { - if(GetParentAura()->IsPositive()) + if(m_amount > 0) { for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++) { @@ -5488,7 +5488,7 @@ void AuraEffect::HandleModDamageDone(bool apply, bool Real, bool changeAmount) void AuraEffect::HandleModDamagePercentDone(bool apply, bool Real, bool changeAmount) { - sLog.outDebug("AURA MOD DAMAGE type:%u negative:%u", GetMiscValue(), GetParentAura()->IsPositive() ? 0 : 1); + sLog.outDebug("AURA MOD DAMAGE type:%u negative:%u", GetMiscValue(), m_amount > 0); // apply item specific bonuses for already equipped weapon if((Real || changeAmount) && m_target->GetTypeId()==TYPEID_PLAYER) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index a522d8c051a..3f2d9204750 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -597,6 +597,13 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) break; } + // Special case: effects which determine positivity of whole spell + for (uint8 i = 0;iEffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH) + return true; + } + switch(spellproto->Effect[effIndex]) { // always positive effects (check before target checks that provided non-positive result in some case for positive effects) @@ -1349,9 +1356,6 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr // Exist req for PROC_EX_EX_TRIGGER_ALWAYS 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)) - return false; // Check Extra Requirement like (hit/crit/miss/resist/parry/dodge/block/immune/reflect/absorb and other) if (procEvent_procEx & procExtra) return true; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e12b7ecd7ca..037c00fcff2 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4915,6 +4915,17 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger } return false; } + // Overkill + case 58426: + { + if (procEx & AURA_REMOVE_PROC_EX_MASK) + triggered_spell_id = 58428; + else + { + triggered_spell_id = 58427; + } + break; + } // Eye for an Eye case 9799: case 25988: @@ -5033,18 +5044,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 34650; break; } - // Overkill - case 58426: - { - if (procEx & AURA_REMOVE_PROC_EX_MASK) - triggered_spell_id = 58428; - else - { - basepoints0 = -triggerAmount; - triggered_spell_id = 58427; - } - break; - } // Mark of Malice case 33493: { @@ -13486,7 +13485,6 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura * aura, SpellEntry co { modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance); } - return roll_chance_f(chance); } -- cgit v1.2.3