summaryrefslogblamecommitdiff
path: root/npc/003-8/jhedia.txt
blob: 9236f2a3a60a55ad15a9cb528246e737181ddb8d (plain) (tree)
1
2
3
4
5
6
7
8
9

                
                 
             


                                                         
                              
 
                                                  
                
 



                                                                      
                          

                          


                                                                                       
                                                                                                  






                                    

                                                      

                       
                                                                                                                              
                                             
                                                


                                             
                         



                                                   

                  
 
                                                   
                                                            
              
 

     
       
         
                                                                                                                                                    
         
          
                        

                          
                        



                            

                         
                              
 
                                                                

                    
                                                     
              
           
                                                         

              
                                                   

              
                                                    

              
                                                             

              
                                                            

              
                                                              

              
                                                        

              
                                                     

              
                                                       
              



                     

        



                


               
       






























































                               
 



                  
// TMW2 scripts.
// Author:
//	Crazyfefe
//	Saulc
//  Jesusalva
// Description:
//  Jhedia takes care of Tulimshar forge and makes ingots
//.@karim = getq(Karim_Quest);

003-8,28,30,0	script	Jhedia	NPC_ELVEN_FEMALE,{
    goto L_Menu;

    // ingot_create( BaseItem, PrizeItem, Amount, Amount_Coal, Price )
    function ingot_create {
        .@basei=getarg(0);
        .@prize=getarg(1);
        .@oream=getarg(2);
        .@coalm=getarg(3);
        .@price=getarg(4);

        mesn;
        mesq l("Do you want to craft @@? For that I will need @@ @@, @@ @@ and @@ gp.",
        getitemlink(.@prize), .@oream, getitemlink(.@basei), .@coalm, getitemlink(Coal), .@price);

        select
            l("Yes"),
            menuaction(l("Quit"));

        if (@menu == 2) goto L_Menu;

        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("How many ingots do you want to make?");
        input .@amount;

        if (countitem(.@basei) >= .@amount * .@oream && countitem(Coal) >= .@amount * .@coalm && Zeny >= .@price * .@amount) {
            inventoryplace .@prize, .@amount;
            delitem .@basei, .@amount * .@oream;
            delitem Coal, .@amount * .@coalm;
            Zeny = Zeny - .@amount * .@price;
            getitem .@prize, .@amount;
            getexp 10, 0;

            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, sorry.");
        close;

    }

L_Menu:
    mesn;
    mesq l("Hello! I am @@, and I take care of Tulimshar forge. I usually make ingots from various materials. So, what do you want today?", .name$);
    next;
    select
        l("Iron Ingot"),
        l("Copper Ingot"),
        l("Tin Ingot"),
        l("Lead Ingot"),
        l("Titanium Ingot"),
        l("Iridium Ingot"),
        l("Platinum Ingot"),
        l("Silver Ingot"),
        l("Gold Ingot"),
        l("Gold Pieces"),
        l("Nothing, thanks.");

    // ingot_create(Ore, Ingot, Nº of Ore, Nº of Coal, Price);
    switch (@menu) {
    case 1:
        ingot_create(IronOre, IronIngot, 6, 10, 740);
        break;
    case 2:
        ingot_create(CopperOre, CopperIngot, 4, 10, 750);
        break;
    case 3:
        ingot_create(TinOre, TinIngot, 4, 10, 750);
        break;
    case 4:
        ingot_create(LeadOre, LeadIngot, 4, 1, 760);
        break;
    case 5:
        ingot_create(TitaniumOre, TitaniumIngot, 4, 10, 800);
        break;
    case 6:
        ingot_create(IridiumOre, IridiumIngot, 4, 10, 1100);
        break;
    case 7:
        ingot_create(PlatinumOre, PlatinumIngot, 3, 10, 1650);
        break;
    case 8:
        ingot_create(SilverOre, SilverIngot, 3, 8, 650);
        break;
    case 9:
        ingot_create(GoldOre, GoldIngot, 3, 10, 850);
        break;
    case 10:
        ingot_create(GoldOre, GoldPieces, 1, 20, 1100);
        break;
    default:
        goto L_Close;
        break;
    }

L_Close:
    closedialog;
    goodbye;
    close;

OnTimer1000:
    domovestep;

OnInit:
    initpath "move", 28, 30,//C
             "dir", DOWN, 0,
             "wait", 70, 0,
             "move", 35, 28,//D
             "dir", DOWN, 0,
             "wait", 10, 0,
             "move", 30, 29,//B
             "dir", UP, 0,
             "wait", 4, 0,
             "move", 36, 36,//H
             "dir", LEFT, 0,
             "wait", 2, 0,
             "move", 27, 29,//A
             "dir", UP, 0,
             "wait", 10, 0,
             "move", 30, 34,//K
             "dir", UP, 0,
             "wait", 13, 0,
             "move", 27, 29,//A
             "dir", UP, 0,
             "wait", 14, 0,
             "move", 39, 31,//G
             "dir", UP, 0,
             "wait", 25, 0,
             "move", 30, 29,//B
             "dir", UP, 0,
             "wait", 11, 0,
             "move", 26, 42,//M
             "dir", UP, 0,
             "wait", 8, 0,
             "move", 30, 29,//B
             "dir", UP, 0,
             "wait", 7, 0,
             "move", 39, 36,//I
             "dir", RIGHT, 0,
             "wait", 2, 0,
             "move", 35, 31,//F
             "dir", UP, 0,
             "wait", 1, 0,
             "move", 27, 29,//A
             "dir", UP, 0,
             "wait", 15, 0,
             "move", 29, 38,//L
             "dir", DOWN, 0,
             "wait", 21, 0,
             "move", 30, 29,//B
             "dir", UP, 0,
             "wait", 10, 0,
             "move", 39, 28,//E
             "dir", DOWN, 0,
             "wait", 13, 0,
             "move", 28, 34,//J
             "dir", UP, 0,
             "wait", 10, 0,
             "move", 30, 29,//B
             "dir", UP, 0,
             "wait", 1, 0,
             "move", 29, 42,//N
             "dir", UP, 0,
             "wait", 16, 0,
             "move", 27, 29,//A
             "dir", UP, 0,
             "wait", 6, 0;

    initialmove;
    initnpctimer;
    .distance = 5;
}