sorax Posted February 4, 2013 Posted February 4, 2013 1. is it possble to create the script that let the user to adjust npc position without change it in script. and the make npc remember it new position. ( via database or permanent global var ) 2. is there anyway to do something like "NPC Scroll" when user use the scroll -> place npc to that location. Quote
AnnieRuru Posted February 4, 2013 Posted February 4, 2013 the npc CAN move outside the map with unitwarp + getnpcid prontera,155,187,5 script dsasda 100,{ .@map$ = strnpcinfo(4); npctalk "I am currently in "+ .@map$; sleep 1000; if ( .@map$ == "prontera" ) unitwarp getnpcid(0), "morocc",156,93; else if ( .@map$ == "morocc" ) unitwarp getnpcid(0), "prontera", 156,191; end; } move to script support btw 2 Quote
Euphy Posted February 4, 2013 Posted February 4, 2013 An NPC can move anywhere within a map, but not outside of it -- you need duplicates for that. // Generic 'movenpc' command. movenpc strnpcinfo(0),x,y; // Script command. { getmapxy(.@map$,.@x,.@y,0); if (.@map$ == "your_map") movenpc "NPC Name",.@x,.@y; } // Store NPC location permanently. getmapxy(.@map$,.@x,.@y,1); set $move_npc_loc$, .@map$+"|"+.@x+"|"+.@y; end; // Load NPC location OnInit. OnInit: if ($move_npc_loc$ != "") { explode(.@loc$,$move_npc_loc$,"|") movenpc strnpcinfo(0),.@loc$[0],atoi(.@loc$[1]),atoi(.@loc$[2]); } Quote
Aly Posted February 5, 2013 Posted February 5, 2013 or you can use this: http://www.eathena.ws/board/index.php?showtopic=270648 maybe it needs an update... I found errors with NPCs that use the OnInit label with this command (maybe it can't duplicate OnInit labels, i don't know) but it's a very useful command in many ways. ( btw, maybe someone can confirm the bug and fix it... ^^ ) Quote
sorax Posted February 5, 2013 Author Posted February 5, 2013 thanks you everyone . i'll try it. Quote
Brian Posted February 6, 2013 Posted February 6, 2013 (edited) the npc CAN move outside the map with unitwarp + getnpcid I learned something new today! If it's that easy, we should change movenpc to allow "map",x,y Edit: I searched /npc and it's only used in 1 script, so the main issue would be notifying users of the change so they can update their custom scripts. Search "movenpc" (2 hits in 1 file) D:\svn\rathena\trunk\npc\pre-re\other\arena\arena_room.txt (2 hits) Line 762: movenpc "#arena_"+$@arenapic+"",96,28; Line 1025: movenpc "#arena_"+$@arenapic+"",1,1; Edited February 6, 2013 by Brian 1 Quote
AnnieRuru Posted February 7, 2013 Posted February 7, 2013 I believe there are certain kinds of tricks here shouldn't be adding into SVN like while(!getmapxy) or attachrid-all-accounts there is a limit of npc can be having on a map #define MAX_NPC_PER_MAP 512doing something like this is just like a trickas this is able to bypass the numbers of npc having on a map example, when try @mapinfo, if you have 1 npc original from prontera, and 1 npc move from morocc into prontera @mapinfo in prontera tells you only having 1 npc, but actually having 2 Quote
fbrulz Posted February 7, 2013 Posted February 7, 2013 (edited) can we make the npc move only with in a specified cell range? i mean sm thing like we set a cage and it will move only within those coordinates not outside those specified coordinates. Edited February 7, 2013 by fbrulz Quote
Emistry Posted February 14, 2013 Posted February 14, 2013 like this ? http://pastebin.com/raw.php?i=FssaCcmX refer npcwalkto , npcspeed Quote
Question
sorax
1.
is it possble to create the script that let the user to adjust npc position without change it in script.
and the make npc remember it new position. ( via database or permanent global var )
2.
is there anyway to do something like "NPC Scroll" when user use the scroll -> place npc to that location.
9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.