![]() |
|
|
|
#1
|
|||
|
|||
|
@Fatt_Shade:
As it turns out, it is implemented as Percent of Base in both TL and AP so the developers intended for it to work this way, I guess. Nonetheless, the change is easy:
By the way, for most functions that work on a statistic, the order is absolute percent increase, percent of base, and then percent of current. See http://translate.googleusercontent.c...LwAowdEODmh0mw as a reference for the King's Bounty LUA Attack library. Good luck! /C\/C\ Quote:
|
|
#2
|
|||
|
|||
|
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)
|
|
#3
|
|||
|
|||
|
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 06:48 AM. |
![]() |
|
|