FIXED CUSIDHE - UNIQUE COLOR CHANCE ISSUE

czekolada

Newbie III
Supporter
With current code there is only 2,14% of chance to get non-standard colors. According to UO GUIDE there should be 15% of chance to get unique color in total (~85% for standard hue). Details you can find in the attached screenshot (except for the most unique color (blaze or fire) which should be compared to 1 not 2 as in the attachment). If there are any question just ask.

UO GUIDE DETAILS: http://www.uoguide.com/Cu_Sidhe

Code:
   Spawn  rate %    color
                    hue
   20000  85.830%   2216 Standard
   500    2.146%    2422 Dull Copper
   500    2.146%    2424 Copper
   500    2.146%    2303 Bronze
   500    2.146%    2218 Grey
   500    2.146%    1445 Agapite
   500    2.146%    1317 Sky Blue
   500    2.146%    1317 Echo Blue
   50     0.215%    1152 Ice Blue
   50     0.215%    1153 Pure White
   50     0.215%    1650 Wine Red
   50     0.215%    1199 Pink
   50     0.215%    1299 Valorite Blue #0
   50     0.215%    1107 Black
   1      0.004%    1161 or 1159 blaze/fire

SERVUO code:
Code:
            double chance = Utility.RandomDouble() * 23301;

            if (chance <= 1)
                Hue = 0x489;
            else if (chance < 50)
                Hue = Utility.RandomList(0x657, 0x515, 0x4B1, 0x481, 0x482, 0x455);
            else if (chance < 500)
                Hue = Utility.RandomList(0x97A, 0x978, 0x901, 0x8AC, 0x5A7, 0x527);

Fixed code:
Code:
            if (chance <= 1)
                Hue = Utility.RandomList(0x487, 0x489);
            else if (chance <= 300)
                Hue = Utility.RandomList(0x657, 0x515, 0x4B1, 0x481, 0x482, 0x455);
            else if (chance <= 3000)
                Hue = Utility.RandomList(0x97A, 0x978, 0x901, 0x8AC, 0x5A7, 0x527);

Calculation (except for the most unique color (blaze or fire) which should be compared to 1 not 2 as in the attachment):

6c85f35c21f9520edd635f797de57e37.png
 

raveX

Neophyte II
C# Nerd
Supporter
Assuming the chart from UO Guide is to be followed, I agree with this.

I think your fixed code is slightly wrong though as you are not taking into account how it is actually working. You are still giving an elevated rate of 87.13% chance for a normal CU.

The code should be:

C#:
if (chance <= 1)
   Hue = Utility.RandomList(0x487, 0x489);
else if (chance <= 301)
   Hue = Utility.RandomList(0x657, 0x515, 0x4B1, 0x481, 0x482, 0x455);
else if (chance <= 3301)
   Hue = Utility.RandomList(0x97A, 0x978, 0x901, 0x8AC, 0x5A7, 0x527);

Nice Find!
 
OP
C

czekolada

Newbie III
Supporter
Assuming the chart from UO Guide is to be followed, I agree with this.

I think your fixed code is slightly wrong though as you are not taking into account how it is actually working. You are still giving an elevated rate of 87.13% chance for a normal CU.

The code should be:

C#:
if (chance <= 1)
   Hue = Utility.RandomList(0x487, 0x489);
else if (chance <= 301)
   Hue = Utility.RandomList(0x657, 0x515, 0x4B1, 0x481, 0x482, 0x455);
else if (chance <= 3301)
   Hue = Utility.RandomList(0x97A, 0x978, 0x901, 0x8AC, 0x5A7, 0x527);

Nice Find!

You're right! Thanks. I will create a new pull request.
 

FireFly

Journeyman II
Supporter
According to Uo-Cah-as mosr actuall information-there is not 2 colors on list but its Fire/Blaze-that mean its one color not 2 diffrent ones.
 
OP
C

czekolada

Newbie III
Supporter
I checked the colors on the local and the other one (1159) seems to be wrong. See the attachment (left upper corner). I removed the new color from my pull request.

Bez tytułu.png
 

PLAY NOW

Heritage

Address
play.trueuo.com
Port
2593
Uptime
8 hours
Players Online
18
Houses
852
Vendors
297
Gold
5,019,541,935gp
Top Bottom