From b2fa1c9d2bdf8ef4dc7c3e896c9c214ffa300d19 Mon Sep 17 00:00:00 2001 From: SoulSeekkor Date: Sat, 9 Apr 2022 13:32:41 -0500 Subject: [PATCH 1/3] Updated to clear compiler warnings. --- src/mod_moneyforkills.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/mod_moneyforkills.cpp b/src/mod_moneyforkills.cpp index 73be8f7..722ab59 100644 --- a/src/mod_moneyforkills.cpp +++ b/src/mod_moneyforkills.cpp @@ -110,9 +110,9 @@ public: // Announce Module void OnLogin(Player *player) { - if (sConfigMgr->GetBoolDefault(MFKEnable, true)) + if (sConfigMgr->GetOption(MFKEnable, true)) { - if (sConfigMgr->GetBoolDefault(MFKAnnounce, true)) + if (sConfigMgr->GetOption(MFKAnnounce, true)) { ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00MoneyForKills |rmodule."); } @@ -123,9 +123,9 @@ public: void OnPVPKill(Player* killer, Player* victim) { // If enabled... - if (sConfigMgr->GetBoolDefault(MFKEnable, true)) + if (sConfigMgr->GetOption(MFKEnable, true)) { - const uint32 PVPMultiplier = sConfigMgr->GetIntDefault(MFKPVPKillMult, 0); + const uint32 PVPMultiplier = sConfigMgr->GetOption(MFKPVPKillMult, 0); const uint32 VictimLevel = victim->getLevel(); // If enabled... @@ -147,7 +147,7 @@ public: } // Calculate the amount of gold to give to the victor - const uint32 PVPCorpseLootPercent = sConfigMgr->GetIntDefault(MFKPVPCorpseLootPercent, 5); + const uint32 PVPCorpseLootPercent = sConfigMgr->GetOption(MFKPVPCorpseLootPercent, 5); const int VictimLoot = (victim->GetMoney() * PVPCorpseLootPercent) / 100; // Rifle the victim's corpse for loot @@ -169,7 +169,7 @@ public: void OnCreatureKill(Player* player, Creature* killed) { // If enabled... - if (sConfigMgr->GetBoolDefault(MFKEnable, true)) + if (sConfigMgr->GetOption(MFKEnable, true)) { // Get the creature level const uint32 CreatureLevel = killed->getLevel(); @@ -178,16 +178,16 @@ public: KillType CreatureType; if (killed->IsDungeonBoss()) { - BossMultiplier = sConfigMgr->GetIntDefault(MFKBountyKillDBMult, 0); + BossMultiplier = sConfigMgr->GetOption(MFKBountyKillDBMult, 0); CreatureType = KILLTYPE_DUNGEONBOSS; } else if (killed->isWorldBoss()) { - BossMultiplier = sConfigMgr->GetIntDefault(MFKBountyKillWBMult, 0); + BossMultiplier = sConfigMgr->GetOption(MFKBountyKillWBMult, 0); CreatureType = KILLTYPE_WORLDBOSS; } else { - KillMultiplier = sConfigMgr->GetIntDefault(MFKBountyKillMult, 0); + KillMultiplier = sConfigMgr->GetOption(MFKBountyKillMult, 0); CreatureType = KILLTYPE_MOB; } @@ -223,7 +223,7 @@ public: void CreatureBounty(Player* player, Creature* killed, KillType kType, int bounty) { Group* group = player->GetGroup(); - const uint32 KillingBlowOnly = sConfigMgr->GetIntDefault(MFKBountyKillingBlow, 0); + const uint32 KillingBlowOnly = sConfigMgr->GetOption(MFKBountyKillingBlow, 0); // Determine who receives the bounty if (!group || KillingBlowOnly == 1) @@ -236,7 +236,7 @@ public: } else { - const uint32 MoneyForNothing = sConfigMgr->GetIntDefault(MFKBountyMoneyForNothing, 0); + const uint32 MoneyForNothing = sConfigMgr->GetOption(MFKBountyMoneyForNothing, 0); Group::MemberSlotList const& members = group->GetMemberSlots(); // Pay the group (OnCreatureKill only rewards the player that got the killing blow) @@ -293,7 +293,7 @@ public: ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str()); break; case KILLTYPE_PVP: - if (sConfigMgr->GetBoolDefault(MFKAnnouncePvP, true)) + if (sConfigMgr->GetOption(MFKAnnouncePvP, 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("."); @@ -301,7 +301,7 @@ public: } break; case KILLTYPE_DUNGEONBOSS: - if (sConfigMgr->GetBoolDefault(MFKAnnounceDungeonBoss, true)) + if (sConfigMgr->GetOption(MFKAnnounceDungeonBoss, true)) { rewardMsg.append("|cffFF8000Your group has defeated |cffFF0000").append(killed->GetName()).append("|cffFF8000."); ChatHandler(killer->GetSession()).SendSysMessage(rewardMsg.c_str()); @@ -309,7 +309,7 @@ public: } break; case KILLTYPE_WORLDBOSS: - if (sConfigMgr->GetBoolDefault(MFKAnnounceWorldBoss, true)) + if (sConfigMgr->GetOption(MFKAnnounceWorldBoss, 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 !"); @@ -324,10 +324,10 @@ public: message.append(killer->GetName()); message.append(" met an untimely demise!"); - if (sConfigMgr->GetBoolDefault(MFKAnnounceWorldSuicide, true)) + if (sConfigMgr->GetOption(MFKAnnounceWorldSuicide, true)) sWorld->SendServerMessage(SERVER_MSG_STRING, message.c_str()); - if (sConfigMgr->GetBoolDefault(MFKAnnounceGuildSuicide, false)) + if (sConfigMgr->GetOption(MFKAnnounceGuildSuicide, false)) { Guild* guild = killer->GetGuild(); if (guild) @@ -335,7 +335,7 @@ public: } - if (sConfigMgr->GetBoolDefault(MFKAnnounceGroupSuicide, false)) + if (sConfigMgr->GetOption(MFKAnnounceGroupSuicide, false)) { Group* group = killer->GetGroup(); if (group) @@ -383,4 +383,4 @@ public: void AddMoneyForKillsScripts() { new MoneyForKills(); -} +} \ No newline at end of file From 746dd2bf2924a9a3ff0323b4ede692f1674dd049 Mon Sep 17 00:00:00 2001 From: SoulSeekkor Date: Sat, 9 Apr 2022 14:10:32 -0500 Subject: [PATCH 2/3] Updated README and changelog. --- README.md | 2 ++ src/mod_moneyforkills.cpp | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ca815c..3e3f89f 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,8 @@ ## Credits + * [stygiancore]( http://stygianthebest.github.io ): (Author of the module): +* [SoulSeekkor]( https://github.com/SoulSeekkor ) cleaned up deprecation warnings * AzerothCore: [repository](https://github.com/azerothcore) - [website](http://azerothcore.org/) - [discord chat community](https://discord.gg/PaqQRkd) diff --git a/src/mod_moneyforkills.cpp b/src/mod_moneyforkills.cpp index 722ab59..9cf184f 100644 --- a/src/mod_moneyforkills.cpp +++ b/src/mod_moneyforkills.cpp @@ -2,7 +2,8 @@ # Money For Kills # -#### A module for AzerothCore by [StygianTheBest](https://github.com/StygianTheBest/AzerothCore-Content/tree/master/Modules) +#### A module for AzerothCore (https://github.com/azerothcore/mod-money-for-kills) +#### Originally by [StygianTheBest](https://github.com/StygianTheBest/AzerothCore-Content/tree/master/Modules) ------------------------------------------------------------------------------------------------------------------ @@ -42,6 +43,7 @@ reward range of the group and an option to only reward the player that got the k ### Version ### ------------------------------------------------------------------------------------------------------------------ +- v2022.04.09 - Fixed deprecation warnings - v2017.08.24 - Release - v2017.08.31 - Added boss kills - v2017.09.02 - Added distance check, Fixed group payment From 117cda304c69c2690cf59eafb0732ce7ce769648 Mon Sep 17 00:00:00 2001 From: SoulSeekkor Date: Sat, 9 Apr 2022 14:33:40 -0500 Subject: [PATCH 3/3] Updated credits. --- src/mod_moneyforkills.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mod_moneyforkills.cpp b/src/mod_moneyforkills.cpp index 9cf184f..de2ae8f 100644 --- a/src/mod_moneyforkills.cpp +++ b/src/mod_moneyforkills.cpp @@ -64,6 +64,7 @@ reward range of the group and an option to only reward the player that got the k - [OregonCore](https://wiki.oregon-core.net/) - [Wowhead.com](http://wowhead.com) - [AoWoW](https://wotlk.evowow.com/) +- [SoulSeekkor](https://github.com/SoulSeekkor) ### License ###