summaryrefslogtreecommitdiff
path: root/npc/020-5
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-01-16 12:40:20 -0300
committerJesusaves <cpntb1@ymail.com>2020-01-16 12:40:20 -0300
commit5b6b65083352e559dae4c10878df2aa1732030f5 (patch)
treec14a0eabe29d1593f75891c2a64bd5a848e40b32 /npc/020-5
parent4916468364fa836fdeef01d99ed7322d778aba89 (diff)
downloadserverdata-5b6b65083352e559dae4c10878df2aa1732030f5.tar.gz
serverdata-5b6b65083352e559dae4c10878df2aa1732030f5.tar.bz2
serverdata-5b6b65083352e559dae4c10878df2aa1732030f5.tar.xz
serverdata-5b6b65083352e559dae4c10878df2aa1732030f5.zip
Rewrite Bracco mass meltdown
Diffstat (limited to 'npc/020-5')
-rw-r--r--npc/020-5/bracco.txt16
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));