#1
|
|||
|
|||
Please help with vampire bats attack script
Hi, I am trying to edit the vampire attack script in addon_special_attacks.lua.
I am trying to make it so that only half (or 1/4) of the damage done by vampire bats is used to resurrect the vampires. I am not good at reading the script or figuring out which part to edit. Please help. Thanks in advance |
#2
|
|||
|
|||
Quote:
|
#3
|
|||
|
|||
I tried looking at the script but there are many places listing damage, etc. Here is the script maybe you can notice. Thanks
function special_vamp() local cycle = Attack.get_cycle() --local count=Attack.act_size(0) local dmg_min,dmg_max = text_range_dec(Attack.get_custom_param("damage")) local power=tonumber(Attack.get_custom_param("power")) --local damage=Game.Random(dmg_min) local typedmg=Attack.get_custom_param("typedmg") Attack.atk_set_damage(typedmg,dmg_min) local source, target Attack.log_label('null') if (cycle == 0) then local source = Attack.get_target() Attack.val_store("vamp_source", source) --Attack.val_store("vamp_hp", math.min(Attack.act_totalhp(source))) --*power/100 Attack.next(0) elseif (cycle == 1) then source = Attack.val_restore("vamp_source") target = Attack.get_target() if ((source ~= nil) and (target ~= nil)) then Attack.aseq_rotate(0, source) Attack.act_aseq( 0, "cast" ) local dmgt = Attack.aseq_time(0, "x") local a = Attack.atom_spawn(source, dmgt, "effect_life_minus", Attack.angleto(source)) local dmgts = Attack.aseq_time(a, "x") Attack.atom_spawn(target, Attack.aseq_time(0, "y"), "effect_life_plus", Attack.angleto(target)) local max_hp=Attack.act_totalhp(source) common_cell_apply_damage(source, dmgts+dmgt) local max_dmg = Attack.act_damage_results(source) local rephits = math.floor(math.min(min_dmg,max_hp)*power/100) local count, hp = Attack.act_size(target),Attack.act_hp(target) -- if Attack.get_caa(target) == nil then count = 0 end local before = Attack.act_totalhp(target) Attack.cell_resurrect(target, rephits, dmgts+dmgt) local after = Attack.act_totalhp(target) Attack.act_cure(target, -(Attack.act_size(target)-count), dmgts+dmgt) -- îòðèöàòåëüíîå ÷èñëî - òîëüêî îòëåò öèôð count = Attack.act_size(target) - count local heal = "resr" if count == 0 then count = Attack.act_hp(target)-hp; heal = "heal" end Attack.log_special(count, blog_side_unit(target,-1)) Attack.log_label('add_blog_vamp_'..heal) end end return true end |
#4
|
|||
|
|||
multiply rephits
|
#5
|
|||
|
|||
I tried mulitplying (by 0.5 or 0.25) just about everything in that script but it has no effect.
|
#6
|
|||
|
|||
there your script.
and it's taken from unit_features.lua, not addon_special_attacks.lua Quote:
this function being called from bat2 and bat.atom in line posthitmaster=features_vampirism |
#7
|
|||
|
|||
Thnks, would have never found/done it. Didn't know about that file.
|
|
|