Suggestion for perl quest random function
Code:
XS(XS__ChooseRandom); |
Not sure I quite understand, however perl has it's own rand functions that's quite useful if you want to write a plugin to do something with random that isn't provided by the code. So I don't really have to understand and implement it and you can still write it in perl.
http://perldoc.perl.org/functions/rand.html |
I already have a plugin for this:
http://www.eqemulator.org/forums/showthread.php?t=30421 You can create a new plugin file as it suggests, or just add it to any of your existing plugin files. |
sorry i haven't checked these forums in a while, but what i was trying to do was get the function the quests call to get random values more diverse.
The root cause is really that eqemu is using the build in c random number generator. http://www-personal.umich.edu/~wagnerr/MersenneTwister.html is a far better choice and wouldn't take much at all to put into use. |
my @moo = (221,222,223);
my $choice = rand @moo; my $picked = $moo[$choice]; $moo = undef; $choice = undef; $picked = undef; |
Quote:
|
All times are GMT -4. The time now is 02:21 AM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.