Azteco

TelePlayerLevel(For Aliance/Horde)

Mar 28th, 2013
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include "ScriptMgr.h"
  2.  
  3. class custom_TelePlayerOnLevel : public PlayerScript
  4. {
  5. public:
  6. custom_TelePlayerOnLevel() : PlayerScript("custom_TelePlayerOnLevel") { }
  7.  
  8. void OnLevelChanged(Player* player, uint8 newLevel)
  9. {
  10. // Change 255 To the level u want to get them teleported to location.
  11. if(newLevel == 254)
  12. {
  13. if
  14. if (player->isInFlight())
  15. {
  16. player->GetMotionMaster()->MovementExpired();
  17. player->CleanupAfterTaxiFlight();
  18. }
  19. // (mapid, X, Y, Z, O)
  20. if (player->TeamForRace(ALLIANCE)
  21. {
  22. player->TeleportTo(M, Y, Y, Z, O);
  23. }
  24. if (player->TeamForRace(HORDE)
  25. {
  26. player->TeleportTo(M, Y, Y, Z, O);
  27. }
  28. }
  29. }
  30. };
  31.  
  32. void AddSC_custom_TelePlayerOnLevel()
  33. {
  34. new custom_TelePlayerOnLevel();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment