From d8bfa4333a28b5b531ab2a510ef5c61dd3581c3f Mon Sep 17 00:00:00 2001 From: Revision Date: Thu, 30 Dec 2021 00:38:34 +0100 Subject: [PATCH] Added: More bonuses! Added support for giving bonuses to weapons and defense skill as well as professions on weekends. --- conf/mod_weekendbonus.conf.dist | 6 ++++++ src/WeekendBonus.cpp | 24 ++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/conf/mod_weekendbonus.conf.dist b/conf/mod_weekendbonus.conf.dist index b07a23f..63a717e 100644 --- a/conf/mod_weekendbonus.conf.dist +++ b/conf/mod_weekendbonus.conf.dist @@ -6,5 +6,11 @@ WeekendBonus.Multiplier.Experience = 2 # Multiplier for money looted and rewarded from quests on weekends WeekendBonus.Multiplier.Money = 2 +# Multiplier for profession skill ups on weekends +WeekendBonus.Multiplier.Professions = 2 + # Multiplier for reputation gains on weekends WeekendBonus.Multiplier.Reputation = 2 + +# Multiplier for weapons and defense skill ups on weekends +WeekendBonus.Multiplier.Proficiencies = 2 diff --git a/src/WeekendBonus.cpp b/src/WeekendBonus.cpp index 81353f7..1224924 100644 --- a/src/WeekendBonus.cpp +++ b/src/WeekendBonus.cpp @@ -5,7 +5,9 @@ float multiplierExperience; float multiplierMoney; +float multiplierProfessions; float multiplierReputation; +float multiplierProficiencies; enum Day { @@ -29,7 +31,7 @@ class WeekendBonusPlayer : public PlayerScript if (localtime(&t)->tm_wday == Day::FRIDAY || localtime(&t)->tm_wday == Day::SATURDAY || localtime(&t)->tm_wday == Day::SUNDAY) { - ChatHandler(player->GetSession()).SendSysMessage("The weekend bonus is active, granting you bonuses to experience, reputation and money!"); + ChatHandler(player->GetSession()).SendSysMessage("The weekend bonus is active, granting you bonuses!"); } } }; @@ -43,7 +45,9 @@ class WeekendBonusWorld : WorldScript { multiplierExperience = sConfigMgr->GetOption("WeekendBonus.Multiplier.Experience", 2.0f); multiplierMoney = sConfigMgr->GetOption("WeekendBonus.Multiplier.Money", 2.0f); + multiplierProfessions = sConfigMgr->GetOption("WeekendBonus.Multiplier.Professions", 2.0f); multiplierReputation = sConfigMgr->GetOption("WeekendBonus.Multiplier.Reputation", 2.0f); + multiplierProficiencies = sConfigMgr->GetOption("WeekendBonus.Multiplier.Proficiencies", 2.0f); } void OnStartup() override @@ -70,7 +74,7 @@ class WeekendBonusWorld : WorldScript if (localtime(&localTime)->tm_wday == Day::FRIDAY && localtime(&localTime)->tm_hour == 0 && localtime(&localTime)->tm_min == 0 && !triggered) { - sWorld->SendServerMessage(SERVER_MSG_STRING, "The weekend bonus is now active, granting you bonuses to experience, reputation and money!"); + sWorld->SendServerMessage(SERVER_MSG_STRING, "The weekend bonus is now active, granting you bonuses!"); SetWorldRates(); } @@ -92,9 +96,17 @@ class WeekendBonusWorld : WorldScript sWorld->setRate(RATE_XP_QUEST_DF, sWorld->getRate(RATE_XP_QUEST_DF) * multiplierExperience); sWorld->setRate(RATE_XP_EXPLORE, sWorld->getRate(RATE_XP_EXPLORE) * multiplierExperience); sWorld->setRate(RATE_XP_PET, sWorld->getRate(RATE_XP_PET) * multiplierExperience); + sWorld->setRate(RATE_DROP_MONEY, sWorld->getRate(RATE_DROP_MONEY) * multiplierMoney); + + sWorld->setIntConfig(CONFIG_SKILL_GAIN_CRAFTING, sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING) * multiplierProfessions); + sWorld->setIntConfig(CONFIG_SKILL_GAIN_GATHERING, sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING) * multiplierProfessions); + sWorld->setRate(RATE_REPUTATION_GAIN, sWorld->getRate(RATE_REPUTATION_GAIN) * multiplierReputation); + sWorld->setIntConfig(CONFIG_SKILL_GAIN_DEFENSE, sWorld->getIntConfig(CONFIG_SKILL_GAIN_DEFENSE) * multiplierProficiencies); + sWorld->setIntConfig(CONFIG_SKILL_GAIN_WEAPON, sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON) * multiplierProficiencies); + triggered = true; } else @@ -105,9 +117,17 @@ class WeekendBonusWorld : WorldScript sWorld->setRate(RATE_XP_QUEST_DF, sWorld->getRate(RATE_XP_QUEST_DF) / multiplierExperience); sWorld->setRate(RATE_XP_EXPLORE, sWorld->getRate(RATE_XP_EXPLORE) / multiplierExperience); sWorld->setRate(RATE_XP_PET, sWorld->getRate(RATE_XP_PET) / multiplierExperience); + sWorld->setRate(RATE_DROP_MONEY, sWorld->getRate(RATE_DROP_MONEY) / multiplierMoney); + + sWorld->setIntConfig(CONFIG_SKILL_GAIN_CRAFTING, sWorld->getIntConfig(CONFIG_SKILL_GAIN_CRAFTING) / multiplierProfessions); + sWorld->setIntConfig(CONFIG_SKILL_GAIN_GATHERING, sWorld->getIntConfig(CONFIG_SKILL_GAIN_GATHERING) / multiplierProfessions); + sWorld->setRate(RATE_REPUTATION_GAIN, sWorld->getRate(RATE_REPUTATION_GAIN) / multiplierReputation); + sWorld->setIntConfig(CONFIG_SKILL_GAIN_DEFENSE, sWorld->getIntConfig(CONFIG_SKILL_GAIN_DEFENSE) / multiplierProficiencies); + sWorld->setIntConfig(CONFIG_SKILL_GAIN_WEAPON, sWorld->getIntConfig(CONFIG_SKILL_GAIN_WEAPON) / multiplierProficiencies); + triggered = false; } }