mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
Add Outdoor PvP handlers to various files
This commit is contained in:
parent
525ec3ea4c
commit
e955c3bc8f
6 changed files with 68 additions and 4 deletions
|
|
@ -42,6 +42,7 @@
|
|||
#include "Vehicle.h"
|
||||
#include "BattleGround.h"
|
||||
#include "InstanceData.h"
|
||||
#include "OutdoorPvP/OutdoorPvP.h"
|
||||
#include "MapPersistentStateMgr.h"
|
||||
#include "GridNotifiersImpl.h"
|
||||
#include "CellImpl.h"
|
||||
|
|
@ -1097,6 +1098,13 @@ uint32 Unit::DealDamage(Unit* pVictim, uint32 damage, CleanDamage const* cleanDa
|
|||
he->DuelComplete(DUEL_INTERUPTED);
|
||||
}
|
||||
|
||||
// handle player kill in outdoor pvp
|
||||
if (player_tap && pVictim->GetTypeId() == TYPEID_PLAYER && pVictim != this)
|
||||
{
|
||||
if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(player_tap->GetCachedZoneId()))
|
||||
outdoorPvP->HandlePlayerKill(player_tap, pVictim);
|
||||
}
|
||||
|
||||
// battleground things (do this at the end, so the death state flag will be properly set to handle in the bg->handlekill)
|
||||
if (pVictim->GetTypeId() == TYPEID_PLAYER && ((Player*)pVictim)->InBattleGround())
|
||||
{
|
||||
|
|
@ -1328,6 +1336,10 @@ void Unit::JustKilledCreature(Creature* victim)
|
|||
if (InstanceData* mapInstance = victim->GetInstanceData())
|
||||
mapInstance->OnCreatureDeath(victim);
|
||||
|
||||
// Notify the outdoor pvp script
|
||||
if (OutdoorPvP* outdoorPvP = sOutdoorPvPMgr.GetScript(GetZoneId()))
|
||||
outdoorPvP->HandleCreatureDeath(victim);
|
||||
|
||||
if (victim->IsLinkingEventTrigger())
|
||||
victim->GetMap()->GetCreatureLinkingHolder()->DoCreatureLinkingEvent(LINKING_EVENT_DIE, victim);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue