-
-
Save coolzoom/e9d56052940dedd54f326bfb4311347c to your computer and use it in GitHub Desktop.
Skeleton-example NPC script for the latest TrinityCore 3.3.5 (11-March-2019)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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