Jump to content

Lightguard

Members
  • Posts

    208
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Lightguard

  1. Well, thinking about it for a while i've come to this conclusion:

    (Should also be applied to other functions probably)

    Basically, this modification checks for three simple things: ApplyAuraName[0] Spellfamily and Spellfamilyflags.

    These values seem to be the same in spells that's stacking we're trying to control. If anyone finds any problem with it, please report it.

    (The auras listed here are just examples, that's not complete yet)

    diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
    index 7ef35a5..5001392 100644
    --- a/src/game/SpellMgr.cpp
    +++ b/src/game/SpellMgr.cpp
    @@ -255,14 +255,21 @@ bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1,SpellSpecific s
        }
    }
    
    -bool IsSingleFromSpellSpecificRanksPerTarget(SpellSpecific spellId_spec, SpellSpecific i_spellId_spec)
    +bool IsSingleFromSpellSpecificRanksPerTarget(SpellEntry const* spellInfo_1, SpellEntry const* spellInfo_2)
    {
    -    switch(spellId_spec)
    +    AuraType spellAura_1 = spellInfo_1->ApplyAuraName[0];
    +    AuraType spellAura_2 = spellInfo_2->ApplyAuraName[0];
    +    switch(spellAura_1)
        {
    -        case SPELL_BLESSING:
    -        case SPELL_AURA:
    -        case SPELL_CURSE:
    -            return spellId_spec==i_spellId_spec;
    +        case SPELL_AURA_MOD_ATTACK_POWER:
    +        case SPELL_AURA_MOD_STAT:
    +        case SPELL_AURA_MOD_RESISTANCE:
    +        case SPELL_AURA_MOD_INCREASE_HEALTH:
    +        case SPELL_AURA_MOD_POWER_REGEN:
    +        case SPELL_AURA_MOD_REGEN:
    +        case SPELL_AURA_MOD_TARGET_RESISTANCE:
    +        case SPELL_AURA_MOD_HEALING_DONE:
    +            return spellAura_1==spellAura_2;
            default:
                return false;
        }
    @@ -1061,6 +1068,11 @@ bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellI
        if(!spellInfo_1 || !spellInfo_2) return false;
        if(spellInfo_1->Id == spellId_2) return false;
    
    +    if(spellInfo_1->EffectApplyAuraName[0] == spellInfo_2->EffectApplyAuraName[0] &&
    +       spellInfo_1->SpellFamilyName == spellInfo_2->SpellFamilyName &&
    +       spellInfo_1->SpellFamilyFlags == spellInfo_2->SpellFamilyFlags)
    +       return true;
    +
        return GetFirstSpellInChain(spellInfo_1->Id)==GetFirstSpellInChain(spellId_2);
    }
    
    diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
    index d026ccb..b39845d 100644
    --- a/src/game/SpellMgr.h
    +++ b/src/game/SpellMgr.h
    @@ -146,7 +146,7 @@ inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
    
    int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
    bool IsSingleFromSpellSpecificPerCaster(SpellSpecific spellSpec1,SpellSpecific spellSpec2);
    -bool IsSingleFromSpellSpecificRanksPerTarget(SpellSpecific spellId_spec, SpellSpecific i_spellId_spec);
    +bool IsSingleFromSpellSpecificRanksPerTarget(SpellEntry const* spellInfo_1, SpellEntry const* spellInfo_2);
    bool IsPassiveSpell(uint32 spellId);
    
    inline bool IsPassiveSpellStackableWithRanks(SpellEntry const* spellProto)
    diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
    index 739f05c..e6af916 100644
    --- a/src/game/Unit.cpp
    +++ b/src/game/Unit.cpp
    @@ -3561,7 +3561,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur)
            SpellSpecific i_spellId_spec = GetSpellSpecific(i_spellId);
    
            bool is_sspc = IsSingleFromSpellSpecificPerCaster(spellId_spec,i_spellId_spec);
    -        bool is_sspt = IsSingleFromSpellSpecificRanksPerTarget(spellId_spec,i_spellId_spec);
    +        bool is_sspt = IsSingleFromSpellSpecificRanksPerTarget(spellProto,i_spellProto);
    
            if( is_sspc && Aur->GetCasterGUID() == (*i).second->GetCasterGUID() )
            {
    

    Patchfile

    List of * Blessing of Might created with this check

    List of * of the Wild created with this check

  2. More general question is: what must happen if one spell

    N3 N2 N1 - spsell ranks

    B2 B1 another and B2 dependent from N2 and B1 dependent from N1

    Whta do if applied B2 and casted N3 or in reversed case.

    also, blessing of might, and battleshout, if they are casted, whichever one is higher should overwrite the lower.

    Yeah pally lesser/greater are still stacking, that's what we've been discussing.

    I added the warrior shouts to the last patch. (1 line...)

  3. That i don't know and currently have no possibilty to test it.

    But, another requested thing was shaman totem stack. This patch would do it.

    ::Edit::

    Added warrior shouts.

    diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
    index 7ef35a5..bdb4efa 100644
    --- a/src/game/SpellMgr.cpp
    +++ b/src/game/SpellMgr.cpp
    @@ -203,6 +203,9 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
                if (IsElementalShield(spellInfo))
                    return SPELL_ELEMENTAL_SHIELD;
    
    +            if (spellInfo->Attributes == 320)
    +                return SPELL_TOTEM_AURA;
    +
                break;
            }
    
    @@ -262,6 +265,8 @@ bool IsSingleFromSpellSpecificRanksPerTarget(SpellSpecific spellId_spec, SpellSp
            case SPELL_BLESSING:
            case SPELL_AURA:
            case SPELL_CURSE:
    +        case SPELL_TOTEM_AURA:
    +        case SPELL_POSITIVE_SHOUT:
                return spellId_spec==i_spellId_spec;
            default:
                return false;
    diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
    index d026ccb..d79828d 100644
    --- a/src/game/SpellMgr.h
    +++ b/src/game/SpellMgr.h
    @@ -96,7 +96,8 @@ enum SpellSpecific
        SPELL_BATTLE_ELIXIR     = 14,
        SPELL_GUARDIAN_ELIXIR   = 15,
        SPELL_FLASK_ELIXIR      = 16,
    -    SPELL_PRESENCE          = 17
    +    SPELL_PRESENCE          = 17,
    +    SPELL_TOTEM_AURA        = 18
    };
    
    SpellSpecific GetSpellSpecific(uint32 spellId); 
    

    Patchfile

    List of affected totem spells

  4. Well, i don't think that the spelliconid check will be enough but if the problem still exists after this, find the spells removing it.

    diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
    index f333db8..61d0549 100644
    --- a/src/game/SpellMgr.cpp
    +++ b/src/game/SpellMgr.cpp
    @@ -1215,6 +1215,9 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons
    
                        break;
                    }
    +            // Dragonmaw Illusion
    +            if(spellInfo_1->SpellIconID == 1691 && spellInfo_2->SpellIconID == 1691)
    +                return false;
                }
                break;
            case SPELLFAMILY_MAGE:
    

    Patchfile

  5. 2

    1

    2

    1

    2

    1

    diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
    index 1f6a746..bd4cd9d 100644
    --- a/src/game/SpellMgr.cpp
    +++ b/src/game/SpellMgr.cpp
    @@ -1064,6 +1064,19 @@ bool SpellMgr::IsRankSpellDueToSpell(SpellEntry const *spellInfo_1,uint32 spellI
        if(!spellInfo_1 || !spellInfo_2) return false;
        if(spellInfo_1->Id == spellId_2) return false;
    
    +    SpellChainMap::const_iterator itr_1 = mSpellChains.find(spellInfo_1->Id);
    +    SpellChainMap::const_iterator itr_2 = mSpellChains.find(spellId_2);
    +    if(itr_1 != mSpellChains.end() && itr_2 != mSpellChains.end())
    +    {
    +        if(uint32 reqSpell1 = itr_1->second.req)
    +            if(GetFirstSpellInChain(reqSpell1) == GetFirstSpellInChain(spellId_2))
    +                return true;
    +
    +        if(uint32 reqSpell2 = itr_2->second.req)
    +            if(GetFirstSpellInChain(reqSpell2) == GetFirstSpellInChain(spellInfo_1->Id))
    +                return true;
    +    }
    +
        return GetFirstSpellInChain(spellInfo_1->Id)==GetFirstSpellInChain(spellId_2);
    }
    

    Patchfile

    Any suggestions to simplify it are welcome.

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