# DemosLooter by Urquart
print "${BGreen}Loading loot.pl\n";

my $lootworth = 0;
my $lootitem = "";
my $lootcheck = 0;

sub cmd_lootl {
	run("look $_");
        $lootworth = 0;
	$lootcheck = 1;
	$lootitem = "";
	$lootperson = "$_";
	run("/window Loots");
}

sub lootprint {
	if ($lootcheck == 1) { run("/print Loots \n${BWhite}*** PRESS ALT-L TO LOOT $lootitem ($lootworth) FROM $lootperson ***${White}\n\n"); }
}
sub loottrig {
	if ($lootcheck == 1) {
		if (/(.*)Dark Phantom Mask(.*)/) {
		 if ($lootworth < 10) {
                  $lootitem = "phantom";
                  $lootworth = 10;
                 }
		}
		if (/(.*)helm of the high forest(.*)/) {
		 if ($lootworth < 10) {
                  $lootitem = "dragonequ";
		  $lootworth = 10;
                  lootprint();
		 }
                }
		if (/(.*)fire-diamond ring(.*)/) {
		 if ($lootworth < 10) {
                  $lootitem = "firediamond";
   		  $lootworth = 10;
		 }
                }
		if (/(.*)Eye of Moira(.*)/) {
	         if ($lootworth < 10) {
 		  $lootitem = "moira";
		  $lootworth = 10;
		 }
		}
		if (/(.*)earth crystal(.*)/) {
		 if ($lootworth < 2) {
		  $lootitem = "earth";
		  $lootworth = 2;
		 }
		}
		if (/(.*)wristband of platinum(.*)/) {
		 if ($lootworth < 3) {
        	  $lootitem = "studded";
		  $lootworth = 3;
		 }
		}
		if (/(.*)Death Knight's scabbard(.*)/) {
		 if ($lootworth < 6) {
		  $lootitem = "scabbard";
		  $lootworth = 6;
		 }
		}
		if (/(.*)portable hole(.*)/) {
		 if ($lootworth < 7) {
		  $lootitem = "well";
		  $lootworth = 7;
		 }
		}
		if (/(.*)into a strange reptilian(.*)/) {
		 if ($lootworth < 5) {
		  $lootitem = "reptile";
		  $lootworth = 5;
		 }
		}
		if (/(.*)jade mask with dark(.*)/) {
		 if ($lootworth < 4) {
 		  $lootitem = "mask";
		  $lootworth = 5;
		 }
		}
		if (/(.*)boots of the Black Rose(.*)/) {
		 if ($lootworth < 6) {
  		  $lootitem = "dkboots";
		  $lootworth = 6;
		 }
		}

               if (/(.*)ring of Red Ruin(.*)/) {
                 if ($lootworth < 6) {
                  $lootitem = "ruin";
                  $lootworth = 6;
                 }
		}
		if (/(.*)ring of Red Ruin(.*)/) {
		 if ($lootworth < 6) {
		  $lootitem = "ruin";
		  $lootworth = 6;
		 }
		}
		if (/(.*)diamond orb of Tyche(.*)/) { 
		 if ($lootworth < 8) {
                  $lootitem = "tyche";
		  $lootworth = 8;
		 }
		}
		if (/(.*)belt of Neumanaga(.*)/) {
		 if ($lootworth < 9) {
         	  $lootitem = "dragonequ";
		  $lootworth = 9;
		 }
		}
		if (/[TAGGED!]/)
		 {
		  if ($lootworth > 0) {
		   lootprint();
		  }
		 }
	}
		
}

sub cmd_doloot  {
	run ("loot $lootitem $lootperson");
	$lootworth = 0;
	$lootcheck = 0;
	$lootitem = "";
	run ("/kill Loots");
}

sub cmd_loff {
	$lootworth = 0;
	$lootcheck = 0;
	$lootitem = "";
	run ("/kill Loots");
}

output_add(\&loottrig);

1;
