THIS IS LUA SCRIPTINGhey guys and welcome to my guide, i will be explaining you how to make a teleporter.
All the coloured have to be modified by you , and i will explain how
but when your making teleporters make sure you dont use INTID more than once, that would mess up your script.FunctionOpen a Lua Notepad and paste this into it :
when you are making menu's put this infront of them this is the first thing in your script:
- Quote :
function NAME_OnGossipTalk(pUnit, event, player, pMisc)
When you start doing Location Places or submenu's than you need put this infront of it before doing the Location places:
- Quote :
function NAME_OnGossipSelect(pUnit, event, player, id, intid, code, pMisc)
Teleport Menu'swould look like this:
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
to make more than 1 menu you just add more so :
pUnit:GossipMenuAddItem(3, "
Location LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
Location LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
Location LIST NAME",
INTID, 0)
INTID is the ID that tells the script where you want it for example:
if i would put INTID 1 i would make a submenu like this:
Submenuif(intid == 1) then
pUnit:GossipCreateMenu(99, player, 0)
pUnit:GossipMenuAddItem(1, "
LOCATION NAME HERE",
INTID, 0)
pUnit:GossipMenuAddItem(1, "
LOCATION NAME HERE",
INTID, 0)
pUnit:GossipMenuAddItem(1, "
LOCATION NAME HERE",
INTID, 0)
pUnit:GossipMenuAddItem(1, "
LOCATION NAME HERE",
INTID, 0)
pUnit:GossipSendMenu(player)
end
Now we have made a submenu we have to make the teleporting location
that would be made like this:
if(intid ==
INTID HERE) then --
You can put location name here to remind uplayer:Teleport(
MAPID, X, Y, Z)
pUnit:GossipComplete(player)
end
if(intid ==
INTID HERE) then --
You can put location name here to remind uplayer:Teleport(
MAPID, X, Y, Z)
pUnit:GossipComplete(player)
end
if(intid ==
INTID HERE) then --
You can put location name here to remind uplayer:Teleport(
MAPID, X, Y, Z)
pUnit:GossipComplete(player)
end
if(intid ==
INTID HERE) then --
You can put location name here to remind uplayer:Teleport(
MAPID, X, Y, Z)
pUnit:GossipComplete(player)
end
MAPID, X, Y, Z can be found by going in-game and doing .gps on the location you want.
or you could go to recall table in your database and find the location in there.
Here is a completed Teleport Location, it should look like this:
if(intid == 5580) then --Stormwind
player:Teleport(0, -8913.23, 554.633, 94.7944)
pUnit:GossipComplete(player)
end
this is a complete stormwind location.
you can also make multiple menu's that would look like this :
Menu without Submenu
if you want to make a menu without submenu you would do like this:
E.G. pUnit:GossipMenuAddItem(3, "
NAME",
INTID, 0)
you do exactly the same, only this time you do no sub-menu
so :
here is completed 1:
pUnit:GossipMenuAddItem(3, "Mall", 5572, 0)
if(intid == 5572) then --Mall
player:Teleport(1, -2659.93, -5017.63, 21.9876)
pUnit:GossipComplete(player)
end
Menu with Spellsnow il show you how to make a spell menu
first you will make a same menu as before:
i will use a resurrection sickness 1:
pUnit:GossipMenuAddItem(3, "
Resurrection Sickness",
INTID, 0)
after you have done this you have to make a script with INTID, for resurrection sickness it would look like this:
Uncompleted:
if (intid ==
INTID) then
player:LearnSpell(
SPELLID) -- Remove Resurrection Sickness
player:UnlearnSpell(
SPELLID)
pUnit:GossipComplete(player)
end
Completed:
pUnit:GossipMenuAddItem(3, "Resurrection Sickness", 9696, 0)
if (intid == 9696) then
player:LearnSpell(15007) -- Remove Resurrection Sickness
player:UnlearnSpell(15007)
pUnit:GossipComplete(player)
end
to make a menu that only learns spell that would look like this:
pUnit:GossipMenuAddItem(3, "SPELLS", INTID, 0)
You can make multiple Spell actions in 1 INTID like this:
if(intid ==
INTID) then
player:LearnSpell(
SPELLID, player)
player:LearnSpell(
SPELLID, player)
player:LearnSpell(
SPELLID, player)
player:LearnSpell(
SPELLID, player)
player:LearnSpell(
SPELLID, player)
player:LearnSpell(
SPELLID, player)
player:LearnSpell(
SPELLID, player)
Menu with race requirementYou can also make a Menu that requires a curtain races
for example:
It is exactly the same only you have expended the menu script a bit for example:
Alliance race:
local race=player:GetPlayerRace()
if race==1 or race==3 or race==4 or race==7 or race==11 then
pUnit:GossipMenuAddItem(3, "
LOCATION NAME",
INTID, 0)
end
Horde Race:
local race=player:GetPlayerRace()
if race==2 or race==5 or race==6 or race==8 or race==10 then
pUnit:GossipMenuAddItem(3, "
LOCATION NAME",
INTID, 0)
end
This will make only Curtain races be able to view this menu, this is highly recommended when you are making Faction Cities .
Making a teleporter not able to talk when your in combatThe script would look like this:
if (player:IsInCombat() == true) then
player:SendAreaTriggerMessage("
MESSAGE HERE")
else
After EVERY menu or Teleport location you make you have to put a end E.G.:
Teleport location:
if(intid ==
INTID) then
player:Teleport(
MAPID, X, Y, Z)
pUnit:GossipComplete(player)
end
Menu:
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
pUnit:GossipMenuAddItem(3, "
LOCATION LIST NAME",
INTID, 0)
pUnit:GossipSendMenu(player)
end
and also at the end for your last location area you should have a extra end so it would look like this :
if(intid ==
INTID) then
player:Teleport(
MAPID, X, Y, Z)pUnit:GossipComplete(player)
end
end
Now registering - Quote :
RegisterUnitGossipEvent(NPCSPAWNID, 1, "NAME_OnGossipTalk")
RegisterUnitGossipEvent(NPCSPAWNID, 2, "NAME_OnGossipSelect")
U must use lua notepad for the world to be able to read it!
REMEMBER TO REPORT ANNY ERRORS YOU GET FROM THIS GUIDE TO ME!