Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom Armor Rating Calculation?
Author Message
Baeguth
Apprentice
*

Posts: 12
Likes Given: 4
Likes Received: 0 in 0 posts
Joined: Aug 2017
Reputation: 0



Post: #1
Custom Armor Rating Calculation?
Hello!

I'm currently working on the combat system of my server and I would like to change the actual armor rating calculation that is implemented and described here : Sphere Default Armor Calculation

Is there any way to change the percentages of the layers?

Thank you,
08-11-2017 05:37 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Custom Armor Rating Calculation?
No, unless you change it in the source.

I think that even if you script it, the AR value displayed in the status will be based on the percentage of the layers found in the source code.

By the way the values on the wiki seems outdated, these are the new ones

static const CArmorLayerType sm_ArmorLayers[ARMOR_QTY] =
{
{ 15, sm_ArmorLayerHead }, // ARMOR_HEAD
{ 7, sm_ArmorLayerNeck }, // ARMOR_NECK
{ 0, sm_ArmorLayerBack }, // ARMOR_BACK
{ 35, sm_ArmorLayerChest }, // ARMOR_CHEST
{ 14, sm_ArmorLayerArms }, // ARMOR_ARMS
{ 7, sm_ArmorLayerHands }, // ARMOR_HANDS
{ 22, sm_ArmorLayerLegs }, // ARMOR_LEGS
{ 0, sm_ArmorLayerFeet } // ARMOR_FEET
};
(This post was last modified: 08-11-2017 09:03 PM by darksun84.)
08-11-2017 08:54 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Baeguth
Apprentice
*

Posts: 12
Likes Given: 4
Likes Received: 0 in 0 posts
Joined: Aug 2017
Reputation: 0



Post: #3
RE: Custom Armor Rating Calculation?
(08-11-2017 08:54 PM)darksun84 Wrote:  No, unless you change it in the source.

I think that even if you script it, the AR value displayed in the status will be based on the percentage of the layers found in the source code.

By the way the values on the wiki seems outdated, these are the new ones

static const CArmorLayerType sm_ArmorLayers[ARMOR_QTY] =
{
{ 15, sm_ArmorLayerHead }, // ARMOR_HEAD
{ 7, sm_ArmorLayerNeck }, // ARMOR_NECK
{ 0, sm_ArmorLayerBack }, // ARMOR_BACK
{ 35, sm_ArmorLayerChest }, // ARMOR_CHEST
{ 14, sm_ArmorLayerArms }, // ARMOR_ARMS
{ 7, sm_ArmorLayerHands }, // ARMOR_HANDS
{ 22, sm_ArmorLayerLegs }, // ARMOR_LEGS
{ 0, sm_ArmorLayerFeet } // ARMOR_FEET
};

Thank you as always.
However isnt a bit difficult to script new armors due to the percentage?
I have to consider that percentage in order to put the correct value that i want to be displayed...
08-11-2017 09:35 PM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 246
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #4
RE: Custom Armor Rating Calculation?
If you are using the old armour system (that means COMBAT_AOS_ELEMENTAL engine disabled) then yes, you will have to tweak the armour values until you get the desired results.

By the way, take note that when using the old armour system the damage will be not reduced by a percentage, instead it will be reduced by a flat amount, the percentage is just used for contributing to the total AR of a character.

Code:
First the value ArmorMax is calculated:

ArmorMax = AR * Random(7,35) / 100  

Then the value ArmorMin is calculated by halving ArmorMax
ArmorMin =  ArmorMax / 2

the flat amount reduction is calculated by using both ArmorMax and ArmorMin:
Reduction = Random(ArmorMin, (ArmorMax - ArmorMin + 1 )

If the damage is magical, reduction will be halved by 2.

Finally subtract  the reduction from the damage.
By doing some test its seems that:
With an AR of 100, you will reduce the amount of damage by a minimum of 3 and a maximum of 19.
With an AR of 10, you will reduce the amount of damage by a minimum of 0 ( no damage reduction) and a maximum of 3.
With an AR of 50, you will reduce the amounf of damage by a minimum of 1 and a maximum of 9
(This post was last modified: 08-11-2017 10:45 PM by darksun84.)
08-11-2017 10:11 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes darksun84's post
Baeguth
Apprentice
*

Posts: 12
Likes Given: 4
Likes Received: 0 in 0 posts
Joined: Aug 2017
Reputation: 0



Post: #5
RE: Custom Armor Rating Calculation?
(08-11-2017 10:11 PM)darksun84 Wrote:  If you are using the old armour system (that means COMBAT_AOS_ELEMENTAL engine disabled) then yes, you will have to tweak the armour values until you get the desired results.

By the way, take note that when using the old armour system the damage will be not reduced by a percentage, instead it will be reduced by a flat amount, the percentage is just used for contributing to the total AR of a character.

Code:
First the value ArmorMax is calculated:

ArmorMax = AR * Random(7,35) / 100  

Then the value ArmorMin is calculated by halving ArmorMax
ArmorMin =  ArmorMax / 2

the flat amount reduction is calculated by using both ArmorMax and ArmorMin:
Reduction = Random(ArmorMin, (ArmorMax - ArmorMin + 1 )

If the damage is magical, reduction will be halved by 2.

Finally subtract  the reduction from the damage.
By doing some test its seems that:
With an AR of 100, you will reduce the amount of damage by a minimum of 3 and a maximum of 19.
With an AR of 10, you will reduce the amount of damage by a minimum of 0 ( no damage reduction) and a maximum of 3.
With an AR of 50, you will reduce the amounf of damage by a minimum of 1 and a maximum of 9

mmhh I dont like it at all.
I think I will override it...
To me having 100 ar and being able to reduce the damage of a maximun of 19 is too little!

thank you as always!
08-11-2017 11:00 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)