From f97320f1328604ec3b31bf9ccd2f59d743e5ed0f Mon Sep 17 00:00:00 2001 From: WibbenZ Date: Tue, 7 Mar 2017 20:22:51 +0100 Subject: [PATCH 1/2] Fix The Hidden City of Beregar Plenty of fixes were needed, most of them should be fixed now. --- data/actions/actions.xml | 3 +- data/actions/lib/actions.lua | 2 +- data/actions/scripts/other/firebug.lua | 25 +++++++---- .../the hidden city of beregar/coalLevers.lua | 10 +++-- .../the hidden city of beregar/coalWagon.lua | 36 ++++++++++------ .../the hidden city of beregar/gapWagon.lua | 33 +++++++-------- .../the hidden city of beregar/ladder.lua | 5 +++ .../the hidden city of beregar/oreWagon.lua | 12 +++--- .../tunnelWagon.lua | 33 ++++++++------- .../wagonMazeExit.lua | 28 +++++++------ .../wagonMazeLevers.lua | 42 +++++++++---------- data/movements/movements.xml | 1 + .../the hidden city of beregar/bellow.lua | 12 +++--- .../bridgeTeleport.lua | 10 +++++ data/npc/scripts/Emperor Rehal.lua | 36 ++++++++-------- 15 files changed, 165 insertions(+), 123 deletions(-) create mode 100644 data/actions/scripts/quests/the hidden city of beregar/ladder.lua create mode 100644 data/movements/scripts/quests/the hidden city of beregar/bridgeTeleport.lua diff --git a/data/actions/actions.xml b/data/actions/actions.xml index 236d9df..d7e8c80 100644 --- a/data/actions/actions.xml +++ b/data/actions/actions.xml @@ -313,7 +313,7 @@ - + @@ -321,6 +321,7 @@ + diff --git a/data/actions/lib/actions.lua b/data/actions/lib/actions.lua index 3dcf629..5179488 100644 --- a/data/actions/lib/actions.lua +++ b/data/actions/lib/actions.lua @@ -219,7 +219,7 @@ function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey) player:addItem(21250, 1) player:setStorageValue(Storage.GravediggerOfDrefia.Mission68, 1) - -- ??? + -- The Hidden City of Beregar Quest elseif targetActionId == 50118 then local wagonItem = Tile(Position(32717, 31492, 11)):getItemById(7131) if wagonItem then diff --git a/data/actions/scripts/other/firebug.lua b/data/actions/scripts/other/firebug.lua index d0de263..328ebb0 100644 --- a/data/actions/scripts/other/firebug.lua +++ b/data/actions/scripts/other/firebug.lua @@ -1,5 +1,5 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) - --Dreamer Challenge Quest + -- Dreamer Challenge Quest if target.uid == 2243 then target:transform(1387) toPosition:sendMagicEffect(CONST_ME_FIREAREA) @@ -7,21 +7,27 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) return true end + -- The Hidden City of Beregar + if target.itemid == 8642 and target.actionid == 50119 then + target:transform(8641) + return true + end + local random = math.random(10) - if random >= 4 then --success 6% chance - if target.itemid == 7538 then --Destroy spider webs/North - South + if random >= 4 then -- success 6% chance + if target.itemid == 7538 then -- Destroy spider webs/North - South toPosition:sendMagicEffect(CONST_ME_HITBYFIRE) target:transform(7544) target:decay() - elseif target.itemid == 7539 then --Destroy spider webs/EAST- West + elseif target.itemid == 7539 then -- Destroy spider webs/EAST- West toPosition:sendMagicEffect(CONST_ME_HITBYFIRE) target:transform(7545) target:decay() - elseif target.itemid == 5466 then --Burn Sugar Cane + elseif target.itemid == 5466 then -- Burn Sugar Cane toPosition:sendMagicEffect(CONST_ME_FIREAREA) target:transform(5465) target:decay() - elseif target.itemid == 1485 then --Light Up empty coal basins + elseif target.itemid == 1485 then -- Light Up empty coal basins toPosition:sendMagicEffect(CONST_ME_HITBYFIRE) target:transform(1484) elseif target.actionid == 12550 or target.actionid == 12551 then -- Secret Service Quest @@ -30,15 +36,16 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) player:setStorageValue(Storage.secretService.TBIMission01, 2) end end - elseif random == 2 then --it remove the fire bug 2% chance + elseif random == 2 then -- it remove the fire bug 2% chance item:remove(1) toPosition:sendMagicEffect(CONST_ME_POFF) - elseif random == 1 then --it explode on the user 1% chance + elseif random == 1 then -- it explode on the user 1% chance doTargetCombatHealth(0, player, COMBAT_FIREDAMAGE, -5, -5, CONST_ME_HITBYFIRE) player:say('OUCH!', TALKTYPE_MONSTER_SAY) item:remove(1) else - toPosition:sendMagicEffect(CONST_ME_POFF) --it fails, but dont get removed 3% chance + toPosition:sendMagicEffect(CONST_ME_POFF) -- it fails, but dont get removed 3% chance end + return true end diff --git a/data/actions/scripts/quests/the hidden city of beregar/coalLevers.lua b/data/actions/scripts/quests/the hidden city of beregar/coalLevers.lua index 1b8db78..8a4ff1c 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/coalLevers.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/coalLevers.lua @@ -11,14 +11,18 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) return true end - local crucible = Tile(Position(32699, 31494, 11)):getItemById(8641) - if crucible.actionid == 50121 then + local machine = Tile(Position(32699, 31494, 11)):getItemById(8641) + if not machine then + return false + end + + if machine.actionid == 50121 then local wagon = Game.createItem(7132, 1, useItem.wagonPos) if wagon then wagon:setActionId(useItem.actionId) end - crucible:transform(8642) + machine:transform(8642) end item:transform(item.itemid == 10044 and 10045 or 10044) diff --git a/data/actions/scripts/quests/the hidden city of beregar/coalWagon.lua b/data/actions/scripts/quests/the hidden city of beregar/coalWagon.lua index 090bbb9..3e1c880 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/coalWagon.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/coalWagon.lua @@ -1,18 +1,30 @@ -local config = { - {wagon = 7131, stopPos = Position(32717, 31492, 11)}, - {wagon = 8749, stopPos = Position(32699, 31492, 11)} +local wagons = { + [7131] = Position(32717, 31492, 11), + [8749] = Position(32699, 31492, 11) } function onUse(player, item, fromPosition, target, toPosition, isHotkey) - for i = 1, #config do - local table = config[i] - local wagonPos = table.wagon:getPosition() - if table.wagon == 7131 and wagonPos ~= table.stopPos then - Tile(wagonPos):getTopTopItem():moveTo(wagonPos, x + 2) - elseif table.wagon == 8749 and wagonPos ~= table.stopPos then - Tile(wagonPos):getTopTopItem():moveTo(wagonPos, x - 2) - end - player:say("SQUEEEEAK", TALKTYPE_MONSTER_SAY, false, 0, wagonPos) + local lastPosition = wagons[item.itemid] + if not lastPosition then + return false end + + local wagonPosition = item:getPosition() + if wagonPosition == lastPosition then + return false + end + + local tile = Tile(wagonPosition) + if item.itemid == 7131 then + wagonPosition.x = wagonPosition.x + 2 + tile:getTopTopItem():moveTo(wagonPosition) + elseif item.itemid == 8749 and item.actionid == 50117 then + wagonPosition.x = wagonPosition.x - 2 + tile:getItemById(7131):moveTo(wagonPosition) + tile:getItemById(8749):moveTo(wagonPosition) + end + + player:say("SQUEEEEAK", TALKTYPE_MONSTER_SAY, false, 0, wagonPosition) + return true end diff --git a/data/actions/scripts/quests/the hidden city of beregar/gapWagon.lua b/data/actions/scripts/quests/the hidden city of beregar/gapWagon.lua index 55d8d40..c6bf858 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/gapWagon.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/gapWagon.lua @@ -1,27 +1,24 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) local tile = Tile(Position(32571, 31508, 9)) - if not tile:getItemById(7122) then - player:teleportTo(Position(32580, 31487, 9)) + if tile and tile:getItemById(7122) and player:getStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue) == 1 then + player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 2) + player:teleportTo(Position(32578, 31507, 9)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You need to build a bridge to pass the gap.", TALKTYPE_MONSTER_SAY) - return true - end - - if player:getStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue) ~= 1 then - return false - end + player:say("You safely passed the gap but your bridge collapsed behind you.", TALKTYPE_MONSTER_SAY, false, 0, player:getPosition()) - player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 2) - player:teleportTo(Position(32578, 31507, 9)) - player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You safely passed the gap but your bridge collapsed behind you.", TALKTYPE_MONSTER_SAY) + local thing = tile:getItemById(7122) + if thing then + thing:remove() + end - local items = tile:getItems() - for i = 1, tile:getItemCount() do - local tmpItem = items[i] - if isInArray({7122, 5770}, tmpItem:getId()) then - tmpItem:remove() + local secondThing = tile:getItemById(5779) + if secondThing then + secondThing:remove() end + else + player:teleportTo(Position(32580, 31487, 9)) + player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + player:say("You need to build a bridge to pass the gap.", TALKTYPE_MONSTER_SAY, false, 0, player:getPosition()) end return true diff --git a/data/actions/scripts/quests/the hidden city of beregar/ladder.lua b/data/actions/scripts/quests/the hidden city of beregar/ladder.lua new file mode 100644 index 0000000..bef9b4d --- /dev/null +++ b/data/actions/scripts/quests/the hidden city of beregar/ladder.lua @@ -0,0 +1,5 @@ +function onUse(player, item, fromPosition, target, toPosition, isHotkey) + player:teleportTo(Position(32680, 31508, 10)) + + return true +end diff --git a/data/actions/scripts/quests/the hidden city of beregar/oreWagon.lua b/data/actions/scripts/quests/the hidden city of beregar/oreWagon.lua index e08ae29..a82f8d8 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/oreWagon.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/oreWagon.lua @@ -9,7 +9,8 @@ local config = { [50105] = Position(32687, 31470, 13), [50106] = Position(32687, 31470, 13), [50107] = Position(32580, 31487, 9), - [50108] = Position(32687, 31470, 13) + [50108] = Position(32687, 31470, 13), + [50109] = Position(32617, 31514, 9) } function onUse(player, item, fromPosition, target, toPosition, isHotkey) @@ -18,12 +19,13 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) return true end - if player:getStorageValue(Storage.hiddenCityOfBeregar.OreWagon) == 1 then player:teleportTo(targetPosition) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - else - player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't know how to use this yet.") + return true end - return true + + player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You don't know how to use this yet.") + + return false end diff --git a/data/actions/scripts/quests/the hidden city of beregar/tunnelWagon.lua b/data/actions/scripts/quests/the hidden city of beregar/tunnelWagon.lua index 316bd01..106a664 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/tunnelWagon.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/tunnelWagon.lua @@ -1,30 +1,31 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) - local rubblePosition = Position(32619, 31514, 9) - if Tile(rubblePosition):getItemById(5709) then + if Tile(Position(32619, 31514, 9)):getItemById(5709) then player:teleportTo(Position(32580, 31487, 9)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You need to build a bridge to pass the gap.", TALKTYPE_MONSTER_SAY) - return true - end - - if player:getStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue) ~= 2 then + player:say("You need to build a bridge to pass the gap.", TALKTYPE_MONSTER_SAY, false, 0, player:getPosition()) return false end - + player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 3) player:teleportTo(Position(32625, 31514, 9)) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) - player:say("You safely passed the tunnel.", TALKTYPE_MONSTER_SAY) - Game.createItem(5709, 1, rubblePosition) + player:say("You safely passed the tunnel.", TALKTYPE_MONSTER_SAY, false, 0, player:getPosition()) + Game.createItem(5709, 1, Position(32619, 31514, 9)) - local wallItem = Tile(Position(32617, 31513, 9)):getItemById(1027) - if wallItem then - wallItem:remove() + local tile = Tile(Position(32617, 31513, 9)) + if tile then + local thing = tile:getItemById(1027) + if thing then + thing:remove() + end end - local archwayItem = Tile(Position(32617, 31514, 9)):getItemById(1205) - if archwayItem then - archwayItem:remove() + local secondTile = Tile(Position(32617, 31513, 9)) + if secondTile then + local thing = tile:getItemById(1205) + if thing then + thing:remove() + end end return true diff --git a/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua b/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua index 6fcce74..15322e1 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua @@ -1,19 +1,21 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) -local destinations = { - {teleportPos = Position(32692, 31501, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7122)}, --Coal Room - {teleportPos = Position(32549, 31407, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7123)}, --Infested Tavern - {teleportPos = Position(32579, 31487, 9), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7124)}, --Beregar - {teleportPos = Position(32701, 31448, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7121) and Tile(Position(32687, 31452, 13)):getItemById(7125) and Tile(Position(32692, 31453, 13)):getItemById(7126)}, --NPC Tehlim - {teleportPos = Position(32721, 31487, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7121) and Tile(Position(32692, 31459, 13)):getItemById(7123) and Tile(Position(32696, 31453, 13)):getItemById(7123)}, --Troll tribe's hideout - {teleportPos = Position(32600, 31504, 13), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7123) and Tile(Position(32695, 31464, 13)):getItemById(7123)} --City's Entrance -} + local destinations = { + {teleportPos = Position(32692, 31501, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7122)}, --Coal Room + {teleportPos = Position(32549, 31407, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7123)}, --Infested Tavern + {teleportPos = Position(32579, 31487, 9), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7124)}, --Beregar + {teleportPos = Position(32701, 31448, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7121) and Tile(Position(32687, 31452, 13)):getItemById(7125) and Tile(Position(32692, 31453, 13)):getItemById(7126)}, --NPC Tehlim + {teleportPos = Position(32721, 31487, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7121) and Tile(Position(32692, 31459, 13)):getItemById(7123) and Tile(Position(32696, 31453, 13)):getItemById(7123)}, --Troll tribe's hideout + {teleportPos = Position(32600, 31504, 13), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7123) and Tile(Position(32695, 31464, 13)):getItemById(7123)} --City's Entrance + } - for i = 1, #config do - local table = config[i] - if table.railCheck then - player:teleportTo(table.teleportPos) + for i = 1, #destinations do + local destination = destinations[i] + if destination.railCheck then + player:teleportTo(destination.teleportPos) player:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + return true end end - return true + + return false end diff --git a/data/actions/scripts/quests/the hidden city of beregar/wagonMazeLevers.lua b/data/actions/scripts/quests/the hidden city of beregar/wagonMazeLevers.lua index 5323c94..cb719f7 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/wagonMazeLevers.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/wagonMazeLevers.lua @@ -1,30 +1,30 @@ local levers = { - {uniqueId = 50113, railPos = Position(32696, 31453, 13)}, - {uniqueId = 50114, railPos = Position(32692, 31453, 13)}, - {uniqueId = 50115, railPos = Position(32687, 31452, 13)}, - {uniqueId = 50116, railPos = Position(32682, 31455, 13)}, - {uniqueId = 50117, railPos = Position(32688, 31456, 13)}, - {uniqueId = 50118, railPos = Position(32692, 31459, 13)}, - {uniqueId = 50119, railPos = Position(32696, 31461, 13)}, - {uniqueId = 50120, railPos = Position(32695, 31464, 13)}, - {uniqueId = 50121, railPos = Position(32690, 31465, 13)}, - {uniqueId = 50122, railPos = Position(32684, 31464, 13)}, - {uniqueId = 50123, railPos = Position(32688, 31469, 13)} + [50113] = Position(32696, 31453, 13), + [50114] = Position(32692, 31453, 13), + [50115] = Position(32687, 31452, 13), + [50116] = Position(32682, 31455, 13), + [50117] = Position(32688, 31456, 13), + [50118] = Position(32692, 31459, 13), + [50119] = Position(32696, 31461, 13), + [50120] = Position(32695, 31464, 13), + [50121] = Position(32690, 31465, 13), + [50122] = Position(32684, 31464, 13), + [50123] = Position(32688, 31469, 13) } function onUse(player, item, fromPosition, target, toPosition, isHotkey) - - for i = 1, #config do - local table = config[i] - if item.uid == table.uniqueId then - local tile = Tile(railPos) - if tile:getItemById(7130) then - tile:getItemById(7130):transform(7121) - else - tile:getItemById():transform(item.itemid + 1) - end + local lever = levers[item.uid] + if lever then + local tile = Tile(lever) + if tile:getItemById(7130) then + tile:getItemById(7130):transform(7121) + else + local targetItem = tile:getItems()[1] + targetItem:transform(targetItem:getId() + 1) end end + item:transform(item.itemid == 10044 and 10045 or 10044) + return true end diff --git a/data/movements/movements.xml b/data/movements/movements.xml index 3ce450f..3140236 100644 --- a/data/movements/movements.xml +++ b/data/movements/movements.xml @@ -252,6 +252,7 @@ + diff --git a/data/movements/scripts/quests/the hidden city of beregar/bellow.lua b/data/movements/scripts/quests/the hidden city of beregar/bellow.lua index a6a2e41..303f688 100644 --- a/data/movements/scripts/quests/the hidden city of beregar/bellow.lua +++ b/data/movements/scripts/quests/the hidden city of beregar/bellow.lua @@ -1,12 +1,9 @@ -local cruciblePosition = Position(32699, 31494, 11) - function onStepIn(creature, item, position, fromPosition) - local player = creature:getPlayer() - if not player then + if not creature:isPlayer() then return true end - local crucibleItem = Tile(cruciblePosition):getItemById(8641) + local crucibleItem = Tile(Position(32699, 31495, 11)):getItemById(10040) if not crucibleItem then return true end @@ -18,8 +15,9 @@ function onStepIn(creature, item, position, fromPosition) crucibleItem:setActionId(50121) Position(32695, 31494, 10):sendMagicEffect(CONST_ME_POFF) elseif crucibleItem.actionid == 50121 then - player:say('TSSSSHHHHH', TALKTYPE_MONSTER_SAY, false, 0, Position(32695, 31494, 11)) - player:say('CHOOOOOOOHHHHH', TALKTYPE_MONSTER_SAY, false, 0, Position(32698, 31492, 11)) + Tile(Position(32699, 31494, 11)):getItemById(8641):setActionId(50121) + creature:say('TSSSSHHHHH', TALKTYPE_MONSTER_SAY, false, 0, Position(32695, 31494, 11)) + creature:say('CHOOOOOOOHHHHH', TALKTYPE_MONSTER_SAY, false, 0, Position(32698, 31492, 11)) end return true end diff --git a/data/movements/scripts/quests/the hidden city of beregar/bridgeTeleport.lua b/data/movements/scripts/quests/the hidden city of beregar/bridgeTeleport.lua new file mode 100644 index 0000000..f3ebcd9 --- /dev/null +++ b/data/movements/scripts/quests/the hidden city of beregar/bridgeTeleport.lua @@ -0,0 +1,10 @@ +function onStepIn(creature, item, position, fromPosition) + if not creature:isPlayer() then + return true + end + + creature:teleportTo(Position(32637, 31509, 10)) + creature:getPosition():sendMagicEffect(CONST_ME_TELEPORT) + + return true +end diff --git a/data/npc/scripts/Emperor Rehal.lua b/data/npc/scripts/Emperor Rehal.lua index 0bce246..fd72772 100644 --- a/data/npc/scripts/Emperor Rehal.lua +++ b/data/npc/scripts/Emperor Rehal.lua @@ -4,17 +4,17 @@ NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end -function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end -function onThink() npcHandler:onThink() end +function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end +function onThink() npcHandler:onThink() end -- Promotion local promoteKeyword = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, text = 'Do you want to be promoted in your vocation for 20000 gold?'}) - promoteKeyword:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, level = 20, cost = 20000}) - promoteKeyword:addChildKeyword({''}, StdModule.say, {npcHandler = npcHandler, text = 'Ok, whatever.', reset = true}) +promoteKeyword:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, level = 20, cost = 20000}) +promoteKeyword:addChildKeyword({''}, StdModule.say, {npcHandler = npcHandler, text = 'Ok, whatever.', reset = true}) -- Justice For All local missionKeyword = keywordHandler:addKeyword({'nokmir'}, StdModule.say, {npcHandler = npcHandler, text = 'Oh well, I liked Nokmir. He used to be a good dwarf until that day on which he stole the ring from Rerun.'}, function(player) return player:getStorageValue(Storage.hiddenCityOfBeregar.JusticeForAll) == 1 end) - missionKeyword:addChildKeyword({'grombur'}, StdModule.say, {npcHandler = npcHandler, text = 'He\'s very ambitious and always volunteers for the long shifts.'}, nil, function(player) player:setStorageValue(Storage.hiddenCityOfBeregar.JusticeForAll, 2) end) +missionKeyword:addChildKeyword({'grombur'}, StdModule.say, {npcHandler = npcHandler, text = 'He\'s very ambitious and always volunteers for the long shifts.'}, nil, function(player) player:setStorageValue(Storage.hiddenCityOfBeregar.JusticeForAll, 2) end) keywordHandler:addKeyword({'nokmir'}, StdModule.say, {npcHandler = npcHandler, text = { @@ -27,19 +27,21 @@ keywordHandler:addKeyword({'nokmir'}, StdModule.say, {npcHandler = npcHandler, -- Royal Rescue local missionKeyword = keywordHandler:addKeyword({'mission'}, StdModule.say, {npcHandler = npcHandler, text = 'As you have proven yourself trustworthy I\'m going to assign you a special mission. Are you interested?'}, - function(player) return player:getStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue) < 1 and player:getStorageValue(Storage.hiddenCityOfBeregar.JusticeForAll) == 5 end - ) + function(player) return player:getStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue) < 1 and player:getStorageValue(Storage.hiddenCityOfBeregar.JusticeForAll) == 5 end +) - missionKeyword:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, - text = { - "Splendid! My son Rehon set off on an expedition to the deeper mines. He and a group of dwarfs were to search for new veins of crystal. Unfortunately they have been missing for 2 weeks now. ...", - "Find my son and if he's alive bring him back. You will find a reactivated ore wagon tunnel at the entrance of the great citadel which leades to the deeper mines. If you encounter problems within the tunnel go ask Xorlosh, he can help you." - }}, nil, function(player) player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 1) end - ) +missionKeyword:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, + text = { + "Splendid! My son Rehon set off on an expedition to the deeper mines. He and a group of dwarfs were to search for new veins of crystal. Unfortunately they have been missing for 2 weeks now. ...", + "Find my son and if he's alive bring him back. You will find a reactivated ore wagon tunnel at the entrance of the great citadel which leades to the deeper mines. If you encounter problems within the tunnel go ask Xorlosh, he can help you." + }}, nil, function(player) player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 1) end +) local missionKeyword = keywordHandler:addKeyword({'mission'}, StdModule.say, {npcHandler = npcHandler, text = 'My son was captured by trolls? Doesn\'t sound like him, but if you say so. Now you want a reward, huh? ...'}, function(player) return player:getStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue) == 5 end) - missionKeyword:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, text = 'Look at these dwarven legs. They were forged years ago by a dwarf who was rather tall for our kind. I want you to have them. Thank you for rescuing my son |PLAYERNAME|'}, - nil, function(player) player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 6) player:addItem(2504, 1) end - ) +missionKeyword:addChildKeyword({'yes'}, StdModule.say, {npcHandler = npcHandler, text = 'Look at these dwarven legs. They were forged years ago by a dwarf who was rather tall for our kind. I want you to have them. Thank you for rescuing my son |PLAYERNAME|.'}, + nil, function(player) player:setStorageValue(Storage.hiddenCityOfBeregar.RoyalRescue, 6) player:addItem(2504, 1) end +) -npcHandler:addModule(FocusModule:new()) +local focusModule = FocusModule:new() +focusModule:addGreetMessage('hail emperor') +npcHandler:addModule(focusModule) \ No newline at end of file From 16e728bff61b60882f2d2eb8273233de98bc2293 Mon Sep 17 00:00:00 2001 From: WibbenZ Date: Tue, 7 Mar 2017 20:57:54 +0100 Subject: [PATCH 2/2] Add spaces to comments --- .../the hidden city of beregar/wagonMazeExit.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua b/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua index 15322e1..149c3cf 100644 --- a/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua +++ b/data/actions/scripts/quests/the hidden city of beregar/wagonMazeExit.lua @@ -1,11 +1,11 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey) local destinations = { - {teleportPos = Position(32692, 31501, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7122)}, --Coal Room - {teleportPos = Position(32549, 31407, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7123)}, --Infested Tavern - {teleportPos = Position(32579, 31487, 9), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7124)}, --Beregar - {teleportPos = Position(32701, 31448, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7121) and Tile(Position(32687, 31452, 13)):getItemById(7125) and Tile(Position(32692, 31453, 13)):getItemById(7126)}, --NPC Tehlim - {teleportPos = Position(32721, 31487, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7121) and Tile(Position(32692, 31459, 13)):getItemById(7123) and Tile(Position(32696, 31453, 13)):getItemById(7123)}, --Troll tribe's hideout - {teleportPos = Position(32600, 31504, 13), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7123) and Tile(Position(32695, 31464, 13)):getItemById(7123)} --City's Entrance + {teleportPos = Position(32692, 31501, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7122)}, -- Coal Room + {teleportPos = Position(32549, 31407, 11), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7123)}, -- Infested Tavern + {teleportPos = Position(32579, 31487, 9), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7124)}, -- Beregar + {teleportPos = Position(32701, 31448, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7124) and Tile(Position(32690, 31465, 13)):getItemById(7125) and Tile(Position(32684, 31464, 13)):getItemById(7122) and Tile(Position(32682, 31455, 13)):getItemById(7121) and Tile(Position(32687, 31452, 13)):getItemById(7125) and Tile(Position(32692, 31453, 13)):getItemById(7126)}, -- NPC Tehlim + {teleportPos = Position(32721, 31487, 15), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7121) and Tile(Position(32692, 31459, 13)):getItemById(7123) and Tile(Position(32696, 31453, 13)):getItemById(7123)}, -- Troll tribe's hideout + {teleportPos = Position(32600, 31504, 13), railCheck = Tile(Position(32688, 31469, 13)):getItemById(7123) and Tile(Position(32695, 31464, 13)):getItemById(7123)} -- City's Entrance } for i = 1, #destinations do