Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-26-2008, 11:06 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default %Hash to Shorten Multiple Quests from 1 NPC - Not Working

After working on this for a few days with no luck, I am posting here to see if anyone can help. I have been trying to figure it out by learning Perl on my own, but I just can't get it working.

What I am trying to do is to have 1 NPC that has multiple quests, where each quest is just a simple turn in X and get reward Y. But in this case, I have over 40 turn ins and 40 rewards, so I am hoping to figure out how to write the quest without making each turn in and reward the long way. I am pretty sure that this can be done with hashes, but I just don't know enough about it yet to get it functioning at all.

Here is a small example of what I am trying to do:



Code:
sub EVENT_ITEM {

#defining the hash for Item IDs that are turned in
my %turn_ins = ("Plate_Boots" => 2667, "Plate_Bracer" => 2664, "Plate_Breastplate" => 2662);

#defining the hash for rewarded Item IDs for the turn ins
my %rewards = ("Plate_Boots" => 3233, "Plate_Bracer" => 3230, "Plate_Breastplate" => 3227);

#defining each armor type to use for matching the $turn_ins with the $rewards
my $armor = ("Plate_Boots" || "Plate_Bracer" || "Plate_Breastplate'");

#checking if the $turn_ins hash is defined with an armor piece
  if(defined($turn_ins{$armor})) {
    if (plugin::check_handin(\%itemcount, ($turn_ins{$armor}) => 1)) {
      quest::say("I see you have turned in item $turn_ins{$armor}"); #here to test if it is working

#checking if the $rewards hash is defined with an armor piece
      if(defined($rewards{$armor})) {
        quest::say("Your reward is item $rewards{$armor}"); #here to test if it is working
        quest::summonitem($rewards{$armor});
      }
    }
  }
}
Some of the other things I have tried that don't work either:

Code:
#my $value = 0;
#my @turn_ins = (2667, 2664, 2662, 2665, 2666, 2661, 2663);
#if ($turn_ins == 2667 || $turn_ins == 2664 || $turn_ins == 2662);
#my @armor = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21);
#my ($1,$2,$3,$4,$5,$6,$7) = @armor;
#my %turn_ins = ("test" => 2667);
#my %rewards = (1 => 3233);
#my $Timeless_Plate_Boots = 2667;
#my $Timeless_Plate_Boots;
#my %turn_ins = (2667 => 2667);
#my %rewards = ("Corathus_Plate_Boots" => 3233);
#my %armor = ("Timeless_Plate_Boots" => "Corathus_Plate_Boots");
#my %armor = (2667 => 3233);
#my %turn_ins = ("Plate_Boots" => 2667, "Plate_Bracer" => 2664, "Plate_Breastplate" => 2662);
I imagine for some of you perl gurus this probably won't be too hard to figure out. But, it has me stumped and I just can't seem to understand why it isn't working. Sure, I could do it the long way easily, but I am trying to keep from having a horribly long quest file and also maybe learn something in the process
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 12:24 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3