mirror of
https://github.com/telegramcores/mod-premium.git
synced 2026-01-13 00:58:36 +00:00
Players can now enable or disable options via the config file
This commit is contained in:
@@ -5,7 +5,41 @@
|
||||
# Description: Enable PremiumAccount for players
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
|
||||
PremiumAccount = 1
|
||||
|
||||
# Morph
|
||||
# Description: Enable Morph & demorph option for players
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
Morph = 0
|
||||
|
||||
# Bank
|
||||
# Description: Allow Players to use mobile bank
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
Bank = 0
|
||||
|
||||
# Auction
|
||||
# Description: Allow Players to use mobile Auction
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
Auction = 0
|
||||
|
||||
# Mount
|
||||
# Description: Allow Players to use mount
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
Mount = 1
|
||||
|
||||
# Vendor
|
||||
# Description: Allow Players to use vendor
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
Vendor = 0
|
||||
|
||||
# Mail Box
|
||||
# Description: Allow Players Access ingame Mail
|
||||
# Default: 1 - (Enabled)
|
||||
# 0 - (Disabled)
|
||||
MailBox = 0
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
void AddSC_premium_account();
|
||||
|
||||
void AddPremiumScripts() {
|
||||
AddSC_premium_account();
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Spell.h"
|
||||
#include "Configuration/Config.h"
|
||||
|
||||
enum vendor
|
||||
{
|
||||
@@ -34,12 +35,21 @@ public:
|
||||
return false;
|
||||
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
|
||||
if (sConfigMgr->GetBoolDefault("Morph", true))
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Morph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Demorph", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
}
|
||||
if (sConfigMgr->GetBoolDefault("Bank", true))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Show Bank", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
if (sConfigMgr->GetBoolDefault("MailBox", true))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Mail Box", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
if (sConfigMgr->GetBoolDefault("Vendor", true))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Vendor", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
if (sConfigMgr->GetBoolDefault("Mount", true))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT_16, "Mount", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
if (sConfigMgr->GetBoolDefault("Auction", true))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, "Auction House", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
||||
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
|
||||
return false; // Cast the spell on use normally
|
||||
@@ -143,7 +153,27 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class premium_world : public WorldScript
|
||||
{
|
||||
public:
|
||||
premium_world() : WorldScript("premiumworld") { }
|
||||
|
||||
void OnBeforeConfigLoad(bool reload) override
|
||||
{
|
||||
if (!reload) {
|
||||
std::string cfg_file = "premium.conf";
|
||||
std::string cfg_def_file = cfg_file + ".dist";
|
||||
|
||||
sConfigMgr->LoadMore(cfg_def_file.c_str());
|
||||
|
||||
sConfigMgr->LoadMore(cfg_file.c_str());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_premium_account()
|
||||
{
|
||||
new premium_account();
|
||||
new premium_world();
|
||||
}
|
||||
Reference in New Issue
Block a user