![]() |
|
#1
|
|||
|
|||
![]()
Not working
Code:
Attack.act_apply_dmgmin_spell( "magic", 0, 0, power, duration, false) Attack.act_apply_dmgmax_spell( "magic", 0, 0, power, duration, false) Attack.act_apply_par_spell( "defense", 0, 0, -penalty, duration, false) |
#2
|
|||
|
|||
![]() Quote:
So change dmgmin and dmgmax to just one line: Code:
Attack.act_apply_dmg_spell( "magic", 0, 0, power, duration, false) Code:
for i = 1, table.getn( resistances ) do local min_damage_current, min_damage_base = Attack.act_get_dmg_min( target, resistances[ i ] ) if min_damage_base > 0 then local max_damage_current, max_damage_base = Attack.act_get_dmg_max( target, resistances[ i ] ) local min_damage_inc = math.max( math.floor( math.abs( min_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k local max_damage_inc = math.max( math.floor( math.abs( max_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k local new_min_damage = min_damage_current + min_damage_inc local new_max_damage = max_damage_current + max_damage_inc if new_min_damage < 1 then new_min_damage = min_damage_current end if new_max_damage < 1 then new_max_damage = max_damage_current end if new_min_damage ~= min_damage_current then Attack.act_apply_dmgmin_spell( resistances[ i ], min_damage_inc, 0, 0, -100, false ) end if new_max_damage ~= max_damage_current then Attack.act_apply_dmgmax_spell( resistances[ i ], max_damage_inc, 0, 0, -100, false ) end end end Code:
for i = 1, table.getn( resistances ) do . . . end Code:
. . . local min_damage_current, min_damage_base = Attack.act_get_dmg_min( target, resistances[ i ] ) if min_damage_base > 0 then . . . end Code:
. . . local max_damage_current, max_damage_base = Attack.act_get_dmg_max( target, resistances[ i ] ) local min_damage_inc = math.max( math.floor( math.abs( min_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k local max_damage_inc = math.max( math.floor( math.abs( max_damage_base * diff_k ) ), min_stat_inc ) * sign_diff_k local new_min_damage = min_damage_current + min_damage_inc local new_max_damage = max_damage_current + max_damage_inc . . . Code:
. . . if new_min_damage < 1 then new_min_damage = min_damage_current end if new_max_damage < 1 then new_max_damage = max_damage_current end . . . Code:
. . . if new_min_damage ~= min_damage_current then Attack.act_apply_dmgmin_spell( resistances[ i ], min_damage_inc, 0, 0, -100, false ) end if new_max_damage ~= max_damage_current then Attack.act_apply_dmgmax_spell( resistances[ i ], max_damage_inc, 0, 0, -100, false ) end . . . Good luck! ![]() /C\/C\ Last edited by MattCaspermeyer; 04-03-2012 at 05:48 AM. |
![]() |
|
|