summaryrefslogblamecommitdiff
path: root/npc/012-5/nicholas.txt
blob: cdad6a12236408033b8dc8b13530dab2c80120e5 (plain) (tree)
1
2
3
4
5
6
7
8
9
10



               
                                                                                     




                                    
                                        

                                     
 


                                       
 

                                                                                             
                                                     









































                                                                                                     
         
                                                                                                           

           
                                   
                                      
                              
 
           





                    


                      
     
          
 

         
                                                                                                                 


                                                                                                           
                          







                                
                                                                        

              
                                                                             

              


                                                                    




                                                                        
       

                               
                                  
 


                  





                                    
                                         
        
 
// TMW-2 Script
// Author:
//    Jesusalva
// Description:
//    Nicholas is Hurnscald's blakcsmith. He forges some stuff, and sell other stuff.
//
// PS.
// Iridium + Platyna        Platinum
// Gold + Coal              Gold
// Silver + Coal            Silver
// Copper + Tin             Bronze (9:1)
// Terranite + Coal         Terranite
// Iron + Coal              Iron

// Resitance and Weight increasing ores
// Lead → +++ res, ++++ wei
// Titanium → + res, + wei

// Originals: Setzer, Steel Shield, Chain Mail, Light Platemail, Warlord Plate, Warlord Boots

012-5,36,26,0	script	Nicholas	NPC_CHELIOS,{
    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 @@ @@, @@ @@ and @@ gp.",
        getitemlink(.@prize), .@amon1, getitemlink(.@base1), .@amon2, getitemlink(.@base2), .@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;

            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;
    mesq l("Hello there, I am @@, blacksmith of this fine city. What do you want to forge today?", .name$);
    mes "";
    select
        l("I just want to trade."),
        l("I want to forge Weapons!"),
        l("Nothing, thanks!");

    mes "";
    switch (@menu) {
    case 1:
        openshop;
        closedialog;
        close;
        break;
    case 2:
        goto L_Weapon;

    }
    close;

L_Weapon:
    mesn;
    mesq l("Very well! We have seven class of items: Wood, Iron, Terranite, Bronze, Silver, Gold and Platinum.");
    mesq l("Each of them require different items, I'll sort from weakest to strongest, so choose wisely.");
    select
        l("Nothing, sorry!"),
        l("Wooden Sword"),
        l("Bronze Gladius"),
        l("Iron Bug Slayer"),
        l("Iron Short Gladius");

    switch (@menu) {
    case 1:
        goto L_Menu;
    case 2:
        blacksmith_create(WoodenLog, 55, RawLog, 25, WoodenSword, 4500);
        break;
    case 3:
        blacksmith_create(CopperIngot, 18, TinIngot, 2, BronzeGladius, 5000);
        break;
    case 4:
        blacksmith_create(IronIngot, 12, Coal, 8, BugSlayer, 10000);
        break;
    case 5:
        blacksmith_create(IronIngot, 22, Coal, 18, ShortGladius, 15000);
        break;
    }
    goto L_Weapon;

OnInit:
	tradertype(NST_MARKET);
    sellitem Dagger, 4000, 5;
    sellitem SharpKnife, 2000, 10;

    .sex = G_MALE;
    .distance = 5;
    end;

OnClock0009:
OnClock0603:
OnClock1207:
OnClock1801:
    restoreshopitem Dagger, 4000, 5;
    restoreshopitem SharpKnife, 2000, 10;
    end;
}