Go Back   RunUO - Ultima Online Emulation > RunUO > Server Support on Windows

Server Support on Windows Get (and give) support on general questions related to the RunUO server itself.

Reply
 
Thread Tools Display Modes
Old 09-29-2005, 03:13 PM   #1 (permalink)
 
Join Date: Sep 2005
Location: somewhere in outer space...
Age: 32
Posts: 12
Send a message via AIM to iNFiNiTE415
Default Magery Skill % Chance Calculation

Ok, so I'm trying to write a magic tool for RunUO/Razor. I want to calculate the % chance of casting a certain circle based on the magery skill I'm getting from Razor.

If anyone knows or can double check this I would appreciate it greatly. Here is the algorithm I'm am using. It's based off of calculations I found in SkillCheck.cs and Spell.cs. I want these calculations to be the same as the ones in RunUO.

1) Calculate the minimum and maximum skill required for a circle.
2) Check if skill is in bounds.
3) Calculate percent chance.

Code:
ChanceOffset: Double = 20.0;
ChanceLength: Double = (100.0 / 7.0);

avg = ChanceLength * circle;
min = avg - ChanceOffset;
max = avg + ChanceOffset;

if (skill < min) then
  // too difficult
else
  if (skill >= max) then
    // 99% chance

chance = ((skill - min) / (max - min)) * 100;  // calculate % chance
iNFiNiTE415 is offline   Reply With Quote
Old 09-29-2005, 03:46 PM   #2 (permalink)
Account Terminated
 
Join Date: Sep 2002
Age: 26
Posts: 3,846
Send a message via ICQ to Phantom Send a message via AIM to Phantom Send a message via MSN to Phantom
Default

Plugin some test cases, see if it works out by hand, if it does what you want test it out in game.
Phantom is offline   Reply With Quote
Old 09-29-2005, 05:23 PM   #3 (permalink)
 
Join Date: Sep 2005
Location: somewhere in outer space...
Age: 32
Posts: 12
Send a message via AIM to iNFiNiTE415
Default Inital Findings

Here is what I am getting from the algorithm.

Minimum and Maximum Magery Skill per Circle:
Code:
1st: min=-5.71428571428571 | max=34.2857142857143
2nd: min=8.57142857142857 | max=48.5714285714286
3rd: min=22.8571428571429 | max=62.8571428571429
4th: min=37.1428571428571 | max=77.1428571428571
5th: min=51.4285714285714 | max=91.4285714285714
6th: min=65.7142857142857 | max=105.714285714286
7th: min=80 | max=120
8th: min=94.2857142857143 | max=134.285714285714
This is the percent chance by circle to successfully cast a spell with the given magery skill. I've broken the results down by Skill in increments of 10. This would look much nicer in a graph which I will do once it's finialize.

MagerySkill=0
1st: chance=14.2857142857143
2nd+ 0% chance

MagerySkill=10
1st: chance=39.2857142857143
2nd: chance=3.57142857142857
3rd+ 0% chance

MagerySkill=20
1st: chance=64.2857142857143
2nd: chance=28.5714285714286
3rd: 0% chance

MagerySkill=30
1st: chance=89.2857142857143
2nd: chance=53.5714285714286
3rd: chance=17.8571428571428
4th+ 0% chance

MagerySkill=40
1st: 99%
2nd: chance=78.5714285714286
3rd: chance=42.8571428571428
4th: chance=7.14285714285714
5th+ 0% chance

MagerySkill=50
1st-2nd: 99%
3rd: chance=67.8571428571428
4th: chance=32.1428571428571
5th+ 0% chance

MagerySkill=60
1st-2nd: 99%
3rd: chance=92.8571428571428
4th: chance=57.1428571428572
5th: chance=21.4285714285714
6th+ 0% chance

MagerySkill=70
1st-3rd: 99%
4th: chance=82.1428571428572
5th: chance=46.4285714285714
6th: chance=10.7142857142857
7th+ 0% chance

MagerySkill=80
1st-4th: 99%
5th: chance=71.4285714285714
6th: chance=35.7142857142857
7th: chance=0
8th: 0%

MagerySkill=90
1st-4th: 99%
5th: chance=96.4285714285714
6th: chance=60.7142857142857
7th: chance=25
8th: 0%

MagerySkill=100
1st-5th: 99%
6th: chance=85.7142857142857
7th: chance=50
8th: chance=14.2857142857143

MagerySkill=110
1st-6th: 99%
7th: chance=75
8th: chance=39.2857142857143

MagerySkill=120
1st-7th: 99%
8th: chance=64.2857142857143

Once I test this ingame I will post my findings. If anyone else knows some of these numbers don't make sense please let me know.

Peace,
-Z
iNFiNiTE415 is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5