Battle System and Player Started Battles

Staff

Young Player Help
Hey guys, I am currently working on some code that will allow players to start their own CTFs, FFAs and Battle of Winds. What I need from you guys is a general list/value of items.

Code:
        public int WeaponValue(BaseWeapon w)
        {
            int value = 0;
            if (w.DamageLevel == WeaponDamageLevel.Regular)
            {
                value += 300;
            }
            if (w.DamageLevel == WeaponDamageLevel.Ruin)
            {
                value += 5000;
            }
            if (w.DamageLevel == WeaponDamageLevel.Might)
            {
                value += 5000;
            }
            if (w.DamageLevel == WeaponDamageLevel.Power)
            {
                value += 5000;
            }
            if (w.DamageLevel == WeaponDamageLevel.Vanq)
            {
                value += 5000;
            }
            if (w.Quality == WeaponQuality.Exceptional)
            {
                value += 5000;
            }
            if (w.Slayer > SlayerName.None)
            {
                value += 5000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Regular)
            {
                value += 5000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Accurate)
            {
                value += 5000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Surpassingly)
            {
                value += 5000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Eminently)
            {
                value += 5000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Exceedingly)
            {
                value += 5000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Supremely)
            {
                value += 5000;
            }
            return value;
        }

        public int ArmorValue(BaseArmor a)
        {
            int value = 0;
            if (a.MaterialType == ArmorMaterialType.Plate)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Barbed)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Bone)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Chainmail)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Dragon)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Horned)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Leather)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Ringmail)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Spined)
            {
                value += 300;
            }
            if (a.MaterialType == ArmorMaterialType.Studded)
            {
                value += 300;
            }

            if (a.Quality == ArmorQuality.Exceptional)
            {
                value += 300;
            }

            if (a.ProtectionLevel == ArmorProtectionLevel.Regular)
            {
                value += 300;
            }

            if (a.ProtectionLevel == ArmorProtectionLevel.Defense)
            {
                value += 300;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Guarding)
            {
                value += 300;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Hardening)
            {
                value += 300;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Fortification)
            {
                value += 300;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Invulnerability)
            {
                value += 300;
            }
            return value;
        }

That format would be great. For weapons, I need a base value for ruin to vanq then extra value for the modifiers. Same thing for armor. It would be great if you guys could just provide me with values for anything that comes to mind. Thanks!
 

Kraden

Grandmaster
Out of curiosity you need the value of the Serial? or Gold lol sorry im slow. Just asking cause id like to help out any way i can
 

Staff

Young Player Help
I need in-game values for vanqs and armor. Also CBDs would be nice. Anything you guys can think of really. The idea is that you put an item in a well and when the well reaches 1million points, an event starts (specific to that well).
 

omnom

Grandmaster
Are you asking us for arbitrary figures which we think fairly represent the item attributes? Or are these values which can be extrapolated from items using an app?

Also, isn't it better to use a switch statement, rather than a series of if statements? Would be a little cleaner IMO :p
 

Nurayia

Expert
Also, you forgot Force!
Code:
if (w.DamageLevel == WeaponDamageLevel.Force)
{
value += 5000;
}
Sadly I cleared out all my plain force and lesser items. Will add info asap.

However, shouldn't you be able to find all this in the section where vendor buying price is calculated? I'm a bit confused here.

