Welcome to AC Web.
Results 1 to 7 of 7
  1. #1

    Completely remove aura from units?


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Hi, I want to remove auras (casted spells) from units.

    I tried:

    Code:
    RemoveAura(id);
    
    RemoveOwnedAura(id);
    
    for(uint8 i = 0; i < GetAuraCount(id); i++)
              RemoveAura(id);
    None of this is deleting me an aura with charges (charges beign stack on aura beign triggered on certain effects like receiving attacks, heals, etc)

    I mean, aura (with charges) gets deleted, but when I cast another spell (deleted) aura reappears...

    Any uidea?

  2. #2
    RemoveAurasDueToSpell

  3. #3
    Quote Originally Posted by Ckabot View Post
    RemoveAurasDueToSpell
    Did not work.
    Still spells re-applying

  4. #4
    Innovation & Emulation

    Join Date
    Feb 2008
    Location
    Great Britain
    Posts
    1,857
    https://github.com/stoneharry/Zombie...Unit.cpp#L4053

    One of these methods may serve your purpose. E.g:

    Code:
    void Unit::RemoveAllAuras()
    {
        // this may be a dead loop if some events on aura remove will continiously apply aura on remove
        // we want to have all auras removed, so use your brain when linking events
        while (!m_appliedAuras.empty() || !m_ownedAuras.empty())
        {
            AuraApplicationMap::iterator aurAppIter;
            for (aurAppIter = m_appliedAuras.begin(); aurAppIter != m_appliedAuras.end();)
                _UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
    
            AuraMap::iterator aurIter;
            for (aurIter = m_ownedAuras.begin(); aurIter != m_ownedAuras.end();)
                RemoveOwnedAura(aurIter);
        }
    }

  5. #5
    Quote Originally Posted by stoneharry View Post
    https://github.com/stoneharry/Zombie...Unit.cpp#L4053

    One of these methods may serve your purpose. E.g:

    Code:
    void Unit::RemoveAllAuras()
    {
        // this may be a dead loop if some events on aura remove will continiously apply aura on remove
        // we want to have all auras removed, so use your brain when linking events
        while (!m_appliedAuras.empty() || !m_ownedAuras.empty())
        {
            AuraApplicationMap::iterator aurAppIter;
            for (aurAppIter = m_appliedAuras.begin(); aurAppIter != m_appliedAuras.end();)
                _UnapplyAura(aurAppIter, AURA_REMOVE_BY_DEFAULT);
    
            AuraMap::iterator aurIter;
            for (aurIter = m_ownedAuras.begin(); aurIter != m_ownedAuras.end();)
                RemoveOwnedAura(aurIter);
        }
    }
    But I want to remove only one spell, this will be removing every Aura from player

  6. #6
    If the aura keeps getting re-applied you need to remove the aura that is triggering the other one. RemoveAurasDueToSpell does all you need. Keep in mind that if you use dungeon spells, some of them have a difficulty entry, which means they have a different id for another difficulty

  7. #7

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by Dreadii View Post
    If the aura keeps getting re-applied you need to remove the aura that is triggering the other one. RemoveAurasDueToSpell does all you need. Keep in mind that if you use dungeon spells, some of them have a difficulty entry, which means they have a different id for another difficulty
    Both are custom spells, custom Earth Shields from shaman, but when one is applied, other is removed, then I get a random buff and gets re applied.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •