From 00953ae203da687042fbce3290edb8cd01be2d55 Mon Sep 17 00:00:00 2001
From: DarkGod <darkgod@net-core.org>
Date: Tue, 21 Jan 2014 22:04:53 +0100
Subject: [PATCH] New talent/effect fields "callbackOnDeath" and
 "callbackOnKill"

---
 game/modules/tome/class/Actor.lua | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 0222eade01..eab9012129 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -2397,6 +2397,8 @@ function _M:die(src, death_note)
 		return
 	end
 
+	if self:fireTalentCheck("callbackOnDeath", src, death_note) then return end
+
 	mod.class.interface.ActorLife.die(self, src, death_note)
 
 	-- Trigegr on_die effects if any
@@ -2658,6 +2660,8 @@ function _M:die(src, death_note)
 		end)
 	end
 
+	if src.fireTalentCheck then src:fireTalentCheck("callbackOnKill", self, death_note) end
+
 	if src and ((src.resolveSource and src:resolveSource().player) or src.player) then
 		-- Achievements
 		local p = game.party:findMember{main=true}
@@ -4070,6 +4074,8 @@ local sustainCallbackCheck = {
 	callbackOnActBase = "talents_on_act_base",
 	callbackOnMove = "talents_on_move",
 	callbackOnRest = "talents_on_rest",
+	callbackOnDeath = "talents_on_death",
+	callbackOnKill = "talents_on_kill",
 	callbackOnMeleeAttack = "talents_on_melee_attack",
 	callbackOnMeleeHit = "talents_on_melee_hit",
 	callbackOnMeleeMiss = "talents_on_melee_miss",
-- 
GitLab