From 85005831eef0bdefaf86ada769df5212f593c482 Mon Sep 17 00:00:00 2001 From: Paco Date: Sun, 12 Jul 2026 01:40:41 -0600 Subject: [PATCH 1/4] temporal fix: crystal-handle colourisable mounts for OTCR I'm sure you have met this problem in otc where color mounts ends by crashing otcr player screen when playing with mixed cipsoft and otcr clients. Well, this is a temporal solution that sets color 0 in mounts, this way you don't have to disable mounts in the xml and you can enable mixed cipsoft and otcr in same server. This is a temporal fix while otcr guys handle the color mounts, I know it's a lil fixed already but if you change color as cip client player in front of a otcr player you will go totally invisible, this script will prevent this problem while a solution is created. This doesn't has to be merged if you don't want to, it's just a code I'm sharing with you guys so you can play without problems. I would make it configurable but makes no sense because otcr may be updated soon. Works for both android and windows otcr clients, you can try with those of mine, just change the ip and conenct to your server: Windows https://tibiatales.com/otclient.zip Android https://tibiatales.com/androidotclient.apk --- .../player/otc_mount_color_fix.lua | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 data/scripts/creaturescripts/player/otc_mount_color_fix.lua diff --git a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua new file mode 100644 index 000000000..e8950fde3 --- /dev/null +++ b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua @@ -0,0 +1,36 @@ +local BROKEN_MOUNTS = { -- add future incoming color mounts in the future until otcr can handle it + [1363] = true, + [1430] = true, + [1599] = true, + [1724] = true, + [1826] = true, + [1827] = true, + [1810] = true, + [1866] = true, +} + +local mountColorFix = GlobalEvent("MountColorFix") + +function mountColorFix.onThink(interval) + for _, player in ipairs(Game.getPlayers()) do + local outfit = player:getOutfit() + local mountId = outfit.lookMount + + if mountId and mountId > 0 and BROKEN_MOUNTS[mountId] then + local hasColor = outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or + outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 + + if hasColor then + outfit.lookMountHead = 0 + outfit.lookMountBody = 0 + outfit.lookMountLegs = 0 + outfit.lookMountFeet = 0 + player:setOutfit(outfit) + end + end + end + return true +end + +mountColorFix:interval(250) +mountColorFix:register() \ No newline at end of file From e44c704c563c759b6ce43d2e5c35b86e87a1d682 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Sun, 12 Jul 2026 07:42:03 +0000 Subject: [PATCH 2/4] Lua code format - (Stylua) --- .../player/otc_mount_color_fix.lua | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua index e8950fde3..1194ab1ba 100644 --- a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua +++ b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua @@ -1,36 +1,35 @@ local BROKEN_MOUNTS = { -- add future incoming color mounts in the future until otcr can handle it - [1363] = true, - [1430] = true, - [1599] = true, - [1724] = true, - [1826] = true, - [1827] = true, - [1810] = true, - [1866] = true, + [1363] = true, + [1430] = true, + [1599] = true, + [1724] = true, + [1826] = true, + [1827] = true, + [1810] = true, + [1866] = true, } local mountColorFix = GlobalEvent("MountColorFix") function mountColorFix.onThink(interval) - for _, player in ipairs(Game.getPlayers()) do - local outfit = player:getOutfit() - local mountId = outfit.lookMount + for _, player in ipairs(Game.getPlayers()) do + local outfit = player:getOutfit() + local mountId = outfit.lookMount - if mountId and mountId > 0 and BROKEN_MOUNTS[mountId] then - local hasColor = outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or - outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 + if mountId and mountId > 0 and BROKEN_MOUNTS[mountId] then + local hasColor = outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 - if hasColor then - outfit.lookMountHead = 0 - outfit.lookMountBody = 0 - outfit.lookMountLegs = 0 - outfit.lookMountFeet = 0 - player:setOutfit(outfit) - end - end - end - return true + if hasColor then + outfit.lookMountHead = 0 + outfit.lookMountBody = 0 + outfit.lookMountLegs = 0 + outfit.lookMountFeet = 0 + player:setOutfit(outfit) + end + end + end + return true end mountColorFix:interval(250) -mountColorFix:register() \ No newline at end of file +mountColorFix:register() From b8cc610cd57a2e9b5c72369c86bfb8ec71eb355f Mon Sep 17 00:00:00 2001 From: Paco Date: Sun, 12 Jul 2026 01:43:24 -0600 Subject: [PATCH 3/4] Update otc_mount_color_fix.lua --- .../player/otc_mount_color_fix.lua | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua index e8950fde3..1194ab1ba 100644 --- a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua +++ b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua @@ -1,36 +1,35 @@ local BROKEN_MOUNTS = { -- add future incoming color mounts in the future until otcr can handle it - [1363] = true, - [1430] = true, - [1599] = true, - [1724] = true, - [1826] = true, - [1827] = true, - [1810] = true, - [1866] = true, + [1363] = true, + [1430] = true, + [1599] = true, + [1724] = true, + [1826] = true, + [1827] = true, + [1810] = true, + [1866] = true, } local mountColorFix = GlobalEvent("MountColorFix") function mountColorFix.onThink(interval) - for _, player in ipairs(Game.getPlayers()) do - local outfit = player:getOutfit() - local mountId = outfit.lookMount + for _, player in ipairs(Game.getPlayers()) do + local outfit = player:getOutfit() + local mountId = outfit.lookMount - if mountId and mountId > 0 and BROKEN_MOUNTS[mountId] then - local hasColor = outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or - outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 + if mountId and mountId > 0 and BROKEN_MOUNTS[mountId] then + local hasColor = outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 - if hasColor then - outfit.lookMountHead = 0 - outfit.lookMountBody = 0 - outfit.lookMountLegs = 0 - outfit.lookMountFeet = 0 - player:setOutfit(outfit) - end - end - end - return true + if hasColor then + outfit.lookMountHead = 0 + outfit.lookMountBody = 0 + outfit.lookMountLegs = 0 + outfit.lookMountFeet = 0 + player:setOutfit(outfit) + end + end + end + return true end mountColorFix:interval(250) -mountColorFix:register() \ No newline at end of file +mountColorFix:register() From 0873616fe4a00f6606d5b7d69d02237496a3b4c3 Mon Sep 17 00:00:00 2001 From: Paco Date: Tue, 14 Jul 2026 21:04:59 -0600 Subject: [PATCH 4/4] fix: onThink Updated with less punishment to your server --- data/scripts/creaturescripts/player/login.lua | 1 + .../player/otc_mount_color_fix.lua | 36 +++++++++---------- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/data/scripts/creaturescripts/player/login.lua b/data/scripts/creaturescripts/player/login.lua index 1e92dc203..c2bfedfa2 100644 --- a/data/scripts/creaturescripts/player/login.lua +++ b/data/scripts/creaturescripts/player/login.lua @@ -189,6 +189,7 @@ function playerLoginGlobal.onLogin(player) player:saveLoginLog() player:initializeLoyaltySystem() + player:registerEvent("StripBrokenMountColorThink") player:registerEvent("Castlemania") player:registerEvent("PartyProtection") player:registerEvent("PlayerDeath") diff --git a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua index 1194ab1ba..bb3f072bb 100644 --- a/data/scripts/creaturescripts/player/otc_mount_color_fix.lua +++ b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua @@ -9,27 +9,23 @@ local BROKEN_MOUNTS = { -- add future incoming color mounts in the future until [1866] = true, } -local mountColorFix = GlobalEvent("MountColorFix") - -function mountColorFix.onThink(interval) - for _, player in ipairs(Game.getPlayers()) do - local outfit = player:getOutfit() - local mountId = outfit.lookMount - - if mountId and mountId > 0 and BROKEN_MOUNTS[mountId] then - local hasColor = outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 - - if hasColor then - outfit.lookMountHead = 0 - outfit.lookMountBody = 0 - outfit.lookMountLegs = 0 - outfit.lookMountFeet = 0 - player:setOutfit(outfit) - end +local function sanitizeMountColor(player) + local outfit = player:getOutfit() + if outfit.lookMount and outfit.lookMount > 0 and BROKEN_MOUNTS[outfit.lookMount] then + if outfit.lookMountHead > 0 or outfit.lookMountBody > 0 or outfit.lookMountLegs > 0 or outfit.lookMountFeet > 0 then + outfit.lookMountHead = 0 + outfit.lookMountBody = 0 + outfit.lookMountLegs = 0 + outfit.lookMountFeet = 0 + player:setOutfit(outfit) end end - return true end -mountColorFix:interval(250) -mountColorFix:register() +local think = CreatureEvent("StripBrokenMountColorThink") +function think.onThink(player, interval) + sanitizeMountColor(player) + return true +end +think:type("think") +think:register()