Thread: Charm Stats?
View Single Post
  #12  
Old 01-08-2016, 03:00 AM
tearinall
Fire Beetle
 
Join Date: Oct 2012
Posts: 9
Default

Mace, I copy/pasted from the hasitem plugin to reduce some time, it doesnt go beyond checking to see if the item is in their proper slot, but should check either cursor or main inventory:

Code:
sub EVENT_SCALE_CALC {
	my @checkarray = (1804..1810);  ## denotes 1804 to 1810
	my $worn;
	foreach $itemtocheck (@checkarray) {
		$worn+=CheckForItem($itemtocheck);
	}
	$questitem->SetScale($worn/(scalar @checkarray));
}

sub CheckForItem {
	for ($slot1=0; $slot1<=30; $slot1++) {
		$itemid1=$client->GetItemIDAt($slot1);
		if ($itemid1==$_[0]) {
			return 1;
		} else {
			return 0;
		}
	}
}
Very much untested beyond syntax.
Reply With Quote