summaryrefslogblamecommitdiff
path: root/npc/018-5-4/elder.txt
blob: 830cc4616f545ab5709c7cccb18a9ed26b9112f3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10




                                     




                                                                                
 
                                                        



                               




                                                          
         
          
                                                                     




                                                                             


                         
                         
                          
               

                         
     

          


















































































































                                                                                                                                                                             


                                                                                                                                                                        
         

                                                                                                                                                                                                          
         











                                                                                                                                                                                                                                 
         
         
                                                                                                                






                                                                                                   
         
         





                                                                                   









                   
// TMW2 Script
// Author:
//  dangerDuck
// Description:
//      Duck Elder is a friendly npc.
//      The first stage of the Elder's quest consists of a supply restock
//      Second stage of the quest will be a pirate attack (WIP)
//      Third stage will consist of planting mage acorns around the island (WIP)
// Variables:
//      LilitQuest_PiratesOfSARAH

018-5-4,28,73,0	script	Duck Elder	NPC_DUCK_ELDER,{
    function elderQuest;
    function elderSupplyList;
    function elderSupplyGive;
    function elderPirateAttack;
    function elderAbout;
    function elderAboutSarah;
    function elderClose;
    mesn;
    mesq l("Hello %s. What brings you here?", get_race());
    next;
    select
        l("I've heard tidings of strange goings-on in this area..."),
        l("Oh, I'm just exploring. What can you tell me about this island?"),
        l("I came to enjoy a beautiful day with some ducks!");
    mes "";
    switch (@menu) {
        case 1:
            elderQuest();
            break;
        case 2:
            elderAbout();
            // fallthrough
        case 3:
            elderClose();
            break;
    }
    close;

function elderQuest {
    if(BaseLevel < 50) {
        mesn;
        mesq l("Unfortunately, a mere fledgling like you is not strong enough to help us.");
        next;
        elderClose();
        return;
    }
    .@q = getq(LilitQuest_PiratesOfSARAH);
    switch (.@q) {
        case 0:
            mesn;
            mesq l("Your information is correct, %s. Pirates have been plaguing our shores and cutting off our supply lines.", get_race());
            next;
            mesn;
            mesq l("We are in desperate need of food and nesting material, as well as our sacred supply of @@.", getitemlink(CrystallizedMaggot));
            next;
            setq LilitQuest_PiratesOfSARAH, 1;
            elderSupplyList();
            break;
        case 1:
            mesn;
            mesq l("Did you bring the supplies?");
            next;
            select
                l("Yes, I have them right here."),
                l("What did you want? I've forgotten."),
                l("Not yet. I've been... delayed.");
            mes "";
            switch (@menu) {
                case 1:
                    elderSupplyGive();
                    break;
                case 2:
                    elderSupplyList();
                    break;
                case 3:
                    close;
                    break;
            }
            break;
        case 2:
            elderPirateAttack();
            break;
        case 3:
            break;
    }
    close;
    return;
}

function elderSupplyList {
    mesq "";
    mesn;
    mesq l("We need:");
    mesq l("%d/%d %s", countitem(Moss), 300, getitemlink(Moss));
    mesq l("%d/%d %s", countitem(RoastedMaggot), 250, getitemlink(RoastedMaggot));
    mesq l("%d/%d %s", countitem(CommonCarp), 250, getitemlink(CommonCarp));
    mesq l("%d/%d %s", countitem(GrassCarp), 75, getitemlink(GrassCarp));
    mesq l("%d/%d %s", countitem(CrystallizedMaggot), 1, getitemlink(CrystallizedMaggot));
    next;
    mesq l("Of course, we'll find a way to reward you for your efforts.");
    return;
}

function elderSupplyGive {
    if (countitem(Moss) < 300 ||
        countitem(RoastedMaggot) < 250 ||
        countitem(CommonCarp) < 250 ||
        countitem(GrassCarp) < 75 ||
        countitem(CrystallizedMaggot) < 1) {
        mesn;
        mesq l("This isn't what we requested. Perhaps you should count your items more carefully.");
        next;
        mesn;
        mesq l("If you aren't more careful, we might... accidentally... mistake you for an agent of S.A.R.A.H.");
        percentheal -99, 0;
        close;
    }
    inventoryplace RubberDucky, 1;

    delitem(Moss, 300);
    delitem(RoastedMaggot, 250);
    delitem(CommonCarp, 250);
    delitem(GrassCarp, 75);
    delitem(CrystallizedMaggot, 1);

    getitem(RubberDucky, 1);
    getexp(34576, 19226);
    setq(LilitQuest_PiratesOfSARAH, 2);

    mes "";
    mesn;
    mesq l("We appreciate your help. Take this %s as a token of goodwill.", getitemlink(RubberDucky));
    next;
    mesn;
    mesq l("If you're ever in need, you may use it to call upon the aid of the ducks.");
    next;
    if(BaseLevel < 75) {
        mesn;
        mesq l("Go now, with the blessing of ducks. There may come a time when we require your aid once again, O %s.", get_race());
    } else {
        mesn;
        mesq l("We may require your aid again soon. The tritan pirates are amassing and we fear they are planning a siege of Duck Island. I must speak with the council...");
    }
    close;
}

function elderPirateAttack {
    mesn;
    mesq l("The tritan pirates amass for their siege, but they will not attack yet. Return later. King DD is working to find a solution.");
    next;
    close;
}

function elderAbout {
    mesn;
    mesq l("This is Duck Island, the last safe refuge for birds. Ducks tend to be very peaceful, but our young ruler, King DD, has been taken up with the art of war.");
    next;
    mesn;
    mesq l("Unfortunately, he has been corrupted by the terrorist organization calling itself S.A.R.A.H. Hopefully, he will return to the ways of peace and bring prosperity to Duck Island once again.");
    next;
    select
        l("What's S.A.R.A.H.?"),
        l("Thanks, I think I'll continue exploring.");
    mes "";
    if (@menu == 1)
        elderAboutSarah();
    return;
}

function elderAboutSarah {
    mesn;
    mesq l("As I said, S.A.R.A.H. is a terrorist organization. They are dedicated to wiping out every single duck, worldwide. No duck has ever survived an encounter with a S.A.R.A.H. agent. You would do best to avoid them.");
    next;
    mesn;
    mesq l("I suggest you leave now, %s. If you are even suspected of being a S.A.R.A.H. agent...", get_race());
    close;
    return;
}

function elderClose {
    mesn;
    mesq l("Enjoy your time here, %s. And keep your eye out for agents of S.A.R.A.H.", get_race());
    next;
    mesn;
    if (BaseLevel < 50) {
        mesq l("Perhaps you may be of assistance later...");
    }
    else{
        mesq l("I may have a task for you. Return when you tired of exploring...");
    }
    close;
    return;
}

OnInit:
    .sex = G_OTHER;
    .distance = 4;
    end;
}