From 6f8fd2a2770915d4d1b65984359c471a1da53783 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Thu, 26 May 2011 22:11:13 +0000
Subject: [PATCH] Archmages starting in Angolwen can now go into the Abashed
 Expanse New zone: Abashed Expanse, a part of Eyal torn away and thrown into
 orbit far above the planet

git-svn-id: http://svn.net-core.org/repos/t-engine4@3442 51575b47-30f0-44d4-a5cc-537603b46e54
---
 .../data/chats/tarelion-start-archmage.lua    | 63 +++++++++++++++++++
 .../tome/data/quests/start-archmage.lua       |  5 +-
 2 files changed, 67 insertions(+), 1 deletion(-)
 create mode 100644 game/modules/tome/data/chats/tarelion-start-archmage.lua

diff --git a/game/modules/tome/data/chats/tarelion-start-archmage.lua b/game/modules/tome/data/chats/tarelion-start-archmage.lua
new file mode 100644
index 0000000000..3e9d78c8f8
--- /dev/null
+++ b/game/modules/tome/data/chats/tarelion-start-archmage.lua
@@ -0,0 +1,63 @@
+-- ToME - Tales of Maj'Eyal
+-- Copyright (C) 2009, 2010, 2011 Nicolas Casalini
+--
+-- This program is free software: you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation, either version 3 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+--
+-- You should have received a copy of the GNU General Public License
+-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
+--
+-- Nicolas Casalini "DarkGod"
+-- darkgod@te4.org
+
+newChat{ id="welcome",
+	text = [[Wait a minute!]],
+	answers = {
+		{"Archmage Tarelion?", jump="next1"},
+	}
+}
+
+newChat{ id="next1",
+	text = [[Yes @playername@, I have heard you plan on going into the wild world, looking for some adventures of your own.
+This is good, more of us should get out of here once in a while and actually help people out there.
+Say, maybe you might want to get an adventure and help Angolwen?]],
+	answers = {
+		{"Perhaps, what do you need?", jump="next2"},
+	}
+}
+
+newChat{ id="next2",
+	text = [[During the Spellblaze the world was torn apart - literally. A part of it, that we now call the Abashed Expanse, was ripped from the world and throw into the void between the stars.
+We managed to stabilize it and it is now orbiting Eyal. Recently we have noticed a disturbance there, if we do nothing it will crash onto Eyal, bringing much destruction in its wake.
+Because it was once part of a land we know well we can teleport you there. You will need to stabilize three wormholes by firing any attack spells at them.
+The instability is also to your advantage there, your simple phase door spell will be fully controllable.
+
+So, you think you can help us ?]],
+	answers = {
+		{"Yes Archmage, send me there!", jump="teleport"},
+		{"No sorry, I need to go.", jump="refuse"},
+	}
+}
+
+newChat{ id="teleport",
+	text = [[Good luck!]],
+	answers = {
+		{"[teleport]", action=function(npc, player) game:changeLevel(1, "abashed-expanse") end},
+	}
+}
+
+newChat{ id="refuse",
+	text = [[Oh well, farewell on your trips. Now I need to find somebody else to go up there.]],
+	answers = {
+		{"Bye.", action=function(npc, player) player:setQuestStatus("start-archmage", engine.Quest.FAILED) end},
+	}
+}
+
+return "welcome"
diff --git a/game/modules/tome/data/quests/start-archmage.lua b/game/modules/tome/data/quests/start-archmage.lua
index afb4ea7f12..41aa5e10fe 100644
--- a/game/modules/tome/data/quests/start-archmage.lua
+++ b/game/modules/tome/data/quests/start-archmage.lua
@@ -40,6 +40,9 @@ on_status_change = function(self, who, status, sub)
 			who:grantQuest(who.archmage_race_start_quest)
 		end
 	end
+	if status == self.FAILED then
+		who:grantQuest(who.archmage_race_start_quest)
+	end
 end
 
 on_grant = function(self, who)
@@ -48,7 +51,7 @@ on_grant = function(self, who)
 		if e.define_as and e.define_as == "TARELION" then npc = e break end
 	end
 	if not npc then return end
-	local x, y = util.findFreeGrid(npc.x, npc.y, 10, true, {[Map.ACTOR]=true})
+	local x, y = util.findFreeGrid(npc.x, npc.y, 10, true, {[engine.Map.ACTOR]=true})
 	if not x or not y then return end
 
 	who:move(x, y, true)
-- 
GitLab