Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #16  
Old 10-19-2016, 03:29 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

I'm going a little beyond my comfort level without having at least Perl installed on this PC, but this may do the trick:

Code:
sub EVENT_LOOT {
	if (quest::ChooseRandom(1..10) < 10) { 
		my %h = (
			1 => [[69,72,81],[69,72,81],[69,72,81],[69,72,81],[91,94,96],[100,142,214]],
			4 => [[45,75,81],[45,75,81],[45,75,81],[45,75,81],[45,75,81],[100,142,214]]
		);
		if ($itemid ~~ keys %h) {
			@augments;
			$unaugmenteditemslot;
			@slots_to_check = (0..30,251..340);
			foreach my $a_s (0..4) {
				$augments[$a_s] = ($h{$itemid}[$a_s][quest::ChooseRandom(0..((scalar @{$h{$itemid}}[$a_s]) - 1 ))]);
			}
			foreach my $slot_check ($slots_to_check) {
				$dupe_check = 0;
				$slot_item_id = $client->GetItemIDAt($slot_check);
				if ($itemid == $slot_item_id) {
					for ($augment_check = 0; $augment_check < 5; $augment_check++) {
						$augment_item_id = $client->GetAugmentIDAt($slot_item_id, $augment_check);
						$unaugmenteditemslot = $slot_check if ($augment_item_id = 0);
						++$dupe_check if ($augment_item_id == $augments[$augment_check]);
					}
				}
			}
			$client->RemoveItem($itemid, 1, $unaugmentedslot);
			if ($dupe_check = 5) {
				$client->Message(7, "That item has poofed into the abyss as you already have one just like it!");
			} else {
				$client->SummonItem($itemid,0,1,$augments[0],$augments[1],$augments[2],$augments[3],$augments[4],$unaugmentedslot);
			}
		}
	}
}
It will need to be checked for logic (heading out of town so no time). It appears sound.

I -think- it will function as closely as what you were after. I used the augment item ID's of what you originally provided for reference of what is going on in the hash of arrays. The key values (ie. 1 and 4) are the item ID's of the main item you're dealing with.

Gotta run, good luck.
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:02 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3