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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-25-2008, 06:44 AM
kedra
Sarnak
 
Join Date: May 2007
Posts: 71
Default Quest to see if client is wearing any equipment

The subject says it all. I'm looking for the most effective way to check a client's inventory (worn items only) to see if he is wearing any item in any slot.

Basically, I want an NPC to be able to determine if the player has any equipped gear.

Any suggestions?
Reply With Quote
  #2  
Old 02-25-2008, 07:44 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Using this as a reference, I would imagine you could use the following command:

Code:
$client->GetItemIDAt(slot_id)
You would then need a loop to test each possible visible slot, which would be 0 through 21. This should do what you're looking for (although I haven't tested it):

Code:
sub EVENT_SAY {
	if ($text=~/i'm a noob/i) {
		my $s_id;	#slot_id that will be looked at, defined in the for loop
		my $ii = 0;	#how many total items you have in your inventory
		for ($s_id = 0; $s_id <= 21; $s_id++) {	#look at just visible slots 0-21
			if ($client->GetItemIDAt($s_id) != 0) {
				$ii++;
			}
		}
		if ($ii > 0) {
			quest::say("If you were a noob, then how did you get $ii pieces of armor?");
		} elseif ($ii == 0) {
			quest::say("Yes. Yes, you are certainly a noob. A very naked noob.");
			quest::emote("sees you cutting diamonds.");
	}
}
To be honest, I'm not even sure if you have to define the variables at the beginning (so that they're only for the script), but it should prevent them from carrying over to the next call of the script (I think).
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #3  
Old 02-25-2008, 08:24 AM
kedra
Sarnak
 
Join Date: May 2007
Posts: 71
Default

Perfect, Andmetal, that's exactly what I needed. I had tried using
Quote:
$client->GetItemIDAt(slot_id)
last night, but I was passing it the slot id in the wrong format.

Thanks tons.
Reply With Quote
Reply


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:44 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