landsandboat/scripts/effects/mounted.lua

53 lines
1.3 KiB
Lua
Raw Permalink Normal View History

2021-01-18 12:48:07 -05:00
-----------------------------------
2021-04-01 15:10:15 -04:00
-- xi.effect.MOUNTED
2021-01-18 12:48:07 -05:00
-----------------------------------
---@type TEffect
local effectObject = {}
local attohwaChasmGlobal = require('scripts/zones/Attohwa_Chasm/globals')
effectObject.onEffectGain = function(target, effect)
local mountId = effect:getPower()
-- Retail sends a music change packet (packet ID 0x5F) in both cases.
2018-03-14 18:07:45 -04:00
local animation = xi.animation.NONE
if
mountId == xi.mount.CHOCOBO or
mountId == xi.mount.NOBLE_CHOCOBO
then
target:changeMusic(4, 212)
2026-07-21 22:46:11 -06:00
animation = xi.animation.CHOCOBO
else
target:changeMusic(4, 84)
2026-07-21 22:46:11 -06:00
animation = xi.animation.MOUNT
end
if not target:isInEvent() then
target:setAnimation(animation)
end
2025-11-11 22:59:31 -07:00
-- Chocobo and mounts uncharm current pet
local pet = target:getPet()
if pet ~= nil and pet:isCharmed() then
target:despawnPet()
end
attohwaChasmGlobal.removeMimeoKIs(target)
end
2016-01-16 01:26:33 -05:00
effectObject.onEffectTick = function(target, effect)
end
2016-01-16 01:26:33 -05:00
effectObject.onEffectLose = function(target, effect)
if not target:isInEvent() then -- Paranoia safety check
2026-07-21 22:46:11 -06:00
target:setAnimation(xi.animation.NONE)
end
2025-01-08 12:37:59 -07:00
-- Remove CharVars from player participating in chocobo riding game
if target:isPC() then
xi.chocoboGame.dismountChoco(target)
end
end
return effectObject