Compare commits
15 commits
b9894eea11
...
fed4752e0c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fed4752e0c | ||
|
|
66f9e0a4f5 | ||
|
|
0c9c0c9bc8 | ||
|
|
ae5e5d3b28 | ||
|
|
4fe199845e | ||
|
|
0d233e2c33 | ||
|
|
d756b42db3 | ||
|
|
239bae9d5b | ||
|
|
6f7a3dbbeb | ||
|
|
b78a72d5ce | ||
|
|
eb72cb9a29 | ||
|
|
d133684206 | ||
|
|
0f8ee189b1 | ||
|
|
793fc6ade3 | ||
|
|
f444ef80ab |
1 changed files with 52 additions and 23 deletions
|
|
@ -64,9 +64,10 @@ config file for quick modifications.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "Configuration/Config.h"
|
#include "Configuration/Config.h"
|
||||||
#include "ScriptMgr.h"
|
|
||||||
#include "Player.h"
|
|
||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
|
#include "Player.h"
|
||||||
|
#include "ScriptMgr.h"
|
||||||
|
#include "WorldSessionMgr.h"
|
||||||
|
|
||||||
struct COL
|
struct COL
|
||||||
{
|
{
|
||||||
|
|
@ -117,25 +118,27 @@ class CongratsAnnounce : public PlayerScript
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CongratsAnnounce() : PlayerScript("CongratsAnnounce") {}
|
CongratsAnnounce() : PlayerScript("CongratsAnnounce", {
|
||||||
|
PLAYERHOOK_ON_LOGIN
|
||||||
|
}) {}
|
||||||
|
|
||||||
void OnLogin(Player* player)
|
void OnPlayerLogin(Player* player)
|
||||||
{
|
{
|
||||||
// Announce Module
|
// Announce Module
|
||||||
if (col.congratsAnnounce)
|
if (col.congratsAnnounce)
|
||||||
{
|
|
||||||
ChatHandler(player->GetSession()).SendSysMessage(col.acoreMessageId);
|
ChatHandler(player->GetSession()).SendSysMessage(col.acoreMessageId);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class CongratsOnLevel : public PlayerScript
|
class CongratsOnLevel : public PlayerScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CongratsOnLevel() : PlayerScript("CongratsOnLevel") { }
|
CongratsOnLevel() : PlayerScript("CongratsOnLevel", {
|
||||||
|
PLAYERHOOK_ON_LEVEL_CHANGED
|
||||||
|
}) { }
|
||||||
|
|
||||||
// Level Up Rewards
|
// Level Up Rewards
|
||||||
void OnLevelChanged(Player* player, uint8 oldLevel) override
|
void OnPlayerLevelChanged(Player* player, uint8 oldLevel) override
|
||||||
{
|
{
|
||||||
// If enabled...
|
// If enabled...
|
||||||
if (col.congratsEnable)
|
if (col.congratsEnable)
|
||||||
|
|
@ -178,22 +181,30 @@ public:
|
||||||
case LOCALE_koKR:
|
case LOCALE_koKR:
|
||||||
case LOCALE_frFR:
|
case LOCALE_frFR:
|
||||||
case LOCALE_deDE:
|
case LOCALE_deDE:
|
||||||
case LOCALE_zhCN:
|
|
||||||
case LOCALE_zhTW:
|
|
||||||
case LOCALE_ruRU:
|
case LOCALE_ruRU:
|
||||||
{
|
{
|
||||||
ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << std::to_string(player->GetLevel()) << "|cffFFFFFF!";
|
ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast<int>(player->GetLevel()) << "|cffFFFFFF!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOCALE_zhCN:
|
||||||
|
{
|
||||||
|
ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast<int>(player->GetLevel()) << " 级|cffFFFFFF!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOCALE_zhTW:
|
||||||
|
{
|
||||||
|
ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast<int>(player->GetLevel()) << " 級|cffFFFFFF!";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LOCALE_esES:
|
case LOCALE_esES:
|
||||||
case LOCALE_esMX:
|
case LOCALE_esMX:
|
||||||
{
|
{
|
||||||
ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << std::to_string(player->GetLevel()) << "|cffFFFFFF!";
|
ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << static_cast<int>(player->GetLevel()) << "|cffFFFFFF!";
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str());
|
sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always send message on reward level up
|
// Always send message on reward level up
|
||||||
|
|
@ -207,22 +218,30 @@ public:
|
||||||
case LOCALE_koKR:
|
case LOCALE_koKR:
|
||||||
case LOCALE_frFR:
|
case LOCALE_frFR:
|
||||||
case LOCALE_deDE:
|
case LOCALE_deDE:
|
||||||
case LOCALE_zhCN:
|
|
||||||
case LOCALE_zhTW:
|
|
||||||
case LOCALE_ruRU:
|
case LOCALE_ruRU:
|
||||||
{
|
{
|
||||||
ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << level << "|cffFFFFFF!";
|
ss << "|cffFFFFFF[ |cffFF0000C|cffFFA500O|cffFFFF00N|cff00FF00G|cff00FFFFR|cff6A5ACDA|cffFF00FFT|cff98FB98S|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFhas reached |cff4CFF00Level " << static_cast<int>(player->GetLevel()) << "|cffFFFFFF!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOCALE_zhCN: // 简体中文
|
||||||
|
{
|
||||||
|
ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF级|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已达到 |cff4CFF00" << static_cast<int>(player->GetLevel()) << " 级|cffFFFFFF!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOCALE_zhTW: // 繁体中文
|
||||||
|
{
|
||||||
|
ss << "|cffFFFFFF[ |cffFF0000恭|cffFFA500喜|cffFFFF00你|cff00FF00升|cff00FFFF級|cff6A5ACD啦|cffFF00FF! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFF已達到 |cff4CFF00" << static_cast<int>(player->GetLevel()) << " 級|cffFFFFFF!";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LOCALE_esES:
|
case LOCALE_esES:
|
||||||
case LOCALE_esMX:
|
case LOCALE_esMX:
|
||||||
{
|
{
|
||||||
ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << level << "|cffFFFFFF!";
|
ss << "|cffFFFFFF[ |cffFF0000F|cffFFA500E|cffFFFF00L|cff00FF00I|cff00FFFFC|cff6A5ACDI|cffFF00FFT|cff98FB98A|cff00FF00C|cff00FFFFI|cffFF0000O|cff00FF00N|cff00FFFFE|cffFF00FFS|cffFF0000! |cffFFFFFF] : |cff4CFF00 " << player->GetName() << " |cffFFFFFFha alcanzado |cff4CFF00el nivel " << static_cast<int>(player->GetLevel()) << "|cffFFFFFF!";
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sWorld->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str());
|
sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, ss.str().c_str());
|
||||||
|
|
||||||
// Issue a raid warning to the player
|
// Issue a raid warning to the player
|
||||||
std::ostringstream ss2;
|
std::ostringstream ss2;
|
||||||
|
|
@ -232,17 +251,25 @@ public:
|
||||||
case LOCALE_koKR:
|
case LOCALE_koKR:
|
||||||
case LOCALE_frFR:
|
case LOCALE_frFR:
|
||||||
case LOCALE_deDE:
|
case LOCALE_deDE:
|
||||||
case LOCALE_zhCN:
|
|
||||||
case LOCALE_zhTW:
|
|
||||||
case LOCALE_ruRU:
|
case LOCALE_ruRU:
|
||||||
{
|
{
|
||||||
ss2 << "Congrats on Level " << level << " " << player->GetName() << "! You've been awarded " << money << " gold and a few treasures!";
|
ss2 << "Congrats on Level " << static_cast<int>(player->GetLevel()) << " " << player->GetName() << "! You've been awarded " << money << " Copper and a few treasures!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOCALE_zhCN: // 简体中文
|
||||||
|
{
|
||||||
|
ss2 << "恭喜达到等级 " << static_cast<int>(player->GetLevel()) << "," << player->GetName() << "!您获得了 " << money << " 钱币和一些宝藏!";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case LOCALE_zhTW: // 繁体中文
|
||||||
|
{
|
||||||
|
ss2 << "恭喜達到等級 " << static_cast<int>(player->GetLevel()) << "," << player->GetName() << "!您獲得了 " << money << " 錢幣和一些寶藏!";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LOCALE_esES:
|
case LOCALE_esES:
|
||||||
case LOCALE_esMX:
|
case LOCALE_esMX:
|
||||||
{
|
{
|
||||||
ss2 << "¡Felicidades por el nivel " << level << " " << player->GetName() << " Se le ha concedido " << money << " oro y unos cuantos tesoros!";
|
ss2 << "¡Felicidades por el nivel " << static_cast<int>(player->GetLevel()) << " " << player->GetName() << " Se le ha concedido " << money << " cobre y unos cuantos tesoros!";
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
@ -257,7 +284,9 @@ public:
|
||||||
class ModCongratsLevelWorldScript : public WorldScript
|
class ModCongratsLevelWorldScript : public WorldScript
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ModCongratsLevelWorldScript() : WorldScript("ModCongratsLevelWorldScript") { }
|
ModCongratsLevelWorldScript() : WorldScript("ModCongratsLevelWorldScript", {
|
||||||
|
WORLDHOOK_ON_BEFORE_CONFIG_LOAD
|
||||||
|
}) { }
|
||||||
|
|
||||||
void OnBeforeConfigLoad(bool reload) override
|
void OnBeforeConfigLoad(bool reload) override
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue