summaryrefslogblamecommitdiff
path: root/npc/005-4/rosen.txt
blob: 83e1bdec30953be916ae3800bad84a3de354ed1c (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
                
          
           
               
                                      
             
                             



                                                                                
 
                                            
                                
                                  
                                
                                                

                                                                                                                              



               
                       
                                               



                                        
              
                                   
                                           
                                                                                   



                                  
                   
                            
                                   
                      
                   
                                  
                      
                   


                              





                            








































































                                                                                                                                           

               

       















                                  
// TMW2 scripts.
// Author:
//    Saulc
// Description:
//    Candor Armor&Weapon shop keeper.
// Variables:
//    CandorQuest_Rosen (nyi)
//      Suggestion: Deliver a letter to Zegas, giving player background about
//      Candor Island and Saxso. Requires level 5. Reward: 150 GP.
//      Could have an additional step related to Bifs. Even a daily quest asking
//      for (day % 8) ore, with suitable prices.

005-4,29,36,0	script	Rosen	NPC_GUARD1,{
    .@q=getq(CandorQuest_Rosen);
    .@b=getq(ShipQuests_ChefGado);
    function explain_ironingot {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Did you see Jhedia the blacksmith in Tulimshar? She might know how you could get this."),
            l("Nevertheless, you probably need some base materials from Bifs. Who knows what it will drop if you are lucky?");

        return;
    }

    speech S_LAST_NEXT,
        l("Welcome to Tolchi and Rosen Shop."),
        l("What would you like today?");

    do
    {
        select
            menuaction(l("Trade")),
            l("How can I get iron ingot?"),
            rif(getq(CandorQuest_Rosen) < 3, l("I want to improve my equipment.")),
            menuaction(l("Quit"));

        switch (@menu)
        {
            case 1:
                closedialog;
                shop "Shop#Candor";
                close;
            case 2:
                explain_ironingot;
                break;
            case 3:
                goto L_Gloves;
                break;
            case 4:
                closedialog;
                goodbye;
                close;
        }
    } while (1);


L_Gloves:
    .@q=getq(CandorQuest_Rosen);
    mes "";
    if (BaseLevel < 4) goto L_NoLevel;
    if (.@b <= 2) goto L_NoGloves;
    .@k=getq2(CandorQuest_Rosen); // Get number of kills (via getq2)
    
    mesn;
    if (.@q == 0) {
        mesq l("As i see you have some used gloves, I'm not sure if you can mine with it...");
        next;
        mesq l("Ah! let's do a test. Go mine 10 @@. You should found some source at nord east of the Island.", getmonsterlink(DiamondBif));
        setq CandorQuest_Rosen, 1, 0;
    } else if (.@q == 1) {
        mesq l("You done mine enought @@. The perfect spot is at nord east of this islend.", getmonsterlink(DiamondBif));
    } else if (.@q == 2) {
        mesq l("Wow! those pity gloves arent made for mining.");
        mesq l("Here, take this @@ It will be better suited!.", getitemlink(CandorGloves));
        inventoryplace CandorGloves, 1;
        getexp 30, 5;
        getitem CandorGloves, 1;
        setq CandorQuest_Rosen, 3, 0;
    }
    close;
    
L_NoLevel:
    mesn;
    mesq l("You aren't strong enought.");
    next;
    mesn;
    mesq l("Go see someone else..");
    close;
    
L_NoGloves:
    mesn;
    mesq l("A miner have real decent gloves dude.");
    next;
    mesn;
    mesq l("For sure Chef of Nard's ship can spare you a pair of glove.");
    close;


    function rosen_add_kills
    {
        .@qp=getq(CandorQuest_Rosen);
        .@kp=getq2(CandorQuest_Rosen); // Get number of kills (via getq2)
        setq CandorQuest_Rosen, .@qp, .@kp+1;
        //message strcharinfo(0), l("Set status @@ with @@ kills", .@qp, .@kp);
    }

    function rosen_max_kills
    {
        .@qp=getq(CandorQuest_Rosen);
        setq CandorQuest_Rosen, .@qp+1, 0;
        //message strcharinfo(0), l("End status @@", .@qp);
    }

OnKillMBif:
    .@q=getq(CandorQuest_Rosen);
    .@k=getq2(CandorQuest_Rosen); // Get number of kills (via getq2)
    if (.@q == 1) {
        if (.@k+1 >= 10) {
            rosen_max_kills();
            message strcharinfo(0), l("Go back to Rosen!");
        } else {
            rosen_add_kills();
            message strcharinfo(0), l("@@/10 Emerald Bif", .@k+1);
        }
    }
    end;


OnTimer1000:
    domovestep;

OnInit:
    initpath "move", 28, 36,
             "dir", DOWN, 0,
             "wait", 31, 0,
             "move", 31, 36,
             "dir", DOWN, 0,
             "wait", 31, 0,
             "move", 25, 35,
             "dir", UP, 0,
             "wait", 2, 0,    
             "move", 29, 36,
             "dir", DOWN, 0,
             "wait", 31, 0;       
    initialmove;
    initnpctimer;
    .distance = 5;
}