summaryrefslogblamecommitdiff
path: root/npc/031-7/tametomo.txt
blob: 20a1a30dd4f18e40fca1aea42ba6988e2d3a9e88 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11






                                                    



                                                         


                                     

                              

                          
             
              
                                                              
                          
                     
              
                                                                  



                                                          
 
         
                                                       





                                          


                                            

              

                                    


                                                

                                                      
           
                  


                    
           




                                                                                                                     



                                        




                                               

                                  




                                               
 






                                               


                                                            















                                                         
// TMW2 scripts.
// Authors:
//    Jesusalva
// Description:
//    Questmaker Handbook 14.0 (F = Favorable)

031-7,76,49,2	script	Tametomo	NPC_SAVIOR,{
    if (BaseLevel < 90) {
        mesc l("The wizard seems busy. He ignores you.");
        close;
    }
    .@q = getq(AethyrQuest_Tametomo);
    .@bt = (.@q & 1);
    .@lp = (.@q & 2);
    .@pt = (.@q & 4);
    .@or = bitmask_count(.@q);

    // Generate the dialog
    .@m$=" ";
    if (!.@bt)
        .@m$+="unless you have a "+getitemlink(Butterfly)+",";
    if (!.@bt && .@or > 1)
        .@m$+=" or ";
    if (!.@lp)
        .@m$+="unless you have a "+getitemlink(LavaManaPearl)+",";
    if ((!.@bt || !.@lp) && !.@pt)
        .@m$+=" or ";
    if (!.@pt)
        .@m$+="unless you have a "+getitemlink(Petal)+",";

    mesn;
    mesq l("Go away,%s can't you see I'm busy?", .@m$);

    // Generate the menu
    if (!.@bt && countitem(Butterfly))
        .@showbt=true;
    if (!.@lp && countitem(LavaManaPearl))
        .@showlp=true;
    if (!.@pt && countitem(Petal))
        .@showpt=true;
    if (!.@showbt && !.@showlp && !.@showpt)
        close;

    // Display the menu if pertinent
    next;
    select
        l("Sure, sure, I'm going..."),
        rif(.@showbt, l("I have a butterfly.")),
        rif(.@showlp, l("I have a lava mana pearl.")),
        rif(.@showpt, l("I have a petal."));
    mes "";
    .@opt = @menu;
    switch (@menu) {
    case 2:
    case 3:
    case 4:
        mesn;
        mesq l("%s Monster Points, and a %s. That's my final offer.", fnum(35000), getitemlink(EquipmentBlueprintE));
        next;
        inventoryplace EquipmentBlueprintE, 1;
        mesc l("Accept offer?");

        if (askyesno() == ASK_NO) break;

        if (.@opt == 2 && !.@bt) {
            delitem Butterfly, 1;
            setq AethyrQuest_Tametomo, .@q | 1;
            Mobpt+=35000;
            getitem EquipmentBlueprintE, 1;
        }

        if (.@opt == 3 && !.@lp) {
            delitem LavaManaPearl, 1;
            setq AethyrQuest_Tametomo, .@q | 2;
            Mobpt+=35000;
            getitem EquipmentBlueprintE, 1;
        }

        if (.@opt == 4 && !.@pt) {
            delitem Petal, 1;
            setq AethyrQuest_Tametomo, .@q | 4;
            Mobpt+=35000;
            getitem EquipmentBlueprintE, 1;
        }

        mesn;
        mesq l("Hmpf. A pleasure doing business with you.");
    }
    close;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADBOTTOM, GraduationRobe);
    setunitdata(.@npcId, UDT_HEADMIDDLE, ManaGloves);
    setunitdata(.@npcId, UDT_HEADTOP, ImperialCrown);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 9);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 18);
    npcsit;

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