Add Outdoor PvP handlers to various files

This commit is contained in:
Xfurry 2012-08-17 18:47:59 +02:00 committed by Antz
parent 525ec3ea4c
commit e955c3bc8f
6 changed files with 68 additions and 4 deletions

View file

@ -38,6 +38,7 @@
#include "Creature.h"
#include "Formulas.h"
#include "BattleGround.h"
#include "OutdoorPvP/OutdoorPvP.h"
#include "CreatureAI.h"
#include "ScriptMgr.h"
#include "Util.h"
@ -5194,8 +5195,11 @@ void Aura::HandleAuraModEffectImmunity(bool apply, bool /*Real*/)
if( !apply && target->GetTypeId() == TYPEID_PLAYER
&& (GetSpellProto()->GetAuraInterruptFlags() & AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION) )
{
if (BattleGround* bg = ((Player*)target)->GetBattleGround())
bg->EventPlayerDroppedFlag(((Player*)target));
Player* player = (Player*)target;
if (BattleGround* bg = player->GetBattleGround())
bg->EventPlayerDroppedFlag(player);
else if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(player->GetCachedZoneId()))
outdoorPvP->HandleDropFlag(player, GetSpellProto()->Id);
}
target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, m_modifier.m_miscvalue, apply);