diff --git a/game/engine/Level.lua b/game/engine/Level.lua index 49c35120fb6662599d6ef9fd74cbbf99b56f7abe..ba81607dbc9a3917c53476882318ce8dd0281ada 100644 --- a/game/engine/Level.lua +++ b/game/engine/Level.lua @@ -135,3 +135,12 @@ function _M:decay(what, check) end end return nb, total end + +--- Pick a random spot matching the given filter +function _M:pickSpot(filter) + local list = {} + for i, spot in ipairs(self.spots) do + if game.zone:checkFilter(spot, filter) then list[#list+1] = spot end + end + return rng.table(list) +end diff --git a/game/engine/ai/simple.lua b/game/engine/ai/simple.lua index c384ac149e7ff2735242a74ccf14dae1987cf25d..e9f57cae547c0a643c671170e8f69f91136a945e 100644 --- a/game/engine/ai/simple.lua +++ b/game/engine/ai/simple.lua @@ -74,3 +74,5 @@ newAI("simple", function(self) end return false end) + +newAI("none", function(self) end) diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 9f8d4a6272648d860167fa32ee080c3f49c7aa2d..6a3cc95a2fbd5f9609ad0fdf891d380aa36fea76 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -475,11 +475,11 @@ function _M:setupCommands() self.player.esp.all = 1 self.player.esp.range = 50 self.player.inc_damage.all = 100000 - self:changeLevel(5, "gorbat-pride") +-- self:changeLevel(5, "gorbat-pride") -- self:changeLevel(1, "town-gates-of-morning") --- self:changeLevel(1, "wilderness-arda-fareast") --- game.memory_levels["wilderness-arda-fareast-1"] = game.level --- self.player:grantQuest("orc-pride") + self:changeLevel(1, "wilderness-arda-fareast") + game.memory_levels["wilderness-arda-fareast-1"] = game.level + self.player:grantQuest("orc-pride") -- self.player:grantQuest("escort-duty") end end, @@ -488,7 +488,7 @@ function _M:setupCommands() self.player:incStat("str", 100) self.player:incStat("dex", 100) self.player:incStat("mag", 100) self.player:incStat("wil", 100) self.player:incStat("cun", 100) self.player:incStat("con", 100) self.player:learnTalent(self.player.T_HEAVY_ARMOUR_TRAINING, true) self.player:learnTalent(self.player.T_MASSIVE_ARMOUR_TRAINING, true) for i, e in ipairs(self.zone.object_list) do - if e.unique and e.rarity then + if e.unique and (not e.define_as or e.define_as ~= "JEWELER_SUMMON") then -- and e.rarity then local a = self.zone:finishEntity(self.level, "object", e) a:identify(true) self.zone:addEntity(self.level, a, "object", self.player.x, self.player.y) diff --git a/game/modules/tome/class/Grid.lua b/game/modules/tome/class/Grid.lua index 26b354956627c1bffc93da3b05f84b616edce550..20c6e0b520232918e4cebe738c8cc51ed93bae8c 100644 --- a/game/modules/tome/class/Grid.lua +++ b/game/modules/tome/class/Grid.lua @@ -133,11 +133,12 @@ function _M:makeShells(base, max) end --- Generate sub entities to make translucent water -function _M:makeWater(z) +function _M:makeWater(z, prefix) + prefix = prefix or "" return { engine.Entity.new{ z = z and 16 or 9, - image = "terrain/water_floor_alpha.png", - shader = "water", textures = { function() return _3DNoise, true end }, + image = "terrain/"..prefix.."water_floor_alpha.png", + shader = prefix.."water", textures = { function() return _3DNoise, true end }, display_on_seen = true, display_on_remember = true, } } diff --git a/game/modules/tome/class/Object.lua b/game/modules/tome/class/Object.lua index 7d816b6da1c15e40f85c0236ff4971d8398b6044..ce4c35f5ea9802408c647bbadcec6649a9ef2b32 100644 --- a/game/modules/tome/class/Object.lua +++ b/game/modules/tome/class/Object.lua @@ -189,6 +189,12 @@ function _M:getTextualDesc() desc[#desc+1] = "Damage type: "..DamageType:get(self.combat.damtype or DamageType.PHYSICAL).name if self.combat.range then desc[#desc+1] = "Firing range: "..self.combat.range end desc[#desc+1] = "" + + if self.combat.talent_on_hit then + for tid, data in pairs(self.combat.talent_on_hit) do + desc[#desc+1] = ("Talent on hit(melee): %d%% chance %s (level %d)."):format(data.chance, self:getTalentFromId(tid).name, data.level) + end + end end local desc_wielder = function(w) @@ -212,13 +218,6 @@ function _M:getTextualDesc() desc[#desc+1] = ("Damage on hit(melee): %s."):format(table.concat(rs, ',')) end - if self.combat and self.combat.talent_on_hit then - local rs = {} - for tid, data in pairs(self.combat.talent_on_hit) do - desc[#desc+1] = ("Talent on hit(melee): %d%% chance %s (level %d)."):format(data.chance, self:getTalentFromId(tid).name, data.level) - end - end - if w.ranged_project then local rs = {} for typ, dam in pairs(w.ranged_project) do @@ -323,16 +322,24 @@ function _M:getTextualDesc() if w.invisible then desc[#desc+1] = ("Invisibility: %d"):format(w.invisible) end end - desc_wielder(self.wielder or {}) + if self.wielder then + desc[#desc+1] = "#YELLOW#When wielded/worn:#LAST#" + desc_wielder(self.wielder) + end + + if self.carrier then + desc[#desc+1] = "#YELLOW#When carried:#LAST#" + desc_wielder(self.carrier) + end if self.imbue_powers then - desc[#desc+1] = "When used to imbue an armour:" + desc[#desc+1] = "#YELLOW#When used to imbue an armour:#LAST#" desc_wielder(self.imbue_powers) end if self.alchemist_bomb then local a = self.alchemist_bomb - desc[#desc+1] = "When used as an alchemist bomb:" + desc[#desc+1] = "#YELLOW#When used as an alchemist bomb:#LAST#" if a.power then desc[#desc+1] = ("Bomb damage +%d%%"):format(a.power) end if a.range then desc[#desc+1] = ("Bomb thrown range +%d"):format(a.range) end if a.mana then desc[#desc+1] = ("Mana regain %d"):format(a.mana) end diff --git a/game/modules/tome/class/generator/actor/MountDoom.lua b/game/modules/tome/class/generator/actor/MountDoom.lua index 4a284461968c0fb735179e6c70519167113f5251..10685133fbf42c417f4875a15fc81e70aa1433ab 100644 --- a/game/modules/tome/class/generator/actor/MountDoom.lua +++ b/game/modules/tome/class/generator/actor/MountDoom.lua @@ -55,7 +55,7 @@ function _M:generateOne() x = rng.range(3, 8) tries = tries + 1 end - if tries < 100 then + if tries < 10 then self.zone:addEntity(self.level, m, "actor", x, y) end end diff --git a/game/modules/tome/class/generator/actor/ValleyMoon.lua b/game/modules/tome/class/generator/actor/ValleyMoon.lua new file mode 100644 index 0000000000000000000000000000000000000000..5472ab663fec03b77a31257bf3f5c59961bc04a5 --- /dev/null +++ b/game/modules/tome/class/generator/actor/ValleyMoon.lua @@ -0,0 +1,90 @@ +-- TE4 - T-Engine 4 +-- 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 + +require "engine.class" +local Map = require "engine.Map" +local DamageType = require "engine.DamageType" +require "engine.Generator" + +module(..., package.seeall, class.inherit(engine.Generator)) + +function _M:init(zone, map, level, spots) + engine.Generator.init(self, zone, map, level, spots) + self.data = level.data.generator.actor + self.level = level + self.rate = self.data.rate + self.max_rate = 5 + self.turn_scale = game.energy_per_tick / game.energy_to_act + + if not _M.limmir then + for i, e in pairs(level.entities) do + if e.define_as and e.define_as == "LIMMIR" then _M.limmir = e break end + end + end +end + +function _M:tick() + local val = rng.float(0,1) + for i = 1,self.max_rate - 1 do + if val < rng.poissonProcess(i, self.turn_scale, self.rate) then + self:generateOne() + else + break + end + end + + -- Fire a light AOE, healing allies damaging demons + if _M.limmir and not _M.limmir.dead and game.turn % 100 == 0 then + game.logSeen(_M.limmir, "Limmir summons a blast of holy light!") + local rad = math.ceil(2 + (500 - self.level.turn_counter / 10) / 20) + local dam = 50 + (500 - self.level.turn_counter / 10) / 7 + local grids = _M.limmir:project({type="ball", radius=rad}, _M.limmir.x, _M.limmir.y, DamageType.HOLY_LIGHT, dam) + game.level.map:particleEmitter(_M.limmir.x, _M.limmir.y, rad, "sunburst", {radius=rad, grids=grids, tx=_M.limmir.x, ty=_M.limmir.y}) + end +end + +function _M:generateOne() + local m + if not self.level.balroged and self.level.turn_counter < 50 * 10 then + m = self.zone:makeEntityByName(self.level, "actor", "CORRUPTED_BALROG") + self.level.balroged = true + else + m = self.zone:makeEntity(self.level, "actor", {type="demon"}, nil, true) + end + + if m then + local spot = self.level:pickSpot{type="portal", subtype="demon"} + local x = spot.x + local y = spot.y + local tries = 0 + while (not m:canMove(x, y)) and tries < 10 do + spot = self.level:pickSpot{type="portal", subtype="demon"} + x = spot.x y = spot.y + tries = tries + 1 + end + if tries < 10 then + if _M.limmir and not _M.limmir.dead then + m:setTarget(_M.limmir) + else + m:setTarget(game.player) + end + self.zone:addEntity(self.level, m, "actor", x, y) + end + end +end diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index 11bf0dc72664b02e2c50305e4e57a2a1d75799ac..18b44058a93d0a553f7eba0404868329da1a299c 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -59,6 +59,9 @@ 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/chats/jewelry-store.lua b/game/modules/tome/data/chats/jewelry-store.lua new file mode 100644 index 0000000000000000000000000000000000000000..96fb259148c85874c18a2ba02f4bb5175ad9420c --- /dev/null +++ b/game/modules/tome/data/chats/jewelry-store.lua @@ -0,0 +1,120 @@ +-- 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 + +local imbue_ring = function(npc, player) + player:showInventory("Imbue which ring?", player:getInven("INVEN"), function(o) return o.type == "jewelry" and o.subtype == "ring" and not o.egoed and not o.unique end, function(ring, ring_item) + player:showInventory("Use which gem?", player:getInven("INVEN"), function(gem) return gem.type == "gem" and gem.material_level <= ring.material_level end, function(gem, gem_item) + local price = 10 + gem.material_level * 5 + ring.material_level * 7 + if price > player.money then require("engine.Dialog"):simplePopup("Not enough money", "This costs "..price.." gold, you need more gold.") return end + + require("engine.Dialog"):yesnoPopup("Imbue cost", "This will cost you "..price.." gold, do you accept?", function(ret) if ret then + player:removeObject(player:getInven("INVEN"), gem_item) + ring.wielder = ring.wielder or {} + table.mergeAdd(ring.wielder, gem.imbue_powers, true) + ring.name = gem.name .. " ring" + ring.been_imbued = true + ring.egoed = true + game.logPlayer(player, "%s creates: %s", npc.name:capitalize(), ring:getName{do_colour=true, no_count=true}) + end end) + end) + end) +end + +local artifact_imbue_ring = function(npc, player) + player:showInventory("Imbue which ring?", player:getInven("INVEN"), function(o) return o.type == "jewelry" and o.subtype == "ring" and not o.egoed and not o.unique end, function(ring, ring_item) + player:showInventory("Use which first gem?", player:getInven("INVEN"), function(gem1) return gem1.type == "gem" and gem1.material_level <= ring.material_level end, function(gem1, gem1_item) + player:showInventory("Use which second gem?", player:getInven("INVEN"), function(gem2) return gem2.type == "gem" and gem2.material_level <= ring.material_level and gem1.name ~= gem2.name end, function(gem2, gem2_item) + local price = 390 + if price > player.money then require("engine.Dialog"):simplePopup("Not enough money", "Limmir needs more gold for the magical plating.") return end + + require("engine.Dialog"):yesnoPopup("Imbue cost", "You need to use "..price.." gold for the plating, do you accept?", function(ret) if ret then + local gem3 = game.zone:makeEntity(game.level, "object", {type="gem"}, nil, true) + print("Imbue third gem", gem3.name) + + if gem1_item > gem2_item then + player:removeObject(player:getInven("INVEN"), gem1_item) + player:removeObject(player:getInven("INVEN"), gem2_item) + else + player:removeObject(player:getInven("INVEN"), gem2_item) + player:removeObject(player:getInven("INVEN"), gem1_item) + end + ring.wielder = ring.wielder or {} + table.mergeAdd(ring.wielder, gem1.imbue_powers, true) + table.mergeAdd(ring.wielder, gem2.imbue_powers, true) + table.mergeAdd(ring.wielder, gem3.imbue_powers, true) + ring.name = "Limmir's Ring of the Moon" + ring.been_imbued = true + ring.unique = util.uuid() + game.logPlayer(player, "%s creates: %s", npc.name:capitalize(), ring:getName{do_colour=true, no_count=true}) + end end) + end) + end) + end) +end + +newChat{ id="welcome", + text = [[Welcome @playername@ to my shop.]], + answers = { + {"Let me see your wares.", action=function(npc, player) + npc.store:loadup(game.level, game.zone) + npc.store:interact(player) + end, cond=function(npc, player) return npc.store and true or false end}, + {"I am looking for special jewelry.", jump="jewelry"}, + {"So you can make better rings in this place?", jump="artifact_jewelry", cond=function(npc, player) return npc.can_craft and player:hasQuest("master-jeweler") and player:isQuestStatus("master-jeweler", engine.Quest.COMPLETED, "limmir-survived") end}, + {"I have found this tome, this looked important.", jump="quest", cond=function(npc, player) return npc.can_quest and player:hasQuest("master-jeweler") and player:hasQuest("master-jeweler"):has_tome(player) end}, + {"Sorry I have to go!"}, + } +} + +newChat{ id="jewelry", + text = [[Then you are at the right place, for I am an expert jeweler. +If you bring me a gem and a non-magical ring I can imbue the gem inside the ring for you. +There is a small fee dependant on the level of the ring and you need a quality ring to use a quality gem.]], + answers = { + {"I need your services.", action=imbue_ring}, + {"Not now thanks."}, + } +} + +newChat{ id="artifact_jewelry", + text = [[Yes! Thank to you this place is now free from the corruption. I will stay on this island to study the magical aura, and as promised I can make you better rings. +Bring me a non-magical ring and two gems and I will turn them into a powerful ring. +I will not make you pay a fee for it since you helped me so much, but I am afraid the ritual requires a gold plating, this should equal to about 390 gold pieces.]], + answers = { + {"I need your services.", action=artifact_imbue_ring}, + {"Not now thanks."}, + } +} + +newChat{ id="quest", + text = [[#LIGHT_GREEN#*He quickly looks at the tome and looks amazed.*#WHITE# This is an amazing find! Truly amazing! +With this knowledge I could create much more potent rings. However this requires a special place of power to craft such items. +There are rumours about a site of power in the southern mountains. Old legends tell about a place where a part of the moon melted when it got to close to the sun and fell from the sky. +A lake formed in the crater of the crash. The water of this lake, soaked in intense moonlight for eons, should be sufficient to forge powerful artifacts! +Go to the lake and then summon me with this scroll. I will retire to study the tome, awaiting your summon.]], + answers = { + {"I will see if I can find it.", action=function(npc, player) + game.level:removeEntity(npc) + player:hasQuest("master-jeweler"):remove_tome(player) + player:hasQuest("master-jeweler"):start_search(player) + end}, + } +} + +return "welcome" diff --git a/game/modules/tome/data/chats/limmir-valley-moon.lua b/game/modules/tome/data/chats/limmir-valley-moon.lua new file mode 100644 index 0000000000000000000000000000000000000000..55f47766432dd6f50d9271a58212139d432fe291 --- /dev/null +++ b/game/modules/tome/data/chats/limmir-valley-moon.lua @@ -0,0 +1,29 @@ +-- 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 + +newChat{ id="welcome", + text = [[I do not have time to talk, this ritual is intense, and we are not alone here. Stop them!]], + answers = { + {"I will not let you down!"}, + {"[leave]"}, + } +} + + +return "welcome" diff --git a/game/modules/tome/data/damage_types.lua b/game/modules/tome/data/damage_types.lua index c957051c50bf4078dd310a9ca7b6348ef1afacf8..c1109e54900d5fdee1672122a21a2d9a416ec703 100644 --- a/game/modules/tome/data/damage_types.lua +++ b/game/modules/tome/data/damage_types.lua @@ -638,6 +638,19 @@ newDamageType{ end, } +-- Holy light, damage demon/undead; heal ohers +newDamageType{ + name = "holy light", type = "HOLY_LIGHT", + projector = function(src, x, y, type, dam) + local target = game.level.map(x, y, Map.ACTOR) + if target and not target.undead and not target.demon then + target:heal(dam / 2) + elseif target then + DamageType:get(DamageType.LIGHT).projector(src, x, y, DamageType.LIGHT, dam) + end + end, +} + -- Heals newDamageType{ name = "healing", type = "HEAL", diff --git a/game/modules/tome/data/general/grids/water.lua b/game/modules/tome/data/general/grids/water.lua index 025327d297f670c766a9e3fae9bf5ce21aa163b8..ee6f187b09bab27e5875a5740da2859ead25ea90 100644 --- a/game/modules/tome/data/general/grids/water.lua +++ b/game/modules/tome/data/general/grids/water.lua @@ -91,3 +91,20 @@ newEntity{ always_remember = true, air_level = -5, air_condition="water", } + +newEntity{ + define_as = "POISON_SHALLOW_WATER", + name = "poisoned shallow water", image = "terrain/water_floor.png", + display = '~', color=colors.LIGHT_GREEN, back_color=colors.DARK_GREEN, + add_displays = class:makeWater(false, "poison_"), + always_remember = true, +} + +newEntity{ + define_as = "POISON_DEEP_WATER", + name = "poisoned deep water", image = "terrain/water_floor.png", + display = '~', color=colors.YELLOW_GREEN, back_color=colors.DARK_GREEN, + add_displays = class:makeWater(true, "poison_"), + always_remember = true, + air_level = -5, air_condition="water", +} diff --git a/game/modules/tome/data/general/npcs/aquatic_demon.lua b/game/modules/tome/data/general/npcs/aquatic_demon.lua index 5c224d2864540b89c5532c46f60c1e58324cc653..4908928e5ceb38bc9c6e1bcf284cd68b89052ff9 100644 --- a/game/modules/tome/data/general/npcs/aquatic_demon.lua +++ b/game/modules/tome/data/general/npcs/aquatic_demon.lua @@ -34,6 +34,7 @@ newEntity{ combat = { dam=resolvers.mbonus(46, 20), atk=15, apr=7, dammod={str=0.7} }, max_life = resolvers.rngavg(100,120), infravision = 20, + demon = 1, open_door = true, rank = 2, size_category = 3, diff --git a/game/modules/tome/data/general/npcs/minor-demon.lua b/game/modules/tome/data/general/npcs/minor-demon.lua new file mode 100644 index 0000000000000000000000000000000000000000..84b461ccdc1d99b5c4c558c0dfacd014ad666760 --- /dev/null +++ b/game/modules/tome/data/general/npcs/minor-demon.lua @@ -0,0 +1,86 @@ +-- 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 + +-- last updated: 10:46 AM 2/3/2010 + +local Talents = require("engine.interface.ActorTalents") + +newEntity{ + define_as = "BASE_NPC_DEMON", + type = "demon", subtype = "minor", + display = "u", color=colors.WHITE, + body = { INVEN = 10 }, + autolevel = "warrior", + ai = "dumb_talented_simple", ai_state = { talent_in=1, }, + stats = { str=12, dex=10, mag=3, con=13 }, + energy = { mod=1 }, + combat_armor = 1, combat_def = 1, + combat = { dam=resolvers.mbonus(46, 20), atk=15, apr=7, dammod={str=0.7} }, + max_life = resolvers.rngavg(100,120), + infravision = 20, + open_door = true, + rank = 2, + size_category = 3, + no_breath = 1, + demon = 1, +} + +newEntity{ base = "BASE_NPC_DEMON", + name = "fire imp", color=colors.CRIMSON, + desc = "A small demon, lobbing spells at you.", + level_range = {10, nil}, exp_worth = 1, + rarity = 3, + rank = 2, + size_category = 1, + autolevel = "caster", + combat_armor = 1, combat_def = 0, + combat = {damtype=DamageType.FIRE}, + + resists={[DamageType.FIRE] = resolvers.mbonus(12, 5)}, + + resolvers.talents{ + [Talents.T_FIRE_IMP_BOLT]=4, + [Talents.T_PHASE_DOOR]=2, + }, +} + +newEntity{ base = "BASE_NPC_DEMON", + name = "quasit", color=colors.LIGHT_GREY, + desc = "A small, heavily armoured demon, rushing toward you.", + level_range = {20, nil}, exp_worth = 1, + rarity = 1, + rank = 2, + size_category = 1, + autolevel = "caster", + combat_armor = 1, combat_def = 0, + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, + + resolvers.talents{ + [Talents.T_HEAVY_ARMOUR_TRAINING]=1, + [Talents.T_SHIELD_PUMMEL]=2, + [Talents.T_RIPOSTE]=3, + [Talents.T_OVERPOWER]=1, + [Talents.T_RUSH]=6, + }, + resolvers.equip{ + {type="weapon", subtype="longsword", autoreq=true}, + {type="armor", subtype="shield", autoreq=true}, + {type="armor", subtype="heavy", autoreq=true} + }, +} diff --git a/game/modules/tome/data/general/objects/quest-artifacts.lua b/game/modules/tome/data/general/objects/quest-artifacts.lua index 1442dd889955cffd8a1cbf16574ef45a2851f988..be288bc1a32200f22a64945ab49af4ff6cdaa550 100644 --- a/game/modules/tome/data/general/objects/quest-artifacts.lua +++ b/game/modules/tome/data/general/objects/quest-artifacts.lua @@ -190,3 +190,32 @@ newEntity{ define_as = "ORB_DESTRUCTION", inc_stats = { [Stats.STAT_STR] = 6, }, }, } + +---------------------------- Various quest starters + +newEntity{ base = "BASE_SCROLL", define_as = "JEWELER_TOME", subtype="tome", + unique = true, quest=true, + unided_name = "ancient tome", + name = "Ancient Tome titled 'Gems and their uses'", + color = colors.VIOLET, + fire_proof = true, + + on_pickup = function(self, who) + if who == game.player then + self:identify(true) + who:grantQuest("master-jeweler") + end + end, +} + +newEntity{ base = "BASE_SCROLL", define_as = "JEWELER_SUMMON", subtype="tome", + unique = true, quest=true, identified=true, + name = "Scroll of Summoning (Limmir the Jeweler)", + color = colors.VIOLET, + fire_proof = true, + + max_power = 1, power_regen = 1, + use_power = { name = "summon Limmir the jeweler at the center of the lake of the moon", power = 1, + use = function(self, who) who:hasQuest("master-jeweler"):summon_limmir(who) end + }, +} diff --git a/game/modules/tome/data/gfx/shaders/poison_water.lua b/game/modules/tome/data/gfx/shaders/poison_water.lua new file mode 100644 index 0000000000000000000000000000000000000000..2469188a6b174f90ec7515190923d8adabfe1bbc --- /dev/null +++ b/game/modules/tome/data/gfx/shaders/poison_water.lua @@ -0,0 +1,29 @@ +-- 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 { + frag = "water", + vert = nil, + args = { + noisevol = { texture = 1 }, + color1 = {0,1,0,1}, + color2 = {0,0.8,0.6,1}, + }, + clone = false, +} diff --git a/game/modules/tome/data/gfx/terrain/poison_water_floor.png b/game/modules/tome/data/gfx/terrain/poison_water_floor.png new file mode 100644 index 0000000000000000000000000000000000000000..e146018b0ba2320f31926f8b1f9759e4080d682b Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/poison_water_floor.png differ diff --git a/game/modules/tome/data/gfx/terrain/poison_water_floor_alpha.png b/game/modules/tome/data/gfx/terrain/poison_water_floor_alpha.png new file mode 100644 index 0000000000000000000000000000000000000000..ef20bc2173724e1fad69520de77e93da1df103f1 Binary files /dev/null and b/game/modules/tome/data/gfx/terrain/poison_water_floor_alpha.png differ diff --git a/game/modules/tome/data/maps/towns/angolwen.lua b/game/modules/tome/data/maps/towns/angolwen.lua index fa9a17cccd60f9e2eadbb9f33f4ff52a4b2a6430..f566ab352d026c017363ddff866c6327eeb30dca 100644 --- a/game/modules/tome/data/maps/towns/angolwen.lua +++ b/game/modules/tome/data/maps/towns/angolwen.lua @@ -23,7 +23,7 @@ quickEntity('T', {name='tree', display='#', color=colors.LIGHT_GREEN, block_move quickEntity('o', {name='fountain', display='~', color=colors.BLUE, block_move=true, image="terrain/river.png", add_displays = mod.class.Grid:makeWater(true)}) quickEntity(' ', {name='grass', display='.', color=colors.LIGHT_GREEN, image="terrain/grass.png"}) -quickEntity('2', {show_tooltip=true, name="Jewelry", display='2', color=colors.BLUE, resolvers.store("ANGOLWEN_JEWELRY"), image="terrain/wood_store_gem.png"}) +quickEntity('2', {show_tooltip=true, name="Jewelry", display='2', color=colors.BLUE, resolvers.store("ANGOLWEN_JEWELRY"), resolvers.chatfeature("jewelry-store"), image="terrain/wood_store_gem.png"}) quickEntity('4', {show_tooltip=true, name="Alchemist", display='4', color=colors.LIGHT_BLUE, resolvers.store("POTION"), image="terrain/wood_store_potion.png"}) quickEntity('5', {show_tooltip=true, name="Scribe", display='5', color=colors.WHITE, resolvers.store("SCROLL"), image="terrain/wood_store_book.png"}) quickEntity('6', {show_tooltip=true, name="Staves & Wands", display='6', color=colors.RED, resolvers.store("ANGOLWEN_STAFF_WAND"), resolvers.chatfeature("magic-store"), image="terrain/wood_store_closed.png"}) diff --git a/game/modules/tome/data/maps/towns/gates-of-morning.lua b/game/modules/tome/data/maps/towns/gates-of-morning.lua index 122d5c1f63e38843932c5306cb035c34ade0f6d7..b2fbaefae9d9199bda26d10d82c8e54dd4d2117a 100644 --- a/game/modules/tome/data/maps/towns/gates-of-morning.lua +++ b/game/modules/tome/data/maps/towns/gates-of-morning.lua @@ -34,6 +34,16 @@ quickEntity('-', {name='grass', display='.', color=colors.LIGHT_GREEN, image="te quickEntity('^', {name='hills', display='^', color=colors.SLATE, image="terrain/mountain.png", block_move=true, block_sight=true}, {no_teleport=true}) defineTile('@', "GRASS", nil, "HIGH_SUN_PALADIN_AERYN") +defineTile('j', "GRASS", nil, mod.class.NPC.new{ + type = "humanoid", subtype = "elf", + display = "p", color=colors.RED, + name = "Limmir, Expert Jeweler", + size_category = 3, rank = 3, + ai = "simple", + faction = "sunwall", + can_talk = "jewelry-store", + can_quest = true, +}) quickEntity('1', {show_tooltip=true, name="Closed store", display='1', color=colors.LIGHT_UMBER, block_move=true, block_sight=true, image="terrain/wood_store_closed.png"}, {no_teleport=true}) quickEntity('2', {show_tooltip=true, name="Armour Smith", display='2', color=colors.UMBER, resolvers.store("ARMOR"), image="terrain/wood_store_armor.png"}, {no_teleport=true}) @@ -96,7 +106,7 @@ MMM TTTT"""""""""""O""""""" MMMMM MMMM TT"""""~~~"""""""""""""""""""""" MMMMM MMMMMM TT"""""~~~~~""""""""""""""""""::""""MMMMMM MMMMMMMMM""""""~~~~~"""""""TT"""""""::P:::::MMMMMM -MMMMMMMMM"""""""~~~"""""TT"T""""""::::::::::MMMMMM +MMMMMMMMM"""j"""~~~"""""TT"T""""""::::::::::MMMMMM MMMMMMMMM"""""""~~""""""TTTT"""""::::::::P:::MMMMM MMMMMMMMM"""""TT~"""""""TT"""""":::::P:::::MMMMMMM MMMMMMMMM"""TTTT~""""""""""""""::::::::::::MMMMMMM diff --git a/game/modules/tome/data/maps/zones/valley-moon.lua b/game/modules/tome/data/maps/zones/valley-moon.lua new file mode 100644 index 0000000000000000000000000000000000000000..6b6e3486a1b83ef8b3a4c62cd4a2637453ae2c65 --- /dev/null +++ b/game/modules/tome/data/maps/zones/valley-moon.lua @@ -0,0 +1,86 @@ +-- 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 + +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"}) +defineTile('.', "GRASS") +defineTile('~', "POISON_DEEP_WATER") +defineTile('"', "GRASS", nil, nil, nil, {summon_limmir=true}) +defineTile('&', "PORTAL_DEMON") +defineTile('T', "TREE") +defineTile('#', "MOUNTAIN_WALL") +defineTile('M', "MOONSTONE") + +addSpot({4, 14}, "portal", "demon") +addSpot({7, 45}, "portal", "demon") +addSpot({47, 27}, "portal", "demon") + +startx = 45 +starty = 1 + +return [[ +################################################## +##################################...........>#### +####....T.........T........T....TTTTT....T.....### +####..........T...T.............T............T.### +####...................TT...............T......### +####...T.....TT........................TT......### +####.........T..............................TT.### +###.......................~~~~~.......T......T.### +##................T....~~~~~~~~~~~.............### +##.....TTT..........~~~~~~~~~~~~~~......TTTT.T.### +##T............~~~~~~~~~~~~~~~~~~~...........T.### +##T............~~~~~~~~~~~~~~~~~~~~.............## +###.........TT..~~~~~~~~~~~~~~~~~~~~~.........T.## +###....TT....TT.~~~~~~~~~~~~~~~~~~~~~....T....T.## +###.&..........TT~~~~~~~~~~~~~~~~~~~~...........## +###..............~~~~~~~~~~~~~~~~~~~~...........## +###......TTT....~~~~~~~~~~~~~~~~~~~~.....T......## +###......T...~~~~~~~~~~~~~~~~~~~~~~~.....TTT...### +#T#..........~~~~~~~~~~~~~~~~~~~~~~......TT....### +###........~~~~~~~~~~~~~~~~~~~~~~~~~......TT...### +###........~~~~~~~~~~~~~~~~~~~~~~~~~...........### +###........~~~~~~~~~~~"""~~~~~~~~~~~~~........T### +###..TT...~~~~~~~~~~~"""""""~~~~~~~~~~....T.T..### +###.TT...~~~~~~~~~~~~""""M"""~~~~~.~~.......TT#### +###......~~~~~~~~~~~~"""".""""~~~~............#### +###............~~~~~~"""""""""~~~~~....TT.....#### +###.TTT.......~~~~~~~"""""""""~~~~~~~.........#### +####..T......~~~~~~~~~~"""""""~~~~~~~..........&## +####.........~~~~~~~~~~~""""""~~~~~~~.TTTT..TT..## +#####.........~~~~~~~~~~"""~~~~~~~~~~......TT...## +#####..........~~~~~~~~~~~~~~~~~~~~~~~~~........## +#####.....T....~~~~~~~~~~~~~~~~~~~~~~~~~........## +####......T....~~~~~~~~~~~~~~~~~~~~~~~~.......T### +####T..........~~~~~~~~~~~~~~~~~~~~~~~........T### +###.............~~~~~~~~~~~~~~~~~~~~~.....T...#### +###...............~~~~~~~~~~~~~~~~~~~.........#### +##...................~~~~~~~~~~~~~~~.........T#### +##..T.....T...........~~~~~~~...........T..TT.#### +##....................~~~~~~..........TTT...T.#### +##...........T........................T........### +##.....T.....T................T................### +##....................................T.........## +##................T..........T........T....T....## +##...T................................TT......T..# +###.........T................TT...............T..# +###....&..............T.......T............T...### +####.........................................##### +#######.........T........T.............########### +#####################........##################### +##################################################]] diff --git a/game/modules/tome/data/quests/mage-apprentice.lua b/game/modules/tome/data/quests/mage-apprentice.lua index d5d38bad6e5b4398f44639453a7c054f96f910df..a65653da44b35fcff7021f003074ebe08fd3c9c5 100644 --- a/game/modules/tome/data/quests/mage-apprentice.lua +++ b/game/modules/tome/data/quests/mage-apprentice.lua @@ -46,7 +46,7 @@ collect_staff = function(self, who, dialog) function(o) return (o.type == "weapon" and o.subtype == "staff" and (not o.define_as or o.define_as ~= "STAFF_ANGMAR")) or (o.type == "jewelry" and o.subtype == "ring") or (o.type == "jewelry" and o.subtype == "amulet") end, function(o, inven, item) -- Special handling for the staff of absorption - if o.define_as ans o.define_as == "STAFF_ABSORPTION" then + if o.define_as and o.define_as == "STAFF_ABSORPTION" then game.logPlayer(who, "#LIGHT_RED#As the apprentice touches the staff he begins to consume, flames bursting out of his mouth, life seems to be drained away from him and in an instant he collapses in a lifeless husk.") who:setQuestStatus(self, self.FAILED) game:unregisterDialog(dialog) diff --git a/game/modules/tome/data/quests/master-jeweler.lua b/game/modules/tome/data/quests/master-jeweler.lua new file mode 100644 index 0000000000000000000000000000000000000000..b90a08d05c74525b428695649617b2b152a35a19 --- /dev/null +++ b/game/modules/tome/data/quests/master-jeweler.lua @@ -0,0 +1,123 @@ +-- 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 + +name = "Lost Knowledge" +desc = function(self, who) + local desc = {} + desc[#desc+1] = "You found an ancient tome about gems." + desc[#desc+1] = "You should bring it to the jeweler in the Gates of Morning." + if self:isCompleted("search-valley") then + desc[#desc+1] = "Limmir told you to look for the Valley of the Moon in the southern mountains." + end + return table.concat(desc, "\n") +end + +on_grant = function(self, who) + game.logPlayer(who, "#VIOLET#This tome seems to be about the power of gems, maybe you should bring it to the jeweler in the Gates of Morning.") +end + +has_tome = function(self, who) + for inven_id, inven in pairs(who.inven) do + for item, o in ipairs(inven) do + if o.type == "scroll" and o.subtype == "tome" and o.define_as == "JEWELER_TOME" then return o, inven_id, item end + end + end +end + +has_scroll = function(self, who) + for inven_id, inven in pairs(who.inven) do + for item, o in ipairs(inven) do + if o.type == "scroll" and o.subtype == "tome" and o.define_as == "JEWELER_SUMMON" then return o, inven_id, item end + end + end +end + +remove_tome = function(self, who) + local o, inven, item = self:has_tome(who) + who:removeObject(inven, item) +end + +start_search = function(self, who) + -- Reveal entrances + local g = mod.class.Grid.new{ + show_tooltip=true, + name="Cavern leading to the valley of the moon", + display='>', color=colors.GREY, + notice = true, + change_level=1, change_zone="valley-moon" + } + g:resolve() g:resolve(nil, true) + game.zone:addEntity(game.memory_levels["wilderness-arda-fareast-1"], g, "terrain", 48, 53) + + who:setQuestStatus(self.id, engine.Quest.COMPLETED, "search-valley") + game.logPlayer(game.player, "Limmir points the entrance to a cave on your map, this is supposed to be the way to the valley.") + + local o = game.zone:makeEntityByName(game.level, "object", "JEWELER_SUMMON") + who:addObject(who:getInven("INVEN"), o) +end + +summon_limmir = function(self, who) + if not game.level.map.attrs(who.x, who.y, "summon_limmir") then + game.logPlayer(who, "You must be near the moonstone to summon Limmir.") + return + end + + local o, inven, item = self:has_scroll(who) + if not o then game.logPlayer(who, "You do not have the summoning scroll!") return end + who:removeObject(inven, item) + + game.level.turn_counter = 300 * 10 + who.changed = true + + local limmir = game.zone:makeEntityByName(game.level, "actor", "LIMMIR") + game.zone:addEntity(game.level, limmir, "actor", 25, 24) + limmir:doEmote("This place is corrupted! I will cleanse it, protect me while I do it!", 120) +end + +ritual_end = function(self) + local limmir = nil + for i, e in pairs(game.level.entities) do + if e.define_as and e.define_as == "LIMMIR" then limmir = e break end + end + + if not limmir then + game.player:setQuestStatus(self.id, engine.Quest.COMPLETED, "limmir-dead") + game.player:setQuestStatus(self.id, engine.Quest.FAILED) + return + end + + game.player:setQuestStatus(self.id, engine.Quest.COMPLETED, "limmir-survived") + game.player:setQuestStatus(self.id, engine.Quest.COMPLETED) + + for i = #game.level.e_array, 1, -1 do + local e = game.level.e_array[i] + if not e.unique and e.type == "demon" then e:die() end + end + limmir.name = "Limmir the Master Jeweler" + limmir.can_talk = "jewelry-store" + + -- Update water + local water = game.zone:makeEntityByName(game.level, "terrain", "DEEP_WATER") + for x = 0, game.level.map.w - 1 do for y = 0, game.level.map.h - 1 do + local g = game.level.map(x, y, engine.Map.TERRAIN) + if g and g.define_as == "POISON_DEEP_WATER" then + game.level.map(x, y, engine.Map.TERRAIN, water) + end + end end +end diff --git a/game/modules/tome/data/zones/valley-moon/grids.lua b/game/modules/tome/data/zones/valley-moon/grids.lua new file mode 100644 index 0000000000000000000000000000000000000000..f88b7292b99bc4426d2ca91961821d7af984b76e --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon/grids.lua @@ -0,0 +1,43 @@ +-- 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") +load("/data/general/grids/forest.lua") +load("/data/general/grids/water.lua") +load("/data/general/grids/mountain.lua") + +newEntity{ + define_as = "MOONSTONE", + name = "moonstone", + image = "terrain/moonstone.png", + display = '&', color=colors.GREY, back_color={r=44,g=95,b=43}, + always_remember = true, + does_block_move = true, + block_sight = true, +} + +newEntity{ + define_as = "PORTAL_DEMON", + name = "Infernal Portal", + display = '&', color=colors.RED, back_color=colors.PURPLE, + notice = true, + always_remember = true, + show_tooltip = true, + desc = [[An invocation portal, perpetualy summoning beings through it.]], +} diff --git a/game/modules/tome/data/zones/valley-moon/npcs.lua b/game/modules/tome/data/zones/valley-moon/npcs.lua new file mode 100644 index 0000000000000000000000000000000000000000..a72bfb0c255b511c9c61ebe3533b2dd4447b4389 --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon/npcs.lua @@ -0,0 +1,89 @@ +-- 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)) + +local Talents = require("engine.interface.ActorTalents") + +-- The boss of Amon Sul, no "rarity" field means it will not be randomly generated +newEntity{ define_as = "CORRUPTED_BALROG", + type = "demon", subtype = "major", unique = true, + name = "Corrupted Balrog", + display = "U", color=colors.VIOLET, + desc = [[Shadow and flames. The huge beast of fire moves speedily toward you, its huge shadowy wings deployed.]], + level_range = {40, 55}, exp_worth = 2, + max_life = 250, life_rating = 25, fixed_rating = true, + rank = 4, + size_category = 5, + infravision = 20, + stats = { str=16, dex=12, cun=14, mag=25, con=16 }, + instakill_immune = 1, + no_breath = 1, + move_others=true, + + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, + resolvers.equip{ + {type="weapon", subtype="staff", autoreq=true}, + {type="armor", subtype="light", 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, + }, + + autolevel = "warriormage", + ai = "dumb_talented_simple", ai_state = { talent_in=1, ai_move="move_astar" }, + + on_die = function(self, who) + end, +} + +newEntity{ define_as = "LIMMIR", + type = "humanoid", subtype = "elf", + display = "p", + faction = "sunwall", + name = "Limmir the Jeweler", color=colors.RED, unique = true, + desc = [[An elf anorithil, specialized in the art of jewelry.]], + level_range = {50, 50}, exp_worth = 2, + rank = 3, + size_category = 3, + max_life = 150, life_rating = 17, fixed_rating = true, + infravision = 20, + stats = { str=15, dex=10, cun=12, mag=16, con=14 }, + move_others=true, + knockback_immune = 1, + + open_door = true, + + autolevel = "caster", + ai = "none", ai_state = { }, + + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, + + resolvers.talents{ + [Talents.T_CHANT_OF_LIGHT]=5, + [Talents.T_HYMN_OF_SHADOWS]=5, + }, + resolvers.sustains_at_birth(), + + can_talk = "limmir-valley-moon", + can_craft = true, +} diff --git a/game/modules/tome/data/zones/valley-moon/objects.lua b/game/modules/tome/data/zones/valley-moon/objects.lua new file mode 100644 index 0000000000000000000000000000000000000000..fa9642c33dee08637bc5da672fc56bd70a5e87e0 --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon/objects.lua @@ -0,0 +1,47 @@ +-- 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") + +-- 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, + combat = { + dam = 10, + apr = 0, + physcrit = 1.5, + dammod = {mag=1.1}, + }, + wielder = { + see_invisible = 2, + combat_spellpower = 7, + combat_spellcrit = 8, + inc_damage={ + [DamageType.FIRE] = 4, + [DamageType.COLD] = 4, + [DamageType.ACID] = 4, + [DamageType.LIGHTNING] = 4, + [DamageType.BLIGHT] = 4, + }, + }, +} diff --git a/game/modules/tome/data/zones/valley-moon/traps.lua b/game/modules/tome/data/zones/valley-moon/traps.lua new file mode 100644 index 0000000000000000000000000000000000000000..3cd3173e45699446c9ad0526d8ce04b7690a2b32 --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon/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/elemental.lua") diff --git a/game/modules/tome/data/zones/valley-moon/zone.lua b/game/modules/tome/data/zones/valley-moon/zone.lua new file mode 100644 index 0000000000000000000000000000000000000000..27d9433e445233042df2db66e6812b981a7fb51a --- /dev/null +++ b/game/modules/tome/data/zones/valley-moon/zone.lua @@ -0,0 +1,54 @@ +-- 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 = "Ithilthum, Valley of the Moon", + level_range = {35, 45}, + level_scheme = "player", + max_level = 1, + actor_adjust_level = function(zone, level, e) return zone.base_level + e:getRankLevelAdjust() + level.level-1 + rng.range(-1,2) end, + width = 50, height = 50, +-- all_remembered = true, + all_lited = true, + persistant = "zone", + ambiant_music = "The Ancients.ogg", + no_connectivity_check = true, + generator = { + map = { + class = "engine.generator.map.Static", + map = "zones/valley-moon", + }, + actor = { + class = "engine.generator.actor.Random", + nb_npc = {0, 0}, + rate = 0.15, + }, + }, + + on_turn = function(self) + if not game.level.turn_counter then return end + require("mod.class.generator.actor.ValleyMoon").new(self, game.level.map, game.level, {}):tick() + game.level.turn_counter = game.level.turn_counter - 1 + game.player.changed = true + if game.level.turn_counter < 0 then + game.level.turn_counter = nil + game.player:hasQuest("master-jeweler"):ritual_end() + end + end, +}