View Single Post
  #8  
Old 06-14-2016, 05:17 PM
Shin Noir's Avatar
Shin Noir
Legendary Member
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 506
Default

Thanks c0ncrete. So the answer to my question is: \%{$itemref}

Code:
sub velious_armor_handin {
	my $zoneid = shift;
	my $cash = shift;
	my $classid = shift;
	my $itemref = shift; #I don't know if perl does a pointer reference or what, emulating check_handin's code to pass along
	my $armor_list = plugin::velious_armor_list();
		
	for $x (0...6) {
		$slot = $armor_list[$zoneid][$classid][$x]{slot};
		$item = $armor_list[$zoneid][$classid][$x]{item};
		$reward = $armor_list[$zoneid][$classid][$x]{reward};
		quest::say("Looking for $slot in $item for reward $reward");		
		if (plugin::check_handin(\%{$itemref}, $item => 1)) { #i'm passing itemref here, to check_handin.
			quest::say("Got item!"); #this line never echos.
			if ($cash >= (plugin::pricing_by_slot($slot)*1000)) {
				quest::summonitem($reward);
				return 1;
			} else { #fail!
				return 0;
			}
		}
	}
	return 0;
}

ghanja sent me a PM that informed shift is destructive and pulls data out of the argument list @_ so, I will keep that in mind while I finish fixing other issues.

This is all complete, and I posted the solutions to my question on each part, for anyone else who may have similar questions.

Thanks for your help guys.
__________________

~Shin Noir
DungeonEQ.com

Last edited by Shin Noir; 06-14-2016 at 05:23 PM..
Reply With Quote