Angelmelody
(\ /) ( . .)
get the direction from an unit (pc、 npc or mob)
or
set the direction of an unit(pc、 npc or mob)
CMD to use:
getunitdir (<GID>{,<type>});
setunitdir(<GID>,<body direction>{,<head drection>});
the type and head direction param are only available for PC
the value of type 1 means head direction ,otherwise if type =0 or with no type param means body direction
example:
prontera,155,177,5 script testgetdirection 4W_SAILOR,{ if(!.mgid).mgid = bg_monster(1,strnpcinfo(4),157,179, "--ja--",1674,""); mes "your body direction is "+getunitdir(getcharid(3)); mes "your head is "+getunitdir(getcharid(3),1); mes "npc direction is "+getunitdir(getnpcid(0)); mes "mob direction is "+getunitdir(.mgid); next; mes "please input your body direction"; input .@pcbd; next; mes "please input your head direction"; input .@pchd; next; mes "please input npc body direction"; input .@npcbd; next; mes "please input mob body direction"; input .@mobbd; next; setunitdir(getcharid(3),.@pcbd,.@pchd); setunitdir(getnpcid(0),.@npcbd); setunitdir(.mgid,.@mobbd); next; mes "your body direction is "+getunitdir(getcharid(3)); mes "your head is "+getunitdir(getcharid(3),1); mes "npc direction is "+getunitdir(getnpcid(0)); mes "mob direction is "+getunitdir(.mgid); close;}
getunitdir.c
or
set the direction of an unit(pc、 npc or mob)
CMD to use:
getunitdir (<GID>{,<type>});
setunitdir(<GID>,<body direction>{,<head drection>});
the type and head direction param are only available for PC
the value of type 1 means head direction ,otherwise if type =0 or with no type param means body direction
example:
prontera,155,177,5 script testgetdirection 4W_SAILOR,{ if(!.mgid).mgid = bg_monster(1,strnpcinfo(4),157,179, "--ja--",1674,""); mes "your body direction is "+getunitdir(getcharid(3)); mes "your head is "+getunitdir(getcharid(3),1); mes "npc direction is "+getunitdir(getnpcid(0)); mes "mob direction is "+getunitdir(.mgid); next; mes "please input your body direction"; input .@pcbd; next; mes "please input your head direction"; input .@pchd; next; mes "please input npc body direction"; input .@npcbd; next; mes "please input mob body direction"; input .@mobbd; next; setunitdir(getcharid(3),.@pcbd,.@pchd); setunitdir(getnpcid(0),.@npcbd); setunitdir(.mgid,.@mobbd); next; mes "your body direction is "+getunitdir(getcharid(3)); mes "your head is "+getunitdir(getcharid(3),1); mes "npc direction is "+getunitdir(getnpcid(0)); mes "mob direction is "+getunitdir(.mgid); close;}
getunitdir.c
Attachments
Last edited by a moderator: