diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua index 2ac74a57690edfc55b8715d828fc0a9a83af1c66..7d17059ce3d4629bda1ab91ea19932de2bcb7e9d 100644 --- a/game/modules/tome/class/Actor.lua +++ b/game/modules/tome/class/Actor.lua @@ -1317,6 +1317,16 @@ function _M:onTakeHit(value, src) return value end +function _M:removeTimedEffectsOnClone() + local todel = {} + for eff, p in pairs(self.tmp) do + if _M.tempeffect_def[eff].remove_on_clone then + todel[#todel+1] = eff + end + end + while #todel > 0 do self:removeEffect(table.remove(todel)) end +end + function _M:resolveSource() if self.summoner_gain_exp and self.summoner then return self.summoner:resolveSource() diff --git a/game/modules/tome/data/talents/misc/npcs.lua b/game/modules/tome/data/talents/misc/npcs.lua index f73570371c92c1656e94e7958cb8a7457553505a..74312875d2b74350c6244eaeb342396b1d16e8ab 100644 --- a/game/modules/tome/data/talents/misc/npcs.lua +++ b/game/modules/tome/data/talents/misc/npcs.lua @@ -55,6 +55,7 @@ newTalent{ a.x, a.y = nil, nil a._mo:invalidate() a._mo = nil + a:removeTimedEffectsOnClone() if a.can_multiply <= 0 then a:unlearnTalent(t.id) end print("[MULTIPLY]", x, y, "::", game.level.map(x,y,Map.ACTOR)) diff --git a/game/modules/tome/data/timed_effects.lua b/game/modules/tome/data/timed_effects.lua index 3073c7c9425d62cc96af8e49821ee91bcd701d95..a8d0bf16aef3644ea30e01a976b0920e9eeefdab 100644 --- a/game/modules/tome/data/timed_effects.lua +++ b/game/modules/tome/data/timed_effects.lua @@ -2794,6 +2794,7 @@ newEffect{ long_desc = function(self, eff) return ("%s is fed upon by %s."):format(self.name:capitalize(), eff.src.name) end, type = "mental", status = "detrimental", + remove_on_clone = true, parameters = { }, activate = function(self, eff) end, @@ -3721,6 +3722,7 @@ newEffect{ type = "physical", status = "detrimental", parameters = {}, + remove_on_clone = true, on_gain = function(self, err) return "#Target# is grappled!", "+Grappled" end, on_lose = function(self, err) return "#Target# is free from the grapple.", "-Grappled" end, activate = function(self, eff)