levelup+autoguild script
This commit is contained in:
parent
8fa12002ad
commit
6fc771b042
@ -16,6 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// This is where scripts' loading functions should be declared:
|
// This is where scripts' loading functions should be declared:
|
||||||
|
void AddSC_mod_mxw_autoguild();
|
||||||
void AddSC_mod_mxw_dynamicxp();
|
void AddSC_mod_mxw_dynamicxp();
|
||||||
void AddSC_mod_mxw_sololfg();
|
void AddSC_mod_mxw_sololfg();
|
||||||
void AddSC_solocraft();
|
void AddSC_solocraft();
|
||||||
@ -27,6 +28,7 @@ void AddSC_solocraft();
|
|||||||
// void Add${NameOfDirectory}Scripts()
|
// void Add${NameOfDirectory}Scripts()
|
||||||
void AddCustomScripts()
|
void AddCustomScripts()
|
||||||
{
|
{
|
||||||
|
AddSC_mod_mxw_autoguild();
|
||||||
AddSC_mod_mxw_dynamicxp();
|
AddSC_mod_mxw_dynamicxp();
|
||||||
AddSC_mod_mxw_sololfg();
|
AddSC_mod_mxw_sololfg();
|
||||||
AddSC_solocraft();
|
AddSC_solocraft();
|
||||||
|
29
src/server/scripts/Custom/mod_mxw_autoguild.cpp
Normal file
29
src/server/scripts/Custom/mod_mxw_autoguild.cpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#include "ScriptMgr.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "GuildMgr.h"
|
||||||
|
#include "Config.h"
|
||||||
|
#include "Guild.h"
|
||||||
|
|
||||||
|
class mod_mxw_autoguild : public PlayerScript
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
mod_mxw_autoguild() : PlayerScript("mod_mxw_autoguild") { }
|
||||||
|
|
||||||
|
void OnLogin(Player* player, bool firstLogin)
|
||||||
|
{
|
||||||
|
if (firstLogin)
|
||||||
|
{
|
||||||
|
uint32 GUILD_ID_ALLIANCE = sConfigMgr->GetIntDefault("AutoGuild.Alliance", 0);
|
||||||
|
uint32 GUILD_ID_HORDE = sConfigMgr->GetIntDefault("AutoGuild.Horde", 0);
|
||||||
|
Guild* guild = sGuildMgr->GetGuildById(player->GetTeam() == ALLIANCE ? GUILD_ID_ALLIANCE : GUILD_ID_HORDE);
|
||||||
|
SQLTransaction trans(nullptr);
|
||||||
|
if (guild)
|
||||||
|
guild->AddMember(player->GetGUID());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void AddSC_mod_mxw_autoguild()
|
||||||
|
{
|
||||||
|
new mod_mxw_autoguild();
|
||||||
|
}
|
72
src/server/scripts/Custom/mod_mxw_levelup.cpp
Normal file
72
src/server/scripts/Custom/mod_mxw_levelup.cpp
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
//// MxWoW Official Module
|
||||||
|
//// Level Up
|
||||||
|
//// Dev: mikx
|
||||||
|
//// Git: https://mxgit.ovh/MxWoW/mod_mxwow_levelup
|
||||||
|
|
||||||
|
#include "Configuration/Config.h"
|
||||||
|
#include "ScriptMgr.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "Chat.h"
|
||||||
|
|
||||||
|
class mod_mxw_levelup : public PlayerScript
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
mod_mxw_levelup() : PlayerScript("mod_mxw_levelup") { }
|
||||||
|
|
||||||
|
void OnLogin(Player* player) override
|
||||||
|
{
|
||||||
|
ChatHandler(player->GetSession()).SendSysMessage("This server is running the |cff4CFF00MxW Level Up |rscript.");
|
||||||
|
}
|
||||||
|
|
||||||
|
void OnLevelChanged(Player * player, uint8 oldLevel)
|
||||||
|
{
|
||||||
|
Map* map = player->GetMap();
|
||||||
|
std::string mapName = map->GetMapName();
|
||||||
|
std::ostringstream ss;
|
||||||
|
if (sConfigMgr->GetBoolDefault("LevelUp.Enabled", true))
|
||||||
|
{
|
||||||
|
ss << "|cffabeeff[MxW] [" << GetPlayerColor(player) << player->GetName() << "|cffabeeff][|cff09ff00"<< mapName <<"|cffabeeff] est maintenant niveau |cff09ff00"<< oldLevel + 1 <<"|cffabeeff.";
|
||||||
|
sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetPlayerColor(const Player* p)
|
||||||
|
{
|
||||||
|
switch (p->getClass())
|
||||||
|
{
|
||||||
|
case CLASS_ROGUE:
|
||||||
|
return "|cffFFF468";
|
||||||
|
case CLASS_DEATH_KNIGHT:
|
||||||
|
return "|cffC41E3A";
|
||||||
|
case CLASS_WARRIOR:
|
||||||
|
return "|cffC69B6D";
|
||||||
|
case CLASS_PRIEST:
|
||||||
|
return "|cffFFFFFF";
|
||||||
|
case CLASS_MAGE:
|
||||||
|
return "|cff3FC7EB";
|
||||||
|
case CLASS_PALADIN:
|
||||||
|
return "|cffF48CBA";
|
||||||
|
case CLASS_HUNTER:
|
||||||
|
return "|cffAAD372";
|
||||||
|
case CLASS_DRUID:
|
||||||
|
return "|cffFF7C0A";
|
||||||
|
case CLASS_SHAMAN:
|
||||||
|
return "|cff0070DD";
|
||||||
|
case CLASS_WARLOCK:
|
||||||
|
return "|cff8788EE";
|
||||||
|
case CLASS_DEMON_HUNTER:
|
||||||
|
return "|cffA330C9";
|
||||||
|
case CLASS_MONK:
|
||||||
|
return "|cff00FF98";
|
||||||
|
default:
|
||||||
|
return "n/d";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
void AddSC_mod_mxw_levelup()
|
||||||
|
{
|
||||||
|
new mod_mxw_levelup();
|
||||||
|
}
|
@ -88,7 +88,7 @@ namespace {
|
|||||||
|
|
||||||
solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler")
|
solocraft_player_instance_handler() : PlayerScript("solocraft_player_instance_handler")
|
||||||
{
|
{
|
||||||
TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "[Solocraft] solocraft_player_instance_handler Loaded");
|
TC_LOG_INFO(LOG_FILTER_PLAYER, "[Solocraft] solocraft_player_instance_handler Loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnMapChanged(Player* player) override
|
void OnMapChanged(Player* player) override
|
||||||
@ -131,7 +131,7 @@ namespace {
|
|||||||
case 40:
|
case 40:
|
||||||
difficulty = D40; break;
|
difficulty = D40; break;
|
||||||
default:
|
default:
|
||||||
TC_LOG_WARN(LOG_FILTER_WORLDSERVER, "[SoloCraft] Unrecognized max players %d, defaulting to 10 man difficulty",
|
TC_LOG_WARN(LOG_FILTER_PLAYER, "[SoloCraft] Unrecognized max players %d, defaulting to 10 man difficulty",
|
||||||
map->GetMapDifficulty()->MaxPlayers);
|
map->GetMapDifficulty()->MaxPlayers);
|
||||||
difficulty = D10;
|
difficulty = D10;
|
||||||
}
|
}
|
||||||
|
@ -2993,6 +2993,15 @@ QuestPOI.DisableErrors = 1
|
|||||||
###################################################################################################
|
###################################################################################################
|
||||||
# CUSTOM SETTINGS #################################################################################
|
# CUSTOM SETTINGS #################################################################################
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
|
# Auto Guild #
|
||||||
|
#
|
||||||
|
|
||||||
|
AutoGuild.Alliance = 1
|
||||||
|
AutoGuild.Horde = 1
|
||||||
|
|
||||||
|
#
|
||||||
|
###################################################################################################
|
||||||
|
###################################################################################################
|
||||||
# Dynamic XP Rate #
|
# Dynamic XP Rate #
|
||||||
#
|
#
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user