local wingOffsets = { [3099] = { [North] = { x = 15, y = 17 }, [East] = { x = 15, y = 17 }, [South] = { x = 15, y = 17 }, [West] = { x = 15, y = 17 }, }, [3100] = { [North] = { x = 15, y = 10 }, [East] = { x = 15, y = 10 }, [South] = { x = 15, y = 10 }, [West] = { x = 15, y = 10 }, }, [3101] = { [North] = { x = 15, y = 17 }, [East] = { x = 15, y = 17 }, [South] = { x = 15, y = 17 }, [West] = { x = 15, y = 17 }, }, [3102] = { [North] = { x = 15, y = 17 }, [East] = { x = 15, y = 17 }, [South] = { x = 15, y = 17 }, [West] = { x = 15, y = 17 }, }, [3103] = { [North] = { x = 15, y = 17 }, [East] = { x = 15, y = 17 }, [South] = { x = 15, y = 17 }, [West] = { x = 15, y = 17 }, }, [3104] = { [North] = { x = 15, y = 12 }, [East] = { x = 15, y = 12 }, [South] = { x = 15, y = 12 }, [West] = { x = 15, y = 12 }, }, [3105] = { [North] = { x = 15, y = 12 }, [East] = { x = 15, y = 12 }, [South] = { x = 15, y = 12 }, [West] = { x = 15, y = 12 }, }, [3106] = { [North] = { x = 15, y = 16 }, [East] = { x = 15, y = 16 }, [South] = { x = 15, y = 16 }, [West] = { x = 15, y = 16 }, }, [3107] = { [North] = { x = 15, y = 14 }, [East] = { x = 15, y = 14 }, [South] = { x = 15, y = 14 }, [West] = { x = 15, y = 14 }, }, [3108] = { [North] = { x = 15, y = 10 }, [East] = { x = 15, y = 10 }, [South] = { x = 15, y = 10 }, [West] = { x = 15, y = 10 }, }, [3110] = { [North] = { x = 50, y = 20 }, [East] = { x = 50, y = 20 }, [South] = { x = 50, y = 20 }, [West] = { x = 50, y = 20 }, }, [3109] = { [North] = { x = 18, y = 17 }, [East] = { x = 18, y = 17 }, [South] = { x = 18, y = 17 }, [West] = { x = 18, y = 17 }, }, [3111] = { [North] = { x = 48, y = 26 }, [East] = { x = 48, y = 26 }, [South] = { x = 48, y = 26 }, [West] = { x = 48, y = 26 }, }, [3112] = { [North] = { x = 28, y = 17 }, [East] = { x = 28, y = 17 }, [South] = { x = 28, y = 17 }, [West] = { x = 28, y = 17 }, }, [3113] = { [North] = { x = 15, y = 17 }, [East] = { x = 15, y = 17 }, [South] = { x = 15, y = 17 }, [West] = { x = 15, y = 17 }, }, [3114] = { [North] = { x = 30, y = 20 }, [East] = { x = 30, y = 20 }, [South] = { x = 30, y = 20 }, [West] = { x = 30, y = 20 }, }, [3117] = { [North] = { x = 32, y = 20 }, [East] = { x = 32, y = 20 }, [South] = { x = 32, y = 20 }, [West] = { x = 32, y = 20 }, }, [3115] = { [North] = { x = 30, y = 20 }, [East] = { x = 30, y = 20 }, [South] = { x = 30, y = 20 }, [West] = { x = 30, y = 20 }, }, [3118] = { [North] = { x = 30, y = 20 }, [East] = { x = 30, y = 20 }, [South] = { x = 30, y = 20 }, [West] = { x = 30, y = 20 }, }, [3119] = { [North] = { x = 30, y = 20 }, [East] = { x = 30, y = 20 }, [South] = { x = 30, y = 20 }, [West] = { x = 30, y = 20 }, }, [2229] = { [North] = { x = 30, y = 20 }, [East] = { x = 30, y = 20 }, [South] = { x = 30, y = 20 }, [West] = { x = 30, y = 20 }, }, [3140] = { [North] = { x = 30, y = 12 }, [East] = { x = 30, y = 12 }, [South] = { x = 30, y = 12 }, [West] = { x = 30, y = 12 }, }, [3152] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3166] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3167] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3169] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3170] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3171] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3172] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3173] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3174] = { [North] = { x = 18, y = 16 }, [East] = { x = 18, y = 16 }, [South] = { x = 18, y = 16 }, [West] = { x = 18, y = 16 }, }, [3139] = { [North] = { x = 29, y = 16 }, [East] = { x = 29, y = 16 }, [South] = { x = 29, y = 16 }, [West] = { x = 29, y = 16 }, }, [3175] = { [North] = { x = 29, y = 16 }, [East] = { x = 29, y = 16 }, [South] = { x = 29, y = 16 }, [West] = { x = 29, y = 16 }, }, [3176] = { [North] = { x = 29, y = 16 }, [East] = { x = 29, y = 16 }, [South] = { x = 29, y = 16 }, [West] = { x = 29, y = 16 }, }, [3177] = { [North] = { x = 29, y = 16 }, [East] = { x = 29, y = 16 }, [South] = { x = 29, y = 16 }, [West] = { x = 29, y = 16 }, }, [3178] = { [North] = { x = 29, y = 16 }, [East] = { x = 29, y = 16 }, [South] = { x = 29, y = 16 }, [West] = { x = 29, y = 16 }, }, [3179] = { [North] = { x = 29, y = 16 }, [East] = { x = 29, y = 16 }, [South] = { x = 29, y = 16 }, [West] = { x = 29, y = 16 }, }, } local auraOffsets = { [2223] = { -- Tipo de aura [North] = { x = 50, y = 10 }, [East] = { x = 50, y = 10 }, [South] = { x = 50, y = 5 }, [West] = { x = 20, y = 5 }, }, [3137] = { [North] = { x = 30, y = 16 }, [East] = { x = 30, y = 16 }, [South] = { x = 30, y = 16 }, [West] = { x = 30, y = 16 }, }, } local function translateDir(dir) if dir == NorthEast or dir == SouthEast then return East elseif dir == NorthWest or dir == SouthWest then return West end return dir end local function getEffectOffset(effectId, effectType, direction) local effectData = (effectType == "wings" and wingOffsets[effectId]) or (effectType == "auras" and auraOffsets[effectId]) direction = translateDir(direction) return effectData and effectData[direction] or { x = 0, y = 0 } end local function onCreatureAppear(creature) local direction = creature:getDirection() local wingOffset = getEffectOffset(creature:getWings(), "wings", direction) creature:setWingsOffset(wingOffset.x, wingOffset.y) -- local auraOffset = getEffectOffset(creature:getAura(), "auras", direction) -- creature:setAuraOffset(auraOffset.x, auraOffset.y) end local function onCreatureDirectionChange(creature, oldDirection, newDirection) local wingOffset = getEffectOffset(creature:getWings(), "wings", newDirection) creature:setWingsOffset(wingOffset.x, wingOffset.y) -- local auraOffset = getEffectOffset(creature:getAura(), "auras", newDirection) -- creature:setAuraOffset(auraOffset.x, auraOffset.y) end local function onCreatureOutfitChange(creature, newOutfit, oldOutfit) local direction = creature:getDirection() local wingOffset = getEffectOffset(creature:getWings(), "wings", direction) creature:setWingsOffset(wingOffset.x, wingOffset.y) -- local auraOffset = getEffectOffset(creature:getAura(), "auras", direction) -- creature:setAuraOffset(auraOffset.x, auraOffset.y) end function init() connect(LocalPlayer, { onOutfitChange = onCreatureOutfitChange }) connect(Creature, { onAppear = onCreatureAppear, onDirectionChange = onCreatureDirectionChange, onOutfitChange = onCreatureOutfitChange }) end function terminate() disconnect(LocalPlayer, { onOutfitChange = onCreatureOutfitChange }) disconnect(Creature, { onAppear = onCreatureAppear, onDirectionChange = onCreatureDirectionChange, onOutfitChange = onCreatureOutfitChange }) end