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 02-06-2013, 12:24 AM
Randymarsh9
Dragon
 
Join Date: Dec 2007
Posts: 658
Default Array Problems

I am hoping to be able to do some sort of system where I can have an array of quest rewards for each class. This is a very simple example of what I am trying to do.

Code:
sub EVENT_SAY
{
	@Shadowknight = (1001,1002,1003);
	@itemArray = "@$class";
	my $summon = quest::saylink("summon");
	if ($text =~/hail/i)
	{
		quest::say("Do you want me to $summon you something?");
	}
	elsif ($text =~/summon/i)
	{
		quest::say("$class");
		quest::say("@itemArray");
		quest::summonitem($itemArray[1]);
	}
}
Ideally, if someone completes the quest, I could just have it choose their reward from their class's array. The problem I have already seen though, is that getting any array element other than the one at the 0 location returns a 0. So in the script I copied above, it will correctly state the character's class, then (since I am a Shadowknight) it will list all of the elements in the shadowknight array. The problem comes with retrieving individual elements. When I do summonitem($itemArray[0]), it summons an item; however, if I do quest::summonitem($itemArray[1]), it says there is no item with ID = 0. Does anyone know why perl is only recognizing the first element of the array?
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 10:05 PM.


 

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