From d556174e3bdbb50d48417b55530aa9ae16518aec Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sat, 15 May 2010 03:35:58 +0000
Subject: [PATCH] stared map of the far east many balancing tweaks

git-svn-id: http://svn.net-core.org/repos/t-engine4@601 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engine/generator/map/Heightmap.lua       |  23 ++--
 game/engine/generator/map/Static.lua          |   8 ++
 game/modules/tome/class/Game.lua              |  14 +--
 game/modules/tome/class/Player.lua            |  27 ++++-
 game/modules/tome/class/interface/Combat.lua  |   1 +
 game/modules/tome/data/birth/races/dwarf.lua  |   2 +-
 game/modules/tome/data/birth/races/elf.lua    |   2 +-
 game/modules/tome/data/birth/races/hobbit.lua |   2 +-
 game/modules/tome/data/birth/races/human.lua  |   4 +-
 game/modules/tome/data/birth/races/orc.lua    |   2 +-
 game/modules/tome/data/birth/races/troll.lua  |   2 +-
 game/modules/tome/data/birth/races/undead.lua |   4 +-
 game/modules/tome/data/general/npcs/orc.lua   |   6 +-
 .../modules/tome/data/general/npcs/thieve.lua |   6 +-
 .../tome/data/general/objects/money.lua       |   4 +-
 .../data/general/objects/quest-artifacts.lua  |  10 +-
 .../data/maps/wilderness/arda-fareast.lua     | 108 ++++++++++++++++++
 .../tome/data/maps/zones/moria-last.lua       |  68 +++++++++++
 game/modules/tome/data/zones/moria/grids.lua  |  19 +++
 game/modules/tome/data/zones/moria/npcs.lua   |  26 +++--
 game/modules/tome/data/zones/moria/zone.lua   |  18 ++-
 .../tome/data/zones/sandworm-lair/objects.lua |   2 +-
 .../zones/wilderness-arda-fareast/grids.lua   |  18 +++
 .../zones/wilderness-arda-fareast/npcs.lua    |  19 +++
 .../zones/wilderness-arda-fareast/objects.lua |  20 ++++
 .../zones/wilderness-arda-fareast/zone.lua    |  37 ++++++
 .../tome/data/zones/wilderness/zone.lua       |  10 +-
 27 files changed, 392 insertions(+), 70 deletions(-)
 create mode 100644 game/modules/tome/data/maps/wilderness/arda-fareast.lua
 create mode 100644 game/modules/tome/data/maps/zones/moria-last.lua
 create mode 100644 game/modules/tome/data/zones/wilderness-arda-fareast/grids.lua
 create mode 100644 game/modules/tome/data/zones/wilderness-arda-fareast/npcs.lua
 create mode 100644 game/modules/tome/data/zones/wilderness-arda-fareast/objects.lua
 create mode 100644 game/modules/tome/data/zones/wilderness-arda-fareast/zone.lua

diff --git a/game/engine/generator/map/Heightmap.lua b/game/engine/generator/map/Heightmap.lua
index bfae3a7d24..d01a3e793f 100644
--- a/game/engine/generator/map/Heightmap.lua
+++ b/game/engine/generator/map/Heightmap.lua
@@ -25,6 +25,7 @@ module(..., package.seeall, class.inherit(engine.Generator))
 
 function _M:init(zone, map, level, data)
 	engine.Generator.init(self, zone, map, level)
+	self.data = data
 	local grid_list = zone.grid_list
 	self.floor = grid_list[data.floor]
 	self.wall = grid_list[data.wall]
@@ -37,21 +38,23 @@ function _M:generate()
 	end end
 
 	-- make the fractal heightmap
