From 2fa8198def0ef72fff4b702f6336941d594661ce Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sat, 10 Nov 2012 17:38:19 +0000
Subject: [PATCH] Psionic Pull doesnt damage the caster Patrols should not give
 rare errors anymore Fixed coral spray

git-svn-id: http://svn.net-core.org/repos/t-engine4@5780 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/ai/worldnpcs.lua                         | 4 ++--
 game/modules/tome/data/general/objects/world-artifacts.lua | 4 ++--
 game/modules/tome/data/talents/misc/horrors.lua            | 2 +-
 game/modules/tome/dialogs/UseItemDialog.lua                | 4 ++++
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/game/modules/tome/ai/worldnpcs.lua b/game/modules/tome/ai/worldnpcs.lua
index a27549ebfb..671d87e926 100644
--- a/game/modules/tome/ai/worldnpcs.lua
+++ b/game/modules/tome/ai/worldnpcs.lua
@@ -48,7 +48,7 @@ newAI("target_world", function(self)
 end)
 
 newAI("world_patrol", function(self)
-	if not self.energy.used then
+	if not self.energy.used and self.x and self.y then
 		if self:runAI("target_world") and self:reactionToward(self.ai_target.actor) < 0 and game.level.map:isBound(self.ai_target.actor.x, self.ai_target.actor.y) then
 			self:runAI("move_dmap")
 		else
@@ -80,7 +80,7 @@ newAI("move_world_patrol", function(self)
 end)
 
 newAI("world_hostile", function(self)
-	if not self.energy.used then
+	if not self.energy.used and self.x and self.y then
 		if self:runAI("target_world") and self:reactionToward(self.ai_target.actor) < 0 and core.fov.distance(self.x, self.y, self.ai_target.actor.x, self.ai_target.actor.y) <= self.ai_state.chase_distance then
 			self:runAI("move_dmap")
 		else
diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua
index 9567d3d965..75505a51c0 100644
--- a/game/modules/tome/data/general/objects/world-artifacts.lua
+++ b/game/modules/tome/data/general/objects/world-artifacts.lua
@@ -4781,8 +4781,8 @@ newEntity{ base = "BASE_SHIELD", --Thanks SageAcrin!
 			local burst = {type="cone", range=0, radius=4, force_target=target, selffire=false,}
 		
 			who:project(burst, target.x, target.y, engine.DamageType.COLD, 30)
-			game.level.map:particleEmitter(target.x, target.y, burst.radius, "breath_ice", {radius=burst.radius, tx=target.x-self.x, ty=target.y-self.y})
-			game.logSeen(src, "A burst of chilling water launches from your shield to %s!", src.name:capitalize())
+			game.level.map:particleEmitter(target.x, target.y, burst.radius, "breath_ice", {radius=burst.radius, tx=target.x-who.x, ty=target.y-who.y})
+			game.logSeen(who, "A burst of chilling water launches from your shield to %s!", who.name:capitalize())
 		end
 	end,
 }
diff --git a/game/modules/tome/data/talents/misc/horrors.lua b/game/modules/tome/data/talents/misc/horrors.lua
index cbc7af4912..60335b7704 100644
--- a/game/modules/tome/data/talents/misc/horrors.lua
+++ b/game/modules/tome/data/talents/misc/horrors.lua
@@ -458,7 +458,7 @@ newTalent{
 		return 5
 	end,
 	target = function(self, t)
-		return {type="ball", range=0, friendlyfire=true, radius=self:getTalentRadius(t), talent=t}
+		return {type="ball", range=0, friendlyfire=false, radius=self:getTalentRadius(t), talent=t}
 	end,
 	action = function(self, t)
 		local tg = self:getTalentTarget(t)
diff --git a/game/modules/tome/dialogs/UseItemDialog.lua b/game/modules/tome/dialogs/UseItemDialog.lua
index 2f0af7c734..6dce535dd2 100644
--- a/game/modules/tome/dialogs/UseItemDialog.lua
+++ b/game/modules/tome/dialogs/UseItemDialog.lua
@@ -85,6 +85,8 @@ function _M:use(item)
 		self.onuse(self.inven, self.item, self.object, false)
 	elseif act == "chat-link" then
 		profile.chat.uc_ext:sendObjectLink(self.object)
+	else
+		self:triggerHook{"UseItemMenu:use", actor=self.actor, object=self.object, inven=self.inven, item=self.item, act=act}
 	end
 end
 
@@ -101,6 +103,8 @@ function _M:generateList()
 	if self.inven == self.actor.INVEN_INVEN and transmo_chest and self.actor:transmoFilter(self.object) then list[#list+1] = {name="Transmogrify now", action="transmo"} end
 	if profile.auth and profile.hash_valid then list[#list+1] = {name="Link item in chat", action="chat-link"} end
 
+	self:triggerHook{"UseItemMenu:generate", actor=self.actor, object=self.object, inven=self.inven, item=self.item, menu=list}
+
 	self.max = 0
 	self.maxh = 0
 	for i, v in ipairs(list) do
-- 
GitLab