- script asdfh FAKE_NPC,{
OnCmd:
if (!.@atcmd_numparameters || .@atcmd_numparameters != 2) {
message strcharinfo(0), "Usage: @itemshower <item_id> <item_quantity>";
end;
}
.@item = atoi(.@atcmd_parameters$[0]);
.@q = atoi(.@atcmd_parameters$[1]);
if (!.@q || getitemname(.@item) == "null") {
message strcharinfo(0), "Invalid item/amount";
end;
}
getmapxy .@map$, .@x, .@y, UNITTYPE_PC;
.@i = 0;
while (.@i < .@q) {
do {
.@a = rand(.@x, .@x+200);
.@b = rand(.@y, .@y+200);
} while (!checkcell(.@map$, .@a, .@b, cell_chkpass));
makeitem .@item, 1, .@map$, .@a, .@b;
.@i++;
}
end;
OnInit:
bindatcmd "itemshower", strnpcinfo(3) + "::OnCmd", 99, 99, true;
end;
}