-	local hm = Heightmap.new(self.map.w, self.map.h, 2, {
-		middle =	Heightmap.min,
-		up_left =	rng.range(Heightmap.max / 2, Heightmap.max),
-		down_left =	rng.range(Heightmap.max / 2, Heightmap.max),
-		up_right =	rng.range(Heightmap.max / 2, Heightmap.max),
-		down_right =	rng.range(Heightmap.max / 2, Heightmap.max)
+	local hm = Heightmap.new(self.map.w, self.map.h, 4, {
+		middle =	Heightmap.max,
+		up_left =	rng.range(Heightmap.min, Heightmap.max / 2),
+		down_left =	rng.range(Heightmap.min, Heightmap.max / 2),
+		up_right =	rng.range(Heightmap.min, Heightmap.max / 2),
+		down_right =	rng.range(Heightmap.min, Heightmap.max / 2)
 	})
 	hm:generate()
 
 	for i = 1, self.map.w do
 		for j = 1, self.map.h do
-			if hm.hmap[i][j] >= Heightmap.max * 3 / 6 then
-				self.map(i-1, j-1, Map.TERRAIN, self.wall)
-			else
-				self.map(i-1, j-1, Map.TERRAIN, self.floor)
+			for z = #self.data.tiles, 1, -1 do
+				local t = self.data.tiles[z]
+				if hm.hmap[i][j] >= Heightmap.max * t[1] then
+					self.map(i-1, j-1, Map.TERRAIN, self.zone.grid_list[t[2]])
+					break
+				end
 			end
 		end
 	end
diff --git a/game/engine/generator/map/Static.lua b/game/engine/generator/map/Static.lua
index 42a5a8dd91..3b0ce301a2 100644
--- a/game/engine/generator/map/Static.lua
+++ b/game/engine/generator/map/Static.lua
@@ -118,6 +118,7 @@ function _M:generate(lev, old_lev)
 		self.map(i-1, j-1, Map.TERRAIN, self:resolve("grid", c))
 
 		local actor = self.tiles[c] and self.tiles[c].actor
+		local trap = self.tiles[c] and self.tiles[c].trap
 		local object = self.tiles[c] and self.tiles[c].object
 
 		if object then
@@ -127,6 +128,13 @@ function _M:generate(lev, old_lev)
 			end
 		end
 
+		if trap then
+			local t = self.zone:makeEntityByName(self.level, "trap", trap)
+			if t then
+				self.zone:addEntity(self.level, t, "trap", i-1, j-1)
+			end
+		end
+
 		if actor then
 			local m = self.zone:makeEntityByName(self.level, "actor", actor)
 			if m then
diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index d1cd2e3981..5558dbb669 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -115,8 +115,7 @@ function _M:newGame()
 	self:setupDisplayMode()
 
 	local birth = Birther.new(self.player, {"base", "world", "race", "subrace", "sex", "class", "subclass" }, function()
-		self.player.wild_x, self.player.wild_y = self.player.default_wilderness[2], self.player.default_wilderness[3]
-		self.player.current_wilderness = self.player.default_wilderness[1]
+		self.player.wild_x, self.player.wild_y = self.player.default_wilderness[1], self.player.default_wilderness[2]
 		self:changeLevel(1, self.player.starting_zone)
 		print("[PLAYER BIRTH] resolve...")
 		self.player:resolve()
@@ -264,7 +263,7 @@ function _M:changeLevel(lev, zone)
 	end
 
 	-- Move back to old wilderness position
-	if self.zone.short_name == "wilderness" then
+	if self.zone.wilderness then
 		self.player:move(self.player.wild_x, self.player.wild_y, true)
 	else
 		if lev > old_lev then
@@ -465,11 +464,12 @@ function _M:setupCommands()
 	self.key:setupProfiler()
 
 	-- Helper function to not allow some actions on the wilderness map
-	local not_wild = function(f) return function() if self.zone and self.zone.short_name ~= "wilderness" then f() else self.logPlayer(self.player, "You can not do that on the world map.") end end end
+	local not_wild = function(f) return function() if self.zone and not self.zone.wilderness then f() else self.logPlayer(self.player, "You can not do that on the world map.") end end end
 
 	self.key:addCommands{
 		[{"_d","ctrl"}] = function()
-			if config.settings.tome.cheat then self:changeLevel(3, "moria") end
+--			if config.settings.tome.cheat then self:changeLevel(3, "moria") end
+			if config.settings.tome.cheat then self:changeLevel(1, "wilderness-arda-fareast") end
 		end,
 	}
 	self.key:addBinds
@@ -544,11 +544,11 @@ function _M:setupCommands()
 					if e.status == "detrimental" then stop[#stop+1] = e.desc end
 				end
 
-				if not e.change_zone or (#stop > 0 and e.change_zone ~= "wilderness") or #stop == 0 then
+				if not e.change_zone or (#stop > 0 and e.change_zone:find("^wilderness")) or #stop == 0 then
 					-- Do not unpause, the player is allowed first move on next level
 					self:changeLevel(e.change_zone and e.change_level or self.level.level + e.change_level, e.change_zone)
 				else
-					self.log("You can not go into the wilds wit hthe following effects: %s", table.concat(stop, ", "))
+					self.log("You can not go into the wilds with the following effects: %s", table.concat(stop, ", "))
 				end
 			else
 				self.log("There is no way out of this level here.")
diff --git a/game/modules/tome/class/Player.lua b/game/modules/tome/class/Player.lua
index 86c27728fc..ab2a3a7326 100644
--- a/game/modules/tome/class/Player.lua
+++ b/game/modules/tome/class/Player.lua
@@ -97,7 +97,7 @@ function _M:move(x, y, force)
 	end
 
 	-- Update wilderness coords
-	if game.zone.short_name == "wilderness" then
+	if game.zone.wilderness then
 		-- Cheat with time
 		game.turn = game.turn + 1000
 
@@ -147,10 +147,14 @@ function _M:playerFOV()
 	-- Clean FOV before computing it
 	game.level.map:cleanFOV()
 	-- Compute ESP FOV, using cache
-	if game.zone.short_name ~= "wilderness" then self:computeFOV(self.esp.range or 10, "block_esp", function(x, y) game.level.map:applyESP(x, y) end, true, true) end
+	if not game.zone.wilderness then self:computeFOV(self.esp.range or 10, "block_esp", function(x, y) game.level.map:applyESP(x, y) end, true, true) end
 	-- Compute both the normal and the lite FOV, using cache
-	self:computeFOV(self.sight or 20, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:apply(x, y) end, true, false, true)
-	self:computeFOV(self.lite, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y) end, true, true, true)
+	if game.zone.wilderness_see_radius then
+		self:computeFOV(game.zone.wilderness_see_radius, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y) end, true, true, true)
+	else
+		self:computeFOV(self.sight or 20, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:apply(x, y) end, true, false, true)
+		self:computeFOV(self.lite, "block_sight", function(x, y, dx, dy, sqdist) game.level.map:applyLite(x, y) end, true, true, true)
+	end
 
 	-- Handle Sense spell, a simple FOV, using cache. Note that this means some terrain features can be made to block sensing
 	if self:attr("detect_range") then
@@ -310,7 +314,7 @@ function _M:runCheck()
 end
 
 function _M:doDrop(inven, item)
-	if game.zone.short_name == "wilderness" then game.logPlayer(self, "You can not drop on the world map.") return end
+	if game.zone.wilderness then game.logPlayer(self, "You can not drop on the world map.") return end
 	self:dropFloor(inven, item, true, true)
 	self:sortInven()
 	self:useEnergy()
@@ -390,7 +394,7 @@ function _M:playerTakeoff()
 end
 
 function _M:playerUseItem(object, item, inven)
-	if game.zone.short_name == "wilderness" then game.logPlayer(self, "You can not use items on the world map.") return end
+	if game.zone.wilderness then game.logPlayer(self, "You can not use items on the world map.") return end
 
 	local use_fct = function(o, inven, item)
 		self.changed = true
@@ -471,6 +475,17 @@ function _M:mouseMove(tmx, tmy)
 	end
 end
 
+--- Use a portal with the orb of many ways
+function _M:useOrbPortal(portal)
+	if portal.change_wilderness then
+		self.current_wilderness = portal.change_wilderness.name
+		self.wild_x = portal.change_wilderness.x or 0
+		self.wild_y = portal.change_wilderness.y or 0
+	end
+	game:changeLevel(portal.change_level, portal.change_zone)
+	if portal.message then game.logPlayer(self, portal.message) end
+end
+
 ------ Quest Events
 function _M:on_quest_grant(quest)
 	game.logPlayer(self, "#LIGHT_GREEN#Accepted quest '%s'! #WHITE#(Press CTRL+Q to see the quest log)", quest.name)
diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua
index dd578660d6..f2d1a99530 100644
--- a/game/modules/tome/class/interface/Combat.lua
+++ b/game/modules/tome/class/interface/Combat.lua
@@ -506,6 +506,7 @@ end
 
 --- Do we get hit by our own AOE ?
 function _M:spellFriendlyFire()
+	print("[SPELL] friendly fire chance", self:getTalentLevelRaw(self.T_SPELL_SHAPING) * 20 + (self:getLck() - 50) * 0.2)
 	return rng.chance(self:getTalentLevelRaw(self.T_SPELL_SHAPING) * 20 + (self:getLck() - 50) * 0.2)
 end
 
diff --git a/game/modules/tome/data/birth/races/dwarf.lua b/game/modules/tome/data/birth/races/dwarf.lua
index 91a939d2e7..b29a34feb3 100644
--- a/game/modules/tome/data/birth/races/dwarf.lua
+++ b/game/modules/tome/data/birth/races/dwarf.lua
@@ -47,7 +47,7 @@ newBirthDescriptor{
 	},
 	copy = {
 		type = "humanoid", subtype="dwarf",
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "dwarf",
diff --git a/game/modules/tome/data/birth/races/elf.lua b/game/modules/tome/data/birth/races/elf.lua
index 48a9407d42..4cbbb45a58 100644
--- a/game/modules/tome/data/birth/races/elf.lua
+++ b/game/modules/tome/data/birth/races/elf.lua
@@ -42,7 +42,7 @@ newBirthDescriptor{
 	},
 	copy = {
 		type = "humanoid", subtype="elf",
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "elf",
diff --git a/game/modules/tome/data/birth/races/hobbit.lua b/game/modules/tome/data/birth/races/hobbit.lua
index 7db195a368..9cd57b728b 100644
--- a/game/modules/tome/data/birth/races/hobbit.lua
+++ b/game/modules/tome/data/birth/races/hobbit.lua
@@ -44,7 +44,7 @@ newBirthDescriptor{
 	copy = {
 		type = "humanoid", subtype="hobbit",
 		life_rating = 12,
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "hobbit",
diff --git a/game/modules/tome/data/birth/races/human.lua b/game/modules/tome/data/birth/races/human.lua
index 95b1f69bad..49ab063d7f 100644
--- a/game/modules/tome/data/birth/races/human.lua
+++ b/game/modules/tome/data/birth/races/human.lua
@@ -55,7 +55,7 @@ newBirthDescriptor
 		"Humans hailing from the northen town of Bree. A common kind of man, unremarkable in all respects.",
 	},
 	copy = {
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "bree-man",
@@ -77,7 +77,7 @@ newBirthDescriptor
 		[ActorTalents.T_DUNADAN_HEAL]=1,
 	},
 	copy = {
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "dunadan",
diff --git a/game/modules/tome/data/birth/races/orc.lua b/game/modules/tome/data/birth/races/orc.lua
index dc0b65a193..e9151e703a 100644
--- a/game/modules/tome/data/birth/races/orc.lua
+++ b/game/modules/tome/data/birth/races/orc.lua
@@ -45,7 +45,7 @@ newBirthDescriptor{
 	},
 	copy = {
 		type = "humanoid", subtype="orc",
-		default_wilderness = {"wilderness/arda-east", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "dwarf",
diff --git a/game/modules/tome/data/birth/races/troll.lua b/game/modules/tome/data/birth/races/troll.lua
index ba657f6867..0680dcf65a 100644
--- a/game/modules/tome/data/birth/races/troll.lua
+++ b/game/modules/tome/data/birth/races/troll.lua
@@ -45,7 +45,7 @@ newBirthDescriptor{
 	},
 	copy = {
 		type = "humanoid", subtype="troll",
-		default_wilderness = {"wilderness/arda-east", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "dwarf",
diff --git a/game/modules/tome/data/birth/races/undead.lua b/game/modules/tome/data/birth/races/undead.lua
index a931b98f61..20dc979504 100644
--- a/game/modules/tome/data/birth/races/undead.lua
+++ b/game/modules/tome/data/birth/races/undead.lua
@@ -74,7 +74,7 @@ newBirthDescriptor
 	},
 	copy = {
 		type = "undead", subtype="ghoul",
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "ghoul",
@@ -119,7 +119,7 @@ newBirthDescriptor
 	},
 	copy = {
 		type = "undead", subtype="skeleton",
-		default_wilderness = {"wilderness/arda-west", 39, 17},
+		default_wilderness = {39, 17},
 		starting_zone = "tower-amon-sul",
 		starting_quest = "start-dunadan",
 		starting_intro = "skeleton",
diff --git a/game/modules/tome/data/general/npcs/orc.lua b/game/modules/tome/data/general/npcs/orc.lua
index e15234a09c..5d6551a0f3 100644
--- a/game/modules/tome/data/general/npcs/orc.lua
+++ b/game/modules/tome/data/general/npcs/orc.lua
@@ -73,7 +73,7 @@ newEntity{ base = "BASE_NPC_ORC",
 	},
 }
 
-newEntity{ base = "BASE_NPC_ORC",
+newEntity{ base = "BASE_NPC_ORC", define_as = "URUK-HAI",
 	name = "uruk-hai", color=colors.DARK_RED,
 	desc = [[A fierce soldier-orc.]],
 	level_range = {1, 50}, exp_worth = 1,
@@ -87,7 +87,7 @@ newEntity{ base = "BASE_NPC_ORC",
 	resolvers.talents{ [Talents.T_SUNDER_ARMOUR]=2, [Talents.T_CRUSH]=2, },
 }
 
-newEntity{ base = "BASE_NPC_ORC",
+newEntity{ base = "BASE_NPC_ORC", define_as = "URUK-HAI_FIRE_WYRMIC",
 	name = "fiery wyrmic uruk-hai", color=colors.RED,
 	desc = [[A fierce soldier-orc trained in the discipline of dragons.]],
 	level_range = {1, 50}, exp_worth = 1,
@@ -107,7 +107,7 @@ newEntity{ base = "BASE_NPC_ORC",
 }
 
 newEntity{ base = "BASE_NPC_ORC",
-	name = "icy wyrmic uruk-hai", color=colors.BLUE,
+	name = "icy wyrmic uruk-hai", color=colors.BLUE, define_as = "URUK-HAI_ICE_WYRMIC",
 	desc = [[A fierce soldier-orc trained in the discipline of dragons.]],
 	level_range = {1, 50}, exp_worth = 1,
 	rarity = 8,
diff --git a/game/modules/tome/data/general/npcs/thieve.lua b/game/modules/tome/data/general/npcs/thieve.lua
index a1fd9828d3..7fea434c41 100644
--- a/game/modules/tome/data/general/npcs/thieve.lua
+++ b/game/modules/tome/data/general/npcs/thieve.lua
@@ -28,7 +28,11 @@ newEntity{
 
 	body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 },
 	drops = resolvers.drops{chance=20, nb=1, {} },
-	resolvers.equip{ {type="weapon", subtype="dagger", autoreq=true}, {type="weapon", subtype="dagger", autoreq=true}, {type="armor", subtype="light", autoreq=true} },
+	resolvers.equip{
+		{type="weapon", subtype="dagger", autoreq=true},
+		{type="weapon", subtype="dagger", autoreq=true},
+		{type="armor", subtype="light", autoreq=true}
+	},
 	resolvers.drops{chance=100, nb=2, {type="money"} },
 
 	max_stamina = 100,
diff --git a/game/modules/tome/data/general/objects/money.lua b/game/modules/tome/data/general/objects/money.lua
index 2ab900da01..a373b97f75 100644
--- a/game/modules/tome/data/general/objects/money.lua
+++ b/game/modules/tome/data/general/objects/money.lua
@@ -38,14 +38,14 @@ newEntity{
 	end,
 }
 
-newEntity{ base = "BASE_MONEY",
+newEntity{ base = "BASE_MONEY", define_as = "MONEY_SMALL",
 	name = "gold pieces",
 	add_name = " (#MONEY#)",
 	level_range = {1, 50},
 	money_value = resolvers.rngavg(1, 20),
 }
 
-newEntity{ base = "BASE_MONEY",
+newEntity{ base = "BASE_MONEY", define_as = "MONEY_BIG",
 	name = "huge pile of gold pieces",
 	add_name = " (#MONEY#)",
 	level_range = {30, 50},
diff --git a/game/modules/tome/data/general/objects/quest-artifacts.lua b/game/modules/tome/data/general/objects/quest-artifacts.lua
index f38fc464fa..f6af986961 100644
--- a/game/modules/tome/data/general/objects/quest-artifacts.lua
+++ b/game/modules/tome/data/general/objects/quest-artifacts.lua
@@ -17,8 +17,7 @@
 -- Nicolas Casalini "DarkGod"
 -- darkgod@te4.org
 
--- Special items, used for quests
-
+-- The staff of absorption, the reason the game exists!
 newEntity{ define_as = "STAFF_ABSORPTION",
 	unique = true, quest=true,
 	slot = "MAINHAND",
@@ -29,7 +28,7 @@ newEntity{ define_as = "STAFF_ABSORPTION",
 	display = "\\", color=colors.VIOLET,
 	encumber = 7,
 	desc = [[Carved with runes of power this staff seems to have been made long ago. Yet it retains no signs of tarnishment.
-	Light around it seems to dim and you can feel its tremoundous power simply by touching it.]],
+Light around it seems to dim and you can feel its tremoundous power simply by touching it.]],
 
 	require = { stat = { mag=60 }, },
 	combat = {
@@ -63,6 +62,7 @@ newEntity{ define_as = "STAFF_ABSORPTION",
 	end,
 }
 
+-- The orb of many ways, allows usage of Farportals
 newEntity{ define_as = "ORB_MANY_WAYS",
 	unique = true, quest=true,
 	type = "jewelry", subtype="orb",
@@ -72,7 +72,7 @@ newEntity{ define_as = "ORB_MANY_WAYS",
 	display = "*", color=colors.VIOLET,
 	encumber = 1,
 	desc = [[The orb projects images of distance places, some that seem to not be of this world, switching rapidly.
-	If used near an portal it could probably activate it.]],
+If used near an portal it could probably activate it.]],
 
 	max_power = 50, power_regen = 1,
 	use_power = { name = "activate a portal", power = 25,
@@ -80,7 +80,7 @@ newEntity{ define_as = "ORB_MANY_WAYS",
 			local g = game.level.map(who.x, who.y, game.level.map.TERRAIN)
 			if g and g.orb_portal then
 				world:gainAchievement("SLIDERS", who:resolveSource())
-				game:changeLevel(g.orb_portal.level, g.orb_portal.zone)
+				who:useOrbPortal(g.orb_portal)
 			else
 				game.logPlayer(who, "There is no portal to activate here.")
 			end
diff --git a/game/modules/tome/data/maps/wilderness/arda-fareast.lua b/game/modules/tome/data/maps/wilderness/arda-fareast.lua
new file mode 100644
index 0000000000..fb683dbcb5
--- /dev/null
+++ b/game/modules/tome/data/maps/wilderness/arda-fareast.lua
@@ -0,0 +1,108 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 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
+
+-- The far east on Arda
+
+quickEntity('w', {show_tooltip=true, name='Sun Wall', display='^', color=colors.GOLD, image="terrain/mountain.png", block_move=true})
+quickEntity('=', {show_tooltip=true, name='the great sea', display='~', color=colors.BLUE, image="terrain/river.png", block_move=true})
+quickEntity(' ', {show_tooltip=true, name='plains', display='.', color=colors.LIGHT_GREEN, image="terrain/grass.png", can_encounter=true, equilibrium_level=-10})
+quickEntity('~', {show_tooltip=true, name='river', display='~', color={r=0, g=80, b=255}, image="terrain/river.png", can_encounter=true, equilibrium_level=-10})
+quickEntity('s', {show_tooltip=true, name='desert', display='.', color={r=203,g=189,b=72}, image="terrain/sand.png", can_encounter=true, equilibrium_level=-10})
+quickEntity('t', {show_tooltip=true, name='forest', display='#', color=colors.LIGHT_GREEN, image="terrain/tree.png", block_move=true})
+quickEntity('m', {show_tooltip=true, name='mountains', display='^', color=colors.UMBER, image="terrain/mountain.png", block_move=true})
+quickEntity('h', {show_tooltip=true, name='low hills', display='^', color=colors.GREEN, image="terrain/hills.png", can_encounter=true, equilibrium_level=-10})
+
+--quickEntity('A', {show_tooltip=true, name="Caves below the tower of Amon Sûl", 	display='>', color={r=0, g=255, b=255}, notice = true, change_level=1, change_zone="tower-amon-sul"})
+
+--quickEntity('1', {show_tooltip=true, name="Bree (Town)", desc="A quiet town at the crossroads of the north", display='*', color={r=255, g=255, b=255}, image="terrain/town1.png", notice = true, change_level=1, change_zone="town-bree"})
+--quickEntity('2', {show_tooltip=true, name="Minas Tirith (Town)", desc="Captical city of the Reunited-Kingdom and Gondor ruled by High King Eldarion", display='*', color={r=255, g=255, b=255}, image="terrain/town1.png", notice = true, change_level=1, change_zone="town-minas-tirith"})
+
+-- Load encounters for this map
+--[[
+prepareEntitiesList("encounters", "mod.class.Encounter", "/data/general/encounters/arda-fareast.lua")
+addData{ encounters = {
+	chance=function(who)
+		local harmless_chance = 1 + who:getLck(7)
+		local hostile_chance = 5
+		print("chance", hostile_chance, harmless_chance)
+		if rng.percent(hostile_chance) then return "hostile"
+		elseif rng.percent(harmless_chance) then return "harmless"
+		end
+	end}
+}
+]]
+
+return [[
+=================================================================================
+=================================================================================
+===========       ========================    ===================================
+========             ===================       ==================================
+=======               ================          =================================
+=====                 ================              =============================
+====                  ===============                 ===========================
+===                    ==========               hh    ===========================
+==t  tttt           =============           hhhhhh          =====================
+==t ttttt         ~==  ==========           hhhhh                ================
+==ttttttt         ~    ===========                              =================
+==ttttttt        ~~    ==========~~~                            =================
+==ttttttt       ~~     ===  ===    ~~~                         ==================
+==ttttt         ~       =            ~~~~~~                   ===================
+===tt           ~                         ~~~                   =================
+====            ~~~                                  tt            ==============
+=====             ~~~~                             ttt              =============
+======               ~                           tttt                  ==========
+=======              ~~                       tttttt                    =========
+========              ~~                     tttttt                      ========
+=========     hhh      ~~ tt       ttttttt   tttttt             hh        =======
+==========   hhhh       ~~ tttttttttttttmmmmmtttttt           hhh         =======
+==========   hhhh        ~~ttttttttttttmmmmmmmmttttt        hhhhh         =======
+=========    hhh          ~~ttttttttttmmmmmmmmmmtttt        hhh           =======
+=========                  ~ttttttttttmmmmmmmmmmttt                      ========
+========                ~~~~~~~~tttttt~~mmmmmmmmttt                     =========
+=======              ~~~~      ~~~~~~~~ttmmmmmmmtttt                   ==========
+======            ~~~~             tttttttmmmmmmtttt                   ==========
+=====           ~~~                ttttttmmmmmmttttt                  ===========
+=====        ~~~~                    ttttmmmmttttttt               w  ===========
+====~~~~~~~~~~                         mmmmtttttttt               www============
+=====                                  mmtttttttt                 www============
+=====                                                             www============
+=====                                                             www============
+======                                                            www============
+========          =======              hhhhhh                     Mww============
+==============================       hhhhhhh                      www============
+================================         h                        www============
+=================================                  hh             www============
+=================================                  hhh            www============
+=================================tttt             hhhh            www============
+================================tttttttt          hh               w  ===========
+================================tttttttttt                            ===========
+================================ttttttttttt                            ==========
+===============================stttttttttttt                sssssss    ==========
+==============================sstssstttttttt            sssssssssssssss==========
+=============================sstssttsst            ssssssssssssssssssss==========
+=============================ssssssssssssssssssssssssssssssssssssssssss==========
+=============================sssssssssssssssssssssssssssssssssssssssss===========
+=============================ssssssssssssssssssssssssssssssssssstssss============
+=============================sssssssssssssssssssssssssssssssssssssss=============
+==============================sssssssssstssssssssssssssssssssssssss==============
+==============================ssssssssssssssssssssssssstssssssssss===============
+================================sssssssssssssssssssssssssssssssss================
+===================================ssssssssssssssssssss==========================
+============================================sssssss==============================
+=================================================================================]]
diff --git a/game/modules/tome/data/maps/zones/moria-last.lua b/game/modules/tome/data/maps/zones/moria-last.lua
new file mode 100644
index 0000000000..bcabb5418f
--- /dev/null
+++ b/game/modules/tome/data/maps/zones/moria-last.lua
@@ -0,0 +1,68 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 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
+
+defineTile('<', "UP")
+defineTile(' ', "FLOOR")
+defineTile('+', "DOOR")
+defineTile('#', "WALL")
+defineTile('$', "FLOOR", "MONEY_SMALL")
+defineTile('*', "FLOOR", "MONEY_BIG")
+
+defineTile('&', "FAR_EAST_PORTAL")
+
+defineTile('O', "FLOOR", nil, "GOLBUG")
+defineTile('a', "FLOOR", nil, "HILL_ORC_ARCHER")
+defineTile('o', "FLOOR", nil, "URUK-HAI")
+defineTile('f', "FLOOR", nil, "URUK-HAI_FIRE_WYRMIC")
+defineTile('i', "FLOOR", nil, "URUK-HAI_ICE_WYRMIC")
+
+startx = 0
+starty = 13
+
+return [[
+#######################################################################
+#######################################################################
+#######################################################################
+#######################################################################
+#######################################################################
+#######################################################################
+#####        ##########################################################
+####               a###################################################
+#####                ############a            a########################
+######   ###          ###########              ########################
+####     ###f          ##########              ########a  #############
+###      ###      #    ##########              ######       ###########
+###               ###  ##########             f#####   &&&   ##########
+<    o            ###o +++++                  O+++++   &&&   ##########
+###               ##   ##########             i#####   &&&   ##########
+####        ###        ##########              ######       ###########
+####        ###i       ##########              ########a  #############
+#####       ###       ###########              ########################
+######              a############a            a########################
+########           ####################################################
+##########    #########################################################
+#######################################################################
+#######################################################################
+###############################################+++++++++###############
+###############################################+io$$$$o+###############
+###############################################+a$$***a+###############
+###############################################+fo$$$$o+###############
+###############################################+++++++++###############
+#######################################################################
+#######################################################################]]
diff --git a/game/modules/tome/data/zones/moria/grids.lua b/game/modules/tome/data/zones/moria/grids.lua
index 14dc047df0..3d35db94e4 100644
--- a/game/modules/tome/data/zones/moria/grids.lua
+++ b/game/modules/tome/data/zones/moria/grids.lua
@@ -18,3 +18,22 @@
 -- darkgod@te4.org
 
 load("/data/general/grids/basic.lua")
+
+newEntity{
+	define_as = "FAR_EAST_PORTAL",
+	name = "Farportal: the Far East",
+	display = '&', color_r=255, color_g=0, color_b=220,
+	notice = true,
+	always_remember = true,
+	show_tooltip = true,
+	desc = [[A farportal is a way to travel increible distances in the blink of an eye. They usualy require an external item to use. You have no idea if it is even two-way.
+This one seems to go to the Far East, a continent of Arda of which only rumours are know...]],
+	orb_portal = {
+		change_level = 1,
+		change_zone = "wilderness-arda-fareast",
+		change_wilderness = {
+			x = 9, y = 5,
+		},
+		message = "#VIOLET#You enter the swirling portal and in the blink of an eye you set foot on an unfamiliar land, with no trace of the portal...",
+	}
+}
diff --git a/game/modules/tome/data/zones/moria/npcs.lua b/game/modules/tome/data/zones/moria/npcs.lua
index d60ba9a99c..f0db6908fb 100644
--- a/game/modules/tome/data/zones/moria/npcs.lua
+++ b/game/modules/tome/data/zones/moria/npcs.lua
@@ -55,19 +55,27 @@ newEntity{ define_as = "GOLBUG",
 
 	resolvers.talents{
 		[Talents.T_SUMMON]=1,
+
 		[Talents.T_HEAVY_ARMOUR_TRAINING]=1,
 		[Talents.T_MASSIVE_ARMOUR_TRAINING]=1,
 		[Talents.T_WEAPON_COMBAT]=6,
 		[Talents.T_MACE_MASTERY]=6,
-		[Talents.T_STAMINA_POOL]=1,
-			[Talents.T_SHIELD_PUMMEL]=4,
-			[Talents.T_RUSH]=4,
-			[Talents.T_RIPOSTE]=4,
-			[Talents.T_BLINDING_SPEED]=4,
-			[Talents.T_OVERPOWER]=3,
-			[Talents.T_ASSAULT]=3,
-			[Talents.T_SHIELD_WALL]=3,
-			[Talents.T_SHIELD_EXPERTISE]=2,
+		[Talents.T_SHIELD_PUMMEL]=4,
+		[Talents.T_RUSH]=4,
+		[Talents.T_RIPOSTE]=4,
+		[Talents.T_BLINDING_SPEED]=4,
+		[Talents.T_OVERPOWER]=3,
+		[Talents.T_ASSAULT]=3,
+		[Talents.T_SHIELD_WALL]=3,
+		[Talents.T_SHIELD_EXPERTISE]=2,
+
+		[Talents.T_BELLOWING_ROAR]=3,
+		[Talents.T_WING_BUFFET]=2,
+		[Talents.T_FIRE_BREATH]=4,
+
+		[Talents.T_ICE_CLAW]=3,
+		[Talents.T_ICY_SKIN]=4,
+		[Talents.T_ICE_BREATH]=4,
 	},
 
 	autolevel = "warrior",
diff --git a/game/modules/tome/data/zones/moria/zone.lua b/game/modules/tome/data/zones/moria/zone.lua
index 19a73573b1..a0bcd57d93 100644
--- a/game/modules/tome/data/zones/moria/zone.lua
+++ b/game/modules/tome/data/zones/moria/zone.lua
@@ -28,7 +28,7 @@ return {
 	all_remembered = true,
 	all_lited = true,
 --	persistant = "zone",
-	ambiant_music = "cirith-ungol.ogg",
+	ambiant_music = "a_lomos_del_dragon_blanco.ogg",
 	generator =  {
 		map = {
 			class = "engine.generator.map.TileSet",
@@ -42,20 +42,16 @@ return {
 		},
 		actor = {
 			class = "engine.generator.actor.Random",
-			nb_npc = {20, 30},
-			guardian = "GOLBUG",
+			nb_npc = {40, 50},
 		},
---[[
 		object = {
 			class = "engine.generator.object.Random",
-			nb_object = {6, 9},
-			filters = { {ego_chance = 20} }
+			nb_object = {12, 16},
 		},
 		trap = {
 			class = "engine.generator.trap.Random",
-			nb_trap = {6, 9},
+			nb_trap = {20, 30},
 		},
-]]
 	},
 	levels =
 	{
@@ -70,9 +66,9 @@ return {
 					class = "engine.generator.map.Static",
 					map = "zones/moria-last",
 				},
-				actor = {
-					nb_npc = {7, 7},
-				},
+				actor = { nb_npc = {3, 3}, },
+				object = { nb_object = {8, 10}, },
+				trap = { nb_trap = {1, 1}, },
 			},
 		},
 	},
diff --git a/game/modules/tome/data/zones/sandworm-lair/objects.lua b/game/modules/tome/data/zones/sandworm-lair/objects.lua
index ca4a86892e..78b9de6a50 100644
--- a/game/modules/tome/data/zones/sandworm-lair/objects.lua
+++ b/game/modules/tome/data/zones/sandworm-lair/objects.lua
@@ -26,7 +26,7 @@ newEntity{
 	name = "Heart of the Sandworm Queen", unique=true, unided_name="pulsing organ",
 	display = "*", color=colors.VIOLET,
 	desc = [[The heart of the Sandworm Queen, ripped from her dead body. You could ... consume it, should you feel mad enough.]],
-	cost = 4000,
+	cost = 3000,
 
 	use_simple = { name="consume the heart", use = function(self, who)
 		game.logPlayer(who, "#00FFFF#You consume the heart and feel the knowledge of this very old creature fills you!")
diff --git a/game/modules/tome/data/zones/wilderness-arda-fareast/grids.lua b/game/modules/tome/data/zones/wilderness-arda-fareast/grids.lua
new file mode 100644
index 0000000000..cad1c5dde4
--- /dev/null
+++ b/game/modules/tome/data/zones/wilderness-arda-fareast/grids.lua
@@ -0,0 +1,18 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 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
diff --git a/game/modules/tome/data/zones/wilderness-arda-fareast/npcs.lua b/game/modules/tome/data/zones/wilderness-arda-fareast/npcs.lua
new file mode 100644
index 0000000000..82f2444fc9
--- /dev/null
+++ b/game/modules/tome/data/zones/wilderness-arda-fareast/npcs.lua
@@ -0,0 +1,19 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 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
+
diff --git a/game/modules/tome/data/zones/wilderness-arda-fareast/objects.lua b/game/modules/tome/data/zones/wilderness-arda-fareast/objects.lua
new file mode 100644
index 0000000000..b5facd63f5
--- /dev/null
+++ b/game/modules/tome/data/zones/wilderness-arda-fareast/objects.lua
@@ -0,0 +1,20 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 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
+
+load("/data/general/objects/objects.lua")
diff --git a/game/modules/tome/data/zones/wilderness-arda-fareast/zone.lua b/game/modules/tome/data/zones/wilderness-arda-fareast/zone.lua
new file mode 100644
index 0000000000..3c543997d6
--- /dev/null
+++ b/game/modules/tome/data/zones/wilderness-arda-fareast/zone.lua
@@ -0,0 +1,37 @@
+-- ToME - Tales of Middle-Earth
+-- Copyright (C) 2009, 2010 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
+
+return {
+	name = "Far East",
+	level_range = {1, 1},
+	max_level = 1,
+	width = 100, height = 100,
+	all_remembered = true,
+	all_lited = true,
+	persistant = "memory",
+	wilderness = true,
+	wilderness_see_radius = 3,
+	ambiant_music = "last",
+	generator =  {
+		map = {
+			class = "engine.generator.map.Static",
+			map = "wilderness/arda-fareast",
+		},
+	}
+}
diff --git a/game/modules/tome/data/zones/wilderness/zone.lua b/game/modules/tome/data/zones/wilderness/zone.lua
index 84a62f91ff..c0f1222075 100644
--- a/game/modules/tome/data/zones/wilderness/zone.lua
+++ b/game/modules/tome/data/zones/wilderness/zone.lua
@@ -18,7 +18,7 @@
 -- darkgod@te4.org
 
 return {
-	name = "wilderness",
+	name = "Middle-earth",
 	level_range = {1, 1},
 	max_level = 1,
 	width = 200, height = 130,
@@ -26,13 +26,11 @@ return {
 	all_lited = true,
 	persistant = "memory",
 	ambiant_music = "last",
+	wilderness = true,
 	generator =  {
 		map = {
-			class = "mod.class.generator.map.Wilderness",
-		},
-		object = {
-			class = "engine.generator.object.Random",
-			nb_object = {0,0},
+			class = "engine.generator.map.Static",
+			map = "wilderness/arda-west",
 		},
 	}
 }
-- 
GitLab