From c1b16ac31a17a7b18eadbed188a1a1db7a074733 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 3 Jan 2023 17:51:55 -0300 Subject: Lets try again... --- npc/020-5/bracco.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt index a6e91f7da..6dce774bd 100644 --- a/npc/020-5/bracco.txt +++ b/npc/020-5/bracco.txt @@ -122,7 +122,7 @@ return; } - // MassMeltdown( item, price ) + // MassMeltdown( item, price{, override} ) function MassMeltdown { .@id=getarg(0); .@price=getarg(1); @@ -149,16 +149,18 @@ debugmes "Requested to melt down %d %s (%s)", .@total, getitemname(.@id), strcharinfo(0); freeloop(true); + .@cnt = 0; for (.@index=0; .@index < @inventorylist_count; .@index++) { .@x=@inventorylist_id[.@index]; if (.@x == getarg(0) && Zeny >= .@price) { + .@cnt += 1; //delitemidx .@index, 1; POL_PlayerMoney(.@price); // Report it was done mesc l("@@ melt down your @@...", .name$, getitemlink(.@x)), 2; // Really melt it down - if (!.@overid) { + if (.@overid < 1) { NewMeltdown(getarg(0)); } else { // Override system (no recipe) @@ -183,7 +185,10 @@ // TODO: Put this in a timer so it can't be exploited // For now, we'll produce logs so I can go after cheaters with a banhammer delitem .@id, .@total; // Delete first, no refunds - debugmes "Success melting down %d %s (%s)", .@total, getitemname(.@id), strcharinfo(0); + if (.@cnt == .@total) + debugmes "Success melting down %d %s (%s)", .@total, getitemname(.@id), strcharinfo(0); + else + debugmes "Failed melting down (%d/%d) %s (%s)", .@cnt, .@total, getitemname(.@id), strcharinfo(0); @indexisbroken=true; return; @@ -307,7 +312,7 @@ L_Irreversible: switch (@menuret) { // Copy Paste from normal Meltdown case RustyKnife: - MassMeltdown(.@it, 15, IronOre); + MassMeltdown(.@it, 15, Coal); break; case SmallKnife: MassMeltdown(.@it, 15, IronOre); -- cgit v1.2.3-60-g2f50