Code:
- script BmapMobList -1,{
OnInit:
bindatcmd "mapmoblist2", strnpcinfo(0)+"::Onaaa";
end;
Onaaa:
if ( .@atcmd_numparameters ) {
if ( getmapusers(.@atcmd_parameters$) == -1 ) {
dispbottom "Map not exist";
end;
}
.@map$ = .@atcmd_parameters$;
}
else
.@map$ = strcharinfo(3);
.@size = getunits( BL_MOB, .@bl, false, .@map$ );
freeloop true;
for ( .@i = 0; .@i < .@size; ++.@i ) {
.@string$ = rid2name(.@bl[.@i]);
if ( !getd(".@"+ .@string$) ) {
.@mobname$[.@c] = .@string$;
getmapxy .@map$, .@x, .@y, UNITTYPE_MOB, .@bl[.@i];
.@mobx[.@c] = .@x;
.@moby[.@c] = .@y;
.@mobhp[.@c] = getunitdata( .@bl[.@i], UDT_HP );
.@mobmaxhp[.@c] = getunitdata( .@bl[.@i], UDT_MAXHP );
++.@c;
}
setd ".@"+ .@string$, getd(".@"+ .@string$) +1;
}
dispbottom " === These are monsters in "+ .@map$ +" ===";
for ( .@i = 0; .@i < .@c; ++.@i )
if ( getd(".@"+ .@mobname$[.@i]) )
dispbottom ( ++.@j )+". "+ .@mobname$[.@i] +" : "+ getd(".@"+ .@mobname$[.@i])+"x";
if ( getgmlevel() < 99 ) end; // Hercules doesn't catch dead monsters as being alive
dispbottom " === Location of unique monsters === ";
for ( .@i = 0; .@i < .@c; ++.@i )
if ( getd(".@"+ .@mobname$[.@i]) == 1 )
dispbottom .@mobname$[.@i] +" --> X = "+ .@mobx[.@i] +" Y = "+ .@moby[.@i] +" | Hp left = "+ .@mobhp[.@i] +"/"+ .@mobmaxhp[.@i];
end;
}
1. I hope to know how do I make a script to check for only a specific monster count from script without use bindatcmd?
like directly check for specific monster count in a map but not other monster on the same map.
Last edited by a moderator: