viewing paste Unknown #25770 | 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 46 47 48 49 50 51 52
-   script  unbinding_system    FAKE_NPC,{
    OnInit:
        setarray .blacklist_Unbinding[0], 29341, 29484, 29340, 29343, 29454, 29152, 29397;
    end;
    
    OnStartBinding:
        .@boundItemsCount = countbound();
        if(!.@boundItemsCount) {
            message strcharinfo(0), "No unbindable item found in the inventory.";
            end;
        }
        
        for (.@i = 0; .@i < .@boundItemsCount; .@i++) {
            for(.@y = 0; .@y < getarraysize(.blacklist_Unbinding); .@y++)  {
                if(@bound_items[.@i] == .blacklist_Unbinding[.@y]) {
                    message strcharinfo(0), "Unfortunately the item '" + getitemname(@inventorylist_id[.@i]) + "' is blacklisted from being unbound.";
                    end;
                }
            }
        }
        
        getinventorylist();
        .@count_1 = 0;
        .@count_2 = 0;
        .@count_3 = 0;
        .@count_4 = 0;
 
        for(.@i = 0; .@i < @inventorylist_count; .@i++) {
            .@bindType = checkbound(@inventorylist_id[.@i], 0);
            if(!.@bindType || @inventorylist_equip[.@i]) continue;
 
            .@count = getd(".@count_" + .@bindType);
            
            setd ".@itemid_" + .@bindType + "["+.@count+"]", @inventorylist_id[.@i];
            setd ".@name_" + .@bindType + "$["+.@count+"]", getitemname(@inventorylist_id[.@i]);
            setd ".@identify_" + .@bindType + "["+.@count+"]", @inventorylist_identify[.@i];
            setd ".@attrib_" + .@bindType + "["+.@count+"]", @inventorylist_attribute[.@i];
            setd ".@refine_" + .@bindType + "["+.@count+"]", @inventorylist_refine[.@i];
            setd ".@card1_" + .@bindType + "["+.@count+"]", @inventorylist_card1[.@i];
            setd ".@card2_" + .@bindType + "["+.@count+"]", @inventorylist_card2[.@i];
            setd ".@card3_" + .@bindType + "["+.@count+"]", @inventorylist_card3[.@i];
            setd ".@card4_" + .@bindType + "["+.@count+"]", @inventorylist_card4[.@i];
            setd ".@count_" + .@bindType, .@count++;
        }
 
        .@bindType = select("Account Bound:Guild Bound:Party Bound:Character Bound.");
        .@id = select(implode(getd(".@name_" + .@bindType + "$"),":"));
        delitem2 getd(".@itemid_" + .@bindType + "[" + .@id-1 + "]"), 1, getd(".@identify_" + .@bindType + "[" + .@id-1 + "]"),getd(".@refine_" + .@bindType + "[" + .@id-1+ "]"), getd(".@attrib_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card1_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card2_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card3_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card4_" + .@bindType + "[" + .@id-1 + "]");
        getitem2 getd(".@itemid_" + .@bindType + "[" + .@id-1 + "]"), 1, getd(".@identify_" + .@bindType + "[" + .@id-1 + "]"),getd(".@refine_" + .@bindType + "[" + .@id-1+ "]"), getd(".@attrib_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card1_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card2_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card3_" + .@bindType + "[" + .@id-1 + "]"), getd(".@card4_" + .@bindType + "[" + .@id-1 + "]");
        message strcharinfo(0), "Item '"+ getitemname(.@itemid) +"' has been unbound.";
        end;
}
Viewed 837 times, submitted by Guest.