Jump to content

[sql Fix][9068] Righteous Vengeance


Auntie Mangos

Recommended Posts

What bug does the patch fix? What features does the patch add?

It modifies calculation of Righteous Vengeance to add remaining damage of previous aura.

It adds proc from Crusader Strike talent.

UPDATE:

Added Sheath of Light ( it has same effect as RV )

For which repository revision was the patch created?

8946

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

http://getmangos.eu/community/viewtopic.php?id=10673

Who has been writing this patch? Please include either forum user names or email addresses.

Me

DB part

UPDATE spell_proc_event SET SpellFamilyMask1 = 163840 WHERE entry IN (53380,53381,53382);

Core part

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index b373f80..27f2df7 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -5973,6 +5973,22 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                // 4 damage tick
                basepoints0 = triggerAmount*damage/400;
                triggered_spell_id = 61840;
+
+				if ( !target )
+					break;
+				// get previous aura
+				Unit::AuraList const &periodicAuras = target->GetAurasByType( SPELL_AURA_PERIODIC_DAMAGE );
+				for( Unit::AuraList::const_iterator i = periodicAuras.begin(); i != periodicAuras.end(); ++i )
+				{
+					if ( (*i)->GetCasterGUID() == GetGUID() && (*i)->GetSpellProto()->SpellIconID == 3025 )
+					{
+						// add remaining damage to new aura
+						Modifier const* mod = (*i)->GetModifier();
+						int32 tickCount = 1 + int32( (*i)->GetAuraDuration() / mod->periodictime );
+						basepoints0 += int32( mod->m_amount * tickCount / 4 );	//damage per tick * remaining ticks count
+						break;
+					}
+				}
                break;
            }
            // Sheath of Light
@@ -5981,6 +5997,22 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                // 4 healing tick
                basepoints0 = triggerAmount*damage/400;
                triggered_spell_id = 54203;
+				
+				if ( !target )
+					break;
+				// get previous aura
+				Unit::AuraList const &periodicAuras = target->GetAurasByType( SPELL_AURA_PERIODIC_HEAL );
+				for( Unit::AuraList::const_iterator i = periodicAuras.begin(); i != periodicAuras.end(); ++i )
+				{
+					if ( (*i)->GetCasterGUID() == GetGUID() && (*i)->GetSpellProto()->SpellIconID == 3030 )
+					{
+						// add remaining heal to new aura
+						Modifier const* mod = (*i)->GetModifier();
+						int32 tickCount = 1 + int32( (*i)->GetAuraDuration() / mod->periodictime );
+						basepoints0 += int32( mod->m_amount * tickCount / 4 );	//damage per tick * remaining ticks count
+						break;
+					}
+				}		
                break;
            }
            switch(dummySpell->Id)

Link to comment
Share on other sites

  • 39 years later...

Why not this:

@@ -5973,7 +5973,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu
                // 4 damage tick
                basepoints0 = triggerAmount*damage/400;
                triggered_spell_id = 61840;
-                break;
+
+                Unit::AuraList const &periodicAuras = target->GetAurasByType( SPELL_AURA_PERIODIC_DAMAGE );
+                for( Unit::AuraList::const_iterator i = periodicAuras.begin(); i != periodicAuras.end(); ++i )
+                {
+                     if ((*i)->GetCasterGUID() == GetGUID() && (*i)->GetSpellProto()->SpellIconID == 3025 &&
+                         (*i)->GetSpellProto()->SpellVisual[0] == 5652)
+                     {
+                         int32 tickremains = int32((*i)->GetAuraDuration() / (*i)->GetModifier()->periodictime );
+                         basepoints0 += int32((*i)->GetModifier()->m_amount * tickremains /4);
+                         break;
+                     }
+               }
+               break;
            }
            // Sheath of Light
            if (dummySpell->SpellIconID == 3030)

Link to comment
Share on other sites

  • 2 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use