Getting Started
Rules
Character Mover
Optimization Guide
EZ Wiki
EZ Guide
Magelo
Zone List
Spell Recipes
T10.5 Spell Recipes
Crafting Recipes
Donate
EZ Player Discord
EZ Server Files
EZ Client Downloads
Custom UF MiniMap
Custom UF Inventory
EQEmulator Home
Allakhazam Home
UFMissingFilesList
TwitchTV
# AddLoot(itemid, amount, chance) --- Amount is usually 1 unless the item has charges --- chance higher numbers for better loot chances sub AddLoot { my $itemdrop = $_[0]; my $amount = $_[1]; my $chance = $_[2]; #Set to 2 for double lootz! my $tries = 2; for($i = 1; $i <= $tries; $i++) { my $random_number = int(rand(100)+1); if($random_number <= $chance) { quest::addloot($itemdrop, $amount); } } }
#item 1289, 1 charge, 100% chanceplugin::AddLoot(1289, 1, 100);
# AddLoot(amount, chance, @itemarray) -- array can be 1 item or more! sub AddLoot { my $amount = shift; my $chance = shift; my @itemdrop = @_; #Set to 2 for double lootz! my $tries = 2; for($i = 1; $i <= $tries; $i++) { my $random_number = int(rand(100)+1); if($random_number <= $chance) { my $itemz = $itemdrop[ rand @itemdrop ]; quest::addloot($itemz, $amount); } }}
sub EVENT_SPAWN {my @itemz = ("1001", #Cloth helm "1002", #Cloth Veil "1003", #Cloth Choker "1004", #Cloth Shirt "1005"); #Cloth Shawl plugin::AddLoot(1, 50, @itemz);}
# AddLoot(amount, chance, @itemarray) -- array can be 1 item or more!sub EZAddLoot { my $amount = shift; my $chance = shift; my @itemdrop = @_; #Set to 2 for double lootz! my $Double_Loot = 1; # 1 = Normal 1x loot, 2 = Double Loot, etc for($n = 1; $n <= $amount; $n++) { for($i = 1; $i <= $Double_Loot; $i++) { my $random_number = int(rand($chance)+1); if($random_number == 1) # 1/chance to drop { my $itemz = $itemdrop[ rand @itemdrop ]; quest::addloot($itemz, 1); # 1 charge } } }}
sub EVENT_SPAWN { my @itemz = ("1001", #Cloth helm "1002", #Cloth Veil "1003", #Cloth Choker "1004", #Cloth Shirt "1005"); #Cloth Shawl plugin::EZAddLoot(4, 2, @itemz); # Drop 4 from list, 1/2 Chance (50% chance per each of 4 items), from Array}
sub EVENT_SPAWN {my @itemz = (1001, #Cloth helm 1002, #Cloth Veil 1003, #Cloth Choker 1004, #Cloth Shirt 1005); #Cloth Shawlmy @stuff = (1006); #Cloth Cape plugin::AddLoot(4, 5, @itemz); plugin::AddLoot(1, 1, @stuff);}