Generic selectors
Exact matches only
Search in title
Search in content
Search in project

Damage Plugin

Atavism 10.2.0

Name: The name of the damage type.

Resistance Stat: The resistance stat used when calculating the damage done for attacks using this damage type.

 

Damage is calculated based on this algorithm:

dmg-base,dmg-max - damage from weapon (player) or defined on mob
effect_dmg - effect damage
useHitRoll - false for DoTs and true for the rest damage effects
PHYSICAL_POWER_STAT - strength for physical attacks and potential for magical attacks
DAMAGE_DEALT_MODIFIER - at this point default value is 0
DAMAGE_TAKEN_MODIFIER - at this point default value is 0
hitRoll - random between 0-100
DAMAGE_HITROLL_MODIFIER - game settings global parameter (by default with value 35)
targetArmor - target resistance to the attacked damage type
FLAT_ARMOR_DAMAGE_CALCULATIONS - game settings global parameter (by default with value true)
DamageMod - damage modifier defined in the effect
skillMod - skill modifier defined in the effect
criticalChance - character statistic (magical_critic or physical_critic)
bonusDmgEffectVals - if Bonus Dmg Effect is on the target (from the effect definition) then add Bonus Damage Ammount value
PVP_DAMAGE_REDUCTION_PERCENT - game settings global parameter (by default with value 0.1)
PVP_DAMAGE_REDUCTION_USE - game settings global parameter (by default with value true)



d1 = effect_dmg + random(dmg-base,dmg-max)+ ammoDamage + skillMod * skillLevel;

d2 = d1 + d1*(PHYSICAL_POWER_STAT / 25);
d3 = d2 + d2 *(DAMAGE_DEALT_MODIFIER/100);

if (useHitRoll)
  d3 = d3 *((hitRoll / (100 / DAMAGE_HITROLL_MODIFIER) + (100 - DAMAGE_HITROLL_MODIFIER)) / 100.0);

if FLAT_ARMOR_DAMAGE_CALCULATIONS
  d4 = d3*0.01+(d3 * 0.99 - targetArmor);
 else
  d4 = d3 * ((100-targetArmor) / 100);

d5 = d4 +d4 * DAMAGE_TAKEN_MODIFIER / 100; 
if (d5 <= 0) 
  d5 = 1.0;

criticalChanceCalculated=0;
  
  if (criticalChance <= 440){
    criticalChanceCalculated = criticalChance/10;
  }
  else if(criticalChance > 440 && criticalChance <= 560){
    criticalChanceCalculated = (criticalChance - 440) / 20 + 44;
  }
  else if(criticalChance > 560 && criticalChance <= 660){
    criticalChanceCalculated = (criticalChance - 560) / 50 + 44 + 6; //44 from 440/10; 6 from (560 - 440) / 20
  }
  else if(criticalChance > 660){
    criticalChanceCalculated = (criticalChance - 660) / 100 + 44 + 6 + 2; //44 from 440/10; 6 from (560 - 440) / 20; 2 from (660 - 560) / 50
  }
if (rand < (criticalChanceCalculated / 100.0)) 
  d6 = d5 * 1.7;
 
d7 = d6 * DamageMod;
d8 = d7 + bonusDmgEffectVals;

RESULT_BLOCKED
  d9 = d8 / 2;

RESULT_PARRIED
  d9 = d8 * 0.6;

if (PVP_DAMAGE_REDUCTION_USE )
  d10 = d9 * PVP_DAMAGE_REDUCTION_PERCENT;

Hit Chance is calculated based on this algorithm:

targetLevel - Targer character level.
casterLevel - Caster character level.
HIT_CHANCE_POINT_PER_PERCENTAGE - Global parameter adjustable in the Game Settings Plugin. Defines the number of points per one percent of hit chance.
HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL - Global parameter is adjustable in the Game Settings Plugin. Defines hit chance reduction by percentage per level difference between defender and attacker.
HIT_CHANCE_PERCENTAGE_CAP - Global parameter adjustable int he Game Settings Plugin. Defines maximum chance for miss.

statDiff = ((evasion - accuracy) / HIT_CHANCE_POINT_PER_PERCENTAGE);
if (statDiff > HIT_CHANCE_PERCENTAGE_CAP) statDiff = HIT_CHANCE_PERCENTAGE_CAP;
if (statDiff < 0) statDiff = 0;
int levelDiff = (targetLevel - casterLevel) * HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL;
if (levelDiff < 0) levelDiff = 0;
hitChance = 0.95 - ( statDiff / 100f + levelDiff / 100f );

 

Parry is calculated based on this algorithm:

targetLevel - Targer character level.
casterLevel - Caster character level.
HIT_CHANCE_POINT_PER_PERCENTAGE - Global parameter adjustable in the Game Settings Plugin. Defines the number of points per one percent of hit chance.
HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL - Global parameter is adjustable in the Game Settings Plugin. Defines hit chance reduction by percentage per level difference between defender and attacker.
PARRY_PERCENTAGE_CAP - Global parameter adjustable int he Game Settings Plugin. Defines the maximum chance for parry.

statDiff = ((parry - accuracy) / HIT_CHANCE_POINT_PER_PERCENTAGE);
if (statDiff > PARRY_PERCENTAGE_CAP) statDiff = PARRY_PERCENTAGE_CAP;
if (statDiff < 0) statDiff = 0;
int levelDiff = (targetLevel - casterLevel) * HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL;
if (levelDiff < 0) levelDiff = 0;
parryChance = 0.05 + ( statDiff / 100f + levelDiff / 100f );

