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 05-02-2020, 05:55 PM
theoneptd
Fire Beetle
 
Join Date: May 2010
Posts: 10
Default Random item number generator

Using the global_npc.pl file with the subroutine EVENT_SPAWN and attempting to generate a random loot id number. Has anyone run into an issue where srand() is implicitly called to seed rand() and is causing a limited of possible numbers?

I am seeing issues of numbers being generated multiple times while others are never. rand(100000) for instance.

I just do not feel 94823 should be generated 20 times, while 94823 never is generated. It looks like only a fraction of the numbers are being chosen , while a large amount are being repeated.

my $addid = ( int rand 100000 ) + 1001;

Thanks for your time.
Reply With Quote
Reply


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