From d7961dd35cc402f5773345d1949ef6e81f295d2a Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Fri, 23 Apr 2010 22:20:57 +0000
Subject: [PATCH] choker of dread summons a vampire

git-svn-id: http://svn.net-core.org/repos/t-engine4@553 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/data/general/npcs/wight.lua |  1 +
 .../tome/data/zones/tol-falas/objects.lua     | 53 +++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/game/modules/tome/data/general/npcs/wight.lua b/game/modules/tome/data/general/npcs/wight.lua
index 7c8c1dfe07..0f7717cbe5 100644
--- a/game/modules/tome/data/general/npcs/wight.lua
+++ b/game/modules/tome/data/general/npcs/wight.lua
@@ -103,6 +103,7 @@ newEntity{ base = "BASE_NPC_WIGHT",
 	rarity = 9,
 	rank = 3,
 	max_life = resolvers.rngavg(100,150),
+	max_mana = resolvers.rngavg(300,350),
 	combat_armor = 12, combat_def = 10,
 	resolvers.talents{ [Talents.T_MANA_POOL]=3, [Talents.T_FLAMESHOCK]=3, [Talents.T_LIGHTNING]=4, [Talents.T_CORROSIVE_VAPOUR]=3, [Talents.T_THUNDERSTORM]=2,
 		[Talents.T_MIND_DISRUPTION]=4,
diff --git a/game/modules/tome/data/zones/tol-falas/objects.lua b/game/modules/tome/data/zones/tol-falas/objects.lua
index 6a1fe80636..ee26d382c4 100644
--- a/game/modules/tome/data/zones/tol-falas/objects.lua
+++ b/game/modules/tome/data/zones/tol-falas/objects.lua
@@ -31,4 +31,57 @@ newEntity{ base = "BASE_AMULET",
 		combat_spellpower = 5,
 		combat_dam = 5,
 	},
+	max_power = 60, power_regen = 1,
+	use_power = { name = "summon an elder vampire to your side", power = 60, use = function(self, who)
+		-- Find space
+		local x, y = util.findFreeGrid(who.x, who.y, 5, true, {[engine.Map.ACTOR]=true})
+		if not x then
+			game.logPlayer(who, "Not enough space to invoke the vampire!")
+			return
+		end
+		print("Invoking gardian on", x, y)
+
+		local NPC = require "mod.class.NPC"
+		local vampire = NPC.new{
+			type = "undead", subtype = "vampires",
+			display = "V",
+			name = "elder vampire", color=colors.RED,
+			desc=[[A terrible robed undead figure, this creature has existed in its unlife for many centuries by stealing the life of others. It can
+			summon the very shades of its victims from beyond the grave to come enslaved to its aid.]],
+
+			combat = { dam=resolvers.rngavg(9,13), atk=10, apr=9, damtype=DamageType.DRAINLIFE, dammod={str=1.9} },
+
+			body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
+
+			autolevel = "warriormage",
+			ai = "summoned", ai_real = "dumb_talented_simple", ai_state = { talent_in=3, },
+			energy = { mod=1 },
+			stats = { str=12, dex=12, mag=12, con=12 },
+			life_regen = 3,
+			size_category = 3,
+			rank = 3,
+
+			resolvers.tmasteries{ ["technique/other"]=0.5, ["spell/phantasm"]=0.8, },
+
+			resists = { [DamageType.COLD] = 80, [DamageType.NATURE] = 80, [DamageType.LIGHT] = -50,  },
+			blind_immune = 1,
+			confusion_immune = 1,
+			see_invisible = 5,
+			undead = 1,
+
+			level_range = {who.level, who.level}, exp_worth = 0,
+			max_life = resolvers.rngavg(90,100),
+			combat_armor = 12, combat_def = 10,
+			resolvers.talents{ [who.T_STUN]=2, [who.T_BLUR_SIGHT]=3, [who.T_PHANTASMAL_SHIELD]=2, [who.T_ROTTING_DISEASE]=3, },
+
+			faction = who.faction,
+			summoner = who,
+			summon_time = 10,
+		}
+
+		vampire:resolve()
+		game.zone:addEntity(game.level, vampire, "actor", x, y)
+
+		game:playSoundNear(who, "talents/spell_generic")
+	end },
 }
-- 
GitLab