mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-14 14:44:55 +02:00
Full Distribution
This commit is contained in:
36
data/movements/scripts/nostalrius/1.lua
Normal file
36
data/movements/scripts/nostalrius/1.lua
Normal file
@@ -0,0 +1,36 @@
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
if not creature:isPlayer() then
|
||||
return true
|
||||
end
|
||||
|
||||
local player = Player(creature)
|
||||
local lookPosition = player:getPosition()
|
||||
lookPosition:getNextPosition(player:getDirection())
|
||||
local depotItem = Tile(lookPosition):getItemByType(ITEM_TYPE_DEPOT)
|
||||
if depotItem ~= nil then
|
||||
local depotItems = player:getDepotChest(getDepotId(depotItem:getUniqueId()), true):getItemHoldingCount()
|
||||
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Your depot contains " .. depotItems .. " item" .. (depotItems > 1 and "s." or "."))
|
||||
end
|
||||
|
||||
if item:getId() == 431 then
|
||||
item:transform(430)
|
||||
elseif item:getId() == 419 then
|
||||
item:transform(420)
|
||||
elseif item:getId() == 452 then
|
||||
item:transform(453)
|
||||
elseif item:getId() == 563 then
|
||||
item:transform(564)
|
||||
end
|
||||
end
|
||||
|
||||
function onStepOut(creature, item, position, fromPosition)
|
||||
if item:getId() == 430 then
|
||||
item:transform(431)
|
||||
elseif item:getId() == 420 then
|
||||
item:transform(419)
|
||||
elseif item:getId() == 453 then
|
||||
item:transform(452)
|
||||
elseif item:getId() == 564 then
|
||||
item:transform(563)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user