mirror of
https://github.com/azerothcore/mod-money-for-kills.git
synced 2026-01-13 01:08:38 +00:00
Merge pull request #21 from archer-gh/azPlayerScript#21020-updates
This commit is contained in:
@@ -79,6 +79,7 @@ reward range of the group and an option to only reward the player that got the k
|
|||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "Guild.h"
|
#include "Guild.h"
|
||||||
|
#include "WorldSessionMgr.h"
|
||||||
|
|
||||||
enum KillType
|
enum KillType
|
||||||
{
|
{
|
||||||
@@ -112,7 +113,7 @@ public:
|
|||||||
MoneyForKills() : PlayerScript("MoneyForKills") { }
|
MoneyForKills() : PlayerScript("MoneyForKills") { }
|
||||||
|
|
||||||
// Announce Module
|
// Announce Module
|
||||||
void OnLogin(Player *player) {
|
void OnPlayerLogin(Player *player) {
|
||||||
if (sConfigMgr->GetOption<bool>(MFKEnable, true))
|
if (sConfigMgr->GetOption<bool>(MFKEnable, true))
|
||||||
{
|
{
|
||||||
if (sConfigMgr->GetOption<bool>(MFKAnnounce, true))
|
if (sConfigMgr->GetOption<bool>(MFKAnnounce, true))
|
||||||
@@ -123,7 +124,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Player Kill Reward
|
// Player Kill Reward
|
||||||
void OnPVPKill(Player* killer, Player* victim)
|
void OnPlayerPVPKill(Player* killer, Player* victim)
|
||||||
{
|
{
|
||||||
// If enabled...
|
// If enabled...
|
||||||
if (sConfigMgr->GetOption<bool>(MFKEnable, true))
|
if (sConfigMgr->GetOption<bool>(MFKEnable, true))
|
||||||
@@ -169,7 +170,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Creature Kill Reward
|
// Creature Kill Reward
|
||||||
void OnCreatureKill(Player* player, Creature* killed)
|
void OnPlayerCreatureKill(Player* player, Creature* killed)
|
||||||
{
|
{
|
||||||
// If enabled...
|
// If enabled...
|
||||||
if (sConfigMgr->GetOption<bool>(MFKEnable, true))
|
if (sConfigMgr->GetOption<bool>(MFKEnable, true))
|
||||||
@@ -300,7 +301,7 @@ public:
|
|||||||
{
|
{
|
||||||
rewardMsg.append("|cff676767[ |cffFFFF00World |cff676767]|r:|cff4CFF00 ").append(killer->GetName()).append(" |cffFF0000has slain ");
|
rewardMsg.append("|cff676767[ |cffFFFF00World |cff676767]|r:|cff4CFF00 ").append(killer->GetName()).append(" |cffFF0000has slain ");
|
||||||
rewardMsg.append(victim->GetName()).append(" earning a bounty of").append(rewardVal).append(".");
|
rewardMsg.append(victim->GetName()).append(" earning a bounty of").append(rewardVal).append(".");
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
|
sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KILLTYPE_DUNGEONBOSS:
|
case KILLTYPE_DUNGEONBOSS:
|
||||||
@@ -316,7 +317,7 @@ public:
|
|||||||
{
|
{
|
||||||
rewardMsg.append("|cffFF0000[ |cffFFFF00World |cffFF0000]|r:|cff4CFF00 ").append(killer->GetName());
|
rewardMsg.append("|cffFF0000[ |cffFFFF00World |cffFF0000]|r:|cff4CFF00 ").append(killer->GetName());
|
||||||
rewardMsg.append("'s|r group triumphed victoriously over |CFF18BE00[").append(killed->GetName()).append("]|r !");
|
rewardMsg.append("'s|r group triumphed victoriously over |CFF18BE00[").append(killed->GetName()).append("]|r !");
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
|
sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
|
||||||
rewardMsg.clear();
|
rewardMsg.clear();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -328,7 +329,7 @@ public:
|
|||||||
message.append(" met an untimely demise!");
|
message.append(" met an untimely demise!");
|
||||||
|
|
||||||
if (sConfigMgr->GetOption<bool>(MFKAnnounceWorldSuicide, true))
|
if (sConfigMgr->GetOption<bool>(MFKAnnounceWorldSuicide, true))
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, message.c_str());
|
sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, message.c_str());
|
||||||
|
|
||||||
if (sConfigMgr->GetOption<bool>(MFKAnnounceGuildSuicide, false))
|
if (sConfigMgr->GetOption<bool>(MFKAnnounceGuildSuicide, false))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user