Preventing minions from debuffing their summoner

All development conversation and discussion takes place here

Moderator: Moderator

Post Reply
Message
Author
Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Preventing minions from debuffing their summoner

#1 Post 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?

stinkstink
Spiderkin
Posts: 543
Joined: Sat Feb 11, 2012 1:12 am

Re: Preventing minions from debuffing their summoner

#2 Post 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

grayswandir
Uruivellas
Posts: 708
Joined: Wed Apr 30, 2008 5:55 pm

Re: Preventing minions from debuffing their summoner

#3 Post 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
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated. :)

grayswandir
Uruivellas
Posts: 708
Joined: Wed Apr 30, 2008 5:55 pm

Re: Preventing minions from debuffing their summoner

#4 Post 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.
Addons: Arcane Blade Tweaks, Fallen Race, Monk Class, Weapons Pack
Currently working on Elementals. It's a big project, so any help would be appreciated. :)

Razakai
Uruivellas
Posts: 889
Joined: Tue May 14, 2013 3:45 pm

Re: Preventing minions from debuffing their summoner

#5 Post by Razakai »

Yeah, sounds like that's the best way then. Thanks for the help.

Post Reply