Loading...   


sub CheckClassGearSet{
	$TierToCheck = $_[0];
	$Debug = 1;
	my %Gear = (
		"T2" => {
			"Bard" => [100904, 100905, 100903, 100906, 100901, 100902, 100907],
			"Beastlord" => [101604, 101603, 101606, 101601, 101602, 101605, 101607],
			"Berserker" => [101302, 101304, 101301, 101306, 101305, 101303, 101307],
			"Cleric" => [100804, 100805, 100803, 100806, 100801, 100802, 100807],
			"Druid" => [101404, 101403, 101406, 101401, 101402, 101405, 101407],
			"Enchanter" => [102006, 102001, 102003, 102005, 102002, 102004, 102007],
			"Magician" => [101806, 101801, 101803, 101805, 101802, 101804, 101807],
			"Monk" => [101504, 101503, 101506, 101501, 101502, 101505, 101507],
			"Necromancer" => [101906, 101901, 101903, 101905, 101902, 101904, 101907],
			"Paladin" => [100704, 100705, 100703, 100706, 100701, 100702, 100707],
			"Ranger" => [101102, 101104, 101101, 101106, 101105, 101103, 101107],
			"Rogue" => [101202, 101204, 101201, 101206, 101205, 101203, 101207],
			"Shadowknight" => [100604, 100605, 100603, 100606, 100601, 100602, 100607],
			"Shaman" => [101004, 101002, 101001, 101006, 101005, 101003, 101007],
			"Warrior" => [100504, 100505, 100503, 100506, 100501, 100502, 100507],
			"Wizard" => [101706, 101701, 101703, 101705, 101702, 101704, 101707],
		},
	);
	if(defined($Gear{$TierToCheck}{$class}[0])){
		$client->Message(15, "Debug: Variable exists for class " . $class . " tier - " . $TierToCheck . "") if $Debug;
		$n = 0; #::: Define iteration variable
		while($Gear{$TierToCheck}{$class}[$n]){ #::: Cycle through row data...
			if(plugin::check_hasitem($client, $Gear{$TierToCheck}{$class}[$n])){
				$client->Message(15, "Debug: Client has item " . $Gear{$TierToCheck}{$class}[$n] . ""  . quest::varlink($Gear{$TierToCheck}{$class}[$n]) . "") if $Debug;
			}
			else{
				$client->Message(15, "Debug: Client does not have item " . $Gear{$TierToCheck}{$class}[$n] . " " . quest::varlink($Gear{$TierToCheck}{$class}[$n]) . "") if $Debug;
				$client->Message(15, "Debug: RETURNING FUNCTION FALSE") if $Debug;
				return;
			}
			$n++; #::: Increment iteration
		}
		$client->Message(15, "Debug: We have everything the has asked for, lets return TRUE") if $Debug;
		return 1;
	}
	else{
		$client->Message(15, "Debug: No hash data exists") if $Debug;
		return;
	}
}

sub EVENT_SAY{
	if($text=~/hail/i){
		if(CheckClassGearSet("T2")){
			quest::say("My friend, it appears you have achieved greatness!");
		}
		else{
			quest::say("You suck, go out there and suck less");
		}
	}
}

Raw Paste Data