-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed water bug in houses opentibiabr/canary#3039
NOTE: You need to remove house water tiles in your map for it to load water properly.
- Loading branch information
Showing
6 changed files
with
52 additions
and
2 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
data-global/scripts/creaturescripts/customs/water_houses.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,30 @@ | ||
local positions = { | ||
{ fromPos = Position(33600, 31927, 3), toPos = Position(33606, 31931, 3) } | ||
} | ||
|
||
local function isInRestrictedArea(position) | ||
for _, restrictedArea in ipairs(positions) do | ||
if position.x >= restrictedArea.fromPos.x and position.x <= restrictedArea.toPos.x and | ||
position.y >= restrictedArea.fromPos.y and position.y <= restrictedArea.toPos.y and | ||
position.z == restrictedArea.fromPos.z then | ||
return true | ||
end | ||
end | ||
return false | ||
end | ||
|
||
local disableMovingItems = EventCallback("DisableMovingItems") | ||
|
||
disableMovingItems.playerOnMoveItem = function(self, item, count, fromPosition, toPosition, fromCylinder, toCylinder) | ||
if isInRestrictedArea(toPosition) then | ||
if item:getId() == ITEM_WATERBALL or item:getId() == ITEM_WATERBALL_SPLASH then | ||
return true | ||
end | ||
|
||
self:sendTextMessage(MESSAGE_FAILURE, "You cannot throw items into the water.") | ||
return false | ||
end | ||
return true | ||
end | ||
|
||
disableMovingItems:register() |
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
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
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
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
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