diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 6a3cc95a2fbd5f9609ad0fdf891d380aa36fea76..df4fbf2016b81b7806444fc1c78f713889834022 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -274,7 +274,7 @@ function _M:leaveLevel(level, lev, old_lev) end end -function _M:changeLevel(lev, zone) +function _M:changeLevel(lev, zone, keep_old_lev) if not self.player.game_ender then game.logPlayer(self.player, "#LIGHT_RED#You may not change level without your own body!") return @@ -287,6 +287,7 @@ function _M:changeLevel(lev, zone) end local old_lev = (self.level and not zone) and self.level.level or -1000 + if keep_old_lev then old_lev = self.level.level end if zone then if self.zone then self.zone:leaveLevel(false, lev, old_lev) @@ -578,7 +579,7 @@ function _M:setupCommands() self.log("You can not go into the wilds with the following effects: %s", table.concat(stop, ", ")) else -- 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) + self:changeLevel(e.change_zone and e.change_level or self.level.level + e.change_level, e.change_zone, e.keep_old_lev) end else self.log("There is no way out of this level here.") diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index 18b44058a93d0a553f7eba0404868329da1a299c..11bf0dc72664b02e2c50305e4e57a2a1d75799ac 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -59,9 +59,6 @@ newBirthDescriptor{ {type="potion", subtype="potion", name="potion of lesser healing", ego_chance=-1000}, {type="potion", subtype="potion", name="potion of cure poison", ego_chance=-1000}, {type="potion", subtype="potion", name="potion of cure poison", ego_chance=-1000}, - {type="gem", name="fire opal"}, - {type="gem", name="diamond"}, - {type="jewelry", subtype="ring", name="mithril ring", ego_chance=-1000}, }, resolvers.generic(function(e) e.hotkey[9] = {"inventory", "potion of lesser healing"} diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index c1109e54900d5fdee1672122a21a2d9a416ec703..2ae0ef116d9004b8aa1506d03dde9a1718c76771 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -374,9 +374,11 @@ newDamageType{ -- Fireburn damage + repulsion; checks for spell power against physical resistance newDamageType{ - name = "fireknockback", type = "FIREKNOCKBACK", + name = "fire knockback", type = "FIREKNOCKBACK", projector = function(src, x, y, type, dam, tmp) local target = game.level.map(x, y, Map.ACTOR) + if _G.type(dam) ~= "table" then dam = {dam=dam, dist=3} end + tmp = tmp or {} if target and not tmp[target] then tmp[target] = true DamageType:get(DamageType.FIREBURN).projector(src, x, y, DamageType.FIREBURN, dam.dam) diff --git a/game/modules/tome/data/general/objects/objects.lua b/game/modules/tome/data/general/objects/objects.lua index a08a0b7f7fcc7cbf9f8d21074fa1dd265653ff4f..f2c40b5cceae7ec880ba96e1ba87b9680b172072 100644 --- a/game/modules/tome/data/general/objects/objects.lua +++ b/game/modules/tome/data/general/objects/objects.lua @@ -39,6 +39,8 @@ loadIfNot("/data/general/objects/jewelry.lua") loadIfNot("/data/general/objects/staves.lua") loadIfNot("/data/general/objects/knifes.lua") +loadIfNot("/data/general/objects/whips.lua") + loadIfNot("/data/general/objects/swords.lua") loadIfNot("/data/general/objects/2hswords.lua") diff --git a/game/modules/tome/data/general/objects/whips.lua b/game/modules/tome/data/general/objects/whips.lua new file mode 100644 index 0000000000000000000000000000000000000000..88f81ccfe740b11507650315565a9f0941852907 --- /dev/null +++ b/game/modules/tome/data/general/objects/whips.lua @@ -0,0 +1,32 @@ +-- 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 + +newEntity{ + define_as = "BASE_WHIP", + slot = "MAINHAND", offslot = "OFFHAND", + type = "weapon", subtype="whip", + add_name = " (#COMBAT#)", + display = "|", color=colors.SLATE, image = resolvers.image_material("whip", "leather"), + encumber = 3, + rarity = 5, + metallic = true, + combat = { talented = "whip", damrange = 1.1, sound = "actions/melee", sound_miss = "actions/melee_miss",}, + desc = [[Sharp, long, and deadly.]], + egos = "/data/general/objects/egos/weapon.lua", egos_chance = { prefix=resolvers.mbonus(40, 5), suffix=resolvers.mbonus(40, 5) }, +} diff --git a/game/modules/tome/data/maps/zones/valley-moon.lua b/game/modules/tome/data/maps/zones/valley-moon.lua index 6b6e3486a1b83ef8b3a4c62cd4a2637453ae2c65..e3e15646601e4206f04fde506f2a9f151f7cb508 100644 --- a/game/modules/tome/data/maps/zones/valley-moon.lua +++ b/game/modules/tome/data/maps/zones/valley-moon.lua @@ -17,7 +17,7 @@ -- Nicolas Casalini "DarkGod" -- darkgod@te4.org -quickEntity('>', {always_remember = true, show_tooltip=true, name="Passage to the caverns", desc="A dark hole in the mountain", display='>', color=colors.GREY, notice = true, change_level=2, change_zone="valley-moon-caverns"}) +quickEntity('>', {always_remember = true, show_tooltip=true, name="Passage to the caverns", desc="A dark hole in the mountain", display='>', color=colors.GREY, notice = true, change_level=2, change_zone="valley-moon-caverns", keep_old_lev=true}) defineTile('.', "GRASS") defineTile('~', "POISON_DEEP_WATER") defineTile('"', "GRASS", nil, nil, nil, {summon_limmir=true}) diff --git a/game/modules/tome/data/quests/master-jeweler.lua b/game/modules/tome/data/quests/master-jeweler.lua index b90a08d05c74525b428695649617b2b152a35a19..6e882b664159331078a749c4b13170fcc983810c 100644 --- a/game/modules/tome/data/quests/master-jeweler.lua +++ b/game/modules/tome/data/quests/master-jeweler.lua @@ -60,7 +60,7 @@ start_search = function(self, who) name="Cavern leading to the valley of the moon", display='>', color=colors.GREY, notice = true, - change_level=1, change_zone="valley-moon" + change_level=1, change_zone="valley-moon-caverns" } g:resolve() g:resolve(nil, true) game.zone:addEntity(game.memory_levels["wilderness-arda-fareast-1"], g, "terrain", 48, 53) diff --git a/game/modules/tome/data/zones/valley-moon-caverns/grids.lua b/game/modules/tome/data/zones/valley-moon-caverns/grids.lua new file mode 100644 index 0000000000000000000000000000000000000000..fd4bae0a2e167eacdac398b92530f77353b7ede1 --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon-caverns/grids.lua @@ -0,0 +1,30 @@ +-- 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/grids/basic.lua") + +newEntity{ + define_as = "UP_VALLEY", + name = "exit to the lost valley", + display = '<', color_r=255, color_g=0, color_b=255, + always_remember = true, + notice = true, + change_level = 3, + change_zone = "valley-moon", +} diff --git a/game/modules/tome/data/zones/valley-moon-caverns/npcs.lua b/game/modules/tome/data/zones/valley-moon-caverns/npcs.lua new file mode 100644 index 0000000000000000000000000000000000000000..3df9861f70452f35e04091044633863c9819ba92 --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon-caverns/npcs.lua @@ -0,0 +1,21 @@ +-- 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/npcs/minor-demon.lua", rarity(0)) +load("/data/general/npcs/all.lua", rarity(4, 35)) diff --git a/game/modules/tome/data/zones/valley-moon-caverns/objects.lua b/game/modules/tome/data/zones/valley-moon-caverns/objects.lua new file mode 100644 index 0000000000000000000000000000000000000000..cea7eb148c36c019214139b66715598bceafe35e --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon-caverns/objects.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 + +load("/data/general/objects/objects.lua") + +newEntity{ base = "BASE_WAND", + define_as = "ROD_SPYDRIC_POISON", + name = "Rod of Spydric Poison", color=colors.LIGHT_GREEN, unique=true, + cost = 50, + elec_proof = true, + + max_power = 75, power_regen = 1, + use_power = { name = "shoot a bolt of spyric poison", power = 25, + use = function(self, who) + local tg = {type="bolt", range=12, talent=t} + local x, y = who:getTarget(tg) + if not x or not y then return nil end + who:project(tg, x, y, engine.DamageType.SPYDRIC_POISON, {dam=200 + who:getMag() * 4, dur=6}, {type="slime"}) + end + }, +} diff --git a/game/modules/tome/data/zones/valley-moon-caverns/traps.lua b/game/modules/tome/data/zones/valley-moon-caverns/traps.lua new file mode 100644 index 0000000000000000000000000000000000000000..4ee7b9dd16339fa08f75a53f0729e74fc71d6daf --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon-caverns/traps.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/traps/water.lua") diff --git a/game/modules/tome/data/zones/valley-moon-caverns/zone.lua b/game/modules/tome/data/zones/valley-moon-caverns/zone.lua new file mode 100644 index 0000000000000000000000000000000000000000..916a3d5216672eb0a4f346b3d04927ba3ca94c94 --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon-caverns/zone.lua @@ -0,0 +1,73 @@ +-- 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 = "Caverns to the hidden valley", + level_range = {30, 40}, + level_scheme = "player", + max_level = 2, + decay = {300, 800}, + actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end, + width = 70, height = 70, + all_remembered = true, + all_lited = true, + persistant = "zone", + -- Apply a darkish tint to all the map + color_shown = {0.7, 0.7, 0.7, 1}, + color_obscure = {0.7*0.6, 0.7*0.6, 0.7*0.6, 1}, + generator = { + map = { + class = "engine.generator.map.Cavern", + zoom = 16, + min_floor = 1200, + floor = "FLOOR", + wall = "WALL", + up = "UP", + down = "DOWN", + door = "FLOOR", + }, + actor = { + class = "engine.generator.actor.Random", + nb_npc = {30, 40}, + guardian = "UNGOLE", + }, + object = { + class = "engine.generator.object.Random", + nb_object = {6, 9}, + }, + trap = { + class = "engine.generator.trap.Random", + nb_object = {0, 0}, + }, + }, + levels = + { + [1] = { + generator = { map = { + up = "UP_WILDERNESS_FAR_EAST", + }, }, + }, + [2] = { + generator = { map = { + down = "UP_VALLEY", + force_last_stair = true, + }, }, + }, + }, +} diff --git a/game/modules/tome/data/zones/valley-moon/npcs.lua b/game/modules/tome/data/zones/valley-moon/npcs.lua index a72bfb0c255b511c9c61ebe3533b2dd4447b4389..8174c1062ea90660e2ac68e9888e490acdcf9452 100644 --- a/game/modules/tome/data/zones/valley-moon/npcs.lua +++ b/game/modules/tome/data/zones/valley-moon/npcs.lua @@ -36,21 +36,28 @@ newEntity{ define_as = "CORRUPTED_BALROG", instakill_immune = 1, no_breath = 1, move_others=true, + demon = 1, + + on_melee_hit = { [DamageType.FIRE] = 50, [DamageType.LIGHT] = 30, }, body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, resolvers.equip{ - {type="weapon", subtype="staff", autoreq=true}, - {type="armor", subtype="light", autoreq=true}, + {type="weapon", subtype="whip", defined="WHIP_GOTHMOG", autoreq=true}, }, resolvers.drops{chance=100, nb=3, {ego_chance=100} }, resolvers.talents{ - [Talents.T_MANATHRUST]=4, [Talents.T_FREEZE]=4, [Talents.T_TIDAL_WAVE]=2, - [Talents.T_SWORD_MASTERY]=3, [Talents.T_STUNNING_BLOW]=1, + [Talents.T_FIREBEAM]=5, + [Talents.T_DARKNESS]=3, + [Talents.T_FLAME]=5, + [Talents.T_POISON_BREATH]=5, + [Talents.T_FIRE_BREATH]=5, + [Talents.T_RUSH]=5, + [Talents.T_WEAPON_COMBAT]=10, }, - autolevel = "warriormage", - ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar" }, + autolevel = "dexmage", + ai = "dumb_talented_simple", ai_state = { talent_in=2, ai_move="move_astar" }, on_die = function(self, who) end, diff --git a/game/modules/tome/data/zones/valley-moon/objects.lua b/game/modules/tome/data/zones/valley-moon/objects.lua index fa9642c33dee08637bc5da672fc56bd70a5e87e0..00105078a18550b6fc2615fb253b67e40841f026 100644 --- a/game/modules/tome/data/zones/valley-moon/objects.lua +++ b/game/modules/tome/data/zones/valley-moon/objects.lua @@ -19,29 +19,29 @@ load("/data/general/objects/objects.lua") --- Artifact, droped (and used!) by the Shade of Angmar -newEntity{ base = "BASE_STAFF", - define_as = "STAFF_ANGMAR", rarity=false, - name = "Angmar's Fall", unique=true, - desc = [[Made from the bones of of many creatures this staff glows with power. You can feel its evilness as you touch it.]], - require = { stat = { mag=25 }, }, - cost = 5, +newEntity{ base = "BASE_WHIP", + define_as = "WHIP_GOTHMOG", + unided_name = "fiery whip", + name = "Whip of Gothmog, High Captain of the Balrogs", color=colors.PURPLE, unique = true, + desc = [[With this unbearably bright whip of flame, the Balrog Gothmog has become known for never having lost in combat. +But nothing lasts forever and he was finaly defeated by Echtelion in the First Age. His whip must have been by the other balrogs from its corpse.]], + require = { stat = { dex=48 }, }, + cost = 250, + material_level = 5, combat = { - dam = 10, + dam = resolvers.rngavg(40,45), apr = 0, - physcrit = 1.5, - dammod = {mag=1.1}, + physcrit = 9, + dammod = {dex=1}, + damtype = DamageType.FIREKNOCKBACK, }, wielder = { + esp = {["demon/minor"]=1, ["demon/major"]=1}, see_invisible = 2, - combat_spellpower = 7, - combat_spellcrit = 8, + }, + carrier = { inc_damage={ - [DamageType.FIRE] = 4, - [DamageType.COLD] = 4, - [DamageType.ACID] = 4, - [DamageType.LIGHTNING] = 4, - [DamageType.BLIGHT] = 4, + [DamageType.BLIGHT] = 8, }, }, }