//===================================
//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;
}
}