mirror of
https://github.com/azerothcore/mod-money-for-kills.git
synced 2026-01-13 01:08:38 +00:00
Add config options for other features
https://github.com/azerothcore/mod-money-for-kills/issues/2
This commit is contained in:
@@ -14,6 +14,26 @@ MFK.Enable = 1
|
|||||||
|
|
||||||
MFK.Announce = 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?
|
# Only allow the player with the killing blow to claim the bounty?
|
||||||
# Default: 0 (All players receive the bounty)
|
# Default: 0 (All players receive the bounty)
|
||||||
|
|
||||||
|
|||||||
@@ -31,12 +31,12 @@ reward range of the group and an option to only reward the player that got the k
|
|||||||
- Type: Server/Player
|
- Type: Server/Player
|
||||||
- Script: MoneyForKills
|
- Script: MoneyForKills
|
||||||
- Config: Yes
|
- Config: Yes
|
||||||
- Enable/Disable Module
|
- Enable/Disable Module
|
||||||
- Enable Module Announce
|
- Enable Module Announce
|
||||||
- Enable Killing Blow Only Bounty
|
- Enable Killing Blow Only Bounty
|
||||||
- Enable Bounty for Players Outside Reward Area
|
- Enable Bounty for Players Outside Reward Area
|
||||||
- Set % of Gold Looted from victim on PVP kill
|
- Set % of Gold Looted from victim on PVP kill
|
||||||
- Set Bounty Multipliers for each type of kill
|
- Set Bounty Multipliers for each type of kill
|
||||||
- SQL: No
|
- SQL: No
|
||||||
|
|
||||||
|
|
||||||
@@ -112,12 +112,16 @@ public:
|
|||||||
// No reward for killing yourself
|
// No reward for killing yourself
|
||||||
if (killer->GetGUID() == victim->GetGUID())
|
if (killer->GetGUID() == victim->GetGUID())
|
||||||
{
|
{
|
||||||
// Inform the world
|
if (sConfigMgr->GetBoolDefault("MFK.SuicideAnnounce", true))
|
||||||
std::string message = "|cff676767[ |cffFFFF00World |cff676767]|r:|cff4CFF00 ";
|
{
|
||||||
message.append(killer->GetName());
|
// Inform the world
|
||||||
message.append(" met an untimely demise!");
|
std::string message = "|cff676767[ |cffFFFF00World |cff676767]|r:|cff4CFF00 ";
|
||||||
|
message.append(killer->GetName());
|
||||||
|
message.append(" met an untimely demise!");
|
||||||
|
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, message.c_str());
|
sWorld->SendServerMessage(SERVER_MSG_STRING, message.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,7 +147,6 @@ public:
|
|||||||
|
|
||||||
// Inform the player of the bounty amount
|
// Inform the player of the bounty amount
|
||||||
Notify(killer, victim, nullptr, KILLTYPE_PVP, BountyAmount);
|
Notify(killer, victim, nullptr, KILLTYPE_PVP, BountyAmount);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -277,37 +280,46 @@ public:
|
|||||||
{
|
{
|
||||||
case KILLTYPE_LOOT:
|
case KILLTYPE_LOOT:
|
||||||
rewardMsg.append("You loot").append(rewardVal).append(" from the corpse.");
|
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(killer->GetName()).append(" rifles through your corpse and takes").append(rewardVal).append(".");
|
||||||
victimMsg.append(".");
|
|
||||||
ChatHandler(victim->GetSession()).SendSysMessage(victimMsg.c_str());
|
ChatHandler(victim->GetSession()).SendSysMessage(victimMsg.c_str());
|
||||||
break;
|
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
|
||||||
|
break;
|
||||||
case KILLTYPE_PVP:
|
case KILLTYPE_PVP:
|
||||||
rewardMsg.append("|cff676767[ |cffFFFF00World |cff676767]|r:|cff4CFF00 ").append(killer->GetName()).append(" |cffFF0000has slain ");
|
if (sConfigMgr->GetBoolDefault("MFK.PvPAnnounce", true))
|
||||||
rewardMsg.append(victim->GetName()).append(" earning a bounty of").append(rewardVal).append(".");
|
{
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
|
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;
|
break;
|
||||||
case KILLTYPE_DUNGEONBOSS:
|
case KILLTYPE_DUNGEONBOSS:
|
||||||
rewardMsg.append("|cffFF8000Your group has defeated |cffFF0000").append(killed->GetName()).append("|cffFF8000.");
|
if (sConfigMgr->GetBoolDefault("MFK.DungeonBossAnnounce", true))
|
||||||
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
|
{
|
||||||
rewardMsg.clear();
|
rewardMsg.append("|cffFF8000Your group has defeated |cffFF0000").append(killed->GetName()).append("|cffFF8000.");
|
||||||
|
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
|
||||||
|
rewardMsg.clear();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case KILLTYPE_WORLDBOSS:
|
case KILLTYPE_WORLDBOSS:
|
||||||
rewardMsg.append("|cffFF0000[ |cffFFFF00World |cffFF0000]|r:|cff4CFF00 ").append(killer->GetName());
|
if (sConfigMgr->GetBoolDefault("MFK.WorldBossAnnounce", true))
|
||||||
rewardMsg.append("'s|r group triumphed victoriously over |CFF18BE00[").append(killed->GetName()).append("]|r !");
|
{
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, rewardMsg.c_str());
|
rewardMsg.append("|cffFF0000[ |cffFFFF00World |cffFF0000]|r:|cff4CFF00 ").append(killer->GetName());
|
||||||
rewardMsg.clear();
|
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;
|
break;
|
||||||
case KILLTYPE_MOB:
|
case KILLTYPE_MOB:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kType != KILLTYPE_PVP)
|
if (kType != KILLTYPE_LOOT)
|
||||||
{
|
{
|
||||||
|
rewardMsg.clear();
|
||||||
rewardMsg.append(" You receive a bounty of");
|
rewardMsg.append(" You receive a bounty of");
|
||||||
rewardMsg.append(rewardVal);
|
rewardMsg.append(rewardVal);
|
||||||
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
|
|
||||||
rewardMsg.append(" for the kill.");
|
rewardMsg.append(" for the kill.");
|
||||||
|
ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,12 +350,12 @@ public:
|
|||||||
if (!reload) {
|
if (!reload) {
|
||||||
std::string conf_path = _CONF_DIR;
|
std::string conf_path = _CONF_DIR;
|
||||||
std::string cfg_file = conf_path + "/mod_moneyforkills.conf";
|
std::string cfg_file = conf_path + "/mod_moneyforkills.conf";
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
cfg_file = "mod_moneyforkills.conf";
|
cfg_file = "mod_moneyforkills.conf";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string cfg_def_file = cfg_file + ".dist";
|
std::string cfg_def_file = cfg_file + ".dist";
|
||||||
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||||
sConfigMgr->LoadMore(cfg_file.c_str());
|
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||||
}
|
}
|
||||||
@@ -353,5 +365,5 @@ public:
|
|||||||
void AddMoneyForKillsScripts()
|
void AddMoneyForKillsScripts()
|
||||||
{
|
{
|
||||||
new MoneyForKills();
|
new MoneyForKills();
|
||||||
new MoneyForKillsWorld();
|
new MoneyForKillsWorld();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user