Advertisement
Rochet2

Random teleporter

Nov 25th, 2012
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local function NatoSwiftmend (pUnit, event, player)
  2.     -- The combat check could be before teleporting instead. This way you could use the NPC, but not teleport.
  3.     -- Atm you can co to the NPC and if you get attacked you can still teleport.
  4.     if (player:IsInCombat()) then
  5.         player:SendAreaTriggerMessage("You cannot access Nato Swiftmend while you're in combat!")
  6.         return
  7.     end
  8.     pUnit:GossipCreateMenu(50, player, 0)
  9.     local race=player:GetPlayerRace()
  10.     if race==2 or race==5 or race==6 or race==8 or race==10 then
  11.         pUnit:GossipMenuAddItem(3, "Mall", 1, 0)
  12.         pUnit:GossipMenuAddItem(9, "Cross Faction Battle", 2, 0)
  13.         pUnit:GossipMenuAddItem(10, "Solo Content", 3, 0)
  14.         pUnit:GossipMenuAddItem(5, "Nevermind", 0, 0)
  15.     else
  16.         pUnit:GossipMenuAddItem(3, "Mall", 1, 0)
  17.         pUnit:GossipMenuAddItem(9, "Cross Faction Battle", 4, 0)
  18.         pUnit:GossipMenuAddItem(10, "Solo Content", 3, 0)
  19.         pUnit:GossipMenuAddItem(5, "Nevermind", 0, 0)
  20.     end
  21.     pUnit:GossipSendMenu(player)
  22. end
  23.  
  24. local function NatoSwiftmend2(pUnit, event, player, id, intid, code)
  25.     if(intid == 1) then
  26.         player:Teleport(1, -10710.852539, 2482.370850, 7.922390)
  27.     elseif(intid == 2) then
  28.         player:Teleport(0, 1804.678345, 186.426788, 70.398277)
  29.     elseif(intid == 3) then
  30.         player:Teleport(0, 0, 0, 0) -- Unfinished
  31.     elseif(intid == 4) then
  32.         player:Teleport(0, 1805.745361, 291.897797, 70.3992628)
  33.     end
  34.     player:GossipComplete()
  35. end
  36.  
  37. -- Dont use quotes in registers
  38. RegisterUnitGossipEvent(80000, 1, NatoSwiftmend)
  39. RegisterUnitGossipEvent(80000, 2, NatoSwiftmend2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement