-- Torrent local modelNeedsUpdate = false function SetTorrentModel(model) local modelName = GetParamValue(PARAM.NpcParam.MODEL_REPLACE, 80000000) if modelName == model then return elseif modelName == -1 and model == 8000 then modelNeedsUpdate = false else modelNeedsUpdate = true end SetParamValue(PARAM.NpcParam.MODEL_REPLACE, 80000000, model) SetParamValue(PARAM.NpcParam.ANIM_REPLACE, 80000000, model) SetParamValue(PARAM.NpcParam.RESOURCE_ID, 80000000, model) SetParamValue(PARAM.NpcParam.TEXTURE_ID, 80000000, model) end function MountChangeLib() if g_FrameCount < 10 then return end local saveIndex = GetPointerValue(GAME_BASE.GAME_MAN.CHR_SAVE_INDEX) local modelNeedsUpdate2 = GetParamValue(PARAM.NpcParam.SLEEPCOLLECTID, 80000000) ~= saveIndex if env(GetEventFlag, "1099002202") == FALSE and not modelNeedsUpdate2 then return end if env(GetEventFlag, "63200") == TRUE then -- Torrent SwitchTorrentWhisle(130) SetTorrentModel(8000) modelNeedsUpdate2 = false elseif env(GetEventFlag, "63201") == TRUE then -- Nights Cav SwitchTorrentWhisle(140) SetTorrentModel(8001) elseif env(GetEventFlag, "63202") == TRUE then -- Tree Sentinel SwitchTorrentWhisle(141) SetTorrentModel(8002) elseif env(GetEventFlag, "63203") == TRUE then -- Donkey SwitchTorrentWhisle(142) SetTorrentModel(8003) elseif env(GetEventFlag, "63204") == TRUE then -- Loretta's SwitchTorrentWhisle(143) SetTorrentModel(8004) elseif modelNeedsUpdate2 then -- Default SwitchTorrentWhisle(130) SetTorrentModel(8000) modelNeedsUpdate2 = false end SetParamValue(PARAM.NpcParam.SLEEPCOLLECTID, 80000000, saveIndex) if (modelNeedsUpdate or modelNeedsUpdate2) and env(GetEventFlag, "1099002202") == FALSE then act(SetEventFlag, "1099002203", TRUE) end act(SetEventFlag, "1099002202", FALSE) end local torrentWhissles = { 130, -- Torrent 140, -- Nights Cav 141, -- Tree Sentinel 142, -- Donkey 143, -- Loretta's } function SwitchTorrentWhisle(id) for i = 1, #torrentWhissles, 1 do if torrentWhissles[i] ~= id then act(ESD_ReplaceTool, torrentWhissles[i], id) end end end -- Spirit Summons function SummonActive_SpEffect() if GetPointerValue(GAME_BASE.CS_FE_MAN.CS_FE_SPIRIT_ASH_DISPLAY.SPIRIT_SUMMON_DISPLAY_COUNT) > 0 then act(AddSpEffect, 100875) elseif env(GetSpEffectID, 100875) == TRUE then act(ClearSpEffect, 100875) end end