First commit
This commit is contained in:
@@ -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
app/SabrehavenServer/data/movements/scripts/misc/damage.lua
Normal file
26
app/SabrehavenServer/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
|
@@ -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
|
61
app/SabrehavenServer/data/movements/scripts/misc/doors.lua
Normal file
61
app/SabrehavenServer/data/movements/scripts/misc/doors.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
local verticalDoors = {
|
||||
[1643] = 1642,
|
||||
[1647] = 1646,
|
||||
[1661] = 1660,
|
||||
[1665] = 1664,
|
||||
[1675] = 1674,
|
||||
[1679] = 1678,
|
||||
[1697] = 1696,
|
||||
[1699] = 1698,
|
||||
[5112] = 5111,
|
||||
[5114] = 5113,
|
||||
[5130] = 5129,
|
||||
[5132] = 5131,
|
||||
[5288] = 5287,
|
||||
[5292] = 5291,
|
||||
[5748] = 5749,
|
||||
[6202] = 6201,
|
||||
[6206] = 6205,
|
||||
[6259] = 6258,
|
||||
[6263] = 6262,
|
||||
}
|
||||
|
||||
local horizontalDoors = {
|
||||
[1645] = 1644,
|
||||
[1649] = 1648,
|
||||
[1663] = 1662,
|
||||
[1667] = 1666,
|
||||
[1677] = 1676,
|
||||
[1681] = 1680,
|
||||
[1688] = 1687,
|
||||
[1690] = 1689,
|
||||
[5103] = 5102,
|
||||
[5105] = 5104,
|
||||
[5121] = 5120,
|
||||
[5123] = 5122,
|
||||
[5290] = 5289,
|
||||
[5294] = 5293,
|
||||
[5746] = 5745,
|
||||
[6204] = 6203,
|
||||
[6208] = 6207,
|
||||
[6261] = 6260,
|
||||
[6265] = 6264,
|
||||
}
|
||||
|
||||
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
|
@@ -0,0 +1,31 @@
|
||||
local condition = Condition(CONDITION_DROWN)
|
||||
condition:setTiming(5)
|
||||
|
||||
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
local player = creature:getPlayer()
|
||||
if player == nil then
|
||||
return true
|
||||
end
|
||||
|
||||
local helmet = player:getSlotItem(CONST_SLOT_HEAD)
|
||||
if helmet ~= nil and helmet:getId() == 5460 then
|
||||
return true
|
||||
end
|
||||
|
||||
if math.random(1, 10) == 1 then
|
||||
position:sendMagicEffect(CONST_ME_BUBBLES)
|
||||
end
|
||||
player:addCondition(condition)
|
||||
return true
|
||||
end
|
||||
|
||||
function onStepOut(creature, item, position, fromPosition)
|
||||
local player = creature:getPlayer()
|
||||
if player == nil then
|
||||
return true
|
||||
end
|
||||
|
||||
player:removeCondition(CONDITION_DROWN)
|
||||
return true
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
item:remove()
|
||||
return true
|
||||
end
|
114
app/SabrehavenServer/data/movements/scripts/misc/floorchange.lua
Normal file
114
app/SabrehavenServer/data/movements/scripts/misc/floorchange.lua
Normal file
@@ -0,0 +1,114 @@
|
||||
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},
|
||||
[5257] = {x = -1, y = 0, z = -1},
|
||||
[5258] = {x = 0, y = -1, z = -1},
|
||||
[5259] = {x = -1, y = 0, z = -1},
|
||||
[5544] = {x = 0, y = 0, z = 1},
|
||||
[5691] = {x = 1, y = 0, z = 1},
|
||||
[5731] = {x = 0, y = 0, z = 1},
|
||||
[5763] = {x = 0, y = 0, z = 1},
|
||||
[6172] = {x = 0, y = 0, z = 1},
|
||||
[6173] = {x = 0, y = 0, 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
|
||||
|
||||
Tile(item:getPosition()):relocateTo(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
|
@@ -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
|
@@ -0,0 +1,8 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
if item:getId() == 2918 or item:getId() == 2917 then
|
||||
tileitem:transform(6279, 1)
|
||||
item:getPosition():sendMagicEffect(CONST_ME_MAGIC_GREEN)
|
||||
item:remove()
|
||||
end
|
||||
return true
|
||||
end
|
@@ -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
|
@@ -0,0 +1,38 @@
|
||||
local config = {
|
||||
[17578] = { name = "edronorshabaal", message = "CHAMEK ATH UTHUL ARAK!", count=100 },
|
||||
[17579] = { name = "ferumbras", message = "Hahahaha! I have never been killed by the Avar Tar!", count=100 },
|
||||
[17580] = { name = "morgaroth", message = "THE TRIANGLE OF TERROR WILL RISE!", count=100 },
|
||||
[17581] = { name = "libertybaypirates", message = "Plundeeeeer!", count=100 }
|
||||
}
|
||||
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
doRelocate(item:getPosition(),{x = 33268, y = 31835, z = 9})
|
||||
item:getPosition():sendMagicEffect(11)
|
||||
Game.sendMagicEffect({x = 33268, y = 31835, z = 9}, 11)
|
||||
item:getPosition():sendMonsterSay("Mystic flame ward you off.")
|
||||
end
|
||||
|
||||
function onAddItem(item, tileitem, position)
|
||||
local movementId = tileitem:getMovementId()
|
||||
local raid = config[movementId]
|
||||
|
||||
if (item:getId() ~= 5776) then
|
||||
doRelocate(item:getPosition(),{x = 33268, y = 31835, z = 9})
|
||||
item:getPosition():sendMagicEffect(11)
|
||||
Game.sendMagicEffect({x = 33268, y = 31835, z = 9}, 11)
|
||||
tileitem:getPosition():sendMonsterSay("Mystic flame spit out the sacrifice.")
|
||||
return true
|
||||
end
|
||||
|
||||
local currentCount = getGlobalStorageValue(movementId) + item:getCount()
|
||||
setGlobalStorageValue(movementId, currentCount)
|
||||
if (currentCount >= raid.count) then
|
||||
item:getPosition():sendMonsterSay(raid.message)
|
||||
Game.startRaid(raid.name)
|
||||
tileitem:remove()
|
||||
setGlobalStorageValue(movementId, 0)
|
||||
end
|
||||
|
||||
item:getPosition():sendMagicEffect(CONST_ME_FIREAREA)
|
||||
item:remove()
|
||||
end
|
@@ -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
|
@@ -0,0 +1,14 @@
|
||||
function onAddItem(item, tileitem, position)
|
||||
if item:getId() == 5898 then
|
||||
tileitem:getPosition():sendMonsterSay("MORE! MORE!")
|
||||
item:remove(-1)
|
||||
return true
|
||||
elseif item:getId() == 5776 then
|
||||
tileitem:getPosition():sendMonsterSay("OHHH! WILL USE IT LATER!")
|
||||
item:remove(-1)
|
||||
return true
|
||||
end
|
||||
|
||||
tileitem:getPosition():sendMonsterSay("I WANT EYES!")
|
||||
item:remove(-1)
|
||||
end
|
@@ -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
app/SabrehavenServer/data/movements/scripts/misc/tar.lua
Normal file
7
app/SabrehavenServer/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
|
34
app/SabrehavenServer/data/movements/scripts/misc/turtles.lua
Normal file
34
app/SabrehavenServer/data/movements/scripts/misc/turtles.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
local config = {
|
||||
[51191] = Position(32359, 32901, 7),
|
||||
[51192] = Position(32340, 32538, 7),
|
||||
[51193] = Position(32472, 32869, 7),
|
||||
[51194] = Position(32415, 32916, 7),
|
||||
[51195] = Position(32490, 32979, 7),
|
||||
[51196] = Position(32440, 32971, 7),
|
||||
[51197] = Position(32523, 32923, 7),
|
||||
[51198] = Position(32527, 32951, 7)
|
||||
}
|
||||
|
||||
function onStepIn(creature, item, position, fromPosition)
|
||||
local player = creature:getPlayer()
|
||||
if not player then
|
||||
return true
|
||||
end
|
||||
|
||||
local targetPosition = config[item:getMovementId()]
|
||||
if not targetPosition then
|
||||
return true
|
||||
end
|
||||
|
||||
if item:getMovementId() == 51191 and player:getStorageValue(17502) < 13 then
|
||||
player:teleportTo(Position(32340, 32540, 7))
|
||||
position:sendMagicEffect(CONST_ME_TELEPORT)
|
||||
Position(32340, 32540, 7):sendMagicEffect(CONST_ME_TELEPORT)
|
||||
return true
|
||||
end
|
||||
|
||||
player:teleportTo(targetPosition)
|
||||
position:sendMagicEffect(CONST_ME_TELEPORT)
|
||||
targetPosition:sendMagicEffect(CONST_ME_TELEPORT)
|
||||
return true
|
||||
end
|
@@ -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