mirror of
https://github.com/freekode/mod-reward-played-time-improved.git
synced 2026-02-15 06:36:08 +00:00
@@ -3,10 +3,10 @@
|
||||
#include "Configuration/Config.h"
|
||||
#include "Player.h"
|
||||
#include "AccountMgr.h"
|
||||
#include "Chat.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Define.h"
|
||||
#include "GossipDef.h"
|
||||
#include "Chat.h"
|
||||
|
||||
bool RewardSystem_Enable;
|
||||
uint32 Max_roll;
|
||||
@@ -14,23 +14,21 @@ uint32 Max_roll;
|
||||
class reward_system : public PlayerScript
|
||||
{
|
||||
public:
|
||||
reward_system() : PlayerScript("rewardsystem") {}
|
||||
reward_system() : PlayerScript("reward_system") {}
|
||||
|
||||
uint32 RewardTimer;
|
||||
int32 roll;
|
||||
|
||||
void OnLogin(Player* p)
|
||||
{
|
||||
if (RewardSystem_Enable)
|
||||
{
|
||||
ChatHandler(p->GetSession()).SendSysMessage("This server is running the |cff4CFF00Player Reward System |rmodule.");
|
||||
RewardTimer = (sConfigMgr->GetIntDefault("RewardTime", 1)*HOUR*IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
void OnLogin(Player* player) override
|
||||
{
|
||||
if (sConfigMgr->GetBoolDefault("RewardSystem.Announce", true)) {
|
||||
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00Reward Time Played |rmodule.");
|
||||
}
|
||||
}
|
||||
|
||||
void OnBeforeUpdate(Player* player, uint32 p_time)
|
||||
void OnBeforeUpdate(Player* player, uint32 p_time) override
|
||||
{
|
||||
if (RewardSystem_Enable)
|
||||
if (sConfigMgr->GetBoolDefault("RewardSystemEnable", true))
|
||||
{
|
||||
if (RewardTimer > 0)
|
||||
{
|
||||
@@ -89,7 +87,6 @@ public:
|
||||
std::string cfg_def_file = cfg_file + ".dist";
|
||||
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||
RewardSystem_Enable = sConfigMgr->GetBoolDefault("RewardSystemEnable", true);
|
||||
Max_roll = sConfigMgr->GetIntDefault("MaxRoll", 1000);
|
||||
}
|
||||
}
|
||||
@@ -99,4 +96,4 @@ void AddRewardSystemScripts()
|
||||
{
|
||||
new reward_system();
|
||||
new reward_system_conf();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user