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 new file mode 100644 index 000000000..bb3f072bb --- /dev/null +++ b/data/scripts/creaturescripts/player/otc_mount_color_fix.lua @@ -0,0 +1,31 @@ +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 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 +end + +local think = CreatureEvent("StripBrokenMountColorThink") +function think.onThink(player, interval) + sanitizeMountColor(player) + return true +end +think:type("think") +think:register()