diff options
| author | megamage <none@none> | 2008-11-11 17:49:51 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2008-11-11 17:49:51 -0600 |
| commit | d06130f88c836f42342519723acb0cb926daae72 (patch) | |
| tree | 5e950a521b47afdb6d07b1502b1a924de072c5e8 /src/game/Player.cpp | |
| parent | b9c7086f056feb10d86ed76bdbfe356050455276 (diff) | |
[svn] Fix some aura_interrupt_flag to correctly remove auras.
Add interrupt_flag_unattackable. Source: mangos forum. Adapted by F636y623.
Add function CombatStart().
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 0119d1ee0db..dfff664b31a 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -16605,7 +16605,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, uint32 mount_i ModifyMoney(-(int32)totalcost); // prevent stealth flight - RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_STEALTH); + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_LOOT); WorldPacket data(SMSG_ACTIVATETAXIREPLY, 4); data << uint32(ERR_TAXIOK); @@ -18885,6 +18885,7 @@ bool Player::isAllowUseBattleGroundObject() { return ( //InBattleGround() && // in battleground - not need, check in other cases !IsMounted() && // not mounted + !isTotalImmunity() && // not totally immuned !HasStealthAura() && // not stealthed !HasInvisibilityAura() && // not invisible !HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup @@ -18900,3 +18901,27 @@ bool ItemPosCount::isContainedIn(ItemPosCountVec const& vec) const return false; } + +bool Player::isTotalImmunity() +{ + AuraList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY); + + for(AuraList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr) + { + if (((*itr)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_ALL) !=0) // total immunity + { + return true; + } + if (((*itr)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) !=0) // physical damage immunity + { + for(AuraList::const_iterator i = immune.begin(); i != immune.end(); ++i) + { + if (((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) !=0) // magic immunity + { + return true; + } + } + } + } + return false; +} |
