Jump to content

[fix] Serendipity


Guest Danstahr

Recommended Posts

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

Nowdays, Serendipity isn't consumed by Prayer of Healing or Greater Heal. This patch fixes this.

For which repository revision was the patch created?

10179

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

No

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

Maxxie and me

diff --git a/src/game/UnitAuraProcHandler.cpp b/src/game/UnitAuraProcHandler.cpp
index 8b6d563..6c7b9e6 100644
--- a/src/game/UnitAuraProcHandler.cpp
+++ b/src/game/UnitAuraProcHandler.cpp
@@ -3634,6 +3639,16 @@ bool Unit::HandleAddPctModifierAuraProc(Unit* /*pVictim*/, uint32 /*damage*/, Au
            }
            break;
        }
+        case SPELLFAMILY_PRIEST:
+        {
+            
+            if (spellInfo->SpellIconID == 2900) //Serendipity removal
+                {
+                    RemoveAurasDueToSpell(triggeredByAura->GetId());
+                    return true;
+                }
+        }
+
    }
    return true;
}

And the DB part

insert into `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMaskA0`, `SpellFamilyMaskA1`, `SpellFamilyMaskA2`, `SpellFamilyMaskB0`, `SpellFamilyMaskB1`, `SpellFamilyMaskB2`, `SpellFamilyMaskC0`, `SpellFamilyMaskC1`, `SpellFamilyMaskC2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) values('63735','0','6','4608','0','0','0','0','0','0','0','0','0','0','0','100','0');

Link to comment
Share on other sites

I think this should be handled in Unit::HandleDummyAuraProc

In the SpellIconID switch of SPELLFAMILY_PRIEST:

case 2900:
{
   RemoveAurasDueToSpell(triggeredByAura->GetId());
   return true;
}

and then just adapt sql part in spell_proc_event

(Sorry for being so vague, but i can't make a diff right now :P)

Link to comment
Share on other sites

I'm quite new to spell repairing, so I might not fix the bugs the best way. However, if I won't publish it, it won't be checked. And, as mentioned on the front page, "MaNGOS is an educational project". I found the Swiftmend spell quite similar (since it's also consuming another buff) and it's implemented this way, so I did the same with Serendipity.

Back to the topic, I did not find any dummy aura able to proc. Wowhead doesn't show any.

//Edit :

I've made it the way you've suggested, but the case event is never triggered (or at least not at the situation we're talking about)

Link to comment
Share on other sites

I'm sorry, I didn't mean to discredit your fix or your skill in any way, but as you stated "MaNGOS is an educational project" so I wanted to show you another way to fix this which I _think_ is simpler. Anyway to explain this better:

Unit::HandleDummyAuraProc is not triggered just by dummy auras, it is triggered by all of these auras (not sure all of them, i might have added a couple in my repo):

SPELL_AURA_IGNORE_REQUIREMENTS

SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN

SPELL_AURA_MANA_SHIELD

SPELL_AURA_OBS_MOD_MANA

SPELL_AURA_ADD_PCT_MODIFIER (this one is the one that is used to trigger the serendipity removal)

SPELL_AURA_DUMMY

EDIT: To make it work you have to edit spell_proc_event:

INSERT INTO spell_proc_event
  (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`)
VALUES
  (63735, 0, 6, 4608, 0, 0, 0, 0, 0, 100, 0);

EDIT2: Swiftmend is handled there because it has to modify m_healing which can't be done from proc, so I think it should be ok.

Link to comment
Share on other sites

You're right, I'm sorry it should be placed in HandleAddPctModifierAuraProc not HandleDummyAuraProc.

I didn't update to latest repo so on my server it works with HandleDummyAuraProc, if you updated you should use HandleAddPctModifierAuraProc.

Link to comment
Share on other sites

Yeah, this looks the way better. Thanks for your help with this, it's definitely smarter than my version. And back to your sorry - why? I don't see any wrong thing at your comment - you know the better solution, so you let me know - as I said, I'm open to new knowledge about spell system - and you definitely give me a big one. So I should (and I do) say thanks to you, not you "Sorry" to me ;).

I'll make a diff with our new version tomorow.

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