diff --git a/game/engine/Map.lua b/game/engine/Map.lua index f470e1bc65546169d702edd8dfed7605044511f4..f28e3713418c99a668ab0291f0bbc56bf6856d78 100644 --- a/game/engine/Map.lua +++ b/game/engine/Map.lua @@ -110,6 +110,7 @@ function _M:loaded() if v ~= nil then t[x + y * self.w] = v self._map:setSeen(x, y, v) + self.changed = true end return t[x + y * self.w] end @@ -118,6 +119,7 @@ function _M:loaded() if v ~= nil then t[x + y * self.w] = v self._map:setRemember(x, y, v) + self.changed = true end return t[x + y * self.w] end @@ -126,6 +128,7 @@ function _M:loaded() if v ~= nil then t[x + y * self.w] = v self._map:setLite(x, y, v) + self.changed = true end return t[x + y * self.w] end diff --git a/game/engine/dialogs/Chat.lua b/game/engine/dialogs/Chat.lua index 465160e221ea90af0e5da4e7a2272185bc6a1a67..902c99b88d266422290cfbe7969cb0b7af16b6ce 100644 --- a/game/engine/dialogs/Chat.lua +++ b/game/engine/dialogs/Chat.lua @@ -45,6 +45,14 @@ function _M:use() self.changed = true print("[CHAT] selected", a[1], a.action, a.jump) + if a.jump then + self.cur_id = a.jump + self:generateList() + self.sel = 1 + self.scroll = 1 + else + game:unregisterDialog(self) + end if a.action then local id = a.action(self.npc, self.player) if id then @@ -55,14 +63,6 @@ function _M:use() return end end - if a.jump then - self.cur_id = a.jump - self:generateList() - self.sel = 1 - self.scroll = 1 - else - game:unregisterDialog(self) - end end function _M:generateList() diff --git a/game/modules/tome/class/Store.lua b/game/modules/tome/class/Store.lua index b5e1a6c8e1561495f96106a500bd0c07c38e63af..1b878df035942d0dced4410acc6a569596184b8f 100644 --- a/game/modules/tome/class/Store.lua +++ b/game/modules/tome/class/Store.lua @@ -40,6 +40,7 @@ function _M:onSell(who, o, item, nb) local price = o:getPrice() / 10 if price <= 0 then return end who.money = who.money + price * nb + o:identify(true) return nb end diff --git a/game/modules/tome/data/autolevel_schemes.lua b/game/modules/tome/data/autolevel_schemes.lua index e3b7ae6a7d704ab09b70b6e5bb559ea7b534c978..6893679d7aad858e82abdb5d64341d956288c19d 100644 --- a/game/modules/tome/data/autolevel_schemes.lua +++ b/game/modules/tome/data/autolevel_schemes.lua @@ -48,3 +48,11 @@ Autolevel:registerScheme{ name = "warriormage", levelup = function(self) learnStats(self, { self.STAT_STR, self.STAT_STR, self.STAT_DEX }) end end} + +Autolevel:registerScheme{ name = "snake", levelup = function(self) + if self.level % 2 == 0 then + learnStats(self, { self.STAT_CUN, self.STAT_DEX, self.STAT_CON }) + else + learnStats(self, { self.STAT_CUN, self.STAT_DEX, self.STAT_STR }) + end +end} diff --git a/game/modules/tome/data/chats/minas-tirith-elder.lua b/game/modules/tome/data/chats/minas-tirith-elder.lua index e409e588d5bd7e4e5cc70822f1a9271222dcd17e..807ebc8e2f53ca77a3f303e640934477e5b63c81 100644 --- a/game/modules/tome/data/chats/minas-tirith-elder.lua +++ b/game/modules/tome/data/chats/minas-tirith-elder.lua @@ -1,8 +1,8 @@ newChat{ id="welcome", text = [[Welcome @playername@ to Minas Tirith traveler, please be quick my time is precious.]], answers = { - {"Nothing, excuse me. Bye!"}, {"I have found this staff in my travels, it looks really old and powerful. I dare not use it.", jump="found_staff", cond=function(npc, player) return player:isQuestStatus("staff-absorption", engine.Quest.PENDING) and player:findInAllInventories("Staff of Absorption") end}, + {"Nothing, excuse me. Bye!"}, } } diff --git a/game/modules/tome/data/chats/minas-tirith-weapon-store.lua b/game/modules/tome/data/chats/minas-tirith-weapon-store.lua new file mode 100644 index 0000000000000000000000000000000000000000..73595eb037701d6aec9aa6f21e38bd307ab8499e --- /dev/null +++ b/game/modules/tome/data/chats/minas-tirith-weapon-store.lua @@ -0,0 +1,30 @@ +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}, + {"I am looking for martial training.", jump="training"}, + {"Sorry I have to go!"}, + } +} + +newChat{ id="training", + text = [[I can indeed give some martial training (talent type Technique/Combat-training) for a fee of 50 gold pieces if you do not already know it.]], + answers = { + {"Please train me!", action=function(npc, player) + game.logPlayer(player, "The smith spends some time with you, teaching you the basics of armour and weapons usage.") + player.money = player.money - 50 + player:learnTalentType("technique/combat-training", true) + player.changed = true + end, cond=function(npc, player) + if player.money < 50 then return end + if player:knowTalentType("technique/combat-training") then return end + return true + end}, + {"No thanks."}, + } +} + +return "welcome" diff --git a/game/modules/tome/data/maps/towns/minas-tirith.lua b/game/modules/tome/data/maps/towns/minas-tirith.lua index ced381a08c1338730308250ee9e2e5cf6f96037a..8b3142b6685c363114e7d2c2a57b7a80cb9355e6 100644 --- a/game/modules/tome/data/maps/towns/minas-tirith.lua +++ b/game/modules/tome/data/maps/towns/minas-tirith.lua @@ -13,7 +13,7 @@ quickEntity('^', {name='hills', display='^', color=colors.SLATE, image="terrain/ 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"}) quickEntity('2', {show_tooltip=true, name="Armour Smith", display='2', color=colors.UMBER, resolvers.store("ARMOR"), image="terrain/wood_store_armor.png"}) -quickEntity('3', {show_tooltip=true, name="Weapon Smith", display='3', color=colors.UMBER, resolvers.store("WEAPON"), image="terrain/wood_store_weapon.png"}) +quickEntity('3', {show_tooltip=true, name="Weapon Smith", display='3', color=colors.UMBER, resolvers.store("WEAPON"), resolvers.chatfeature("minas-tirith-weapon-store"), image="terrain/wood_store_weapon.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="Closed store", display='6', color=colors.LIGHT_UMBER, block_move=true, block_sight=true, image="terrain/wood_store_closed.png"}) diff --git a/game/modules/tome/data/maps/wilderness/main.lua b/game/modules/tome/data/maps/wilderness/main.lua index 87e4b219b4f64030c244608b39d044b7860bfee3..f0ef595a676b4154b1ed394fe7802c4f2b62a3fc 100644 --- a/game/modules/tome/data/maps/wilderness/main.lua +++ b/game/modules/tome/data/maps/wilderness/main.lua @@ -50,7 +50,7 @@ return { [[====.._...bbbb...._....hhhh__..........A..._.....mm..~.uuuuuu____........._........................]], [[=====.._..uubb..._........._......h......._Btt...mm..~6uuuuu&&&u._........._.......................]], [[====...__..ubbb._......hh.._.......hh...._.t^^^._mm..~..uuu&f&&&u._........._......................]], -[[=====..._.....__......hho.-_.2....1hh......._L...mm..~..uuuuuuuuu._........_.......................]], +[[=====..._.....__......hho.-_......1hh......._L...mm..~..uuuuuuuuu._........_.......................]], [[======..==..=__....h....h..._.hh..ih....._..^^^._m...~..uuuuuuuuuu._........_......................]], [[=============.....hhh......._.vvD.h......_.._.._mmm...~..uuuuuuuuu.._........_....................t]], [[======........bb...h........._vvv.hh...._.._...mm.....~..uuuuuuuu...._......_....................tt]], diff --git a/game/modules/tome/data/rooms/forest_clearing.lua b/game/modules/tome/data/rooms/forest_clearing.lua index 6fc90621842651121d0bbc09c279258ac663224e..2d72044dd2ff53c67aa616c21334d6142fcd3d3f 100644 --- a/game/modules/tome/data/rooms/forest_clearing.lua +++ b/game/modules/tome/data/rooms/forest_clearing.lua @@ -11,7 +11,7 @@ return function(gen, id) for i = 1, self.w do for j = 1, self.h do if hm.hmap[i][j] >= Heightmap.max * 5 / 6 then - gen.map.room_map[i-1+x][j-1+y].can_open = true +-- gen.map.room_map[i-1+x][j-1+y].can_open = true gen.map(i-1+x, j-1+y, Map.TERRAIN, gen.grid_list[gen:resolve('#')]) else gen.map.room_map[i-1+x][j-1+y].room = id diff --git a/game/modules/tome/data/texts/intro-elf.lua b/game/modules/tome/data/texts/intro-elf.lua index 8a00fa7e24a82193356fcbf3d89195e08737f953..6d6de06ab829fd3c941ea5f023e39cb5a5b65dff 100644 --- a/game/modules/tome/data/texts/intro-elf.lua +++ b/game/modules/tome/data/texts/intro-elf.lua @@ -1,12 +1,12 @@ return [[Welcome #LIGHT_GREEN#]]..name..[[#WHITE#. -You are an elf, the first-born. Many of your kind having gone weary of Middle-earth and left for the immortal lands. -Yet some elves do no wish to leave this land they fought so hard for. In the Mirkwood forest, now called Eryn Lasgalen, the kingdom of Thranduil still thrives. -You lived a peaceful life deep in the forest for many hundred years but lately you have grown restless and decided to step into the world. +You are an elf, one of the first born. Many of your kind, having grown weary of Middle Earth, have left for the immortal lands. +Yet some elves do not wish to leave this land they fought so hard for. In Mirkwood Forest, now called Eryn Lasgalen, the kingdom of Thranduil still thrives. +You lived a peaceful life deep in the forest for many years but lately you have grown restless and have decided to step into the world. -You have decided to venture into the old and wild places of the world, looking for treasures of old and glory. +You have decided to venture into the old and wild places looking for ancient treasures and glory. -You have come to a land called Rhudaur, on the western steppes of the Misty Mountains, far away from your home, in search of the ruined tower of Amon Sûl. You heard the caves below were infested by vermin and undeads. -Nearby to the east also lies the Trollshaws and other dangerous place, an old forest infested with trolls and all kinds of wild animals. +You have come to a land called Rhudaur on the western side of the Misty Mountains, far away from your home in search of the ruined tower of Amon Sul. You have heard that the caverns below are infested with vermin and undead. +Close by, to the east are the Trollshaws another dangerous place - an old forest infested with trolls and other dangerous animals. -After days of travels you have found the ruined tower and entered the caves, what will you find there... +After days of travel you have found the tower and are about to enter the caves. What will you discover... ]] diff --git a/game/modules/tome/data/zones/maze/npcs.lua b/game/modules/tome/data/zones/maze/npcs.lua index 36d6da048f835554be58d9280a561dacd92db831..91343f66d7b4212e201ebfa6d04a49672acfb0f2 100644 --- a/game/modules/tome/data/zones/maze/npcs.lua +++ b/game/modules/tome/data/zones/maze/npcs.lua @@ -21,7 +21,7 @@ newEntity{ define_as = "MINOTAUR_MAZE", max_stamina = 200, stats = { str=25, dex=10, cun=8, mag=20, wil=20, con=20 }, - body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1 }, + body = { INVEN = 10, MAINHAND=1, OFFHAND=1, BODY=1, HEAD=1, }, equipment = resolvers.equip{ {type="weapon", subtype="battleaxe"}, {type="armor", subtype="head", defined="HELM_OF_HAMMERHAND"},