diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Spell.cpp | 2 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 35 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 13 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 45 | ||||
-rw-r--r-- | src/game/Unit.cpp | 21 | ||||
-rw-r--r-- | src/game/Unit.h | 16 |
6 files changed, 93 insertions, 39 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8f74606cda1..424bfd097fe 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -738,7 +738,7 @@ void Spell::prepareDataForTriggerSystem(AuraEffect * triggeredByAura) to prevent chain proc of these spells */ - if (triggeredByAura && !triggeredByAura->GetParentAura()->CanProc()) + if (triggeredByAura && !triggeredByAura->GetParentAura()->GetTarget()->CanProc()) { m_canTrigger=false; } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 59059756fbc..457b020864c 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_procDeep(0) +m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_auraStateMask(0), m_updated(false), m_isRemoved(false) { assert(target); @@ -685,6 +685,9 @@ void AreaAuraEffect::Update(uint32 diff) if(m_formalCasterGUID == m_target->GetGUID()) { Unit* caster = m_target; + Unit * originalCaster = GetCaster(); + if (!originalCaster) + m_target->RemoveAura(GetParentAura()); if( !caster->hasUnitState(UNIT_STAT_ISOLATED) ) { @@ -723,7 +726,7 @@ void AreaAuraEffect::Update(uint32 diff) for(std::list<Unit*>::iterator tIter = targets.begin(); tIter != targets.end(); tIter++) { - if(Aura *aur = (*tIter)->GetAura(GetId(), m_formalCasterGUID)) + if(Aura *aur = (*tIter)->GetAura(GetId(), GetCasterGUID())) { if(aur->HasEffect(GetEffIndex())) continue; @@ -733,7 +736,7 @@ void AreaAuraEffect::Update(uint32 diff) bool skip = false; for(Unit::AuraMap::iterator iter = (*tIter)->GetAuras().begin(); iter != (*tIter)->GetAuras().end();++iter) { - bool samecaster = iter->second->GetCasterGUID() == m_formalCasterGUID; + bool samecaster = iter->second->GetCasterGUID() == GetCasterGUID(); if(spellmgr.IsNoStackSpellDueToSpell(GetId(), iter->first, samecaster)) { skip = true; @@ -750,7 +753,7 @@ void AreaAuraEffect::Update(uint32 diff) // recalculate basepoints for lower rank (all AreaAura spell not use custom basepoints?) //if(actualSpellInfo != GetSpellProto()) // actualBasePoints = actualSpellInfo->EffectBasePoints[m_effIndex]; - (*tIter)->AddAuraEffect(actualSpellInfo, GetEffIndex(), caster, &m_currentBasePoints); + (*tIter)->AddAuraEffect(actualSpellInfo, GetEffIndex(), caster, &m_currentBasePoints, originalCaster); if(m_areaAuraType == AREA_AURA_ENEMY) caster->CombatStart(*tIter); @@ -1507,8 +1510,10 @@ void AuraEffect::HandleAddModifier(bool apply, bool Real, bool changeAmount) ((Player*)m_target)->AddSpellMod(m_spellmod, apply); + // Auras with charges do not mod amount of passive auras + if (GetParentAura()->GetAuraCharges()) + return; // reapply some passive spells after add/remove related spellmods - //if (GetParentAura()->IsPassive()) // Warning: it is a dead loop if 2 auras each other amount-shouldn't happen switch (modOp) { @@ -4165,6 +4170,8 @@ void AuraEffect::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real, bool cha void AuraEffect::HandleModStateImmunityMask(bool apply, bool Real, bool /*changeAmount*/) { + if (!Real) + return; std::list <AuraType> immunity_list; if (GetMiscValue() & (1<<10)) immunity_list.push_back(SPELL_AURA_MOD_STUN); @@ -4206,6 +4213,8 @@ void AuraEffect::HandleModStateImmunityMask(bool apply, bool Real, bool /*change void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeAmount*/) { + if (!Real) + return; uint32 mechanic; mechanic = 1 << GetMiscValue(); @@ -4280,14 +4289,18 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA } // Heroic Fury (remove Intercept cooldown) - if( apply && GetId() == 60970 && m_target->GetTypeId() == TYPEID_PLAYER ) + else if( apply && GetId() == 60970 && m_target->GetTypeId() == TYPEID_PLAYER ) + { + ((Player*)m_target)->RemoveSpellCooldown(20252, true); + } + // Demonic Empowerment -- voidwalker -- missing movement impairing effects immunity + else if (GetId() == 54508) { - ((Player*)m_target)->RemoveSpellCooldown(20252); + if (apply) + m_target->RemoveMovementImpairingAuras(); - WorldPacket data(SMSG_CLEAR_COOLDOWN, (4+8)); - data << uint32(20252); - data << uint64(m_target->GetGUID()); - ((Player*)m_target)->GetSession()->SendPacket(&data); + m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_ROOT,apply); + m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_DECREASE_SPEED,apply); } } diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index a1efaf2febd..a760b765878 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -107,18 +107,6 @@ class TRINITY_DLL_SPEC Aura bool IsRemoved() const { return m_isRemoved; } void SetUpdated(bool val) { m_updated = val; } - bool CanProc() const { return !m_procDeep; } - void SetCantProc(bool apply) - { - if(apply) - ++m_procDeep; - else - { - assert(m_procDeep); - --m_procDeep; - } - } - bool IsPersistent() const; bool IsAreaAura() const; bool IsAuraType(AuraType type) const; @@ -169,7 +157,6 @@ class TRINITY_DLL_SPEC Aura AuraEffect * m_partAuras[3]; uint32 m_procDamage; // used in aura proc code - int32 m_procDeep; bool m_isDeathPersist:1; bool m_isRemovedOnShapeLost:1; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c28e992adde..09807fe6cd0 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1986,8 +1986,7 @@ void Spell::EffectTriggerSpell(uint32 i) // Vanish case 18461: { - m_caster->RemoveAurasByType(SPELL_AURA_MOD_ROOT); - m_caster->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); + m_caster->RemoveMovementImpairingAuras(); m_caster->RemoveAurasByType(SPELL_AURA_MOD_STALKED); // if this spell is given to NPC it must handle rest by it's own AI @@ -2027,6 +2026,17 @@ void Spell::EffectTriggerSpell(uint32 i) m_TriggerSpells.push_back(spellInfo); return; } + // Demonic Empowerment -- succubus + case 54437: + { + unitTarget->RemoveMovementImpairingAuras(); + unitTarget->RemoveAurasByType(SPELL_AURA_MOD_STALKED); + unitTarget->RemoveAurasByType(SPELL_AURA_MOD_STUN); + + // Cast Lesser Invisibility + triggered_spell_id = 7870; + break; + } // just skip case 23770: // Sayge's Dark Fortune of * // not exist, common cooldown can be implemented in scripts if need. @@ -4984,6 +4994,37 @@ void Spell::EffectScriptEffect(uint32 effIndex) if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, m_caster->GetGUID())) aur->GetParentAura()->RefreshAura(); return; + // Demonic Empowerment + case 47193: + { + if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || !((Creature *)unitTarget)->isPet()) + return; + CreatureInfo const * ci = objmgr.GetCreatureTemplate(unitTarget->GetEntry()); + switch (ci->family) + { + case CREATURE_FAMILY_SUCCUBUS: + unitTarget->CastSpell(unitTarget, 54435, true); + break; + case CREATURE_FAMILY_VOIDWALKER: + { + SpellEntry const* spellInfo = sSpellStore.LookupEntry(54443); + int32 hp = unitTarget->GetMaxHealth() * m_caster->CalculateSpellDamage(spellInfo, 0, spellInfo->EffectBasePoints[0], unitTarget) /100; + unitTarget->CastCustomSpell(unitTarget, 54443,&hp, NULL, NULL,true); + //unitTarget->CastSpell(unitTarget, 54441, true); + break; + } + case CREATURE_FAMILY_FELGUARD: + unitTarget->CastSpell(unitTarget, 54508, true); + break; + case CREATURE_FAMILY_FELHUNTER: + unitTarget->CastSpell(unitTarget, 54509, true); + break; + case CREATURE_FAMILY_IMP: + unitTarget->CastSpell(unitTarget, 54444, true); + break; + } + return; + } } break; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 97791d48417..725d934910a 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -82,7 +82,7 @@ Unit::Unit() : WorldObject(), i_motionMaster(this), m_ThreatManager(this), m_HostilRefManager(this) , m_IsInNotifyList(false), m_Notified(false), IsAIEnabled(false), NeedChangeAI(false) , i_AI(NULL), i_disabledAI(NULL), m_removedAurasCount(0), m_Vehicle(NULL), m_transport(NULL) -, m_ControlledByPlayer(false) +, m_ControlledByPlayer(false), m_procDeep(0) { m_objectType |= TYPEMASK_UNIT; m_objectTypeId = TYPEID_UNIT; @@ -12040,16 +12040,16 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag } } if (triggerData.effMask) - { procTriggered.push_front(triggerData); - if (procExtra & (PROC_EX_INTERNAL_TRIGGERED | PROC_EX_INTERNAL_CANT_PROC)) - itr->second->SetCantProc(true); - } } // Nothing found if (procTriggered.empty()) return; + + if (procExtra & (PROC_EX_INTERNAL_TRIGGERED | PROC_EX_INTERNAL_CANT_PROC)) + SetCantProc(true); + // Handle effects proceed this time for(ProcTriggeredList::iterator i = procTriggered.begin(); i != procTriggered.end(); ++i) { @@ -12217,8 +12217,7 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag // 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); + SetCantProc(false); } SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const @@ -13761,7 +13760,7 @@ void Unit::AddAura(uint32 spellId, Unit* target) target->AddAura(Aur); } -Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints) +Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints, Unit * formalCaster) { // can't do that for passive auras - they stack from same caster so there is no way to get exact aura which should get effect //assert (!IsPassiveSpell(spellInfo)); @@ -13772,7 +13771,7 @@ Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* c if (aur) { - AuraEffect *aurEffect = CreateAuraEffect(aur, effIndex, basePoints, caster); + AuraEffect *aurEffect = CreateAuraEffect(aur, effIndex, basePoints, caster,NULL, formalCaster); if (aurEffect && !aur->SetPartAura(aurEffect, effIndex)) delete aurEffect; } @@ -13782,10 +13781,10 @@ Aura * Unit::AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* c { int32 amount[3]; amount[effIndex] = *basePoints; - aur = new Aura(spellInfo, 1<<effIndex, amount, this ,caster); + aur = new Aura(spellInfo, 1<<effIndex, amount, this ,caster, NULL,formalCaster); } else - aur = new Aura(spellInfo, 1<<effIndex, NULL, this ,caster); + aur = new Aura(spellInfo, 1<<effIndex, NULL, this ,caster, NULL,formalCaster); if(!AddAura(aur)) return NULL; diff --git a/src/game/Unit.h b/src/game/Unit.h index 084dcd53789..5267c272677 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1188,7 +1188,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0); void AddAura(uint32 spellId, Unit *target); void HandleAuraEffect(AuraEffect * aureff, bool apply); - Aura *AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints=NULL); + Aura *AddAuraEffect(const SpellEntry * spellInfo, uint8 effIndex, Unit* caster, int32 * basePoints=NULL, Unit * formalCaster=NULL); bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const; @@ -1607,6 +1607,19 @@ class TRINITY_DLL_SPEC Unit : public WorldObject // group updates void UpdateAuraForGroup(uint8 slot); + // proc trigger system + bool CanProc(){return !m_procDeep;} + void SetCantProc( bool apply) + { + if(apply) + ++m_procDeep; + else + { + assert(m_procDeep); + --m_procDeep; + } + } + // pet auras typedef std::set<PetAura const*> PetAuraSet; PetAuraSet m_petAuras; @@ -1673,6 +1686,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject AuraMap m_Auras; uint32 m_removedAurasCount; + int32 m_procDeep; typedef std::list<uint64> DynObjectGUIDs; DynObjectGUIDs m_dynObjGUIDs; |