Skip to content

Commit 8ea0854

Browse files
committed
Announce Joyous Journeys event and max XP rate on login
Added a system message on player login to inform users when the Joyous Journeys event is active and display the maximum allowed XP rate. Also refactored ConfigMaxAllowedRate to public for use in the login announcement.
1 parent 7e2e01c commit 8ea0854

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/mod-double-xp-weekend.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ class DoubleXpWeekend
145145
float ConfigJoyousJourneysXPRate() const { return sConfigMgr->GetOption<float>("XPWeekend.JoyousJourneysXPRate", 1.0f); }
146146
float ConfigJoyousJourneysRepRate() const { return sConfigMgr->GetOption<float>("XPWeekend.JoyousJourneysRepRate", 1.10f); }
147147
bool ExcludeInsaneReps() const { return sConfigMgr->GetOption<bool>("XPWeekend.ExcludeInsaneReps", true); }
148+
float ConfigMaxAllowedRate() const { return sConfigMgr->GetOption<float>("XPWeekend.MaxAllowedRate", 2.0f) + (IsJoyousJourneysActive() ? ConfigJoyousJourneysXPRate() : 0.0f); }
148149

149150
private:
150151

@@ -156,7 +157,6 @@ class DoubleXpWeekend
156157
float ConfigxpAmount() const { return sConfigMgr->GetOption<float>("XPWeekend.xpAmount", 2.0f); }
157158
bool ConfigIndividualXPEnabled() const { return sConfigMgr->GetOption<bool>("XPWeekend.IndividualXPEnabled", false); }
158159
bool ConfigEnabled() const { return sConfigMgr->GetOption<bool>("XPWeekend.Enabled", false); }
159-
float ConfigMaxAllowedRate() const { return sConfigMgr->GetOption<float>("XPWeekend.MaxAllowedRate", 2.0f) + (IsJoyousJourneysActive() ? ConfigJoyousJourneysXPRate() : 0.0f); }
160160
bool ConfigIsDKStartZoneRequired() const { return sConfigMgr->GetOption<bool>("XPWeekend.IsDKStartZoneRequired", false); }
161161

162162
bool IsDKStartZoneComplete(Player* player) const
@@ -312,6 +312,9 @@ class DoubleXpWeekendPlayerScript : public PlayerScript
312312
DoubleXpWeekend* mod = DoubleXpWeekend::instance();
313313
ChatHandler handler = ChatHandler(player->GetSession());
314314
mod->OnPlayerLogin(player, &handler);
315+
316+
if (mod->IsJoyousJourneysActive() && mod->ConfigJoyousJourneysXPRate())
317+
handler.PSendSysMessage("|cff00ccffThe Joyous Journeys event is active! You may set your rates up to {} while it is active!|r", mod->ConfigMaxAllowedRate());
315318
}
316319

317320
void OnPlayerGiveXP(Player* player, uint32& amount, Unit* /*victim*/, uint8 xpSource) override

0 commit comments

Comments
 (0)