Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- EmuDevs NPC Tutorial
- http://emudevs.com
- TrinityCore Tutorial
- */
- class npc_tutorial : public CreatureScript
- {
- public:
- npc_tutorial() : CreatureScript("npc_tutorial") { }
- struct npc_tutorialAI : public ScriptedAI
- {
- npc_tutorialAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 tickTimer;
- void Reset()
- {
- tickTimer = 1000;
- }
- void UpdateAI(uint32 diff)
- {
- if (tickTimer <= diff)
- {
- if (Player* player = me->SelectNearestPlayer(10.0f))
- {
- if (player->HasAtLoginFlag(AT_LOGIN_FIRST))
- player->learnSpell(30000, true);
- }
- }
- else
- tickTimer -= diff;
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_tutorialAI(creature);
- }
- };
- void AddSC_Tutorial()
- {
- new npc_tutorial;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement