diff options
-rw-r--r-- | npc/020-5/bracco.txt | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt index 5d41dbb30..f9d960fc5 100644 --- a/npc/020-5/bracco.txt +++ b/npc/020-5/bracco.txt @@ -54,14 +54,16 @@ function MassMeltdown { if (getargcount() < 2 || getargcount() % 2 != 0) return Exception("Faulty learning Meltdown command invoked - error"); - if (@indexisbroken) { - mesc l("Wait, if you try to melt more than one item at login, manaplus will get buggy."), 1; - mesc l("Please try again later!"), 1; - close; - } .@id=getarg(0); .@price=getarg(1); + .@total=countitem(.@id); + if (!.@total) { + mesc l("You don't have any %s.", getitemlink(.@id)), 1; + mesc l("Please try again later!"), 1; + next; + return; + } .@price=POL_AdjustPrice(.@price); @@ -75,10 +77,12 @@ delinventorylist(); getinventorylist(); + delitem .@id, .@total; // Delete first, no refunds + for (.@index=0; .@index < @inventorylist_count; .@index++) { .@x=@inventorylist_id[.@index]; if (.@x == getarg(0) && Zeny >= .@price) { - delitemidx .@index, 1; + //delitemidx .@index, 1; POL_PlayerMoney(.@price); // Report it was done mesc l("@@ melt down your @@...", .name$, getitemlink(.@x)); |