summaryrefslogblamecommitdiff
path: root/npc/005-4/tolchi.txt
blob: 788ac9de494302beff37011295948ec440d2e756 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                
          
           
             
                         

                   


                                                
 
 

                                                                




























































































































                                                                   
                                                                                              





















                                                                   


                                          























                                           


               

       



























                             
 
// TMW2 scripts.
// Author:
//    Saulc
// Variables:
//    CandorQuests_Tolchi
// Values:
//    0    Default.
//    1    BlackSmith quest ask for 1 iron oore
//    2    BlackSmith quest ask for 3 coal
//    3    BlackSmith quest ask for 1 iron ingot


005-4,42,37,0	script	Tolchi	NPC_RAIJIN_FEMALE_LEGION_ARTIS,{

    .Item1 = IronOre;
    .Item2 = Coal;
    .Item3 = IronIngot;

    function quest_close {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Maybe next time.");
            goodbye;
        close;        
    }

    function quest_giveitem {
    .@tolchi = getq(CandorQuest_Tolchi);
        if (.@tolchi == 2)
        {
            if (countitem("Iron Ingot") == 0)
            {           
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("You don't have the item.");
                    goodbye;
                close;
            }
            delitem .Item3, 1;
            Zeny = Zeny + 8000;
            getexp 1500,0; 
            setq CandorQuest_Tolchi, 3;
            speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Thanks mate that all i need ! Have a good day !");  
        }
        if (.@tolchi == 1)
        {
            if (countitem("Coal") <= 2)
            {           
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("You don't have the item.");
                    goodbye;
                close;
            }
            delitem .Item2, 3;
            Zeny = Zeny + 800;
            getexp 100,0; 
            setq CandorQuest_Tolchi, 2;
        }
        if (.@tolchi == 0)
        {
            if (countitem("Iron Ore") == 0)
            {           
                speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
                    l("You don't have the item.");
                    goodbye;                 
                close;
            }
            delitem .Item1, 1;
            Zeny = Zeny + 200;
            getexp 50,0; 
            setq CandorQuest_Tolchi, 1;
        }
        close;
    }

    function quest_first {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Can you bring me 1 @@", getitemlink(.Item1));
        do
        {
            select
                l("Yes."),
                l("No.");

            switch (@menu)
            {
                case 1:
                    quest_giveitem;
                    break;
                case 2:
                    quest_close;
                    break;
            }   
        } while (@menu != 2);       
    }

    function quest_second {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Can you bring me 3 @@", getitemlink(.Item2));
        do
        {
            select
                l("Yes."),
                l("No.");

            switch (@menu)
            {
                case 1:
                    quest_giveitem;
                    break;
                case 2:
                    quest_close;
                    break;
            }   
        } while (@menu != 2);       
    }

    function quest_third {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
            l("Can you bring me 1 @@", getitemlink(.Item3));
        do
        {
            select
                l("Yes."),
                l("No.");

            switch (@menu)
            {
                case 1:
                    quest_giveitem;
                    break;
                case 2:
                    quest_close;
                    break;
            }   
        } while (@menu != 2);       
    }

    .@tolchi = getq(CandorQuest_Tolchi);

    if (BaseLevel <= 4 || BaseLevel <= 9 && .@tolchi == 1 || BaseLevel <= 14 && .@tolchi == 2)
    {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("You aren't strong enought. Come Back Later.");
        goodbye;
        close;
    }

    if (.@tolchi == 3)
    {
        speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("Hey ! How are you today ? Thanks again for your help.");
        goodbye;
        close;
    }

    speech S_FIRST_BLANK_LINE | S_LAST_NEXT,
        l("Hello can you help me?");

    
    do
    {
        select
            rif(.@tolchi == 0, l("Yes.")),
            rif(.@tolchi == 1, l("Yes.")),
            rif(.@tolchi == 2, l("Yes.")),
            l("No.");

        switch (@menu)
        {
            case 1:
                quest_first;
                setq CandorQuest_Tolchi, 0;
                break;
            case 2:
                quest_second;
                break;
            case 3:
                quest_third;
                break;
            case 4:
                quest_close;
                goodbye;
                break;        
        }
    } while (@menu != 4);

    closedialog;
    goodbye;
    close;

OnTimer1000:
    domovestep;

OnInit:
    initpath "move", 44, 35,
             "dir", UP, 0,
             "wait", 30, 0,
             "move", 43, 40,
             "dir", UP, 0,
             "wait", 30, 0,
             "move", 40, 35,
             "dir", UP, 0,
             "wait", 30, 0,
             "dir", LEFT, 0,
             "wait", 30, 0,
             "move", 42, 37,
             "dir", DOWN, 0,
             "dir", UP, 0,
             "wait", 30, 0,
             "Mmove", 45, 37,
             "dir", DOWN, 0,
             "wait", 30, 0,
             "move", 33, 37,
             "dir", LEFT, 0,
             "wait", 30, 0,
             "move", 33, 37,
             "dir", RIGHT, 0,
             "wait", 30, 0;

    initialmove;
    initnpctimer;
    .distance = 5;
}