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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-23-2018, 01:22 PM
Bruser999
Fire Beetle
 
Join Date: Jul 2013
Posts: 4
Default Help With Random Loot Per Kill

Does anyone have a custom code to help with a chance to drop completely random loot after each kill? I have seen some things where it essentially rolls a dice and if you score higher than a number, it puts a piece of gear on the corpse or summons it.

I am new to this coding on the server, so please put it in noon speak.

Wasn’t sure if this was done in the database tables or a .pl or .lua file.
Reply With Quote
  #2  
Old 09-23-2018, 01:29 PM
demonstar55
Developer
 
Join Date: Apr 2008
Location: MA
Posts: 1,055
Default

We have global loot tables.
Reply With Quote
  #3  
Old 09-23-2018, 02:30 PM
Bruser999
Fire Beetle
 
Join Date: Jul 2013
Posts: 4
Default

How do you do that? Ultimately just trying to get random loot from any mob in any way shape or form. Wanted to play 1-60 with a few friends and thought it would be fun.
Reply With Quote
  #4  
Old 09-25-2018, 09:31 PM
superpally1
Fire Beetle
 
Join Date: Jul 2018
Location: Tennessee
Posts: 14
Default

http://wiki.eqemulator.org/p?Diablo_...ster_Reference

And here is the example given in the wikki for using the plugin::AddLoot(amount, chance, @itemarray)

Code:
sub EVENT_SPAWN{
    plugin::AddLoot(1, 1200, 132064); # Drop 1 Minor Rainbow Crystal, 1:1200 drop
    plugin::AddLoot(1, 2750, 132065); # Drop 1 Lesser Rainbow Crystal, 1:2750 drop
    my @item_STONES = (10299, 10300, 10400, 112170);            # Light Stones
    plugin::AddLoot(8, 1, @item_STONES); # Drop 8 from list, 1/1 (100%) Chance, from Array
}
Reply With Quote
  #5  
Old 09-26-2018, 02:03 AM
Anon.GM's Avatar
Anon.GM
Fire Beetle
 
Join Date: Apr 2018
Posts: 19
Default

Here is what I'm running on Anon. I know it could be tweaked better by an expert, but this works. Just change the ids to the range of items you want for the zone.

My default.pl from the zone warrens that drops crude defiant weapons and armor. Its a modified version from this link.

http://www.eqemulator.org/forums/showthread.php?t=38286

Code:
sub EVENT_SPAWN {
  $roll = int(rand(100)) + 1;
  
  $roll_chance = $roll - 70;
  $roll2_chance = $roll - 85;
  $WPlower_limit = 50500;
  $WPupper_limit = 50519;
  $ARlower_limit = 50005;
  $ARupper_limit = 50033;
	
  if($roll >= 85)
  {
       my $itemid = int(rand($WPupper_limit-$WPlower_limit)) + $WPlower_limit;
		#quest::shout("I rolled a $roll have an extra item at $roll_chance percent. Number 1 statement");
        $npc->AddItem($itemid);
		if($roll >= 75 && $mlevel >= 15)
		{
		my $itemid2 = int(rand($ARupper_limit-$ARlower_limit)) + $ARlower_limit;
		#quest::shout("I have rolled higher than 85 an extra item at $roll2_chance percent chance. Number 2 statement");
		$npc->AddItem($itemid2);
		}
	}
	
}
__________________
email:anon.gm@protonmail.com
servers: Anon (bots) and Anon (solo)
Reply With Quote
  #6  
Old 09-26-2018, 12:40 PM
demonstar55
Developer
 
Join Date: Apr 2008
Location: MA
Posts: 1,055
Default

Quote:
Originally Posted by Bruser999 View Post
How do you do that? Ultimately just trying to get random loot from any mob in any way shape or form. Wanted to play 1-60 with a few friends and thought it would be fun.
If you're using the PEQ editor, hit the loot tab and then global loot. You can hit the plus button to set up the global loot specific stuff. Currently you can't edit the loot table here just yet, but you can go to a dummy NPC and create a loot table there and use that ID. Hopefully this will be resolved at some point :P
Reply With Quote
  #7  
Old 09-29-2018, 07:05 AM
N0ctrnl's Avatar
N0ctrnl
Discordant
 
Join Date: Jan 2007
Posts: 429
Default

I've been using this for a few years now. Mostly to prevent the farming of greens for random drops.

Code:
sub EVENT_SPAWN {
  $roll = int(rand(1000)) + 1;

  if($roll >= 995 && $mlevel >= 46) {
    my $itemid=(132522);
    $npc->AddItem($itemid);
  }

  if($roll >= 989 && $roll <= 994 && $mlevel >= 46) {
    my $itemid=(132530);
    $npc->AddItem($itemid);
  }

  if($roll >= 910 && $roll <= 920) {
    my $itemid=(40605);
    $npc->AddItem($itemid);
  }
}

sub EVENT_HATE_LIST {
        if ($hate_state == 1 && $client && $client->GetLevel() > ($mlevel + 10) && $npc->GetEntityVariable("removed") != 1) {
                $npc->RemoveItem(132522);
                $npc->RemoveItem(40605);
                $npc->SetEntityVariable("removed", 1); #so it stops trying to remove the item when more people aggro it
        }
}
__________________
Ender - Lead GM/Developer
Vegarlson Asylum Server - http://www.vegarlson-server.org/
Reply With Quote
  #8  
Old 09-30-2018, 03:58 PM
demonstar55
Developer
 
Join Date: Apr 2008
Location: MA
Posts: 1,055
Default

With the most recent updates to PEQ Editor you can now edit the actual loot tables from the global loot editor.

Hit the Loot tab, then click global loot, and you should be able to add or edit existing global loot entries.


This doesn't do scripted remove like n0ctrnl posted, but it does do the stuff in spawn (and more!)
Reply With Quote
  #9  
Old 10-01-2018, 02:33 AM
Anon.GM's Avatar
Anon.GM
Fire Beetle
 
Join Date: Apr 2018
Posts: 19
Default

Quote:
Originally Posted by demonstar55 View Post
With the most recent updates to PEQ Editor you can now edit the actual loot tables from the global loot editor.

Hit the Loot tab, then click global loot, and you should be able to add or edit existing global loot entries.


This doesn't do scripted remove like n0ctrnl posted, but it does do the stuff in spawn (and more!)

I only use the PEQ editor in EOC and don't see this feature. I guess its coming in the near future? I have been testing the script from N0ctrnl on Anon (Solo) where I also have gobal enabled on defiant. Any other suggestions on how to add to the global loot tables without PEQ? Editing was not a problem just looking up the loot table id's but adding new items manually to the table is what I'm looking for ideas on.
__________________
email:anon.gm@protonmail.com
servers: Anon (bots) and Anon (solo)
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:18 AM.


 

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