mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Initial commit - mod-playerbots
This commit is contained in:
15
src/MP_loader.cpp
Normal file
15
src/MP_loader.cpp
Normal 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
29
src/MyPlayer.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user