summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-07-11 18:32:22 -0300
committerJesusaves <cpntb1@ymail.com>2018-07-11 18:32:22 -0300
commitdf6803fa128e0ca8bafb24ac6fc2ba668c4fe23b (patch)
tree382f66e28c3e8c6f8269ac8fa5a66b51ceb3e7c1 /npc
parente6f866e96197b8c8ad6d8a52fc7a1285f7e814d9 (diff)
downloadserverdata-df6803fa128e0ca8bafb24ac6fc2ba668c4fe23b.tar.gz
serverdata-df6803fa128e0ca8bafb24ac6fc2ba668c4fe23b.tar.bz2
serverdata-df6803fa128e0ca8bafb24ac6fc2ba668c4fe23b.tar.xz
serverdata-df6803fa128e0ca8bafb24ac6fc2ba668c4fe23b.zip
Repairman NPC, and bug fixes.
Diffstat (limited to 'npc')
-rw-r--r--npc/functions/refine.txt50
1 files changed, 48 insertions, 2 deletions
diff --git a/npc/functions/refine.txt b/npc/functions/refine.txt
index eefcc478f..a48c13e9c 100644
--- a/npc/functions/refine.txt
+++ b/npc/functions/refine.txt
@@ -4,7 +4,7 @@
// Pyndragon (inspiration)
// Scall (inspiration)
// Description:
-// Refine functions
+// Refine functions. Includes equipment repair. In future use getequippercentrefinery(.@it, REFINE_CHANCE_TYPE_ENRICHED) too
// (No arguments)
function script refineMaster {
@@ -88,7 +88,7 @@ function script refineMaster {
}
mesn;
mesq l("This @@ is a nice stuff. I can refine it for @@ GP and @@ @@.", getitemlink(.@item), .@price, .@amount, getitemlink(.@rg));
- mesc l("Success ratio is of aprox. @@ %%" % (100-(.@rlv*10)));
+ mesc l("Success ratio is of aprox. @@ %%", (100-(.@rlv*10))+rand(-6,6));
next;
if (askyesno() != ASK_YES)
close;
@@ -174,3 +174,49 @@ function script refineMaster {
return;
}
+
+// (No arguments)
+function script repairMaster {
+ mesn;
+ mesq l("I am a really good blacksmith. In fact, there is no stuff I can't fix.");
+ next;
+ mesn;
+ if (getbrokenid(1) == 0) {
+ mesq l("I don't think you have any broken item, but if a friend of mine break your stuff, come talk to me!");
+ close;
+ } else {
+ // Print the name of the first broken item
+ mesq l("You seem to have @@ broken items and... Oh, I see you have a broken @@ here! I wanna repair it!", getbrokencount(), getitemname(getbrokenid(1)));
+ .@save=getbrokenid(1);
+ next;
+ }
+ .@price=getiteminfo(getbrokenid(1), ITEMINFO_SELLPRICE)+getiteminfo(getbrokenid(1), ITEMINFO_ELV)-(getbrokencount()*15);
+ if (.@price < 100)
+ .@price=100;
+ mesn;
+ mesq l("I can refine this for you. Just pay me @@ GP and a @@. It'll take no time at all!", .@price, getitemlink(IronIngot));
+ next;
+ if (askyesno() != ASK_YES || Zeny < .@price) {
+ mes "";
+ mesn;
+ mesq l("Ahh, that's a pity... Well, just talk to me with enough money and I'll gladly fix that for you! %%0");
+ close;
+ }
+ // Cheating? Well, let's try to be innovative this time
+ if (.@save != getbrokenid(1)) {
+ mesn;
+ mesq l("Ah...! POLICE! POLICE! Quick, send this cheating thief to jail!!");
+ atcommand "@jail "+strcharinfo(0);
+ close;
+ }
+ Zeny=Zeny-.@price;
+ repair(1);
+ mesn;
+ mesq l("Here, sparking new! Nice!!");
+ if (getbrokencount() > 0) {
+ next;
+ return;
+ } else {
+ close;
+ }
+}