mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-10-13 22:34:53 +02:00
Full Distribution
This commit is contained in:
7
data/movements/scripts/misc/candelabrum.lua
Normal file
7
data/movements/scripts/misc/candelabrum.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
function onRemoveItem(item, tileitem, position)
|
||||
if item:getPosition():getDistance(position) > 0 then
|
||||
item:transform(2912, 1)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
26
data/movements/scripts/misc/damage.lua
Normal file
26
data/movements/scripts/misc/damage.lua
Normal file
@@ -0,0 +1,26 @@
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
local tile = Tile(position)
|
||||
if tile:hasFlag(TILESTATE_PROTECTIONZONE) then
|
||||
return
|
||||
end
|
||||
|
||||
if item:getId() == 2145 then
|
||||
item:transform(2146, 1)
|
||||
item:decay()
|
||||
doTargetCombatHealth(0, creature, COMBAT_PHYSICALDAMAGE, -60, -60)
|
||||
elseif item:getId() == 2146 or item:getId() == 2148 then
|
||||
doTargetCombatHealth(0, creature, COMBAT_PHYSICALDAMAGE, -60, -60)
|
||||
elseif item:getId() == 3482 then
|
||||
if not creature:isPlayer() then
|
||||
doTargetCombatHealth(0, creature, COMBAT_PHYSICALDAMAGE, -30, -30)
|
||||
else
|
||||
position:sendMagicEffect(CONST_ME_POFF)
|
||||
end
|
||||
item:transform(3481, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 3944 then
|
||||
doTargetCombatHealth(0, creature, COMBAT_PHYSICALDAMAGE, -30, -30)
|
||||
item:transform(3945, 1)
|
||||
item:decay()
|
||||
end
|
||||
end
|
36
data/movements/scripts/misc/depot_switch.lua
Normal file
36
data/movements/scripts/misc/depot_switch.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
|
39
data/movements/scripts/misc/doors.lua
Normal file
39
data/movements/scripts/misc/doors.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local verticalDoors = {
|
||||
[1643] = 1642,
|
||||
[1647] = 1646,
|
||||
[1661] = 1660,
|
||||
[1665] = 1664,
|
||||
[1675] = 1674,
|
||||
[1679] = 1678,
|
||||
[1697] = 1696,
|
||||
[1699] = 1698,
|
||||
}
|
||||
|
||||
local horizontalDoors = {
|
||||
[1645] = 1644,
|
||||
[1649] = 1648,
|
||||
[1663] = 1662,
|
||||
[1667] = 1666,
|
||||
[1677] = 1676,
|
||||
[1681] = 1680,
|
||||
[1688] = 1687,
|
||||
[1690] = 1689,
|
||||
}
|
||||
|
||||
function onStepOut(creature, item, fromPosition, toPosition)
|
||||
local door = verticalDoors[item:getId()]
|
||||
if door then
|
||||
doRelocate(item:getPosition(), item:getPosition():moveRel(1, 0, 0))
|
||||
item:transform(door)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
|
||||
door = horizontalDoors[item:getId()]
|
||||
if door then
|
||||
doRelocate(item:getPosition(), item:getPosition():moveRel(0, 1, 0))
|
||||
item:transform(door)
|
||||
item:decay()
|
||||
return true
|
||||
end
|
||||
end
|
4
data/movements/scripts/misc/dustbin.lua
Normal file
4
data/movements/scripts/misc/dustbin.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
item:remove()
|
||||
return true
|
||||
end
|
105
data/movements/scripts/misc/floorchange.lua
Normal file
105
data/movements/scripts/misc/floorchange.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
local list = {
|
||||
[293] = {x = 0, y = 0, z = 1},
|
||||
[294] = {x = 0, y = 0, z = 1},
|
||||
[369] = {x = 0, y = 0, z = 1},
|
||||
[370] = {x = 0, y = 0, z = 1},
|
||||
[385] = {x = 0, y = 0, z = 1},
|
||||
[394] = {x = 0, y = 0, z = 1},
|
||||
[411] = {x = 0, y = 0, z = 1},
|
||||
[412] = {x = 0, y = 0, z = 1},
|
||||
[413] = {x = 0, y = 1, z = 1},
|
||||
[414] = {x = 0, y = 1, z = 1},
|
||||
[428] = {x = 0, y = 1, z = 1},
|
||||
[4823] = {x = 0, y = 1, z = 1},
|
||||
[4824] = {x = 0, y = 1, z = 1},
|
||||
[4825] = {x = 0, y = 1, z = 1},
|
||||
[4826] = {x = 0, y = 1, z = 1},
|
||||
[432] = {x = 0, y = 0, z = 1},
|
||||
[433] = {x = 0, y = 0, z = 1},
|
||||
[434] = {x = 0, y = 1, z = 1},
|
||||
[437] = {x = 0, y = 1, z = 1},
|
||||
[438] = {x = 0, y = 1, z = 1},
|
||||
[451] = {x = 0, y = 1, z = 1},
|
||||
[465] = {x = 0, y = -1, z = 1},
|
||||
[466] = {x = -1, y = 0, z = 1},
|
||||
[467] = {x = 1, y = 0, z = 1},
|
||||
[471] = {x = -1, y = -1, z = 1},
|
||||
[472] = {x = 1, y = -1, z = 1},
|
||||
[473] = {x = -1, y = 1, z = 1},
|
||||
[474] = {x = 1, y = 1, z = 1},
|
||||
[475] = {x = 0, y = 0, z = 1},
|
||||
[476] = {x = 0, y = 0, z = 1},
|
||||
[482] = {x = 0, y = 0, z = 1},
|
||||
[5081] = {x = 0, y = 0, z = 1},
|
||||
[483] = {x = 0, y = 0, z = 1},
|
||||
[484] = {x = 0, y = 1, z = 1},
|
||||
[485] = {x = 0, y = 1, z = 1},
|
||||
[566] = {x = 0, y = 1, z = 1},
|
||||
[567] = {x = 1, y = 0, z = 1},
|
||||
[594] = {x = 0, y = 0, z = 1},
|
||||
[595] = {x = 0, y = 0, z = 1},
|
||||
[600] = {x = -1, y = 0, z = 1},
|
||||
[601] = {x = 1, y = 0, z = 1},
|
||||
[604] = {x = -1, y = 0, z = 1},
|
||||
[605] = {x = 1, y = 0, z = 1},
|
||||
[607] = {x = 0, y = 0, z = 1},
|
||||
[609] = {x = 0, y = 0, z = 1},
|
||||
[610] = {x = 0, y = 0, z = 1},
|
||||
[615] = {x = 0, y = 0, z = 1},
|
||||
[1066] = {x = 0, y = 0, z = 1},
|
||||
[1067] = {x = 0, y = 0, z = 1},
|
||||
[1080] = {x = 0, y = 0, z = 1},
|
||||
[1156] = {x = 0, y = 1, z = 1},
|
||||
[1947] = {x = 0, y = -1, z = -1},
|
||||
[1950] = {x = 1, y = 0, z = -1},
|
||||
[1952] = {x = -1, y = 0, z = -1},
|
||||
[1954] = {x = 0, y = 1, z = -1},
|
||||
[1956] = {x = 0, y = -1, z = -1},
|
||||
[1958] = {x = 0, y = -1, z = -1},
|
||||
[1960] = {x = 1, y = 0, z = -1},
|
||||
[1962] = {x = -1, y = 0, z = -1},
|
||||
[1964] = {x = 0, y = 1, z = -1},
|
||||
[1966] = {x = 0, y = -1, z = -1},
|
||||
[1969] = {x = 1, y = 0, z = -1},
|
||||
[1971] = {x = -1, y = 0, z = -1},
|
||||
[1973] = {x = 0, y = 1, z = -1},
|
||||
[1975] = {x = 0, y = -1, z = -1},
|
||||
[1977] = {x = 0, y = -1, z = -1},
|
||||
[1978] = {x = -1, y = 0, z = -1},
|
||||
[2192] = {x = -1, y = -1, z = -1},
|
||||
[2194] = {x = 1, y = -1, z = -1},
|
||||
[2196] = {x = 1, y = 1, z = -1},
|
||||
[2198] = {x = -1, y = 1, z = -1},
|
||||
}
|
||||
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
local entry = list[item:getId()]
|
||||
local relPos = item:getPosition():moveRel(entry.x, entry.y, entry.z)
|
||||
|
||||
local tile = Tile(relPos)
|
||||
if tile == nil or tile:getGround() == nil then
|
||||
return false
|
||||
end
|
||||
|
||||
creature:teleportTo(relPos)
|
||||
if item:getId() == 293 then
|
||||
item:transform(294)
|
||||
item:decay()
|
||||
elseif item:getId() == 475 then
|
||||
item:transform(476)
|
||||
item:decay()
|
||||
elseif item:getId() == 1066 then
|
||||
item:transform(1067)
|
||||
item:decay()
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
function onAddItem(item, tileitem, position)
|
||||
if tileitem:getId() ~= 293 and tileitem:getId() ~= 475 and tileitem:getId() ~= 476 and tileitem:getId() ~= 1066 then
|
||||
local entry = list[tileitem:getId()]
|
||||
local relPos = tileitem:getPosition():moveRel(entry.x, entry.y, entry.z)
|
||||
item:moveTo(relPos)
|
||||
end
|
||||
return true
|
||||
end
|
7
data/movements/scripts/misc/lava.lua
Normal file
7
data/movements/scripts/misc/lava.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
if item:getType():isMovable() and Tile(position):getThingCount() == 2 then
|
||||
item:getPosition():sendMagicEffect(16)
|
||||
item:remove()
|
||||
end
|
||||
return true
|
||||
end
|
8
data/movements/scripts/misc/open_trap.lua
Normal file
8
data/movements/scripts/misc/open_trap.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
function onRemoveItem(item, tileitem, position)
|
||||
if item:getPosition():getDistance(position) > 0 then
|
||||
item:transform(3481, 1)
|
||||
item:decay()
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
end
|
||||
return true
|
||||
end
|
39
data/movements/scripts/misc/sandstone_wall.lua
Normal file
39
data/movements/scripts/misc/sandstone_wall.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
function onStepIn(creature, item, fromPosition, toPosition)
|
||||
if item:getId() == 478 then
|
||||
item:transform(479, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 480 then
|
||||
item:transform(481, 1)
|
||||
item:decay()
|
||||
end
|
||||
end
|
||||
|
||||
function onStepOut(creature, item, fromPosition, toPosition)
|
||||
if item:getId() == 479 then
|
||||
item:transform(478, 1)
|
||||
item:decay()
|
||||
elseif item:getId() == 481 then
|
||||
item:transform(480, 1)
|
||||
item:decay()
|
||||
end
|
||||
end
|
||||
|
||||
function onAddItem(item, tileitem, position)
|
||||
if tileitem:getId() == 478 then
|
||||
tileitem:transform(479, 1)
|
||||
tileitem:decay()
|
||||
elseif tileitem:getId() == 480 then
|
||||
tileitem:transform(481, 1)
|
||||
tileitem:decay()
|
||||
end
|
||||
end
|
||||
|
||||
function onRemoveItem(item, tileitem, position)
|
||||
if tileitem:getId() == 479 then
|
||||
tileitem:transform(478, 1)
|
||||
tileitem:decay()
|
||||
elseif tileitem:getId() == 481 then
|
||||
tileitem:transform(480, 1)
|
||||
tileitem:decay()
|
||||
end
|
||||
end
|
8
data/movements/scripts/misc/swamp.lua
Normal file
8
data/movements/scripts/misc/swamp.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
if (item:getType():isMovable() and Tile(position):getThingCount() == 2) or
|
||||
(tileitem:getId() >= 4874 and tileitem:getId() <= 4880) then
|
||||
item:getPosition():sendMagicEffect(9)
|
||||
item:remove()
|
||||
end
|
||||
return true
|
||||
end
|
7
data/movements/scripts/misc/tar.lua
Normal file
7
data/movements/scripts/misc/tar.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
if item:getType():isMovable() and Tile(position):getThingCount() == 2 then
|
||||
item:getPosition():sendMagicEffect(3)
|
||||
item:remove()
|
||||
end
|
||||
return true
|
||||
end
|
7
data/movements/scripts/misc/water.lua
Normal file
7
data/movements/scripts/misc/water.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
if item:getType():isMovable() and Tile(position):getThingCount() == 2 then
|
||||
item:getPosition():sendMagicEffect(2)
|
||||
item:remove()
|
||||
end
|
||||
return true
|
||||
end
|
Reference in New Issue
Block a user