From 6b551d5ff145a2cdb21b1bd289241ea4d726529a Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Tue, 31 Jul 2018 12:07:02 -0300 Subject: Silversmith --- npc/017-5/_import.txt | 1 + npc/017-5/silversmith.txt | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 npc/017-5/silversmith.txt (limited to 'npc/017-5') diff --git a/npc/017-5/_import.txt b/npc/017-5/_import.txt index 3c5b312d2..ac4bb9e62 100644 --- a/npc/017-5/_import.txt +++ b/npc/017-5/_import.txt @@ -2,3 +2,4 @@ // This file is generated automatically. All manually added changes will be removed when running the Converter. "npc/017-5/_warps.txt", "npc/017-5/nahrec.txt", +"npc/017-5/silversmith.txt", diff --git a/npc/017-5/silversmith.txt b/npc/017-5/silversmith.txt new file mode 100644 index 000000000..d57d8ed01 --- /dev/null +++ b/npc/017-5/silversmith.txt @@ -0,0 +1,87 @@ +// TMW2/LoF scripts. +// Authors: +// TMW-LoF Team +// Jesusalva +// Description: +// Crafts silver objects + +017-5,24,25,0 script Silversmith NPC_SILVERSMITH,{ + goto L_Menu; + + // blacksmith_create( BaseItem1, Amount, BaseItem2, Amount, PrizeItem, Price ) + function blacksmith_create { + .@base1=getarg(0); + .@amon1=getarg(1); + .@base2=getarg(2); + .@amon2=getarg(3); + .@prize=getarg(4); + .@price=getarg(5); + + mesn; + mesq l("Do you want to craft @@? For that I will need:", getitemlink(.@prize)); + mesc l("@@/@@ @@", countitem(.@base1), .@amon1, getitemlink(.@base1)); + mesc l("@@/@@ @@", countitem(.@base2), .@amon2, getitemlink(.@base2)); + mesc l("@@/@@ GP", format_number(Zeny), format_number(.@price)); + + select + l("Yes"), + l("No"); + + if (@menu == 2) + return; + + if (countitem(.@base1) >= .@amon1 && + countitem(.@base2) >= .@amon2 && + Zeny >= .@price) { + inventoryplace .@prize, 1; + delitem .@base1, .@amon1; + delitem .@base2, .@amon2; + Zeny = Zeny - .@price; + getitem .@prize, 1; + .@xp=getiteminfo(.@base1, ITEMINFO_SELLPRICE)*.@amon1+getiteminfo(.@base2, ITEMINFO_SELLPRICE)*.@amon2; + getexp .@xp, rand(1,10); + + mes ""; + mesn; + mesq l("Many thanks! Come back soon."); + } else { + speech S_FIRST_BLANK_LINE,// | S_LAST_NEXT, + l("You don't have enough material, sorry."); + } + return; + } + + +L_Menu: + mesn l("Smith Silvers"); + mesq l("Hello, I am your local silversmith, here for all of your smithing needs!"); + next; + select + l("Nothing, sorry!"), + l("I'd like my Crozenite Clover Silvered.") + l("Silver Ring!"), + l("Miere Cleaver!"), + l("Broadsword!"); + + switch (@menu) { + case 2: + blacksmith_create(SilverIngot, 3, CrozeniteFourLeafAmulet, 1, SilverFourLeafAmulet, 5000); + break; + case 3: + blacksmith_create(SilverIngot, 4, TinIngot, 2, SilverRing, 10000); + break; + case 4: + blacksmith_create(SilverIngot, 12, Coal, 8, MiereCleaver, 20000); + break; + case 5: + blacksmith_create(SilverIngot, 27, Coal, 20, BroadSword, 50000); + break; + } + close; + +OnInit: + .sex=G_MALE; + .distance=5; + end; +} + -- cgit v1.2.3-70-g09d2