- script unbinding_system FAKE_NPC,{
OnInit:
.item_Binding = 29990;
setarray .blacklist_Unbinding[0], 29341, 29484, 29340, 29343, 29454, 29152, 29397;
end;
OnStartBinding:
getinventorylist();
for (.@i = 0; .@i < @inventorylist_count; .@i++) {
for(.@y = 0; .@y < getarraysize(.blacklist_Unbinding); .@y++) {
if(@inventorylist_id[.@i] == .blacklist_Unbinding[.@y]) {
message strcharinfo(0), "Unfortunately the item '" + getitemname(@inventorylist_id[.@i]) + "' is blacklisted from being bound.";
end;
}
}
}
.@count = 0;
for(.@i = 0; .@i < @inventorylist_count; .@i++) {
if(@inventorylist_bound[@i] && @inventorylist_equip[.@i] == 0) {
.@itemid[.@count] = @inventorylist_id[.@i];
.@name$[.@count] = getitemname(@inventorylist_id[.@i]);
.@identify[.@count] = @inventorylist_identify[.@i];
.@attrib[.@count] = @inventorylist_attribute[.@i];
.@refine[.@count] = @inventorylist_refine[.@i];
.@card1[.@count] = @inventorylist_card1[.@i];
.@card2[.@count] = @inventorylist_card2[.@i];
.@card3[.@count] = @inventorylist_card3[.@i];
.@card4[.@count] = @inventorylist_card4[.@i];
.@count++;
}
}
if(getarraysize(.@itemid) == 0) {
message strcharinfo(0), "No unbindable item found in the inventory.";
end;
} else {
.@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 .item_Binding,1;
message strcharinfo(0), "Item '"+ getitemname(.@itemid) +"' has been unbinded.";
end;
}
}