From ea9c3715b3b6ab2b51c14354899f4cfa365c8caf Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 24 Feb 2013 21:12:27 +0000
Subject: [PATCH] Sacrificing oneself at the endgame is now duly noted in the
 death message

git-svn-id: http://svn.net-core.org/repos/t-engine4@6464 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/utils.lua         | 6 ++++++
 game/modules/tome/data/chats/sorcerer-end.lua | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/game/engines/default/engine/utils.lua b/game/engines/default/engine/utils.lua
index aca0c13fd0..26e13735e2 100644
--- a/game/engines/default/engine/utils.lua
+++ b/game/engines/default/engine/utils.lua
@@ -338,6 +338,12 @@ function string.his_her(actor)
 	end
 end
 
+function string.his_her_self(actor)
+	if actor.female then return "herself"
+	else return "himself"
+	end
+end
+
 function string.capitalize(str)
 	if #str > 1 then
 		return string.upper(str:sub(1, 1))..str:sub(2)
diff --git a/game/modules/tome/data/chats/sorcerer-end.lua b/game/modules/tome/data/chats/sorcerer-end.lua
index 91b342bfb4..351ee2df22 100644
--- a/game/modules/tome/data/chats/sorcerer-end.lua
+++ b/game/modules/tome/data/chats/sorcerer-end.lua
@@ -48,7 +48,7 @@ The Way will never forget you. Now go and make history!
 	answers = {
 		{"#LIGHT_GREEN#[sacrifice yourself to bring the Way to every sentient creature.]", action=function(npc, player)
 			player.no_resurrect = true
-			player:die(player)
+			player:die(player, {special_death_msg="sacrificing "..string.his_her_self(player).." to bring the Way to all"})
 			player:setQuestStatus("high-peak", engine.Quest.COMPLETED, "yeek")
 			player:hasQuest("high-peak"):win("yeek-sacrifice")
 		end},
@@ -63,7 +63,7 @@ You will do as asked, for the good of all Yeeks! The Way is always right.
 	answers = {
 		{"#LIGHT_GREEN#[sacrifice yourself to bring the Way to every sentient creature.]", action=function(npc, player)
 			player.no_resurrect = true
-			player:die(player)
+			player:die(player, {special_death_msg="sacrificing "..string.his_her_self(player).." to bring the Way to all"})
 			player:setQuestStatus("high-peak", engine.Quest.COMPLETED, "yeek")
 			player:hasQuest("high-peak"):win("yeek-sacrifice")
 		end},
@@ -88,7 +88,7 @@ After searching the remains of the Sorcerers you find a note explaining that the
 		{"Aeryn, I am sorry but one of us needs to be sacrificed for the world to go on. #LIGHT_GREEN#[sacrifice Aeryn for the sake of the world]", jump="aeryn-sacrifice", cond=aeryn_alive},
 		{"I will close it. #LIGHT_GREEN#[sacrifice yourself for the sake of the world]", action=function(npc, player)
 			player.no_resurrect = true
-			player:die(player)
+			player:die(player, {special_death_msg="sacrificing "..string.his_her_self(player).." for the sake of the world"})
 			player:hasQuest("high-peak"):win("self-sacrifice")
 		end},
 	}
-- 
GitLab