-- Name: World Traveler Userfunction -- Version: 1.0 -- Author: NoobBotter -- ** Latest Updates: -- ** 10/15: -- Added direct transport to/from Butterflies/Dogmeat daily NPC in Xaviera. -- Fixed Varanas Bridge Teleport direct to any Varanas location. -- Added waypoints for Dwarven zone, Yrvandis Hollows, andthe Elven Zone, Haven of Departure. -- The keywords for these zones are "Yrvandis" and "Haven" -- ** Need to double check obj.ID of snoop in those areas and fix if necessary. -- Added Support for Multiple Languages. (Big thanks to Rock5 for implementing this.) -- Set keyword matching to case-insensitive. Now, takemeto("VaranasCentral") is the same as takemeto("varanasCENTRAL"), -- takemeto("VARANASCENTRAL"), or takemeto("varanascentral").(Big thanks to Rock5 for implementing this.) -- -- ** Older Updates: -- Changed "Lyonside" to "Lyonsyde" so transports work properly. -- Heffner - having toruble doing any transports... walks to NPC but fails at transfunc call with nil value... Fixed -- VaranasCentral was misspelled... fixed. -- Added Waypoints between Mercenary Square and ObsidiantoDalanis Envoy. -- Added Waypoints between DalanistoObsidian Envoy and Snoop in Thunderhoof Hills. -- Added zone for Ancient Kingdom of Rorazan. -- **Known issues: -- Have not tested Elven or Dwarf Starting zones. Need elf and dwarf to test it. -- Currently must be within 100 distance to the First NPC to utilize the function. -- This is due to current conflicts between having two NPC in close proximity that are both used, -- such as snoop and Varanas bridge transporter. Without this limitation, it will always run back and forth between the two. -- *************** Table with all the Zones and Transport NPCs. local zoneTable = {[1] = {zoneindex=1, ZoneId=1, myzone=100, nodename="Logar", ZNpcID=111256, Npcx=-1163, Npcz=-5535, Npcy=36}, [2] = {zoneindex=2, ZoneId=2, myzone=2000, nodename="VaranasSnoop", ZNpcID=111256, Npcx=2307, Npcz=1152, Npcy=0}, [3] = {zoneindex=3, ZoneId=2, myzone=3000, nodename="VaranasBridge", ZNpcID=110755, Npcx=2767, Npcz=956, Npcy=54}, [4] = {zoneindex=4, ZoneId=2, myzone=4000, nodename="VaranasWest", ZNpcID=110728, Npcx=2900, Npcz=-800, Npcy=57}, [5] = {zoneindex=5, ZoneId=2, myzone=5000, nodename="VaranasClassHall", ZNpcID=110922, Npcx=5271, Npcz=-3896, Npcy=60}, [6] = {zoneindex=6, ZoneId=2, myzone=6000, nodename="VaranasEast", ZNpcID=110727, Npcx=4475, Npcz=-39, Npcy=52}, [7] = {zoneindex=7, ZoneId=2, myzone=7000, nodename="VaranasCentral", ZNpcID=110726, Npcx=4747, Npcz=-1971, Npcy=115}, [8] = {zoneindex=8, ZoneId=2, myzone=8000, nodename="VaranasGuildHall", ZNpcID=110561, Npcx=6364, Npcz=-3104, Npcy=60}, [9] = {zoneindex=9, ZoneId=2, myzone=9000, nodename="HallofEyeofWisdon", ZNpcID=111339, Npcx=6929, Npcz=-2491, Npcy=58}, [10] = {zoneindex=10, ZoneId=4, myzone=10000, nodename="Silverfall", ZNpcID=111256, Npcx=-5913, Npcz=2867, Npcy=598}, [11] = {zoneindex=11, ZoneId=5, myzone=11000, nodename="HarfTradingPost", ZNpcID=111256, Npcx=-14459, Npcz=-150, Npcy=755}, [12] = {zoneindex=12, ZoneId=11, myzone=12000, nodename="DragonfangRidge", ZNpcID=111256, Npcx=-29438, Npcz=-17657, Npcy=250}, [13] = {zoneindex=13, ZoneId=10, myzone=13000, nodename="AyrenCaravan", ZNpcID=111256, Npcx=-38733, Npcz=1545, Npcy=1}, [14] = {zoneindex=14, ZoneId=10, myzone=14000, nodename="Reifort", ZNpcID=118586, Npcx=-29471, Npcz=1190, Npcy=-544}, [15] = {zoneindex=15, ZoneId=6, myzone=15000, nodename="ObsidianStronghold", ZNpcID=111256, Npcx=-20458, Npcz=6519, Npcy=-188}, [16] = {zoneindex=16, ZoneId=6, myzone=15800, nodename="BattleSquare", ZNpcID=110530, Npcx=-20782, Npcz=6214, Npcy=-226}, [17] = {zoneindex=17, ZoneId=6, myzone=16000, nodename="TradeSquare", ZNpcID=110944, Npcx=-22819, Npcz=2679, Npcy=-179}, [18] = {zoneindex=18, ZoneId=6, myzone=17000, nodename="GlorySquare", ZNpcID=110805, Npcx=-23203, Npcz=4489, Npcy=-260}, [19] = {zoneindex=19, ZoneId=6, myzone=18000, nodename="CraftingSquare", ZNpcID=110532, Npcx=-23631, Npcz=5814, Npcy=-260}, [20] = {zoneindex=20, ZoneId=6, myzone=19000, nodename="MercenarySquare", ZNpcID=110531, Npcx=-22001, Npcz=3636, Npcy=-179}, [21] = {zoneindex=21, ZoneId=6, myzone=19900, nodename="ObsidianDalanisEnvoy", ZNpcID=114777, Npcx=-20597, Npcz=4183, Npcy=-172}, [22] = {zoneindex=22, ZoneId=3, myzone=20000, nodename="AbandonedFortress", ZNpcID=111256, Npcx=13868, Npcz=6768, Npcy=27}, [23] = {zoneindex=23, ZoneId=7, myzone=21000, nodename="WeepingCoast", ZNpcID=111256, Npcx=19647, Npcz=21909, Npcy=10}, [24] = {zoneindex=24, ZoneId=8, myzone=22000, nodename="SavageLands", ZNpcID=111256, Npcx=5939, Npcz=20618, Npcy=219}, [25] = {zoneindex=25, ZoneId=9, myzone=23000, nodename="AotuliaVolcano", ZNpcID=111256, Npcx=-11317, Npcz=26312, Npcy=972}, [26] = {zoneindex=26, ZoneId=15, myzone=24000, nodename="DalanisObsidianEnvoy", ZNpcID=114776, Npcx=-4672, Npcz=7595, Npcy=107}, [27] = {zoneindex=27, ZoneId=15, myzone=30000, nodename="Dalanis", ZNpcID=114353, Npcx=-4282, Npcz=5088, Npcy=7}, [28] = {zoneindex=28, ZoneId=16, myzone=31000, nodename="SouthernJanost", ZNpcID=114353, Npcx=-6017, Npcz=21630, Npcy=-148}, [29] = {zoneindex=29, ZoneId=17, myzone=32000, nodename="NorthernJanost", ZNpcID=114353, Npcx=3563, Npcz=31618, Npcy=112}, [30] = {zoneindex=30, ZoneId=18, myzone=33000, nodename="LimoDesert", ZNpcID=114353, Npcx=3074, Npcz=47621, Npcy=84}, [31] = {zoneindex=31, ZoneId=19, myzone=34000, nodename="LandofMalevolence", ZNpcID=114353, Npcx=-2893, Npcz=49657, Npcy=118}, [32] = {zoneindex=32, ZoneId=20, myzone=35000, nodename="RedhillMountains", ZNpcID=114353, Npcx=-16459, Npcz=41043, Npcy=610}, [33] = {zoneindex=33, ZoneId=21, myzone=36000, nodename="TergothenBay", ZNpcID=114353, Npcx=-26309, Npcz=29777, Npcy=-98}, [34] = {zoneindex=34, ZoneId=13, myzone=40000, nodename="Heffner", ZNpcID=118002, Npcx=-6336, Npcz=-3913, Npcy=162}, [35] = {zoneindex=35, ZoneId=13, myzone=41000, nodename="Lyonsyde", ZNpcID=118020, Npcx=50, Npcz=-1137, Npcy=137}, [36] = {zoneindex=36, ZoneId=13, myzone=42000, nodename="DesertInvestigation", ZNpcID=118020, Npcx=-7413, Npcz=1191, Npcy=615}, [37] = {zoneindex=37, ZoneId=13, myzone=43000, nodename="FangersMakeshift", ZNpcID=118020, Npcx=2, Npcz=5036, Npcy=686}, [38] = {zoneindex=38, ZoneId=14, myzone=44000, nodename="RuinsResearch", ZNpcID=118002, Npcx=989, Npcz=13370, Npcy=326}, [39] = {zoneindex=39, ZoneId=14, myzone=45000, nodename="Jinners", ZNpcID=118020, Npcx=12879, Npcz=1939, Npcy=52}, [40] = {zoneindex=40, ZoneId=14, myzone=46000, nodename="FrontLine", ZNpcID=118020, Npcx=6777, Npcz=6312, Npcy=92}, [41] = {zoneindex=41, ZoneId=14, myzone=46001, nodename="Butterflies", ZNpcID=118072, Npcx=6424, Npcz=5432, Npcy=155}, [42] = {zoneindex=42, ZoneId=22, myzone=50000, nodename="Rorazan", ZNpcID=118219, Npcx=-20708, Npcz=-22750, Npcy=564}, [43] = {zoneindex=43, ZoneId=31, myzone=400, nodename="Yrvandis", ZNpcID=111256, Npcx=2270, Npcz=-409, Npcy=1554}, [44] = {zoneindex=44, ZoneId=12, myzone=700, nodename="Haven", ZNpcID=111256, Npcx=28492, Npcz=3465, Npcy=312} } -- NOTE: zoneindex is an index number from 1 thru however many zones I make. -- NOTE: ZoneId is the actual ingame ID for that zone (returned when you use the getZoneId() function). -- NOTE: myzone is the numbering I use to mathematically figure out where to tranport to get to final destination. This will be the numbers used in the -- path calculations -- NOTE: nodename is the input to use with the takemeto() function to take you to that zone. -- NOTE: The below strings are the strings used at the NPCs. This is within the system and is used for multi-language support: local optionstrings = { Logar = "ZONE_ROGSHIRE", Rorazan = "ZONE_Z22_OLD_ROJAN_KINGDOM", Heffner = "ZONE_HARFEN_CAMP", Obsidian = "ZONE_OBSIDIAN BASTION", Fortress = "ZONE_DUST HOLD", Reifort = "ZONE_REIFORT POINT", Silverfall = "ZONE_ARGENFALL", Class = "ZONE_VARANAS_CLASS_HALL", West = "ZONE_VARANAS WEST WING", Gates = "SO_110561_10", Wisdom = "SC_111339_12", Guild = "SO_110561_6", Central = "ZONE_VARANAS CENTRAL SQUARE", East = "ZONE_VARANAS EAST WING", Varanas = "ZONE_VARANAS", Silverspring = "ZONE_SILVERSPRING", Harf = "ZONE_HAROLFE TRADING POST", Lyk = "ZONE_LAGO", Ayren = "ZONE_AYEN CARAVAN", Mercenary = "SO_110944_8", Crafting = "SO_110944_7", Glory = "SO_110944_3", Trade = "SO_110944_2", Battle = "SO_110944_6", ToDalanis = "SC_114777_1", Boulderwind = "ZONE_BOULDERWIND", Green = "ZONE_THE GREEN TOWER", Dimarka = "ZONE_DIMARKA", ToObsidian = "SC_114776_0", Southern = "ZONE_SOUTH_JENOTAR_FOREST", Northern = "ZONE_NORTHERN_JANOST_FOREST", Dalanis = "ZONE_DAELANIS", Limon = "ZONE_LYMUN_KINGDOM", Kampel = "ZONE_CAMPBELL_TOWNSHIP", Fireboot = "ZONE_FIREBOOT_DWARF_FORTRESS", Torag = "ZONE_TORAGG_CARAVAN", Lyonsyde = "ZONE_LANZERD_HORDE", Investigation = "ZONE_WILDERNESS_RESEARCH_CAMP", Makeshift = "ZONE_TEMPORARY_FANGT_CAMP", Jinner = "ZONE_JINNERS_CAMP", Research = "ZONE_RUINS_TESTING_CAMP", Front = "ZONE_FRONT_LINES_CAMP", Thunderhoof = "ZONE_THUNDERHOOF_MESA", Yrvandis = "ZONE_Z31_IFANTRISH_CRYPT", Haven = "ZONE_STONES FURLOUGH", } function TEXT(string) local option = optionstrings[string] if not option then error("option missing from option table: "..string) end local text = RoMScript("TEXT(\""..option.."\")") for replace in string.gfind(text,"%[(.*)%]") do text = string.gsub(text,"%["..replace.."%]", RoMScript("TEXT(\""..replace.."\")")) end return text end -- **************************************Zone functions follow **************************************************** -- if in Logar it should call the Node1 function. -- if in Varanas, it should call the Node2 function, -- if at Varanas Bridge, it should call the Node3 function. -- if in Silverfall, it should call the Node10 function. -- etc, etc, etc... -- ****************Each zone will have it's own function for how to handle teleports: -- This is the Logar Node function Node1(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 399 then print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); end end -- This is the Varanas Snoop node function Node2(myzone_dest, myzone_current, cur_Npc_ID) if (400 > myzone_dest) then-- anything less than 400 has to be Logar print("Now Transporting to Logar"); NPCTeleport(cur_Npc_ID, TEXT("Logar")); elseif (700 > myzone_dest) then-- anything less than 700 has to be Yrvandis print("Now Transporting to Yrvandis Hollows"); NPCTeleport(cur_Npc_ID, TEXT("Yrvandis")); elseif (1000 > myzone_dest) then-- anything less than 1000 has to be Haven print("Now Transporting to Haven of Departure"); NPCTeleport(cur_Npc_ID, TEXT("Haven")); elseif (myzone_dest > 49999) then -- anything 50000 or up must be through Rorazan print("Now Transporting to Rorazan"); NPCTeleport(cur_Npc_ID, TEXT("Rorazan")); elseif (myzone_dest > 39999) then -- anything 40000 or up must be through Heffner print("Now Transporting to Heffner"); NPCTeleport(cur_Npc_ID, TEXT("Heffner")); elseif (myzone_dest > 23999) then -- 30000 is Dalanis - must go through OS to get there print("Now Transporting to Obsidian"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif (myzone_dest > 19999) then -- 20000 is Abandoned Fortress print("Now Transporting to Abandoned Fortress"); NPCTeleport(cur_Npc_ID, TEXT("Fortress")); elseif (myzone_dest > 14999) then -- 15000 is Obsidian Stronghold print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif (myzone_dest > 11999) then -- 14000 is Reifort print("Now Transporting to Reifort"); NPCTeleport(cur_Npc_ID, TEXT("Reifort")); elseif (myzone_dest > 9999) then -- 10000 is Silverfall and Harf print("Now Transporting to Silverfall"); NPCTeleport(cur_Npc_ID, TEXT("Silverfall")); elseif (myzone_dest > 2999) then -- 3000 through 9999 is for Varanas Bridge and City so need to go to that NPC. print("Now Moving to Varanas City Transporter..."); player:moveTo(CWaypoint(2767,956), true); end -- That should cover all the options for Varanas Locations. end -- This is the Varanas Bridge node function Node3(myzone_dest, myzone_current, cur_Npc_ID) if (3000 > myzone_dest or myzone_dest > 9999) then -- if anything but Varanas City is destination, move to snoop. d = 2; -- index for snoop in varanas is 2. print("Now moving to Snoop..."); player:moveTo(CWaypoint(2307,1152), true); elseif myzone_dest > 8999 then -- anything 9000 or up must be Eye Of Wisdom Hall print("Now Transporting to Hall of the Eye of Wisdom"); NPCTeleport(cur_Npc_ID, TEXT("Wisdom")); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, TEXT("Guild")); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, TEXT("Central")); elseif myzone_dest > 5999 then -- 6000 is Lower City East print("Now Transporting to Lower City East"); NPCTeleport(cur_Npc_ID, TEXT("East")); elseif myzone_dest > 4999 then -- 5000 is Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, TEXT("Class")); elseif myzone_dest > 3999 then -- 4000 is Lower City West print("Now Transporting to Lower City West"); NPCTeleport(cur_Npc_ID, TEXT("West")); end -- That should cover all the options for Varanas Locations. end -- This is the Lower City West node function Node4(myzone_dest, myzone_current, cur_Npc_ID) if (4000 > myzone_dest) or (myzone_dest > 9999) then -- anything not in city, goto Varanas gate or bridge print("Now Transporting to Varanas Gate"); NPCTeleport(cur_Npc_ID, TEXT("Gates")); elseif myzone_dest > 8999 then -- anything 9000 or up must be Eye Of Wisdom Hall print("Now Transporting to Hall of the Eye of Wisdom"); NPCTeleport(cur_Npc_ID, TEXT("Wisdom")); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, TEXT("Guild")); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, TEXT("Central")); elseif myzone_dest > 5999 then -- 6000 is Lower City East print("Now Transporting to Lower City East"); NPCTeleport(cur_Npc_ID, TEXT("East")); elseif myzone_dest > 4999 then -- 5000 is Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, TEXT("Class")); end -- That should cover all the options for Varanas Locations. end -- This is the Class Hall node function Node5(myzone_dest, myzone_current, cur_Npc_ID) if (4000 > myzone_dest) or (myzone_dest > 9999) then -- anything not in city, goto Varanas gate or bridge print("Now Transporting to Varanas Gates"); NPCTeleport(cur_Npc_ID, TEXT("Gates")); elseif 5000 > myzone_dest then -- this would find anything between 4000 and 4999 to go to Lower City West print("Now Transporting to Lower City West"); NPCTeleport(cur_Npc_ID, TEXT("West")); elseif myzone_dest > 8999 then -- anything 9000 or up must be Eye Of Wisdom Hall print("Now Transporting to Hall of the Eye of Wisdom"); NPCTeleport(cur_Npc_ID, TEXT("Wisdom")); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, TEXT("Guild")); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, TEXT("Central")); elseif myzone_dest > 5999 then -- 6000 is Lower City East print("Now Transporting to Lower City East"); NPCTeleport(cur_Npc_ID, TEXT("East")); end -- That should cover all the options for Varanas Locations. end -- This is the Varanas Lower City East node function Node6(myzone_dest, myzone_current, cur_Npc_ID) if (4000 > myzone_dest) or (myzone_dest > 9999) then -- anything not in city, goto Varanas gate or bridge print("Now Transporting to Varanas Gates"); NPCTeleport(cur_Npc_ID, TEXT("Gates")); elseif 5000 > myzone_dest then -- this would find anything between 4000 and 4999 to go to Lower City West print("Now Transporting to Lower City West"); NPCTeleport(cur_Npc_ID, TEXT("West")); elseif 6000 > myzone_dest then -- this would find anything between 5000 and 5999 to go to Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, TEXT("Class")); elseif myzone_dest > 8999 then -- anything 9000 or up must be Eye Of Wisdom Hall print("Now Transporting to Hall of the Eye of Wisdom"); NPCTeleport(cur_Npc_ID, TEXT("Wisdom")); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, TEXT("Guild")); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, TEXT("Central")); end -- That should cover all the options for Varanas Locations. end -- This is the Varanas Central Plaza node function Node7(myzone_dest, myzone_current, cur_Npc_ID) if (4000 > myzone_dest) or (myzone_dest > 9999) then -- anything not in city, goto Varanas gate or bridge print("Now Transporting to Varanas Gates"); NPCTeleport(cur_Npc_ID, TEXT("Gates")); elseif 5000 > myzone_dest then -- this would find anything between 4000 and 4999 to go to Lower City West print("Now Transporting to Lower West"); NPCTeleport(cur_Npc_ID, TEXT("West")); elseif 6000 > myzone_dest then -- this would find anything between 5000 and 5999 to go to Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, TEXT("Class")); elseif 7000 > myzone_dest then -- this would find anything between 6000 and 6999 to go to Lower City East print("Now Transporting to Lower East"); NPCTeleport(cur_Npc_ID, TEXT("East")); elseif myzone_dest > 8999 then -- anything 9000 or up must be Eye Of Wisdom Hall print("Now Transporting to Hall of the Eye of Wisdom"); NPCTeleport(cur_Npc_ID, TEXT("Wisdom")); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, TEXT("Guild")); end -- That should cover all the options for Varanas Locations. end -- This is the Varanas Guild Hall node function Node8(myzone_dest, myzone_current, cur_Npc_ID) if (4000 > myzone_dest) or (myzone_dest > 9999) then -- anything not in city, goto Varanas gate or bridge print("Now Transporting to Varanas Gates"); NPCTeleport(cur_Npc_ID, TEXT("Gates")); elseif 5000 > myzone_dest then -- this would find anything between 4000 and 4999 to go to Lower City West print("Now Transporting to Lower West"); NPCTeleport(cur_Npc_ID, TEXT("West")); elseif 6000 > myzone_dest then -- this would find anything between 5000 and 5999 to go to Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, TEXT("Class")); elseif 7000 > myzone_dest then -- this would find anything between 6000 and 6999 to go to Lower City East print("Now Transporting to Guild"); NPCTeleport(cur_Npc_ID, TEXT("Lower East")); elseif 8000 > myzone_dest then -- this would find anything between 7000 and 7999 to go to Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, TEXT("Central")); elseif myzone_dest > 8999 then -- anything 9000 or up must be Eye Of Wisdom Hall print("Now Transporting to Hall of the Eye of Wisdom"); NPCTeleport(cur_Npc_ID, TEXT("Wisdom")); end -- That should cover all the options for Varanas Locations. end -- This is the Varanas Hall of the Eye of Wisdom node function Node9(myzone_dest, myzone_current, cur_Npc_ID) if (4000 > myzone_dest) or (myzone_dest > 9999) then -- anything not in city, goto Varanas gate or bridge print("Now Transporting to Varanas Gates"); NPCTeleport(cur_Npc_ID, TEXT("Gates")); elseif 5000 > myzone_dest then -- this would find anything between 4000 and 4999 to go to Lower City West print("Now Transporting to Lower West"); NPCTeleport(cur_Npc_ID, TEXT("West")); elseif 6000 > myzone_dest then -- this would find anything between 5000 and 5999 to go to Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, TEXT("Class")); elseif 7000 > myzone_dest then -- this would find anything between 6000 and 6999 to go to Lower City East print("Now Transporting to Guild"); NPCTeleport(cur_Npc_ID, TEXT("Lower East")); elseif 8000 > myzone_dest then -- this would find anything between 7000 and 7999 to go to Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, TEXT("Central")); elseif 9000 > myzone_dest then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, TEXT("Guild")); end -- That should cover all the options for Varanas Locations. end -- This is the Silverfall node function Node10(myzone_dest, myzone_current, cur_Npc_ID) if (10000 > myzone_dest) or (myzone_dest > 12999) then -- Anything not between Harf or Lyk, goto Varanas Snoop print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif myzone_dest > 10999 then -- anything else above 10999 go to Harf Trading post node print("Now Transporting to Harf Trading Post"); NPCTeleport(cur_Npc_ID, TEXT("Harf")); end -- anything between 10000 - 10999 will stay here. end -- This is the Harf Trading Post node function Node11(myzone_dest, myzone_current, cur_Npc_ID) if (11000 > myzone_dest) or (myzone_dest > 39999) then -- Anything Less than 11000, goto Silverfall print("Now Transporting to Silverfall"); NPCTeleport(cur_Npc_ID, TEXT("Silverfall")); elseif myzone_dest > 23999 then -- anything else above 23999 go to OS node print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif myzone_dest > 19999 then -- anything else above 19999 go to Silverfall node print("Now Transporting to Silverfall"); NPCTeleport(cur_Npc_ID, TEXT("Silverfall")); elseif myzone_dest > 13999 then -- anything else above 13999 go to OS node print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif myzone_dest > 11999 then -- anything else above 11999 go to Dragonfang Ridge node print("Now Transporting to Dragonfang Ridge"); NPCTeleport(cur_Npc_ID, TEXT("Lyk")); end -- anything between 11000 - 11999 will stay here. end -- This is the Dragonfang Ridge (Lyk) node function Node12(myzone_dest, myzone_current, cur_Npc_ID) if (12000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Lyk or heffner and up will go to varanas. print("Now Transporting to Harf Trading Post"); NPCTeleport(cur_Npc_ID, TEXT("Harf")); elseif myzone_dest > 23999 then -- anything else above 23999 (Dalanis) go to Obsidian node print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif myzone_dest > 19999 then -- anything else above 19999 (Abandoned Fort) go to Varanas via Harf print("Now Transporting to Harf Trading Post"); NPCTeleport(cur_Npc_ID, TEXT("Harf")); elseif myzone_dest > 12999 then -- anything else above 12999 go to Ayren Caravan print("Now Transporting to Ayren Caravan"); NPCTeleport(cur_Npc_ID, TEXT("Ayren")); end -- anything between 12000 - 12999 will stay here. end -- This is the Ayren Caravan node function Node13(myzone_dest, myzone_current, cur_Npc_ID) if (myzone_dest > 49999) then -- anything 50000 or up must be through Lyk print("Now Transporting to Lyk"); NPCTeleport(cur_Npc_ID, TEXT("Lyk")); elseif (12000 > myzone_dest) or (myzone_dest > 14999) then -- Anything below Lyk or above reifort will go to Obsidian. print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif myzone_dest > 13999 then -- anything else above 13999 (Reifort) go to Reifort node print("Now Transporting to Reifort"); NPCTeleport(cur_Npc_ID, TEXT("Reifort")); elseif 1300 > myzone_dest then -- anything else below 1300 go to Lyk print("Now Transporting to Dragonfang Ridge"); NPCTeleport(cur_Npc_ID, TEXT("Lyk")); end -- anything between 13000 - 13999 will stay here. end -- This is the Reifort node function Node14(myzone_dest, myzone_current, cur_Npc_ID) if (11000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Harf or above Heffner will go to Varanas. print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif myzone_dest > 23999 then -- anything else above 23999 go to Obsidian print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif myzone_dest > 19999 then -- Anything else above 19999 will go to Varanas. print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif myzone_dest > 14999 then -- anything else above 14999 go to Obsidian print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, TEXT("Obsidian")); elseif 1300 > myzone_dest then -- anything else below 1300 go to Lyk print("Now Transporting to Dragonfang Ridge"); NPCTeleport(cur_Npc_ID, TEXT("Lyk")); elseif 14000 > myzone_dest then -- anything else below 14000 go to Ayren print("Now Transporting to Ayren Caravan"); NPCTeleport(cur_Npc_ID, TEXT("Ayren")); end -- anything between 14000 - 14999 will stay here. end -- This is the Obsidian Snoop node function Node15(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Now Moving To Battle Square to transport to Merchant Square"); player:moveTo(CWaypoint(-20782,6214), true); elseif (10000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Silverfall or above Heffner will go to Varanas. print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif myzone_dest > 23999 then -- anything else above 23999 go to Dalanis Envoy via Battle Square print("Now Moving To Battle Square to transport to Merchant Square"); player:moveTo(CWaypoint(-20782,6214), true); elseif myzone_dest > 19999 then -- Anything else above 19999 will go to Varanas. print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif myzone_dest > 15000 then -- anything else above 15000 go to Battle Square print("Now Moving To Battle Square"); player:moveTo(CWaypoint(-20782,6214), true); elseif 1300 > myzone_dest then -- anything else below 1300 go to Harf print("Now Transporting to harf Trading Post"); NPCTeleport(cur_Npc_ID, TEXT("Harf")); elseif 14000 > myzone_dest then -- anything else below 14000 go to Ayren print("Now Transporting to Ayren Caravan"); NPCTeleport(cur_Npc_ID, TEXT("Ayren")); elseif 15000 > myzone_dest then -- anything else below 15000 go to Reifort print("Now Transporting to Reifort"); NPCTeleport(cur_Npc_ID, TEXT("Reifort")); end -- anything between 14000 - 14999 will stay here. end -- This is the Battle Square node function Node16(myzone_dest, myzone_current, cur_Npc_ID) if (15800 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Battle Square or above Heffner will go to snoop. print("Now Moving To Obsidian Snoop"); player:moveTo(CWaypoint(-20458,6519), true); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 19999 then -- Anything else above 19999 will go to Obsidian Snoop. print("Now Moving To Obsidian Snoop"); player:moveTo(CWaypoint(-20458,6519), true); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 17999 then -- anything else above 17999 go to Crafting Square print("Now Transporting to Crafting Square"); NPCTeleport(cur_Npc_ID, TEXT("Crafting")); elseif myzone_dest > 16999 then -- anything else above 16999 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, TEXT("Glory")); elseif myzone_dest > 15999 then -- anything else above 15999 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, TEXT("Trade")); end end -- This is the Trade Square node function Node17(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif (16000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Battle Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 19999 then -- Anything above 19000 Battle Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 17999 then -- anything else above 17999 go to Crafting Square print("Now Transporting to Crafting Square"); NPCTeleport(cur_Npc_ID, TEXT("Crafting")); elseif myzone_dest > 16999 then -- anything else above 16999 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, TEXT("Glory")); end end -- This is the Glory Square node function Node18(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif (16000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Trade Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 19999 then -- Anything above 19000 Battle Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 17999 then -- anything else above 17999 go to Crafting Square print("Now Transporting to Crafting Square"); NPCTeleport(cur_Npc_ID, TEXT("Crafting")); elseif 17000 > myzone_dest then -- anything else below 17000 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, TEXT("Trade")); end end -- This is the Crafting Square node function Node19(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif (16000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Trade Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif myzone_dest > 19999 then -- Anything above 19000 Battle Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, TEXT("Mercenary")); elseif 17000 > myzone_dest then -- anything else below 17000 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, TEXT("Trade")); elseif 18000 > myzone_dest then -- anything else below 18000 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, TEXT("Glory")); end end -- This is the Mercenary Square node function Node20(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Moving from Mercenary Square to envoy"); -- ******************************************************************************************** player:moveTo(CWaypoint(-21441,4199), true); player:moveTo(CWaypoint(-21261,4379), true); player:moveTo(CWaypoint(-20999,4541), true); player:moveTo(CWaypoint(-20743,4319), true); player:moveTo(CWaypoint(-20653,4237), true); -- ******************************************************************************************** elseif (16000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below Trade Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Moving from Mercenary Square to envoy"); -- ******************************************************************************************** player:moveTo(CWaypoint(-21441,4199), true); player:moveTo(CWaypoint(-21261,4379), true); player:moveTo(CWaypoint(-20999,4541), true); player:moveTo(CWaypoint(-20743,4319), true); player:moveTo(CWaypoint(-20653,4237), true); -- ******************************************************************************************** elseif myzone_dest > 19999 then -- Anything above 19000 Battle Square or above Heffner will go to Battle Square print("Now Transporting to Battle Square"); NPCTeleport(cur_Npc_ID, TEXT("Battle")); elseif 17000 > myzone_dest then -- anything else below 17000 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, TEXT("Trade")); elseif 18000 > myzone_dest then -- anything else below 18000 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, TEXT("Glory")); elseif 19000 > myzone_dest then -- anything else below 19000 go to Crafting Square print("Now Transporting to CraftingSquare"); NPCTeleport(cur_Npc_ID, TEXT("Crafting")); end end -- This is the Obsidian to Dalanis Envoy node function Node21(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Now Transporting to Dalanis"); NPCTeleport(cur_Npc_ID, TEXT("ToDalanis")); elseif (19900 > myzone_dest) or (myzone_dest > 39999) then -- Anything below This location or above Heffner will go to Battle Square via Marcenary Square print("Moving to the Mercenary Square"); -- ******************************************************************************************** player:moveTo(CWaypoint(-20743,4319), true); player:moveTo(CWaypoint(-20999,4541), true); player:moveTo(CWaypoint(-21261,4379), true); player:moveTo(CWaypoint(-21441,4199), true); player:moveTo(CWaypoint(-21941,3709), true); -- ******************************************************************************************** elseif myzone_dest > 23999 then -- Anything above 23999 Transports to Dalanis print("Now Transporting to Dalanis"); NPCTeleport(cur_Npc_ID, TEXT("ToDalanis")); elseif myzone_dest > 19999 then -- Anything above 19999 Transports to Varanas via Mercenary Square print("Moving to the Mercenary Square"); -- ******************************************************************************************** player:moveTo(CWaypoint(-20743,4319), true); player:moveTo(CWaypoint(-20999,4541), true); player:moveTo(CWaypoint(-21261,4379), true); player:moveTo(CWaypoint(-21441,4199), true); player:moveTo(CWaypoint(-21941,3709), true); -- ******************************************************************************************** end end -- This is the Abandoned Fortress node function Node22(myzone_dest, myzone_current, cur_Npc_ID) if (20000 > myzone_dest) or (myzone_dest > 23999) then -- anything less than current and greater that volcano,has to be Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif (myzone_dest > 20999) then -- anything 21000 or up must be through Weeping Coast print("Now Transporting to WeepingCoast"); NPCTeleport(cur_Npc_ID, TEXT("Boulderwind")); end end -- This is the Weeping Coast node function Node23(myzone_dest, myzone_current, cur_Npc_ID) if (21000 > myzone_dest) or (myzone_dest > 23999) then -- anything less than current and greater that volcano,has to be Abandoned Fortress print("Now Transporting to Abandoned Fortress"); NPCTeleport(cur_Npc_ID, TEXT("Fortress")); elseif (myzone_dest > 21999) then -- anything 22000 or up must be through Savage Lands (Green Tower) print("Now Transporting to Savage Lands"); NPCTeleport(cur_Npc_ID, TEXT("Green")); end end -- This is the Savage Lands node function Node24(myzone_dest, myzone_current, cur_Npc_ID) if (22000 > myzone_dest) or (myzone_dest > 23999) then -- anything less than current and greater that volcano,has to be Weeping Coast print("Now Transporting to Weeping Coast"); NPCTeleport(cur_Npc_ID, TEXT("Boulderwind")); elseif (myzone_dest > 22999) then -- anything 23000 or up must be through Volcano (outskirts of Dimarka) print("Now Transporting to Aotulia Volcano"); NPCTeleport(cur_Npc_ID, TEXT("Dimarka")); end end -- This is the Aotulia Volcano node function Node25(myzone_dest, myzone_current, cur_Npc_ID) if (23000 > myzone_dest) or (myzone_dest > 23999) then -- anything less than current and greater that volcano,has to be Savage Lands print("Now Transporting to Savage Lands"); NPCTeleport(cur_Npc_ID, TEXT("Green")); end end -- This is the Dalanis to Obsidian Envoy node function Node26(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Moving to Snoop outside Dalanis City"); -- ******************************************************************************************** player:moveTo(CWaypoint(-4639,7600), true); player:moveTo(CWaypoint(-4497,7474), true); player:moveTo(CWaypoint(-4403,7187), true); player:moveTo(CWaypoint(-4407,6829), true); player:moveTo(CWaypoint(-4193,6256), true); player:moveTo(CWaypoint(-4143,6031), true); player:moveTo(CWaypoint(-4170,5641), true); player:moveTo(CWaypoint(-4044,5128), true); player:moveTo(CWaypoint(-4285,5090), true); -- ******************************************************************************************** elseif (24000 > myzone_dest) or (myzone_dest > 39999) then -- Anything below This location or above Heffner will go Back to Obsidian print("Now Transporting to Obsidian"); NPCTeleport(cur_Npc_ID, TEXT("ToObsidian")); elseif myzone_dest > 29999 then -- Anything above 29999 will walk to Dalanis Snoop print("Moving to Snoop outside Dalanis City"); -- ******************************************************************************************** player:moveTo(CWaypoint(-4639,7600), true); player:moveTo(CWaypoint(-4497,7474), true); player:moveTo(CWaypoint(-4403,7187), true); player:moveTo(CWaypoint(-4407,6829), true); player:moveTo(CWaypoint(-4193,6256), true); player:moveTo(CWaypoint(-4143,6031), true); player:moveTo(CWaypoint(-4170,5641), true); player:moveTo(CWaypoint(-4044,5128), true); player:moveTo(CWaypoint(-4285,5090), true); -- ******************************************************************************************** end end -- This is the Dalanis Snoop node function Node27(myzone_dest, myzone_current, cur_Npc_ID) if myzone_dest > 49999 then print("Now Transporting to Rorazan"); NPCTeleport(cur_Npc_ID, TEXT("Rorazan")); elseif (30000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to Obsidian print("This function not yet available"); -- ******************************************************************************************** player:moveTo(CWaypoint(-4285,5090), true); player:moveTo(CWaypoint(-4044,5128), true); player:moveTo(CWaypoint(-4170,5641), true); player:moveTo(CWaypoint(-4143,6031), true); player:moveTo(CWaypoint(-4193,6256), true); player:moveTo(CWaypoint(-4407,6829), true); player:moveTo(CWaypoint(-4403,7187), true); player:moveTo(CWaypoint(-4497,7474), true); player:moveTo(CWaypoint(-4639,7600), true); -- ******************************************************************************************** elseif (myzone_dest > 30999) then -- anything 31000 or up must be through Southern Janost print("Now Transporting to Southern Janost Forest"); NPCTeleport(cur_Npc_ID, TEXT("Southern")); end end -- This is the "SouthernJanost" node function Node28(myzone_dest, myzone_current, cur_Npc_ID) if (31000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to Dalanis print("Now Transporting to Dalanis"); NPCTeleport(cur_Npc_ID, TEXT("Dalanis")); elseif (myzone_dest > 31999) then -- anything 32000 or up must be through Northern Janost print("Now Transporting to Northern Janost Forest"); NPCTeleport(cur_Npc_ID, TEXT("Northern")); end end -- This is the "NorthernJanost" node function Node29(myzone_dest, myzone_current, cur_Npc_ID) if (32000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to SouthernJanost print("Now Transporting to SouthernJanost"); NPCTeleport(cur_Npc_ID, TEXT("Southern")); elseif (myzone_dest > 32999) then -- anything 33000 or up must be through Limo Desert print("Now Transporting to Limo Desert"); NPCTeleport(cur_Npc_ID, TEXT("Limon")); end end -- This is the "Limo Desert" node function Node30(myzone_dest, myzone_current, cur_Npc_ID) if (33000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to NorthernJanost print("Now Transporting to NorthernJanost"); NPCTeleport(cur_Npc_ID, TEXT("Northern")); elseif (myzone_dest > 33999) then -- anything 34000 or up must be through Land of Malevolence print("Now Transporting to Land of Malevolence"); NPCTeleport(cur_Npc_ID, TEXT("Kampel")); end end -- This is the "Land of Malevolence" node function Node31(myzone_dest, myzone_current, cur_Npc_ID) if (34000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to Limo Desert print("Now Transporting to Limo Desert"); NPCTeleport(cur_Npc_ID, TEXT("Limon")); elseif (myzone_dest > 34999) then -- anything 35000 or up must be through Redhill Mountains print("Now Transporting to Redhill Mountains"); NPCTeleport(cur_Npc_ID, TEXT("Fireboot")); end end -- This is the "Redhill Mountains" node function Node32(myzone_dest, myzone_current, cur_Npc_ID) if (35000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to Land of Malevolence print("Now Transporting to Land of Malevolence"); NPCTeleport(cur_Npc_ID, TEXT("Kampel")); elseif (myzone_dest > 35999) then -- anything 36000 or up must be through Tergothen Bay print("Now Transporting to Tergothen Bay"); NPCTeleport(cur_Npc_ID, TEXT("Torag")); end end -- This is the "Tergothen Bay" node function Node33(myzone_dest, myzone_current, cur_Npc_ID) if (36000 > myzone_dest) or (myzone_dest > 39999) then -- anything less than current and greater than heffner,has to go back to Redhill Mountains print("Now Transporting to Redhill Mountains"); NPCTeleport(cur_Npc_ID, TEXT("Fireboot")); end end -- This is the Heffner node function Node34(myzone_dest, myzone_current, cur_Npc_ID) if (40000 > myzone_dest) or (myzone_dest > 49999) then-- anything less than current has to be Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); elseif (myzone_dest > 40999) then -- anything 41000 or up must be through Lyonsyde print("Now Transporting to Lyonsyde Camp"); NPCTeleport(cur_Npc_ID, TEXT("Lyonsyde")); end end -- This is the Lyonsyde node function Node35(myzone_dest, myzone_current, cur_Npc_ID) if (41000 > myzone_dest) or (myzone_dest > 49999) then-- anything less than current has to be Heffner print("Now Transporting to Heffner"); NPCTeleport(cur_Npc_ID, TEXT("Heffner")); elseif (myzone_dest > 41999) then -- anything 42000 or up must be through Desert Investigation Post print("Now Transporting to Desert Investigation Post"); NPCTeleport(cur_Npc_ID, TEXT("Investigation")); end end -- This is the Desert Investigation Post node function Node36(myzone_dest, myzone_current, cur_Npc_ID) if (42000 > myzone_dest) then-- anything less than current has to be Lyonsyde print("Now Transporting to Lyonsyde"); NPCTeleport(cur_Npc_ID, TEXT("Lyonsyde")); elseif (myzone_dest > 42999) then -- anything 43000 or up must be through Fanger's Makeshift Camp print("Now Transporting to FangersMakeshift"); NPCTeleport(cur_Npc_ID, TEXT("Makeshift")); end end -- This is the Fanger's Makeshift Camp node function Node37(myzone_dest, myzone_current, cur_Npc_ID) if (40000 > myzone_dest) or (myzone_dest > 43999) then -- anything here would be more efficient to go forward. print("Now Transporting to Ruins Research Camp"); NPCTeleport(cur_Npc_ID, TEXT("Research")); elseif (43000 > myzone_dest) then-- anything else less than current has to be Desert Investigation print("Now Transporting to Desert Investigation post"); NPCTeleport(cur_Npc_ID, TEXT("Investigation")); end end -- This is the Ruins Research Camp node function Node38(myzone_dest, myzone_current, cur_Npc_ID) if (41000 > myzone_dest) or (myzone_dest > 49999) then-- anything less than 41000 should go back to Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Silverspring")); elseif (4400> myzone_dest) then -- anything 44000 or lower must be through Fangers Camp print("Now Transporting to Fanger's Makeshift Camp"); NPCTeleport(cur_Npc_ID, TEXT("Makeshift")); elseif (myzone_dest > 44999) then-- anything higher than current has to be Jinners print("Now Transporting to Jinner's Camp"); NPCTeleport(cur_Npc_ID, TEXT("Jinner")); end end -- This is the Jinner's Camp node function Node39(myzone_dest, myzone_current, cur_Npc_ID) if (45000 > myzone_dest) or (myzone_dest > 49999) then-- anything less than 45000 should go back to Ruins Research print("Now Transporting to Ruins Research Camp"); NPCTeleport(cur_Npc_ID, TEXT("Research")); elseif (myzone_dest > 45999) then-- anything higher than current has to be Front Line Camp print("Now Transporting to Front Line Camp"); NPCTeleport(cur_Npc_ID, TEXT("Front")); end end -- This is the Frontline Camp node function Node40(myzone_dest, myzone_current, cur_Npc_ID) if (46000 > myzone_dest) or (myzone_dest > 49999) then-- anything outside of 46000 - 47000 range should go back to Jinners print("Now Transporting to Jinners Camp"); NPCTeleport(cur_Npc_ID, TEXT("Jinner")); end if(myzone_dest == 46001) then -- 46001 is Butterflies Daily area. print("Now Moving to Butterflies Daily NPC."); player:moveTo(CWaypoint(6665,6295), true); player:moveTo(CWaypoint(6404,6170), true); player:moveTo(CWaypoint(6362,5678), true); player:moveTo(CWaypoint(6424,5432), true); print("Arrived at Butterflies Daily Area"); end end -- This is the Butterflies Daily Area node function Node41(myzone_dest, myzone_current, cur_Npc_ID) if(myzone_dest == 46001) then print("You're already at the Butterflies Daily Area. Not transporting."); else print("Now Moving to Frontline Camp Teleporter."); player:moveTo(CWaypoint(6362,5678), true); player:moveTo(CWaypoint(6404,6170), true); player:moveTo(CWaypoint(6665,6295), true); player:moveTo(CWaypoint(6777,6312), true); print("Arrived at Frontline Camp Teleporter."); end end -- This is the Ancient Kingdom of Rorazan node function Node42(myzone_dest, myzone_current, cur_Npc_ID) if (30000 > myzone_dest) then-- anything less than 30000 should go back to Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Silverspring")); elseif (40000 > myzone_dest) then-- anything less than 40000 should go back to Thunderhoof Hills/dalanis print("Now Transporting to Thunderhoof Hills"); NPCTeleport(cur_Npc_ID, TEXT("Thunderhoof")); elseif (50000 > myzone_dest) then-- anything less than 50000 should go back to Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Silverspring")); end end -- This is the Yrvandis Hollows Node function Node43(myzone_dest, myzone_current, cur_Npc_ID) if (399 > myzone_dest) or (myzone_dest > 699) then print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); end end -- This is the Haven of Departure Node function Node44(myzone_dest, myzone_current, cur_Npc_ID) if (699 > myzone_dest) or (myzone_dest > 999) then print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, TEXT("Varanas")); end end -- Set my local functions -- For any new zones added, the Function will need to be added above and the Node added to the followign entry: local transfunc = { Node1, Node2, Node3, Node4, Node5, Node6, Node7, Node8, Node9, Node10, Node11, Node12, Node13, Node14, Node15, Node16, Node17, Node18, Node19, Node20, Node21, Node22, Node23, Node24, Node25, Node26, Node27, Node28, Node29, Node30, Node31, Node32, Node33, Node34, Node35, Node36, Node37, Node38, Node39, Node40, Node41, Node42, Node43, Node44}; -- uses my index (table.zoneindex) for the nodes. I need one of these for each node and then -- **************** The variable "destzone" is going to be the zone number associated with where you want your bot to go. -- **************** I will have to publish a listing of zone names to zone numbers. -- **************** I'm using a repeat/until command to check the current zone every 60 seconds. -- **************** If they are not equal, it calls the transport function for the zone you're in. -- Call main function: function takemeto(mynode_dest) -- **************** first, get some basic info about the ultimate destination for the bot: local match_dest = nil; local myzone_dest = nil; local failures = 0; -- check for the table for destination for k,v in pairs(zoneTable) do if string.find(string.lower(v.nodename), string.lower(mynode_dest), 1, true) then match_dest=v; -- for troubleshooting: printf("Destination set to %s.\n",v.nodename); -- for troubleshooting: printf("match_dest equals %s.\n",match_dest); myzone_dest=v.myzone; break; end end if mynode_dest == nil then return end -- for troubleshooting: printf("match_dest equals %s.\n",match_dest); -- this next part is inside a repeat function. this is so it will continue running this until the current zone matches the bot's ulimate destination zone: repeat local zoneID_current = getZoneId(); --check to see where bot is at now. -- at this point, I know what zone I'm in. local objectList = CObjectList(); objectList:update(); local objSize = objectList:size(); local match_current = nil; local match_found = false; local mynode_current = nil; local myzone_current = nil; local cur_Npc_ID = nil; local obj = nil; local oldx = 0; local oldz = 0; -- for each nearby NPC, I will compare it's ID to the ones in my table for the current zone. for i = 0,objSize do if match_found == true then break end; obj = objectList:getObject(i); -- printf("Found NPC: %s, %s, Zone ID: %s\n",obj.Id,obj.Name,zoneID_current); for k,v in pairs(zoneTable) do -- for troubleshooting: printf("checking tables for row %s\n",v); if match_found == true then break end; if (v.ZNpcID == obj.Id and v.ZoneId == zoneID_current) then -- in COO and Xaviera, there are identically named NPCs (Ailic's Aide) with identical IDs (118020) in the same zone (13 and 14)... -- this statement will get the difference between player and NPC. -- if this difference is greater than 1000, then this is obviously either the wrong NPC, or the player isn't close enough. if (200 > distance(player.X,player.Z,player.Y,v.Npcx,v.Npcz,v.Npcy)) then -- print("First distance check passed"); -- at this point I know I'm close to that particular NPC. -- Now check NPC location compared to NPC location in table to determine if I have the correct NPC for that zone -- if (100 > distance(obj.X,obj.Z,obj.Y,v.Npcx,v.Npcz,v.Npcy)) then -- print("Second distance check passed"); match_current = v; mynode_current = match_current.nodename; myzone_current = match_current.myzone; cur_Npc_ID = match_current.ZNpcID; -- for troubleshooting: printf("Found nearest transport NPC to be %s.\n",obj.Name); if (mynode_current ~= mynode_dest) then player:moveTo(CWaypoint(match_current.Npcx,match_current.Npcz), true); -- ********************************************************** -- ************** Calling transport zone function *********** -- ********************************************************** -- printf("Now calling transport function Node%s\n",match_current.zoneindex); -- for troubleshooting: printf("using following variables:myzone_dest= %s, myzone_current= %s, cur_Npc_ID= %s\n",myzone_dest,myzone_current,cur_Npc_ID) match_found = true; -- Remember last player position player:update() oldx, oldz = player.X, player.Z transfunc[match_current.zoneindex](myzone_dest, myzone_current, cur_Npc_ID); -- the function for the current node is called above. else printf("Not Transporting because current location is %s and destination is %s.\n",mynode_current,mynode_dest); end else printf("Current found NPC is not the one in the database %s.\n",cur_Npc_ID); end -- else printf("Not close enough to nearest Transport NPC: %s.\n",obj.Name); end end end end -- After each teleport, it will run through function again until we are at final destination. -- Check if teleport was successful player:update() if distance(player.X,player.Z,oldx,oldz) > 200 then -- Success failures = 0 else failures = failures + 1 end yrest(500); if failures > 1 then error("Failed twice to teleport to "..mynode_dest); end until myzone_current == myzone_dest printf("Destination reached\n"); -- clear out variables when function complete: end