Add config options for other features

https://github.com/azerothcore/mod-money-for-kills/issues/2
This commit is contained in:
Sdyess
2019-06-10 19:11:59 -05:00
parent daf204ad34
commit e71c6062bc
2 changed files with 67 additions and 35 deletions

View File

@@ -14,6 +14,26 @@ MFK.Enable = 1
MFK.Announce = 1
# Enable announcements to notify the server of a world boss kill
# Default 1
MFK.WorldBossAnnounce = 1
# Enable player suicide announcements
# Default 1
MFK.SuicideAnnounce = 1
# Enable PvP announcements
# Default 1
MFK.PvPAnnounce = 1
# Enable Group announcements for killing a dungeon boss
# Default 1
MFK.DungeonBossAnnounce = 1
# Only allow the player with the killing blow to claim the bounty?
# Default: 0 (All players receive the bounty)

View File

@@ -31,12 +31,12 @@ reward range of the group and an option to only reward the player that got the k
- Type: Server/Player
- Script: MoneyForKills
- Config: Yes
- Enable/Disable Module
- Enable Module Announce
- Enable Killing Blow Only Bounty
- Enable Bounty for Players Outside Reward Area
- Set % of Gold Looted from victim on PVP kill
- Set Bounty Multipliers for each type of kill
- Enable/Disable Module
- Enable Module Announce
- Enable Killing Blow Only Bounty
- Enable Bounty for Players Outside Reward Area
- Set % of Gold Looted from victim on PVP kill
- Set Bounty Multipliers for each type of kill
- SQL: No
@@ -111,6 +111,8 @@ public:
{
// No reward for killing yourself
if (killer->GetGUID() == victim->GetGUID())
{
if (sConfigMgr->GetBoolDefault("MFK.SuicideAnnounce", true))
{
// Inform the world
std::string message = "|cff676767[ |cffFFFF00World |cff676767]|r:|cff4CFF00 ";
@@ -118,6 +120,8 @@ public:
message.append(" met an untimely demise!");
sWorld->SendServerMessage(SERVER_MSG_STRING, message.c_str());
}
return;
}
@@ -143,7 +147,6 @@ public:
// Inform the player of the bounty amount
Notify(killer, victim, nullptr, KILLTYPE_PVP, BountyAmount);
return;
}
}
@@ -277,37 +280,46 @@ public:
{
case KILLTYPE_LOOT:
rewardMsg.append("You loot").append(rewardVal).append(" from the corpse.");
victimMsg.append(killer->GetName()).append(" rifles through your corpse and takes").append(rewardVal);
victimMsg.append(".");
victimMsg.append(killer->GetName()).append(" rifles through your corpse and takes").append(rewardVal).append(".");
ChatHandler(victim->GetSession()).SendSysMessage(victimMsg.c_str());
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
break;
case KILLTYPE_PVP:
if (sConfigMgr->GetBoolDefault("MFK.PvPAnnounce", true))
{
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(".");
sWorld->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
}
break;
case KILLTYPE_DUNGEONBOSS:
if (sConfigMgr->GetBoolDefault("MFK.DungeonBossAnnounce", true))
{
rewardMsg.append("|cffFF8000Your group has defeated |cffFF0000").append(killed->GetName()).append("|cffFF8000.");
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
rewardMsg.clear();
}
break;
case KILLTYPE_WORLDBOSS:
if (sConfigMgr->GetBoolDefault("MFK.WorldBossAnnounce", true))
{
rewardMsg.append("|cffFF0000[ |cffFFFF00World |cffFF0000]|r:|cff4CFF00 ").append(killer->GetName());
rewardMsg.append("'s|r group triumphed victoriously over |CFF18BE00[").append(killed->GetName()).append("]|r !");
sWorld->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
rewardMsg.clear();
}
break;
case KILLTYPE_MOB:
break;
}
if (kType != KILLTYPE_PVP)
if (kType != KILLTYPE_LOOT)
{
rewardMsg.clear();
rewardMsg.append(" You receive a bounty of");
rewardMsg.append(rewardVal);
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
rewardMsg.append(" for the kill.");
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
}
}
@@ -339,9 +351,9 @@ public:
std::string conf_path = _CONF_DIR;
std::string cfg_file = conf_path + "/mod_moneyforkills.conf";
#ifdef WIN32
#ifdef WIN32
cfg_file = "mod_moneyforkills.conf";
#endif
#endif
std::string cfg_def_file = cfg_file + ".dist";
sConfigMgr->LoadMore(cfg_def_file.c_str());