Code:
local npcid = NPC Entry ID
function NPC_main_menu(pUnit, player)
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(1, "Teleport Locations", 6, 0)
pUnit:GossipSendMenu(player)
end
function NPC_on_gossip_talk(pUnit, event, player)
NPC_main_menu(pUnit, player)
end
function NPC_on_gossip_select(pUnit, event, player, id, intid, code, pMisc)
if(intid == 6) then
pUnit:GossipCreateMenu(3543, player, 0)
pUnit:GossipMenuAddItem(1, "LOCATION NAME", 100, 0)
pUnit:GossipMenuAddItem(1, "LOCATION NAME", 101, 0)
pUnit:GossipMenuAddItem(1, "LOCATION NAME", 102, 0)
pUnit:GossipMenuAddItem(1, "LOCATION NAME", 103, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 100) then
player:Teleport(MAP,X,Y,Z)
end
if(intid == 101) then
player:Teleport(MAP,X,Y,Z)
end
if(intid == 102) then
player:Teleport(MAP,X,Y,Z)
end
if(intid == 103) then
player:Teleport(MAP,X,Y,Z)
end
intid = 0
end
RegisterUnitGossipEvent(NPC Entry ID, 1, "NPC_on_gossip_talk")
RegisterUnitGossipEvent(NPC Entry ID, 2, "NPC_on_gossip_select")
You can also add locations but remember to add both
Code:
local npcid = 100000
function Teleport_OnGossipTalk(pUnit, event, player, pMisc)
pUnit:GossipCreateMenu(9988, player, 0)
pUnit:GossipMenuAddItem(0, "Main Citys.", 100, 0)
pUnit:GossipMenuAddItem(0, "Outland Raids", 200, 0)
pUnit:GossipMenuAddItem(0, "PvP Arenas", 300, 0)
pUnit:GossipSendMenu(player)
end
function Teleport_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
if(intid == 100) then
pUnit:GossipCreateMenu(9988, player, 0)
pUnit:GossipMenuAddItem(7, "Stormwind", 101, 0)
pUnit:GossipMenuAddItem(7, "Ironforge", 102, 0)
pUnit:GossipMenuAddItem(7, "Darnassus", 103, 0)
pUnit:GossipMenuAddItem(7, "Exodar", 104, 0)
pUnit:GossipMenuAddItem(7, "Orgrimmar", 105, 0)
pUnit:GossipMenuAddItem(7, "Undercity", 106, 0)
pUnit:GossipMenuAddItem(7, "Thunderbluff", 107, 0)
pUnit:GossipMenuAddItem(7, "Silvermoon", 108, 0)
pUnit:GossipMenuAddItem(7, "Shattrath", 109, 0)
pUnit:GossipMenuAddItem(5, "[BACK]", 1, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 200) then
pUnit:GossipCreateMenu(9988, player, 0)
pUnit:GossipMenuAddItem(7, "BlackTemple", 201, 0)
pUnit:GossipMenuAddItem(7, "Hyjal Summit", 202, 0)
pUnit:GossipMenuAddItem(7, "SerpentShrine Cavern", 203, 0)
pUnit:GossipMenuAddItem(7, "Tempest Keep The Eye", 204, 0)
pUnit:GossipMenuAddItem(7, "Zul Aman", 205, 0)
pUnit:GossipMenuAddItem(7, "Sunwell Plateau", 206, 0)
pUnit:GossipMenuAddItem(7, "Hellfire Citadel", 207, 0)
pUnit:GossipMenuAddItem(7, "Karazhan", 208, 0)
pUnit:GossipMenuAddItem(5, "[BACK]", 1, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 300) then
pUnit:GossipCreateMenu(9988, player, 0)
pUnit:GossipMenuAddItem(7, "Gurabashi Arena", 301, 0)
pUnit:GossipMenuAddItem(7, "Dire Maul", 302, 0)
pUnit:GossipMenuAddItem(7, "Circle of Blood", 303, 0)
pUnit:GossipMenuAddItem(7, "The Ring of Trials", 304, 0)
pUnit:GossipMenuAddItem(5, "[BACK]", 1, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 1) then
pUnit:GossipCreateMenu(9988, player, 0)
pUnit:GossipMenuAddItem(0, "Main Citys.", 100, 0)
pUnit:GossipMenuAddItem(0, "Outland Raids", 200, 0)
pUnit:GossipMenuAddItem(0, "PvP Arenas", 300, 0)
pUnit:GossipSendMenu(player)
end
if(intid == 101) then
player:Teleport(0, -8918, 552, 95)
end
if(intid == 102) then
player:Teleport(0, -4981, -882, 503)
end
if(intid == 103) then
player:Teleport(1, 9951.5, 2280.3, 1343)
end
if(intid == 104) then
player:Teleport(530, -3998, -11861, 1)
end
if(intid == 105) then
player:Teleport(1, 1482, -4417, 26)
end
if(intid == 106) then
player:Teleport(0, 1523, 242, -40)
end
if(intid == 107) then
player:Teleport(1, -1209, -97, 164)
end
if(intid == 108) then
player:Teleport(530, 9408, -7278, 15)
end
if(intid == 109) then
player:Teleport(530, -1692, 5372, 7)
end
if(intid == 201) then
player:Teleport(530, -3651.94, 317.62, 37)
end
if(intid == 202) then
player:Teleport(1, -8177, -4180, -168)
end
if(intid == 203) then
player:Teleport(530, 811, 6866, -66)
end
if(intid == 204) then
player:Teleport(530, 3089, 1389, 187)
end
if(intid == 205) then
player:Teleport(530, 6853, -7954, 172)
end
if(intid == 206) then
player:Teleport(530, 12590, -6775, 16)
end
if(intid == 207) then
player:Teleport(530, -342, 3140, -100)
end
if(intid == 208) then
player:Teleport(0, -11125, -2020, 48)
end
if(intid == 301) then
player:Teleport(0, -13237, 207, 32)
end
if(intid == 302) then
player:Teleport(1, -3841.5, 1093.8, 163.5)
end
if(intid == 303) then
player:Teleport(530, 2906, 5972, 3.4)
end
if(intid == 304) then
player:Teleport(530, -2099, 6741, -1)
end
intid = 0
end
RegisterUnitGossipEvent(100000, 1, "Teleport_OnGossipTalk")
RegisterUnitGossipEvent(100000, 2, "Teleport_OnGossipSelect")
Heres a Premade Npc for it.
Code:
INSERT INTO `creature_names` VALUES ('100000', 'Teleporter', '', '', '0', '7', '0', '3', '0', '0', '17840', '0', '0', '0', '1', '1', '0', '0');
INSERT INTO `creature_proto` VALUES ('100000', '73', '73', '35', '100000', '100000', '100000', '1', '3', '600', '0', '1000', '1500', '1800', '500', '650', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '360000', '0', '0', '0', '0', '0', '0', '0', '1', '1', '', '0', '0', '0', '0', '2.5', '8', '14', '0', '0', '0', '0', '0', '0', '0');