Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions src/PvPScript.cpp
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "AccountMgr.h"
#include "Chat.h"
#include "Configuration/Config.h"
#include "Player.h"
#include "Creature.h"
#include "AccountMgr.h"
#include "ScriptMgr.h"
#include "Define.h"
#include "GossipDef.h"
#include "Pet.h"
#include "LootMgr.h"
#include "Chat.h"
#include "Pet.h"
#include "Player.h"
#include "ScriptMgr.h"

uint32 SummonChest, KillAnnounce;
bool spawnchestIP;
Expand All @@ -17,7 +17,10 @@ std::vector<uint32> AreatoIgnore = { 1741 /*Gurubashi*/, 2177 };
class PvPScript : public PlayerScript
{
public:
PvPScript() : PlayerScript("PvPScript") {}
PvPScript() : PlayerScript("PvPScript", {
PLAYERHOOK_ON_PLAYER_KILLED_BY_CREATURE,
PLAYERHOOK_ON_PVP_KILL
}) {}

void OnPlayerKilledByCreature(Creature* killer, Player* killed/*, bool& durabilityLoss*/)
{
Expand All @@ -33,10 +36,8 @@ class PvPScript : public PlayerScript
if (spawnchestIP)
if (Pet* pet = killer->ToPet())
if (Player* owner = pet->GetOwner())
{
if (!CheckConditions(owner, killed))
return;
}

if (!CheckConditions(nullptr, killed))
return;
Expand All @@ -49,7 +50,7 @@ class PvPScript : public PlayerScript
}
}

void OnPVPKill(Player* killer, Player* killed)
void OnPlayerPVPKill(Player* killer, Player* killed)
{
if (!sConfigMgr->GetOption<bool>("PvPChest", true))
return;
Expand Down