Jump to content

darkstalker

Members
  • Posts

    717
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by darkstalker

  1. We know that currently that on mangos hunter traps are visible, when they're supposed to be stealthed. For that purpose there is a rogue passive called Detect Traps, thats supposed to make traps visible for them. Reading the spell effects shows is has "Apply Aura: Stealth Detection (1) Value: 70", its a spell with SPELL_AURA_MOD_STEALTH_DETECT, EffectBasePoints0 = 69 and EffectMiscValue0 = 1. The problem here is that this stealth detection is being currently applied to unit detection, not traps (that don't even have stealth). The key here is the MiscValue, that seems to be some kind of stealth mask. Its the only stealth detection spell on the dbc with miscvalue != 0, so it suggest that this value means trap detection. A (hack?) fix for this problem would be something like:

    diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
    index 46a15e5..d00b027 100644
    --- a/src/game/Unit.cpp
    +++ b/src/game/Unit.cpp
    @@ -8043,7 +8043,9 @@ bool Unit::isVisibleForOrDetect(Unit const* u, WorldObject const* viewPoint, boo
    
            //-Stealth Mod(positive like Master of Deception) and Stealth Detection(negative like paranoia)
            //based on wowwiki every 5 mod we have 1 more level diff in calculation
    -        visibleDistance += (int32(u->GetTotalAuraModifier(SPELL_AURA_MOD_STEALTH_DETECT)) - stealthMod)/5.0f;
    +        // spell 2836 (Detect Traps) not meant to enhace unit detection has MiscValue = 1, all others have 0 (stealth mask?)
    +        int32 detectMod = u->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_STEALTH_DETECT, 0);
    +        visibleDistance += (detectMod - stealthMod) / 5.0f;
            visibleDistance = visibleDistance > MAX_PLAYER_STEALTH_DETECT_RANGE ? MAX_PLAYER_STEALTH_DETECT_RANGE : visibleDistance;
    
            // recheck new distance
    

    to prevent this "extra bonus" to detection of players being added. Any toughts on this? maybe should implement stealth masks for future implementation of trap stealthing.

  2. * What bug does the patch fix? What features does the patch add?

    Prevents abilities that are "usable while stunned" being usable while in non-stun effects like Cyclone or Sap. With this patch the usability while stunned is restricted only to stun auras with mechanic stun.

    * For which repository revision was the patch created?

    11044

    * 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.

    darkstalker

    diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
    index ab4b0fc..267c104 100644
    --- a/src/game/Spell.cpp
    +++ b/src/game/Spell.cpp
    @@ -5575,8 +5575,25 @@ SpellCastResult Spell::CheckCasterAuras() const
        SpellCastResult prevented_reason = SPELL_CAST_OK;
        // Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out
        uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS);     // Get unit state
    -    if (unitflag & UNIT_FLAG_STUNNED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
    -        prevented_reason = SPELL_FAILED_STUNNED;
    +    if (unitflag & UNIT_FLAG_STUNNED)
    +    {
    +        // spell is usable while stunned, check if aura has mechanic stun
    +        if (m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED)
    +        {
    +            bool is_stun_mechanic = true;
    +            Unit::AuraList const& stunAuras = m_caster->GetAurasByType(SPELL_AURA_MOD_STUN);
    +            for (Unit::AuraList::const_iterator itr = stunAuras.begin(); itr != stunAuras.end(); ++itr)
    +                if (!(*itr)->HasMechanic(MECHANIC_STUN))
    +                {
    +                    is_stun_mechanic = false;
    +                    break;
    +                }
    +            if (!is_stun_mechanic)
    +                prevented_reason = SPELL_FAILED_STUNNED;
    +        }
    +        else
    +            prevented_reason = SPELL_FAILED_STUNNED;
    +    }
        else if (unitflag & UNIT_FLAG_CONFUSED && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
            prevented_reason = SPELL_FAILED_CONFUSED;
        else if (unitflag & UNIT_FLAG_FLEEING && !(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
    @@ -5625,7 +5642,7 @@ SpellCastResult Spell::CheckCasterAuras() const
                            switch(aura->GetModifier()->m_auraname)
                            {
                                case SPELL_AURA_MOD_STUN:
    -                                if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
    +                                if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED) || !aura->HasMechanic(MECHANIC_STUN))
                                        return SPELL_FAILED_STUNNED;
                                    break;
                                case SPELL_AURA_MOD_CONFUSE:
    diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
    index 3e9151f..b8edc90 100644
    --- a/src/game/SpellAuras.cpp
    +++ b/src/game/SpellAuras.cpp
    @@ -8014,6 +8014,12 @@ bool Aura::IsLastAuraOnHolder()
        return true;
    }
    
    +bool Aura::HasMechanic(uint32 mechanic) const
    +{
    +    return GetSpellProto()->Mechanic == mechanic ||
    +        GetSpellProto()->EffectMechanic[m_effIndex] == mechanic;
    +}
    +
    SpellAuraHolder::SpellAuraHolder(SpellEntry const* spellproto, Unit *target, WorldObject *caster, Item *castItem) :
    m_target(target), m_castItemGuid(castItem ? castItem->GetObjectGuid() : ObjectGuid()),
    m_auraSlot(MAX_AURAS), m_auraFlags(AFLAG_NONE), m_auraLevel(1), m_procCharges(0),
    diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
    index 9812dd2..5147d1c 100644
    --- a/src/game/SpellAuras.h
    +++ b/src/game/SpellAuras.h
    @@ -436,6 +436,8 @@ class MANGOS_DLL_SPEC Aura
            SpellAuraHolder* const GetHolder() const { return m_spellAuraHolder; }
    
            bool IsLastAuraOnHolder();
    +
    +        bool HasMechanic(uint32 mechanic) const;
        protected:
            Aura(SpellEntry const* spellproto, SpellEffectIndex eff, int32 *currentBasePoints, SpellAuraHolder *holder, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
    
    

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