Hello All,
Could you please help me.
I'd like to make below script scans and ignores all equiped items on the characters.
Now it deletes all items, including equiped.
I also want to include function to ignore specific item IDs.
Might be someone can help me with below or have alternative script with bulk selling, working with Hercules?
Thanks in advace,
Could you please help me.
I'd like to make below script scans and ignores all equiped items on the characters.
Now it deletes all items, including equiped.
I also want to include function to ignore specific item IDs.
Might be someone can help me with below or have alternative script with bulk selling, working with Hercules?
Thanks in advace,
Code:
nss_dojo,209,222,4 script Bulk_sell 1_M_MERCHANT,{
disable_items;
getinventorylist;
for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
if ( getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_ETC ) {
.@id[.@c] = @inventorylist_id[.@i];
.@amount[.@c] = @inventorylist_amount[.@i];
.@zeny_total += getiteminfo( .@id[.@c], ITEMINFO_SELLPRICE ) * .@amount[.@c] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100;
++.@c;
}
}
for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
// if ( getiteminfo( !@inventorylist_equip[.@i], ITEMINFO_TYPE ) == IT_WEAPON ) {
// if ( getiteminfo( !@inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_WEAPON ) {
if( !@inventorylist_equip[.@i] && getiteminfo ( !@inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_WEAPON ){
.@id[.@c] = @inventorylist_id[.@i];
.@amount[.@c] = @inventorylist_amount[.@i];
.@zeny_total += getiteminfo( .@id[.@c], ITEMINFO_SELLPRICE ) * .@amount[.@c] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100;
++.@c;
}
}
for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
if ( getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_PETARMOR ) {
.@id[.@c] = @inventorylist_id[.@i];
.@amount[.@c] = @inventorylist_amount[.@i];
.@zeny_total += getiteminfo( .@id[.@c], ITEMINFO_SELLPRICE ) * .@amount[.@c] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100;
++.@c;
}
}
for ( .@i = 0; .@i < @inventorylist_count; ++.@i ) {
if ( getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_ARMOR ) {
.@id[.@c] = @inventorylist_id[.@i];
.@amount[.@c] = @inventorylist_amount[.@i];
.@zeny_total += getiteminfo( .@id[.@c], ITEMINFO_SELLPRICE ) * .@amount[.@c] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100;
++.@c;
}
}
if ( !.@c ) {
mes "nothing to sell";
close;
}
mes "are you sure to sell :";
for ( .@i = 0; .@i < .@c; ++.@i )
mes .@amount[.@i] +"x "+ getitemname(.@id[.@i]);
mes "в сумме за "+ F_InsertComma(.@zeny_total) +" Зени ?";
next;
if ( select( "Yes", "No" ) == 2 ) close;
if ( Zeny + .@zeny_total > MAX_ZENY ) {
mes "you cannot carry much more zeny.";
close;
}
for ( .@i = 0; .@i < .@c; ++.@i )
delitem .@id[.@i], .@amount[.@i];
specialeffect(367, AREA, playerattached());
specialeffect(10, AREA, playerattached());
mes "All items have been sold for "+ F_InsertComma(.@zeny_total) +" z";
Zeny += .@zeny_total;
close;
OnInit:
setarray .Overcharge[0], 0, 7,9,11,13,15,17,19,21,23,24;
end;
}
Last edited by a moderator: