View Single Post
  #12  
Old 05-23-2018, 03:48 PM
swansona65
Fire Beetle
 
Join Date: Oct 2013
Posts: 11
Default

Ok so i put the below in both the zone/default.pl file and i tried adding it to the quests/global folder with the file name global_npc.pl and neither are spawning npcs with loot. I must be doing something wrong. I am trying to figure out an easy way to add a list of item ID's to all the npcs in the zone with a probability of around 90-95%. Let me know if there is a more streamlined method of implementation.

sub EVENT_SPAWN{
my @drops = (50516, 50011, 50518, 50014, 50012, 50015, 50013, 50017, 50016, 50018, 50029, 50027, 50031, 50032, 50028, 50030, 50026, 50507, 50510, 50501, 50512, 50503, 50514, 50515, 50021, 50019, 50022, 50020, 50023, 50024, 50025, 50506, 50007, 50005, 50006, 50010, 50008, 50009, 50513, 50502, 50508, 50511, 50517, 50504, 50505);#define loot drops here
if(quest::ChooseRandom(1..100) >= 95){ #probability an item will be added
$item = $drops[int(rand @drops)];
$npc->AddItem($item);
}
}
Reply With Quote