-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
b4af6d7
commit bb6862c
Showing
2 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...global/scripts/actions/other/bath_tub.lua → ...cripts/actions/objects/bath_tub_drain.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
21 changes: 12 additions & 9 deletions
21
...bal/scripts/movements/others/bath_tub.lua → data/scripts/movements/bath_tub.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 |
---|---|---|
@@ -1,35 +1,38 @@ | ||
local playerBathTub = 26087 | ||
|
||
local bathtubEnter = MoveEvent() | ||
|
||
function bathtubEnter.onStepIn(creature, item, position, fromPosition) | ||
if not creature:isPlayer() then | ||
return false | ||
local player = creature:getPlayer() | ||
if not player then | ||
return true | ||
end | ||
|
||
local condition = Condition(CONDITION_OUTFIT) | ||
condition:setOutfit({ lookTypeEx = playerBathTub }) | ||
condition:setOutfit({ lookTypeEx = 26087 }) | ||
condition:setTicks(-1) | ||
|
||
position:sendMagicEffect(CONST_ME_WATERSPLASH) | ||
item:transform(BATHTUB_FILLED_NOTMOVABLE) | ||
creature:addCondition(condition) | ||
player:addCondition(condition) | ||
return true | ||
end | ||
|
||
bathtubEnter:type("stepin") | ||
bathtubEnter:id(BATHTUB_FILLED) | ||
bathtubEnter:register() | ||
|
||
local bathtubExit = MoveEvent() | ||
|
||
function bathtubExit.onStepOut(creature, item, position, fromPosition) | ||
if not creature:isPlayer() then | ||
return false | ||
local player = creature:getPlayer() | ||
if not player then | ||
return true | ||
end | ||
|
||
item:transform(BATHTUB_FILLED) | ||
creature:removeCondition(CONDITION_OUTFIT) | ||
player:removeCondition(CONDITION_OUTFIT) | ||
return true | ||
end | ||
|
||
bathtubExit:type("stepout") | ||
bathtubExit:id(BATHTUB_FILLED_NOTMOVABLE) | ||
bathtubExit:register() |