From 7d9ff5688fa1065e1a609f870ac7ff1469e2fad9 Mon Sep 17 00:00:00 2001 From: Joseph Botosh Date: Sat, 26 Sep 2015 22:03:53 +0300 Subject: add sit and stand commands to movegraph, extend warp command --- npc/functions/npcmovegraph.txt | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/npc/functions/npcmovegraph.txt b/npc/functions/npcmovegraph.txt index 1db945fb..dedd14fe 100644 --- a/npc/functions/npcmovegraph.txt +++ b/npc/functions/npcmovegraph.txt @@ -98,6 +98,14 @@ function script execmovecmd { { setnpcdir atoi(.@cmd$[1]); } + else if (.@cmd$[0] == "sit") + { + npcsit; + } + else if (.@cmd$[0] == "stand") + { + npcstand; + } else if (.@cmd$[0] == "wait") { set getvariableofnpc(.waitticks, strnpcinfo(3)), atoi(.@cmd$[1]); @@ -113,10 +121,23 @@ function script execmovecmd { } else if (.@cmd$[0] == "warp") { - .@pos = findmovegraphlabel(.@cmd$[1]); + .@pos = -1; + .@map$ = ""; + .@pos_idx = 1; + if (getarraysize(.@cmd$) == 3) + { + .@map$ = .@cmd$[1]; + .@pos_idx = 2; + } + .@pos = findmovegraphlabel(.@cmd$[.@pos_idx]); if (.@pos > 0) { - movenpc strnpcinfo(3), getvariableofnpc(.movepos_x1[.@pos], strnpcinfo(3)), getvariableofnpc(.movepos_y1[.@pos], strnpcinfo(3)); + .@x = getvariableofnpc(.movepos_x1[.@pos], strnpcinfo(3)); + .@y = getvariableofnpc(.movepos_y1[.@pos], strnpcinfo(3)); + if (getstrlen(.@map$) > 0) + unitwarp getnpcid(0), .@map$, .@x, .@y; + else + movenpc strnpcinfo(3), .@x, .@y; set getvariableofnpc(.movepos, strnpcinfo(3)), .@pos; } else -- cgit v1.2.3-70-g09d2