 ____                 _ _   _              
|  _ \               | | \ | |            
| (_) |__ _ _ __   __| |  \| |_   _ _ _ _       
|    //  ' | '_ \ / _  |     | | | | ' ' |         
| |\ \ (_) | | | | (_) | |\  | |_| | |v| |      
|_| \_\__,_|_| |_|\__,_|_| \_|\__,_|_| |_|          
 _____  _____ __  __           _ 
|  __ \/ __  |  \/  |         | |
| |  | \/ / /| \  / | ___   __| |
| |  | | / / | |\/| |/ _ \ / _  |
| |__| |/ /__| |  | | (_) | (_) |
|_____//_____|_|  |_|\___/ \____|
 ____  _             _       
|  _ \| |           (_)      
| (_) | |_   _  __ _ _ _ __  
|  __/| | | | |/ _` | | `_ \ 
| |   | | |_| | (_) | | | | |
|_|   |_|\__,_|\__, |_|_| |_|
                __/ |        
               |___/         

Version 1.0 - 11/5/5

This plugin is made for the D2Mod system, so you will need to have it installed in your Diablo II directory, or in your mod folder.

What does this plugin do?	

It gives you a random stat, that you can use for any random needs, like in Skills.txt or anywhere with a calc column. You could also use it in itemstatcost as a random multiplier or something. The method is there, the innovation is up to you.

>>-<_D2Mod Installation_>-<<
1) Insert this line into the [D2Mod] section of D2Mod.ini:

	RandNum=RandNum.dll

2) Add these lines to the bottom:

;------------------------------------------------

[RandNum]

;RandStat = ID of randstat in itemstatcost (default=183)
RandStat = 183

;------------------------------------------------

3) Put RandNum.dll in the same directory as the D2Mod ini file (either Diablo II directory or mod directory).

4) Follow the usage steps below.

>>-<_Usage_>-<<

Zip file has 3 files:
RandNum.dll
Readme-RandNum1.0.txt
ItemStatCost-rnd.txt

DO NOT overwrite your itemstatcost with the included file. Copy the line into any unused row (you can find lots of them around ID 183-213). Don't forget to change the ID so its still in running order.

Finally if the randstat ID is not 183, change the RandStat value in the ini file to match the ID.

What is happening?

The value of the randstat will change often, and it will be a random value between 0 to 99,999 (by default). You could use this as a super precise percentage check in skills.txt or a bunch of other things.

>>-<_Extra Customisation_>-<<

You can tweak the output by using two more commands

RandDiv = <some value>
RandAdd = <some other value>

The final output will be a value between (RandAdd) - (RandAdd+RandDiv-1). RandAdd accepts negative values up to -100000 (I don't think anyone needs that sort of negative precision though) RandDiv takes up to 4294967295 (I don't think anyone needs that sort of precision either... but just in case you've got some REALLY queer formula) You can adjust these things in your itemstatcost (columns SaveBits and SaveAdd - there are posts in GMM to teach you how those work)

If you just want a random boolean, Use RandDiv = 2 (you'll get 0 and 1 for output)
If you want -5 to 5, use RandDiv = 11 and RandAdd = -5

You get the drift :) Enjoy!

>>-<_To Do_>-<<

Not much if anything. Let me know if you can think of something else to do to this. I could have made multiple random stats, but most modders don't want to waste all the extra stat real estate space. I'll put a post in GMM on how to use Skills.txt to create any number of random values from 1 random value.

-------------

Thanks for trying this plug-in out. If there are any bugs or queries, PM me in the Keep.

Cheers,
RicFaith