Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
58 stars 45 forks source link

[Question] Static ArmorLayers Part Percents #1173

Open canerksk opened 1 year ago

canerksk commented 1 year ago

These percentages are different in most emulators. Can we improve these percentage calculations so that they can be adjusted with default? For example, wouldn't it be nice to be able to set the percentage protection for which region within the defname?

Also, I think there is a manually entered fixed randomness setting here,

7, 35

I think this value indicates the minimum and maximum values that provide protection to other body parts except the shield. This part seems to be a critical part for servers to adjust their combat mechanisms according to themselves, and I think it should not be fixed.

Of course, if the defname is not entered at all or is set to zero, it will still use its own values.

The places I mentioned are below;

int iArMax = iArmorRating * Calc_GetRandVal2(7,35) / 100;


static const CArmorLayerType sm_ArmorLayers[ARMOR_QTY] =
{
    { 15,   sm_ArmorLayerHead },    // ARMOR_HEAD, 15% of the armour value will be applied.
    { 7,    sm_ArmorLayerNeck },    // ARMOR_NECK, 7% of the armour value will be applied.
    { 0,    sm_ArmorLayerBack },    // ARMOR_BACK, 0% of the armour value will be applied.
    { 35,   sm_ArmorLayerChest },   // ARMOR_CHEST, 35% of the armour value will be applied.
    { 14,   sm_ArmorLayerArms },    // ARMOR_ARMS, 14% of the armour value will be applied.
    { 7,    sm_ArmorLayerHands },   // ARMOR_HANDS, 7% of the armour value will be applied.
    { 22,   sm_ArmorLayerLegs },    // ARMOR_LEGS, 22% of the armour value will be applied.
    { 0,    sm_ArmorLayerFeet },    // ARMOR_FEET, 0% of the armour value will be applied.
    {100,   sm_ArmorLayerShield }   // ARMOR_SHIELD, 100% of the armour value will be applied, this only used if CombatParryEra flag PARRYERA_ARSCALING is enabled
};

For example, what if we could set it in defname like this?

[DEFNAME ArmorDefencePercents]
LayerHeadPerc = 15
LayerNeckPerc = 7
LayerBackPerc = 0

CalcRand 7,15 (or, if possible, the minimum and maximum values ​​entered among the def definitions can be automatically found and added.)

etc.
xwerswoodx commented 1 year ago

Um, could be good idea to have this, I like that idea honestly, let us to customize armors more better than now, even can have an option under itemdef instead of defname to customize differently for every armor. Or we can have both defname for global settings and itemdef option to change it for specific armors.

Jhobean commented 1 year ago

Yes could be nice. Ini setting or a define in script.

drk84 commented 1 year ago

The % coverage is just for the AC value in the status menu, it's not actually used in combat, that's why there is the rand 7,35.

What about an item property like "coverage"/""armorcoverage" that allows the user to customize the % armour value used? If this value is not set, the default values are used otherwise the value in "coverage"/"armorcoverage" is used