stoneharry

Untitled

Mar 29th, 2011
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.49 KB | None | 0 0
  1. -- Valnyr-Gaming Teleporter.
  2. -- Credits by RakorZ - ZxOxZ.
  3.  
  4. ValnyrTeleporter = {}
  5.  
  6. function ValnyrTeleporter.OnTeleporterTalk(pUnit, event, player)
  7.     if (player:IsInCombat() == true) then
  8.         player:SendAreaTriggerMessage("|CFFFF0000You cannot use the Teleporter while you are in combat!|R")
  9.         player:GossipComplete()
  10.     else
  11.         pUnit:GossipCreateMenu(1, player, 0)
  12.         if player:GetPhase() == 2 then
  13.             pUnit:GossipMenuAddItem(3, "|CFF00008BValnyr-Gaming - Mall.|R", 8, 0)
  14.         else
  15.             pUnit:GossipMenuAddItem(3, "|CFF00008BValnyr-Gaming - Mall.|R", 10, 0)
  16.             pUnit:GossipMenuAddItem(9, "|CFF00008BValnyr-Gaming PvP Zones.|R", 30, 0)
  17.             pUnit:GossipMenuAddItem(9, "|CFF00008BValnyr-Gaming Dueling Zone.|R", 50, 0)
  18.             pUnit:GossipMenuAddItem(5, "|CFF00008BValnyr-Gaming Obstacle Courses.|R", 20, 0)
  19.             pUnit:GossipMenuAddItem(9, "|CFF00008BValnyr-Gaming World Bosses.|R", 450, 0)
  20.             if (player:GetPlayerClass() == "Hunter") then
  21.                 pUnit:GossipMenuAddItem(8, "|CFF00008FValnyr-Gaming Hunter Pets Zone.|R", 90, 0)
  22.             end
  23.             pUnit:GossipMenuAddItem(5, "|CFF800000Remove my Ressurection Sickness.|R", 80, 0)
  24.             pUnit:GossipMenuAddItem(5, "|CFF800000Valnyr-Gaming - Player Tools.|R", 15, 0)
  25.             pUnit:GossipMenuAddItem(5, "Close the Teleporter Window.", 100, 0)
  26.         end
  27.         pUnit:GossipSendMenu(player)
  28.     end
  29. end
  30.  
  31. function ValnyrTeleporter.OnTeleporterSelect(pUnit, event, player, id, intid, code)
  32.  
  33.     if (intid == 8) then
  34.         player:SetPhase(1)
  35.         player:Teleport(631, 4493.549805, 2769.330078, 351.101990, 6.280330)
  36.         player:GossipComplete()
  37.     end
  38.     -- Hunter Pets Zone.
  39.    
  40.     if (intid == 90) then
  41.         player:Teleport(571, 6224.148438, 5757.467773, -6.235819)
  42.         player:SetFacing(0.7)
  43.         player:GossipComplete()
  44.     end
  45.  
  46.     -- Dueling Zone.
  47.  
  48.     if (intid == 50) then
  49.         player:Teleport(571, 7867.817383, 3405.942383, 654.370239)
  50.         player:SetFacing(4.277964)
  51.         player:GossipComplete()
  52.     end
  53.  
  54.     -- Main Menu.
  55.    
  56.     if (player:IsInCombat() == true) then
  57.         player:SendAreaTriggerMessage("|CFFFF0000You cannot use the Teleporter while you are in combat!|R")
  58.         player:GossipComplete()
  59.     else
  60.         pUnit:GossipCreateMenu(1, player, 0)
  61.         pUnit:GossipMenuAddItem(3, "|CFF00008BValnyr-Gaming - Mall.|R", 10, 0)
  62.         pUnit:GossipMenuAddItem(9, "|CFF00008BValnyr-Gaming PvP Zones.|R", 30, 0)
  63.         pUnit:GossipMenuAddItem(9, "|CFF00008BValnyr-Gaming Dueling Zone.|R", 50, 0)
  64.         pUnit:GossipMenuAddItem(5, "|CFF00008BValnyr-Gaming Obstacle Courses.|R", 20, 0)
  65.         pUnit:GossipMenuAddItem(9, "|CFF00008BValnyr-Gaming World Bosses.|R", 450, 0)
  66.         if (player:GetPlayerClass() == "Hunter") then
  67.             pUnit:GossipMenuAddItem(8, "|CFF00008FValnyr-Gaming Hunter Pets Zone.|R", 90, 0)
  68.         end
  69.         pUnit:GossipMenuAddItem(5, "|CFF800000Remove my Ressurection Sickness.|R", 80, 0)
  70.         pUnit:GossipMenuAddItem(5, "|CFF800000Valnyr-Gaming - Player Tools.|R", 15, 0)
  71.         pUnit:GossipMenuAddItem(5, "Close the Teleporter Window.", 100, 0)
  72.         pUnit:GossipSendMenu(player)
  73.     end
  74.  
  75.     -- Valnyr-Gaming Mall.
  76.  
  77.     if (intid == 10) then
  78.         player:Teleport(631, 4493.549805, 2769.330078, 351.101990, 6.280330)
  79.         player:GossipComplete()
  80.     end
  81.    
  82.     -- Valnyr-Gaming Player Tools.
  83.    
  84.     if (intid == 15) then
  85.         pUnit:GossipCreateMenu(1, player, 0)
  86.         pUnit:GossipMenuAddItem(5, "|CFF00008BMake this place my home.|R", 16, 0)
  87.         pUnit:GossipMenuAddItem(5, "|CFF00008BReset my Talent Points.|R", 17, 0)
  88.         pUnit:GossipMenuAddItem(5, "|CFF00008BRepair all my items.|R", 19, 0)
  89.         pUnit:GossipMenuAddItem(5, "Back to Main Menu.", 150, 0)
  90.         pUnit:GossipSendMenu(player)
  91.     end
  92.    
  93.     -- Valnyr-Gaming Obstacle Courses.
  94.    
  95.     if (intid == 20) then
  96.         pUnit:GossipCreateMenu(1, player, 0)
  97.         pUnit:GossipMenuAddItem(5, "|CFF00008BSouthbreak Shore - Tanaris -  (|CFF9400D3Very Easy|R)|R.", 21, 0)
  98.         pUnit:GossipMenuAddItem(5, "|CFF00008BLand's End Beach - Tanaris - (|CFF9400D3Easy|R)|R.", 22, 0)
  99.         pUnit:GossipMenuAddItem(5, "|CFF00008BDreadmurk Shore - Marsh - (|CFF4B0082Medium|R)|R.", 23, 0)
  100.         pUnit:GossipMenuAddItem(5, "|CFF00008BTower of Eldara - Azshara - (|CFF4B0082Medium|R)|R.", 24, 0)
  101.         pUnit:GossipMenuAddItem(5, "|CFF00008BThe North Sea - Eversong Woods - (|CFFFF0000Hard|R)|R.", 25, 0)
  102.         pUnit:GossipMenuAddItem(5, "Back to Main Menu.", 150, 0)
  103.         pUnit:GossipSendMenu(player)
  104.     end
  105.  
  106.     -- Valnyr-Gaming PvP Zones.
  107.    
  108.     if (intid == 30) then
  109.         pUnit:GossipCreateMenu(1, player, 0)
  110.         pUnit:GossipMenuAddItem(9, "|CFF00008BGurubashi Arena.", 31, 0)
  111.         pUnit:GossipMenuAddItem(5, "Back to Main Menu.", 150, 0)
  112.         pUnit:GossipSendMenu(player)
  113.     end
  114.    
  115.     -- Gurubashi Arena,
  116.    
  117.     if (intid == 31) then
  118.         player:Teleport(0, -13247.606445, 190.499863, 31.046532)
  119.         player:SetFacing(1.09)
  120.         player:GossipComplete()
  121.     end
  122.    
  123.     -- First Obstacle Course.
  124.    
  125.     if (intid == 21) then
  126.         player:Teleport(1, -8825.584961, -4763.866211, 2.060145)
  127.         player:SetFacing(0.77)
  128.         player:GossipComplete()
  129.     end
  130.    
  131.     -- Second Obstacle Course.
  132.    
  133.     if (intid == 22) then
  134.         player:Teleport(1, -9867.587891, -3547.404297, 0.757514)
  135.         player:SetFacing(3.18)
  136.         player:GossipComplete()
  137.     end
  138.    
  139.     -- Third Obstacle Course.
  140.    
  141.     if (intid == 23) then
  142.         player:Teleport(1, -3173.639404, -4227.227051, 0.380090)
  143.         player:SetFacing(0.31)
  144.         player:GossipComplete()
  145.     end
  146.    
  147.     -- Fourth Obstacle Course.
  148.    
  149.     if (intid == 24) then
  150.         player:Teleport(1, 4215.317383, -7822.778320, 10.097189)
  151.         player:SetFacing(0.55)
  152.         player:GossipComplete()
  153.     end
  154.    
  155.     -- Fifth Obstacle Course.
  156.    
  157.     if (intid == 25) then
  158.         player:Teleport(530, 10399.297852, -7188.446289, 1.022378)
  159.         player:SetFacing(1.00)
  160.         player:GossipComplete()
  161.     end
  162.    
  163.     -- Close the Teleporter Window.
  164.    
  165.     if (intid == 100) then
  166.         player:GossipComplete()
  167.         player:Emote(3, 1800)
  168.     end
  169.    
  170.     -- Innkeeper Option.
  171.    
  172.     if (intid == 16) then
  173.         player:SetBindPoint(player:GetX(), player:GetY(), player:GetZ(), player:GetMapId(), player:GetZoneId())
  174.         player:CastSpell(31517)
  175.         pUnit:SendChatMessageToPlayer(15, 0, "This is your new home. You can use your \124cffffffff\124Hitem:6948:0:0:0:0:0:0:0:0\124h[Hearthstone]\124h\124r to teleport here.", player)
  176.         player:GossipComplete()
  177.     end
  178.    
  179.     -- Reset Talents.
  180.    
  181.     if (intid == 17) then
  182.             if (player:GetTalentPoints(0) == 10) then
  183.                 pUnit:SendChatMessageToPlayer(15, 0, "You have no talent points spended, "..player:GetName().."!", player)
  184.                 player:GossipComplete()
  185.             else
  186.                 player:ResetTalents()
  187.                 player:CastSpell(14867) -- Untalent visual.
  188.                 pUnit:SendChatMessageToPlayer(15, 0, "Your Talent Points has been reseted, "..player:GetName().."!", player)
  189.                 player:DealGoldCost(5000)
  190.                 player:GossipComplete()
  191.             end
  192.     end
  193.    
  194.     -- Remove Ressurection Sickness.
  195.    
  196.     if (intid == 80) then
  197.         if (player:HasAura(15007) == true) then
  198.             player:RemoveAura(15007)
  199.             pUnit:SendChatMessageToPlayer(15, 0, "Your \124cff71d5ff\124Hspell:15007\124h[Resurrection Sickness]\124h\124r debuff has been removed.", player)
  200.             player:CastSpell(528)
  201.             player:GossipComplete()
  202.         else
  203.             pUnit:SendChatMessageToPlayer(15, 0, "You do not have \124cff71d5ff\124Hspell:15007\124h[Resurrection Sickness]\124h\124r debuff.", player)
  204.             player:GossipComplete()
  205.         end
  206.     end
  207.    
  208.     -- Repair All Items.
  209.    
  210.     if (intid == 19) then
  211.         player:RepairAllPlayerItems()
  212.         pUnit:SendChatMessageToPlayer(15, 0, "All your items has been repaired!", player)
  213.         player:Emote(23, 1800)
  214.         player:GossipComplete()
  215.     end
  216.    
  217.    
  218.     -- World Bosses.
  219.    
  220.     if (intid == 450) then
  221.         pUnit:GossipCreateMenu(1, player, 0)
  222.         pUnit:GossipMenuAddItem(5, "|CFF00008BScourgelord Nyrgonnus.|R", 451, 0)
  223.         pUnit:GossipMenuAddItem(5, "|CFF00008BLord Zechoron.|R", 452, 0)
  224.         pUnit:GossipMenuAddItem(5, "|CFF00008BGeneral Moulgar.|R", 453, 0)
  225.         pUnit:GossipMenuAddItem(5, "|CFF00008BArchmage Arugal.|R", 454, 0)
  226.         pUnit:GossipMenuAddItem(5, "Back to Main Menu.", 150, 0)
  227.         pUnit:GossipSendMenu(player)
  228.     end
  229.    
  230.     -- Scourgelord Nyrgonnus.
  231.    
  232.     if (intid == 451) then
  233.         player:Teleport(571, 7495.018066, 4847.215332, 54.158279)
  234.         player:SetFacing(3.17)
  235.         player:GossipComplete()
  236.     end
  237.    
  238.     -- General Moulgar.
  239.    
  240.     if (intid == 453) then
  241.         player:Teleport(632, 5633.590332, 2471.320801, 708.696045)
  242.         player:SetFacing(0.914771)
  243.         player:GossipComplete()
  244.     end
  245.    
  246.     -- Lord Zechoron.
  247.    
  248.     if (intid == 452) then
  249.         player:Teleport(571, 8515.150391, 823.0222278, 558.149170)
  250.         player:SetFacing(4.707060)
  251.         player:GossipComplete()
  252.     end
  253.    
  254.     if (intid == 454) then
  255.         player:Teleport(631, 4494, 2769, 404)
  256.         player:SetFacing(6.28)
  257.         player:SetPhase(2)
  258.         player:GossipComplete()
  259.     end
  260.    
  261. end
  262.  
  263. RegisterUnitGossipEvent(80000, 1, "ValnyrTeleporter.OnTeleporterTalk")
  264. RegisterUnitGossipEvent(80000, 2, "ValnyrTeleporter.OnTeleporterSelect")
Advertisement
Add Comment
Please, Sign In to add comment