viewing paste Unknown #25765 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
-   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;
        }
}
Viewed 859 times, submitted by Guest.