We are trying to figure out a couple things in relation to jewelry skill drops and the + to skill that can drop.....

So when the random generator determines a piece of jewelry is going to drop and on that piece of jewelry it is determined to drop with a skill ability, what is the file (we cannot locate what file controls this) that lists the possible skills that could drop on that piece of jewelry? Im trying to expand and add to that skill list so that more possible skills can then be randomly dropped on jewelry as the skill list currently is quite small.

Also in addition to that we are using what i believe is the standard UO drop for the +skills, currently only +1,+5, +10 and +15 can drop on jewelry and we are trying to allow it to drop anything randomly between +1 and +15 not the set amounts. Where is that file (again we cannot locate what file controls this) located that determines the +skill add that can drop?

After the files are located im sure we will need scripting assistance how to modify those files to do what we would like them to do.

Thanks so much for the replies community, I appreciate it!
 
https://github.com/ServUO/ServUO/bl...rvices/RunicReforging/RunicReforging.cs#L1557

add a comma to the end of SkillName.Ninjitsu and then add whatever skills you want following the same format. just make sure the last skill in the list doesn't have the comma



Zero your awesome mate, thank you! Anything on where I can change the + that drops on the skills for jewelry? Currently only +1, +5, +10 and +15 drop but we want it to be random from +1 to +15. Where and how do i change that?
 
https://github.com/ServUO/ServUO/bl...rvices/RunicReforging/RunicReforging.cs#L2438

Code:
value = CalculateValue(sk, 1, 15, perclow, perchigh, ref budget, luckchance, playerMade);

CalculateValue(object attribute, int min, int max, int perclow, int perchigh, ref int budget, int luckchance)

so 1, 15 is min and max value for skill bonuses, that's where you should change it


So in your example here it should read like how you show it? Which mine does read like how you show it..........so if its showing 1 as min and 15 as max.....why does it currently only drop 1,5,10 or 15 for the adds and not randomly between the 1 and 15?

Mine reads as follows in that section:

value = CalculateValue(sk, 1, 15, perclow, perchigh, ref budget, luckchance);
skillbonuses.SetValues(skillIdx, sk, value);
budget -= Imbuing.GetIntensityForAttribute(sk, -1, value);
 
because it's set to use on 1 or intervals of 5.
are you saying you literally want it to use any number between 1 and 15?
 
Just incase I wasent clear there.......Yes our goal is to literally have it be random from 1 to 15 for the +skill value dropped.


Anyone else have an ideas on this? How to make the +skill add be a random add from 1 to 15 instead of our current set up that will only drop +1, +5, +10 and +15?
 
sorry, Life keeps me busy

i believe if you do this it should achieve what you're wanting to do

Code:
int max = Utility.RandomMinMax( 2, 15); //added
                        //value = CalculateValue(sk, 1, 15, perclow, perchigh, ref budget, luckchance, true);
                        value = CalculateValue(sk, 1, max, perclow, perchigh, ref budget, luckchance, true);
 
sorry, Life keeps me busy

i believe if you do this it should achieve what you're wanting to do

Code:
int max = Utility.RandomMinMax( 2, 15); //added
                        //value = CalculateValue(sk, 1, 15, perclow, perchigh, ref budget, luckchance, true);
                        value = CalculateValue(sk, 1, max, perclow, perchigh, ref budget, luckchance, true);


Ill give it a try Zero, thanks!

Would I want to add this in my reforging file like i made the changes to for the skills, or am I replacing what is there already (like we talked about above) in the reforging file?
 
Last edited:
Thanks for your help zerodowned.

We tried the changes you gave and it didn't work. Skills still dropped in 1,5,10,15 adds.

I found this in the jewelry portion of BaseRunicTool.cs
Code:
case 19:
                        ApplySkillBonus(skills, min, max, 0, 1, 15);
                        break;
                    case 20:
                        ApplySkillBonus(skills, min, max, 1, 1, 15);
                        break;
                    case 21:
                        ApplySkillBonus(skills, min, max, 2, 1, 15);
                        break;
                    case 22:
                        ApplySkillBonus(skills, min, max, 3, 1, 15);
                        break;
                    case 23:
                        ApplySkillBonus(skills, min, max, 4, 1, 15);
                        break;
That wouldn't have anything to do with it would it? Seems like we should be able to use something along the lines of Utility.RandomMinMax(1, 15) somewhere in those lines, but I could be way off.

