Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "ScriptPCH.h"
- #include "GameObjectAI.h"
- class gob_tele : public GameObjectScript
- {
- public:
- gob_tele() : GameObjectScript("gob_tele") {}
- struct gob_teleAI : public GameObjectAI
- {
- gob_teleAI(GameObject* go) : GameObjectAI(go) {}
- void UpdateAI(uint32 diff)
- {
- Map::PlayerList const& players = go->GetMap()->GetPlayers();
- for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
- if (Player* player = itr->GetSource())
- if (player->GetDistance(go->GetPositionX(), go->GetPositionY(), go->GetPositionZ()) < 2.0f) // This distance might need to be changed
- player->TeleportTo(571, 0.0f, 0.0f, 0.0f, 0.0f); // Modify these coordinates
- }
- };
- GameObjectAI* GetAI(GameObject* go) const
- {
- return new gob_teleAI(go);
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement