Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpecialContainersAvailable feature (11.8) #4172

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions data/lib/core/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -371,3 +371,15 @@ function Player.addAllMounts(self)
self:addMount(mounts[mount].id)
end
end

function Player.setSpecialContainersAvailable(self, available)
local msg = NetworkMessage()
msg:addByte(0x2A)

msg:addByte(0x00) -- stash
msg:addByte(available and 0x01 or 0x00) -- market

msg:sendToPlayer(self)
msg:delete()
return true
end
8 changes: 7 additions & 1 deletion data/movements/scripts/tiles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function onStepIn(creature, item, position, fromPosition)
local depotItems = creature:getDepotChest(getDepotId(depotItem:getUniqueId()), true):getItemHoldingCount()
creature:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
creature:addAchievementProgress("Safely Stored Away", 1000)
creature:setSpecialContainersAvailable(true)
return true
end
end
Expand All @@ -47,7 +48,12 @@ function onStepOut(creature, item, position, fromPosition)
return true
end

if creature:isPlayer() and creature:isInGhostMode() then
local isPlayer = creature:isPlayer()
if isPlayer then
creature:setSpecialContainersAvailable(false)
end

if isPlayer and creature:isInGhostMode() then
return true
end

Expand Down
2 changes: 1 addition & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5214,7 +5214,7 @@ void Game::playerBrowseMarket(uint32_t playerId, uint16_t spriteId)
}

if (!player->isInMarket()) {
return;
player->sendMarketEnter();
}

const ItemType& it = Item::items.getItemIdByClientId(spriteId);
Expand Down