Jump to content

Alenovo

Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Alenovo's Achievements

Poring

Poring (1/15)

0

Reputation

  1. Thanks, Ehwaz. I'll try this out. Update: The fix Ehwaz provided works. It's working as intended now. Here's the full NPC script below in case anyone wants it. I modified it tiny bit to show the total number of items that have stacks (e.g. 10x Red Potion, 5x Treasure Box): prontera,155,181,5 script Sell All Items 757,{ getinventorylist; .@overcharge_lv = getskilllv( "MC_OVERCHARGE" ); if( .@overcharge_lv ) .@overcharge_rate = 105 + ( 2 * .@overcharge_lv ) - ( ( .@overcharge_lv >= 10 )? 1:0 ); while( .@i < @inventorylist_count ){ if( !@inventorylist_equip[.@i] ){ .@item_sell_price = getiteminfo( @inventorylist_id[.@i],1 ); if( .@overcharge_lv ) .@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( "Sell all items for "+.@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 "Gained "+.@cost+" zeny."; } }else{ mes "You don't have any items to sell."; } close; } Thanks for the help.
  2. Hello everyone, I found this script by Punit and Emistry that allows loot and unequipped items to be sold easily. The NPC will ask if the player wants to sell all items in their inventory and pay for all of them when the player accepts. The purpose of this script is to make it easier for players to sell loot they find. Problem: The issue is when selling items that stack (e.g. ygg berries, potions, arrows, treasure boxes), it only treats the stack as though it's only one item and only pays for that item. For example, a treasure box sells for 150,000z. If you have 3 treasure boxes it should sell for 450,000z but the NPC only pays 150,000z. This is not an issue for items that don't stack, especially equipment. Meaning if you have 2 broadswords in the inventory, the NPC would buy them correctly. Script: prontera,155,181,5 script Sample 757,{ getinventorylist; .@overcharge_lv = getskilllv( "MC_OVERCHARGE" ); if( .@overcharge_lv ) .@overcharge_rate = 105 + ( 2 * .@overcharge_lv ) - ( ( .@overcharge_lv >= 10 )? 1:0 ); while( .@i < @inventorylist_count ){ if( !@inventorylist_equip[.@i] ){ .@item_sell_price = getiteminfo( @inventorylist_id[.@i],1 ); if( .@overcharge_lv ) .@item_sell_price = ( ( .@item_sell_price * .@overcharge_rate ) / 100 ); mes " > "+getitemname( @inventorylist_id[.@i] )+" : "+.@item_sell_price+"z"; .@cost += .@item_sell_price; } .@i++; } if( .@cost ){ if( select( "Sell all items for "+.@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 "Gained "+.@cost+" zeny."; } }else{ mes "You dont have any items."; } close; } It would be greatly appreciated if anyone can help point out the issue with the script. I looked into the manuals and documentation but I couldn't really understand all of it because I'm new to this. Thanks in advanced.
×
×
  • Create New...