From f28a4f64257c6604400a984f70ca3e074914e8b7 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 23 Jan 2011 01:47:35 +0000
Subject: [PATCH] The Rod of Recall is now dropped by the first boss killed

git-svn-id: http://svn.net-core.org/repos/t-engine4@2469 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/NPC.lua               |  8 ++
 .../data/general/objects/quest-artifacts.lua  | 22 +++++
 .../tome/data/maps/wilderness/eyal.lua        |  2 +-
 game/modules/tome/data/quests/start-yeek.lua  |  1 +
 .../tome/data/zones/murgol-lair/npcs.lua      | 90 ++-----------------
 .../tome/data/zones/trollmire/npcs.lua        |  1 -
 .../tome/data/zones/trollmire/objects.lua     | 22 -----
 7 files changed, 40 insertions(+), 106 deletions(-)

diff --git a/game/modules/tome/class/NPC.lua b/game/modules/tome/class/NPC.lua
index 6701f2e7b6..a316e2c569 100644
--- a/game/modules/tome/class/NPC.lua
+++ b/game/modules/tome/class/NPC.lua
@@ -193,6 +193,14 @@ function _M:die(src)
 		return
 	end
 
+	if self.rank >= 4 and not game.state.droped_rod_recall then
+		local rod = game.zone:makeEntityByName(game.level, "object", "ROD_OF_RECALL")
+		if rod then
+			game.zone:addEntity(game.level, rod, "object", self.x, self.y)
+			game.state.droped_rod_recall = true
+		end
+	end
+
 	return mod.class.Actor.die(self, src)
 end
 
diff --git a/game/modules/tome/data/general/objects/quest-artifacts.lua b/game/modules/tome/data/general/objects/quest-artifacts.lua
index b938d70c25..d95318d49b 100644
--- a/game/modules/tome/data/general/objects/quest-artifacts.lua
+++ b/game/modules/tome/data/general/objects/quest-artifacts.lua
@@ -285,3 +285,25 @@ newEntity{ define_as = "ORB_SCRYING",
 		auto_id = 1,
 	},
 }
