Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1381 from rude-jerk/thief_tools
Browse files Browse the repository at this point in the history
Player's main job must be THF to use thief's tools
  • Loading branch information
zach2good authored Oct 17, 2020
2 parents f52b66b + 2733a95 commit e6001c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions scripts/globals/caskets.lua
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,7 @@ tpz.caskets.onTrade = function(player, npc, trade)
end

if locked == 1 then
if npcUtil.tradeHasExactly(trade, 1022) then

if player:getMainJob() == tpz.job.THF and npcUtil.tradeHasExactly(trade, 1022) then
local splitNumbers = {}
local tradeAttempt = math.random()
local firstAttempt = npc:getLocalVar("[caskets]HINT_TRADE")
Expand Down
7 changes: 4 additions & 3 deletions scripts/globals/treasure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1336,13 +1336,14 @@ tpz.treasure.onTrade = function(player, npc, trade, chestType)

-- determine type of key traded
local keyTraded = nil
local isThief = player:getMainJob() == tpz.job.THF
if npcUtil.tradeHasExactly(trade, info.key) then
keyTraded = keyType.ZONE_KEY
elseif npcUtil.tradeHasExactly(trade, 1022) then
elseif isThief and npcUtil.tradeHasExactly(trade, 1022) then
keyTraded = keyType.THIEF_TOOLS
elseif npcUtil.tradeHasExactly(trade, 1115) then
elseif isThief and npcUtil.tradeHasExactly(trade, 1115) then
keyTraded = keyType.SKELETON_KEY
elseif npcUtil.tradeHasExactly(trade, 1023) then
elseif isThief and npcUtil.tradeHasExactly(trade, 1023) then
keyTraded = keyType.LIVING_KEY
end

Expand Down

0 comments on commit e6001c7

Please sign in to comment.