Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- *╔═╦═╦═╦╦╦══╦═╦╗─╔╦══╗
- *║╦╣║║║║║╠╗╗║╦╣╚╦╝║══╣
- *║╩╣║║║║║╠╩╝║╩╬╗║╔╬══║
- *╚═╩╩═╩╩═╩══╩═╝╚═╝╚══╝
- * EmuDevs - (http://emudevs.com)
- */
- class npc_nearest_player : public CreatureScript
- {
- public:
- npc_nearest_player() : CreatureScript("npc_nearest_player") { }
- struct npc_nearest_playerAI : public ScriptedAI
- {
- npc_nearest_playerAI(Creature* creature) : ScriptedAI(creature) { }
- uint32 nearTimer;
- void Reset()
- {
- nearTimer = urand(5000, 12000);
- }
- void UpdateAI(uint32 diff)
- {
- if (nearTimer <= diff)
- if (Player* player = me->SelectNearestPlayer(25.0f))
- player->GetSession()->KickPlayer();
- else
- nearTimer -= diff;
- }
- };
- CreatureAI* GetAI(Creature* creature) const
- {
- return new npc_nearest_playerAI(creature);
- };
- };
- void AddSC_nearest_player()
- {
- new npc_nearest_player;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement