• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

setCombatFormula TUTORIAL

Chev

C++ /lua scripter
Joined
May 22, 2010
Messages
195
Solutions
1
Reaction score
11
Location
Poland
This tutorial help you to understand formula of spells...

Code:
setCombatFormula(combat, type, min_a, min_b, max_a, max_b, min_lvl, max_lvl, min_mlvl, max_mlvl, min_dmg, max_dmg)
combat - object of combat :)

type - type of formula (FORMULA_LEVELMAGIC, FORMULA_SKILL, FORMULA_VALUE)

[FORMULA_LEVELMAGIC]
Code:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, min_a, min_b, max_a, max_b, min_lvl, max_lvl, min_mlvl, max_mlvl, min_dmg, max_dmg)
EXAMPLE:
Code:
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -1, -2, -1, -5, 5, 5, 0.3, 0.5, 10, 50)

Code:
min = ((player_level / min_lvl + player_mlvl) * min_mlvl) * min_a + min_b)
max = ((player_level / max_lvl + player_mlvl * max_mlvl) * max_a + max_b)
                 
min_a - multiplier of min damage
min_b - var added to calculated min damage (min calculated damage + this value)

max_a - multiplier of max damage
min_b - var added to calculated max damage (max calculated damage + this value)

min_lvl - divisor of lvl: min damage formula is: player_level / min_lvl + ...
max_lvl - divisor of lvl: max damage formula is: player_level / max_lvl + ... --should be lower or same as min_lvl

min_mlvl - multiplier of mlvl: min damage formula is: ... + player_mlevel * min_mlvl + ...
max_mlvl - multiplier of mlvl: max damage formula is: ...+ player_mlevel * max_mlvl + ... --should be higher or same as min_mlvl

!!!
min_dmg - when calculated min damage is lower than this value then min value is this value
max_dmg - when calculated max damage is higher than this value then max value is this value


[FORMULA_SKILL]
Code:
setCombatFormula(combat, COMBAT_FORMULA_SKILL, min_a, min_b, max_a, max_b, min_lvl, max_lvl, min_mlvl, max_mlvl, min_dmg, max_dmg)
EXAMPLE:
Code:
setCombatFormula(combat, COMBAT_FORMULA_SKILL, 0, 50, 1.5, 100)

Code:
min = min_b;
when you have weapon:
max = calculated_weapon_damage(included lvl and skill) * maxa + maxb
when not:
max = maxb;

min_a - not working :)
min_b - min damage value

max_a - multiplier of max damage
min_b - var added to calculated max damage (max calculated damage + this value)

min_lvl - not working :)
max_lvl - not working :)
min_mlvl - not working :)
max_mlvl - not working :)

!!!
min_dmg - not working :)
max_dmg - when calculated max damage is higher than this value then max value is this value


[FORMULA_VALUE] -- random damage using 2 parameters min and max, else didnt work
Code:
setCombatFormula(combat, type, min_a, min_b, max_a, max_b)
EXAMPLE:
Code:
setCombatFormula(combat, COMBAT_FORMULA_VALUE, 0, -50, 0, -200)
Code:
min = min_b;
max = max_b;

min_a - not working :)
min_b - min
max_a - not working :)
max_b - max

BASED ON THE FORGOTTEN SERVER
 
Back
Top