Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

Commit

Permalink
fix(Quest): reward players with correct keys
Browse files Browse the repository at this point in the history
Fixes a problem with Emperor's Cookies quest
  • Loading branch information
wizardlink committed Feb 24, 2021
1 parent 4950907 commit 44e6ffb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions data/lib/core/storages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ Storage = {
LastMissionState = 51529
},
TheCursedCrystal = {
Oneeyedjoe = 51530,
Oneeyedjoe = 51530,
MedusaOil = 51531,
Questline = 51532
}
Expand Down Expand Up @@ -2425,4 +2425,4 @@ if #extraction > 1 then
print(string.format("> Processed in %.4f(s)", os.clock() - benchmark))
end
end
end
end
20 changes: 10 additions & 10 deletions data/scripts/actions/system/quest_reward_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ end

local function playerAddContainerItem(params, item)
local player = params.player

local reward = params.containerReward
if params.action then
local itemType = ItemType(params.itemid)
if itemType:isKey() then
-- If is key inside container, uses the "keyAction" variable
keyItem = reward:addItem(params.itemid, params.count)
keyItem:setActionId(params.action)
end
end

local achievement = achievementTable[item.uid]
if achievement then
player:addAchievement(achievement)
end

reward:addItem(params.itemid, params.count)
local itemType = ItemType(params.itemid)

if params.action and itemType:isKey() then
-- If is key inside container, uses the "keyAction" variable
keyItem = reward:addItem(params.itemid, params.count)
keyItem:setActionId(params.action)
else
reward:addItem(params.itemid, params.count)
end

player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have found a " .. getItemName(params.itemBagName) .. ".")
player:setStorageValue(params.storage, 1)
return true
Expand Down
4 changes: 2 additions & 2 deletions data/startup/tables/chest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ ChestUnique = {
},
-- Emperor's cookies quest key 3801
[5004] = {
isKey = true,
itemId = 1740,
itemPos = {x = 32648, y = 31905, z = 3},
container = 1987,
keyAction = Storage.Quest.Key.ID3801,
reward = {{2089, 1}, {2687, 20}, {2687, 7}},
weight = 44,
storage = Storage.Quest.Key.ID3801
Expand Down Expand Up @@ -112,10 +112,10 @@ ChestUnique = {
storage = Storage.Quest.Key.ID5010
},
[5008] = {
isKey = true,
itemId = 1740,
itemPos = {x = 32201, y = 31571, z = 10},
container = 1987,
keyAction = Storage.Quest.Key.ID4502,
reward = {{2089, 1}, {2148, 23}, {2260, 1}, {2410, 4}, {2490, 1}},
weight = 80,
storage = Storage.Quest.Key.ID4502
Expand Down

0 comments on commit 44e6ffb

Please sign in to comment.