Jump to content

[Fix] Elemental Oath


Guest MrLama

Recommended Posts

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

While Clearcasting from Elemental Focus is active, you deal % more spell damage. Missing DBC entry workaround.

For which repository revision was the patch created?

8994

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

---

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

Me

Link to patch:

http://pastebin.com/m178ff86c

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 186d538..b229aa1 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -5617,6 +5657,25 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
        return;
    }

+	// Elemental Oath - Damage increase on Clearcasting
+	if ( GetId() == 16246 )
+	{
+		Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
+		for ( Unit::AuraList::const_iterator i = auras.begin(); i != auras.end(); i++ )
+		{
+			switch((*i)->GetId())
+			{
+				case 51466:
+				case 51470:
+					m_modifier.m_amount += (*i)->GetSpellProto()->CalculateSimpleValue(1);
+					break;
+				default:
+					continue;
+			}
+			break;
+		}
+	}
+

Link to comment
Share on other sites

the damage increase value is stored in effect 1, so use instead:

(*i)->GetSpellProto()->CalculateSimpleValue(1);

I know it is effIndex 1 but today I was in a good mood and I wanted 1 little bit differently, so I used effIndex of that Clearcasting aura, which is 1 too :)

//udpated fist post to use CalculateSimpleValue()

//updated to use 1 instead effIndex... i liked it though :)

Link to comment
Share on other sites

I attempt write alt. patch with use spellmod (source of recent cleanup commits ;) ) but this have 2 problem for this case:

1) we reapply only auras that not have duration (maybe possible allow reapply auras in state duration==maxduration so recently applied in same tick.

2) we not support reapply for cusom spelmods that not applied by some spellmod auras. maybe this need imlemented anyway becaus we have like custom spellmods and its can not reppaly to already applied affected auras.

In current form you way will work only if 16246 triggered after 51466/ranks, so correct work dependent from internal aurs list proccessing order.

Maybe this only possible order, but i not so sure.

One from ways fix without big chnages add symmetric aura scan for 51466/ranks aura apply but search 16246

Link to comment
Share on other sites

  • 5 weeks later...

51466/51470 are the passive talent auras, damage mod only depends from how much talent points you invested in Elemental Oath, maybe you misunderstood with the Elemental Oath proc (53410/43414)

only thing needed to change is

if ( GetId() == 16246 )

so doesnt add value twice when removing aura:

// Elemental Oath - Damage increase on Clearcasting
   if (apply && GetId() == 16246)
   {
       Unit::AuraList const& auras = m_target->GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
       for (Unit::AuraList::const_iterator i = auras.begin(); i != auras.end(); ++i)
           if ((*i)->GetId() == 51466 ||   //Elemental Oath rank 1
               (*i)->GetId() == 51470)     //Elemental Oath rank 2
           {
               m_modifier.m_amount += (*i)->GetSpellProto()->CalculateSimpleValue(1);
               break;
           }
   }

Link to comment
Share on other sites

  • 2 months later...

Trinity cod:

    // Elemental oath - "while Clearcasting from Elemental Focus is active, you deal 5%/10% more spell damage."
   if (m_target->GetTypeId() == TYPEID_PLAYER && (GetId() == 51466 || GetId() == 51470))
   {
       if (apply)
       {
           SpellModifier *mod = new SpellModifier;
           mod->op = SPELLMOD_EFFECT2;
           mod->value = m_target->CalculateSpellDamage(GetSpellProto(), 1, GetSpellProto()->EffectBasePoints[1], m_target);
           mod->type = SPELLMOD_FLAT;
           mod->spellId = GetId();
           mod->mask[1] = 0x0004000;
           m_spellmod = mod;
       }
       ((Player*)m_target)->AddSpellMod(m_spellmod, apply);
   }
}

Link to comment
Share on other sites

  • 3 months later...

Rev 10051+

diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index b69fbb5..18744f4 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -6392,6 +6421,18 @@ void Aura::HandleModDamagePercentDone(bool apply, bool Real)
    if(target->GetTypeId() == TYPEID_PLAYER)
        for(int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
            target->ApplyModSignedFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, m_modifier.m_amount/100.0f, apply);
+       // Elemental Oath - Damage increase on Clearcasting
+    if (apply && GetId() == 16246)
+    {
+        Unit::AuraList const& auras = target->GetAurasByType(SPELL_AURA_PROC_TRIGGER_SPELL);
+        for (Unit::AuraList::const_iterator i = auras.begin(); i != auras.end(); ++i)
+            if ((*i)->GetId() == 51466 ||   //Elemental Oath rank 1
+                (*i)->GetId() == 51470)     //Elemental Oath rank 2
+            {
+                m_modifier.m_amount += (*i)->GetSpellProto()->CalculateSimpleValue(EFFECT_INDEX_1);
+                break;
+            }
+    }
}

Link to comment
Share on other sites

×
×
  • 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