//function script unbind {
- script unbinding_system -1,{
OnStartBinding:
set .id, 29990; // or any item id that would correspond to your item/scroll that you wish to use.
setarray .itemid[0],0;
setarray .name$[0],"";
setarray .identify[0],0;
setarray .attrib[0],0;
setarray .refine[0],0;
setarray .card1[0],0;
setarray .card2[0],0;
setarray .card3[0],0;
setarray .card4[0],0;
getinventorylist;
// Item IDs that cannot be bound
setarray .@blacklist[0], 1201, 1207, 2301;
// Check blacklist
for (.@i = 0; .@i < getarraysize(.@blacklist); .@i++) {
if (@inventorylist_id[.@item] == .@blacklist[.@i]) {
mes "Sorry, but "+ getitemname(@inventorylist_id[.@item]) +" is blacklisted from being bound.";
close;
}
}
set @count,0;
for(set @i, 0; @i <@inventorylist_count; set @i, @i + 1)
{
if(@inventorylist_bound[@i] && @inventorylist_equip[@i]==0)
{
set .itemid[@count], @inventorylist_id[@i];
set .name$[@count], getitemname(@inventorylist_id[@i]);
set .identify[@count], @inventorylist_identify[@i];
set .attrib[@count], @inventorylist_attribute[@i];
set .refine[@count], @inventorylist_refine[@i];
set .card1[@count], @inventorylist_card1[@i];
set .card2[@count], @inventorylist_card2[@i];
set .card3[@count], @inventorylist_card3[@i];
set .card4[@count], @inventorylist_card4[@i];
set @count,@count+1;
}
}
if(getarraysize(.itemid)==0)
{
message strcharinfo(0), "No unbindable item found in the inventory.";
end;
}
else
{
set @id, select(implode(.name$,":"));
delitem2 .itemid[@id-1],1,.identify[@id-1],.refine[@id-1],.attrib[@id-1],.card1[@id-1],.card2[@id-1],.card3[@id-1],.card4[@id-1];
getitem2 .itemid[@id-1],1,.identify[@id-1],.refine[@id-1],.attrib[@id-1],.card1[@id-1],.card2[@id-1],.card3[@id-1],.card4[@id-1];
delitem .id,1;
message strcharinfo(0), "Item has been unbinded.";
end;
}
}