Skip to content

Instantly share code, notes, and snippets.

@mindsear
Last active March 20, 2019 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mindsear/e9b8b12041f2cbe51dd8a6a3538f42ea to your computer and use it in GitHub Desktop.
Save mindsear/e9b8b12041f2cbe51dd8a6a3538f42ea to your computer and use it in GitHub Desktop.
Skeleton-example NPC script for the latest TrinityCore 3.3.5 (11-March-2019)
#include "ScriptMgr.h"
#include "World.h"
#include "Player.h"
#include "Chat.h"
#include "WorldSession.h"
#include "ScriptedGossip.h"
#include "ScriptedCreature.h"
#include "CreatureAI.h"
class npc_script_example : public CreatureScript
{
public:
npc_script_example() : CreatureScript("npc_script_example") { }
struct npc_script_exampleAI : public ScriptedAI
{
npc_script_exampleAI(Creature* creature) : ScriptedAI(creature) { }
bool GossipHello(Player* player) override
{
//DO STUFF
}
bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
{
uint32 const sender = player->PlayerTalkClass->GetGossipOptionSender(gossipListId);
uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
//DO STUFF
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_script_exampleAI(creature);
}
};
void AddSC_npc_script_example()
{
new npc_script_example();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment