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
  #4  
Old 10-02-2018, 02:12 AM
Almusious
Fire Beetle
 
Join Date: Sep 2012
Posts: 25
Default

Indeed, "and" is instead a valid logical operator. You had me scratchin' my head trying to figure out what you meant, but I assume perl -c barfed on it because I placed the scalar values meant to be an array within brackets rather than parentheses. Serves me right for not bouncing it against Perl.

Code:
($headid ~~ (147587,147580,147573,147566) and ...
I left the comments in so the numbers didn't appear so random. Though, they may still appear random even if:

Code:
my @headpieces = (147587,147580,147573,147566);
if ($headid ~~ @headpieces) {
As aforementioned, I would consider doing a Hash of Hashes.

Maybe something along the lines of:

Code:
%HoH = (
	'leather'	=>	{
					'head'	=>	147587,
					'chest'	=>	147588,
					'legs'	=>	147591,
				},
	'plate'		=>	{
					'head'	=>	147580,
					'chest'	=>	147581,
					'legs'	=>	147584,
				},
	'chain'		=>	{
					'head'	=>	147573,
					'chest'	=>	147547,
					'legs'	=>	147577,
				},
	'cloth'		=>	{
					'head'	=>	147566,
					'chest'	=>	147567,
					'legs'	=>	147570,
				},
);
Though the nice thing about Perl and Eqemu in general, there are so many ways one can approach a problem to reach a solution. Sure, there are "better" ways, or perhaps even correct. For instance, placing the

Code:
my %elementshash = map { $_ => 1 } @headpieces;
if(exists($elementhash{$headid})) {
I am looking forward to see what you have cooking up superpally1. Assuming it's going to be a public server.
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 08:16 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