Skip to content

Commit

Permalink
Reward Exercise: Adjusted validation to ignore players in Dawnport or…
Browse files Browse the repository at this point in the history
… rookgard.
  • Loading branch information
elsongabriel committed Oct 5, 2023
1 parent a060c21 commit f0160ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
local winReward = CreatureEvent("WinReward")

function winReward.onLogin(player)
if configManager.getBoolean(configKeys.TOGGLE_RECEIVE_REWARD) then
if (configManager.getBoolean(configKeys.TOGGLE_RECEIVE_REWARD) and player:getTown():getId() >= TOWNS_LIST.AB_DENDRIEL) then
-- check user won exercise weapon and send message
if not table.contains({ TOWNS_LIST.DAWNPORT, TOWNS_LIST.DAWNPORT_TUTORIAL }, player:getTown():getId()) then
if player:getStorageValue(tonumber(Storage.PlayerWeaponReward)) ~= 1 then
player:sendTextMessage(MESSAGE_LOGIN, "You can receive an exercise weapon using command !reward")
end
if player:getStorageValue(tonumber(Storage.PlayerWeaponReward)) ~= 1 then
player:sendTextMessage(MESSAGE_LOGIN, "You can receive an exercise weapon using command !reward")
end
end
return true
Expand Down
2 changes: 1 addition & 1 deletion data/scripts/talkactions/player/reward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ end

local exerciseRewardModal = TalkAction("!reward")
function exerciseRewardModal.onSay(player, words, param)
if not configManager.getBoolean(configKeys.TOGGLE_RECEIVE_REWARD) then
if (not configManager.getBoolean(configKeys.TOGGLE_RECEIVE_REWARD) or player:getTown():getId() < TOWNS_LIST.AB_DENDRIEL) then
return true
end
if player:getStorageValue(config.storage) > 0 then
Expand Down

0 comments on commit f0160ed

Please sign in to comment.