Thread: Porters
View Single Post
  #35  
Old 04-18-2015, 11:17 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 69
Default

Quote:
Originally Posted by Asylum View Post
"So the ghanja's code works, but it sends me to the zone safe spots rather than the druid ring. Would it make sense to add the x,y,z,h values into the $porthash array and call them in a quest::movenpc rather than a quest::zone command?"

You will want to use quest::movepc(zone_id,x,y,z,h) not quest::movenpc because the object you're trying to port is the player character. Just using quest::zone sends to the save coordinates of the zone. Simply run to the druid rings of your destination zone, target yourself, type #loc (NOT /loc unless you like reversing x and y), and use that location in the quest::movepc command. The zone_id portion will accept numbers for the zone IDs or pass it the zone shortname with $text. I haven't searched the plugins folder for it but someone may have made a plugin that converts zone shortname to ID#.
I'm a derp. Should learn to not write code at 2am probably. I actually had the quest::movepc correct in the quasi-working script. Though trying to use those coordinates in my array has resulted in my NPC not responding (even with the movenpc->movepc fixed). Right now I'm trying to dig up an example of pulling multiple values from an array to see where my syntax went sideways. I'm suspect probably this that's breaking it:

Code:
quest::movenpc($porthash{$key}[1],[2],[3],[4],[5]);
Markusdabrave = Perlnoob
Reply With Quote