A few thoughts on player vendor /ingame prices, they change and they're kept simple from what I've seen (like 3k for force weps, 5k for power, not discerning what other attributes are on it as long as they're only tier 1-3). Also the durability won't matter much unless its a reeeeally high-end weapon. So I'd just add 50-100g per durability level and only if the item is actually anything better than force, because noone would pay for durability on a weapon they'd not use anyway. Similar for accuracy. Its no use on a weapon below power and worth most on a vanq... Shields are highly undervalued too because few ppl actually use parry.
 
Last edited by a moderator:

Lavos

Master
Assuming the values are arbitrary values to reach a 1 million point goal, and not actual selling for gold values:


Code:
        public int WeaponValue(BaseWeapon w)
        {
            int value = 0;
            if (w.DamageLevel == WeaponDamageLevel.Regular)
            {
                value += 100;
            }
            if (w.DamageLevel == WeaponDamageLevel.Ruin)
            {
                value += 2000;
            }
            if (w.DamageLevel == WeaponDamageLevel.Might)
            {
                value += 4000;
            }
            if (w.DamageLevel == WeaponDamageLevel.Power)
            {
                value += 6000;
            }
            if (w.DamageLevel == WeaponDamageLevel.Vanq)
            {
                value += 9000;
            }
            if (w.Quality == WeaponQuality.Exceptional)
            {
                value += 500;
            }
            if (w.Slayer > SlayerName.None)
            {
                value += 4000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Regular)
            {
                value += 100;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Accurate)
            {
                value += 500;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Surpassingly)
            {
                value += 1000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Eminently)
            {
                value += 1500;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Exceedingly)
            {
                value += 2000;
            }
            if (w.AccuracyLevel == WeaponAccuracyLevel.Supremely)
            {
                value += 3000;
            }
            return value;
        }

        public int ArmorValue(BaseArmor a)
        {
            int value = 0;
            if (a.MaterialType == ArmorMaterialType.Plate)
            {
                value += 1000;
            }
            if (a.MaterialType == ArmorMaterialType.Barbed)
            {
                value += 800;
            }
            if (a.MaterialType == ArmorMaterialType.Bone)
            {
                value += 200;
            }
            if (a.MaterialType == ArmorMaterialType.Chainmail)
            {
                value += 1000;
            }
            if (a.MaterialType == ArmorMaterialType.Dragon)
            {
                value += 1500;
            }
            if (a.MaterialType == ArmorMaterialType.Horned)
            {
                value += 800;
            }
            if (a.MaterialType == ArmorMaterialType.Leather)
            {
                value += 1500;
            }
            if (a.MaterialType == ArmorMaterialType.Ringmail)
            {
                value += 800;
            }
            if (a.MaterialType == ArmorMaterialType.Spined)
            {
                value += 800;
            }
            if (a.MaterialType == ArmorMaterialType.Studded)
            {
                value += 800;
            }

            if (a.Quality == ArmorQuality.Exceptional)
            {
                value += 200;
            }

            if (a.ProtectionLevel == ArmorProtectionLevel.Regular)
            {
                value += 100;
            }

            if (a.ProtectionLevel == ArmorProtectionLevel.Defense)
            {
                value += 1000;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Guarding)
            {
                value += 2000;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Hardening)
            {
                value += 2500;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Fortification)
            {
                value += 3500;
            }
            if (a.ProtectionLevel == ArmorProtectionLevel.Invulnerability)
            {
                value += 4000;
            }
            return value;
        }

It would be great if you guys could just provide me with values for anything that comes to mind. !

If you're looking for more items to value for this, I would say make halloween candy worth 50 points each, there's probably thousands of these on the server. Could really reduce server save times.

Looking forward to this system, hope this helps!
 

halygon

Grandmaster
I've never coded for UO but logically speaking, i would think you would want to throw in an extra variable for each item type. A global type variable that can be used to raise all values up or down for when you are tuning the values to work properly for your end goal.
 

omnom

Grandmaster
Yeah, it's probably better to just edit the BaseWeapon and BaseArmor objects by adding a ListValue parameter and just do:

public int WeaponValue(BaseWeapon w) {
return w.ListValue;
}

public int ArmorValue(BaseArmor a) {
return a.ListValue;
}

Simple. Condensed. OOP.
 

Nurayia

Expert
Yeah thats something I forgot to add, a vanq pickaxe (I actually found one!!) is great but nobody will ever buy it. Meh.
 

Staff

Young Player Help
Yeah, it's probably better to just edit the BaseWeapon and BaseArmor objects by adding a ListValue parameter and just do:

public int WeaponValue(BaseWeapon w) {
return w.ListValue;
}

public int ArmorValue(BaseArmor a) {
return a.ListValue;
}

Simple. Condensed. OOP.

We try to keep our code modular and not edit the distro when we don't need to.
 

Staff

Young Player Help
I've never coded for UO but logically speaking, i would think you would want to throw in an extra variable for each item type. A global type variable that can be used to raise all values up or down for when you are tuning the values to work properly for your end goal.

I don't think you could just throw in a single variable to track valuation of an object such as a weapon. You'd need to control all of the properties as well. So, I would need to create an interface or just an item to props off of which would allow me to control all the the properties such damage and tactics modifiers for proper valuation of the item.

I could also make a list, serialize it to some item and just allow staff to add items and their values as they see fit. however, this is getting out of the realm of how much work I want to do on something I scripted in 30 minutes as a way for players to start a battle.
 

omnom

Grandmaster
I like the list idea, you could create an int list of possible attributes as a name/value pair and assign the value on a per-attribute basis. Then you could use a single function to calculate the total "cost" of the item by doing something like:

value += List[w.DamageLevel] + List[w.Slayer] + list[w.AccuracyLevel];

This would be much easier to maintain as the list can then be centralised in one location. It would be much more human-readable than a series of if conditions as well.
 
Top