[7127] Implement 271 SPELL_AURA_MOD_DAMAGE_FROM_CASTER aura

Allow this aura trigger and drop charges (only if caster hit target)

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-21 01:35:16 +03:00
parent 1d0d9c6fa2
commit 9e1b9e56fd
4 changed files with 15 additions and 3 deletions

View file

@ -313,7 +313,7 @@ enum AuraType
SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268, SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT = 268,
SPELL_AURA_269 = 269, SPELL_AURA_269 = 269,
SPELL_AURA_270 = 270, SPELL_AURA_270 = 270,
SPELL_AURA_271 = 271, SPELL_AURA_MOD_DAMAGE_FROM_CASTER = 271,
SPELL_AURA_272 = 272, SPELL_AURA_272 = 272,
SPELL_AURA_273 = 273, SPELL_AURA_273 = 273,
SPELL_AURA_274 = 274, SPELL_AURA_274 = 274,

View file

@ -321,7 +321,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleAuraModAttackPowerOfStatPercent, //268 SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT &Aura::HandleAuraModAttackPowerOfStatPercent, //268 SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT
&Aura::HandleNULL, //269 ignore DR effects? &Aura::HandleNULL, //269 ignore DR effects?
&Aura::HandleNULL, //270 &Aura::HandleNULL, //270
&Aura::HandleNULL, //271 increase damage done? &Aura::HandleNoImmediateEffect, //271 SPELL_AURA_MOD_DAMAGE_FROM_CASTER implemented in Unit::SpellDamageBonus
&Aura::HandleNULL, //272 reduce spell cast time? &Aura::HandleNULL, //272 reduce spell cast time?
&Aura::HandleNULL, //273 &Aura::HandleNULL, //273
&Aura::HandleNULL, //274 proc free shot? &Aura::HandleNULL, //274 proc free shot?

View file

@ -7468,6 +7468,12 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3
} }
} }
// From caster spells
AuraList const& mOwnerTaken = pVictim->GetAurasByType(SPELL_AURA_MOD_DAMAGE_FROM_CASTER);
for(AuraList::const_iterator i = mOwnerTaken.begin(); i != mOwnerTaken.end(); ++i)
if( (*i)->GetCasterGUID() == GetGUID() && (*i)->isAffectedOnSpell(spellProto))
TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f;
// Distribute Damage over multiple effects, reduce by AoE // Distribute Damage over multiple effects, reduce by AoE
CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime ); CastingTime = GetCastingTimeForBonus( spellProto, damagetype, CastingTime );
@ -10223,6 +10229,7 @@ bool InitTriggerAuraData()
isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE]=true; isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE]=true;
isTriggerAura[SPELL_AURA_PRAYER_OF_MENDING] = true; isTriggerAura[SPELL_AURA_PRAYER_OF_MENDING] = true;
isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true;
isTriggerAura[SPELL_AURA_MOD_DAMAGE_FROM_CASTER] = true;
isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true; isNonTriggerAura[SPELL_AURA_MOD_POWER_REGEN]=true;
isNonTriggerAura[SPELL_AURA_RESIST_PUSHBACK]=true; isNonTriggerAura[SPELL_AURA_RESIST_PUSHBACK]=true;
@ -10477,6 +10484,11 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag
if (procSpell==NULL || procSpell->Mechanic != auraModifier->m_miscvalue) if (procSpell==NULL || procSpell->Mechanic != auraModifier->m_miscvalue)
continue; continue;
break; break;
case SPELL_AURA_MOD_DAMAGE_FROM_CASTER:
// Compare casters
if (triggeredByAura->GetCasterGUID() != pTarget->GetGUID())
continue;
break;
default: default:
// nothing do, just charges counter // nothing do, just charges counter
break; break;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "7126" #define REVISION_NR "7127"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__