//Created by Racaae (https://herc.ws/board/topic/20119-is-this-can-be-done/)
- script restricted_item_command HIDDEN_WARP_NPC,{
OnInit:
//== CONF ===========
.command$ = "item3";
.max_qty = 10;
//0 = Whitelist (can only create items in the list below) or
//1 = Blacklist (cannot create items in the list below)
.mode = 1;
//Item list
.items$ = "607,608,1530,2020,2021,2181,2182,2383,2410," +
"2541,2629,2630,5377,";
//===================
bindatcmd .command$,strnpcinfo(3)+"::OnAtcommand";
end;
OnAtcommand:
if (atoi(.@atcmd_parameters$[0]) < 501) {
dispbottom "Please enter an item ID (usage: @" + .command$ + " <item ID> <quantity>

.";
end;
}
.@id = atoi(.@atcmd_parameters$[0]);
.@qty = atoi(.@atcmd_parameters$[1]);
if (.@qty < 1)
.@qty = 1;
if (getitemname(.@id) == "null") {
dispbottom "Invalid item ID.";
end;
}
if (.@qty > .max_qty) {
dispbottom "You can create only " + .max_qty + " at a time.";
end;
}
if (compare(","+.items$+"," , ","+.@id+","))
.@listed = 1;
if ((.mode == 1 && .@listed) || (!.mode && !.@listed)) {
dispbottom "You cannot create " + getitemname(.@id) + ".";
end;
}
getitem .@id, .@qty;
dispbottom "Item created.";
end;
}
//Created by Racaae (https://herc.ws/board/topic/20119-is-this-can-be-done/)
- script restricted_item_command HIDDEN_WARP_NPC,{
OnInit:
//== CONF ===========
.command$ = "item3";
.max_qty = 10;
//0 = Whitelist (can only create items in the list below) or
//1 = Blacklist (cannot create items in the list below)
.mode = 1;
//Item list
.items$ = "607,608,1530,2020,2021,2181,2182,2383,2410," +
"2541,2629,2630,5377,";
//===================
bindatcmd .command$,strnpcinfo(3)+"::OnAtcommand";
end;
OnAtcommand:
if (atoi(.@atcmd_parameters$[0]) < 501) {
dispbottom "Please enter an item ID (usage: @" + .command$ + " <item ID> <quantity>

.";
end;
}
.@id = atoi(.@atcmd_parameters$[0]);
.@qty = atoi(.@atcmd_parameters$[1]);
if (.@qty < 1)
.@qty = 1;
if (getitemname(.@id) == "null") {
dispbottom "Invalid item ID.";
end;
}
if (.@qty > .max_qty) {
dispbottom "You can create only " + .max_qty + " at a time.";
end;
}
if (compare(","+.items$+"," , ","+.@id+","))
.@listed = 1;
if ((.mode == 1 && .@listed) || (!.mode && !.@listed)) {
dispbottom "You cannot create " + getitemname(.@id) + ".";
end;
}
getitem .@id, .@qty;
dispbottom "Item created.";
end;
}