Skip to content

Commit df8e395

Browse files
authored
Merge pull request #11 from azerothcore/sudlud-pach-42-4
2 parents db16f47 + 9bbc83f commit df8e395

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/PvPScript.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1+
#include "AccountMgr.h"
2+
#include "Chat.h"
13
#include "Configuration/Config.h"
2-
#include "Player.h"
34
#include "Creature.h"
4-
#include "AccountMgr.h"
5-
#include "ScriptMgr.h"
65
#include "Define.h"
76
#include "GossipDef.h"
8-
#include "Pet.h"
97
#include "LootMgr.h"
10-
#include "Chat.h"
8+
#include "Pet.h"
9+
#include "Player.h"
10+
#include "ScriptMgr.h"
1111

1212
uint32 SummonChest, KillAnnounce;
1313
bool spawnchestIP;
@@ -17,7 +17,10 @@ std::vector<uint32> AreatoIgnore = { 1741 /*Gurubashi*/, 2177 };
1717
class PvPScript : public PlayerScript
1818
{
1919
public:
20-
PvPScript() : PlayerScript("PvPScript") {}
20+
PvPScript() : PlayerScript("PvPScript", {
21+
PLAYERHOOK_ON_PLAYER_KILLED_BY_CREATURE,
22+
PLAYERHOOK_ON_PVP_KILL
23+
}) {}
2124

2225
void OnPlayerKilledByCreature(Creature* killer, Player* killed/*, bool& durabilityLoss*/)
2326
{
@@ -33,10 +36,8 @@ class PvPScript : public PlayerScript
3336
if (spawnchestIP)
3437
if (Pet* pet = killer->ToPet())
3538
if (Player* owner = pet->GetOwner())
36-
{
3739
if (!CheckConditions(owner, killed))
3840
return;
39-
}
4041

4142
if (!CheckConditions(nullptr, killed))
4243
return;
@@ -49,7 +50,7 @@ class PvPScript : public PlayerScript
4950
}
5051
}
5152

52-
void OnPVPKill(Player* killer, Player* killed)
53+
void OnPlayerPVPKill(Player* killer, Player* killed)
5354
{
5455
if (!sConfigMgr->GetOption<bool>("PvPChest", true))
5556
return;

0 commit comments

Comments
 (0)