+
+newEntity{ base = "BASE_WAND",
+	define_as = "ROD_OF_RECALL",
+	unided_name = "unstable wand", identified=true, force_lore_artifact=true,
+	name = "Rod of Recall", color=colors.LIGHT_BLUE, unique=true,
+	desc = [[This rod is made entirely of voratun, infused with raw magical energies it can bend space itself.
+This seems to be what the troll was keeping as "treasure". You have heard of such items before, they are very useful to adventurers, allowing faster travel.]],
+	cost = 0, quest=true,
+	elec_proof = true,
+
+	max_power = 1000, power_regen = 1,
+	use_power = { name = "recall the user to the worldmap", power = 1000,
+		use = function(self, who)
+			if who:canBe("worldport") then
+				who:setEffect(who.EFF_RECALL, 40, {})
+				game.logPlayer(who, "Space around you starts to dissolve...")
+			else
+				game.logPlayer(who, "The rod emits a strange noise, glows briefly and returns to normal.")
+			end
+		end
+	},
+}
diff --git a/game/modules/tome/data/maps/wilderness/eyal.lua b/game/modules/tome/data/maps/wilderness/eyal.lua
index 5f20a3f95b..b92aed427e 100644
--- a/game/modules/tome/data/maps/wilderness/eyal.lua
+++ b/game/modules/tome/data/maps/wilderness/eyal.lua
@@ -75,7 +75,7 @@ quickEntity('high-peak', {always_remember = true, show_tooltip=true, name="High
 quickEntity('unremarkable-cave', {always_remember = true, show_tooltip=true, name="Unremarkable cave", display='>', color=colors.UMBER, notice = true, change_level=1, change_zone="unremarkable-cave"})
 
 -- Island of Rel
-quickEntity('irkkk', {always_remember = true, show_tooltip=true, name="Irkkk (Town)", desc="Yeek Wayist capital", display='*', color={r=255, g=255, b=255}, back_color=colors.DARK_GREEN, image="terrain/town1.png", notice = true, change_level=1, change_zone="town-irkkk"})
+quickEntity('irkkk', {always_remember = true, show_tooltip=true, name="Irkkk (Town)", desc="Yeek Wayist capital", display='*', color={r=255, g=255, b=255}, back_color=colors.DARK_GREEN, image="terrain/town1.png", notice = true})
 quickEntity('ritch-tunnels', {always_remember = true, show_tooltip=true, name="Tunnel into the ritchs grounds",display='>', color=colors.UMBER, notice = true, change_level=1, change_zone="ritch-tunnels"})
 quickEntity('murgol-lair', {always_remember = true, show_tooltip=true, name="Way into the lair of Murgol",display='>', color=colors.LIGHT_BLUE, notice = true, change_level=1, change_zone="murgol-lair"})
 quickEntity('rel-tunnel', {always_remember = true, show_tooltip=true, name="Tunnel to Maj'Eyal", display='>', color=colors.LIGHT_BLUE, notice = true, force_down=true, change_level=4, change_zone="halfling-ruins", change_level_check = function() local p = game.party:findMember{main=true} if p:hasQuest("start-yeek") and not p:isQuestStatus("start-yeek", engine.Quest.DONE) then require("engine.ui.Dialog"):simplePopup("Long tunnel", "You can not abandon the yeeks of Rel to the dangers that lie within the island.") return false end return true end})
diff --git a/game/modules/tome/data/quests/start-yeek.lua b/game/modules/tome/data/quests/start-yeek.lua
index 3eca782d05..b1fb459233 100644
--- a/game/modules/tome/data/quests/start-yeek.lua
+++ b/game/modules/tome/data/quests/start-yeek.lua
@@ -40,6 +40,7 @@ on_status_change = function(self, who, status, sub)
 		if self:isCompleted("ritch") and self:isCompleted("murgol") then
 			who:setQuestStatus(self.id, engine.Quest.DONE)
 			who:grantQuest("starter-zones")
+			game.logPlayer(game.player, "You should head to the tunnel to Maj'Eyal and explore the world. For the Way.")
 		end
 	end
 end
diff --git a/game/modules/tome/data/zones/murgol-lair/npcs.lua b/game/modules/tome/data/zones/murgol-lair/npcs.lua
index 4b58bb0b70..d13d1c2beb 100644
--- a/game/modules/tome/data/zones/murgol-lair/npcs.lua
+++ b/game/modules/tome/data/zones/murgol-lair/npcs.lua
@@ -24,106 +24,32 @@ load("/data/general/npcs/jelly.lua", rarity(3))
 
 local Talents = require("engine.interface.ActorTalents")
 
-newEntity{
-	define_as = "BASE_NPC_RITCH_REL",
-	type = "insect", subtype = "ritch",
-	display = "I", color=colors.RED,
-	desc = [[Ritchs are giant insects native to the arid wastes of the southern parts of the Far East.
-Vicious predators, they inject corrupting diseases into their foes, and their sharp claws cut through most armours.]],
 
-	combat = { dam=resolvers.rngavg(10,32), atk=9, apr=4, damtype=DamageType.BLIGHT, dammod={dex=1.2} },
-
-	body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
-
-	infravision = 20,
-	size_category = 1,
-	rank = 2,
-
-	autolevel = "slinger",
-	ai = "dumb_talented_simple", ai_state = { ai_move="move_dmap", talent_in=3, },
-	stats = { str=15, dex=15, mag=8, con=10 },
-
-	poison_immune = 0.5,
-	disease_immune = 0.5,
-	resists = { [DamageType.BLIGHT] = 20, [DamageType.FIRE] = 40 },
-}
-
-newEntity{ base = "BASE_NPC_RITCH",
-	name = "ritch flamespitter", color=colors.DARK_RED,
-	level_range = {1, nil}, exp_worth = 1,
-	rarity = 1,
-	max_life = 5,
-	life_rating = 3,
-
-	rank = 2,
-
-	ai_state = { ai_move="move_dmap", talent_in=1, },
-	resolvers.talents{
-		[Talents.T_RITCH_FLAMESPITTER_BOLT]=1,
-	},
-}
-
-newEntity{ base = "BASE_NPC_RITCH",
-	name = "ritch impaler", color=colors.UMBER,
-	level_range = {2, nil}, exp_worth = 1,
-	rarity = 1,
-	max_life = 50,
-	life_rating = 11,
-
-	rank = 2,
-
-	ai_state = { ai_move="move_dmap", talent_in=1, },
-	resolvers.talents{
-		[Talents.T_RUSHING_CLAWS]=1,
-	},
-}
-
-newEntity{ base = "BASE_NPC_RITCH",
-	name = "chitinous ritch", color=colors.YELLOW,
-	level_range = {1, nil}, exp_worth = 1,
-	rarity = 1,
-	max_life = 100,
-	life_rating = 13,
-
-	rank = 2,
-	combat_armor = 6,
-
-	ai_state = { ai_move="move_dmap", talent_in=1, },
-}
 
 newEntity{ base = "BASE_NPC_RITCH_REL", define_as = "HIVE_MOTHER",
-	unique = true,
-	name = "Ritch Hive Mother",
-	display = "I", color=colors.VIOLET,
-	desc = [[This huge ritch seems to be the mother of all those here. Her sharp, fiery, claws dart toward you!]],
+	type = "humanoid", subtype="atch", unique = true,
+	name = "Murgol",
+	display = "y", color=colors.VIOLET,
+	desc = [[This monstrous yeek depravity opposes all that the Way stands for. The Way commands that he is eliminated.]],
 	level_range = {7, nil}, exp_worth = 2,
-	max_life = 120, life_rating = 14, fixed_rating = true,
-	equilibrium_regen = -50,
+	max_life = 190, life_rating = 17, fixed_rating = true,
 	infravision = 20,
-	stats = { str=15, dex=10, cun=8, mag=16, wil=16, con=10 },
+	stats = { str=15, dex=10, cun=8, mag=16, wil=10, con=15 },
 	move_others=true,
 
 	instakill_immune = 1,
-	blind_immune = 1,
-	no_breath = 1,
 	rank = 4,
 	size_category = 4,
+	no_breath = 1,
 
 	combat = { dam=30, atk=22, apr=7, dammod={str=1.1} },
 
-	resists = { [DamageType.BLIGHT] = 40 },
-
 	body = { INVEN = 10, BODY=1 },
 
 	resolvers.drops{chance=100, nb=1, {defined="FLAMEWROUGHT", random_art_replace={chance=75}}, },
 	resolvers.drops{chance=100, nb=3, {ego_chance=100} },
 
 	resolvers.talents{
-		[Talents.T_SUMMON]=1,
-		[Talents.T_SHRIEK]=2,
-		[Talents.T_WEAKNESS_DISEASE]=1,
-		[Talents.T_RITCH_FLAMESPITTER_BOLT]=2,
-		[Talents.T_SPIT_BLIGHT]=2,
 	},
 	resolvers.sustains_at_birth(),
 
@@ -135,6 +61,6 @@ newEntity{ base = "BASE_NPC_RITCH_REL", define_as = "HIVE_MOTHER",
 	ai = "tactical", ai_state = { talent_in=2, },
 
 	on_die = function(self, who)
-		game.player:setQuestStatus("start-yeek", engine.Quest.COMPLETED, "ritch")
+		game.player:setQuestStatus("start-yeek", engine.Quest.COMPLETED, "murgol")
 	end,
 }
diff --git a/game/modules/tome/data/zones/trollmire/npcs.lua b/game/modules/tome/data/zones/trollmire/npcs.lua
index 91e2447773..c1d32e68b4 100644
--- a/game/modules/tome/data/zones/trollmire/npcs.lua
+++ b/game/modules/tome/data/zones/trollmire/npcs.lua
@@ -50,7 +50,6 @@ He is wielding a small tree trunk and lumbering toward you.]],
 	body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
 	resolvers.equip{ {type="weapon", subtype="greatmaul", defined="GREATMAUL_BILL_TRUNK", random_art_replace={chance=75}, autoreq=true}, },
 	resolvers.drops{chance=100, nb=3, {ego_chance=100} },
-	resolvers.drops{chance=100, nb=1, {defined="ROD_OF_RECALL"} },
 
 	resolvers.talents{
 		[Talents.T_RUSH]=3,
diff --git a/game/modules/tome/data/zones/trollmire/objects.lua b/game/modules/tome/data/zones/trollmire/objects.lua
index 8443d8755d..64f68bd7d9 100644
--- a/game/modules/tome/data/zones/trollmire/objects.lua
+++ b/game/modules/tome/data/zones/trollmire/objects.lua
@@ -29,25 +29,3 @@ newEntity{ base = "BASE_LORE",
 	encumberance = 0,
 }
 end
-
-newEntity{ base = "BASE_WAND",
-	define_as = "ROD_OF_RECALL",
-	unided_name = "unstable wand", identified=true, force_lore_artifact=true,
-	name = "Rod of Recall", color=colors.LIGHT_BLUE, unique=true,
-	desc = [[This rod is made entirely of voratun, infused with raw magical energies it can bend space itself.
-This seems to be what the troll was keeping as "treasure". You have heard of such items before, they are very useful to adventurers, allowing faster travel.]],
-	cost = 0, quest=true,
-	elec_proof = true,
-
-	max_power = 1000, power_regen = 1,
-	use_power = { name = "recall the user to the worldmap", power = 1000,
-		use = function(self, who)
-			if who:canBe("worldport") then
-				who:setEffect(who.EFF_RECALL, 40, {})
-				game.logPlayer(who, "Space around you starts to dissolve...")
-			else
-				game.logPlayer(who, "The rod emits a strange noise, glows briefly and returns to normal.")
-			end
-		end
-	},
-}
-- 
GitLab