Below is what I believe is the entire code block for jewelry stats from the same file.
Code:
public static void ApplyAttributesTo(BaseJewel jewelry, int attributeCount, int min, int max)
        {
            ApplyAttributesTo(jewelry, false, 0, attributeCount, min, max);
        }

        public static void ApplyAttributesTo(BaseJewel jewelry, bool isRunicTool, int luckChance, int attributeCount, int min, int max)
        {
            m_IsRunicTool = isRunicTool;
            m_LuckChance = luckChance;

            AosAttributes primary = jewelry.Attributes;
            AosElementAttributes resists = jewelry.Resistances;
            AosSkillBonuses skills = jewelry.SkillBonuses;

            m_Props.SetAll(false);

            for (int i = 0; i < attributeCount; ++i)
            {
                int random = GetUniqueRandom(24);

                if (random == -1)
                    break;

                switch ( random )
                {
                    case 0:
                        ApplyAttribute(resists, min, max, AosElementAttribute.Physical, 1, 15);
                        break;
                    case 1:
                        ApplyAttribute(resists, min, max, AosElementAttribute.Fire, 1, 15);
                        break;
                    case 2:
                        ApplyAttribute(resists, min, max, AosElementAttribute.Cold, 1, 15);
                        break;
                    case 3:
                        ApplyAttribute(resists, min, max, AosElementAttribute.Poison, 1, 15);
                        break;
                    case 4:
                        ApplyAttribute(resists, min, max, AosElementAttribute.Energy, 1, 15);
                        break;
                    case 5:
                        ApplyAttribute(primary, min, max, AosAttribute.WeaponDamage, 1, 25);
                        break;
                    case 6:
                        ApplyAttribute(primary, min, max, AosAttribute.DefendChance, 1, 15);
                        break;
                    case 7:
                        ApplyAttribute(primary, min, max, AosAttribute.AttackChance, 1, 15);
                        break;
                    case 8:
                        ApplyAttribute(primary, min, max, AosAttribute.BonusStr, 1, 8);
                        break;
                    case 9:
                        ApplyAttribute(primary, min, max, AosAttribute.BonusDex, 1, 8);
                        break;
                    case 10:
                        ApplyAttribute(primary, min, max, AosAttribute.BonusInt, 1, 8);
                        break;
                    case 11:
                        ApplyAttribute(primary, min, max, AosAttribute.EnhancePotions, 5, 25, 5);
                        break;
                    case 12:
                        ApplyAttribute(primary, min, max, AosAttribute.CastSpeed, 1, 1);
                        break;
                    case 13:
                        ApplyAttribute(primary, min, max, AosAttribute.CastRecovery, 1, 3);
                        break;
                    case 14:
                        ApplyAttribute(primary, min, max, AosAttribute.LowerManaCost, 1, 8);
                        break;
                    case 15:
                        ApplyAttribute(primary, min, max, AosAttribute.LowerRegCost, 1, 20);
                        break;
                    case 16:
                        ApplyAttribute(primary, min, max, AosAttribute.Luck, 1, 100);
                        break;
                    case 17:
                        ApplyAttribute(primary, min, max, AosAttribute.SpellDamage, 1, 12);
                        break;
                    case 18:
                        ApplyAttribute(primary, min, max, AosAttribute.NightSight, 1, 1);
                        break;
                    case 19:
                        ApplySkillBonus(skills, min, max, 0, 1, 15);
                        break;
                    case 20:
                        ApplySkillBonus(skills, min, max, 1, 1, 15);
                        break;
                    case 21:
                        ApplySkillBonus(skills, min, max, 2, 1, 15);
                        break;
                    case 22:
                        ApplySkillBonus(skills, min, max, 3, 1, 15);
                        break;
                    case 23:
                        ApplySkillBonus(skills, min, max, 4, 1, 15);
                        break;
                }
            }
        }
 
AOS.cs

this should be it, but i honestly don't know quite how to read all of it other than the for loop arguments

Code:
public bool GetValues(int index, out SkillName skill, out double bonus)
        {
            int v = this.GetValue(1 << index);
            int vSkill = 0;
            int vBonus = 0;

            for (int i = 0; i < 16; ++i)
            {
                vSkill <<= 1;
                vSkill |= (v & 1);
                v >>= 1;

                vBonus <<= 1;
                vBonus |= (v & 1);
                v >>= 1;
            }

            skill = (SkillName)vSkill;
            bonus = (double)vBonus / 10;

            return (bonus != 0);
        }
 
I realized that it was just like hard coding a skill bonus to an item: SkillBonuses.SetValues(0, SkillName.EvalInt, 10);

line 2242 in runicreforging, change
Code:
skillbonuses.SetValues(skillIdx, sk, value);
to this
int skillMinMax= Utility.RandomMinMax( 1, 15); //added
skillbonuses.SetValues(skillIdx, sk, skillMinMax);

Also, change this line just below that to make sure the skill bonus is being correctly deducted from the "budget" for random properties
budget -= Imbuing.GetIntensityForAttribute(item, sk, -1, value);
change to
budget -= Imbuing.GetIntensityForAttribute(item, sk, -1, skillMinMax);

upload_2017-8-23_5-4-25.png
upload_2017-8-23_5-4-52.png
upload_2017-8-23_5-5-29.png
 
Thank you so much zerodowned! That worked! I had a few errors at first, but then I realized my script didn't have the "item" bit on the budget line. I took that out and it worked perfectly. Thank you, thank you
 
Back