summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--npc/020-5/bracco.txt84
1 files changed, 84 insertions, 0 deletions
diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt
index 055b12fe1..af066b7c7 100644
--- a/npc/020-5/bracco.txt
+++ b/npc/020-5/bracco.txt
@@ -46,6 +46,49 @@
@indexisbroken=true;
return;
}
+ // MassMeltdown( item, price, {id1, amount1}, {id2, amount2}... )
+ 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);
+
+ // Skip Confirmation
+ mesn;
+ mesc l("Really melt down all your @@? It'll cost you @@ GP each. This action cannot be undone!", getitemlink(.@id), .@price), 1;
+ next;
+ if (askyesno() == ASK_NO || Zeny < .@price)
+ return;
+
+ delinventorylist();
+ getinventorylist();
+
+ for (.@index=0; .@index < @inventorylist_count; .@index++) {
+ .@x=@inventorylist_id[.@i];
+ if (.@x == getarg(0) && Zeny >= .@price) {
+ delitemidx .@index, 1;
+ Zeny-=.@price;
+ // Report it was done
+ mesc l("@@ melt down your @@...", .name$, getitemlink(.@x));
+
+ for (.@i=2;.@i < getargcount(); .@i++) {
+ if (getarg(.@i+1)) {// It may be zero
+ getitem getarg(.@i), getarg(.@i+1);
+ mesc l("* Acquired @@ @@!", getarg(.@i+1), getitemlink(getarg(.@i)));
+ }
+ .@i++;
+ }
+ }
+ }
+ @indexisbroken=true;
+ return;
+ }
// blacksmith_create( BaseItem1, Amount, BaseItem2, Amount, PrizeItem, Price )
function blacksmith_create {
@@ -100,6 +143,7 @@ L_Start:
l("Trade"),
l("I'm actually looking for an item forged!"),
l("I would like an item melted!"),
+ l("I would like all Knifes and Daggers on me melted!"),
l("Leave");
mes "";
@@ -109,6 +153,9 @@ L_Start:
if (@menu == 3)
goto L_Meltdown;
+ if (@menu == 4)
+ goto L_Irreversible;
+
closedialog;
if (@menu == 1) {
npcshopattach(.name$);
@@ -142,6 +189,43 @@ L_Forge:
}
goto L_Forge;
+L_Irreversible:
+ mesn;
+ mesq l("Quite the guts! The price is taxed individually, if you run out of GP it is your loss.");
+ mesc l("Are you sure?"), 1;
+ next;
+ menuint
+ l("I'm not."), 0,
+ l("Rusty Knife"), RustyKnife,
+ l("Small Knife"), SmallKnife,
+ l("Knife"), Knife,
+ l("Sharp Knife"), SharpKnife,
+ l("Dagger"), Dagger;
+ mes "";
+ .@it=@menuret;
+ switch (@menuret) {
+ // Copy Paste from normal Meltdown
+ case RustyKnife:
+ MassMeltdown(.@it, 15, IronOre, any(0, 0, 0, 1, 1));
+ break;
+ case SmallKnife:
+ MassMeltdown(.@it, 15, IronOre, any(0, 0, 1, 1, 1));
+ break;
+ case Knife:
+ MassMeltdown(.@it, 25, IronOre, any(0, 1, 1, 2));
+ break;
+ case SharpKnife:
+ MassMeltdown(.@it, 50, IronOre, any(1, 2, 2, 3));
+ break;
+ case Dagger:
+ MassMeltdown(.@it, 100, IronOre, any(2, 2, 3, 3, 4));
+ break;
+ }
+ close;
+
+
+
+
L_Meltdown:
mesn;
mesc l("What item do you want to melt down? This is irreversible, and may return some ingots to you, but there is no way to tell how many you'll receive!"), 1;