Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Feature Requests

Development::Feature Requests Post suggestions/feature requests here.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2024, 03:24 PM
eyenseq's Avatar
eyenseq
Fire Beetle
 
Join Date: Jan 2014
Location: United States
Posts: 1
Default Loot based on class hate list

sub EVENT_SPAWN{
quest::setnexthpevent(50);
}

sub EVENT_HP {
my @items = (123, 456, 789); #array of items / loot tables
my @item = shuffle(@items); #Shuffle array into new array
my $loot = @item[0]; #Assign the 1st entry in new array to $loot

# Check if HP is at or below 50%
if ($hpevent == 50) {
# Get hate list of NPC
my @hate_list = $npc->GetHateList();

foreach my $ent (@hate_list) {
my $hate_entity = $ent->GetEnt();
my $hate_entity_id = $hate_entity->GetID();
my $hate_entity_class = $hate_entity->GetClass();

# Check if entity is a paladin
if ($hate_entity_class == 9) {
my $client = $entity_list->GetClientByID($hate_entity_id);
if ($client) {
# Add item 1234 to NPC1 for each Paladin on hate list
$npc->AddItem($loot, 1); # Assuming 1234 is the item ID and 1 is quantity could be swapped out for AddLootTable. item id replaced with $loot
}
}
}
}
}

This would add loot based on player classes on hatelist..3 pally's 3 items..maybe add a out of combat that would reset loot so he wouldnt end up with a ton of items.

Additionally, I would use shuffle over quest::summonitem("$items[int(rand($#items+1))]") for example

Last edited by eyenseq; 02-09-2024 at 03:26 PM.. Reason: typo
Reply With Quote
Reply


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 01:15 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3