|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
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 .
Wasn’t sure if this was done in the database tables or a .pl or .lua file.
|
09-23-2018, 01:29 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
We have global loot tables.
|
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.
|
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
}
|
|
|
|
09-26-2018, 02:03 AM
|
|
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);
}
}
}
|
|
|
|
09-26-2018, 12:40 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
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
|
09-29-2018, 07:05 AM
|
|
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
}
}
|
09-30-2018, 03:58 PM
|
Demi-God
|
|
Join Date: Apr 2008
Location: MA
Posts: 1,164
|
|
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!)
|
10-01-2018, 02:33 AM
|
|
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.
|
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.
|
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);
}
}
}
|
|
|
|
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);
}
}
}
|
|
|
|
02-25-2022, 11:30 AM
|
|
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
|
|
|
|
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 12:10 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|