Jump to content

[fix][dev]Fingers of Frost, Aura 262


Auntie Mangos

Recommended Posts

  • Replies 173
  • Created
  • Last Reply

Top Posters In This Topic

Yes, it would be nice, thank you. I want to submit my patch wit working sudden death, but at first, I need to test recent changes - but on my PC, mangos just crashs after start, so I have to wait for my friend :(

PS: I think theres something different in DBC for this auras, but I cant even find code which using Clearcasting, Combustion etc for removing auras on spell cast :(

PS2: Now, when I know that there are more than one spells which using this aura, I named it SPELL_AURA_IGNORE_UNIT_STATE

Link to comment
Share on other sites

About the aura charges, i'm really no expert but after reading some code, it looks like Clearcasting etc. works through the SpellModifier that gets setup in Aura::HandleAddModifier. When all charges in the modifier are used (by applying it to the spell casted) the aura gets removed in Spell::finish() by calling RemoveSpellMods() which in turn calls RemoveAurasDueToSpell().

However Fingers of Frost does not modify any of the spells attributes like casting time, mana cost, damage etc...so no idea how to handle that, i can't think of a spell aura with dummy effect and charges that works right now...anyone?

-edit-

Fingers of Frost does not specify an amount of charges in Spell.dbc either, while Clearcasting has one charge, but that's easy to set in code...

Link to comment
Share on other sites

  • 2 weeks later...

First post updated!

I think that would be useful to you, thats patch for aura 262 that was made 3 months ago:)

http://getmangos.org/forum/showpost.php?p=276528&postcount=26

At least you can take changes for sudden strike - that would make your patch more complete ^_^

Thanks, I will look at it, but I cant read Russian letters, so I have to wait for reeshack....

PS: you mean sudden death?

Link to comment
Share on other sites

No, from what i understand, they just use the same random number to proc. That means if you have frostbite and fof both at max rank, they will always proc together, with 15% chance.

If you for example have both at rank one (5% and 7% respectively) the result is a 2% chance that only fof will proc and a 5% chance that both proc, frostbite will never proc alone in this case because it's the same roll but frostbite has lower proc chance.

So fully skilled, on a single target you're forced to waste one fof charge while your target really is frozen. Seems blizzard mainly wanted to buff boss fights with fof.

Link to comment
Share on other sites

Firts post updated

I added this to Unit::HandleProcTriggerSpell for FoF, but i dont know where to add code for Frostbite...

//Fingers of Frost
       case 44544:
       {
           if(HasAura(11071) || HasAura(12496) || HasAura(12497))
           {
               uint32 chance = 100;
               switch(auraSpellInfo->Id)
               {
                   case 44543:            //FoF rank 1
                       if(HasAura(11071))   //Frostbite rank 1
                           chance -= 71;
                       if(HasAura(12496) || HasAura(12497)) //Frostbite rank 2 & 3
                           chance -= 100;
                       break;
                   case 44545:              //FoF rank 2
                       if(HasAura(11071))   //Frostbite rank 1
                           chance -= 25;
                       if(HasAura(12496))   //Frostbite rank 2
                           chance -= 75;
                       if(HasAura(12497))   //Frostbite rank 3
                           chance -= 100;
                       break;
               }
               if (!roll_chance_f(chance) && pVictim && pVictim->isAlive())
                   CastSpell(pVictim, 12494, true);  //Cast Frostbite Effect on target...
           }
       }

Link to comment
Share on other sites

*scratches head*

i am not sure if this code piece makes sense...since both will be triggered you can't just make one trigger the other one too...

My idea would've been to make Unit::IsTriggeredAtSpellProcEvent() return the chance rather than already roll for it, so Unit::ProcDamageAndSpellFor() can group Frostbite and Fingers of Frost in one random roll.

Link to comment
Share on other sites

Darn i think my idea doesn't work...Frostbite is rolled for in Spell::finish() while FoF is rolled for in Unit::IsTriggeredAtSpellProcEvent(), i don't see any way to pull these two together :(

-edit-

btw, where did you get the SpellFamilyMask0 values for the SQL query from? Because Frostbite has a different mask...but both should proc on chill effects.

Link to comment
Share on other sites

Darn i think my idea doesn't work...Frostbite is rolled for in Spell::finish() while FoF is rolled for in Unit::IsTriggeredAtSpellProcEvent(), i don't see any way to pull these two together :(

-edit-

btw, where did you get the SpellFamilyMask0 values for the SQL query from? Because Frostbite has a different mask...but both should proc on chill effects.

Its line from Brain freeze...maybe right SpellFamilyMask0 can solve this? :o

EDIT: No, that would be too easy :(

Link to comment
Share on other sites

No those (apparently) wrong flags only make Brain Freeze trigger incorrectly from some spells, specifically Blizzard without Improved Blizzard, and Frost/Ice Armor when the chill effect does not trigger...

Frostbite has: EffectSpellClassMaskA[0]: 1049120, EffectSpellClassMaskA[1]: 4096

I already wondered why i got so many Fireball! procs sometimes...

Link to comment
Share on other sites

Then...SQL is wrong for both spells(and FoF need same triggering in c++ like brain freeze)?

And what to do with FBite and FoF proc? Its damn little detail :(

V4b!

some cleanup, removed wrong trigger for FoF/Frostbite and I added this for warbringer "...In addition, your Charge, Intercept and Intervene abilities will remove all movement impairing effects.". I this correct?

//Warbringer - remove movement imparing effects
if(m_caster->HasAura(57499))
     m_caster->RemoveAurasAtMechanicImmunity(IMMUNE_TO_ROOT_AND_SNARE_MASK,0,true);

EDIT: I forgot to add it for Intercept and Intervene, i will add it tomorrow.

Link to comment
Share on other sites

Okay after a few brain near-meltdowns i managed to hack something together to proc Frostbite and FoF together. But it's almost as hacky as that hardcoded package to enable charge in the client :D

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index ac5f15d..b864577 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10489,6 +10489,17 @@ int32 Unit::CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_inde
            (spellProto->Effect[effect_index] != SPELL_EFFECT_APPLY_AURA || spellProto->EffectApplyAuraName[effect_index] != SPELL_AURA_MOD_DECREASE_SPEED))
        value = int32(value*0.25f*exp(getLevel()*(70-spellProto->spellLevel)/1000.0f));

+    // Frostbite trigger aura: if Fingers of Frost is active, it has saved a roll:
+    if(spellProto->EffectTriggerSpell[effect_index] == 12494)
+    {
+        sLog.outDebug("CalculateSpellDamage: called for 12494 (Frostbite), chance is: %u", value);
+        if(m_lastAuraProcRoll >=0) //override independent trigger
+        {
+            sLog.outDebug("CalculateSpellDamage: saved roll from FoF is: %f", m_lastAuraProcRoll);
+            return value > m_lastAuraProcRoll ? 100 : 0;
+        }
+        sLog.outDebug("CalculateSpellDamage: no  saved roll for 12494 (Frostbite)");
+    }
    return value;
}

@@ -11499,6 +11510,9 @@ void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag

    RemoveSpellList removedSpells;
    ProcTriggeredList procTriggered;
+    // reset saved roll from Fingers of Frost:
+    sLog.outDebug("resetting m_lastAuraProcRoll to -1.0");
+    m_lastAuraProcRoll = -1.0f;
    // Fill procTriggered list
    for(AuraMap::const_iterator itr = GetAuras().begin(); itr!= GetAuras().end(); ++itr)
    {
@@ -12434,6 +12448,13 @@ bool Unit::IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry con
        modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_CHANCE_OF_SUCCESS,chance);
        modOwner->ApplySpellMod(spellProto->Id,SPELLMOD_FREQUENCY_OF_SUCCESS,chance);
    }
+    // Fingers of Frost: save roll for re-use in Frostbite trigger
+    if(aura->GetSpellProto()->EffectTriggerSpell[aura->GetEffIndex()] == 44544)
+    {
+        sLog.outDebug("Fingers of Frost: saving roll; triggered by %u", aura->GetId());
+    	m_lastAuraProcRoll = rand_chance();
+    	return chance > m_lastAuraProcRoll;
+    }

    return roll_chance_f(chance);
}
diff --git a/src/game/Unit.h b/src/game/Unit.h
index b481c37..75ffcd4 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1588,6 +1588,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
        uint32 m_reactiveTimer[MAX_REACTIVE];
        uint32 m_regenTimer;
        uint32 m_lastManaUseTimer;
+        float m_lastAuraProcRoll;

    private:
        bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );

