[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
2009-03-24 09:36:50 -06:00
parent 9dfe48747f
commit 7d9a71a6cf
8 changed files with 90 additions and 145 deletions

View File

@@ -2483,6 +2483,8 @@ void Spell::EffectPowerDrain(uint32 i)
void Spell::EffectSendEvent(uint32 EffectIndex)
{
/* we do not drop a flag by sendevent system, OBSOLETE CODE:
this code caused crashes
if (m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->InBattleGround())
{
BattleGround* bg = ((Player *)m_caster)->GetBattleGround();
@@ -2491,25 +2493,22 @@ void Spell::EffectSendEvent(uint32 EffectIndex)
switch(m_spellInfo->Id)
{
case 23333: // Pickup Horde Flag
/*do not uncomment .
/*do not uncomment
if(bg->GetTypeID()==BATTLEGROUND_WS)
bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
sLog.outDebug("Send Event Horde Flag Picked Up");
break;
/* not used :
case 23334: // Drop Horde Flag
if(bg->GetTypeID()==BATTLEGROUND_WS)
bg->EventPlayerDroppedFlag((Player*)m_caster);
sLog.outDebug("Drop Horde Flag");
break;
*/
case 23335: // Pickup Alliance Flag
/*do not uncomment ... (it will cause crash, because of null targetobject!) anyway this is a bad way to call that event, because it would cause recursion
/*do not uncomment - it will cause crash, because of null targetobject!
if(bg->GetTypeID()==BATTLEGROUND_WS)
bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
sLog.outDebug("Send Event Alliance Flag Picked Up");
break;
/* not used :
case 23336: // Drop Alliance Flag
if(bg->GetTypeID()==BATTLEGROUND_WS)
bg->EventPlayerDroppedFlag((Player*)m_caster);
@@ -2524,19 +2523,17 @@ void Spell::EffectSendEvent(uint32 EffectIndex)
if(bg->GetTypeID()==BATTLEGROUND_WS)
bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
sLog.outDebug("Horde Flag Returned");
break;*/
break;
case 34976:
/*
if(bg->GetTypeID()==BATTLEGROUND_EY)
bg->EventPlayerClickedOnFlag((Player*)m_caster, gameObjTarget);
*/
break;
default:
sLog.outDebug("Unknown spellid %u in BG event", m_spellInfo->Id);
break;
}
}
}
}*/
sLog.outDebug("Spell ScriptStart %u for spellid %u in EffectSendEvent ", m_spellInfo->EffectMiscValue[EffectIndex], m_spellInfo->Id);
sWorld.ScriptsStart(sEventScripts, m_spellInfo->EffectMiscValue[EffectIndex], m_caster, focusObject);
}