diff options
author | Joseph Botosh <rumly111@gmail.com> | 2015-09-26 22:03:53 +0300 |
---|---|---|
committer | Joseph Botosh <rumly111@gmail.com> | 2015-09-26 22:03:53 +0300 |
commit | 7d9ff5688fa1065e1a609f870ac7ff1469e2fad9 (patch) | |
tree | e669486e123035720926091d4b14d5dacf941e58 /npc | |
parent | fbc3d6d0c4c8e6a56f07dc8b70882f975b1f7bf2 (diff) | |
download | serverdata-7d9ff5688fa1065e1a609f870ac7ff1469e2fad9.tar.gz serverdata-7d9ff5688fa1065e1a609f870ac7ff1469e2fad9.tar.bz2 serverdata-7d9ff5688fa1065e1a609f870ac7ff1469e2fad9.tar.xz serverdata-7d9ff5688fa1065e1a609f870ac7ff1469e2fad9.zip |
add sit and stand commands to movegraph, extend warp command
Diffstat (limited to 'npc')
-rw-r--r-- | npc/functions/npcmovegraph.txt | 25 |
1 files 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 |