*Rename SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS to SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, and reimplement that aura type.

*Some more research about new aura types.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-07-16 13:20:50 +02:00
parent 5ca1748326
commit 719f13874e
5 changed files with 23 additions and 40 deletions
+1 -12
View File
@@ -11208,17 +11208,7 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage, WeaponAttackType att
// ..done (base at attack power for marked target and base at attack power for creature type) // ..done (base at attack power for marked target and base at attack power for creature type)
int32 APbonus = 0; int32 APbonus = 0;
if (attType == RANGED_ATTACK && pVictim->GetTypeId() == TYPEID_UNIT) if (attType == RANGED_ATTACK)
{
APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS);
// ..done (base at attack power and creature type)
AuraEffectList const& mCreatureAttackPower = GetAuraEffectsByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_VERSUS);
for (AuraEffectList::const_iterator i = mCreatureAttackPower.begin(); i != mCreatureAttackPower.end(); ++i)
if (creatureTypeMask & uint32((*i)->GetMiscValue()))
APbonus += (*i)->GetAmount();
}
else if (attType == RANGED_ATTACK)
{ {
APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS); APbonus += pVictim->GetTotalAuraModifier(SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS);
@@ -13689,7 +13679,6 @@ bool InitTriggerAuraData()
isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true; isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true;
isNonTriggerAura[SPELL_AURA_REDUCE_PUSHBACK]=true; isNonTriggerAura[SPELL_AURA_REDUCE_PUSHBACK]=true;
isTriggerAura[SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS] = true;
return true; return true;
} }
@@ -354,12 +354,12 @@ enum AuraType
SPELL_AURA_307 = 307, SPELL_AURA_307 = 307,
SPELL_AURA_308 = 308, SPELL_AURA_308 = 308,
SPELL_AURA_309 = 309, SPELL_AURA_309 = 309,
SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS = 310, SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE = 310,
SPELL_AURA_311 = 311, SPELL_AURA_311 = 311,
SPELL_AURA_312 = 312, SPELL_AURA_312 = 312,
SPELL_AURA_313 = 313, SPELL_AURA_313 = 313,
SPELL_AURA_314 = 314, SPELL_AURA_PREVENT_RESSURECTION = 314,
SPELL_AURA_315 = 315, SPELL_AURA_UNDERWATER_WALKING = 315,
SPELL_AURA_PERIODIC_HASTE = 316, SPELL_AURA_PERIODIC_HASTE = 316,
TOTAL_AURAS = 317 TOTAL_AURAS = 317
}; };
@@ -355,22 +355,21 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNULL, //299 unused &AuraEffect::HandleNULL, //299 unused
&AuraEffect::HandleNoImmediateEffect, //300 SPELL_AURA_SHARE_DAMAGE_PCT implemented in Unit::DealDamage &AuraEffect::HandleNoImmediateEffect, //300 SPELL_AURA_SHARE_DAMAGE_PCT implemented in Unit::DealDamage
&AuraEffect::HandleNoImmediateEffect, //301 SPELL_AURA_SCHOOL_HEAL_ABSORB implemented in Unit::CalcHealAbsorb &AuraEffect::HandleNoImmediateEffect, //301 SPELL_AURA_SCHOOL_HEAL_ABSORB implemented in Unit::CalcHealAbsorb
&AuraEffect::HandleNULL, //302 unused &AuraEffect::HandleNULL, //302 0 spells in 3.3.5
&AuraEffect::HandleNULL, //303 17 spells &AuraEffect::HandleNULL, //303 SPELL_AURA_MOD_DMG_VESRUS_AURASTATE_PCT? - 22 and 19 look like serverside aurastates (22 - dark, gas cloud, 19 light, ooze)
&AuraEffect::HandleNULL, //304 2 spells (alcohol effect?) &AuraEffect::HandleUnused, //304 clientside
&AuraEffect::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED &AuraEffect::HandleAuraModIncreaseSpeed, //305 SPELL_AURA_MOD_MINIMUM_SPEED
&AuraEffect::HandleNULL, //306 1 spell &AuraEffect::HandleNULL, //306 0 spells in 3.3.5
&AuraEffect::HandleNULL, //307 absorb healing? &AuraEffect::HandleNULL, //307 0 spells in 3.3.5
&AuraEffect::HandleNULL, //308 new aura for hunter traps &AuraEffect::HandleNULL, //308 new aura for hunter traps
&AuraEffect::HandleNULL, //309 absorb healing? &AuraEffect::HandleNULL, //309 0 spells in 3.3.5
&AuraEffect::HandleNoImmediateEffect, //310 5 spells SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS implemented in Unit::MeleeDamageBonus &AuraEffect::HandleNoImmediateEffect, //310 SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE implemented in Spell::CalculateDamageDone
&AuraEffect::HandleNULL, //311 0 spells in 3.3 &AuraEffect::HandleNULL, //311 0 spells in 3.3.5
&AuraEffect::HandleNULL, //312 0 spells in 3.3 &AuraEffect::HandleNULL, //312 0 spells in 3.3.5
&AuraEffect::HandleNULL, //313 0 spells in 3.3 &AuraEffect::HandleNULL, //313 0 spells in 3.3.5
&AuraEffect::HandleNULL, //314 1 test spell (reduce duration of silince/magic) &AuraEffect::HandleNoImmediateEffect, //314 SPELL_AURA_PREVENT_RESSURECTION todo
&AuraEffect::HandleNULL, //315 underwater walking &AuraEffect::HandleNoImmediateEffect, //315 SPELL_AURA_UNDERWATER_WALKING todo
&AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic &AuraEffect::HandleNoImmediateEffect, //316 SPELL_AURA_PERIODIC_HASTE implemented in AuraEffect::CalculatePeriodic
&AuraEffect::HandleNULL
}; };
AuraEffect::AuraEffect(Aura * base, uint8 effIndex, int32 *baseAmount, Unit * caster) : AuraEffect::AuraEffect(Aura * base, uint8 effIndex, int32 *baseAmount, Unit * caster) :
@@ -780,7 +779,8 @@ void AuraEffect::CalculatePeriodic(Unit * caster, bool create)
modOwner->ModSpellCastTime(m_spellProto, m_amplitude); modOwner->ModSpellCastTime(m_spellProto, m_amplitude);
} }
// For spells that can benefit from haste // For spells that can benefit from haste
else if (modOwner->HasAuraType(SPELL_AURA_PERIODIC_HASTE)) { else if (modOwner->HasAuraType(SPELL_AURA_PERIODIC_HASTE))
{
const Unit::AuraEffectList &effList = modOwner->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HASTE); const Unit::AuraEffectList &effList = modOwner->GetAuraEffectsByType(SPELL_AURA_PERIODIC_HASTE);
for (Unit::AuraEffectList::const_iterator itr = effList.begin(), end = effList.end(); itr != end; ++itr) for (Unit::AuraEffectList::const_iterator itr = effList.begin(), end = effList.end(); itr != end; ++itr)
{ {
+4 -11
View File
@@ -5447,17 +5447,6 @@ SpellCastResult Spell::CheckCast(bool strict)
} }
break; break;
} }
case SPELL_AURA_RANGED_AP_ATTACKER_CREATURES_BONUS:
{
if (!m_targets.getUnitTarget() && m_targets.getUnitTarget()->GetTypeId() != TYPEID_UNIT)
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
// can be casted at non-friendly unit or own pet/charm
if (m_caster->IsFriendlyTo(m_targets.getUnitTarget()))
return SPELL_FAILED_TARGET_FRIENDLY;
break;
}
case SPELL_AURA_PERIODIC_MANA_LEECH: case SPELL_AURA_PERIODIC_MANA_LEECH:
{ {
if (!m_targets.getUnitTarget()) if (!m_targets.getUnitTarget())
@@ -6791,6 +6780,10 @@ int32 Spell::CalculateDamageDone(Unit *unit, const uint32 effectMask, float *mul
{ {
if (IsAreaEffectTarget[m_spellInfo->EffectImplicitTargetA[i]] || IsAreaEffectTarget[m_spellInfo->EffectImplicitTargetB[i]]) if (IsAreaEffectTarget[m_spellInfo->EffectImplicitTargetA[i]] || IsAreaEffectTarget[m_spellInfo->EffectImplicitTargetB[i]])
{ {
m_damage = float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask);
if (m_caster->GetTypeId() == TYPEID_UNIT)
m_damage = float(m_damage) * unit->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask);
if (int32 reducedPct = unit->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE)) if (int32 reducedPct = unit->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE))
m_damage = m_damage * (100 + reducedPct) / 100; m_damage = m_damage * (100 + reducedPct) / 100;
+1
View File
@@ -890,6 +890,7 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
case SPELL_AURA_PERIODIC_LEECH: case SPELL_AURA_PERIODIC_LEECH:
case SPELL_AURA_MOD_STALKED: case SPELL_AURA_MOD_STALKED:
case SPELL_AURA_PERIODIC_DAMAGE_PERCENT: case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
case SPELL_AURA_PREVENT_RESSURECTION:
return false; return false;
case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also. case SPELL_AURA_PERIODIC_DAMAGE: // used in positive spells also.
// part of negative spell if casted at self (prevent cancel) // part of negative spell if casted at self (prevent cancel)