All pastes #388201 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-09 22:08 UTC
rendered paste body
-- Create the Mango Script Base object
My_Teleporter = Mango.Scripts.Create('my_teleporter');
My_Teleporter:ForceLUA(); -- Don't use the CPP version if valid

-- Function prototypes (to keep it clean)
local My_Teleporter_GossipHello
local My_Teleporter_GossipSelect

-- The actual functions
-- Send the first menu (with the selections)
function My_Teleporter_GossipHello(player,_Creature)

   player:ADD_GOSSIP_ITEM( 5, "Travel to Ironforge"      , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Goldshire"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2)
   player:ADD_GOSSIP_ITEM( 5, "Travel to BootyBay"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Menthil Harbor"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Auberdine"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Theramore Isle"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Rut'theran Village"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Feathermoon Stronghold"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Feralas Coast"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Ratchet"      , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Undercity"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Grom'Gol Basecamp"       , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12)
   player:ADD_GOSSIP_ITEM( 5, "Travel to Durotar"      , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13)
   player:ADD_GOSSIP_ITEM( 5, "Travel Mob Spawning Ground"      , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14)
   player:SEND_GOSSIP_MENU(1  ,_Creature:GetGUID()); -- Says " Greetings <Playername>

return RETURN_OK
end

-- Called when you chose an option
function My_Teleporter_GossipSelect(player, _Creature, sender, action)
   --Serving guard_stormwind/main menu
   if sender == GOSSIP_SENDER_MAIN then
   
         if action == GOSSIP_ACTION_INFO_DEF + 1 then
         -- teleport player to Ironforge
         player:TeleportTo(0, -4919.979980 , -957.887024 , 501.503998 , 0, false, true );
         elseif action == GOSSIP_ACTION_INFO_DEF + 2 then
         -- teleport player to Goldshire
         player:TeleportTo(0, -9443.450195 , 59.894402  , 56.070400 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 3 then
         -- teleport player to BootyBay
         player:TeleportTo(0, -14289.0 , 556.6  , 8.9 , 0, false, true );
         elseif action == GOSSIP_ACTION_INFO_DEF + 4 then
         -- teleport player to Menthil Harbor
         player:TeleportTo(0, -3779.526611 , -734.663025  , 8.090954 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 5 then
         -- teleport player to Auberdine
         player:TeleportTo(1, 6439.279785 , 614.956970  , 10.469187 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 6 then
         -- teleport player to Theramore Isle
         player:TeleportTo(1, -3994.240967 , -4722.521484  , 4.718028 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 7 then
         -- teleport player to Rut'theran Village
         player:TeleportTo(1, 8549.147461 , 1020.227905  , 5.824060 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 8 then
         -- teleport player to Feathermoon Stronghold
         player:TeleportTo(1, -4214.979492 , 3285.962158  , 6.361742 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 9 then
         -- teleport player to Feralas Coast
         player:TeleportTo(1, -4346.529297 , 2429.156494  , 6.317777 , 0, false, true );
         elseif action == GOSSIP_ACTION_INFO_DEF + 10 then
         -- teleport player to Ratchet
         player:TeleportTo(1, -997.727234 , -3823.210205 , 5.358360 , 0, false, true );
         elseif action == GOSSIP_ACTION_INFO_DEF + 11 then
         -- teleport player to Undercity
         player:TeleportTo(0, 2058.840088 , 253.284988  , 99.760002 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 12 then
         -- teleport player to Grom'Gol Basecamp
         player:TeleportTo(0, -12441.599609 , 215.000000  , 31.200001 , 0, false, true );
         elseif action == GOSSIP_ACTION_INFO_DEF + 13 then
         -- teleport player to Durotar
         player:TeleportTo(1, 1338.453491 , -4663.950195 , 54.048733 , 0, false, true );
	 elseif action == GOSSIP_ACTION_INFO_DEF + 14 then
         -- teleport Mob Spawning Grounds
         player:TeleportTo(451, 16957.70 , 15812.03 , 84.808733 , 0, false, true );
 	 end
   end
return RETURN_OK
end

-- Assign the functions
My_Teleporter.GossipHello = My_Teleporter_GossipHello;
My_Teleporter.GossipSelect= My_Teleporter_GossipSelect;

-- Activate (run) the script
My_Teleporter:Activate();