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-nmm7 (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-nmm7 (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-nmm7 (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
R99
Author Message
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #1
R99
Hello. I noticed that chance for treasure maps by default is R99 in loot templates. I have a question, is it possible to use R100 or R150 for example? Will be it as 1 for 150 or how that random calculates?
04-19-2013 04:53 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #2
RE: R99
the higher the number the harder to get...


,R2 = 50% chance

Dragons of Time 2000-2020
http://dragonsoftime.com
(This post was last modified: 04-19-2013 05:41 PM by x77x.)
04-19-2013 05:40 PM
Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #3
RE: R99
I though function R works only when less than 100, because it was R99 in script, but not R100 Smile

Thanks.
04-19-2013 05:59 PM
Find all posts by this user Like Post Quote this message in a reply
UltimaAku
Journeyman
*

Posts: 125
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 1



Post: #4
RE: R99
Your right Art, it stops at 99, but if you want to make an item rarer than 99, you would have to add a variance in your script.

At 99, theres a 1% chance of dropping the loot (i think?) so if you want it lower add this to your npc

ON=@DEATH
VAR.RAND=<EVAL {1 1000}>
IF (<VAR.RAND><=5) //0.5% Chance Loot Drop
NEWITEM=i_something_rare
ACT.BOUNCE
RETURN 0
ENDIF

It does add a variance on R100 but it seems to only make it more common than R99, which i dont understand...
(This post was last modified: 04-21-2013 07:35 PM by UltimaAku.)
04-21-2013 07:31 PM
Find all posts by this user Like Post Quote this message in a reply
x77x
Master
**

Posts: 488
Likes Given: 0
Likes Received: 15 in 15 posts
Joined: Mar 2012
Reputation: -4



Post: #5
RE: R99
sorry, i never knew 99 was the limit...

Dragons of Time 2000-2020
http://dragonsoftime.com
04-22-2013 07:00 AM
Find all posts by this user Like Post Quote this message in a reply
Wap
Journeyman
*

Posts: 138
Likes Given: 6
Likes Received: 7 in 6 posts
Joined: Mar 2012
Reputation: 3

UORPG.net

Post: #6
RE: R99
Mmmm... I think, there are no limit here. I will test this tomorrow.
04-22-2013 11:18 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #7
RE: R99
There is no limit, I use a lot R1000 without any problem. In fact If you use only R, a R1000 is executed in his place.

Note that R2 goes from 0 to 1, R99 goes from 0 to 98, R100 goes from 0 to 99, and R1000, from 0 to 999.
There is always one less number that you put in the random. If you want a random who begins at other number different of zero, use:

R1,10 to numbers from 1 to 10
R5,10 to numbers from 5 to 10
(This post was last modified: 04-22-2013 09:41 PM by Gil Amarth.)
04-22-2013 09:36 PM
Find all posts by this user Like Post Quote this message in a reply
Rattlehead
Master
**

Posts: 290
Likes Given: 3
Likes Received: 8 in 6 posts
Joined: Jun 2012
Reputation: 8



Post: #8
RE: R99
(04-21-2013 07:31 PM)UltimaAku Wrote:  Your right Art, it stops at 99, but if you want to make an item rarer than 99, you would have to add a variance in your script.

At 99, theres a 1% chance of dropping the loot (i think?) so if you want it lower add this to your npc

ON=@DEATH
VAR.RAND=<EVAL {1 1000}>
IF (<VAR.RAND><=5) //0.5% Chance Loot Drop
NEWITEM=i_something_rare
ACT.BOUNCE
RETURN 0
ENDIF

It does add a variance on R100 but it seems to only make it more common than R99, which i dont understand...

using vars is actually a bad idea, use locals instead:

ON=@DEATH
LOCAL.RAND=<EVAL {1 1000}>
IF (<LOCAL.RAND><=5) //0.5% Chance Loot Drop
SERV.NEWITEM i_something_rare
NEW.CONT <SRC.FINDLAYER.21.UID>
RETURN 0
ENDIF

Rx is ok to use i guess, but u have better control if u use ur own algorithm, please correct me if i am wrong.

[Image: matts_siggy.gif]
(This post was last modified: 04-27-2013 05:47 PM by Rattlehead.)
04-27-2013 05:43 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #9
RE: R99
LOCAL.RAND=<EVAL {1 1000}>
IF (<LOCAL.RAND><=5) //0.5% Chance Loot Drop

has the same results as

IF (<R1,1000><=5) //0.5% Chance Loot Drop

which is the same as

IF (<R><=5) //0.5% Chance Loot Drop

...except that in these versions, there less for the server to do since there is less script to parse, no allocation of memory for the temporary local string variable, no evaluation of the random {}, no assignment of the resulting integer to the string value, no re-evaluation of the string back to an integer in the if statement...

To be fair however, this all takes place in microseconds.inside a @Death trigger that does not get called all that often. :-)
04-28-2013 12:13 AM
Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #10
RE: R99
Hm Smile

So, if (<r> <= 5) is same as R200 or better? And have anyone tested, is item=i_test,R200 working if R more than 99 ?
04-28-2013 05:18 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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