[7523] Fixed: players will now drop flag in battleground if they cast immunity buff on themselves. Author: `win

TODO: players who carry flag in bg are imune to immunity buffs casted by friendly players. (todo added to code).
    Bug: if paladin casts Hand of protection on flag carrier - flag will be dropped, but he should get "target is immune" message.
    Fixed: Do not call Battleground::Update for battleground template objects.
    Fixed: Do not allow immune player to click on object in battleground (not sure if this is correct in all cases).

--HG--
branch : trunk
This commit is contained in:
megamage committed 2009-03-24 09:36:50 -06:00
1 parent 9dfe48747f
commit 7d9a71a6cf
8 files changed
+90 -145

No files matched your search

+16
View File
@@ -19384,6 +19384,7 @@ void Player::SummonIfPossible(bool agree)
}
// drop flag at summon
// this code can be reached only when GM is summoning player who carries flag, because player should be immune to summoning spells when he carries flag
if(BattleGround *bg = GetBattleGround())
bg->EventPlayerDroppedFlag(this);
@@ -20129,6 +20130,7 @@ bool Player::CanUseBattleGroundObject()
return ( //InBattleGround() && // in battleground - not need, check in other cases
//!IsMounted() && - not correct, player is dismounted when he clicks on flag
//i'm not sure if these two are correct, because invisible players should get visible when they click on flag
!isTotalImmune() && // not totally immune
!HasStealthAura() && // not stealthed
!HasInvisibilityAura() && // not invisible
!HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
@@ -20285,6 +20287,20 @@ void Player::ExitVehicle(Vehicle *vehicle)
CastSpell(this, 45472, true); // Parachute
}
bool Player::isTotalImmune()
{
AuraList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
uint32 immuneMask = 0;
for(AuraList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
{
immuneMask |= (*itr)->GetModifier()->m_miscvalue;
if( immuneMask & SPELL_SCHOOL_MASK_ALL ) // total immunity
return true;
}
return false;
}
bool Player::HasTitle(uint32 bitIndex)
{
if (bitIndex > 128)