Atavism 10.1.0-

Name: The name of the damage type.

Resistance Stat: The resistance stat used when calculating the damage done for attacks using this damage type.

 

Damage is calculated based on this algorithm:

dmg-base,dmg-max - damage from weapon (player) or defined on mob
effect_dmg - effect damage
useHitRoll - false for DoTs and true for the rest damage effects
PHYSICAL_POWER_STAT - strength for physical attacks and potential for magical attacks
DAMAGE_DEALT_MODIFIER - at this point default value is 0
DAMAGE_TAKEN_MODIFIER - at this point default value is 0
hitRoll - random between 0-100
DAMAGE_HITROLL_MODIFIER - game settings global parameter (by default with value 35)
targetArmor - target resistance to the attacked damage type
FLAT_ARMOR_DAMAGE_CALCULATIONS - game settings global parameter (by default with value true)
DamageMod - damage modifier defined in the effect
skillMod - skill modifier defined in the effect
criticalChance - character statistic (magical_critic or physical_critic)
bonusDmgEffectVals - if Bonus Dmg Effect is on the target (from the effect definition) then add Bonus Damage Ammount value
PVP_DAMAGE_REDUCTION_PERCENT - game settings global parameter (by default with value 0.1)
PVP_DAMAGE_REDUCTION_USE - game settings global parameter (by default with value true)



d1 = effect_dmg + random(dmg-base,dmg-max)+ ammoDamage + skillMod * skillLevel;

d2 = d1 + d1*(PHYSICAL_POWER_STAT / 25);
d3 = d2 + d2 *(DAMAGE_DEALT_MODIFIER/100);

if (useHitRoll)
  d3 = d3 *((hitRoll / (100 / DAMAGE_HITROLL_MODIFIER) + (100 - DAMAGE_HITROLL_MODIFIER)) / 100.0);

if FLAT_ARMOR_DAMAGE_CALCULATIONS
  d4 = d3*0.01+(d3 * 0.99 - targetArmor);
 else
  d4 = d3 * ((100-targetArmor) / 100);

d5 = d4 +d4 * DAMAGE_TAKEN_MODIFIER / 100; 
if (d5 <= 0) 
  d5 = 1.0;

criticalChanceCalculated=0;
  
  if (criticalChance <= 440){
    criticalChanceCalculated = criticalChance/10;
  }
  else if(criticalChance > 440 && criticalChance <= 560){
    criticalChanceCalculated = (criticalChance - 440) / 20 + 44;
  }
  else if(criticalChance > 560 && criticalChance <= 660){
    criticalChanceCalculated = (criticalChance - 560) / 50 + 44 + 6; //44 from 440/10; 6 from (560 - 440) / 20
  }
  else if(criticalChance > 660){
    criticalChanceCalculated = (criticalChance - 660) / 100 + 44 + 6 + 2; //44 from 440/10; 6 from (560 - 440) / 20; 2 from (660 - 560) / 50
  }
if (rand < (criticalChanceCalculated / 100.0)) 
  d6 = d5 * 1.7;
 
d7 = d6 * DamageMod;
d8 = d7 + bonusDmgEffectVals;

RESULT_BLOCKED
  d9 = d8 / 2;

RESULT_PARRIED
  d9 = d8 * 0.6;

if (PVP_DAMAGE_REDUCTION_USE )
  d10 = d9 * PVP_DAMAGE_REDUCTION_PERCENT;

Hit Chance is calculated based on this algorithm:

targetLevel - Targer character level.
casterLevel - Caster character level.
HIT_CHANCE_POINT_PER_PERCENTAGE - Global parameter adjustable in the Game Settings Plugin. Defines the number of points per one percent of hit chance.
HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL - Global parameter is adjustable in the Game Settings Plugin. Defines hit chance reduction by percentage per level difference between defender and attacker.
HIT_CHANCE_PERCENTAGE_CAP - Global parameter adjustable int he Game Settings Plugin. Defines maximum chance for miss.

statDiff = ((evasion - accuracy) / HIT_CHANCE_POINT_PER_PERCENTAGE);
if (statDiff > HIT_CHANCE_PERCENTAGE_CAP) statDiff = HIT_CHANCE_PERCENTAGE_CAP;
if (statDiff < 0) statDiff = 0;
int levelDiff = (targetLevel - casterLevel) * HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL;
if (levelDiff < 0) levelDiff = 0;
hitChance = 0.95 - ( statDiff / 100f + levelDiff / 100f );

 

Parry is calculated based on this algorithm:

targetLevel - Targer character level.
casterLevel - Caster character level.
HIT_CHANCE_POINT_PER_PERCENTAGE - Global parameter adjustable in the Game Settings Plugin. Defines the number of points per one percent of hit chance.
HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL - Global parameter is adjustable in the Game Settings Plugin. Defines hit chance reduction by percentage per level difference between defender and attacker.
PARRY_PERCENTAGE_CAP - Global parameter adjustable int he Game Settings Plugin. Defines the maximum chance for parry.

statDiff = ((parry - accuracy) / HIT_CHANCE_POINT_PER_PERCENTAGE);
if (statDiff > PARRY_PERCENTAGE_CAP) statDiff = PARRY_PERCENTAGE_CAP;
if (statDiff < 0) statDiff = 0;
int levelDiff = (targetLevel - casterLevel) * HIT_CHANCE_PERCENTAGE_PER_DIFF_LEVEL;
if (levelDiff < 0) levelDiff = 0;
parryChance = 0.05 + ( statDiff / 100f + levelDiff / 100f );