summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2018-05-29 09:25:06 -0300
committerJesusaves <cpntb1@ymail.com>2018-05-29 09:51:13 -0300
commit741e6bd65fe1b66c670e41f1dc7a46b83a2caae6 (patch)
treec7e0332fdc766d9dac0c908c7ec5d98f60f48b09
parenta05e17c4ae6d461317f7617de3155ebe54aba08d (diff)
downloadserverdata-741e6bd65fe1b66c670e41f1dc7a46b83a2caae6.tar.gz
serverdata-741e6bd65fe1b66c670e41f1dc7a46b83a2caae6.tar.bz2
serverdata-741e6bd65fe1b66c670e41f1dc7a46b83a2caae6.tar.xz
serverdata-741e6bd65fe1b66c670e41f1dc7a46b83a2caae6.zip
Rewrite how Jhedia craft ingots
-rw-r--r--npc/003-8/jhedia.txt43
1 files changed, 26 insertions, 17 deletions
diff --git a/npc/003-8/jhedia.txt b/npc/003-8/jhedia.txt
index 03864ea6c..c1280e368 100644
--- a/npc/003-8/jhedia.txt
+++ b/npc/003-8/jhedia.txt
@@ -2,30 +2,38 @@
// Author:
// Crazyfefe
// Saulc
-// Note: script works, but one may argue it is not complete
+// Jesusalva
+// Description:
+// Jhedia takes care of Tulimshar forge and makes ingots
003-8,28,30,0 script Jhedia NPC_ELVEN_FEMALE,{
- .Item1 = IronOre; //7
- .Item2 = Coal; //11
- .GP = 8500;
- .ItemCreate = IronIngot;
-
- function iron_create {
+ // ingot_create( BaseItem, PrizeItem, Amount, Amount_Coal, Price )
+ function ingot_create {
+ .@basei=getarg(0);
+ .@prize=getarg(1);
+ .@amoun=getarg(2);
+ .@coalm=getarg(3);
+ .@price=getarg(4);
speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
l("How many ingots do you want to make?");
- input @amount;
+ input .@amount;
+
+ if (countitem(.@basei) >= .@amount * .@amoun && countitem(Coal) >= .@amount * .@coalm && Zeny >= .@price * .@amount) {
+ inventoryplace .@prize, .@amount;
+ delitem .@basei, .@amount * .@amoun;
+ delitem Coal, .@amount * .@coalm;
+ Zeny = Zeny - .@amount * .@price;
+ getitem .@prize, .@amount;
- if (countitem("Iron Ore") >= @amount * 7 && countitem("Coal") >= @amount * 11 && Zeny >= 8500 * @amount)
- {
- delitem .Item1, @amount * 7;
- delitem .Item2, @amount * 11;
- Zeny = Zeny - @amount * .GP;
- getitem .ItemCreate, @amount;
+ mes "";
+ mesn;
+ mesq l("Many thanks! Come back soon.");
close;
}
+
speech S_FIRST_BLANK_LINE,// | S_LAST_NEXT,
- l("You don't have enough material.");
+ l("You don't have enough material, sorry.");
close;
}
@@ -38,8 +46,9 @@
l("Nothing, thanks."), L_Close;
L_Iron:
+ .@price=8500; // Bad, duplicate
speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
- l("Hello! Do you want to craft @@? For that I will need 7 @@, 11 @@ and @@ gp.", getitemlink(.ItemCreate),getitemlink(.Item1),getitemlink(.Item2),.GP);
+ l("Hello! Do you want to craft @@? For that I will need 7 @@, 11 @@ and @@ gp.", getitemlink(IronIngot),getitemlink(IronOre),getitemlink(Coal),.@price);
//.@karim = getq(Karim_Quest);
select
@@ -48,7 +57,7 @@ L_Iron:
switch (@menu) {
case 1:
- iron_create;
+ ingot_create(IronOre, IronIngot, 7, 11, 8500);
break;
default:
goto L_Close;