147 lines
5.0 KiB
C++
147 lines
5.0 KiB
C++
//// MxWoW Official Module
|
|
//// QoL Master
|
|
//// Dev: mikx
|
|
//// Git: https://mxgit.ovh/MxWoW/mod-mxwow-qolmaster
|
|
|
|
#include "Define.h"
|
|
#include "GossipDef.h"
|
|
#include "Item.h"
|
|
#include "Player.h"
|
|
#include "ScriptedGossip.h"
|
|
#include "ScriptMgr.h"
|
|
#include "Spell.h"
|
|
#include "Configuration/Config.h"
|
|
#include "Chat.h"
|
|
|
|
class mxwow_toonmasterAnnounce : public PlayerScript
|
|
{
|
|
public:
|
|
mxwow_toonmasterAnnounce() : PlayerScript("mxwow_toonmasterAnnounce") {}
|
|
void OnLogin(Player* player) override
|
|
{
|
|
// Announce Module
|
|
if (sConfigMgr->GetOption<bool>("MxWoW_ToonMaster.Enabled", true))
|
|
{
|
|
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00MxW Toon Master|r module.");
|
|
}
|
|
}
|
|
};
|
|
|
|
class mxwow_toonmaster : public PlayerScript
|
|
{
|
|
public:
|
|
mxwow_toonmaster() : PlayerScript("mxwow_toonmaster") {}
|
|
|
|
void OnGiveXP(Player* player, uint32& amount, Unit* victim, uint8 xpSource) override
|
|
{
|
|
std::ostringstream ss;
|
|
if (sConfigMgr->GetOption<bool>("MxWoW_ToonMaster.Enabled", true))
|
|
{
|
|
int pLevel = player->GetLevel();
|
|
int mLevel = sConfigMgr->GetOption<int>("MxWoW_ToonMaster.MaxLevel", true);
|
|
if (pLevel <= mLevel) {
|
|
QueryResult queryMaxLevelPlayer = CharacterDatabase.Query("SELECT * FROM characters WHERE account = {} AND level = 80", player->GetSession()->GetAccountId());
|
|
if (queryMaxLevelPlayer) {
|
|
int cMPL = queryMaxLevelPlayer->GetRowCount();
|
|
int expMulti = 1;
|
|
int plevel = player->getLevel();
|
|
|
|
if (cMPL > 0 && plevel < 80)
|
|
{
|
|
switch (cMPL) {
|
|
case 1:
|
|
expMulti = 2;
|
|
break;
|
|
case 2:
|
|
expMulti = 3;
|
|
break;
|
|
case 3:
|
|
expMulti = 4;
|
|
break;
|
|
case 4:
|
|
expMulti = 5;
|
|
break;
|
|
case 5:
|
|
expMulti = 6;
|
|
break;
|
|
case 6:
|
|
expMulti = 7;
|
|
break;
|
|
case 7:
|
|
expMulti = 8;
|
|
break;
|
|
case 8:
|
|
expMulti = 9;
|
|
break;
|
|
case 9:
|
|
expMulti = 10;
|
|
break;
|
|
}
|
|
amount = amount * expMulti;
|
|
if (sConfigMgr->GetOption<bool>("MxWoW_ToonMaster.Verbose", true) && plevel < 80)
|
|
{
|
|
ss << "|cffabeeff[MxW][ToonMaster][%ixNiv.80] Bonus: EXPx%i";
|
|
ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), cMPL, expMulti);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/*bool OnReputationChange(Player* player, uint32 factionID, int32& standing, bool incremental) override
|
|
{
|
|
std::ostringstream ss;
|
|
QueryResult queryMaxLevelPlayer = CharacterDatabase.Query("SELECT * FROM characters WHERE account = {} AND level = 80", player->GetSession()->GetAccountId());
|
|
if (queryMaxLevelPlayer)
|
|
{
|
|
int cMPL = queryMaxLevelPlayer->GetRowCount();
|
|
float repMulti = 1;
|
|
int pLevel = player->GetLevel();
|
|
int mLevel = sConfigMgr->GetOption<int>("MxWoW_ToonMaster.MaxLevel", true);
|
|
if (cMPL > 1)
|
|
{
|
|
switch (cMPL) {
|
|
case 2:
|
|
repMulti = 2;
|
|
break;
|
|
case 3:
|
|
repMulti = 3;
|
|
break;
|
|
case 4:
|
|
repMulti = 4;
|
|
break;
|
|
case 5:
|
|
repMulti = 5;
|
|
break;
|
|
case 6:
|
|
repMulti = 6;
|
|
break;
|
|
case 7:
|
|
repMulti = 7;
|
|
break;
|
|
case 8:
|
|
repMulti = 8;
|
|
break;
|
|
case 9:
|
|
repMulti = 10;
|
|
break;
|
|
}
|
|
standing *= repMulti;
|
|
if (sConfigMgr->GetOption<bool>("MxWoW_ToonMaster.Verbose", true))
|
|
{
|
|
ss << "|cffabeeff[MxW][ToonMaster][%ixNiv.80] Bonus: REPx%f";
|
|
ChatHandler(player->GetSession()).PSendSysMessage(ss.str().c_str(), cMPL, repMulti);
|
|
}
|
|
}
|
|
}
|
|
return true;
|
|
}*/
|
|
};
|
|
|
|
void AddMxWoWPortalMasterScripts()
|
|
{
|
|
new mxwow_toonmasterAnnounce();
|
|
new mxwow_toonmaster();
|
|
}
|