This was made for Tomb of the forsaken, it basically adds a random item to every mob's loot table if the roll is high enough, and mobs 51+ get an extra chance at an additional item.
Code:
#sub EVENT_SPAWN {
# $roll = int(rand(100)) + 1;
#
# $roll_chance = $roll - 70;
# $roll2_chance = $roll - 85;
# if($roll >= 88)
# {
# my $itemid = ( int rand 95000 ) + 1001;
# #quest::shout("I rolled a $roll have an extra item at $roll_chance percent. Number 1 statement");
# $npc->AddItem($itemid);
# if($roll >= 88 && $mlevel >= 51)
# {
# my $itemid2 = ( int rand 95000 ) + 1001;
# #quest::shout("I have rolled higher than 85 an extra item at $roll2_chance percent chance. Number 2 statement");
# $npc->AddItem($itemid2);
# }
# }
#
#}