viewing paste Backpack | Athena

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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161
//===================================
//Made  :   Goddameit              //
//===================================
function    script  Backpack    {
getitem getarg(0),1;
set @ve,getarg(1);
set @select$,"";
set @select2$,"";
set @nu,0;
set @i,0;
set @j,0;
set @w,0;
set @maxnu,getarg(2);
set @maxwi,getarg(3);
mes "Backpack:Lv."+@ve;
for(set @i,1;@i<=@maxnu;set @i,@i+1){
    set @select$,@select$+"["+getitemname(getd("bpdataid"+@i+"_"+@ve))+"]^000000x["+getd("bpdatanu"+@i+"_"+@ve)+"]:";
    if(getd("bpdatanu"+@i+"_"+@ve)){set .@yy,.@yy+1;}
}
set @select$,@select$+"[Close]";
mes "[ItemSpace][^000088"+.@yy+"/^FF0000"+(@maxnu-.@yy)+"^000000]";
mes "[ItemWeigt][^000088"+getd("bpdataww_"+@ve)+"/^FF0000"+(@maxwi-getd("bpdataww_"+@ve))+"^000000]";
set @i,select(@select$);
if(@i>@maxnu){close;}
switch(select("[Load]","[Save]","[Clean]")){
    case 1:
        next;
        if(getd("bpdatare"+@i+"_"+@ve)){
            mes "[+"+getd("bpdatare"+@i+"_"+@ve)+"]";
        }
        if(getd("bpdatac1"+@i+"_"+@ve)){
            mes "["+getitemname(getd("bpdatac1"+@i+"_"+@ve))+"]";
        }
        if(getd("bpdatac2"+@i+"_"+@ve)){
            mes "["+getitemname(getd("bpdatac2"+@i+"_"+@ve))+"]";
        }
        if(getd("bpdatac3"+@i+"_"+@ve)){
            mes "["+getitemname(getd("bpdatac3"+@i+"_"+@ve))+"]";
        }
        if(getd("bpdatac4"+@i+"_"+@ve)){
            mes "["+getitemname(getd("bpdatac4"+@i+"_"+@ve))+"]";
        }
        mes "["+getitemname(getd("bpdataid"+@i+"_"+@ve))+"]x["+getd("bpdatanu"+@i+"_"+@ve)+"]";
        if(!getd("bpdatawa"+@i+"_"+@ve)){
            if(!getd("bpdataid"+@i+"_"+@ve)||input(@nu,1,getd("bpdatanu"+@i+"_"+@ve))){
                mes "Error.";
                close;
            }
        }
            if(getd("bpdatawa"+@i+"_"+@ve)){set @nu,1;}
            if(!checkweight(getd("bpdataid"+@i+"_"+@ve),@nu)){
                mes "Too heavy.";
                close;
            }
            if(!getd("bpdatawa"+@i+"_"+@ve)){
                getitem getd("bpdataid"+@i+"_"+@ve),@nu;
            }else{
                getitem2 getd("bpdataid"+@i+"_"+@ve),@nu,getd("bpdataiy"+@i+"_"+@ve),getd("bpdatare"+@i+"_"+@ve),getd("bpdataat"+@i+"_"+@ve),getd("bpdatac1"+@i+"_"+@ve),getd("bpdatac2"+@i+"_"+@ve),getd("bpdatac3"+@i+"_"+@ve),getd("bpdatac4"+@i+"_"+@ve);
            }
            setd "bpdatanu"+@i+"_"+@ve,getd("bpdatanu"+@i+"_"+@ve)-@nu;
            setd "bpdataww_"+@ve,getd("bpdataww_"+@ve)-getiteminfo(getd("bpdataid"+@i+"_"+@ve),6)*@nu;
            if(!getd("bpdatanu"+@i+"_"+@ve)){
                for(;@i<=@maxnu;set @i,@i+1){
                    setd "bpdatanu"+@i+"_"+@ve,getd("bpdatanu"+(@i+1)+"_"+@ve);
                    setd "bpdataid"+@i+"_"+@ve,getd("bpdataid"+(@i+1)+"_"+@ve);
                    setd "bpdatare"+@i+"_"+@ve,getd("bpdatare"+(@i+1)+"_"+@ve);
                    setd "bpdatac1"+@i+"_"+@ve,getd("bpdatac1"+(@i+1)+"_"+@ve);
                    setd "bpdatac2"+@i+"_"+@ve,getd("bpdatac2"+(@i+1)+"_"+@ve);
                    setd "bpdatac3"+@i+"_"+@ve,getd("bpdatac3"+(@i+1)+"_"+@ve);
                    setd "bpdatac4"+@i+"_"+@ve,getd("bpdatac4"+(@i+1)+"_"+@ve);
                    setd "bpdataiy"+@i+"_"+@ve,getd("bpdataiy"+(@i+1)+"_"+@ve);
                    setd "bpdataat"+@i+"_"+@ve,getd("bpdataat"+(@i+1)+"_"+@ve);
                    setd "bpdatawa"+@i+"_"+@ve,getd("bpdatawa"+(@i+1)+"_"+@ve);
                }
            }
        next;mes "[Complete]";
        close;
    case 2:
        next;
        getinventorylist;
        for(set @j,0;@j<@inventorylist_count;set @j,@j+1){
            set @select2$,@select2$+"["+getitemname(@inventorylist_id[@j])+"]x["+@inventorylist_amount[@j]+"]:";
        }
        set @select2$,@select2$+"[Close]";
        set @j,select(@select2$)-1;
        if(@j>@inventorylist_count){close;}
        if(@inventorylist_refine[@j]){
            mes "[+"+@inventorylist_refine[@j]+"]";
        }
        if(@inventorylist_card1[@j]){
            mes "["+getitemname(@inventorylist_card1[@j])+"]";
        }
        if(@inventorylist_card2[@j]){
            mes "["+getitemname(@inventorylist_card2[@j])+"]";
        }
        if(@inventorylist_card3[@j]){
            mes "["+getitemname(@inventorylist_card3[@j])+"]";
        }
        if(@inventorylist_card4[@j]){
            mes "["+getitemname(@inventorylist_card4[@j])+"]";
        }
        mes "["+getitemname(@inventorylist_id[@j])+"]x["+@inventorylist_amount[@j]+"]";
        if(getiteminfo(@inventorylist_id[@j],2)==4||getiteminfo(@inventorylist_id[@j],2)==5){set @nu,1;setd "bpdatawa"+@i+"_"+@ve,1;}
        if(!getd("bpdatawa"+@i+"_"+@ve)){
            if(input(@nu,1,@inventorylist_amount[@j])){
                mes "Error.";
                close;
            }
        }
            if(getd("bpdatawa"+@i+"_"+@ve)&&getd("bpdatanu"+@i+"_"+@ve)){
                mes "Weapom/Armor/Garment/Boots/Headgear";
                mes "all just can 1 in same space.";
                close;
            }
            if(getd("bpdatanu"+@i+"_"+@ve)!=@inventorylist_id[@j]&&getd("bpdatanu"+@i+"_"+@ve)){
                mes "You have to choose the free room";
                mes " or same item.";
                close;
            }
            set @w,getiteminfo(@inventorylist_id[@j],6)*@nu;
            if(getd("bpdataww_"+@ve)+@w>@maxwi){
                mes "Too heavy.";
                close;
            }
            if(!getd("bpdatawa"+@i+"_"+@ve)){
                delitem @inventorylist_id[@j],@nu;
            }else{
                delitem2 @inventorylist_id[@j],@nu,@inventorylist_identify[@j],@inventorylist_refine[@j],@inventorylist_attribute[@j],@inventorylist_card1[@j],@inventorylist_card2[@j],@inventorylist_card3[@j],@inventorylist_card4[@j];
            }
            setd "bpdataid"+@i+"_"+@ve,@inventorylist_id[@j];
            setd "bpdatanu"+@i+"_"+@ve,getd("bpdatanu"+@i+"_"+@ve)+@nu;
            setd "bpdatare"+@i+"_"+@ve,@inventorylist_refine[@j];
            setd "bpdatac1"+@i+"_"+@ve,@inventorylist_card1[@j];
            setd "bpdatac2"+@i+"_"+@ve,@inventorylist_card2[@j];
            setd "bpdatac3"+@i+"_"+@ve,@inventorylist_card3[@j];
            setd "bpdatac4"+@i+"_"+@ve,@inventorylist_card4[@j];
            setd "bpdataiy"+@i+"_"+@ve,@inventorylist_identify[@j];
            setd "bpdataat"+@i+"_"+@ve,@inventorylist_attribute[@j];
            setd "bpdataww_"+@ve,getd("bpdataww_"+@ve)+@w;
        next;mes "[Complete]";
        close;
    case 3:
        next;
        if(select("No","Yes")==1){close;}
        setd "bpdataww_"+@ve,getd("bpdataww_"+@ve)-getiteminfo(getd("bpdataid"+@i+"_"+@ve),6)*getd("bpdatanu"+@i+"_"+@ve);
        for(;@i<=@maxnu;set @i,@i+1){
            setd "bpdatanu"+@i+"_"+@ve,getd("bpdatanu"+(@i+1)+"_"+@ve);
            setd "bpdataid"+@i+"_"+@ve,getd("bpdataid"+(@i+1)+"_"+@ve);
            setd "bpdatare"+@i+"_"+@ve,getd("bpdatare"+(@i+1)+"_"+@ve);
            setd "bpdatac1"+@i+"_"+@ve,getd("bpdatac1"+(@i+1)+"_"+@ve);
            setd "bpdatac2"+@i+"_"+@ve,getd("bpdatac2"+(@i+1)+"_"+@ve);
            setd "bpdatac3"+@i+"_"+@ve,getd("bpdatac3"+(@i+1)+"_"+@ve);
            setd "bpdatac4"+@i+"_"+@ve,getd("bpdatac4"+(@i+1)+"_"+@ve);
            setd "bpdataiy"+@i+"_"+@ve,getd("bpdataiy"+(@i+1)+"_"+@ve);
            setd "bpdataat"+@i+"_"+@ve,getd("bpdataat"+(@i+1)+"_"+@ve);
            setd "bpdatawa"+@i+"_"+@ve,getd("bpdatawa"+(@i+1)+"_"+@ve);
        }
        next;mes "[Complete]";
        close;
}
}
Viewed 881 times, submitted by Guest.