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 09-30-2018, 09:34 PM
superpally1
Sarnak
 
Join Date: Jul 2018
Location: Tennessee
Posts: 33
Default Trying to understand.

I can not figure out why this first script works as it should, and the second one does not.

Code:
sub EVENT_SAY {

    if ($text=~/armorset/i) {
	# head armor ids   147587 = leather, 147580 = plate, 147573 = chain, 147566 = cloth
        # chest armor ids  147588 = leather, 147581 = plate, 147574 = chain, 147567 = cloth
        # leg  armor ids   147591 = leather, 147584 = plate, 147577 = chain, 147570 = cloth
	
	my $headid = $client->GetItemIDAt(2);
        my $chestid = $client->GetItemIDAt(17);
        my $legid = $client->GetItemIDAt(18);
	
        if($headid == 147587 && $chestid == 147588 && $legid == 147591){ #leather
	    $client->Message(15,"3 pieces of armor equipped, $headid, $chestid, $legid.");
	}
	elsif($headid == 147587 && $legid == 147591){ #leather
            $client->Message(15,"2 pieces of armor equipped, $headid, $legid.");
	}
	if($headid == 147580 && $chestid == 147581 && $legid == 147584){ #plate
            $client->Message(15,"3 pieces of armor equipped, $headid, $chestid, $legid.");
	}
	elsif($headid == 147580 && $legid == 147584){ #plate
            $client->Message(15,"2 pieces of armor equipped, $headid, $legid.");
	}
	if($headid == 147573 && $chestid == 147574 && $legid == 147577){ #chain
            $client->Message(15,"3 pieces of armor equipped, $headid, $chestid, $legid.");
	}
	elsif($headid == 147573 && $legid == 147577){ #chain
            $client->Message(15,"2 pieces of armor equipped, $headid, $legid.");
	}
	if($headid == 147566 && $chestid == 147567 && $legid == 147570){ #cloth
            $client->Message(15,"3 pieces of armor equipped, $headid, $chestid, $legid.");
	}
	elsif($headid == 147566 && $legid == 147570){ #cloth
            $client->Message(15,"2 pieces of armor equipped, $headid, $legid.");
	}
    }
}


Code:
sub EVENT_SAY {
	if ($text=~/armorset/i) {
	# head armor ids   147587 = leather, 147580 = plate, 147573 = chain, 147566 = cloth
        # chest armor ids  147588 = leather, 147581 = plate, 147574 = chain, 147567 = cloth
        # leg  armor ids   147591 = leather, 147584 = plate, 147577 = chain, 147570 = cloth
	
	my $headid = $client->GetItemIDAt(2);
        my $chestid = $client->GetItemIDAt(17);
        my $legid = $client->GetItemIDAt(18);
	
        if ($headid == 147587||147580||147573||147566 && $chestid == 147588||147581||147574||147567 && $legid == 147591||147584||147577||147570){
            $client->Message(15,"3 pieces of armor equipped, $headid, $chestid, $legid.");
	}
	elsif ($headid == 147587||147580||147573||147566 && $legid == 147591||147584||147577||147570){
            $client->Message(15,"2 pieces of armor equipped, $headid, $legid.");
	}
    }
}
The second script will always output the 3 piece message regardless if you have all 3 pieces of gear on, 2 pieces, 1 piece, or no pieces.
If the item is not equipped the client->Message will just list -1 for the itemid for that slot.

The elsif statement is never reached.

Any help would be greatly appreciated.
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 07:27 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3