diff options
author | megamage <none@none> | 2009-01-04 23:21:38 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-04 23:21:38 -0600 |
commit | 190b0269507fce596d96821dd2d79d3c6c7c7e31 (patch) | |
tree | 348c5ebed6b6228d1ecb2f1b92d9b2ed0373da05 | |
parent | aecc244de30b3f8a9a9466f308985452c70f10bf (diff) |
*Mangos [7025] Restore work/add new spell post effects. By DiSlord.
--HG--
branch : trunk
-rw-r--r-- | src/game/Spell.cpp | 74 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 19 | ||||
-rw-r--r-- | src/game/Unit.cpp | 4 | ||||
-rw-r--r-- | src/shared/revision_nr.h | 2 |
4 files changed, 73 insertions, 26 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 3ede2fe4f53..832b6694d32 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2641,6 +2641,68 @@ void Spell::finish(bool ok) m_caster->resetAttackTimer(RANGED_ATTACK); } + // Post effects apply on spell targets in some spells + if(!m_UniqueTargetInfo.empty()) + { + uint32 spellId = 0; + switch(m_spellInfo->SpellFamilyName) + { + case SPELLFAMILY_GENERIC: + { + if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages + spellId = 11196; // Recently Bandaged + else if(m_spellInfo->SpellIconID == 1662 && m_spellInfo->AttributesEx & 0x20) // Blood Fury (Racial) + spellId = 23230; // Blood Fury - Healing Reduction + break; + } + case SPELLFAMILY_MAGE: + { + if (m_spellInfo->SpellFamilyFlags&0x0000008000000000LL) // Ice Block + spellId = 41425; // Hypothermia + break; + } + case SPELLFAMILY_PRIEST: + { + if (m_spellInfo->Mechanic == MECHANIC_SHIELD && + m_spellInfo->SpellIconID == 566) // Power Word: Shield + spellId = 6788; // Weakened Soul + break; + } + case SPELLFAMILY_PALADIN: + { + if (m_spellInfo->SpellFamilyFlags&0x0000000000400080LL) // Divine Shield, Divine Protection or Hand of Protection + spellId = 25771; // Forbearance + break; + } + case SPELLFAMILY_SHAMAN: + { + if (m_spellInfo->Id == 2825) // Bloodlust + spellId = 57724; // Sated + else if (m_spellInfo->Id == 32182) // Heroism + spellId = 57723; // Exhaustion + break; + } + default: + break; + } + if (spellId) + { + for(std::list<TargetInfo>::iterator ihit= m_UniqueTargetInfo.begin();ihit != m_UniqueTargetInfo.end();++ihit) + { + Unit* unit = m_caster->GetGUID()==ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID); + if (unit) + { +// TODO: fix me use cast spell (now post spell can immune by this spell) +// m_caster->CastSpell(unit, spellId, true, m_CastItem); + SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(spellId); + if (!AdditionalSpellInfo) + continue; + Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, 0, &m_currentBasePoints[0], unit, m_caster, m_CastItem); + unit->AddAura(AdditionalAura); + } + } + } + } // call triggered spell only at successful cast (after clear combo points -> for add some if need) if(!m_TriggerSpells.empty()) TriggerSpell(); @@ -3790,16 +3852,14 @@ uint8 Spell::CanCast(bool strict) } }*/ - if(!m_triggeredByAuraSpell) + if(!m_IsTriggeredSpell) + { if(uint8 castResult = CheckRange(strict)) return castResult; - if(!m_IsTriggeredSpell) - { if(uint8 castResult = CheckPower()) return castResult; - //if(!m_triggeredByAuraSpell) // triggered spell not affected by stun/etc if(uint8 castResult = CheckCasterAuras()) return castResult; } @@ -5230,6 +5290,12 @@ bool Spell::CheckTarget( Unit* target, uint32 eff, bool hitPhase ) return false; } + // Check Aura spell req (need for AoE spells) + if(m_spellInfo->targetAuraSpell && !target->HasAura(m_spellInfo->targetAuraSpell)) + return false; + if (m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell)) + return false; + // Check targets for not_selectable unit flag and remove // A player can cast spells on his pet (or other controlled unit) though in any state if (target != m_caster && target->GetCharmerOrOwnerGUID() != m_caster->GetGUID()) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index ac4cd626be0..6686933a921 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2197,25 +2197,6 @@ void Spell::EffectApplyAura(uint32 i) if(!Aur) return; - // TODO Make a way so it works for every related spell! - if(unitTarget->GetTypeId()==TYPEID_PLAYER) // Negative buff should only be applied on players - { - uint32 spellId = 0; - if (m_spellInfo->Mechanic == MECHANIC_BANDAGE) // Bandages - spellId = 11196; // Recently Bandaged - else if( (m_spellInfo->AttributesEx & 0x20) && (m_spellInfo->AttributesEx2 & 0x20000) ) - spellId = 23230; // Blood Fury - Healing Reduction - - SpellEntry const *AdditionalSpellInfo = sSpellStore.LookupEntry(spellId); - if (AdditionalSpellInfo) - { - // applied at target by target - Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, 0, NULL, unitTarget,unitTarget, 0); - unitTarget->AddAura(AdditionalAura); - sLog.outDebug("Spell: Additional Aura is: %u", AdditionalSpellInfo->EffectApplyAuraName[0]); - } - } - // Prayer of Mending (jump animation), we need formal caster instead original for correct animation if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags & 0x00002000000000LL)) m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID); diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e2c5c9944ac..73157da31d3 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2528,7 +2528,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool if (spell->Attributes & SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY) return SPELL_MISS_NONE; - // Check for immune (use charges) + // Check for immune if (pVictim->IsImmunedToSpell(spell)) return SPELL_MISS_IMMUNE; @@ -2538,7 +2538,7 @@ SpellMissInfo Unit::SpellHitResult(Unit *pVictim, SpellEntry const *spell, bool &&(!IsHostileTo(pVictim))) //prevent from affecting enemy by "positive" spell return SPELL_MISS_NONE; - // Check for immune (use charges) + // Check for immune if (pVictim->IsImmunedToDamage(GetSpellSchoolMask(spell))) return SPELL_MISS_IMMUNE; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d1b84f35e7a..8997fd5a28a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7024" + #define REVISION_NR "7025" #endif // __REVISION_NR_H__ |