Skip to content

Commit

Permalink
[9457] Implement spell/attack power bonus for 59547 and similar spells.
Browse files Browse the repository at this point in the history
Signed-off-by: VladimirMangos <vladimir@getmangos.com>

Also fix build in prev. rev. in result my not added changes.
  • Loading branch information
MrLama authored and VladimirMangos committed Feb 26, 2010
1 parent f04146b commit 1f4ddbf
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
24 changes: 24 additions & 0 deletions src/game/SpellAuras.cpp
Expand Up @@ -4684,6 +4684,30 @@ void Aura::HandleAuraPeriodicDummy(bool apply, bool Real)
void Aura::HandlePeriodicHeal(bool apply, bool /*Real*/)
{
m_isPeriodic = apply;

// For prevent double apply bonuses
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());

// Custom damage calculation after
if (apply)
{
if(loading)
return;

Unit *caster = GetCaster();
if (!caster)
return;

// Gift of the Naaru (have diff spellfamilies)
if (m_spellProto->SpellIconID == 329 && m_spellProto->SpellVisual[0] == 7625)
{
int32 ap = int32 (0.22f * caster->GetTotalAttackPowerValue(BASE_ATTACK));
int32 holy = caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto))
+ caster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellProto), m_target);
holy = int32(holy * 377 / 1000);
m_modifier.m_amount += ap > holy ? ap : holy;
}
}
}

void Aura::HandlePeriodicDamage(bool apply, bool Real)
Expand Down
2 changes: 1 addition & 1 deletion src/game/SpellMgr.cpp
Expand Up @@ -1155,7 +1155,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellP
if (procEvent_procEx & PROC_EX_EX_TRIGGER_ALWAYS)
return true;
// Passive spells can`t trigger if need hit (exclude cases when procExtra include non-active flags)
((procEvent_procEx & PROC_EX_NORMAL_HIT & procExtra) && !active)
if ((procEvent_procEx & PROC_EX_NORMAL_HIT & procExtra) && !active)
return false;
// Check Extra Requirement like (hit/crit/miss/resist/parry/dodge/block/immune/reflect/absorb and other)
if (procEvent_procEx & procExtra)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9456"
#define REVISION_NR "9457"
#endif // __REVISION_NR_H__

0 comments on commit 1f4ddbf

Please sign in to comment.