Go Back   EQEmulator Home > EQEmulator Forums > General > General::General Discussion

General::General Discussion General discussion about EverQuest(tm), EQEMu, and related topics.
Do not post support topics here.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 01-08-2016, 09:16 PM
tearinall
Fire Beetle
 
Join Date: Oct 2012
Posts: 9
Default

Mace, it doesn't always "take hold" instantaneously from what I remember.

I get what you're after, which is why I only check the main inventory (worn, and consequently cursor rather than all slots). I also put the item numbers you want to check for in a declared array so that you may add to it in perhaps a more easier to understand method. I also have it check how many elements are in the array as a "total number of armor to check for", so it's easier to scale (as in grow, increase, etc.).

Try this debugging version:

Code:
sub EVENT_SCALE_CALC {
	my @checkarray = (1804..1810);  ## denotes a range between 1804 to 1810 - could also have (1804,1805,1806,etc.) to as many as you want
									## since we check how many are in the array later
	my $worn = 0;
	foreach my $itemtocheck (@checkarray) {
		if (CheckForItem($itemtocheck) {
			$worn++
			quest::say ("".$worn." total worn items at this time.");
		}
	}
	$questitem->SetScale($worn/(scalar @checkarray));
}

sub CheckForItem {
	## Check only main inventory/cursor (we want these pieces to be worn to count right?
	for ($slot1=0; $slot1<=30; $slot1++) {
		$itemid1=$client->GetItemIDAt($slot1);
		if ($itemid1==$_[0]) {
			quest::say ("Found item: ".$_[0]."");
			return 1;
		} else {
			quest::say ("Did not find item: ".$_[0]."");
			return 0;
		}
	}
}
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:54 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