This bug is caused when then the actor initiating the chat with the elder does not have the staff in inventory. I have added a new function _M:findInAllPartyInventoriesBy(prop, value) to check the inventories of all party members and updated the quest code to use it. Since this quest is needed to continue to the east, I have added a new chat option to allow the quest to continue if the player does not have the staff for any reason.
Code: Select all
Index: game/modules/tome/class/Party.lua
===================================================================
--- game/modules/tome/class/Party.lua (revision 6354)
+++ game/modules/tome/class/Party.lua (working copy)
@@ -418,3 +418,11 @@
end
game:registerDialog(d)
end
+
+function _M:findInAllPartyInventoriesBy(prop, value)
+ local o, item, inven_id
+ for i, mem in ipairs(game.party.m_list) do
+ o, item, inven_id = mem:findInAllInventoriesBy(prop, value)
+ if o then return mem, o, item, inven_id end
+ end
+end
\ No newline at end of file
Index: game/modules/tome/data/chats/last-hope-elder.lua
===================================================================
--- game/modules/tome/data/chats/last-hope-elder.lua (revision 6354)
+++ game/modules/tome/data/chats/last-hope-elder.lua (working copy)
@@ -30,10 +30,12 @@
text = [[#LIGHT_GREEN#*He remains silent for a while*#WHITE# Indeed you were right to come here.
The staff you describe reminds me of an artifact of great power from ancient times. May I see it?]],
answers = {
- {"Here it is. #LIGHT_GREEN#*Tell him the encounter with the orcs*#LAST# You should keep it. I can feel its power and it would be safer if it were guarded by the armies of the kingdom.",
- jump="given_staff", cond=function(npc, player) return player:findInAllInventoriesBy("define_as", "STAFF_ABSORPTION") and player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "survived-ukruk") end},
+ {"Here it is. #LIGHT_GREEN#*Tell him about the encounter with the orcs*#LAST# You should keep it. I can feel its power and it would be safer if it were guarded by the armies of the kingdom.",
+ jump="given_staff", cond=function(npc, player) return game.party:findInAllPartyInventoriesBy("define_as", "STAFF_ABSORPTION") and player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "survived-ukruk") or false end},
{"I am afraid I lost it. #LIGHT_GREEN#*Tell him about the encounter with the orcs*",
jump="lost_staff", cond=function(npc, player) return player:isQuestStatus("staff-absorption", engine.Quest.COMPLETED, "ambush-finish") end},
+ {"I had it briefly but have lost it somehow. It could have been some orcs I encountered ...",
+ jump="lost_staff", cond=function(npc, player) return player:hasQuest("staff-absorption") and not game.party:findInAllPartyInventoriesBy("define_as", "STAFF_ABSORPTION") end},
}
}
@@ -43,10 +45,10 @@
Anyway, thank you again, @playername@, for your help.]],
answers = {
{"Thank you, my lord.", action=function(npc, player)
- local o, item, inven_id = player:findInAllInventoriesBy("define_as", "STAFF_ABSORPTION")
- player:removeObject(inven_id, item, true)
+ local mem, o, item, inven_id = game.party:findInAllPartyInventoriesBy("define_as", "STAFF_ABSORPTION")
+ mem:removeObject(inven_id, item, true)
o:removed()
-
+
player:setQuestStatus("staff-absorption", engine.Quest.DONE)
world:gainAchievement("A_DANGEROUS_SECRET", player)
end, jump="orc_hunt"},