forked from opentibiabr/canary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f253373
commit 609f6e7
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
data-otservbr-global/scripts/quests/the_ancient_tombs/action_morguthis_wall.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
local Morguthiswall = Action() | ||
|
||
function Morguthiswall.onUse(player, item, fromPosition, target, toPosition) | ||
local wallPosition = Position(33211, 32698, 13) | ||
local wallId = 1306 | ||
|
||
local tile = Tile(wallPosition) | ||
if not tile then | ||
return false | ||
end | ||
|
||
local wall = tile:getItemById(wallId) | ||
if wall then | ||
wall:remove() | ||
else | ||
local creatures = tile:getCreatures() | ||
if creatures then | ||
for _, creature in ipairs(creatures) do | ||
local newPosition = Position(wallPosition.x, wallPosition.y + 1, wallPosition.z) | ||
creature:teleportTo(newPosition) | ||
end | ||
end | ||
|
||
local items = tile:getItems() | ||
if items then | ||
for _, tileItem in ipairs(items) do | ||
local newPosition = Position(wallPosition.x, wallPosition.y + 1, wallPosition.z) | ||
tileItem:moveTo(newPosition) | ||
end | ||
end | ||
|
||
Game.createItem(wallId, 1, wallPosition) | ||
end | ||
|
||
return true | ||
end | ||
|
||
Morguthiswall:aid(10808) | ||
Morguthiswall:register() |