summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/020-5/bracco.txt129
1 files changed, 86 insertions, 43 deletions
diff --git a/npc/020-5/bracco.txt b/npc/020-5/bracco.txt
index c9cb31941..aaffbfc42 100644
--- a/npc/020-5/bracco.txt
+++ b/npc/020-5/bracco.txt
@@ -4,13 +4,56 @@
// Description:
// Nivalis shopkeeper & forge master. He deals with the equipment which Nicholas,
// Silversmith and Nahred doesn't works with.
+// TODO FIXME: Rewrite Meltdown to don't allow if countitem(id) > 1
+// Also, use deletion by ID (reliable).
+// delitemidx is HOPELESSY BROKEN
020-5,31,25,0 script Bracco NPC_M_SHOPKEEPER,{
goto L_Start;
- // Meltdown( item, price, {id1, amount1}, {id2, amount2}... )
+ // LegacyMeltdown( item, price, {id1, amount1}, {id2, amount2}... )
function Meltdown {
if (getargcount() < 2 || getargcount() % 2 != 0)
return Exception("Faulty learning Meltdown command invoked - error");
+ if (countitem(getarg(0)) != 1) {
+ mesc l("Wait, if you try to melt more than one item, manaplus will get buggy."), 1;
+ mesc l("Please try again later!"), 1;
+ close;
+ }
+
+ .@index=getarg(0);
+ .@price=getarg(1);
+ .@price=POL_AdjustPrice(.@price);
+
+ // Confirmation
+ mesn;
+ mesc l("Really melt down your @@? It'll cost you @@ GP. This action cannot be undone!", getitemlink(.@index), .@price), 1;
+ next;
+ if (askyesno() == ASK_NO || Zeny < .@price)
+ return;
+
+ // Report it was done
+ mesc l("@@ melt down your @@...", .name$, getitemlink(.@index));
+
+ delitem .@index, 1;
+ POL_PlayerMoney(.@price);
+
+ // TODO: Inventoryplace.
+ // Add Items (if inventory is full, your fault and not mine)
+ 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;
+ }
+
+ // LegacyMeltdown( item, price, {id1, amount1}, {id2, amount2}... )
+ function LegacyMeltdown {
+ 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;
@@ -48,7 +91,7 @@
@indexisbroken=true;
return;
}
- // MassMeltdown( item, price, {id1, amount1}, {id2, amount2}... )
+ // MassLegacyMeltdown( item, price, {id1, amount1}, {id2, amount2}... )
function MassMeltdown {
if (getargcount() < 2 || getargcount() % 2 != 0)
return Exception("Faulty learning Meltdown command invoked - error");
@@ -213,19 +256,19 @@ L_Irreversible:
switch (@menuret) {
// Copy Paste from normal Meltdown
case RustyKnife:
- MassMeltdown(.@it, 15, IronOre, any(0, 0, 0, 1, 1));
+ MassLegacyMeltdown(.@it, 15, IronOre, any(0, 0, 0, 1, 1));
break;
case SmallKnife:
- MassMeltdown(.@it, 15, IronOre, any(0, 0, 1, 1, 1));
+ MassLegacyMeltdown(.@it, 15, IronOre, any(0, 0, 1, 1, 1));
break;
case Knife:
- MassMeltdown(.@it, 25, IronOre, any(0, 1, 1, 2));
+ MassLegacyMeltdown(.@it, 25, IronOre, any(0, 1, 1, 2));
break;
case SharpKnife:
- MassMeltdown(.@it, 50, IronOre, any(1, 2, 2, 3));
+ MassLegacyMeltdown(.@it, 50, IronOre, any(1, 2, 2, 3));
break;
case Dagger:
- MassMeltdown(.@it, 100, IronOre, any(2, 2, 3, 3, 4));
+ MassLegacyMeltdown(.@it, 100, IronOre, any(2, 2, 3, 3, 4));
break;
}
close;
@@ -248,119 +291,119 @@ L_Meltdown:
switch (.@id) {
// Special Exceptions
case SilverMirror:
- Meltdown(.@it, 500, SilverOre, rand2(2, 5)); // Exception
+ LegacyMeltdown(.@it, 500, SilverOre, rand2(2, 5)); // Exception
break;
case RustyKnife:
- Meltdown(.@it, 15, IronOre, any(0, 0, 0, 1, 1)); // Exception
+ LegacyMeltdown(.@it, 15, IronOre, any(0, 0, 0, 1, 1)); // Exception
break;
case SmallKnife:
- Meltdown(.@it, 15, IronOre, any(0, 0, 1, 1, 1)); // Exception
+ LegacyMeltdown(.@it, 15, IronOre, any(0, 0, 1, 1, 1)); // Exception
break;
case Knife:
- Meltdown(.@it, 25, IronOre, any(0, 1, 1, 2)); // Exception
+ LegacyMeltdown(.@it, 25, IronOre, any(0, 1, 1, 2)); // Exception
break;
case SharpKnife:
- Meltdown(.@it, 50, IronOre, any(1, 2, 2, 3)); // Exception
+ LegacyMeltdown(.@it, 50, IronOre, any(1, 2, 2, 3)); // Exception
break;
case Dagger:
- Meltdown(.@it, 100, IronOre, any(2, 2, 3, 3, 4, 5)); // Exception
+ LegacyMeltdown(.@it, 100, IronOre, any(2, 2, 3, 3, 4, 5)); // Exception
break;
// Official Weapons
case WoodenSword:
- Meltdown(.@it, 500, WoodenLog, rand2(5,10)); // Exception: 25~50% returned
+ LegacyMeltdown(.@it, 500, WoodenLog, rand2(5,10)); // Exception: 25~50% returned
break;
case BugSlayer:
- Meltdown(.@it, 1000, IronIngot, rand2(4,5));
+ LegacyMeltdown(.@it, 1000, IronIngot, rand2(4,5));
break;
case ShortGladius:
- Meltdown(.@it, 1500, IronIngot, rand2(6,8));
+ LegacyMeltdown(.@it, 1500, IronIngot, rand2(6,8));
break;
case Backsword:
- Meltdown(.@it, 2000, IronIngot, rand2(9,12), TinIngot, rand2(1,2));
+ LegacyMeltdown(.@it, 2000, IronIngot, rand2(9,12), TinIngot, rand2(1,2));
break;
case ShortSword:
- Meltdown(.@it, 2500, IronIngot, rand2(12,16), TinIngot, rand2(2,3));
+ LegacyMeltdown(.@it, 2500, IronIngot, rand2(12,16), TinIngot, rand2(2,3));
break;
case Kitana:
- Meltdown(.@it, 2500, IronIngot, rand2(15,21), TinIngot, rand2(4,6));
+ LegacyMeltdown(.@it, 2500, IronIngot, rand2(15,21), TinIngot, rand2(4,6));
break;
case BoneKnife:
- Meltdown(.@it, 3000, IronIngot, rand2(18,25), Bone, rand2(45,62));
+ LegacyMeltdown(.@it, 3000, IronIngot, rand2(18,25), Bone, rand2(45,62));
break;
case LongSword:
- Meltdown(.@it, 3000, IronIngot, rand2(21,29), IridiumIngot, rand2(0,1));
+ LegacyMeltdown(.@it, 3000, IronIngot, rand2(21,29), IridiumIngot, rand2(0,1));
break;
case RockKnife:
- Meltdown(.@it, 3000, TerraniteOre, rand2(25,35), IridiumIngot, 1);
+ LegacyMeltdown(.@it, 3000, TerraniteOre, rand2(25,35), IridiumIngot, 1);
break;
case DivineSword:
- Meltdown(.@it, 3000, DivineApple, 1, PlatinumIngot, rand2(1,2), IridiumIngot, rand2(2,3));
+ LegacyMeltdown(.@it, 3000, DivineApple, 1, PlatinumIngot, rand2(1,2), IridiumIngot, rand2(2,3));
break;
// 2 hand swords
case MiereCleaver:
- Meltdown(.@it, 2000, SilverIngot, rand2(6,8));
+ LegacyMeltdown(.@it, 2000, SilverIngot, rand2(6,8));
break;
case Broadsword:
- Meltdown(.@it, 2000, SilverIngot, rand2(13,18));
+ LegacyMeltdown(.@it, 2000, SilverIngot, rand2(13,18));
break;
case Halberd:
- Meltdown(.@it, 2000, SilverIngot, rand2(22,31), TinIngot, rand2(2,3));
+ LegacyMeltdown(.@it, 2000, SilverIngot, rand2(22,31), TinIngot, rand2(2,3));
break;
case ImmortalSword:
- Meltdown(.@it, 2000, SilverIngot, rand2(20,28), IridiumIngot, 1);
+ LegacyMeltdown(.@it, 2000, SilverIngot, rand2(20,28), IridiumIngot, 1);
break;
// Bows can go up to 100% but only wood is returned
case ShortBow:
- Meltdown(.@it, 2000, WoodenLog, rand2(9,18));
+ LegacyMeltdown(.@it, 2000, WoodenLog, rand2(9,18));
break;
case ForestBow:
- Meltdown(.@it, 2000, WoodenLog, rand2(12,24));
+ LegacyMeltdown(.@it, 2000, WoodenLog, rand2(12,24));
break;
case ElficBow:
- Meltdown(.@it, 1500, WoodenLog, rand2(16,33));
+ LegacyMeltdown(.@it, 1500, WoodenLog, rand2(16,33));
break;
case ChampionshipBow:
- Meltdown(.@it, 1000, WoodenLog, rand2(24,48));
+ LegacyMeltdown(.@it, 1000, WoodenLog, rand2(24,48));
break;
case BansheeBow:
- Meltdown(.@it, 500, WoodenLog, rand2(35,70));
+ LegacyMeltdown(.@it, 500, WoodenLog, rand2(35,70));
break;
// Wands have no warranted min. and are more expensive because they are sold
case TrainingWand:
- Meltdown(.@it, 12000, WoodenLog, rand2(1,14), ManaPiouFeathers, rand2(0, 21), FluoPowder, rand2(0,3));
+ LegacyMeltdown(.@it, 12000, WoodenLog, rand2(1,14), ManaPiouFeathers, rand2(0, 21), FluoPowder, rand2(0,3));
break;
case NoviceWand:
- Meltdown(.@it, 12000, WoodenLog, rand2(2,28), ManaPiouFeathers, rand2(1, 42), FluoPowder, rand2(0,5));
+ LegacyMeltdown(.@it, 12000, WoodenLog, rand2(2,28), ManaPiouFeathers, rand2(1, 42), FluoPowder, rand2(0,5));
break;
case ApprenticeWand:
- Meltdown(.@it, 12000, WoodenLog, rand2(3,42), ManaPiouFeathers, rand2(2, 63), FluoPowder, rand2(0,8));
+ LegacyMeltdown(.@it, 12000, WoodenLog, rand2(3,42), ManaPiouFeathers, rand2(2, 63), FluoPowder, rand2(0,8));
break;
case LeaderWand:
- Meltdown(.@it, 12000, WoodenLog, rand2(5,70), ManaPiouFeathers, rand2(3, 84), FluoPowder, rand2(2,10));
+ LegacyMeltdown(.@it, 12000, WoodenLog, rand2(5,70), ManaPiouFeathers, rand2(3, 84), FluoPowder, rand2(2,10));
break;
case LegendaryWand:
- Meltdown(.@it, 12000, WoodenLog, rand2(7,77), GoldenApple, rand2(0, 1), FluoPowder, rand2(4,14));
+ LegacyMeltdown(.@it, 12000, WoodenLog, rand2(7,77), GoldenApple, rand2(0, 1), FluoPowder, rand2(4,14));
break;
// Shields - same rule (except leather shield)
case RoundLeatherShield:
- Meltdown(.@it, 500, LeatherPatch, rand2(0,1));
+ LegacyMeltdown(.@it, 500, LeatherPatch, rand2(0,1));
break;
case LeatherShield:
- Meltdown(.@it, 500, LeatherPatch, rand2(1,3));
+ LegacyMeltdown(.@it, 500, LeatherPatch, rand2(1,3));
break;
case WoodenShield:
- Meltdown(.@it, 1500, WoodenLog, rand2(20,28), LeatherPatch, 1);
+ LegacyMeltdown(.@it, 1500, WoodenLog, rand2(20,28), LeatherPatch, 1);
break;
case BladeShield:
- Meltdown(.@it, 1500, IronIngot, rand2(7,9), TitaniumIngot, 1);
+ LegacyMeltdown(.@it, 1500, IronIngot, rand2(7,9), TitaniumIngot, 1);
break;
case BraknarShield:
- Meltdown(.@it, 1500, CopperIngot, rand2(9,12), TinIngot, 1);
+ LegacyMeltdown(.@it, 1500, CopperIngot, rand2(9,12), TinIngot, 1);
break;
// Etc
case GoldenRing:
- Meltdown(.@it, 1500, GoldPieces, rand2(2,3));
+ LegacyMeltdown(.@it, 1500, GoldPieces, rand2(2,3));
break;
default:
mesn;