aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-07-13 21:27:05 +0200
committerQAston <none@none>2009-07-13 21:27:05 +0200
commit310f15e546c2525e2fbef2fbea57521e4cc8b78b (patch)
tree794288cd95709cae36c8a9a26dceb2784548b98c /src
parent2120bc0d3055576db84a731463dd6b82b21008a0 (diff)
*Make charge-like spells with talented warbringer correctly remove movement impairing auras.
*Fix Revitalize. *Use MaxHp of target instead of base hp for CC auras amount. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp7
-rw-r--r--src/game/SpellAuras.cpp6
-rw-r--r--src/game/SpellEffects.cpp21
-rw-r--r--src/game/Unit.cpp27
-rw-r--r--src/game/Unit.h3
5 files changed, 46 insertions, 18 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 5e0fce39f98..9d5f425920f 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -4758,9 +4758,14 @@ SpellCastResult Spell::CheckCast(bool strict)
}
case SPELL_EFFECT_CHARGE:
{
+ if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR)
+ {
+ // Warbringer - can't be handled in proc system - should be done before checkcast root check and charge effect process
+ if (strict && m_caster->IsScriptOverriden(m_spellInfo, 6953))
+ m_caster->RemoveMovementImpairingAuras();
+ }
if (m_caster->hasUnitState(UNIT_STAT_ROOT))
return SPELL_FAILED_ROOTED;
-
break;
}
case SPELL_EFFECT_SKINNING:
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 20393034b5f..2c88c4cec0d 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -4367,7 +4367,7 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA
mechanic=IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
// Forbearance
// in DBC wrong mechanic immune since 3.0.x
- else if (GetId() == 25771)
+ else if (GetId() == 25771)
mechanic = 1 << MECHANIC_IMMUNE_SHIELD;
if (!mechanic)
@@ -7451,7 +7451,7 @@ int32 AuraEffect::CalculateCrowdControlAuraAmount(Unit * caster)
m_auraName !=SPELL_AURA_MOD_ROOT)
return 0;
- int32 damageCap = (int32)(m_target->GetCreateHealth()*0.10f);
+ int32 damageCap = (int32)(m_target->GetMaxHealth()*0.10f);
if (!caster)
return damageCap;
@@ -7462,7 +7462,7 @@ int32 AuraEffect::CalculateCrowdControlAuraAmount(Unit * caster)
{
if((*itr)->isAffectedOnSpell(m_spellProto))
{
- // Glyph of Fear
+ // Glyph of Fear, Glyph of Frost nova and similar auras
if ((*itr)->GetMiscValue() == 7801)
{
damageCap += (int32)(damageCap*(*itr)->GetAmount()/100.0f);
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index 49690e63d74..8ab8b37dec7 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -2965,6 +2965,12 @@ void Spell::EffectEnergize(uint32 i)
if(unitTarget->GetMaxPower(power) == 0)
return;
+ // Spells which use pct of max mana, but have wrong effect
+ if (m_spellInfo->Id == 48542)
+ {
+ damage = damage * unitTarget->GetMaxPower(power) / 100;
+ }
+
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power);
// Mad Alchemist's Potion
@@ -4379,19 +4385,8 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
{
// Skyshatter Harness item set bonus
// Stormstrike
- if(m_spellInfo->SpellFamilyFlags[1] & 0x0010)
- {
- Unit::AuraEffectList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
- for(Unit::AuraEffectList::const_iterator citr = m_OverrideClassScript.begin(); citr != m_OverrideClassScript.end(); ++citr)
- {
- // Stormstrike AP Buff
- if ( (*citr)->GetMiscValue() == 5634 )
- {
- m_caster->CastSpell(m_caster, 38430, true, NULL, *citr);
- break;
- }
- }
- }
+ if (AuraEffect * aurEff = m_caster->IsScriptOverriden(m_spellInfo, 5634))
+ m_caster->CastSpell(m_caster, 38430, true, NULL, aurEff);
break;
}
case SPELLFAMILY_DRUID:
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 02e6f8fd440..ffc70bbb4c5 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4346,6 +4346,18 @@ AuraEffect* Unit::GetAura(AuraType type, uint32 family, uint32 familyFlag1, uint
return NULL;
}
+AuraEffect * Unit::IsScriptOverriden(SpellEntry const * spell, int32 script) const
+{
+ AuraEffectList const& auras = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
+ for(AuraEffectList::const_iterator i = auras.begin();i != auras.end(); ++i)
+ {
+ if ((*i)->GetMiscValue() == script)
+ if ((*i)->isAffectedOnSpell(spell))
+ return (*i);
+ }
+ return NULL;
+}
+
uint32 Unit::GetDiseasesByCaster(uint64 casterGUID, bool remove)
{
static const AuraType diseaseAuraTypes[] =
@@ -7931,6 +7943,21 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE
CastCustomSpell(this, 47762, &basepoints0, 0, 0, true, 0, triggeredByAura);
return true;
}
+ case 7010: // Revitalize - can proc on full hp target
+ case 7011:
+ case 7012:
+ {
+ if (!roll_chance_i(triggeredByAura->GetAmount()))
+ return false;
+ switch(pVictim->getPowerType())
+ {
+ case POWER_MANA: triggered_spell_id = 48542; break;
+ case POWER_RAGE: triggered_spell_id = 48541; break;
+ case POWER_ENERGY: triggered_spell_id = 48540; break;
+ case POWER_RUNIC_POWER: triggered_spell_id = 48543; break;
+ }
+ break;
+ }
}
// not processed
diff --git a/src/game/Unit.h b/src/game/Unit.h
index ed51e606996..cc13b28d30f 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1594,7 +1594,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
Aura * GetAura(uint32 spellId, uint64 casterGUID = 0) const;
- AuraEffect* GetAura(AuraType type, uint32 family, uint32 familyFlag1 , uint32 familyFlag2=0, uint32 familyFlag3=0, uint64 casterGUID=0);
+ AuraEffect * GetAura(AuraType type, uint32 family, uint32 familyFlag1 , uint32 familyFlag2=0, uint32 familyFlag3=0, uint64 casterGUID=0);
+ AuraEffect * IsScriptOverriden(SpellEntry const * spell, int32 script) const;
bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
bool HasAura(uint32 spellId, uint64 caster = 0) const;
bool HasAura(Aura * aur) const;