summaryrefslogblamecommitdiff
path: root/npc/017-5/nahrec.txt
blob: bd430d7ba68f79937630befdae868f4bc322cc5b (plain) (tree)
1
2
3
4
5
6
7
8
9





                                
                                                                                              
                                       
 
                                            

                               



                                                                                                                              

                

     
























                                                                                                                                                 


                                                                                                     
                                            
                                                      
                                         
                                            



                                                         






                                                                                             
                                                                               

                  
                                                                                    
                  
               

                                                                                         
               
                          
               




                                                                                     
























                                                                                                                                      

                                             

          






































                                                                                                 
       
                               











                                                       
// TMW2/LoF scripts.
// Authors:
//    TMW-LoF Team
//    Jesusalva
// Description:
//    General Purpose Blacksmith
//          TODO: Mylarin Dust for THE EPISODE. This means Savior Pants is part of THE EPISODE
//          TODO: Silversmith on 24, 25

017-5,44,24,0	script	Nahrec	NPC_PLAYER,{
    function blacksmith_create;

    // Debug
    if (!is_staff()) {
        mesn;
        mesq l("Almost there! The War Lord will be proud with this new armor I am inventing for him! Just a little more...!");
        //close;
        next;
    }

    mesn;
    mesq l("Ah, hello! It is good to see another traveler in this town!");
    next;
    menu
        l("Really? Where are you from?"), L_Story,
        l("It's good to see you too, do you happen to be able to make stuff?"), L_Makestuff,
        l("Alright."), -;
    close;

L_Story:
    mesn;
    mesq l("I came from Thermin, a town far far away.");
    next;
    mesn;
    mesq l("I'm an experienced weapon master helping this smithy here, but I am new in this town. I am best at smithing armor.");
    next;
    menu
        l("'Best'? So you can make other things?"), L_Makestuff,
        l("Good to know."), -;
    close;

L_Makestuff:
    mesn;
    mesq l("Yes, I can craft many things. In addition to plating and improving armor, I can craft smaller items made of gold and other metals.");
    select
        rif(false && countitem(WarlordPlate) > 0, l("Can you improve my Warlord Plate for me?")),
        rif(false && countitem(LightPlatemail) > 0, l("Can you improve my Light Platemail for me?")),
        l("Can you craft Chainmail?"),
        l("Can you craft Light Platemail?"),
        rif(false, l("Can you craft Warlord Plate?")),
        l("Can you craft Savior Pants?"),
        l("Can you craft Chainmail Skirt?"),
        l("Do you know something about 'Mylarin Dust'?"),
        l("Nevermind, bye!");
    mes "";
    switch (@menu) {
        case 1:
            blacksmith_create(GoldIngot, 35, WarlordPlate, 1, GoldenWarlordPlate, 200000);
            break;
        case 2:
            blacksmith_create(GoldIngot, 10, LightPlatemail, 1, GoldenLightPlatemail, 30000);
            break;
        case 3:
            blacksmith_create(IronIngot, 10, SilverIngot, 2, Chainmail, 20000);
            break;
        case 4:
            blacksmith_create(IronIngot, 15, SilverIngot, 5, LightPlatemail, 40000);
            break;
        case 5:
            blacksmith_create(IronIngot, 5, GoldenLightPlatemail, 1, WarlordPlate, 5000);
            break;
        case 6:
            goto L_Savior;
        case 7:
            blacksmith_create(IronIngot, 10, SilverIngot, 15, ChainmailSkirt, 35000);
            break;
        case 8:
            goto L_Mylarin;
        case 9:
            closedialog;
            goodbye;
            close;
    }
    goto L_Makestuff;

L_Mylarin:
    mesn;
    mesq l("Mylarin dust?! Where would you get that? That's amazing!");
    next;
    mesq l("It has eluded so many craftsmiths, who knows what can be done with that!");
    next;
    mesq l("I can make some stuff with it, but I have no idea where it can be found. Mylarin dust... amazing.");
    next;
    goto L_Makestuff;

L_Missing:
    mesn;
    mesq l("It looks like you're missing some items or money. Please come back when you have what I need!");
    close;

L_Savior:
    mesn;
    mesq l("Yes, I can craft Savior Pants. But it is not cheap. I'll need Platinum, Iridium, and Mylarin Dust. And gold. Much gold.");
    select
        l("I'll be back with those items.."),
        l("That's crazy!");
    close;

// 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;
}

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, FancyHat);
    setunitdata(.@npcId, UDT_HEADMIDDLE, WarlordPlate);
    setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    setunitdata(.@npcId, UDT_WEAPON, SaviorPants);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);

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

}