Jump to content

[patch]Improved Faerie Fire


Guest laise

Recommended Posts

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

fixes crit chance related part of Improved Faerie Fire Talent

For which repository revision was the patch created?

9100

Is there a thread in the bug report section or at lighthouse?

haven't seen any

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

Me

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index c980507..04ee5fb 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -9051,6 +9051,25 @@ bool Unit::isSpellCrit(Unit *pVictim, SpellEntry const *spellProto, SpellSchoolM
                            }
                        }
                        break;
+                    case SPELLFAMILY_DRUID:
+                        // Improved Faerie Fire
+                        if (!IsPositiveSpell(spellProto->Id))
+                        {
+                            // search for Faerie Fire (not self-casted only?), use second effect aura for smaller aura list size
+                            if (pVictim->GetAura(SPELL_AURA_MOD_ATTACKER_SPELL_HIT_CHANCE, SPELLFAMILY_DRUID, UI64LIT(0x000000000000400)))
+                            {
+                                Unit::AuraList const& improvedFFire = GetAurasByType(SPELL_AURA_DUMMY);
+                                for(Unit::AuraList::const_iterator iter = improvedFFire.begin(); iter != improvedFFire.end(); ++iter)
+                                {
+                                    if ((*iter)->GetSpellProto()->SpellIconID == 109 && (*iter)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID)
+                                    {
+                                        crit_chance += (*iter)->GetModifier()->m_amount;
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+                        break;
                    case SPELLFAMILY_PALADIN:
                        // Sacred Shield
                        if (spellProto->SpellFamilyFlags & UI64LIT(0x0000000040000000))

idk if there is better way to check *damage-only* spells except FamilyFlags

--

will merge with Improved Insect Swarm depending on which one gets accepted first (if it gets accepted)

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