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 02-25-2022, 11:14 AM
deanalee
Fire Beetle
 
Join Date: Feb 2022
Posts: 1
Default

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);
		}
	}
	
}
__________________
AMC Lighting and Decor Inc.
Reply With Quote
  #2  
Old 02-25-2022, 11:30 AM
Firepaw's Avatar
Firepaw
Fire Beetle
 
Join Date: Dec 2012
Location: USA
Posts: 4
Smile

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