EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Can anyone provide a random weapon quest template ? (https://www.eqemulator.org/forums/showthread.php?t=31338)

everlastnmn 05-19-2010 08:54 PM

Can anyone provide a random weapon quest template ?
 
What I'm kind of thinking would be a specific set of weapons. You complete a quest and receive the quest reward. If you receive a 1hb and rather have a 1hs, you can turn it back in for another random generated weapon until the weapon of your choice has been obtained.

Kinda like the ST key quest - you turn in the ST key and receive either the earring, weapon or whatever else it was and could turn it back in for a different item.

Thanks !

nenelan 06-09-2010 06:58 AM

I /think/ this should work. See if it works, if so, rip it apart and modify it for your own use.

Code:

# Cycle Reward


sub EVENT_SAY {
        my $item = quest::saylink("item",1);

@rewardlist = (68875, 68876, 68877, 68878, 68879, 68970, 68971, 68875);


        if ($text =~/Hail/i) {
                plugin::Whisper("I can give you an [$item], which you can give back to me, and I will cycle through a list of items I will give back to you.  Isn't cyclic redundancy fun?");
        }
        if ($text =~/item/i) {
                plugin::Whisper("Here you go.");
                quest::summonitem("68879");
        }
}

sub EVENT_ITEM {
my $given = 0;
my $togive = 0;
my $count = 0;
        foreach $positem (@rewardlist) {
               
                if ($given == 0) {
                        if (plugin::check_handin(\%itemcount, $positem => 1)) {
                                $togive = $count+1;
                                $given = 1;
                        }
                }
                else {
                        quest::summonitem($rewardlist[$togive]);
                        plugin::Whisper("If you want something else, please return that to me.  I will go through my list of items and give you the next one on the list.");
                        return;
                }
                $count++;
        }

        if ($given == 0) {
                plugin::return_items(\%itemcount);
        }

}



All times are GMT -4. The time now is 10:05 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.