-- Got my initial tests working. Logar to Varanas, to Silverfall, and Varanas Lower City west. -- Had some things I had to put in statically to get to work, but it's working. -- Now time to continue getting numbers for rest of NPCs and zones. -- For a user to sue this function in a waypoint, -- they would get somewhat near the Trasport NPC and use: -- takemeto("destination") -- where "destination" is a set name for the Zone they want to go to (Varanas, Logar, VaranasClassHall, Silverfall, Obsidian, WeepingCoast, Frontline, etc...). -- ** The location names are defined in the following table in the "nodename=" section. -- (I will publish all the zone names to use with the userfunction) -- *************** First, I need to create a table with all the relevant info in it. local zoneTable = {[1] = {zoneindex=1, ZoneId=1, myzone=1000, nodename="Logar", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-1163, Npcz=-5535, Npcy=36}, [2] = {zoneindex=2, ZoneId=2, myzone=2000, nodename="VaranasSnoop", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=2307, Npcz=1152, Npcy=0}, [3] = {zoneindex=3, ZoneId=2, myzone=3000, nodename="VaranasBridge", Npcname="Lieve", ZNpcID=110755, Npcx=2767, Npcz=956, Npcy=54}, [4] = {zoneindex=4, ZoneId=2, myzone=4000, nodename="VaranasWest", Npcname="Bareve", ZNpcID=110728, Npcx=2908, Npcz=-798, Npcy=56}, [5] = {zoneindex=5, ZoneId=2, myzone=5000, nodename="VaranasClassHall", Npcname="Bareve", ZNpcID=110728, Npcx=5271, Npcz=-3896, Npcy=60}, [6] = {zoneindex=6, ZoneId=2, myzone=6000, nodename="VaranasEast", Npcname="Dieve", ZNpcID=110727, Npcx=2900, Npcz=-800, Npcy=57}, [7] = {zoneindex=7, ZoneId=2, myzone=7000, nodename="VaranalCentral", Npcname="Noreve", ZNpcID=110726, Npcx=4747, Npcz=-1971, Npcy=115}, [8] = {zoneindex=8, ZoneId=2, myzone=8000, nodename="VaranasGuildHall", Npcname="Novia", ZNpcID=110561, Npcx=6364, Npcz=-3104, Npcy=60}, [9] = {zoneindex=9, ZoneId=2, myzone=9000, nodename="HallofEyeofWisdon", Npcname="Mevay", ZNpcID=111339, Npcx=6929, Npcz=-2491, Npcy=58}, [10] = {zoneindex=10, ZoneId=4, myzone=10000, nodename="Silverfall", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-5913, Npcz=2867, Npcy=598}, [11] = {zoneindex=11, ZoneId=5, myzone=11000, nodename="HarfTradingPost", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-14459, Npcz=-150, Npcy=755}, [12] = {zoneindex=12, ZoneId=11, myzone=12000, nodename="DragonfangRidge", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-29438, Npcz=-17657, Npcy=250}, [13] = {zoneindex=13, ZoneId=10, myzone=13000, nodename="AyrenCaravan", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-38733, Npcz=1545, Npcy=1}, [14] = {zoneindex=14, ZoneId=10, myzone=14000, nodename="Reifort", Npcname="Ailic's Aide", ZNpcID=118586, Npcx=-29471, Npcz=1190, Npcy=-544}, [15] = {zoneindex=15, ZoneId=6, myzone=15000, nodename="ObsidianStronghold", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-20458, Npcz=6519, Npcy=-188}, [16] = {zoneindex=16, ZoneId=6, myzone=15800, nodename="BattleSquare", Npcname="Maylee", ZNpcID=110530, Npcx=-20782, Npcz=6214, Npcy=-226}, [17] = {zoneindex=17, ZoneId=6, myzone=16000, nodename="TradeSquare", Npcname="Mayren", ZNpcID=110944, Npcx=-22819, Npcz=2679, Npcy=-179}, [18] = {zoneindex=18, ZoneId=6, myzone=17000, nodename="GlorySquare", Npcname="Maylen", ZNpcID=110805, Npcx=-23203, Npcz=4489, Npcy=-260}, [19] = {zoneindex=19, ZoneId=6, myzone=18000, nodename="CraftingSquare", Npcname="Maya", ZNpcID=110532, Npcx=-23631, Npcz=5814, Npcy=-260}, [20] = {zoneindex=20, ZoneId=6, myzone=19000, nodename="MercenarySquare", Npcname="Macy", ZNpcID=110531, Npcx=-22001, Npcz=3636, Npcy=-179}, [21] = {zoneindex=21, ZoneId=6, myzone=19900, nodename="ObsidianDalanisEnvoy", Npcname="Hajikar Mashes", ZNpcID=114777, Npcx=-20597, Npcz=4183, Npcy=-172}, [22] = {zoneindex=22, ZoneId=3, myzone=20000, nodename="AbandonedFortress", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=13868, Npcz=6768, Npcy=27}, [23] = {zoneindex=23, ZoneId=7, myzone=21000, nodename="WeepingCoast", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=19647, Npcz=21909, Npcy=10}, [24] = {zoneindex=24, ZoneId=8, myzone=22000, nodename="SavageLands", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=5939, Npcz=20618, Npcy=219}, [25] = {zoneindex=25, ZoneId=9, myzone=23000, nodename="AotuliaVolcano", Npcname="Snoop the Stubborn", ZNpcID=111256, Npcx=-11317, Npcz=26312, Npcy=972}, [26] = {zoneindex=26, ZoneId=15, myzone=24000, nodename="DalanisObsidianEnvoy", Npcname="Arina Kaiyinth", ZNpcID=114776, Npcx=-4672, Npcz=7595, Npcy=107}, [27] = {zoneindex=27, ZoneId=15, myzone=30000, nodename="Dalanis", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=-4282, Npcz=5088, Npcy=7}, [28] = {zoneindex=28, ZoneId=16, myzone=31000, nodename="SouthernJanost", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=-6017, Npcz=21630, Npcy=-148}, [29] = {zoneindex=29, ZoneId=17, myzone=32000, nodename="NorthernJanost", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=3563, Npcz=31618, Npcy=112}, [30] = {zoneindex=30, ZoneId=18, myzone=33000, nodename="LimoDesert", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=3074, Npcz=47621, Npcy=84}, [31] = {zoneindex=31, ZoneId=19, myzone=34000, nodename="LandofMalevolence", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=-2893, Npcz=49657, Npcy=118}, [32] = {zoneindex=32, ZoneId=20, myzone=35000, nodename="RedhillMountains", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=-16459, Npcz=41043, Npcy=610}, [33] = {zoneindex=33, ZoneId=21, myzone=36000, nodename="TergothenBay", Npcname="Snoop the Stubborn", ZNpcID=114353, Npcx=-26309, Npcz=29777, Npcy=-98}, [34] = {zoneindex=34, ZoneId=13, myzone=40000, nodename="Heffner", Npcname="Snoop the Stubborn", ZNpcID=118002, Npcx=-6336, Npcz=-3913, Npcy=162}, [35] = {zoneindex=35, ZoneId=13, myzone=41000, nodename="Lyonside", Npcname="Ailic's Aide", ZNpcID=118020, Npcx=50, Npcz=-1137, Npcy=137}, [36] = {zoneindex=36, ZoneId=13, myzone=42000, nodename="DesertInvestigation", Npcname="Ailic's Aide", ZNpcID=118020, Npcx=-7413, Npcz=1191, Npcy=615}, [37] = {zoneindex=37, ZoneId=13, myzone=43000, nodename="FangersMakeshift", Npcname="Ailic's Aide", ZNpcID=118020, Npcx=2, Npcz=5036, Npcy=686}, [38] = {zoneindex=38, ZoneId=14, myzone=44000, nodename="RuinsResearch", Npcname="Snoop the Stubborn", ZNpcID=118002, Npcx=989, Npcz=13370, Npcy=326}, [39] = {zoneindex=39, ZoneId=14, myzone=45000, nodename="Jinners", Npcname="Ailic's Aide", ZNpcID=118020, Npcx=12879, Npcz=1939, Npcy=52}, [40] = {zoneindex=40, ZoneId=14, myzone=46000, nodename="FrontLine", Npcname="Ailic's Aide", ZNpcID=118020, Npcx=6777, Npcz=6312, Npcy=92} } -- 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 set name for that particular transportNPC to use with the takemeto() function. -- **************************************Zone functions follow **************************************************** -- if in Logar it should call the Node1000 function. -- if in Varanas, it should call the Node2000 function, -- if at Varanas Bridge, it should call the Node2100 function. -- if in Silverfall, it should call the Node10000 function. -- etc, etc, etc... -- ****************Each zone will have it's own function for how to handle teleports. Here are a couple examples that clearly need to be written correctly: -- This is the Logar Node function Node1(myzone_dest, myzone_current, cur_Npc_ID) -- Need to build out process of transporting. -- Need to build out proper if/thens for figuring out where to transport to. print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, "Varanas"); --****************Is it "Silverspring" or "Varanas"? Need to lookup and fix. end -- This is the Varanas Snoop node function Node2(myzone_dest, myzone_current, cur_Npc_ID) if (myzone_current > myzone_dest) then-- anything less than current has to be Logar print("Now Transporting to Logar"); NPCTeleport(cur_Npc_ID, "Logar"); elseif (myzone_dest > 39999) then -- anything 40000 or up must be through Heffner print("Now Transporting to Heffner"); NPCTeleport(cur_Npc_ID, "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, "Obsidian"); elseif (myzone_dest > 19999) then -- 20000 is Abandoned Fortress print("Now Transporting to Abandoned Fortress"); NPCTeleport(cur_Npc_ID, "Fortress"); elseif (myzone_dest > 14999) then -- 15000 is Obsidian Stronghold print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, "Obsidian"); elseif (myzone_dest > 11999) then -- 14000 is Reifort print("Now Transporting to Reifort"); NPCTeleport(cur_Npc_ID, "Reifort"); elseif (myzone_dest > 9999) then -- 10000 is Silverfall and Harf print("Now Transporting to Silverfall"); NPCTeleport(cur_Npc_ID, "Silverfall"); elseif (myzone_dest > 2999) then -- 3000 through 9999 is for Varanas Bridge and City so need to go to that NPC. -- d = 3; -- index for Lieve at Varanas Bridge is 3. print("Now Moving to Varanas City Transporter..."); -- player:moveTo(CWaypoint(d.Npcx,d.Npcz), true); -- after moving to that location, the function will run again using the correct zone3 function to use with Lieve. -- the above didn't work, cant figure out easy way to grab from table, so going direct route... 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 > 4999) then -- 5000 is Varanas Class Hall. Any other varanas locations besides West will go here first. print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, "Class"); elseif (myzone_dest > 3999) then -- 4000 is Varanas Lower City West print("Now Transporting to Lower City West"); NPCTeleport(cur_Npc_ID, "West"); end -- That should cover all the options for Varanas Locations from bridge. 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, "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, "Wisdom"); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, "Guild"); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, "Central"); elseif myzone_dest > 5999 then -- 6000 is Lower City East print("Now Transporting to Lower City East"); NPCTeleport(cur_Npc_ID, "East"); elseif myzone_dest > 4999 then -- 5000 is Class Hall print("Now Transporting to Class Hall"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "Wisdom"); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, "Guild"); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, "Central"); elseif myzone_dest > 5999 then -- 6000 is Lower City East print("Now Transporting to Lower City East"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "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, "Wisdom"); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, "Guild"); elseif myzone_dest > 6999 then -- 7000 is Central Plaza print("Now Transporting to Central Plaza"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "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, "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, "Wisdom"); elseif myzone_dest > 7999 then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "Central"); elseif 9000 > myzone_dest then -- anything 8000 or up must be Guild Hall print("Now Transporting to Guild Hall"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "Silverfall"); elseif myzone_dest > 23999 then -- anything else above 23999 go to OS node print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, "Obsidian"); elseif myzone_dest > 19999 then -- anything else above 19999 go to Silverfall node print("Now Transporting to Silverfall"); NPCTeleport(cur_Npc_ID, "Silverfall"); elseif myzone_dest > 13999 then -- anything else above 13999 go to OS node print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "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, "Harf"); elseif myzone_dest > 12999 then -- anything else above 12999 go to Ayren Caravan print("Now Transporting to Ayren Caravan"); NPCTeleport(cur_Npc_ID, "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 (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, "Obsidian"); elseif myzone_dest > 13999 then -- anything else above 13999 (Reifort) go to Reifort node print("Now Transporting to Reifort"); NPCTeleport(cur_Npc_ID, "Reifort"); elseif 1300 > myzone_dest then -- anything else below 1300 go to Lyk print("Now Transporting to Dragonfang Ridge"); NPCTeleport(cur_Npc_ID, "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, "Varanas"); elseif myzone_dest > 23999 then -- anything else above 23999 go to Obsidian print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, "Obsidian"); elseif myzone_dest > 19999 then -- Anything else above 19999 will go to Varanas. print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, "Varanas"); elseif myzone_dest > 14999 then -- anything else above 14999 go to Obsidian print("Now Transporting to Obsidian Stronghold"); NPCTeleport(cur_Npc_ID, "Obsidian"); elseif 1300 > myzone_dest then -- anything else below 1300 go to Lyk print("Now Transporting to Dragonfang Ridge"); NPCTeleport(cur_Npc_ID, "Lyk"); elseif 14000 > myzone_dest then -- anything else below 14000 go to Ayren print("Now Transporting to Ayren Caravan"); NPCTeleport(cur_Npc_ID, "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 (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, "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, "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, "Harf"); elseif 14000 > myzone_dest then -- anything else below 14000 go to Ayren print("Now Transporting to Ayren Caravan"); NPCTeleport(cur_Npc_ID, "Ayren"); elseif 15000 > myzone_dest then -- anything else below 15000 go to Reifort print("Now Transporting to Reifort"); NPCTeleport(cur_Npc_ID, "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, "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, "Mercenary"); elseif myzone_dest > 17999 then -- anything else above 17999 go to Crafting Square print("Now Transporting to Crafting Square"); NPCTeleport(cur_Npc_ID, "Crafting"); elseif myzone_dest > 16999 then -- anything else above 16999 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, "Glory"); elseif myzone_dest > 15999 then -- anything else above 15999 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, "Trade"); end end -- This is the Trade Square node function Node17(myzone_dest, myzone_current, cur_Npc_ID) if (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, "Battle"); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, "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, "Battle"); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, "Mercenary"); elseif myzone_dest > 17999 then -- anything else above 17999 go to Crafting Square print("Now Transporting to Crafting Square"); NPCTeleport(cur_Npc_ID, "Crafting"); elseif myzone_dest > 16999 then -- anything else above 16999 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, "Glory"); end end -- This is the Glory Square node function Node18(myzone_dest, myzone_current, cur_Npc_ID) if (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, "Battle"); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, "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, "Battle"); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, "Mercenary"); elseif myzone_dest > 17999 then -- anything else above 17999 go to Crafting Square print("Now Transporting to Crafting Square"); NPCTeleport(cur_Npc_ID, "Crafting"); elseif 17000 > myzone_dest then -- anything else below 17000 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, "Trade"); end end -- This is the Crafting Square node function Node19(myzone_dest, myzone_current, cur_Npc_ID) if (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, "Battle"); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, "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, "Battle"); elseif myzone_dest > 18999 then -- anything else above 18999 go to Mercenary Square print("Now Transporting to Mercenary Square"); NPCTeleport(cur_Npc_ID, "Mercenary"); elseif 17000 > myzone_dest then -- anything else below 17000 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, "Trade"); elseif 18000 > myzone_dest then -- anything else below 18000 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, "Glory"); end end -- This is the Mercenary Square node function Node20(myzone_dest, myzone_current, cur_Npc_ID) if (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, "Battle"); elseif myzone_dest > 23999 then -- anything else above 23999 go to Mercenary Square print("This function not yet available"); -- ******************************************************************************************** -- player:moveTo(CWaypoint(-20458,6519), true); ***Need to add waypoints to move to envoy -- ******************************************************************************************** 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, "Battle"); elseif 17000 > myzone_dest then -- anything else below 17000 go to Trade Square print("Now Transporting to Trade Square"); NPCTeleport(cur_Npc_ID, "Trade"); elseif 18000 > myzone_dest then -- anything else below 18000 go to Glory Square print("Now Transporting to Glory Square"); NPCTeleport(cur_Npc_ID, "Glory"); elseif 19000 > myzone_dest then -- anything else below 19000 go to Crafting Square print("Now Transporting to CraftingSquare"); NPCTeleport(cur_Npc_ID, "Crafting"); end end -- This is the Obsidian to Dalanis Envoy node function Node21(myzone_dest, myzone_current, cur_Npc_ID) if (19900 > myzone_dest) or (myzone_dest > 39999) then -- Anything below This location or above Heffner will go to Battle Square via Marcenary Square print("This function not yet available"); -- ******************************************************************************************** -- player:moveTo(CWaypoint(-20458,6519), true); ***Need to add waypoints to move from envoy back to Mercenary Square -- ******************************************************************************************** elseif myzone_dest > 23999 then -- Anything above 23999 Transports to Dalanis print("Now Transporting to Dalanis"); NPCTeleport(cur_Npc_ID, "Please send me"); elseif myzone_dest > 19999 then -- Anything above 19999 Transports to Varanas via Mercenary Square print("This function not yet available"); -- ******************************************************************************************** -- player:moveTo(CWaypoint(-20458,6519), true); ***Need to add waypoints to move from envoy back to Mercenary Square -- ******************************************************************************************** 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, "Varanas"); elseif (myzone_dest > 20999) then -- anything 21000 or up must be through Weeping Coast print("Now Transporting to WeepingCoast"); NPCTeleport(cur_Npc_ID, "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, "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, "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, "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, "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, "Green"); end end -- This is the Dalanis to Obsidian Envoy node function Node26(myzone_dest, myzone_current, cur_Npc_ID) if (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, "Please send me"); elseif myzone_dest > 29999 then -- Anything above 29999 will walk to Dalanis Snoop print("This function not yet available"); -- ******************************************************************************************** -- player:moveTo(CWaypoint(-20458,6519), true); ***Need to add waypoints to move from envoy to Snoop -- ******************************************************************************************** end end -- This is the Dalanis Snoop node function Node27(myzone_dest, myzone_current, cur_Npc_ID) if (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(-20458,6519), true); ***Need to add waypoints to move from Snoop to Envoy -- ******************************************************************************************** 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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "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, "Fireboot"); end end -- This is the Heffner node function Node34(myzone_dest, myzone_current, cur_Npc_ID) if (myzone_current > myzone_dest) then-- anything less than current has to be Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, "Varanas"); elseif (myzone_dest > 40999) then -- anything 41000 or up must be through Lyonside print("Now Transporting to Lyonside Camp"); NPCTeleport(cur_Npc_ID, "Lyonside"); end end -- This is the Lyonside node function Node35(myzone_dest, myzone_current, cur_Npc_ID) if (myzone_current > myzone_dest) then-- anything less than current has to be Heffner print("Now Transporting to Heffner"); NPCTeleport(cur_Npc_ID, "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, "Investigation"); end end -- This is the Desert Investigation Post node function Node36(myzone_dest, myzone_current, cur_Npc_ID) if (myzone_current > myzone_dest) then-- anything less than current has to be Lyonside print("Now Transporting to Lyonside"); NPCTeleport(cur_Npc_ID, "Lyonside"); 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, "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, "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, "Investigation"); end end -- This is the Ruins Research Camp node function Node38(myzone_dest, myzone_current, cur_Npc_ID) if (41000 > myzone_dest) then-- anything less than 41000 should go back to Varanas print("Now Transporting to Varanas"); NPCTeleport(cur_Npc_ID, "Varanas"); 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, "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, "Jinner"); end end -- This is the Jinner's Camp node function Node39(myzone_dest, myzone_current, cur_Npc_ID) if (45000 > myzone_dest) then-- anything less than 45000 should go back to Ruins Research print("Now Transporting to Ruins Research Camp"); NPCTeleport(cur_Npc_ID, "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, "Front"); end end -- Set my local functions 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}; -- uses my index (table.zoneindex) for the nodes. I need one of these for each node and then -- I will also create each of these functions... functions are now jsut above this section. Currently doen up through node 25. -- **************** 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. -- **************** first, get some basic info about the ultimate destination for the bot: function takemeto(mynode_dest) -- get "myzone" of destination: local match_dest = nil; local myzone_dest = nil; -- how do I check for the table before doing this? for k,v in pairs(zoneTable) do if (v.nodename == mynode_dest) then -- how do I check for string.lowercase or whatever? Until then, case must match. match_dest=v; printf("Destination set to %s.\n",v.nodename); printf("match_dest equals %s.\n",match_dest); myzone_dest=v.myzone; break; end end -- printf("match_dest equals %s.\n",match_dest); -- at this point I have matched the destination name from the waypoint to the correct row in the table. -- now I will get the zone number to use in rest of functions: **actually, I don;'t think I need this so commented out. Using match_dest instead. -- if (match_dest) then -- local index_destination = match_dest.zoneindex; -- end; -- 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. -- what if there are multiple transport NPCs in this area (like with Snoop and Lieve in Varanas)? I need to find out which one I'm closest to. local objectList = CObjectList(); objectList:update(); local objSize = objectList:size(); local match_current = nil; local match_found = false; local obj = nil; -- 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 Object ID: %s, Zone ID: %s\n",obj.Id,zoneID_current); for k,v in pairs(zoneTable) do -- printf("checking tables for row %s\n",v); if match_found == true then break end; -- printf("NPC ID: %s, Found Object ID: %s, Zone ID: %s, zoneID_current is %s\n",v.ZNpcID,obj.Id,v.ZoneId,zoneID_current); 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)... -- I will need to use location to differentiate between them: -- this statement will get the difference between player x and NPC x and add it to difference of y. -- if this total difference is greater than 1000, then this is obviously either the wrong NPC, or the player isn't close enough. -- might have to play with this a bit to get it to work. if (1000 > distance(player.X,player.Z,player.Y,v.Npcx,v.Npcz,Npcy)) then match_current = v; mynode_current = match_current.nodename; myzone_current = match_current.myzone; cur_Npc_ID = match_current.ZNpcID; printf("Found nearest transport NPC to be %s.\n",match_current.Npcname); 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); match_found = true; 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("Not close enough to nearest Transport NPC: %s.\n",obj.Name); end end end end -- Now I will compare current location with ultimate destination to determine if I need to move, and if so, call function for current node to initiate a move. -- After each teleport, it will run through function again until we are at final destination. -- It will then repeat the function until the current node == the final destination node. yrest(2000); until mynode_current == mynode_dest end