I only tested with frostbolts so far though, thinking about how FoF works with Improved Blizzard cause some of the brain-stalls...and i'd bet my left arm that Blizz's trigger code works substantially different (see lack of shatter-combo "exploit" in MaNGOS).

Link to comment
Share on other sites

Thanks, I will add it to main patch, if you do not have anything against it/if you don't mind it(Sorry, I dont know correct phrase) :)

And how we can make non-hacky fixes, when trigger system is wrong? :)

btw is code for remove movement imparing effects is player have Warbringer correct?

EDIT: I asked our server(around 600 players) admin to test this patch, but he is very lazy, so i can only hope :)

EDIT:

...But it's almost as hacky as that hardcoded package to enable charge in the client....

Now I trying to modify Aura::SendAuraUpdate, I will post V5 soon :)

Link to comment
Share on other sites

Now i have it working without hardcoded packet in SpellAuras.cpp (SetAuraSlot() ... ), but why code in HandleAuraIgnoreUnitState() isnt executing at player login? Now I have to leave packet in Player.cpp :(

V5 added!

- Added Lynx3d's patch for triggering of FoF/Frostbite

- Added remove movement imparing effects for Warbringer

- Added Sudden death "at least X rage left" from fullburned suggestion(Sorry, I cant add author name because getmangos.org is down)

- Removed hardcoded packet from SpellAuras.cpp, but in Player.cpp i still need it :(

EDIT: Player::IsNeedCastPassiveSpellAtLearn() maybe...? :)

Link to comment
Share on other sites

V5a added!

- Removed hardcoded packet from Player.cpp :)

Player.cpp 3035:

    else if (IsPassiveSpell(spell_id))
   {
       if (IsNeedCastPassiveSpellAtLearn(spellInfo))
       {
           // Juggernaut & Warbringer needs to not be triggered
           if(spell_id == 57499 || spell_id == 64976)
           {
               CastSpell(this, spell_id, false);
           }else CastSpell(this, spell_id, true);
       }
   }

I think the patch is now ready to commit....?

Link to comment
Share on other sites

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