I am trying to use the unitattack command to a player using bindatcmd. Unfortunately, I can't make it work. I can get the GID of the mob that is close to my character. Can anyone help me please? Thanks!
- script test_bot -1,{
OnInit:
bindatcmd "testsc",strnpcinfo(3) + "::OnAtcommand";
end;
OnAtcommand:
if (getgroupid() > 90) {
getmapxy(.@m$,.@x0,.@y0,BL_PC);
.@plusx = .@x0 + 5;
.@plusy = .@y0 + 5;
.@minx = .@x0 - 5;
.@miny = .@y0 - 5;
dispbottom .@m$ + " " + .@x0 + " " + .@y0;
.@num = getareaunits(BL_MOB,.@m$,.@plusx,.@plusy,.@minx,.@miny,.@array[0]);
dispbottom "the number of Monsters in Prontera in that Coordinates is " + .@num + " .";
dispbottom "list of Monsters GID :";
freeloop(1); // for if the list was too big.
for(.@i=0;.@i<getarraysize(.@array);.@i++) {
dispbottom (.@i + 1) + " " + .@array[.@i];
//unitskilluseid getcharid(3),"WL_JACKFROST",5,getcharid(3),-4;
unitattack getcharid(3),.@array[.@i];
unitattack 0,.@array[.@i];
}
freeloop(0);
dispbottom "end";
end;
} else {
dispbottom "Currently for testing only.";
end;
}
}
Question
noblesse
Hello,
I am trying to use the unitattack command to a player using bindatcmd. Unfortunately, I can't make it work. I can get the GID of the mob that is close to my character. Can anyone help me please? Thanks!
Link to comment
Share on other sites
3 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.