Initial commit - mod-playerbots

This commit is contained in:
UltraNix
2021-12-30 17:13:09 +01:00
commit b3d00ccb26
28 changed files with 571 additions and 0 deletions

15
src/MP_loader.cpp Normal file
View File

@@ -0,0 +1,15 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
*/
// From SC
void AddMyPlayerScripts();
// Add all
// cf. the naming convention https://github.com/azerothcore/azerothcore-wotlk/blob/master/doc/changelog/master.md#how-to-upgrade-4
// additionally replace all '-' in the module folder name with '_' here
void Addskeleton_moduleScripts()
{
AddMyPlayerScripts();
}

29
src/MyPlayer.cpp Normal file
View File

@@ -0,0 +1,29 @@
/*
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
*/
#include "ScriptMgr.h"
#include "Player.h"
#include "Config.h"
#include "Chat.h"
// Add player scripts
class MyPlayer : public PlayerScript
{
public:
MyPlayer() : PlayerScript("MyPlayer") { }
void OnLogin(Player* player) override
{
if (sConfigMgr->GetOption<bool>("MyModule.Enable", false))
{
ChatHandler(player->GetSession()).SendSysMessage("Hello World from Skeleton-Module!");
}
}
};
// Add all scripts in one
void AddMyPlayerScripts()
{
new MyPlayer();
}