Thread: #reloadqst
View Single Post
  #9  
Old 06-03-2009, 10:32 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

Here is the complete script: ( more or less working. to the extent that it's complete, but it's not done.)

If one of you could take a look at it and let me know what you think. I'll probably peruse the code to see if I can get a better understanding of how it works.


Code:
##########################################################
#   NPC:  Imildu Woodstreak                              #
#   Zone:  Abysmal Sea                                   #
#   Quest:  Imildu's Task                                #
#   Author:  Andrew80k                                   #
##########################################################
# Items:  
#    Wayfarer Arrowhead -- 58173, 
#    Wayfarer Shaft -- 58207, 
#    Wayfarer Fletching --58186, 
#    Wayfarer Arrow -- 58170, 
#    Wayfarer Bow Staff -- 58178,
#    Wayfarer Bow String -- 58179,
#    Wayfarer Bow -- 58177,
#    Wayfarer Honing Stone -- 58191,
#    Scavenged Bow Staff -- 58077,
#    Salvaged Arrowhead --  58072
sub EVENT_SAY {
        $charid  = $client->CharacterID();
        @item_array = ( 58173,58207,58186,58170,58178,58179,58177,58191,58077,58072 );
        if($text =~ /Hail/i) {
                quest::say("Welcome $name, Tunare smiles upon us all.  I don't want to impose, I know that we are all very busy, but if you have the time and inclination, I could use your help finishing some [tasks] that have been overwhelming me.");
        }
        if($text =~ /tasks/i) {
                quest::say("As you may know, many of our scouts have been lost. That has not kept us from trying to explore, but to do so we need supplies. We also must keep those that stay behind stocked with weapons to use in our defense. This has kept me in here working on those supplies and has prevented me from getting out to see the new lands. A dwarf brought me back some strange stone from Taelosia and it's made me want to go out and explore with all my heart. The stone has magical properties too. If treated properly, it can be used much like flint to make some of the sharpest arrowheads I've ever come across. If you could [aid] me with some of the simple tasks, I might be able to do more work with the [Taelosian Stone].");
        }
        if($text =~ /aid/i) {
                foreach $id (@item_array) {
                        if (plugin::check_hasitem($client,$id)) {
                                quest::say("May the Mother of All smile upon you.  You already have some work assigned to you, you should finish that before coming to ask for more.");
                                return;
                        }
                }
                if (!defined($qglobal{imildustep1})) { 
                        quest::setglobal("imildustep1",0,0,'F');
                        $qglobal{imildustep1}=0;
                }
                if ($qglobal{imildustep1} >= 100) {
                        quest::setglobal("imildustep2",0,0,'F');
                        quest::delglobal("imildustep1");
                }
                if ($qglobal{imildustep2} >= 100) {
                        quest::setglobal("imildustep3",0,0,'F');
                        quest::delglobal("imildustep2");
                }
                if ($qglobal{imildustep3} >= 100) {
                        quest::setglobal("imildustep3",0,0,'F');
                        quest::delglobal("imildustep3");
                }
                if ($qglobal{imildustep4} >= 100) {
                        quest::setglobal("imildustep4",0,0,'F');
                        quest::delglobal("imildustep4");
                }
                if (defined($qglobal{imildustep1})){
                        quest::say("You are as welcome here as a shade tree in the Desert of Ro, friend.  I and others have created the components needed to make arrows for the Wayfarers.  I would be grateful if you could do the final assembly for me.  Just take a Wayfarer Arrowhead, a Wayfarer Shaft, and a Wayfarer Fletching and combine them in your fletching kit.  There are many chores that need to be completed.  If you assist me with them, I might be willing to share with you the secret for treating the Chunks of Taelosian Rock to create the useful Taelosian Stones.  When you have those arrows finished, please bring them right back to me and I will make certain that they get to those that need them.");
                        quest::summonitem(58173,20);
                        quest::summonitem(58186,20);
                        quest::summonitem(58207,20);
                }
                if (defined($qglobal{imildustep2})) {
                        quest::say("Hail, traveler.  Thank you for taking the time to help me.  I have several bow staves and strings that need to be assembled.  A simple enough task, but time consuming.  All you need to do is place the Wayfarer Bow Staff and the Wayfarer Bow String into your fletching hit and combine them.  These bows will be needed soon, so please bring them directly to me when you have them assembled.");
                        quest::summonitem(58178,20);
                        quest::summonitem(58189,20);
                }
                if (defined($qglobal{imildustep3})) {
                        quest::say("Like warm fire on a chill northern eve, you are welcome.  We have run low on bow staves.  New wood has been hard to find, but we have several staves that can be repaired with some careful work.  Place a Scavenged Bow Staff and a Wayfarer Honing Stone into your fletching kit and combine them.  The stones are not of the best quality, and will be worthless by the time you fix a single staff, but stone is not difficult to find.  When you have repaired the staves, bring them to me so I can get someone to assemble them into bows for use.");
                        quest::summonitem(58191,20);
                        quest::summonitem(58077,20);
                }
                if (defined($qglobal{imildustep4})) {
                        quest::say("You are the stars on a clear night.  I am grateful to you for your assistance.  We have several ill-prepared or damaged arrowheads that we would like to repair and put into service.  All resources must be watched carefully.  Please take a Salvaged Arrowhead and a Wayfarer Honing Stone and combine them in your fletching kit.  Some of these are badly damaged, but I think you have the skill to repair them.  Bring them to me when you are done.");
                        quest::summonitem(58191,20);
                        quest::summonitem(58072,20);
                }
                if (defined($qglobal{imildustep5})) {
                        quest::emote("beams a bright smile at you, one that softens his usually dour face dramatically.");
                        quest::say("May Tunare bless you, friend.  I can no longer keep you here.  Certainly you too wish to get back out under the sun and see the new land.  Your help has allowed me much freedom, and for that I thank you.  Look at this compound.  Using it when you work with the Chunks of Taelosian Rock and the Chunks of Discordian Rock will allow you to work them into the shapes you desire.'  The smell of the liquid leads you to understand what he has given you.  You will be able to incorporate that material into all of your fletching kits and work with this new stone easily.  In fact, you believe that in time you can improve on the compound and get better results.");
                }
        }

        if($text =~ /Taelosian Stone/i) {
                quest::say("Truly unusual material. I suspect that there has been some long-term unnatural stress on it. If handled one way, it can be ground to powder relatively easily, but with some clever manipulation it can be sheared to make very fine edges. It also seems to hold some magical potential, though. I just haven't had time to explore that possibility. If you come across a Chunk of Taelosian Rock, please bring it to me. I'll treat it for you at the cost of keeping a small portion of the treated stone for myself.");
        }
}
sub EVENT_ITEM {
        my $val = $qglobal{imildustep1};
        if (plugin::check_handin(\%itemcount,58170 => 1)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep1} + 1;
                $qglobal{imildustep1} += 1;
                quest::setglobal("imildustep1",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58170 => 2)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep1} + 2;
                $qglobal{imildustep1} += 2;
                quest::setglobal("imildustep1",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58170 => 3)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep1} + 3;
                $qglobal{imildustep1} += 3;
                quest::setglobal("imildustep1",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58170 => 4)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep1} + 4;
                $qglobal{imildustep1} += 4;
                quest::setglobal("imildustep1",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58177 => 1)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep2} + 1;
                $qglobal{imildustep2} += 1;
                quest::setglobal("imildustep2",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58177 => 2)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep2} + 2;
                $qglobal{imildustep2} += 2;
                quest::setglobal("imildustep2",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58177 => 3)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep2} + 3;
                $qglobal{imildustep2} += 3;
                quest::setglobal("imildustep2",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58177 => 4)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep2} + 4;
                $qglobal{imildustep2} += 4;
                quest::setglobal("imildustep2",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58178 => 1)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep3} + 1;
                $qglobal{imildustep3} += 1;
                quest::setglobal("imildustep3",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58178 => 2)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep3} + 2;
                $qglobal{imildustep3} += 2;
                quest::setglobal("imildustep3",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58178 => 3)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep3} + 3;
                $qglobal{imildustep3} += 3;
                quest::setglobal("imildustep3",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58178 => 4)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep3} + 4;
                $qglobal{imildustep3} += 4;
                quest::setglobal("imildustep3",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58072 => 1)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep4} + 1;
                $qglobal{imildustep4} += 1;
                quest::setglobal("imildustep4",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58072 => 2)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep4} + 2;
                $qglobal{imildustep4} += 2;
                quest::setglobal("imildustep4",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58072 => 3)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep4} + 3;
                $qglobal{imildustep4} += 3;
                quest::setglobal("imildustep4",$val,0,'F');
        } elsif (plugin::check_handin(\%itemcount, 58072 => 4)) {
                quest::say("You are very helpful, we thank you.");
                $val = $qglobal{imildustep4} + 4;
                $qglobal{imildustep4} += 4;
                quest::setglobal("imildustep4",$val,0,'F');
        } else {
                plugin::return_items(\%itemcount);
        }
}
Reply With Quote