Skip to content

Commit

Permalink
Merge pull request #8 from jprzimba/swimming
Browse files Browse the repository at this point in the history
Updated Swimming System
  • Loading branch information
jprzimba authored Dec 28, 2024
2 parents 2f94ceb + b007313 commit 6555e09
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 7 deletions.
12 changes: 12 additions & 0 deletions data/scripts/creaturescripts/player/swimming.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
local swimmingLogout = CreatureEvent("SwimmingLogout")

function swimmingLogout.onLogout(player)
if player:getOutfit().lookType == 267 then
player:sendCancelMessage("You cannot logout while in the pool.")
return false
end

return true
end

swimmingLogout:register()
6 changes: 6 additions & 0 deletions data/scripts/movements/swimming.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ function swimming.onStepIn(creature, item, position, fromPosition)
return false
end

if player:isInGhostMode() then
player:sendCancelMessage("You cannot enter the water while in ghost mode.")
player:teleportTo(fromPosition, true)
return false
end

for i = 1, #conditions do
player:removeCondition(conditions[i])
end
Expand Down
5 changes: 5 additions & 0 deletions data/scripts/talkactions/god/create_npc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ function createNpc.onSay(player, words, param)
return true
end

if player:getOutfit().lookType == 267 then
player:sendCancelMessage("You cannot execte this command while in the pool.")
return true
end

local split = param:split(",")
local name = split[1]
local permanentStr = split[2]
Expand Down
5 changes: 5 additions & 0 deletions data/scripts/talkactions/god/create_summon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function createSummon.onSay(player, words, param)
return true
end

if player:getOutfit().lookType == 267 then
player:sendCancelMessage("You cannot execte this command while in the pool.")
return true
end

local position = player:getPosition()
local summon = Game.createMonster(param, position, true, false, player)
if not summon then
Expand Down
5 changes: 5 additions & 0 deletions data/scripts/talkactions/god/manage_monster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ function createMonster.onSay(player, words, param)
return true
end

if player:getOutfit().lookType == 267 then
player:sendCancelMessage("You cannot execte this command while in the pool.")
return true
end

local playerPosition = player:getPosition()
local splitParams = param:split(",")
local monsterName = splitParams[1]
Expand Down
4 changes: 2 additions & 2 deletions data/scripts/talkactions/player/randomoutfit.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ local randomOutfit = TalkAction("!randomoutfit")

local config = {
changeInterval = 100,
showEffect = false
showEffect = false,
}

local validValues = {
"on",
"off"
"off",
}

local activePlayers = {}
Expand Down
16 changes: 11 additions & 5 deletions markdowns/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

- Add all files in data/migrations
- data/scripts/talkactions/player/randomoutfit.lua
- data/scripts/creaturescripts/player/swimming.lua
- data-global/scripts/creaturescripts/customs/water_houses.lua

## Modified files

Expand All @@ -26,16 +28,16 @@
- data/items/items.xml
- data/scripts/creaturescripts/player/login.lua
- data/scripts/movements/special_tiles.lua
- data/scripts/movements/swimming.lua
- data/scripts/talkactions/god/icons_functions.lua
- data/scripts/talkactions/god/goto_house.lua
- data/scripts/talkactions/god/manage_monster.lua
- data/scripts/talkactions/god/create_summon.lua
- data/scripts/talkactions/god/create_npc.lua
- data-global/scripts/quests/ferumbras_ascension/actions_flower_puzzle_lever.lua
- data-global/scripts/quests/ferumbras_ascension/movements_flower_puzzle.lua
- data-global/scripts/lib/register_actions.lua

## Added files

- data-global/scripts/creaturescripts/customs/water_houses.lua

### Bug Fixes

- Fixed influenced creatures not spawning. ([Tryller](https://github.com/jprzimba))
Expand All @@ -44,7 +46,11 @@
- Fixed gotoHouse talkaction. ([Tryller](https://github.com/jprzimba))
- Fixed Ferumbras' Ascendant Garden Flower Puzzle. ([Mckay666](https://github.com/Mckay666))
- Fixed lava tiles in entrance of The Pits of Inferno Quest. ([jeansouzak](https://github.com/jeansouzak))
- Fixed Items created using CreateMapItem are cleanable by /clean. ([#7](https://github.com/jprzimba/crystalserver/issues/7)) ([Tryller](https://github.com/jprzimba)).
- Fixed Items created using CreateMapItem are cleanable by /clean. ([#7](https://github.com/jprzimba/crystalserver/issues/7)) ([Tryller](https://github.com/jprzimba))
- Prevent players from entering the pool while in ghost mode. ([Tryller](https://github.com/jprzimba))
- Prevent players from logging out while in the pool.
- Prevent the use of `/n`, `/m`, and `/s` commands while in the pool. ([Tryller](https://github.com/jprzimba))


## Version 4.1

Expand Down

0 comments on commit 6555e09

Please sign in to comment.