View Single Post
  #5  
Old 07-03-2021, 07:06 PM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Code:
sub EVENT_SPAWN {
   my @item_PHARA = (1628, 1845, 1848, 2377, 10845, 10851, 10912, 10913, 24648); #loot list
   #my $itemlist = @item_PHARA;
   my $item1 = splice(@item_PHARA, plugin::RandomRange(0,$#item_PHARA), 1);
   my $item2 = splice(@item_PHARA, plugin::RandomRange(0,$#item_PHARA), 1);
   my $item3 = splice(@item_PHARA, plugin::RandomRange(0,$#item_PHARA), 1);
   quest::addloot($item1, 0, 0);
   quest::addloot($item2, 0, 0);
   quest::addloot($item3, 0, 0);
}
Maybe try that, it should splice the array by removing 1 element and placing it into the $item1 variable... then 2 and 3 ect...


or go even further and do this...

Code:
sub EVENT_SPAWN {
   my @item_PHARA = (1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009); #loot list
   for $item (1 .. 3) { #drop 3 items...
	   my $item_drop = splice(@item_PHARA, plugin::RandomRange(0,$#item_PHARA), 1);
	   quest::addloot($item_drop, 0, 0);
   }
}

Last edited by NatedogEZ; 07-03-2021 at 07:21 PM..
Reply With Quote