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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #13  
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
 

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