The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm6 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RAND and Functions
Author Message
Mazer
Apprentice
*

Posts: 2
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Jan 2014
Reputation: 1



Post: #2
RE: RAND and Functions
Im sorry im not best scripter in UO, but as i understand EVAL RAND(500) is random number between 0 and 500 second i dont really know how SRC.SKILL return value 50.5% skill its 505 or 50.5.
And you should start from easiest function. With 50% of skill if its 50.0. The chance to get last ELSEIF is about 1:30000. You really want this ?
If you could declare random value in the beginning of the script. etc
x = EVAL RAND(500) + SKILL if player have 50% skill and he rolls 100, x would be 150 then declaring chances

if X >= 550 then
function1 (rarest)
elseif x >= 400 then
function2
elseif x >= 300 then
function3
elseif x < 300 then
function4

function1 gona happen 1:500 times with 50% skill and 50:500 with 100% skill
function 2 gona happen 150:500 times with 50% skill and 200:500 with 100% skill
function 3 gona happen 250:500 times with 50% skill and 300:500 with 100% skill
and function4 gona happen 350:500 times with 50% skill and 400:500 with 100% skill
(This post was last modified: 02-03-2014 09:54 PM by Mazer.)
02-03-2014 09:49 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
RAND and Functions - pinku - 02-03-2014, 06:06 PM
RE: RAND and Functions - Mazer - 02-03-2014 09:49 PM
RE: RAND and Functions - Alaric - 02-03-2014, 10:15 PM
RE: RAND and Functions - Coruja - 02-04-2014, 12:46 PM
RE: RAND and Functions - pinku - 02-04-2014, 04:58 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)