Hey I'm Asbonia from Executer WoW Developing Staff.
I'm here to show you guys how to make a Teleporter NPC w/ different menu's for Alliance and Horde.
First lets start off with NPC id and the first function
(Color Red = Must be changed)
Now we got the NPC id in place and the first function.local npcid = NPC-ID
function TeleNPC_OnGossipTalk(unit, event, player)
Now we will find the race ID's to Alliance..
Now we have found the race ids: 1, 3, 4, 7 and 11. Thats the Alliance's ones.local race=player:GetPlayerRace()
if race==1 or race==3 or race==4 or race==7 or race==11 then
Now lets make the alliance first menu:
the "Menu Name" you can switch to the name you want the menu to be named.unit:GossipCreateMenu(3544, player, 0)
unit:GossipMenuAddItem(2, "Menu Name", Menu ID, 0)
unit:GossipSendMenu(player)
Then "Menu ID" is important! Do not set the same ID twice!
Now lets create a menu for the Horde:
Change the same things you changed upside this.else
unit:GossipCreateMenu(3544, player, 0)
unit:GossipMenuAddItem(2, "Menu Name", MenuID, 0)
unit:GossipSendMenu(player)
end
end
Now lets fix the sub-menues for Ally and Horde Menu.. (Only use the different menuid)
Now you put in the Menu id in: if(intid == AllyMenuID) thenfunction TeleNPC_OnGossipSelect(unit, event, player, id, intid, code)
if(intid == MenuID for ALLY) then
unit:GossipCreateMenu(3543, player, 0)
unit:GossipMenuAddItem(1, "Stormwind", SubMenuID, 0)
unit:GossipSendMenu(player)
end
And then you change the Sub Menu ID (This is the important ID!) This ID will be used when we add the teleports.
Now a horde SuB Menu:
The sub menu id's for Ally and Horde can't be the same! Then the hole script ****s upif(intid == HordeMenuID) then
unit:GossipCreateMenu(3543, player, 0)
unit:GossipMenuAddItem(1, "Orgrimmar", SubMenuID, 0)
unit:GossipSendMenu(player)
end
Now to the teleports
Now we finish up with registration the functions:if(intid == StormwindMenuID) then
player:Teleport(0, -8913.230469, 554.632996, 93.794830)
unit:GossipComplete(player)
end
if(intid == OrgrimmarMenuID) then
player:Teleport(1, 1505.377319, -4414.602539, 20.598469)
unit:GossipComplete(player)
end
Credits:RegisterUnitGossipEvent(npcid, 1, "TeleNPC_OnGossipTalk")
RegisterUnitGossipEvent(npcid, 2, "TeleNPC_OnGossipSelect")
Asbonia(Me) For the script
DaWarrior99 For helping setting it up
Have any questions? Just ask