Page 1 of 1
Preventing minions from debuffing their summoner
Posted: Mon Sep 29, 2014 9:22 am
by Razakai
For Necromancers, the Dark Empathy effect causes minions to deal 0 damage to their summoner with attacks. However, this doesn't affect stuff like a Lich shooting you with Congeal Time and the like. I saw someone make mention of using on_set_temporary_effect to make them no longer apply debuffs to you, but I'm unclear how this would work in the load file?
Re: Preventing minions from debuffing their summoner
Posted: Mon Sep 29, 2014 3:57 pm
by stinkstink
Try adding this to superload/mod/class/Actor.lua (warning: completely untested)
Code: Select all
local baseon_set_temporary_effect = _M.on_set_temporary_effect
function _M:on_set_temporary_effect(eff_id, e, p)
return baseon_set_temporary_effect(self, eff_id, e, p)
if e.status == "detrimental" and e.src and e.src.necrotic_minion and e.src.summoner == self then
p.dur = 0
end
end
Re: Preventing minions from debuffing their summoner
Posted: Mon Sep 29, 2014 5:19 pm
by grayswandir
That won't work. The very first line in the function is a return.
Code: Select all
local baseon_set_temporary_effect = _M.on_set_temporary_effect
function _M:on_set_temporary_effect(eff_id, e, p)
if e.status == "detrimental" and e.src and e.src.necrotic_minion and e.src.summoner == self then
p.dur = 0
end
return baseon_set_temporary_effect(self, eff_id, e, p)
end
Re: Preventing minions from debuffing their summoner
Posted: Tue Sep 30, 2014 10:29 am
by grayswandir
Actually, looking at this again, this'll be quite hard to pull off. Generally, most status effects don't know what their source is, unless it was specifically passed in.
You could probably get around this by changing each spell that the minions use to specifically pass in the source.
The way I've done this in the past is to superload Actor:act, making it set game.current_actor when it's called. That way, if an effect doesn't have a source, you can assume it's game.current_actor.
Re: Preventing minions from debuffing their summoner
Posted: Tue Sep 30, 2014 1:03 pm
by Razakai
Yeah, sounds like that's the best way then. Thanks for the help.