
05-04-2010, 09:39 PM
|
Approved Member
|
|
Join Date: Dec 2009
Posts: 83
|
|
there your script.
and it's taken from unit_features.lua, not addon_special_attacks.lua
Quote:
function features_vampirism( damage,addrage,attacker,receiver,minmax ) -- minmax, равный 1 или 2 означает, что функция вызывается только для определения мин/макс урона во всп.подсказке
if (minmax==0) and damage>0 then
-- сколько хитов у вампов
if --[[Attack.act_need_cure(attacker) or ]]Attack.cell_need_resurrect(attacker) then
if Attack.act_enemy(receiver) and not (Attack.act_feature(receiver,"undead,boss")) and not (Attack.act_feature(receiver,"plant")) and not (Attack.act_feature(receiver,"golem")) and not (Attack.act_feature(receiver,"pawn")) and not (Attack.act_name(receiver)=="griffin_spirit") then
local count_1 = Attack.act_size(attacker)
local vamp = math.min(Attack.act_totalhp(receiver), damage)
local hp1 = Attack.act_totalhp(attacker)
Attack.act_resurrect(attacker, math.floor(vamp+.5))
local count_2 = Attack.act_size(attacker)
Attack.atom_spawn(attacker, 0, "effect_total_cure")
local log_msg="add_blog_vamp_"
local special=count_2-count_1
if count_2==count_1 then
log_msg=log_msg.."0"
special = Attack.act_totalhp(attacker) - hp1
end
Attack.act_damage_addlog(receiver,log_msg,true)
Attack.log_special(special) -- работает
end
end
end
return damage,addrage
end
|
you must multiply "vamp"
this function being called from bat2 and bat.atom in line posthitmaster=features_vampirism
|