Timokha 0 Posted Sunday at 08:53 PM (edited) 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, nss_dojo,209,222,4 script Bulk_sell 1_M_MERCHANT,{ disable_items; getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { // if ( getiteminfo( [email protected]_equip[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { // if ( getiteminfo( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { if( [email protected]_equip[[email protected]] && getiteminfo ( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ){ [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } if ( [email protected] ) { mes "nothing to sell"; close; } mes "are you sure to sell :"; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) mes [email protected][[email protected]] +"x "+ getitemname([email protected][[email protected]]); mes "в сумме за "+ F_InsertComma([email protected]_total) +" Зени ?"; next; if ( select( "Yes", "No" ) == 2 ) close; if ( Zeny + [email protected]_total > MAX_ZENY ) { mes "you cannot carry much more zeny."; close; } for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) delitem [email protected][[email protected]], [email protected][[email protected]]; specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); mes "All items have been sold for "+ F_InsertComma([email protected]_total) +" z"; Zeny += [email protected]_total; close; OnInit: setarray .Overcharge[0], 0, 7,9,11,13,15,17,19,21,23,24; end; } Edited Sunday at 08:55 PM by Timokha Quote Share this post Link to post Share on other sites
0 Kuya Jeo 110 Posted Monday at 12:47 AM (edited) 9 hours ago, Timokha said: 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, nss_dojo,209,222,4 script Bulk_sell 1_M_MERCHANT,{ disable_items; getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { // if ( getiteminfo( [email protected]_equip[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { // if ( getiteminfo( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { if( [email protected]_equip[[email protected]] && getiteminfo ( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ){ [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } if ( [email protected] ) { mes "nothing to sell"; close; } mes "are you sure to sell :"; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) mes [email protected][[email protected]] +"x "+ getitemname([email protected][[email protected]]); mes "в сумме за "+ F_InsertComma([email protected]_total) +" Зени ?"; next; if ( select( "Yes", "No" ) == 2 ) close; if ( Zeny + [email protected]_total > MAX_ZENY ) { mes "you cannot carry much more zeny."; close; } for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) delitem [email protected][[email protected]], [email protected][[email protected]]; specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); mes "All items have been sold for "+ F_InsertComma([email protected]_total) +" z"; Zeny += [email protected]_total; close; OnInit: setarray .Overcharge[0], 0, 7,9,11,13,15,17,19,21,23,24; end; } nss_dojo,209,222,4 script Bulk_sell 1_M_MERCHANT,{ disable_items; getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { // if ( getiteminfo( [email protected]_equip[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { // if ( getiteminfo( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { if( [email protected]_equip[[email protected]] && getiteminfo ( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ){ [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } if ( [email protected] ) { mes "nothing to sell"; close; } mes "are you sure to sell :"; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) mes [email protected][[email protected]] +"x "+ getitemname([email protected][[email protected]]); mes "в сумме за "+ F_InsertComma([email protected]_total) +" Зени ?"; next; if ( select( "Yes", "No" ) == 2 ) close; if ( Zeny + [email protected]_total > MAX_ZENY ) { mes "you cannot carry much more zeny."; close; } for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) delitem [email protected][[email protected]], [email protected][[email protected]]; specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); mes "All items have been sold for "+ F_InsertComma([email protected]_total) +" z"; Zeny += [email protected]_total; close; OnInit: setarray .Overcharge[0], 0, 7,9,11,13,15,17,19,21,23,24; end; } Try this one, didnt test it yet. mapname,100,100,4 script TestNPC 4_M_MAYOR,{ getinventorylist; set .@overcharge_lv, getskilllv( "MC_OVERCHARGE" ); if( .@overcharge_lv ) set .@overcharge_rate, 105 + ( 2 * .@overcharge_lv ) - ( ( .@overcharge_lv >= 10 )? 1:0 ); while( .@i < @inventorylist_count ){ if( !@inventorylist_equip[.@i] ){ set .@item_sell_price, getiteminfo( @inventorylist_id[.@i],1 ); if( .@overcharge_lv ) set .@item_sell_price, ( ( .@item_sell_price * .@overcharge_rate ) / 100 ); mes " > "+@inventorylist_amount[.@i]+ "x " +getitemname( @inventorylist_id[.@i] )+" : "+.@item_sell_price+"z"; .@cost += .@item_sell_price * @inventorylist_amount[.@i]; } .@i++; } if( .@cost ){ if( select( "Cost for all the Items - "+.@cost+" zeny?","Cancel" ) == 1 ){ .@i = 0; while( .@i < @inventorylist_count ){ if( !@inventorylist_equip[.@i] ) delitem @inventorylist_id[.@i],@inventorylist_amount[.@i]; .@i++; } Zeny += .@cost; mes "You received a total cost of "+.@cost+" zeny."; } } else{ mes "You don't have any items to sell."; } close; } Edited Monday at 06:44 AM by Kuya Jeo Quote Share this post Link to post Share on other sites
0 Timokha 0 Posted Monday at 06:27 PM (edited) 17 hours ago, Kuya Jeo said: Try this one, didnt test it yet. mapname,100,100,4 script TestNPC 4_M_MAYOR,{ getinventorylist; set [email protected]_lv, getskilllv( "MC_OVERCHARGE" ); if( [email protected]_lv ) set [email protected]_rate, 105 + ( 2 * [email protected]_lv ) - ( ( [email protected]_lv >= 10 )? 1:0 ); while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] ){ set [email protected]_sell_price, getiteminfo( @inventorylist_id[[email protected]],1 ); if( [email protected]_lv ) set [email protected]_sell_price, ( ( [email protected]_sell_price * [email protected]_rate ) / 100 ); mes " > "[email protected]_amount[[email protected]]+ "x " +getitemname( @inventorylist_id[[email protected]] )+" : "[email protected]_sell_price+"z"; [email protected] += [email protected]_sell_price * @inventorylist_amount[[email protected]]; } [email protected]++; } if( [email protected] ){ if( select( "Cost for all the Items - "[email protected]+" zeny?","Cancel" ) == 1 ){ [email protected] = 0; while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] ) delitem @inventorylist_id[[email protected]],@inventorylist_amount[[email protected]]; [email protected]++; } Zeny += [email protected]; mes "You received a total cost of "[email protected]+" zeny."; } } else{ mes "You don't have any items to sell."; } close; } mapname,100,100,4 script TestNPC 4_M_MAYOR,{ getinventorylist; set .@overcharge_lv, getskilllv( "MC_OVERCHARGE" ); if( .@overcharge_lv ) set .@overcharge_rate, 105 + ( 2 * .@overcharge_lv ) - ( ( .@overcharge_lv >= 10 )? 1:0 ); while( .@i < @inventorylist_count ){ if( !@inventorylist_equip[.@i] ){ set .@item_sell_price, getiteminfo( @inventorylist_id[.@i],1 ); if( .@overcharge_lv ) set .@item_sell_price, ( ( .@item_sell_price * .@overcharge_rate ) / 100 ); mes " > "+@inventorylist_amount[.@i]+ "x " +getitemname( @inventorylist_id[.@i] )+" : "+.@item_sell_price+"z"; .@cost += .@item_sell_price * @inventorylist_amount[.@i]; } .@i++; } if( .@cost ){ if( select( "Cost for all the Items - "+.@cost+" zeny?","Cancel" ) == 1 ){ .@i = 0; while( .@i < @inventorylist_count ){ if( !@inventorylist_equip[.@i] ) delitem @inventorylist_id[.@i],@inventorylist_amount[.@i]; .@i++; } Zeny += .@cost; mes "You received a total cost of "+.@cost+" zeny."; } } else{ mes "You don't have any items to sell."; } close; } Thank you. It works well, but it sells all items including cards and items, that should not (can't) be sold. That's why I use //ITEMINFO_TYPE ) == IT_WEAPON/ARMOR/ETC// in my script. I'm looking for a script, which will sell all items, expect for cards, usable, healing items, and some IDs from my list. Edited Monday at 06:27 PM by Timokha Quote Share this post Link to post Share on other sites
0 Kuya Jeo 110 Posted Tuesday at 12:41 AM 6 hours ago, Timokha said: Thank you. It works well, but it sells all items including cards and items, that should not (can't) be sold. That's why I use //ITEMINFO_TYPE ) == IT_WEAPON/ARMOR/ETC// in my script. I'm looking for a script, which will sell all items, expect for cards, usable, healing items, and some IDs from my list. Try to put another condition in this part if( !@inventorylist_equip[.@i] ){ something like this. if( !@inventorylist_equip[.@i] && getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_ETC){ i really dont test it. maybe just give it a try. 1 Timokha reacted to this Quote Share this post Link to post Share on other sites
0 Timokha 0 Posted Tuesday at 11:39 AM 10 hours ago, Kuya Jeo said: Try to put another condition in this part if( [email protected]_equip[[email protected]] ){ if( !@inventorylist_equip[.@i] ){ something like this. if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC){ if( !@inventorylist_equip[.@i] && getiteminfo( @inventorylist_id[.@i], ITEMINFO_TYPE ) == IT_ETC){ i really dont test it. maybe just give it a try. Thanks a lot, I highly appreciate your assistance. May the Gods bless you!! I've made it works. If someone needs, below share complete script for bulk sell. It ignores: x Items with 0z cost (eg. customs items) x Refined items x Equiped items Works only for: x Junk (ETC) x Weapon / Armor / Pet armor SOLVED. nss_dojo,211,222,4 script TestNPC 4_M_MAYOR,{ getinventorylist; set [email protected]_lv, getskilllv( "MC_OVERCHARGE" ); if( [email protected]_lv ) set [email protected]_rate, 105 + ( 2 * [email protected]_lv ) - ( ( [email protected]_lv >= 10 )? 1:0 ); while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_SELLPRICE ) != 0 && [email protected]_refine[[email protected]] != 0 && (getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON )) { set [email protected]_sell_price, getiteminfo( @inventorylist_id[[email protected]],1 ); if( [email protected]_lv ) set [email protected]_sell_price, ( ( [email protected]_sell_price * [email protected]_rate ) / 100 ); mes " > "[email protected]_amount[[email protected]]+ "x " +getitemname( @inventorylist_id[[email protected]] )+" : "[email protected]_sell_price+"z"; [email protected] += [email protected]_sell_price * @inventorylist_amount[[email protected]]; } [email protected]++; } if( [email protected] ){ if( select( "Cost for all the Items - "[email protected]+" zeny?","Cancel" ) == 1 ){ [email protected] = 0; while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_SELLPRICE ) != 0 && [email protected]_refine[[email protected]] != 0 && (getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON )) delitem @inventorylist_id[[email protected]],@inventorylist_amount[[email protected]]; [email protected]++; } specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); Zeny += [email protected]; mes "You received a total cost of "[email protected]+" zeny."; } } else{ mes "You don't have any items to sell."; } close; } Quote Share this post Link to post Share on other sites
0 Kuya Jeo 110 Posted Tuesday at 11:49 AM 5 minutes ago, Timokha said: Thanks a lot, I highly appreciate your assistance. May the Gods bless you!! I've made it works. If someone needs, below share complete script for bulk sell. It ignores: x Items with 0z cost (eg. customs items) x Refined items x Equiped items Works only for: x Junk (ETC) x Weapon / Armor / Pet armor SOLVED. nss_dojo,211,222,4 script TestNPC 4_M_MAYOR,{ getinventorylist; set [email protected]_lv, getskilllv( "MC_OVERCHARGE" ); if( [email protected]_lv ) set [email protected]_rate, 105 + ( 2 * [email protected]_lv ) - ( ( [email protected]_lv >= 10 )? 1:0 ); while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_SELLPRICE ) != 0 && [email protected]_refine[[email protected]] != 0 && (getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON )) { set [email protected]_sell_price, getiteminfo( @inventorylist_id[[email protected]],1 ); if( [email protected]_lv ) set [email protected]_sell_price, ( ( [email protected]_sell_price * [email protected]_rate ) / 100 ); mes " > "[email protected]_amount[[email protected]]+ "x " +getitemname( @inventorylist_id[[email protected]] )+" : "[email protected]_sell_price+"z"; [email protected] += [email protected]_sell_price * @inventorylist_amount[[email protected]]; } [email protected]++; } if( [email protected] ){ if( select( "Cost for all the Items - "[email protected]+" zeny?","Cancel" ) == 1 ){ [email protected] = 0; while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_SELLPRICE ) != 0 && [email protected]_refine[[email protected]] != 0 && (getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON )) delitem @inventorylist_id[[email protected]],@inventorylist_amount[[email protected]]; [email protected]++; } specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); Zeny += [email protected]; mes "You received a total cost of "[email protected]+" zeny."; } } else{ mes "You don't have any items to sell."; } close; } nss_dojo,211,222,4 script TestNPC 4_M_MAYOR,{ getinventorylist; set [email protected]_lv, getskilllv( "MC_OVERCHARGE" ); if( [email protected]_lv ) set [email protected]_rate, 105 + ( 2 * [email protected]_lv ) - ( ( [email protected]_lv >= 10 )? 1:0 ); while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_SELLPRICE ) != 0 && [email protected]_refine[[email protected]] != 0 && (getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON )) { set [email protected]_sell_price, getiteminfo( @inventorylist_id[[email protected]],1 ); if( [email protected]_lv ) set [email protected]_sell_price, ( ( [email protected]_sell_price * [email protected]_rate ) / 100 ); mes " > "[email protected]_amount[[email protected]]+ "x " +getitemname( @inventorylist_id[[email protected]] )+" : "[email protected]_sell_price+"z"; [email protected] += [email protected]_sell_price * @inventorylist_amount[[email protected]]; } [email protected]++; } if( [email protected] ){ if( select( "Cost for all the Items - "[email protected]+" zeny?","Cancel" ) == 1 ){ [email protected] = 0; while( [email protected] < @inventorylist_count ){ if( [email protected]_equip[[email protected]] && getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_SELLPRICE ) != 0 && [email protected]_refine[[email protected]] != 0 && (getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR || getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON )) delitem @inventorylist_id[[email protected]],@inventorylist_amount[[email protected]]; [email protected]++; } specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); Zeny += [email protected]; mes "You received a total cost of "[email protected]+" zeny."; } } else{ mes "You don't have any items to sell."; } close; } Thank you, im glad that I help you alot Quote Share this post Link to post Share on other sites
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,
nss_dojo,209,222,4 script Bulk_sell 1_M_MERCHANT,{ disable_items; getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ETC ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { // if ( getiteminfo( [email protected]_equip[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { // if ( getiteminfo( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ) { if( [email protected]_equip[[email protected]] && getiteminfo ( [email protected]_id[[email protected]], ITEMINFO_TYPE ) == IT_WEAPON ){ [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_PETARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected] ) { if ( getiteminfo( @inventorylist_id[[email protected]], ITEMINFO_TYPE ) == IT_ARMOR ) { [email protected][[email protected]] = @inventorylist_id[[email protected]]; [email protected][[email protected]] = @inventorylist_amount[[email protected]]; [email protected]_total += getiteminfo( [email protected][[email protected]], ITEMINFO_SELLPRICE ) * [email protected][[email protected]] *(100 + .Overcharge[ getskilllv(MC_OVERCHARGE)] )/100; [email protected]; } } if ( [email protected] ) { mes "nothing to sell"; close; } mes "are you sure to sell :"; for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) mes [email protected][[email protected]] +"x "+ getitemname([email protected][[email protected]]); mes "в сумме за "+ F_InsertComma([email protected]_total) +" Зени ?"; next; if ( select( "Yes", "No" ) == 2 ) close; if ( Zeny + [email protected]_total > MAX_ZENY ) { mes "you cannot carry much more zeny."; close; } for ( [email protected] = 0; [email protected] < [email protected]; [email protected] ) delitem [email protected][[email protected]], [email protected][[email protected]]; specialeffect(367, AREA, playerattached()); specialeffect(10, AREA, playerattached()); mes "All items have been sold for "+ F_InsertComma([email protected]_total) +" z"; Zeny += [email protected]_total; close; OnInit: setarray .Overcharge[0], 0, 7,9,11,13,15,17,19,21,23,24; end; }
Share this post
Link to post
Share on other sites