|
|
![](/forums/images/Darkness/misc/spacer.gif) |
![](/forums/images/Darkness/misc/spacer.gif) |
![](/forums/images/Darkness/misc/spacer.gif) |
![](/forums/images/Darkness/misc/q1.jpg) |
|
![](/forums/images/Darkness/misc/q1-1.jpg) |
![](/forums/images/Darkness/misc/q4.jpg) |
|
![](/forums/images/Darkness/misc/q4-1.jpg) |
![](/forums/images/Darkness/misc/a1.jpg) |
|
![](/forums/images/Darkness/misc/a1-1.jpg) |
|
Quests::Q&A This is the quest support section |
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-23-2018, 01:22 PM
|
Fire Beetle
|
|
Join Date: Jul 2013
Posts: 4
|
|
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 ![Smile](http://www.eqemulator.net/forums/images/smilies/icon_smile.gif) .
Wasn’t sure if this was done in the database tables or a .pl or .lua file.
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-23-2018, 01:29 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,165
|
|
We have global loot tables.
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-23-2018, 02:30 PM
|
Fire Beetle
|
|
Join Date: Jul 2013
Posts: 4
|
|
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.
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-25-2018, 09:31 PM
|
Sarnak
|
|
Join Date: Jul 2018
Location: Tennessee
Posts: 33
|
|
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
}
|
![](/forums/images/Darkness/misc/a4.gif) |
|
![](/forums/images/Darkness/misc/a6.gif) |
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-26-2018, 02:03 AM
|
![Anon.GM's Avatar](image.php?s=edc9b87c97afbc755826ff69db85bc64&u=238933&dateline=1540203063) |
Fire Beetle
|
|
Join Date: Apr 2018
Posts: 19
|
|
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);
}
}
}
|
![](/forums/images/Darkness/misc/a1.gif) |
|
![](/forums/images/Darkness/misc/a3.gif) |
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-26-2018, 12:40 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,165
|
|
Quote:
Originally Posted by Bruser999
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
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-29-2018, 07:05 AM
|
![N0ctrnl's Avatar](image.php?s=edc9b87c97afbc755826ff69db85bc64&u=71931&dateline=1448399969) |
Discordant
|
|
Join Date: Jan 2007
Posts: 443
|
|
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
}
}
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
09-30-2018, 03:58 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,165
|
|
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!)
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
10-01-2018, 02:33 AM
|
![Anon.GM's Avatar](image.php?s=edc9b87c97afbc755826ff69db85bc64&u=238933&dateline=1540203063) |
Fire Beetle
|
|
Join Date: Apr 2018
Posts: 19
|
|
Quote:
Originally Posted by demonstar55
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.
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
11-19-2020, 09:30 PM
|
Fire Beetle
|
|
Join Date: Dec 2018
Posts: 2
|
|
Is there a working version of this floating around? Links to the old wiki are dead and gitbook has a link to GeorgeS's Tools website, which is also now gone.
|
![Old](/forums/images/Darkness/statusicon/post_old.gif)
11-21-2020, 05:14 PM
|
Fire Beetle
|
|
Join Date: Oct 2010
Posts: 3
|
|
This still seems to work.
Code:
sub EVENT_SPAWN {
$roll = int(rand(100)) + 1;
$roll_chance = $roll;
$roll2_chance = $roll;
if($roll >= 50)
{
my $itemid = ( int rand 95000 ) + 1001;
quest::shout("I rolled a $roll have an extra item at $roll_chance percent. Number 1 statement");
$npc->AddItem($itemid);
if($roll >= 88 && $mlevel >= 51)
{
my $itemid2 = ( int rand 95000 ) + 1001;
quest::shout("I have rolled higher than 85 an extra item at $roll2_chance percent chance. Number 2 statement");
$npc->AddItem($itemid2);
}
}
}
|
![](/forums/images/Darkness/misc/a4.gif) |
|
![](/forums/images/Darkness/misc/a6.gif) |
![Old](/forums/images/Darkness/statusicon/post_old.gif)
02-25-2022, 11:14 AM
|
Fire Beetle
|
|
Join Date: Feb 2022
Posts: 1
|
|
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.
Code:
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);
}
}
}
|
![](/forums/images/Darkness/misc/a1.gif) |
|
![](/forums/images/Darkness/misc/a3.gif) |
![Old](/forums/images/Darkness/statusicon/post_old.gif)
02-25-2022, 11:30 AM
|
![Firepaw's Avatar](image.php?s=edc9b87c97afbc755826ff69db85bc64&u=187936&dateline=1645563406) |
Fire Beetle
|
|
Join Date: Dec 2012
Location: USA
Posts: 4
|
|
Heres a simple way of doing that where level is taken into account.
Note youll have to change some of it since its tailored to a custom server but left in comments to debug and explain what each part does
Code:
function event_spawn(e)
local levelMod = math.ceil(e.self:GetLevel()/10);
local ran = math.random(1,100);
--e.self:Shout(tostring(levelMod)); debug
if (ran > 90) then
--local levelMod = math.ceil(e.self:GetLevel()/10);
local ran2 = math.random(0,52);
--which item in the tier drops, had 52 items in each tier
--e.self:Shout(tostring(ran2)); debug
if (ran < 99) then
levelMod = levelMod - 1;
end
if (levelMod > 7) then
levelMod = 7;
end
local lootdrop = levelMod * 52 + ran2 + 300000;
-- decides what item goes on a mob. first item I wanted to drop was 300,000 ... 52 * tier
--e.self:Shout(tostring(lootdrop)); debug
e.self:AddItem(lootdrop, -1);
--gives mob item
--e.self:Shout(tostring(levelMod)); debug
end
end
|
![](/forums/images/Darkness/misc/a1.gif) |
|
![](/forums/images/Darkness/misc/a3.gif) |
![Old](/forums/images/Darkness/statusicon/post_old.gif)
03-29-2022, 11:39 AM
|
Fire Beetle
|
|
Join Date: Mar 2022
Posts: 1
|
|
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!)
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 02:51 PM.
|
|
![](/forums/images/Darkness/misc/s1.jpg) |
|
![](/forums/images/Darkness/misc/s1-1.jpg) |
|
|
|
![](/forums/images/Darkness/misc/z1.jpg) |
|
![](/forums/images/Darkness/misc/z1-1.jpg) |
|
![](/forums/images/Darkness/misc/side3.jpg) |