• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

Can you change zombie damage with a buff?

I've tried using <passive_effect name="EntityDamage" operation="perc_set" value="@roll"/>, applied to the zombie, with @roll being 0 or 1. But this does nothing. I only see damage change with .xml files, but I don't want that. I want something like a blind debuff, with x% change for zombie missing the attack. My original logic was this:

Code:
<effect_group>
	<triggered_effect trigger="onSelfBuffStart" action="ModifyCVar" cvar="roll" operation="set" value="1"/>
	<requirement name="RandomRoll" seed_type="Random" min_max="0,100" operation="LTE" value="15"/>
		<triggered_effect trigger="onSelfBuffUpdate" action="ModifyCVar" cvar="roll" operation="set" value="0"/>
</effect_group>
<effect_group>
	<passive_effect name="EntityDamage" operation="perc_set" value="@roll"/>
</effect_group>
 
Last edited by a moderator:
Maybe something like this?

(Untested)

<effect_group name="hit_rating">
<triggered_effect trigger="onSelfPrimaryActionStart" action="ModifyCVar" target="self" cvar="hit_rating" operation="set" value="randomint(0,100)"/>
<triggered_effect trigger="onSelfSecondaryActionStart" action="ModifyCVar" target="self" cvar="hit_rating" operation="set" value="randomint(0,100)"/>
</effect_group>

<effect_group name="hit_chance">
<requirement name="CVarCompare" cvar="hit_rating" operation="LTE" value="25"/>
<passive_effect name="EntityDamage" operation="perc_add" value="-5"/>
</effect_group>






The idea is, only when the entity with the buff begins their attack, their hit_rating will change between 0 and 100.

Then the requirement tag checks if hit_rating is below 25, then sets the EntityDamage to -500% (which should be 0 damage).

Whatever value you set for the requirement will be the % chance of a miss, so in my code, it is a 25% chance to miss.

  - If you want 15%, you'd change the 25 to 15

  - If you want 75%, you'd change the 25 to 75


One issue that comes to mind with my method, is you'll still be getting hit, just with 0 damage taken, this is bad because Im thinking you can still be inflicted with debuffs, like CriticalHitsDebuffs, Bleeding, Concussion, etc

 
I've tested your solution and it also doesn't work. The problem is that EntityDamage <= 0 doesn't seem to work, zombies always do some damage.

 
They will do 1 damage at minimum if they connect. That's just how the game is coded. Same with player hands or any items/weapons.

 
Back
Top