------------------------------------------ -- Version 17 (For ER HKS last updated in 1.16.1) ------------------------------------------ EnableDebugLogger = false ------------------------------------------ -- Importing Convergence Modules ------------------------------------------ local script_dir = debug.getinfo(1, "S").source:sub(2):match("(.*/)"):gsub("/", "\\") .. "modules\\" function LoadFile(path) if path == nil then return end local success, err = pcall(function() return dofile(script_dir .. path) end) if not success then act(10001, "Failed to import module: " .. path .. "\nError: " .. err) end end function LoadFileArray(path_array) if path_array == nil then return end for i = 1, #path_array, 1 do LoadFile(path_array[i]) end end LoadFile("vanilla\\ActDictionary.hks") LoadFile("vanilla\\EnvDictionary.hks") ImportModules() local basic_modules = { -- 5 "vanilla\\CommonIncludes.hks", "vanilla\\Globals.hks", "exposer\\ExposerVariables.hks", "exposer\\ChrInsPointers.hks", "convergence\\EnemyInfo.hks", } local addative_modules = { -- 27 "vanilla\\CMSGLibrary.hks", "exposer\\GameBasePointers.hks", "exposer\\ParamPointers.hks", "convergence\\Diversions.hks", "convergence\\Math.hks", "convergence\\Multiplayer.hks", "convergence\\OS.hks", "convergence\\Utility.hks", "convergence\\Status.hks", "convergence\\Animations.hks", "convergence\\Position.hks", "convergence\\ChrModelDictionary.hks", "convergence\\SpEffects.hks", "convergence\\equipment\\WeaponsGeneric.hks", "convergence\\equipment\\WeaponsUnique.hks", "convergence\\classes\\BloodInitiate.hks", "convergence\\classes\\FlameProphet.hks", "convergence\\classes\\FrenziedZealot.hks", "convergence\\classes\\GodskinCelebrant.hks", "convergence\\classes\\Mystic.hks", "convergence\\classes\\Necromancer.hks", "convergence\\classes\\NoxOracle.hks", "convergence\\classes\\ServantOfRot.hks", "convergence\\classes\\BestialDevout.hks", "convergence\\classes\\Marksman.hks", "convergence\\classes\\FrostWitch.hks", } -- In the case of the local player these modules have to be loaded later local addative_modules_delayed = { -- 1 "convergence\\equipment\\Spells.hks", -- After spell Dictionaries } -- Must be loaded last to avoid errors local final_modules = { -- 1 "convergence\\Update.hks", } local bannedNpcParams = { 0, -- None 1000000, -- Buddystone 10000000, -- Bonfire 10003000, -- Talk Dummy } local modulesLoaded = false local delayedModulesLoaded = false local modulesAmountLoaded = 0 function ImportModules() if modulesLoaded then return end local isNPC = env(IsCOMPlayer) == TRUE if isNPC then if #basic_modules > modulesAmountLoaded then modulesAmountLoaded = modulesAmountLoaded + 1 LoadFile(basic_modules[modulesAmountLoaded]) if #basic_modules == modulesAmountLoaded then return end modulesAmountLoaded = modulesAmountLoaded + 1 LoadFile(basic_modules[modulesAmountLoaded]) return end if bannedNpcParams[GetNpcParamId()] then modulesLoaded = true bannedNpcParams = nil basic_modules = nil addative_modules = nil addative_modules_delayed = nil final_modules = nil return end if #addative_modules + #basic_modules > modulesAmountLoaded then modulesAmountLoaded = modulesAmountLoaded + 1 LoadFile(addative_modules[modulesAmountLoaded - #basic_modules]) if #addative_modules == modulesAmountLoaded - #basic_modules then return end modulesAmountLoaded = modulesAmountLoaded + 1 LoadFile(addative_modules[modulesAmountLoaded - #basic_modules]) return end if not delayedModulesLoaded then LoadFileArray(addative_modules_delayed) delayedModulesLoaded = true return end LoadFileArray(final_modules) modulesLoaded = true bannedNpcParams = nil basic_modules = nil addative_modules = nil addative_modules_delayed = nil final_modules = nil return end local player_only_modules = { -- 7 "convergence\\LogicModification.hks", -- Unsure about this one "convergence\\equipment\\EquipmentGeneric.hks", "convergence\\classes\\AberrantHeretic.hks", "convergence\\classes\\DragonCultist.hks", "convergence\\classes\\Dreadnought.hks", "convergence\\classes\\Rogue.hks", "convergence\\classes\\Sellsword.hks", } LoadFileArray(basic_modules) LoadFileArray(addative_modules) LoadFileArray(player_only_modules) if IsLocalPlayer() then local local_player_only_modules = { -- 16 "convergence\\Buddies.hks", "convergence\\LoadingScreens.hks", "convergence\\Bullets.hks", "convergence\\Settings.hks", "convergence\\Stats.hks", --"convergence\\Minions.hks", "convergence\\equipment\\Inventory.hks", "convergence\\equipment\\Consumables.hks", "convergence\\equipment\\SorceryDictionary.hks", "convergence\\equipment\\IncantationDictionary.hks", "convergence\\equipment\\Talismans.hks", "convergence\\classes\\Fundamentalist.hks", "convergence\\classes\\GlintstoneSorcerer.hks", "convergence\\classes\\Prisoner.hks", "convergence\\classes\\Retainer.hks", "convergence\\classes\\Stormcaller.hks", "convergence\\classes\\Volcanist.hks", } LoadFileArray(local_player_only_modules) end LoadFileArray(addative_modules_delayed) LoadFileArray(final_modules) modulesLoaded = true basic_modules = nil addative_modules = nil addative_modules_delayed = nil final_modules = nil end ------------------------------------------ -- Core: Functions ------------------------------------------ function ExecEvent(state) ResetRequest() hkbFireEvent(state) end function ExecEventSync(state) ResetRequest() act(PlayEventSync, state) end function ExecEventNoReset(state) hkbFireEvent(state) end function ExecEventSyncNoReset(state) act(PlayEventSync, state) end function ExecEvents(...) local buff = {...} for i = 1, #buff, 1 do ExecEvent(buff[i]) end end function GetVariable(variable) return hkbGetVariable(variable) end function ExecEventHalfBlend(event_table, blend_type) if blend_type == ALLBODY then SetVariable("MoveSpeedLevelReal", 0) local lower_event = event_table[1] local upper_event = lower_event .. "_Upper" ExecEvents(lower_event, upper_event) for i = 2, #event_table, 1 do SetVariable("LowerDefaultState0" .. i - 2, event_table[i]) SetVariable("UpperDefaultState0" .. i - 2, event_table[i]) end elseif blend_type == LOWER then ExecEvent(event_table[1]) for i = 2, #event_table, 1 do SetVariable("LowerDefaultState0" .. i - 2, event_table[i]) end elseif blend_type == UPPER then ExecEvent(event_table[1] .. "_Upper") for i = 2, #event_table, 1 do SetVariable("UpperDefaultState0" .. i - 2, event_table[i]) end end end function ExecEventHalfBlendNoReset(event_table, blend_type) if blend_type == ALLBODY then local lower_event = event_table[1] local upper_event = lower_event .. "_Upper" ExecEventNoReset(lower_event) ExecEventNoReset(upper_event) for i = 2, #event_table, 1 do SetVariable("LowerDefaultState0" .. i - 2, event_table[i]) SetVariable("UpperDefaultState0" .. i - 2, event_table[i]) end elseif blend_type == LOWER then ExecEventNoReset(event_table[1]) for i = 2, #event_table, 1 do SetVariable("LowerDefaultState0" .. i - 2, event_table[i]) end elseif blend_type == UPPER then ExecEventNoReset(event_table[1] .. "_Upper") for i = 2, #event_table, 1 do SetVariable("UpperDefaultState0" .. i - 2, event_table[i]) end end end function ExecEventAllBody(event) SetVariable("MoveSpeedLevelReal", 0) ExecEvent(event) end function IsNodeActive(...) local buff = {...} for i = 1, #buff, 1 do if hkbIsNodeActive(buff[i]) then return TRUE end end return FALSE end function ResetEventState() SetVariable("MoveSpeedLevelReal", 0) ResetRequest() end function ResetMimicry() act(AddSpEffect, 503041) end function SetEnableMimicry() g_EnableMimicry = TRUE end function SetWeightIndex() local weight = math.mod(env(GetMoveAnimParamID), 20) if weight == WEIGHT_LIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_LIGHT) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_LIGHT) elseif weight == WEIGHT_NORMAL then SetVariable("MoveWeightIndex", MOVE_WEIGHT_NORMAL) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_MEDIUM) elseif weight == WEIGHT_HEAVY then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) elseif weight == WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_OVERWEIGHT) elseif weight == WEIGHT_SUPERLIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_SUPERLIGHT) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_SUPERLIGHT) else SetVariable("MoveWeightIndex", 0) end if env(GetSpEffectID, 4100) == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) elseif ShouldDoSlowEffect() == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) end end function SetAIActionState() act(SetAIAttackState, env(GetNpcAIAttackRequestIDAfterBlend)) end function SetAttackHand(hand) act(WeaponParameterReference, hand) end function SetGuardHand(hand) act(SetThrowPossibilityState_Attacker, hand) end function SetEnableAimMode() if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return end local style = c_Style local isRide = env(IsOnMount) if isRide == TRUE then if style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_CROSSBOW) == TRUE then act(SetIsPreciseShootingPossible) end elseif GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_CROSSBOW) == TRUE then act(SetIsPreciseShootingPossible) end elseif style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) == TRUE then act(SetIsPreciseShootingPossible) end elseif style == HAND_RIGHT_BOTH and GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) == TRUE then act(SetIsPreciseShootingPossible) end end function Replanning() act(DoAIReplanningAtCancelTiming) end function AddStamina(num) act(SetStaminaRecoveryDisabled) act(ChangeStamina, num) end function GetLocomotionState() local state = GetVariable("LowerDefaultState00") if state == MOVE_DEF0 or state == STEALTHMOVE_DEF0 then if env(GetSpEffectID, 100000) == TRUE then return PLAYER_STATE_MOVE elseif env(GetSpEffectID, 100001) == TRUE then return PLAYER_STATE_MOVE elseif env(GetSpEffectID, 100002) == TRUE then return PLAYER_STATE_MOVE end end return PLAYER_STATE_IDLE end function SetInterruptType(num) act(AINotifyAttackType, num) end function SetTurnSpeed(turn_speed) act(SetTurnSpeed, turn_speed) end function SetRollingTurnCondition(is_selftrans) local rolling_angle = "RollingAngleReal" if is_selftrans == TRUE then rolling_angle = "RollingAngleRealSelftrans" end if GetVariable("IsLockon") == true then local angle = GetVariable("TurnAngleReal") if angle > 180 then SetTurnSpeed(0) elseif angle > 90 then SetTurnSpeed(360) end elseif env(IsPrecisionShoot) == TRUE then SetTurnSpeed(0) SetVariable("TurnAngleReal", 300) elseif math.abs(GetVariable(rolling_angle)) > 0.001 then SetTurnSpeed(0) elseif GetVariable("TurnAngleReal") > 200 then SetTurnSpeed(0) end end function IsLowerQuickTurn() if GetVariable("LowerDefaultState00") == QUICKTURN_DEF0 and env(GetSpEffectID, 100010) == TRUE then return TRUE end return FALSE end function IsLowerBackStep() if GetVariable("LowerDefaultState00") == BACKSTEP_DEF0 then return TRUE end return FALSE end function IsDualBladeSpecific(hand) if hand == HAND_LEFT then return env(IsTwinSwords, 0) else return env(IsTwinSwords, 1) end end function GetEquipType(hand, ...) local buff = {...} local kind = {} local num = 1 if hand == HAND_BOTH then kind[1] = env(GetEquipWeaponCategory, HAND_LEFT) kind[2] = env(GetEquipWeaponCategory, HAND_RIGHT) num = 2 else kind[1] = env(GetEquipWeaponCategory, hand) end for i = 1, num, 1 do for j = 1, #buff, 1 do if kind[i] == buff[j] then return TRUE end end end return FALSE end function GetEquipTypeHandStyle(arg) if c_Style == HAND_LEFT_BOTH then local kind = env(GetEquipWeaponCategory, HAND_LEFT) return kind else local kind = env(GetEquipWeaponCategory, HAND_RIGHT) return kind end end function IsHandStyleBoth(arg) if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then return TRUE end return FALSE end function SetVariable(name, value) act(SetHavokVariable, name, value) end function IsWeaponCanGuard() local style = c_Style local kind = 0 local pos = 0 if style == HAND_RIGHT then kind = env(GetEquipWeaponCategory, HAND_LEFT) pos = 2 elseif style == HAND_LEFT_BOTH then kind = env(GetEquipWeaponCategory, HAND_LEFT) pos = 3 else kind = env(GetEquipWeaponCategory, HAND_RIGHT) pos = 3 end for i = 1, #WeaponCategoryID, 1 do if WeaponCategoryID[i][1] == kind then local canguard = WeaponCategoryID[i][pos] return canguard end end end function IsEnableGuard() local style = c_Style local hand = HAND_LEFT if style == HAND_RIGHT_BOTH then hand = HAND_RIGHT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if style == HAND_RIGHT and GetEquipType(hand, WEAPON_CATEGORY_STAFF) == TRUE then return FALSE end if (sp_kind == 249 or sp_kind == 748 or sp_kind == 107 or sp_kind == 943) and (style == HAND_LEFT_BOTH or style == HAND_RIGHT_BOTH) then -- Dragonkin twinblade/Fingerslayer return FALSE end if IsWeaponCanGuard() == FALSE then return FALSE end if IsEnableDualWielding() ~= -1 then return FALSE end return TRUE end function ExecGuard(event, blend_type) if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return FALSE end if c_IsStealth == TRUE then blend_type = ALLBODY end if env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) > 0 then if env(GetStamina) <= 0 then return FALSE end if IsEnableGuard() == TRUE then local style = c_Style local hand = HAND_LEFT if style == HAND_RIGHT_BOTH then hand = HAND_RIGHT end local kind = env(GetEquipWeaponCategory, hand) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) local guardindex = env(GetGuardMotionCategory, hand) if kind == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = GUARD_STYLE_DUELINGSHIELD end -- Set Torch Color if kind == WEAPON_CATEGORY_TORCH and style == HAND_RIGHT then guardindex = GUARD_STYLE_TORCH if sp_kind == 291 then SetVariable("IndexTorchColor", 1) -- Ghostflame Torch elseif sp_kind == 292 then SetVariable("IndexTorchColor", 2) -- St. Trina's Torch elseif sp_kind == 288 then SetVariable("IndexTorchColor", 3) -- Nanaya's Torch else SetVariable("IndexTorchColor", 0) -- Torch end elseif sp_kind == 240 and style == HAND_RIGHT then guardindex = GUARD_STYLE_TORCH elseif style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then if env(GetStayAnimCategory) ~= 15 and env(GetStayAnimCategory) ~= 0 and env(GetStayAnimCategory) ~= 2 and env(GetStayAnimCategory) ~= 3 then guardindex = GUARD_STYLE_DEFAULT end if kind == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = GUARD_STYLE_DUELINGSHIELD end end if env(GetSpEffectID, 172) == TRUE then SetVariable("GuardStartType", 1) else SetVariable("GuardStartType", 0) end SetVariable("IndexGuardStyle", guardindex) if blend_type == ALLBODY and MoveStart(LOWER, Event_MoveLong, FALSE) == TRUE then blend_type = UPPER end if DeflectActive() == TRUE and event ~= Event_GuardOn then local is_after_additive_just_guard = FALSE if env(GetSpEffectID, 102020) == TRUE or env(GetSpEffectID, 102022) == TRUE then is_after_additive_just_guard = TRUE end if env(GetSpEffectID, 102002) == TRUE and is_after_additive_just_guard == FALSE then event = Event_GuardStart_JustGuard2 elseif env(GetSpEffectID, 102003) == TRUE and is_after_additive_just_guard == FALSE then event = Event_GuardStart_JustGuard3 elseif env(GetSpEffectID, 102004) == TRUE and is_after_additive_just_guard == FALSE then if IsNodeActive("GuardStart_JustGuard4_Upper Selector") == TRUE then event = Event_GuardStart_JustGuard4_SelfTrans else event = Event_GuardStart_JustGuard4 end elseif event ~= Event_GuardStart then elseif IsNodeActive("GuardStart_JustGuard_Upper Selector") == TRUE then event = Event_GuardStart_JustGuard_SelfTrans else event = Event_GuardStart_JustGuard end end act(AddSpEffect, 102021) ExecEventHalfBlend(event, blend_type) return TRUE end end return FALSE end function ResetRequest() act(ResetInputQueue) end function CheckActionRequest() return env(HasActionRequest) end function ExecStop() -- 100200 "[HKS] Gesture Anim" if GetVariable("MoveSpeedLevel") > 0 and env(GetSpEffectID, 100200) == FALSE then return FALSE end local stop_speed = GetVariable("MoveSpeedLevelReal") local movedirection = GetVariable("MoveDirection") local stop_speed_threshold = 0.35 SetVariable("ToggleDash", 0) SetWeightIndex() if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT and stop_speed > 0.35 then stop_speed = stop_speed_threshold end if stop_speed >= 0 and stop_speed <= 1 then if stop_speed <= stop_speed_threshold then if c_IsStealth == TRUE then ExecEventAllBody("W_Stealth_Idle") else ExecEventAllBody("W_Idle") end elseif c_IsStealth == TRUE then if movedirection == 0 then ExecEventAllBody("W_StealthRunStopFront") elseif movedirection == 1 then ExecEventAllBody("W_StealthRunStopBack") elseif movedirection == 2 then ExecEventAllBody("W_StealthRunStopLeft") elseif movedirection == 3 then ExecEventAllBody("W_StealthRunStopRight") end elseif movedirection == 0 then ExecEventAllBody("W_RunStopFront") elseif movedirection == 1 then ExecEventAllBody("W_RunStopBack") elseif movedirection == 2 then ExecEventAllBody("W_RunStopLeft") elseif movedirection == 3 then ExecEventAllBody("W_RunStopRight") end elseif stop_speed > 1 then if c_IsStealth == TRUE then ExecEventAllBody("W_StealthDashStop") else ExecEventAllBody("W_DashStop") end elseif c_IsStealth == TRUE then ExecEventAllBody("W_Stealth_Idle") else ExecEventAllBody("W_Idle") end return TRUE end function ExecStopHalfBlend(event, to_idle) -- 100200 "[HKS] Gesture Anim" if GetVariable("MoveSpeedLevel") > 0 and env(GetSpEffectID, 100200) == FALSE then return FALSE end SetVariable("LocomotionState", 0) if to_idle == TRUE then ExecEventNoReset("W_Idle") return TRUE end ExecEventHalfBlendNoReset(event, LOWER) return TRUE end function MoveStart(blend_type, event, gen_hand) -- 100200 "[HKS] Gesture Anim" if GetVariable("MoveSpeedLevel") <= 0 then return FALSE end if env(GetSpEffectID, 100200) == TRUE then return FALSE end if blend_type ~= LOWER then if gen_hand == FALSE then SetVariable("ArtsTransition", 0) else SetArtsGeneratorTransitionIndex() end end SetBonfireIndex() local stealth_state = GetVariable("StealthState") if (stealth_state == STEALTH_TO_STEALTHIDLE or stealth_state == STEALTH_TO_IDLE) and GetVariable("StealthTransitionIndex") > 0 then ExecEventHalfBlendNoReset(event, blend_type) return TRUE end if GetLocomotionState() ~= PLAYER_STATE_MOVE then SetVariable("MoveSpeedLevelReal", 0) SpeedUpdate() end ExecEventHalfBlend(event, blend_type) return TRUE end function MoveStartonCancelTiming(event, gen_hand) if env(IsMoveCancelPossible) == TRUE then if GetLocomotionState() == PLAYER_STATE_MOVE then if MoveStart(UPPER, event, gen_hand) == TRUE then return TRUE end elseif MoveStart(ALLBODY, event, gen_hand) == TRUE then return TRUE end end return FALSE end function SetBaseCategory() SetVariable("IndexBaseCategory", GetBaseCategory()) end function GetBaseCategory() -- Stay Anim is Weapon Motion Position ID local basecategoryid = 0 local index = 0 basecategoryid = env(GetStayAnimCategory) if basecategoryid == 0 then index = 0 elseif basecategoryid == 2 or basecategoryid == 12 then index = 1 elseif basecategoryid == 3 or basecategoryid == 13 then index = 2 end return index end function SetArtCancelType() if IsCasterAsh() == TRUE then act(SetArtCancelType, env(GetWeaponCancelType, HAND_LEFT)) elseif IsEnableSwordArts() == TRUE then act(SetWeaponCancelType, env(GetWeaponCancelType, c_SwordArtsHand)) else act(SetWeaponCancelType, 0) end end function GetSwordArtInfo() local style = c_Style local is_both = FALSE if style >= HAND_LEFT_BOTH then is_both = TRUE end local art_id = 0 local art_hand = 0 if is_both == TRUE then if style == HAND_RIGHT_BOTH then art_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then art_hand = HAND_LEFT end art_id = env(GetSwordArtID, art_hand) else local weaponswordartid = env(GetSwordArtID, HAND_LEFT) if IsShieldArts(weaponswordartid) == FALSE and IsArrowStanceArts(weaponswordartid) == FALSE then art_hand = HAND_RIGHT art_id = env(GetSwordArtID, HAND_RIGHT) else art_hand = HAND_LEFT art_id = weaponswordartid end end if env(GetSpEffectID, 102150) == TRUE then art_id = 0 elseif env(GetSpEffectID, 102151) == TRUE then art_id = 0 end return art_id, art_hand end function IsEnableSwordArts() -- 17 is Torch Attack local style = c_Style local arts_id = c_SwordArtsID if env(IsOnMount) == TRUE then return FALSE end if style ~= HAND_LEFT_BOTH and c_SwordArtsHand == 0 then if IsWeaponCatalyst(HAND_LEFT) == TRUE then return FALSE end if IsShieldArts(arts_id) == TRUE then return TRUE else return FALSE end else if style == HAND_RIGHT and IsWeaponCatalyst(HAND_LEFT) == TRUE then return FALSE end if arts_id ~= 17 and arts_id ~= SWORDARTS_INVALID then return TRUE end end return FALSE end function GreyOutSwordArtFE() if c_IsEnableSwordArts == FALSE then act(SetArtsPointFEDisplayState, 1) return end if c_SwordArtsID == SWORDARTS_PARRY then act(SetArtsPointFEDisplayState, 1) else act(SetArtsPointFEDisplayState, 0) end end function IsAttackSwordArts(arts_id) local aow_blacklist = { [157] = true, -- Raptor of the Mists [160] = true, -- White Shadow's Lure [330] = true -- Assassin's Feint } local aow_whitelist = { [273] = true, -- Raging Beast [276] = true, -- Blind Spot [313] = true, -- Dynastic Sickleplay [348] = true -- Discus Hurl } if env(GetSpEffectID, 391900) == FALSE then aow_blacklist[307] = true -- Dragon Lord's Recall end if IsShieldArts(arts_id) == TRUE or IsRollingArts(arts_id) == TRUE or IsEnchantArts(arts_id) == TRUE or aow_blacklist[arts_id] then if aow_whitelist[arts_id] then return TRUE else return FALSE end else return TRUE end end function IsHalfBlendArts(arts_id) local aow_list = { [20] = true, -- Spinning Weapon [34] = true, -- Guardian Spearblade [58] = true, -- Gravitas [84] = true, -- Flash of Gold [kmstr] [139] = true, -- Deflecting Ash [148] = true, -- DragonKin Twinblade [149] = true, -- Egg Mace [168] = true, -- Zamor Ice Storm [182] = true, -- Knowledge Above All [183] = true, -- Devourer of Worlds [184] = true, -- Familal Rancor [199] = true, -- Spinning Weapon [202] = true, -- Tongues of Fire [203] = true, -- Oracular Bubble [206] = true, -- Sea of Magma [213] = true, -- Soul Stifler [217] = true, -- Glintstone Dart [264] = true, -- Wall of Sparks [267] = true, -- Perfumer Mace [328] = true, -- Euporia Vortex [334] = true, -- Feeble Lord's Frenzied Flame [335] = true -- Repeating Fire } if aow_list[arts_id] then return TRUE else return FALSE end end function IsEnchantArts(arts_id) if 130 <= arts_id and arts_id <= 140 then return TRUE else return FALSE end end function IsShieldArts(arts_id) local aow_list = { --[17] = true, -- Torch Attack [71] = true, -- Firebreather [84] = true, -- Flash of Gold [kmstr] [90] = true, -- Shield Bash [91] = true, -- Barricade Shield [92] = true, -- Parry [93] = true, -- Buckler Parry [95] = true, -- Carian Retaliation [96] = true, -- Storm Wall [97] = true, -- Golden Parry [98] = true, -- Shield Crash [99] = true, -- Thops's Barrier [109] = true, -- Spell Casting [139] = true, -- Deflecting Ash [151] = true, -- Vow of the Indomitable [152] = true, -- Holy Ground [195] = true, -- Fires of Slumber [196] = true, -- Golden Retaliation [197] = true, -- Contagious Fury [201] = true, -- Flame Spit [202] = true, -- Tongues of Fire [207] = true, -- Viper Bite [211] = true, -- Bear Witness! [322] = true, -- Sleep Evermore [324] = true, -- Moore's Charge [348] = true, -- Discus Hurl [352] = true, -- Revenge of the Night [354] = true, -- Blindfold of Happiness [355] = true, -- Blindfold of Happiness (2?) [359] = true, -- Roaring Bash [399] = true, -- Shield Strike [334] = true -- Feeble Lord's Frenzied Flame } if aow_list[arts_id] then return TRUE else return FALSE end end function IsStanceArts(arts_id) local aow_list = { [10] = true, -- Wild Strikes [11] = true, -- Spinning Strikes [14] = true, -- Unsheathe [15] = true, -- Square Off [25] = true, -- Spinning Chain [26] = true, -- Halberd Stance [80] = true, -- Crucible bow Stance [81] = true, -- Unsheathe night katana [100] = true, -- Through and Through [101] = true, -- Barrage [102] = true, -- Mighty Shot [103] = true, -- Enchanted Shot [104] = true, -- Carian Bow [105] = true, -- Rain of Arrows [106] = true, -- UNUSED [107] = true, -- UNUSED [108] = true, -- Sky Shot [121] = true, -- Varre's Bouquet and Seething Flail stance [161] = true, -- Marai's Stance [169] = true, -- Radahn's Rain [178] = true, -- Transient Moonlight [219] = true, -- Night-and-Flame Stance [239] = true, -- Spinning Wheel [266] = true, -- Sword of the Cosmos [278] = true, -- Overhead Stance [279] = true, -- Wing Stance [287] = true, -- Lord of Light Stance [309] = true, -- Unending Dance [318] = true, -- Moon-and-Fire Stance [326] = true, -- Abbysal Flame Shot [335] = true, -- Repeating Fire [337] = true, -- Fan Shot [340] = true, -- UNUSED [341] = true, -- UNUSED --[343] = true, -- UNUSED --fingerslayerblade [346] = true, -- UNUSED [347] = true, -- UNUSED [357] = true, -- Igor's Drake Hunt [371] = true -- Rancor Shot } if aow_list[arts_id] then return TRUE else return FALSE end end function IsArrowStanceArts(arts_id) local aow_list = { [80] = true, -- Crucible bow Stance [100] = true, -- Through and Through [101] = true, -- Barrage [102] = true, -- Mighty Shot [103] = true, -- Enchanted Shot [104] = true, -- Carian Bow [105] = true, -- Rain of Arrows [106] = true, -- UNUSED [107] = true, -- UNUSED [108] = true, -- Sky Shot [169] = true, -- Radahn's Rain [326] = true, -- Abyssal Flame Shot [337] = true, -- Fan Shot [357] = true, -- Igor's Drake Hunt [371] = true -- Rancor Shot } if aow_list[arts_id] then return TRUE else return FALSE end end function IsAttackStanceArts(arts_id) local aow_list = { [10] = true, -- Wild Strikes [11] = true, -- Spinning Strikes [25] = true, -- Spinning Chain [121] = true, -- Varre's Bouquet and Seething Flail stance [239] = true, -- Spinning Wheel [309] = true, -- Unending Dance [340] = true, -- UNUSED [341] = true -- UNUSED } if aow_list[arts_id] then return TRUE else return FALSE end end function IsRollingArts(arts_id) local aow_list = { [78] = true, -- Straight Sword art [155] = true, -- Quickstep [156] = true, -- Bloodhound's Step [273] = true, -- Raging Beast [276] = true, -- Blind Spot [313] = true, -- Dynastic Sickleplay [344] = true, -- Conv Scadu Bow } if aow_list[arts_id] then return TRUE else return FALSE end end function IsJumpArts() if env(HasEnoughArtsPoints, ACTION_ARM_L2, c_SwordArtsHand) == FALSE then return FALSE elseif GetPointerValue(GAME_BASE.WORLD_CHR_MAN.CHR_CAM.CAMERA_TYPE) == 7 then -- Killcam return FALSE end local aow_list = { [307] = true, -- Dragon Lord's Recall } if aow_list[c_SwordArtsID] then return TRUE end return FALSE end function GetSwordArtsRequestNew() local style = c_Style local is_both = FALSE local arts_hand = c_SwordArtsHand local arts_id = c_SwordArtsID local request = SWORDART_REQUEST_INVALID local arts_category = arts_id + 600 local animID = SWORDARTS_ANIM_ID_RIGHT_NORMAL local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if IsTrickWeapon() == TRUE and TrickWeapon_CanDoTransformAttack == TRUE and env(ActionDuration, ACTION_ARM_L2) <= 0 then if arts_id == 87 and env(GetSpEffectID, 100050) == TRUE then request = SWORDARTS_REQUEST_LEFT_NORMAL animID = SWORDARTS_ANIM_ID_LEFT_NORMAL else request = SWORDARTS_REQUEST_RIGHT_COMBO_2 animID = SWORDARTS_ANIM_ID_RIGHT_COMBO_2 end else if IsStanceArts(arts_id) == TRUE or (GetWeaponID(c_SwordArtsHand, 2) == "12540000" and arts_id == 149) then -- egg mace request = SWORDARTS_REQUEST_RIGHT_STANCE animID = SWORDARTS_ANIM_ID_RIGHT_STANCE_START elseif env(GetSpEffectID, 100052) == TRUE then request = SWORDARTS_REQUEST_RIGHT_COMBO_1 animID = SWORDARTS_ANIM_ID_RIGHT_COMBO_1 elseif env(GetSpEffectID, 100053) == TRUE then request = SWORDARTS_REQUEST_RIGHT_COMBO_2 animID = SWORDARTS_ANIM_ID_RIGHT_COMBO_2 elseif IsRollingArts(arts_id) == TRUE or (arts_id == 290 and (env(GetSpEffectID, 3011) == TRUE or env(GetSpEffectID, 3013) == TRUE)) or -- Restored Maliketh BB [kmstr] (arts_id == 388 and env(GetSpEffectID, 2426) == TRUE) then --Rosary dodge and dagger request = SWORDARTS_REQUEST_RIGHT_STEP animID = SWORDARTS_ANIM_ID_RIGHT_STEP_FRONT elseif arts_hand == HAND_LEFT and (style == HAND_LEFT_BOTH or style == HAND_RIGHT_BOTH) and arts_id == 139 then -- deflecting ash request = SWORDARTS_REQUEST_RIGHT_NORMAL animID = SWORDARTS_ANIM_ID_RIGHT_NORMAL elseif (style == HAND_LEFT_BOTH or style == HAND_RIGHT_BOTH) and IsShieldArts(arts_id) == TRUE then request = SWORDARTS_REQUEST_BOTH_NORMAL animID = SWORDARTS_ANIM_ID_BOTH_NORMAL elseif arts_hand == HAND_LEFT and IsShieldArts(arts_id) == TRUE then request = SWORDARTS_REQUEST_LEFT_NORMAL animID = SWORDARTS_ANIM_ID_LEFT_NORMAL else request = SWORDARTS_REQUEST_RIGHT_NORMAL animID = SWORDARTS_ANIM_ID_RIGHT_NORMAL end end act(DebugLogOutput, "SwordArtRequest " .. request .. " artsId=" .. arts_id .. " animID=a" .. arts_category .. "_" .. animID) return request end function HasSwordArtPoint(button, hand) return env(HasEnoughArtsPoints, button, hand) end function SetSwordArtsPointInfo(button, is_point_consume, to_state_event) local aow_list_noFPUse = { [17] = true, -- Torch Attack [92] = true, -- Parry [93] = true, -- Buckler Parry [112] = true -- Kick } local hand = c_SwordArtsHand local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if is_point_consume == TRUE then act(ReserveArtsPointsUse, button, hand) end local sel = 0 local isNoMPUse = FALSE local artsID = env(GetSwordArtID, hand) if aow_list_noFPUse[artsID] then isNoMPUse = TRUE end if env(HasEnoughArtsPoints, button, hand) == FALSE and isNoMPUse == FALSE then sel = 1 act(DebugLogOutput, "no artspoint , hand=" .. hand) elseif env(IsAbilityInsufficient, hand) == TRUE and isNoMPUse == FALSE then sel = 1 act(DebugLogOutput, "no ability , hand=" .. hand) end local val = "IsEnoughArtPointsL2" if button == ACTION_ARM_R1 then if (c_SwordArtsID == 318 or c_SwordArtsID == 287 or c_SwordArtsID == 299 or artsID == 266 or c_SwordArtsID == 340) and IsNodeActive("DrawStanceRightAttackLight_Selector") == TRUE then -- conv marika hammer val = "IsEnoughArtPointsR2_MesmerSowrdArts" else val = "IsEnoughArtPointsR1" end elseif button == ACTION_ARM_R2 then val = "IsEnoughArtPointsR2" elseif button == ACTION_ARM_L2 and c_SwordArtsID == 334 and (IsNodeActive("SwordArtsOneShot Selector00") == TRUE or IsNodeActive("SwordArtsHalfOneShotShieldBoth_Upper Selector") == TRUE or IsNodeActive("SwordArtsOneShotShieldLeft Selector01") == TRUE) then val = "IsEnoughArtPointsL2_MadTorchEnd" end if c_SwordArtsID == 344 and env(IsOutOfAmmo, c_SwordArtsHand) == TRUE then -- conv scadu bow val = "IsEnoughArtPointsL2" sel = 1 end if c_SwordArtsID == 162 and env(GetSpEffectID, 2046) == TRUE then -- starcaller's Mandrill sel = 1 end if GetParamValue(PARAM.EquipParamWeapon.REQUIREMENT_ARCANE, c_WeaponSwordArts) > GetPointerValue(CHR_INS_BASE.PLAYER_GAME_DATA.ARCANE) then sel = 1 end if to_state_event ~= nil then if to_state_event == "W_SwordArtsOneShotComboEnd_2" then val = "IsEnoughArtPointsR2_2" elseif to_state_event == "W_SwordArtsOneShotComboEnd" then val = "IsEnoughArtPointsR2" end end if artsID == 309 or artsID == 318 or artsID == 287 or artsID == 299 or artsID == 266 or artsID == 340 then -- conv marika hammer SetVariable("IsEnoughArtPointsL2_DrawStanceRightStart", sel) else SetVariable("IsEnoughArtPointsL2_DrawStanceRightStart", 0) end if artsID == 318 or artsID == 287 or artsID == 299 or artsID == 266 or artsID == 340 then -- conv marika hammer SetVariable("IsEnoughArtPointsL2_DrawStanceRightEnd", sel) else SetVariable("IsEnoughArtPointsL2_DrawStanceRightEnd", 0) end if artsID == 334 then SetVariable("IsEnoughArtPointsL2_MadTorchEnd", sel) else SetVariable("IsEnoughArtPointsL2_MadTorchEnd", 0) end if artsID == 309 and IsNodeActive("DrawStanceNoSyncLoop_Upper Selector00") == TRUE then SetVariable("IsEnoughArtPointsL2_DrawStanceNoSyncLoop", sel) else SetVariable(val, sel) end end function RequestArtPointConsumption(button, hand) act(ReserveArtsPointsUse, button, hand) end function CheckIfNonGeneratorTransition() local kind_right = env(GetEquipWeaponCategory, HAND_RIGHT) local kind_left = env(GetEquipWeaponCategory, HAND_LEFT) if kind_left == WEAPON_CATEGORY_FIST then return TRUE end return FALSE end function SetArtsGeneratorTransitionIndex() if env(GetSpEffectID, 2335) == FALSE then if GetSwordArtsPutOppositeWeapon() == FALSE then SetVariable("ArtsTransition", 0) return end end local style = c_Style if style == HAND_RIGHT then if CheckIfNonGeneratorTransition() == TRUE then SetVariable("ArtsTransition", 0) return end local hand = HAND_LEFT if c_SwordArtsHand == HAND_LEFT and env(GetSwordArtID, HAND_LEFT) ~= 84 then -- flash of gold [kmstr] hand = HAND_RIGHT end if c_SwordArtsHand == HAND_LEFT and (IsTrickWeapon(HAND_RIGHT) == TRUE or IsTrickWeapon(HAND_RIGHT_BOTH)) then hand = HAND_LEFT end local changetype = GetHandChangeType(hand) if changetype == WEAPON_CHANGE_REQUEST_LEFT_WAIST then SetVariable("ArtsTransition", 1) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_BACK then SetVariable("ArtsTransition", 2) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then SetVariable("ArtsTransition", 3) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then SetVariable("ArtsTransition", 4) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then SetVariable("ArtsTransition", 5) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_BACK then SetVariable("ArtsTransition", 6) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then SetVariable("ArtsTransition", 7) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_SPEAR then SetVariable("ArtsTransition", 8) else SetVariable("ArtsTransition", 0) end else local idle_cat = env(GetStayAnimCategory) if env(GetEquipWeaponCategory, c_SwordArtsHand) == 53 or env(GetEquipWeaponCategory, c_SwordArtsHand) == 58 then if c_SwordArtsHand == HAND_RIGHT then SetVariable("ArtsTransition", 1) else SetVariable("ArtsTransition", 2) end return elseif idle_cat < 10 then SetVariable("ArtsTransition", 0) return end SetVariable("ArtsTransition", 9) end end function SetMagicGeneratorTransitionIndex() if GetMagicPutOppositeWeapon() == FALSE then SetVariable("ArtsTransition", 0) return end local style = c_Style if style == HAND_RIGHT then local hand = HAND_LEFT if g_Magichand == HAND_LEFT then hand = HAND_RIGHT end local changetype = GetHandChangeType(hand) if changetype == WEAPON_CHANGE_REQUEST_LEFT_WAIST then SetVariable("ArtsTransition", 1) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_BACK then SetVariable("ArtsTransition", 2) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then SetVariable("ArtsTransition", 3) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then SetVariable("ArtsTransition", 4) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then SetVariable("ArtsTransition", 5) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_BACK then SetVariable("ArtsTransition", 6) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then SetVariable("ArtsTransition", 7) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_SPEAR then SetVariable("ArtsTransition", 8) else SetVariable("ArtsTransition", 0) end else SetVariable("ArtsTransition", 9) end end function SetRightSpecialHeavyAttackGeneratorTransitionIndex() -- NOT Ornamental Straight Sword if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 852 and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 667 then SetVariable("ArtsTransition", 0) return end local style = c_Style if style == HAND_RIGHT then local hand = HAND_LEFT if g_Magichand == HAND_LEFT then hand = HAND_RIGHT end local changetype = GetHandChangeType(hand) if changetype == WEAPON_CHANGE_REQUEST_LEFT_WAIST then SetVariable("ArtsTransition", 1) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_BACK then SetVariable("ArtsTransition", 2) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then SetVariable("ArtsTransition", 3) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then SetVariable("ArtsTransition", 4) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then SetVariable("ArtsTransition", 5) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_BACK then SetVariable("ArtsTransition", 6) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then SetVariable("ArtsTransition", 7) elseif changetype == WEAPON_CHANGE_REQUEST_RIGHT_SPEAR then SetVariable("ArtsTransition", 8) else SetVariable("ArtsTransition", 0) end else SetVariable("ArtsTransition", 9) end end function IsMagicAnimExists(magic_type, anim_id) return env(DoesAnimExist, magic_type + 400, anim_id) end function IsQuickMagic() local magic_type = env(GetMagicAnimType) local magic_type_list = { [MAGIC_REQUEST_STONE_SHOTGUN] = true, [MAGIC_REQUEST_QUICKENBULLET] = true, [MAGIC_REQUEST_QUICKSLASH] = true, [MAGIC_REQUEST_QUICK_FLAME] = true } if (magic_type == MAGIC_REQUEST_WEAPON_ENCHANT2 and c_Style == HAND_RIGHT) or magic_type_list[magic_type] then return TRUE end return FALSE end function IsWeaponEnchantMagic() local magic_type = env(GetMagicAnimType) local magic_type_list = { [MAGIC_REQUEST_WEAPON_ENCHANT] = true, [MAGIC_REQUEST_WEAPON_ENCHANT2] = true, [MAGIC_REQUEST_WEAPON_ENCHANT_B] = true, [MAGIC_REQUEST_THUNDER_ENCHANT] = true, [MAGIC_REQUEST_HOLY_ENCHANT] = true } if magic_type_list[magic_type] then return TRUE end return FALSE end function IsJumpMagic() local magic_type = env(GetMagicAnimType) local magic_type_list = { [MAGIC_REQUEST_FLYING_BREATH] = true, [MAGIC_REQUEST_ELDER_DRAGON_BREATH] = true, [180] = true -- Maker's } if magic_type_list[magic_type] then return TRUE end return FALSE end function IsComboMagic() local magic_type = env(GetMagicAnimType) return IsMagicAnimExists(magic_type, 45020) or IsMagicAnimExists(magic_type, 45010) end function IsChargeMagic() return IsMagicAnimExists(env(GetMagicAnimType), 45011) end function CheckIfHoldMagic() local magic_type = env(GetMagicAnimType) local has_hold_anim = IsMagicAnimExists(magic_type, 45012) if not has_hold_anim then if magic_type ~= 35 then has_hold_anim = false else has_hold_anim = true end end return has_hold_anim end function IsStealthMagic(magic_type) local magic_type_list = { [26] = true, [114] = true } if magic_type_list[magic_type] then return TRUE end return FALSE end function IsRollingMagic(magic_type) local magic_type_list = { [127] = true } if magic_type_list[magic_type] then return TRUE end return FALSE end function SetMoveType() -- 100130 "[HKS] Stance - SetMoveType 1" -- 100140 "[HKS] Stance - SetMoveType 2" -- 100150 "[HKS] Stance - SetMoveType 0" -- 100160 "[HKS] Stance - SetMoveType 3" -- Unknown (DLC) "[HKS] Stance - SetMoveType 4" -- Unknown (DLC) "[HKS] Stance - SetMoveType 5" if env(GetSpEffectID, 100130) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 1) elseif env(GetSpEffectID, 100140) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 2) elseif env(GetSpEffectID, 100150) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 0) elseif env(GetSpEffectID, 100160) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 3) elseif env(GetSpEffectID, 19920) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 4) elseif env(GetSpEffectID, 19930) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 5) else SetVariable("MoveType", ConvergeValue(0, hkbGetVariable("MoveType"), 5, 5)) end end function SetStyleSpecialEffect() -- 100620 "[HKS] Right Hand Style" -- 100621 "[HKS] Left Hand Style" if c_Style == HAND_LEFT_BOTH then if env(GetSpEffectID, 100621) == FALSE then act(AddSpEffect, 100621) end elseif env(GetSpEffectID, 100620) == FALSE then act(AddSpEffect, 100620) end end function GetAttackRequest(is_guard, is_ride) local style = c_Style local is_both = FALSE local is_both_right = FALSE if style >= HAND_LEFT_BOTH then is_both = TRUE end if style == HAND_RIGHT_BOTH then is_both_right = TRUE end local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local is_arrow = GetEquipType(hand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) local is_crossbow = GetEquipType(hand, WEAPON_CATEGORY_CROSSBOW) local is_ballista = GetEquipType(hand, WEAPON_CATEGORY_BALLISTA) local is_staff = GetEquipType(hand, WEAPON_CATEGORY_STAFF) local request_r1 = env(ActionRequest, ACTION_ARM_R1) local request_r2 = env(ActionRequest, ACTION_ARM_R2) local request_l1 = env(ActionRequest, ACTION_ARM_L1) local request_l2 = env(ActionRequest, ACTION_ARM_L2) is_ride = is_ride or FALSE if env(ActionDuration, ACTION_ARM_ACTION) > 0 then request_r1 = FALSE request_r2 = FALSE request_l1 = FALSE request_l2 = FALSE end -- R1 + Staff R2 if request_r1 == TRUE and is_staff == FALSE or request_r2 == TRUE and is_staff == TRUE then if is_both == TRUE then if is_arrow == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if style == HAND_LEFT_BOTH then return ATTACK_REQUEST_ARROW_FIRE_LEFT else return ATTACK_REQUEST_ARROW_FIRE_RIGHT end elseif is_crossbow == TRUE or is_ballista == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW else return ATTACK_REQUEST_BOTH_LIGHT end elseif is_guard == TRUE then local is_spear = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SPEAR) local is_rapier = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_RAPIER) local is_large_spear = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_SPEAR) local is_large_rapier = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_RAPIER) -- Shield Poke if is_spear == TRUE or is_rapier == TRUE or is_large_spear == TRUE or is_large_rapier == TRUE then if env(ActionDuration, ACTION_ARM_L1) > 0 then return ATTACK_REQUEST_ATTACK_WHILE_GUARD else return ATTACK_REQUEST_RIGHT_LIGHT end else if is_arrow == TRUE or is_ballista == TRUE then return ATTACK_REQUEST_ARROW_BOTH_RIGHT end if is_crossbow == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_RIGHT_CROSSBOW end return ATTACK_REQUEST_RIGHT_LIGHT end else if is_arrow == TRUE or is_ballista == TRUE then return ATTACK_REQUEST_ARROW_BOTH_RIGHT end if is_crossbow == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_RIGHT_CROSSBOW end return ATTACK_REQUEST_RIGHT_LIGHT end end -- R2 if request_r2 == TRUE then -- Bow / Greatbow if is_arrow == TRUE then if is_both == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if style == HAND_LEFT_BOTH then return ATTACK_REQUEST_ARROW_FIRE_LEFT2 else return ATTACK_REQUEST_ARROW_FIRE_RIGHT2 end else return ATTACK_REQUEST_ARROW_BOTH_RIGHT end -- Crossbow elseif is_crossbow == TRUE then if is_both == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 else g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_RIGHT_CROSSBOW2 end -- Ballista elseif is_ballista == TRUE then if is_both == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 else return ATTACK_REQUEST_ARROW_BOTH_RIGHT end -- 2H Heavy else if IsWeaponCatalyst(hand, true) == TRUE then return ATTACK_REQUEST_INVALID end if is_both == TRUE then return ATTACK_REQUEST_BOTH_HEAVY -- R1 Heavy else return ATTACK_REQUEST_RIGHT_HEAVY end end end -- L1 if request_l1 == TRUE then if env(IsPrecisionShoot) == TRUE then return ATTACK_REQUEST_INVALID end local is_shield_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_TORCH) local is_shield_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_TORCH) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if is_both == TRUE and (sp_kind == 249 or sp_kind == 748 or sp_kind == 107 or sp_kind == 943) then -- dragonkin twinblade/Fingerslayer return ATTACK_REQUEST_BOTH_LEFT end if is_shield_left == TRUE then return ATTACK_REQUEST_INVALID end if is_shield_right == TRUE and is_both_right == TRUE then return ATTACK_REQUEST_INVALID end is_arrow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) is_crossbow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) if is_arrow == TRUE then if is_both == FALSE then return ATTACK_REQUEST_ARROW_BOTH_LEFT else return ATTACK_REQUEST_INVALID end elseif is_crossbow == TRUE then if is_both == FALSE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_LEFT_CROSSBOW else return ATTACK_REQUEST_INVALID end end is_staff = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) if is_staff == TRUE then return ATTACK_REQUEST_INVALID end is_arrow = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) if is_arrow == TRUE and is_both == TRUE then return ATTACK_REQUEST_INVALID end is_crossbow = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) if is_crossbow == TRUE and is_both == TRUE then return ATTACK_REQUEST_INVALID end local isEnableDualWielding = IsEnableDualWielding() if isEnableDualWielding == HAND_RIGHT then return ATTACK_REQUEST_DUAL_RIGHT elseif isEnableDualWielding == HAND_LEFT then return ATTACK_REQUEST_DUAL_LEFT end if IsWeaponCanGuard() == TRUE then return ATTACK_REQUEST_INVALID end return ATTACK_REQUEST_LEFT_HEAVY end -- L2 if request_l2 == TRUE then act(DebugLogOutput, "action request ACTION_ARM_L2") if is_both == FALSE then is_arrow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) is_crossbow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) if is_arrow == TRUE then return ATTACK_REQUEST_ARROW_BOTH_LEFT elseif is_crossbow == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_LEFT_CROSSBOW2 end if IsCasterAsh() == TRUE or (is_ride == TRUE and c_SwordArtsID == SPELLCASTING_ASH and c_SwordArtsHand == HAND_LEFT and c_Style == HAND_RIGHT and env(GetSwordArtID, HAND_RIGHT) == SPELLCASTING_ASH) then return SWORDARTS_REQUEST_RIGHT_NORMAL elseif IsWeaponCatalyst(HAND_LEFT) == TRUE then return ATTACK_REQUEST_INVALID end end if c_SwordArtsID == 399 then if is_both == FALSE then return ATTACK_REQUEST_LEFT_HEAVY else return ATTACK_REQUEST_BOTH_LIGHT end end if c_SwordArtsID == SPELLCASTING_ASH then return SWORDARTS_REQUEST_BOTH_NORMAL end if c_IsEnableSwordArts == TRUE then local swordartrequest = GetSwordArtsRequestNew() local is_arrowright = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) if swordartrequest == SWORDARTS_REQUEST_RIGHT_STANCE and is_arrowright == TRUE then if style ~= HAND_RIGHT_BOTH then return ATTACK_REQUEST_ARROW_BOTH_RIGHT else return swordartrequest end else return swordartrequest end elseif is_both == TRUE then if GetEquipType(hand, WEAPON_CATEGORY_STAFF) == TRUE then return ATTACK_REQUEST_BOTH_LIGHT else return ATTACK_REQUEST_BOTH_HEAVY end else return ATTACK_REQUEST_LEFT_HEAVY end end return ATTACK_REQUEST_INVALID end function ExecAttack(r1, r2, l1, l2, b1, b2, is_guard, blend_type, artsr1, artsr2, is_stealth_rolling) local cur_stamina = env(GetStamina) if cur_stamina <= 0 and GetVariable("StaminaComboResetTest") == 1 then g_ComboReset = TRUE end local request = GetAttackRequest(is_guard) -- New trick system manual retreival trigger (kmstr) if env(GetSpEffectID, 2335) == TRUE then SetArtsGeneratorTransitionIndex() end if request == ATTACK_REQUEST_INVALID then return FALSE end act(DebugLogOutput, "ExecAttack request=" .. request) -- fingerslayer combo memory convergence if env(GetSpEffectID, 2340) == TRUE then if env(GetSpEffectID, 2345) == TRUE then b1 = "W_AttackBothLight6" r1 = "W_AttackRightLight6" elseif env(GetSpEffectID, 2344) == TRUE then b1 = "W_AttackBothLight5" r1 = "W_AttackRightLight5" elseif env(GetSpEffectID, 2343) == TRUE then b1 = "W_AttackBothLight4" r1 = "W_AttackRightLight4" elseif env(GetSpEffectID, 2342) == TRUE then b1 = "W_AttackBothLight3" r1 = "W_AttackRightLight3" elseif env(GetSpEffectID, 2341) == TRUE then b1 = "W_AttackBothLight2" r1 = "W_AttackRightLight2" else b1 = "W_AttackBothLight1" r1 = "W_AttackRightLight1" end end -- Kmstr General Animation Jumping -- Smithscript Rosary here if env(GetSpEffectID, 2401) == TRUE then b1 = "W_AttackBothLight1" r1 = "W_AttackRightLight1" end if env(GetSpEffectID, 2402) == TRUE then b1 = "W_AttackBothLight2" r1 = "W_AttackRightLight2" end if env(GetSpEffectID, 2403) == TRUE then b1 = "W_AttackBothLight3" r1 = "W_AttackRightLight3" end if env(GetSpEffectID, 2404) == TRUE then b1 = "W_AttackBothLight4" r1 = "W_AttackRightLight4" end if env(GetSpEffectID, 2405) == TRUE then b1 = "W_AttackBothLight5" r1 = "W_AttackRightLight5" end if env(GetSpEffectID, 2406) == TRUE then b1 = "W_AttackBothLight6" r1 = "W_AttackRightLight6" end if env(GetSpEffectID, 2407) == TRUE then b2 = "W_AttackBothHeavy1Start" r2 = "W_AttackRightHeavy1Start" end if env(GetSpEffectID, 2408) == TRUE then b2 = "W_AttackBothHeavy2Start" r2 = "W_AttackRightHeavy2Start" end if env(GetSpEffectID, 2409) == TRUE then b1 = "W_AttackBothLightStealth" r1 = "W_AttackRightLightStealth" end if env(GetSpEffectID, 2410) == TRUE then b2 = "W_AttackBothLightStealth" r2 = "W_AttackRightLightStealth" end if env(GetSpEffectID, 2415) == TRUE then b1 = "W_AttackBothLightStep" r1 = "W_AttackRightLightStep" end if env(GetSpEffectID, 2416) == TRUE then b1 = "W_AttackBothBackstep" r1 = "W_AttackRightBackstep" end if env(GetSpEffectID, 2430) == TRUE then SetVariable("AttackRightHeavySpecialType", 0) b2 = "W_AttackBothHeavySpecial1Start" r2 = "W_AttackRightHeavySpecial1Start" end -- Kmstr End local style = c_Style local swordartpoint_hand = HAND_RIGHT local atk_hand = HAND_RIGHT local guard_hand = HAND_RIGHT local is_find_atk = TRUE local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if cur_stamina <= 0 then ResetRequest() return FALSE end local is_Dual = FALSE g_ComboReset = FALSE if c_Style == HAND_LEFT_BOTH then swordartpoint_hand = HAND_LEFT end act(SetDamageMotionBlendRatio, 0) if env(IsSpecialTransitionPossible) == TRUE then r1 = "W_AttackRightLight1" l1 = "W_AttackLeftLight1" b1 = "W_AttackBothLight1" -- 132 "[HKS] Recovery Window: Heavy Attack" -- Applied in TAE if env(GetSpEffectID, 132) == FALSE then r2 = "W_AttackRightHeavy1Start" l2 = "W_AttackLeftHeavy1" b2 = "W_AttackBothHeavy1Start" end end -- Moveset animation jumping script if (env(GetSpEffectID, 8000500) == TRUE) then -- Champion's Evasion SetVariable("AttackRightHeavySpecialType", 0) r2 = "W_AttackRightHeavySpecial1Start" -- 030600 b2 = "W_AttackBothHeavySpecial1Start" -- 032600 end if (env(GetSpEffectID, 8000600) == TRUE) then r1 = "W_SwordArtsOneShotComboEnd_2" -- 040020 r1 b1 = "W_SwordArtsOneShotComboEnd_2" end if (env(GetSpEffectID, 8000601) == TRUE) then r2 = "W_SwordArtsOneShotComboEnd_2" -- 040020 r2 b2 = "W_SwordArtsOneShotComboEnd_2" end if (env(GetSpEffectID, 8000605) == TRUE) then r1 = "W_SwordArtsOneShotComboEnd" -- 040010 r1 b1 = "W_SwordArtsOneShotComboEnd" end if (env(GetSpEffectID, 8000606) == TRUE) then l2 = "W_SwordArtsChargeCancelEarly" -- 040001 L2 end if (env(GetSpEffectID, 8000400) == TRUE) then r1 = "W_AttackRightBackstep" -- 030400 r1 b1 = "W_AttackBothBackstep" end -- Moveset animation jumping script end -- 133 "[HKS] Switch Heavy to Heavy Sub" -- Applied in TAE if env(GetSpEffectID, 133) == TRUE then if r2 == "W_AttackRightHeavy1Start" then r2 = "W_AttackRightHeavy1SubStart" end if b2 == "W_AttackBothHeavy1Start" then b2 = "W_AttackBothHeavy1SubStart" end -- 134 "[HKS] Switch Heavy Sub to Heavy" -- Applied in TAE elseif env(GetSpEffectID, 134) == TRUE then if r2 == "W_AttackRightHeavy1SubStart" then r2 = "W_AttackRightHeavy1Start" end if b2 == "W_AttackBothHeavy1SubStart" then b2 = "W_AttackBothHeavy1Start" end end local isAfterAdditiveJustGuard = FALSE if IsNodeActive("Guard_Upper LayerGenerator") == TRUE and env(GetSpEffectID, 102020) == TRUE then isAfterAdditiveJustGuard = TRUE end -- 173 "[HKS] Guard Counter: End" -- 174 "[HKS] Guard Counter: Window" -- 177 "[HKS] Guard Counter - Window (Gravity Armor with Meteoric Alignment active)" if env(GetSpEffectID, 173) == TRUE or env(GetSpEffectID, 174) == TRUE or env(GetSpEffectID, 177) == TRUE or isAfterAdditiveJustGuard == TRUE then if c_Style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT guard_hand = HAND_RIGHT elseif c_Style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT guard_hand = HAND_LEFT end -- Guard Counter Window -- If the player is holding a valid weapon, and has pressed R2, play Guard Counter anim if GetEquipType(atk_hand, WEAPON_CATEGORY_STAFF, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) == FALSE and env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then ExecEventAllBody("W_AttackBothHeavyCounter") else ExecEventAllBody("W_AttackRightHeavyCounter") end WeaponAttackDetection() return TRUE end -- Otherwise, if in Guard Counter Window, mulch the request if env(GetSpEffectID, 174) == TRUE then return FALSE end end -- 100630 "[HKS] Throw related" if env(GetSpEffectID, 100630) == TRUE and ExecFallAttack() == TRUE then WeaponAttackDetection() return TRUE end if request == ATTACK_REQUEST_RIGHT_LIGHT then if artsr1 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE, r1) if r1 == "W_DrawStanceRightAttackLight" then SetSwordArtsWepCategory_DrawStanceRightAttackLight() end end if c_SwordArtsID == 318 or c_SwordArtsID == 287 or c_SwordArtsID == 299 or artsID == 266 or c_SwordArtsID == 340 then if r1 == "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) elseif r1 == "W_SwordArtsOneShotComboEnd_2" then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) local val = GetVariable("IsEnoughArtPointsR1") SetVariable("IsEnoughArtPointsR2", val) end end --- 135 "[HKS] Light Sub Start Type 0" --- 136 "[HKS] Light Sub Start Type 1" --- 137 "[HKS] Light Sub Start Type 2" --- 138 "[HKS] Light Sub Start Type 3" if r1 == "W_AttackRightLightSubStart" then if env(GetSpEffectID, 135) == TRUE then SetVariable("AttackLightSubStartType", 0) elseif env(GetSpEffectID, 136) == TRUE then SetVariable("AttackLightSubStartType", 1) elseif env(GetSpEffectID, 137) == TRUE then SetVariable("AttackLightSubStartType", 2) elseif env(GetSpEffectID, 138) == TRUE then SetVariable("AttackLightSubStartType", 3) else r1 = "W_AttackRightLight2" end end if r1 == "W_AttackRightLightStealth" and IsUseStealthAttack(FALSE) == FALSE then r1 = "W_AttackRightLightStep" end if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == TRUE and r1 ~= "W_AttackRightLight2" and r1 ~= "W_AttackRightLight3" then r1 = "W_AttackRightLight1" end if env(GetSpEffectID, 19903) == TRUE then r1 = "W_AttackRightLight3" elseif env(GetSpEffectID, 19904) == TRUE then r1 = "W_AttackRightLight4" end if env(GetSpEffectID, 19915) == TRUE then r1 = "W_AttackRightLight2" end ExecEventAllBody(r1) elseif request == ATTACK_REQUEST_RIGHT_HEAVY then if (c_SwordArtsID == 313 or c_SwordArtsID == 273) and (r2 == "W_SwordArtsOneShotComboEnd" or r2 == "W_SwordArtsOneShotComboEnd_2") then artsr2 = TRUE SetVariable("SwordArtsOneShotComboCategory", 0) end if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, r2) end local IsEnableSpecialAttack = FALSE -- Barbaric Roar: Heavy Special if env(GetSpEffectID, 1681) == TRUE or env(GetSpEffectID, 1686) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- War Cry: Heavy Special if env(GetSpEffectID, 1811) == TRUE or env(GetSpEffectID, 1816) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end -- Unknown: Heavy Special if env(GetSpEffectID, 1716) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Omen's Roar: Heavy Special if env(GetSpEffectID, 2011) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Spear: Heavy Special if env(GetSpEffectID, 2031) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown: Heavy Special if env(GetSpEffectID, 1721) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Celestial Blade: Heavy Special if env(GetSpEffectID, 1981) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Call to Thunder: Heavy Special if env(GetSpEffectID, 1961) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Monk Flameblade: Heavy Special if env(GetSpEffectID, 2041) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Monk Flamemace: Heavy Special if env(GetSpEffectID, 2141) == TRUE or env(GetSpEffectID, 2143) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Skeleton Hands: Heavy Special if env(GetSpEffectID, 2061) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown (DLC): Heavy Special if env(GetSpEffectID, 102101) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end --[kmstr] Maliketh BB if env(GetSpEffectID, 3011) == TRUE or env(GetSpEffectID, 3013) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if c_SwordArtsID == 295 and (env(GetSpEffectID, 100114) == TRUE or env(GetSpEffectID, 100109) == TRUE or env(GetSpEffectID, 1441500) == TRUE) then -- moon cirque IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if IsEnableSpecialAttack == TRUE then if r2 == "W_AttackRightHeavy1Start" then r2 = "W_AttackRightHeavySpecial1Start" elseif r2 == "W_AttackRightHeavy1SubStart" then r2 = "W_AttackRightHeavySpecial1SubStart" elseif r2 == "W_AttackRightHeavy2Start" then r2 = "W_AttackRightHeavySpecial2Start" end end if env(GetSpEffectID, 1681) == FALSE and env(GetSpEffectID, 1686) == FALSE and env(GetSpEffectID, 1811) == FALSE and env(GetSpEffectID, 1816) == FALSE and env(GetSpEffectID, 19912) == TRUE then r2 = "W_AttackRightHeavy2Start" end ExecEventAllBody(r2) elseif request == ATTACK_REQUEST_LEFT_LIGHT then atk_hand = HAND_LEFT guard_hand = HAND_LEFT ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_LEFT_HEAVY then atk_hand = HAND_LEFT guard_hand = HAND_LEFT ExecEventAllBody(l2) elseif request == ATTACK_REQUEST_BOTH_LIGHT then if (c_SwordArtsID == 318 or c_SwordArtsID == 287 or c_SwordArtsID == 299 or artsID == 266 or artsID == 340) and r1 == "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" then -- conv marika hammer artsr1 = TRUE end if artsr1 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE, b1) if b1 == "W_DrawStanceRightAttackLight" then SetSwordArtsWepCategory_DrawStanceRightAttackLight() end end --- 135 "[HKS] Light Sub Start Type 0" --- 136 "[HKS] Light Sub Start Type 1" --- 137 "[HKS] Light Sub Start Type 2" --- 138 "[HKS] Light Sub Start Type 3" if b1 == "W_AttackBothLightSubStart" then if env(GetSpEffectID, 135) == TRUE then SetVariable("AttackLightSubStartType", 0) elseif env(GetSpEffectID, 136) == TRUE then SetVariable("AttackLightSubStartType", 1) elseif env(GetSpEffectID, 137) == TRUE then SetVariable("AttackLightSubStartType", 2) elseif env(GetSpEffectID, 138) == TRUE then SetVariable("AttackLightSubStartType", 3) else b1 = "W_AttackBothLight2" end end if b1 == "W_AttackBothLightStealth" and IsUseStealthAttack(FALSE) == FALSE then b1 = "W_AttackBothLightStep" end local staff_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then staff_hand = HAND_LEFT end if GetEquipType(staff_hand, WEAPON_CATEGORY_STAFF) == TRUE and b1 ~= "W_AttackBothLight2" and b1 ~= "W_AttackBothLight3" then b1 = "W_AttackBothLight1" end if env(GetSpEffectID, 19903) == TRUE then b1 = "W_AttackBothLight3" elseif env(GetSpEffectID, 19904) == TRUE then b1 = "W_AttackBothLight4" end if env(GetSpEffectID, 19915) == TRUE then b1 = "W_AttackBothLight2" end if style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT end if env(GetEquipWeaponCategory, atk_hand) == WEAPON_CATEGORY_DUELING_SHIELD then guard_hand = atk_hand if is_guard == TRUE and env(ActionDuration, ACTION_ARM_L1) > 0 then b1 = "W_AttackBothLightGuard" end end --smithscript rosary conv if env(GetEquipWeaponSpecialCategoryNumber, atk_hand) == 988 and TRUE == IsEnableGuard() and TRUE == IsGuard() then if style == HAND_LEFT_BOTH then b1 = "W_AttackLeftHeavy5" else b1 = "W_AttackRightWhileGuard" end end ExecEventAllBody(b1) elseif request == ATTACK_REQUEST_BOTH_LEFT then if l1 ~= "W_AttackBothLeftSpecial2" and l1 ~= "W_AttackBothLeftSpecial3" and l1 ~= "W_AttackBothLeftSpecial4" and l1 ~= "W_AttackBothLeftSpecial5" then l1 = "W_AttackBothLeftSpecial1" end ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_BOTH_HEAVY then -- DLC 1.13.1: Dynastic Sickleplay, Raging Beast if (c_SwordArtsID == 313 or c_SwordArtsID == 273) and (r2 == "W_SwordArtsOneShotComboEnd" or r2 == "W_SwordArtsOneShotComboEnd_2") then artsr2 = TRUE SetVariable("SwordArtsOneShotComboCategory", 0) end if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, b2) end local IsEnableSpecialAttack = FALSE -- Barbaric Roar: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1681) == TRUE or env(GetSpEffectID, 1686) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and (env(GetSpEffectID, 1683) == TRUE or env(GetSpEffectID, 1688) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- War Cry: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1811) == TRUE or env(GetSpEffectID, 1816) == TRUE or env(GetSpEffectID, 1861) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end elseif c_Style == HAND_LEFT_BOTH and (env(GetSpEffectID, 1813) == TRUE or env(GetSpEffectID, 1818) == TRUE or env(GetSpEffectID, 1863) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end -- Unknown: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1716) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 1718) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1721) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 1723) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Celestial Blade: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1981) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 1991) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Omen's Roar: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 2011) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 2021) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Spear: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 2031) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 2036) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Call to Thunder: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1961) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 1971) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Monk Flameblade: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 2041) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 2043) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Monk Flamemace: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 2141) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 2143) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Skeleton Hands: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 2061) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 2063) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- DLC Unknown: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 102101) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 102106) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end --[kmstr] Maliketh BB if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 3011) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 3013) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if c_SwordArtsID == 295 and c_Style == HAND_RIGHT_BOTH then -- moon cirque if (env(GetSpEffectID, 100109) == TRUE or env(GetSpEffectID, 1441500) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and (env(GetSpEffectID, 100114) == TRUE or env(GetSpEffectID, 1441500) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if IsEnableSpecialAttack == TRUE then if b2 == "W_AttackBothHeavy1Start" then b2 = "W_AttackBothHeavySpecial1Start" elseif b2 == "W_AttackBothHeavy1SubStart" then b2 = "W_AttackBothHeavySpecial1SubStart" elseif b2 == "W_AttackBothHeavy2Start" then b2 = "W_AttackBothHeavySpecial2Start" end end if env(GetSpEffectID, 1681) == FALSE and env(GetSpEffectID, 1686) == FALSE and env(GetSpEffectID, 1811) == FALSE and env(GetSpEffectID, 1816) == FALSE and env(GetSpEffectID, 19912) == TRUE then b2 = "W_AttackBothHeavy2Start" end if style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT end if env(GetEquipWeaponCategory, atk_hand) == WEAPON_CATEGORY_DUELING_SHIELD then guard_hand = atk_hand end ExecEventAllBody(b2) elseif request == ATTACK_REQUEST_DUAL_RIGHT then if r1 == "W_AttackRightLightDash" then l1 = "W_AttackDualDash" elseif r1 == "W_AttackRightLightStep" then l1 = "W_AttackDualRolling" elseif r1 == "W_AttackRightBackstep" then l1 = "W_AttackDualBackStep" elseif r1 == "W_AttackRightLightStealth" then if IsUseStealthAttack(TRUE) == FALSE then l1 = "W_AttackDualRolling" else l1 = "W_AttackDualStealth" end elseif l1 == "W_AttackLeftLight1" then l1 = "W_AttackDualLight1" elseif l1 == "W_AttackLeftLight2" then l1 = "W_AttackDualLight2" elseif l1 == "W_AttackLeftLight3" then l1 = "W_AttackDualLight3" elseif l1 == "W_AttackLeftLight4" then l1 = "W_AttackDualLight4" elseif l1 == "W_AttackLeftLight5" then l1 = "W_AttackDualLight5" elseif l1 == "W_AttackLeftLight6" then l1 = "W_AttackDualLight6" elseif l1 == "W_AttackDualLightSubStart" then l1 = "W_AttackDualLightSubStart" else l1 = "W_AttackDualLight1" end if env(GetSpEffectID, 19903) == TRUE then l1 = "W_AttackDualLight3" elseif env(GetSpEffectID, 19904) == TRUE then l1 = "W_AttackDualLight4" end if l1 == "W_AttackDualLightSubStart" then if env(GetSpEffectID, 135) == TRUE then SetVariable("AttackLightSubStartType", 0) else l1 = "W_AttackDualLight2" end end is_Dual = TRUE ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_ARROW_BOTH_RIGHT then if c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH and ExecHandChange(HAND_RIGHT, TRUE, blend_type) == TRUE then WeaponAttackDetection() return TRUE end return FALSE elseif request == ATTACK_REQUEST_ARROW_BOTH_LEFT then if c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH and ExecHandChange(HAND_LEFT, TRUE, blend_type) == TRUE then WeaponAttackDetection() return TRUE end return FALSE elseif request == ATTACK_REQUEST_LEFT_REVERSAL then ExecEventAllBody("W_AttackLeftReversal") elseif request == SWORDARTS_REQUEST_LEFT_NORMAL then SkardeShieldAltAshHandler() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) atk_hand = HAND_LEFT guard_hand = HAND_LEFT if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD then arts_idx = 3 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD then arts_idx = 4 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD then arts_idx = 5 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 10 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 11 elseif c_SwordArtsID == 295 and (env(GetSpEffectID, 100114) == FALSE and env(GetSpEffectID, 100109) == FALSE and env(GetSpEffectID, 1441500) == FALSE) then -- conv Moon cirque arts_idx = 1 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) -- Torch Attack if c_SwordArtsID == 17 then SetVariable("SwordArtsOneShotComboCategory", 0) end if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldLeft, blend_type) else ExecEventAllBody("W_SwordArtsOneShotShieldLeft") end elseif request == SWORDARTS_REQUEST_BOTH_NORMAL and c_SwordArtsID ~= SPELLCASTING_ASH then SkardeShieldAltAshHandler() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) if IsHalfBlendArts(c_SwordArtsID) == TRUE and c_SwordArtsID ~= 334 and c_SwordArtsID ~= 354 and c_SwordArtsID ~= 355 then if c_SwordArtsHand == HAND_LEFT then local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD then arts_idx = 3 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD then arts_idx = 4 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD then arts_idx = 5 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 10 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 11 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldLeft, blend_type) else local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD or arts_cat == WEAPON_CATEGORY_THROW_DAGGER then arts_idx = 3 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then arts_idx = 4 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 5 elseif arts_cat == WEAPON_CATEGORY_FIST or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_PERFUME_BOTTLE or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 10 end SetVariable("SwordArtsOneShotCategory", arts_idx) ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) end else local arts_idx = 0 if arts_cat == WEAPON_CATEGORY_SHORT_SWORD then arts_idx = 1 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 3 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 4 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 5 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldBoth, blend_type) else ExecEventAllBody("W_SwordArtsOneShotShieldBoth") end end elseif request == SWORDARTS_REQUEST_RIGHT_NORMAL then SkardeShieldAltAshHandler() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if c_WeaponSwordArts == "60530000" then -- Jump Ash arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON or arts_cat == WEAPON_CATEGORY_LARGE_KATANA then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD or arts_cat == WEAPON_CATEGORY_THROW_DAGGER then arts_idx = 3 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then arts_idx = 4 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 5 elseif arts_cat == WEAPON_CATEGORY_FIST or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_PERFUME_BOTTLE or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 10 elseif c_SwordArtsID == 328 and env(GetSpEffectID, 19875) == TRUE and GetVariable("IsEnoughArtPointsL2") == 0 then arts_idx = 12 elseif c_SwordArtsID == 328 and env(GetSpEffectID, 19874) == TRUE and GetVariable("IsEnoughArtPointsL2") == 0 then arts_idx = 11 elseif c_SwordArtsID == 295 and (env(GetSpEffectID, 100114) == FALSE and env(GetSpEffectID, 100109) == FALSE and env(GetSpEffectID, 1441500) == FALSE) then -- conv Moon cirque arts_idx = 1 elseif c_SwordArtsID == 9 and env(GetSpEffectID, 1879) == TRUE then -- Sleep Estoc arts_idx = 11 elseif c_SwordArtsID == 343 and (c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH) then -- Conv Fingerslayer Blade arts_idx = 1 elseif c_SwordArtsID == 312 and env(GetSpEffectID, 1878) == TRUE then -- Flame Swordspear arts_idx = 1 elseif c_SwordArtsID == 208 and env(GetSpEffectID, 2100) == TRUE then -- Flamemace arts_idx = 1 elseif c_SwordArtsID == 1 and env(GetSpEffectID, 1886) == TRUE then -- Storm Dagger arts_idx = 11 elseif c_SwordArtsID == 173 and env(GetSpEffectID, 2101) == TRUE then -- Mystic Huntress Sword arts_idx = 1 elseif c_SwordArtsID == 320 and env(GetSpEffectID, 2102) == TRUE then -- Idris' Halberd arts_idx = 1 elseif c_WeaponSwordArts == "10070000" then -- Godwyn's cragblade arts_idx = 4 elseif c_SwordArtsID == 388 then --smithscript rosary if env(GetSpEffectID, 2425) == TRUE then -- 040200 -- sword arts_idx = 1 elseif env(GetSpEffectID, 2424) == TRUE then -- 040300 -- Quarterstaff arts_idx = 2 elseif IsNodeActive("Guard_SM") == TRUE or IsNodeActive("Guard_Upper_SM") == TRUE then -- 042000 -- Shield --act(AddSpEffect, 199) arts_idx = 3 elseif env(GetSpEffectID, 2420) == TRUE then -- 042400 -- Hammer arts_idx = 4 elseif env(GetSpEffectID, 2423) == TRUE then -- 042800 -- Spear arts_idx = 5 elseif env(GetSpEffectID, 2422) == TRUE then -- 044200 -- Axe arts_idx = 6 elseif env(GetSpEffectID, 2421) == TRUE then -- 044700 -- Sword Left side arts_idx = 7 else arts_idx = 0 end elseif c_WeaponSwordArts == "11130000" then -- Vanilla ringed finger to account for crystalline crab claw using same tae arts_idx = 11 end SetVariable("SwordArtsOneShotCategory", arts_idx) local combo_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then combo_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then combo_idx = 2 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then combo_idx = 3 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then combo_idx = 4 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then combo_idx = 5 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then combo_idx = 6 elseif c_SwordArtsID == 343 and (c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH) then -- Conv Fingerslayer Blade combo_idx = 1 elseif c_SwordArtsID == 312 and env(GetSpEffectID, 1878) == TRUE then -- Fire Swordspear combo_idx = 1 elseif c_SwordArtsID == 173 and env(GetSpEffectID, 2101) == TRUE then -- Mystic Huntress Sword combo_idx = 1 elseif c_SwordArtsID == 320 and env(GetSpEffectID, 2102) == TRUE then -- Idris' Halberd combo_idx = 1 elseif c_SwordArtsID == 388 then --smithscript rosary if env(GetSpEffectID, 2422) == TRUE then -- 044200 -- Axe combo_idx = 4 else combo_idx = 0 end end SetVariable("SwordArtsOneShotComboCategory", combo_idx) SetVariable("SwordArtsSubCategory", 0) if c_SwordArtsID == 261 then if env(GetSpEffectID, 102355) == TRUE then SetVariable("SwordArtsSubCategory", 0) ExecEventAllBody("W_SwordArtsOneShot_Sub") elseif env(GetSpEffectID, 102356) == TRUE then SetVariable("SwordArtsSubCategory", 1) ExecEventAllBody("W_SwordArtsOneShot_Sub") else ExecEventAllBody("W_SwordArtsOneShot") end elseif c_SwordArtsID == 34 then -- guardian Swordspear if wep_cat == WEAPON_CATEGORY_STRAIGHT_SWORD then ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) elseif wep_cat == WEAPON_CATEGORY_HALBERD then ExecEventAllBody("W_SwordArtsOneShot") end elseif c_SwordArtsID == 148 then -- dragonkin Twinblade if wep_cat == WEAPON_CATEGORY_TWINBLADE then ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) elseif wep_cat == WEAPON_CATEGORY_LARGE_SWORD then ExecEventAllBody("W_SwordArtsOneShot") end elseif IsHalfBlendArts(c_SwordArtsID) == TRUE or c_SwordArtsID == 295 and (env(GetSpEffectID, 100114) == FALSE and env(GetSpEffectID, 100109) == FALSE and env(GetSpEffectID, 1441500) == FALSE) then -- Conv Moon Cirque ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) else ExecEventAllBody("W_SwordArtsOneShot") end elseif request == SWORDARTS_REQUEST_RIGHT_STEP then act(DebugLogOutput, "SwordArtsRolling request" .. request) if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local rollingAngle = c_ArtsRollingAngle if GetVariable("MoveSpeedLevel") > 0.2 then rollingAngle = GetVariable("MoveAngle") end local turn_target_angle = 0 local rollingDirection = 0 local turn_angle_real = 200 local is_self_trans = FALSE local is_self_trans_2 = FALSE local arts_id = c_SwordArtsID -- [Kmstr] Dodge AOW local list Alternating local aow_list_Rolling_alternate = { [78] = true, [155] = true, -- Quickstep [156] = true, -- Bloodhound's step [344] = true -- Scadu Bow } if IsNodeActive("SwordArtsRolling Selector MP") == TRUE or IsNodeActive("SwordArtsRolling Selector MP_SelfTrans2") == TRUE then is_self_trans = TRUE elseif aow_list_Rolling_alternate[arts_id] and (IsNodeActive("SwordArtsRolling Selector MP_SelfTrans") == TRUE or env(GetSpEffectID, 100710) == TRUE) then is_self_trans_2 = TRUE end if GetVariable("IsLockon") == false and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE or env(GetSpEffectID, 100002) == TRUE then rollingDirection = 0 else if rollingAngle <= GetVariable("RollingAngleThresholdRightFrontTest") and rollingAngle >= GetVariable("RollingAngleThresholdLeftFrontTest") then rollingDirection = 0 turn_target_angle = rollingAngle elseif rollingAngle > GetVariable("RollingAngleThresholdRightFrontTest") and rollingAngle < GetVariable("RollingAngleThresholdRightBackTest") then rollingDirection = 3 turn_target_angle = rollingAngle - 90 elseif rollingAngle < GetVariable("RollingAngleThresholdLeftFrontTest") and rollingAngle > GetVariable("RollingAngleThresholdLeftBackTest") then rollingDirection = 2 turn_target_angle = rollingAngle + 90 else rollingDirection = 1 turn_target_angle = rollingAngle - 180 end if arts_id == 276 then if rollingAngle <= 0 and rollingAngle >= -180 then rollingDirection = 2 turn_target_angle = rollingAngle + 90 elseif rollingAngle > 0 and rollingAngle < 180 then rollingDirection = 3 turn_target_angle = rollingAngle - 90 else rollingDirection = 2 turn_target_angle = rollingAngle + 90 end end if arts_id == 313 then if GetVariable("MoveSpeedLevel") < 0.2 then rollingDirection = 0 turn_target_angle = rollingAngle elseif rollingAngle <= 0 and rollingAngle >= -120 then rollingDirection = 2 turn_target_angle = rollingAngle + 90 elseif rollingAngle > 0 and rollingAngle < 120 then rollingDirection = 3 turn_target_angle = rollingAngle - 90 else rollingDirection = 1 turn_target_angle = rollingAngle - 180 end end turn_angle_real = math.abs(GetVariable("TurnAngle") - rollingAngle) if turn_angle_real > 180 then turn_angle_real = 360 - turn_angle_real end if arts_id ~= 276 then if GetVariable("IsLockon") == true then act(TurnToLockonTargetImmediately, turn_target_angle) else act(FaceDirection, turn_target_angle) end end end -- [Kmstr] Dodge AOW local list local aow_list_Rolling = { [155] = true, -- Quickstep [156] = true, -- Bloodhound's step [290] = true, -- Maliketh BB [344] = true -- Scadu Bow } if is_self_trans == TRUE then if aow_list_Rolling[arts_id] then -- [Kmstr] Dodge AOW local list for Maliketh BB SetVariable("SwordArtsRollingArtsCategory", 0) else SetVariable("SwordArtsRollingArtsCategory", 1) end SetVariable("SwordArtsRollingDirection_SelfTrans", rollingDirection) SetVariable("RollingAngleRealSelftrans", rollingAngle) elseif is_self_trans_2 == TRUE then SetVariable("SwordArtsRollingDirection_SelfTrans2", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) else SetVariable("SwordArtsRollingDirection", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) end SetVariable("TurnAngleReal", turn_angle_real) SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if ShouldDoStaminaCost() == TRUE and arts_id ~= 313 then if GetVariable("IsEnoughArtPointsL2") == 1 then AddStamina(STAMINA_REDUCE_ARTS_QUICKSTEP * STAMINA_CONSUMERATE_LOWSTATUS) else AddStamina(STAMINA_REDUCE_ARTS_QUICKSTEP) end end local arts_idx = 0 if arts_id ~= 344 and aow_list_Rolling[arts_id] then -- [Kmstr] Dodge AOW local list for Maliketh BB SetWeightIndex() if GetVariable("EvasionWeightIndex") == MOVE_WEIGHT_LIGHT then arts_idx = 1 end end SetVariable("SwordArtsRollingWeightCategory", arts_idx) act(AddSpEffect, 100710) if is_self_trans == TRUE then ExecEventAllBody("W_SwordArtsRolling_SelfTrans") elseif is_self_trans_2 == TRUE then ExecEventAllBody("W_SwordArtsRolling_SelfTrans2") elseif (arts_id == 276 or arts_id == 313) and GetVariable("IsLockon") == true and env(GetSpEffectID, 100002) == TRUE then ExecEventAllBody("W_SwordArtsRolling_Sub") else ExecEventAllBody("W_SwordArtsRolling") end elseif request == SWORDARTS_REQUEST_RIGHT_COMBO_1 then if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE) if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotCombo1, blend_type) else ExecEventAllBody("W_SwordArtsOneShotComboEnd") end elseif request == SWORDARTS_REQUEST_RIGHT_COMBO_2 then if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, "W_SwordArtsOneShotComboEnd_2") if IsTrickWeapon() == TRUE then local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local combo_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then combo_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then combo_idx = 2 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then combo_idx = 3 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then combo_idx = 4 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then combo_idx = 5 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then combo_idx = 6 end SetVariable("SwordArtsOneShotComboCategory", combo_idx) ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") elseif IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotCombo2, blend_type) else ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") end elseif request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then is_find_atk = FALSE if env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") elseif env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW then ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStart, ALLBODY) elseif GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW) == TRUE and (c_IsStealth == FALSE and r1 == "W_AttackRightLightStep" or is_stealth_rolling == TRUE or r1 == "W_AttackRightLightDash" or r1 == "W_AttackRightBackstep") then ShotArrow() ExecEventAllBody("W_AttackArrowRightFireStep") elseif c_IsStealth == TRUE then ShotArrow() ExecEventHalfBlend(Event_StealthAttackArrowStart, ALLBODY) else ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStart, blend_type) end elseif request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 then is_find_atk = FALSE if env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") elseif env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_LARGE_ARROW then ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftStart, ALLBODY) elseif GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW) == TRUE and (c_IsStealth == FALSE and r1 == "W_AttackRightLightStep" or is_stealth_rolling == TRUE or r1 == "W_AttackRightLightDash" or r1 == "W_AttackRightBackstep") then ShotArrow() ExecEventAllBody("W_AttackArrowLeftFireStep") elseif c_IsStealth == TRUE then ShotArrow() ExecEventHalfBlend(Event_StealthAttackArrowStart, ALLBODY) else ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftStart, blend_type) end elseif request == ATTACK_REQUEST_RIGHT_CROSSBOW or request == ATTACK_REQUEST_RIGHT_CROSSBOW2 then is_find_atk = FALSE if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end local crossbowHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then crossbowHand = HAND_LEFT end if env(IsOutOfAmmo, 1) == TRUE then if c_IsStealth == TRUE and GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowRightEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) end elseif env(GetBoltLoadingState, 1) == FALSE and GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then if c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackCrossbowRightReload, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowRightReload, blend_type) end elseif c_IsStealth == TRUE and GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowRightStart, blend_type) else ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowRightStart, blend_type) end elseif request == ATTACK_REQUEST_LEFT_CROSSBOW or request == ATTACK_REQUEST_LEFT_CROSSBOW2 then is_find_atk = FALSE atk_hand = HAND_LEFT guard_hand = HAND_LEFT if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end if env(IsOutOfAmmo, 0) == TRUE then if c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowLeftEmpty, blend_type) end elseif env(GetBoltLoadingState, 0) == FALSE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then if c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftReload, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowLeftReload, blend_type) end elseif c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowLeftStart, blend_type) else ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowLeftStart, blend_type) end elseif request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW or request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 then is_find_atk = FALSE if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end local arrowHand = 0 if c_Style == HAND_RIGHT_BOTH then arrowHand = 1 end if env(IsOutOfAmmo, arrowHand) == TRUE then if c_IsStealth == TRUE and GetEquipType(arrowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothRightEmpty, blend_type) end elseif env(GetBoltLoadingState, arrowHand) == FALSE and GetEquipType(arrowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then local reloadEvent = Event_AttackCrossbowBothRightReload if c_IsStealth == TRUE then if c_Style == HAND_LEFT_BOTH then reloadEvent = Event_StealthAttackCrossbowBothLeftReload else reloadEvent = Event_StealthAttackCrossbowBothRightReload end elseif c_Style == HAND_LEFT_BOTH then reloadEvent = Event_AttackCrossbowBothLeftReload else reloadEvent = Event_AttackCrossbowBothRightReload end ExecEventHalfBlend(reloadEvent, blend_type) elseif c_IsStealth == TRUE and GetEquipType(arrowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightStart, blend_type) else ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowBothRightStart, blend_type) end elseif request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW or request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW2 then is_find_atk = FALSE if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end if env(IsOutOfAmmo, 0) == TRUE then if c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothLeftEmpty, blend_type) end elseif env(GetBoltLoadingState, 0) == FALSE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then if c_IsStealth == TRUE then ExecEventHalfBlend(Event_AttackCrossbowBothLeftReload, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothLeftReload, blend_type) end elseif c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftStart, blend_type) else ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowBothLeftStart, blend_type) end elseif request == ATTACK_REQUEST_ATTACK_WHILE_GUARD then guard_hand = HAND_LEFT local index = env(GetGuardMotionCategory, HAND_LEFT) if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_DUELING_SHIELD then index = 3 end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_TORCH) == TRUE then index = 2 SetVariable("IsAttackWhileTorchGuard", TRUE) else SetVariable("IsAttackWhileTorchGuard", FALSE) end SetVariable("IndexAttackWhileGuard", index) ExecEventAllBody("W_AttackRightWhileGuard") else return FALSE end if is_find_atk == TRUE then SetInterruptType(INTERRUPT_FINDATTACK) end if style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT end SetAttackHand(atk_hand) SetGuardHand(guard_hand) if is_Dual == TRUE then act(SetThrowPossibilityState_Defender, 400000) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() WeaponAttackDetection() return TRUE end -- Checks the max combo length function IsEnableNextAttack(cur_attack_num, hand) local style = c_Style if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local max_num = GetAttackMaxNumber(hand) DebugPrint(3, env(GetEquipWeaponCategory, hand)) DebugPrint(4, max_num) DebugPrint(5, cur_attack_num) if cur_attack_num < max_num then return TRUE else return FALSE end end -- Get the maximum supported combo length for each type function GetAttackMaxNumber(hand) local kind = env(GetEquipWeaponCategory, hand) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) local max_num = 1 if sp_kind == 249 then if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then max_num = 4 elseif hand == HAND_LEFT then max_num = 5 else max_num = 5 end return max_num end if sp_kind == 255 then if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then max_num = 4 elseif hand == HAND_LEFT then max_num = 6 else max_num = 6 end return max_num end if sp_kind == 257 then if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then max_num = 4 elseif hand == HAND_LEFT then max_num = 6 else max_num = 6 end return max_num end if sp_kind == 258 then if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then max_num = 4 elseif hand == HAND_LEFT then max_num = 5 else max_num = 5 end return max_num end -- Halberd of Archea if sp_kind == 747 then if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then max_num = 5 elseif hand == HAND_LEFT then max_num = 3 else max_num = 4 end return max_num end -- Dragon Cult Daggers if sp_kind == 921 and (c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH) then return 4 end if kind == WEAPON_CATEGORY_ARROW or kind == WEAPON_CATEGORY_LARGE_ARROW or kind == WEAPON_CATEGORY_CROSSBOW or kind == WEAPON_CATEGORY_SMALL_ARROW then max_num = 1 elseif kind == WEAPON_CATEGORY_EXTRALARGE_SWORD or kind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER or kind == WEAPON_CATEGORY_LARGE_SPEAR or kind == WEAPON_CATEGORY_LARGE_SHIELD or kind == WEAPON_CATEGORY_STAFF then max_num = 3 elseif kind == WEAPON_CATEGORY_TORCH or kind == WEAPON_CATEGORY_LARGE_SWORD or kind == WEAPON_CATEGORY_FLAIL or kind == WEAPON_CATEGORY_LARGE_AX or kind == WEAPON_CATEGORY_LARGE_HAMMER or kind == WEAPON_CATEGORY_SPEAR or kind == WEAPON_CATEGORY_HALBERD or kind == WEAPON_CATEGORY_LARGE_CURVEDSWORD or kind == WEAPON_CATEGORY_SMALL_SHIELD or kind == WEAPON_CATEGORY_MIDDLE_SHIELD or kind == WEAPON_CATEGORY_LARGE_SCYTHE or kind == WEAPON_CATEGORY_WHIP or kind == WEAPON_CATEGORY_PERFUME_BOTTLE or kind == WEAPON_CATEGORY_DUELING_SHIELD or kind == WEAPON_CATEGORY_LARGE_KATANA or kind == WEAPON_CATEGORY_BEAST_CLAW then max_num = 4 elseif kind == WEAPON_CATEGORY_STRAIGHT_SWORD or kind == WEAPON_CATEGORY_TWINBLADE or kind == WEAPON_CATEGORY_KATANA or kind == WEAPON_CATEGORY_AX or kind == WEAPON_CATEGORY_HAMMER or kind == WEAPON_CATEGORY_LARGE_RAPIER or kind == WEAPON_CATEGORY_LIGHT_LARGE_SWORD then max_num = 5 elseif kind == WEAPON_CATEGORY_SHORT_SWORD or kind == WEAPON_CATEGORY_CLAW or kind == WEAPON_CATEGORY_RAPIER or kind == WEAPON_CATEGORY_CURVEDSWORD or kind == WEAPON_CATEGORY_FIST or kind == WEAPON_CATEGORY_MARTIAL_ARTS or kind == WEAPON_CATEGORY_THROW_DAGGER or kind == WEAPON_CATEGORY_BACKHAND_SWORD then max_num = 6 end return max_num end -- Get the maximum supported combo length for each dual type function GetDualAttackMaxNumber(hand) local kind = env(GetEquipWeaponCategory, hand) local max_num = 1 if kind == WEAPON_CATEGORY_EXTRALARGE_SWORD or kind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER or kind == WEAPON_CATEGORY_LARGE_SPEAR or kind == WEAPON_CATEGORY_LARGE_SWORD or kind == WEAPON_CATEGORY_LARGE_AX or kind == WEAPON_CATEGORY_LARGE_HAMMER or kind == WEAPON_CATEGORY_SPEAR or kind == WEAPON_CATEGORY_HALBERD or kind == WEAPON_CATEGORY_LARGE_CURVEDSWORD or kind == WEAPON_CATEGORY_LARGE_SCYTHE or kind == WEAPON_CATEGORY_WHIP or kind == WEAPON_CATEGORY_LARGE_KATANA then max_num = 3 elseif kind == WEAPON_CATEGORY_STRAIGHT_SWORD or kind == WEAPON_CATEGORY_TWINBLADE or kind == WEAPON_CATEGORY_KATANA or kind == WEAPON_CATEGORY_AX or kind == WEAPON_CATEGORY_HAMMER or kind == WEAPON_CATEGORY_FLAIL or kind == WEAPON_CATEGORY_LARGE_RAPIER or kind == WEAPON_CATEGORY_SHORT_SWORD or kind == WEAPON_CATEGORY_RAPIER or kind == WEAPON_CATEGORY_CURVEDSWORD or kind == WEAPON_CATEGORY_PERFUME_BOTTLE or kind == WEAPON_CATEGORY_DUELING_SHIELD or kind == WEAPON_CATEGORY_LIGHT_LARGE_SWORD or kind == WEAPON_CATEGORY_BEAST_CLAW then max_num = 4 elseif kind == WEAPON_CATEGORY_CLAW or kind == WEAPON_CATEGORY_FIST or kind == WEAPON_CATEGORY_THROW_DAGGER or kind == WEAPON_CATEGORY_MARTIAL_ARTS or kind == WEAPON_CATEGORY_BACKHAND_SWORD then max_num = 6 end return max_num end function IsEnableSpecialAttack(hand) -- enable fients local style = c_Style if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local kind = env(GetEquipWeaponCategory, hand) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if sp_kind == 254 or sp_kind == 251 then return TRUE end if sp_kind == 940 then --daergraf claws return TRUE end if GetEquipType(hand, WEAPON_CATEGORY_RAPIER, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_LARGE_RAPIER, WEAPON_CATEGORY_BEAST_CLAW, WEAPON_CATEGORY_THROW_DAGGER, WEAPON_CATEGORY_LARGE_KATANA, WEAPON_CATEGORY_PERFUME_BOTTLE) == TRUE then return TRUE elseif env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 943 then -- Conv Fingerslayer blade return TRUE elseif env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 988 then -- Conv Smithscript Rosary return TRUE else return FALSE end end function IsEnableDualWielding() if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then return -1 end local rightKind = env(GetEquipWeaponCategory, HAND_RIGHT) local leftKind = env(GetEquipWeaponCategory, HAND_LEFT) local rightSpecialKind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) local leftSpecialKind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local rightWeaponId = GetWeaponID(HAND_RIGHT) local leftWeaponId = GetWeaponID(HAND_LEFT) if rightKind == WEAPON_CATEGORY_SHORT_SWORD then if rightSpecialKind == 104 then if leftSpecialKind == 104 then return HAND_RIGHT end elseif rightSpecialKind == 262 then if leftSpecialKind == 262 then return HAND_RIGHT end elseif leftKind == WEAPON_CATEGORY_SHORT_SWORD and leftSpecialKind ~= 104 and leftSpecialKind ~= 262 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_CLAW then if leftKind == WEAPON_CATEGORY_CLAW then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_STRAIGHT_SWORD then if leftKind == WEAPON_CATEGORY_STRAIGHT_SWORD or leftSpecialKind == 217 then -- 217 = Yura's Kanabo return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_TWINBLADE then if leftKind == WEAPON_CATEGORY_TWINBLADE then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_SWORD or rightSpecialKind == 219 then if leftKind == WEAPON_CATEGORY_LARGE_SWORD or leftSpecialKind == 219 then -- 219 = Dyru's Greatsword return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_EXTRALARGE_SWORD then if leftKind == WEAPON_CATEGORY_EXTRALARGE_SWORD then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_RAPIER then if leftKind == WEAPON_CATEGORY_RAPIER or leftSpecialKind == 262 or leftWeaponId == "1020000" then -- 262 = Main-gauche | 1020000 = Parrying Dagger return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_CURVEDSWORD then if leftKind == WEAPON_CATEGORY_CURVEDSWORD then return HAND_RIGHT elseif rightWeaponId == "7500000" and leftWeaponId == "1180000" then return HAND_RIGHT -- Deathrite Dagger + Spirit Sword end elseif rightKind == WEAPON_CATEGORY_KATANA then if leftKind == WEAPON_CATEGORY_KATANA or leftSpecialKind == 104 then -- 104 = Wakizashi return HAND_RIGHT elseif rightSpecialKind == 646 and leftWeaponId == "1170000" then return HAND_RIGHT -- Midnight Dagger + Star Shadow end elseif rightKind == WEAPON_CATEGORY_HAMMER or rightSpecialKind == 217 then -- 217 = Yura's Kanabo if leftKind == WEAPON_CATEGORY_HAMMER or leftSpecialKind == 217 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_AX then if leftKind == WEAPON_CATEGORY_AX then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER then if leftKind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_AX and rightSpecialKind ~= 219 then -- 219 = Dyru's Greatsword if leftKind == WEAPON_CATEGORY_LARGE_AX and leftSpecialKind ~= 219 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_HAMMER then if leftKind == WEAPON_CATEGORY_LARGE_HAMMER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_FLAIL then if leftKind == WEAPON_CATEGORY_FLAIL then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_SPEAR then if leftKind == WEAPON_CATEGORY_SPEAR then return HAND_RIGHT elseif rightWeaponId == "16040000" and leftWeaponId == "5010000" then return HAND_RIGHT -- Cleanrot Knight's Sword + Cleanrot Spear end elseif rightKind == WEAPON_CATEGORY_LARGE_SPEAR then if leftKind == WEAPON_CATEGORY_LARGE_SPEAR then return HAND_RIGHT elseif rightWeaponId == "17080000" and leftWeaponId == "5100000" then return HAND_RIGHT -- Spear of the Dreaming + Mystic Huntress Estoc end elseif rightKind == WEAPON_CATEGORY_LARGE_RAPIER then if leftKind == WEAPON_CATEGORY_LARGE_RAPIER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_HALBERD then if leftKind == WEAPON_CATEGORY_HALBERD then return HAND_RIGHT elseif rightSpecialKind == 59 and leftKind == WEAPON_CATEGORY_LARGE_KATANA then return HAND_RIGHT -- Odachi end elseif rightKind == WEAPON_CATEGORY_LARGE_CURVEDSWORD then if leftKind == WEAPON_CATEGORY_LARGE_CURVEDSWORD then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_FIST then if leftSpecialKind == 988 or rightSpecialKind == 988 then -- smithscript rosary -- disable dual wield return -1 elseif leftKind == WEAPON_CATEGORY_FIST then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_WHIP then if leftKind == WEAPON_CATEGORY_WHIP then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_SCYTHE then if leftKind == WEAPON_CATEGORY_LARGE_SCYTHE then return HAND_RIGHT elseif rightWeaponId == "19020000" and leftWeaponId == "5010000" then return HAND_RIGHT -- Cleanrot Knight's Sword + Halo Scythe end elseif rightKind == WEAPON_CATEGORY_THROW_DAGGER then if leftKind == WEAPON_CATEGORY_THROW_DAGGER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_MARTIAL_ARTS then if leftKind == WEAPON_CATEGORY_MARTIAL_ARTS then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_PERFUME_BOTTLE then if leftKind == WEAPON_CATEGORY_PERFUME_BOTTLE then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_DUELING_SHIELD then return -1 elseif rightKind == WEAPON_CATEGORY_BACKHAND_SWORD then if leftKind == WEAPON_CATEGORY_BACKHAND_SWORD then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LIGHT_LARGE_SWORD then if leftKind == WEAPON_CATEGORY_LIGHT_LARGE_SWORD then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_KATANA or rightSpecialKind == 59 then -- Odachi if leftKind == WEAPON_CATEGORY_LARGE_KATANA then return HAND_RIGHT elseif leftSpecialKind == 59 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_BEAST_CLAW and leftKind == WEAPON_CATEGORY_BEAST_CLAW then return HAND_RIGHT end return -1 end function IsUseStealthAttack(is_dual) local spCategories = { [110] = true, -- Broadsword [207] = true, -- Serpent-Hunter [255] = true, -- Falx / Horned Warrior's Sword [257] = true, -- Dancing Blade of Ranah [634] = true, -- Guardian Spearblade [641] = true, -- Carwyn's Épée [647] = true, -- Godskin Flayer [758] = true, -- Storm Curved Swords [759] = true, -- Lightning Colossal Swords [832] = true, -- Starscourge Greatsword [852] = true, -- Ornamental Straight Sword } if is_dual == TRUE then if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STRAIGHT_SWORD, WEAPON_CATEGORY_TWINBLADE, WEAPON_CATEGORY_RAPIER, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_SPEAR, WEAPON_CATEGORY_LARGE_SPEAR, WEAPON_CATEGORY_BACKHAND_SWORD) == TRUE then return TRUE end elseif c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end local specialcategory = env(GetEquipWeaponSpecialCategoryNumber, hand) if spCategories[specialcategory] then return FALSE end -- 182 Morning Star -- 207 Serpent-Hunter if specialcategory == 182 or specialcategory == 207 then return TRUE end --smithcript rosary if specialcategory == 988 then return TRUE end if GetEquipType(hand, WEAPON_CATEGORY_TORCH, WEAPON_CATEGORY_STRAIGHT_SWORD, WEAPON_CATEGORY_TWINBLADE, WEAPON_CATEGORY_EXTRALARGE_SWORD, WEAPON_CATEGORY_RAPIER, WEAPON_CATEGORY_LARGE_RAPIER, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_BACKHAND_SWORD) == TRUE then return TRUE end else local hand = HAND_RIGHT local specialcategory = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if specialcategory == 110 then return FALSE end if specialcategory == 182 or specialcategory == 207 then return TRUE end --smithcript rosary if specialcategory == 988 then return TRUE end if GetEquipType(hand, WEAPON_CATEGORY_TORCH, WEAPON_CATEGORY_STRAIGHT_SWORD, WEAPON_CATEGORY_TWINBLADE, WEAPON_CATEGORY_EXTRALARGE_SWORD, WEAPON_CATEGORY_RAPIER, WEAPON_CATEGORY_LARGE_RAPIER, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_BACKHAND_SWORD) == TRUE then return TRUE end end return FALSE end function ExecArtsStance(blend_type) if c_IsEnableSwordArts == FALSE then return FALSE end local arts_id = c_SwordArtsID local is_arrow = GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_LARGE_ARROW) local is_crossbow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) if c_Style == HAND_RIGHT and (is_arrow == TRUE or is_crossbow == TRUE) then return FALSE end if IsAttackStanceArts(arts_id) == TRUE then if env(GetStamina) <= 0 then return FALSE end if env(ActionRequest, ACTION_ARM_L2) == FALSE then return FALSE end elseif GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then if env(ActionRequest, ACTION_ARM_L2) == FALSE or env(ActionDuration, ACTION_ARM_L2) <= 0 then return FALSE end elseif IsStanceArts(arts_id) == TRUE or (GetWeaponID(c_SwordArtsHand, 2) == "12540000" and arts_id == 149) then -- egg mace if env(ActionDuration, ACTION_ARM_L2) <= 0 then return FALSE end else return FALSE end if c_IsStealth == TRUE then blend_type = ALLBODY end if blend_type == ALLBODY and MoveStart(LOWER, Event_Move, FALSE) == TRUE then blend_type = UPPER end SetVariable("SwordArtsOneShotComboCategory", 0) if c_SwordArtsID == 318 or c_SwordArtsID == 287 or c_SwordArtsID == 299 or c_SwordArtsID == 266 or c_SwordArtsID == 340 then -- conv marika hammer SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) else SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) end if env(GetSpEffectID, 19921) == TRUE then ExecEventHalfBlendNoReset(Event_DrawStanceRightLoop, blend_type) else ExecEventHalfBlend(Event_DrawStanceRightStart, blend_type) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecArtsStanceOnCancelTiming(blend_type) if env(IsWeaponCancelPossible) == TRUE and ExecArtsStance(blend_type) == TRUE then return TRUE end return FALSE end function ExecMagic(quick_type, blend_type, is_ride) if c_HasActionRequest == FALSE then return FALSE end if env(GetStamina) <= 0 then return FALSE end if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return FALSE end if env(IsMagicUseMenuOpened) == TRUE then return FALSE end if c_IsStealth == TRUE then blend_type = ALLBODY end local style = c_Style local magic_hand = HAND_RIGHT local wep_hand = HAND_RIGHT local delayActRequestNo = -1 local is_samagic = FALSE local buttonR = ACTION_ARM_MAGIC_R local buttonL = ACTION_ARM_MAGIC_L if IsWeaponCatalyst(HAND_RIGHT, true) == TRUE then buttonR = ACTION_ARM_MAGIC_R2 end if IsWeaponCatalyst(HAND_LEFT) == TRUE or is_ride == FALSE then buttonL = ACTION_ARM_MAGIC_L2 end if env(ActionRequest, buttonL) == TRUE and env(ActionRequest, buttonR) == FALSE and (is_ride == TRUE and c_SwordArtsID ~= SPELLCASTING_ASH) then ResetRequest() return FALSE end local atkRequest = GetAttackRequest(FALSE, is_ride) local isCasterAsh = FALSE -- Normal Catalysts -- R1/L1 (while riding) if env(ActionRequest, ACTION_ARM_MAGIC_R) == TRUE or env(ActionRequest, ACTION_ARM_MAGIC_L) == TRUE and is_ride == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_R if env(ActionRequest, ACTION_ARM_MAGIC_L) == TRUE and is_ride == TRUE then LastHeldMagicButton = ACTION_ARM_L1 else LastHeldMagicButton = ACTION_ARM_R1 end if style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_LEFT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_RIGHT end -- R2 elseif env(ActionRequest, ACTION_ARM_MAGIC_R2) == TRUE and not (c_SwordArtsID == SPELLCASTING_ASH and c_SwordArtsHand == HAND_RIGHT and (style == HAND_RIGHT or style == HAND_LEFT_BOTH)) then delayActRequestNo = ACTION_ARM_MAGIC_R2 LastHeldMagicButton = ACTION_ARM_R2 if style == HAND_LEFT_BOTH then if IsWeaponCatalyst(HAND_LEFT, true) == FALSE then return FALSE end wep_hand = HAND_LEFT else if IsWeaponCatalyst(HAND_RIGHT, true) == FALSE then return FALSE end wep_hand = HAND_RIGHT end -- L1 elseif env(ActionRequest, ACTION_ARM_MAGIC_L) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_L LastHeldMagicButton = ACTION_ARM_L1 if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then return FALSE end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT act(DebugLogOutput, "MagicLeft") -- L2 elseif env(ActionRequest, ACTION_ARM_MAGIC_L2) == TRUE and is_ride == FALSE then delayActRequestNo = ACTION_ARM_MAGIC_L2 LastHeldMagicButton = ACTION_ARM_L2 if style == HAND_RIGHT then if IsWeaponCatalyst(HAND_LEFT) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT if c_SwordArtsID == SPELLCASTING_ASH and c_SwordArtsHand == HAND_LEFT then isCasterAsh = TRUE end else return FALSE end elseif c_SwordArtsID == SPELLCASTING_ASH and ( atkRequest == SWORDARTS_REQUEST_RIGHT_NORMAL or atkRequest == SWORDARTS_REQUEST_BOTH_NORMAL or (is_ride == TRUE and atkRequest == 4 and env(ActionDuration, ACTION_ARM_L2) > 0 and env(ActionDuration, ACTION_ARM_R2) <= 0) or hasLanded and env(ActionDuration, ACTION_ARM_L2) > 0 and IsNodeActive(unpack(ROLLING_CMSGS)) == FALSE) then act(UpdateMagicIdToActive) LastHeldMagicButton = ACTION_ARM_L2 if style == HAND_RIGHT_BOTH then delayActRequestNo = ACTION_ARM_MAGIC_R2 elseif style == HAND_LEFT_BOTH then delayActRequestNo = ACTION_ARM_MAGIC_R2 wep_hand = HAND_LEFT else delayActRequestNo = ACTION_ARM_MAGIC_L2 wep_hand = c_SwordArtsHand magic_hand = c_SwordArtsHand end isCasterAsh = TRUE else return FALSE end if env(IsMagicUseMenuOpening, wep_hand) == TRUE then ResetRequest() act(OpenMenuWhenUsingMagic, delayActRequestNo) return TRUE end act(DecideMagicUse) act(NotifyAIMagicCast) local magic_index = env(GetMagicAnimType) local shouldFail = false -- Required to make Immutable Shield not A pose when casting with an ash on a shield if magic_index == MAGIC_REQUEST_ORDER_SHIELD and isCasterAsh and wep_hand ~= HAND_RIGHT then if c_SwordArtsID == SPELLCASTING_ASH and env(GetSwordArtID, HAND_LEFT) == env(GetSwordArtID, HAND_RIGHT) then wep_hand = HAND_RIGHT magic_hand = HAND_RIGHT else shouldFail = true end end g_MagicIndex = magic_index g_Magichand = wep_hand local lastMagicMem = lastUsedMagicAnim lastUsedMagicAnim = magic_index if blend_type == ALLBODY and is_ride == FALSE then local move_event = Event_Move if IsStealthMagic(magic_index) == TRUE and c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end if env(IsCOMPlayer) == TRUE then local weaponID = GetWeaponID(wep_hand) if GetParamValue(PARAM.EquipParamWeapon.REQUIREMENT_INTELLIGENCE, weaponID) > GetPointerValue(CHR_INS_BASE.PLAYER_GAME_DATA.INTELLIGENCE) or GetParamValue(PARAM.EquipParamWeapon.REQUIREMENT_FAITH, weaponID) > GetPointerValue(CHR_INS_BASE.PLAYER_GAME_DATA.FAITH) or GetParamValue(PARAM.EquipParamWeapon.REQUIREMENT_ARCANE, weaponID) > GetPointerValue(CHR_INS_BASE.PLAYER_GAME_DATA.ARCANE) then shouldFail = true end end if env(IsMagicUseable, wep_hand, 0) == FALSE or shouldFail then act(DebugLogOutput, "Event_MagicInvalid_Cannot_Use_Magic") SetVariable("IndexMagicHand", magic_hand) if is_ride == TRUE then ExecEventAllBody("W_RideMagicInvalid") else ExecEventHalfBlend(Event_MagicInvalid, blend_type) end act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end if wep_hand == HAND_LEFT then act(ClearSpEffect, 3000501) -- Right Hand act(AddSpEffect, 3000500) -- Left Hand else act(ClearSpEffect, 3000500) -- Left Hand act(AddSpEffect, 3000501) -- Right Hand end if magic_index == 254 or magic_index == 255 then SetVariable("IndexMagicHand", magic_hand) if is_ride == TRUE then ExecEventAllBody("W_RideMagicInvalid") else act(DebugLogOutput, "Event_MagicInvalid_InvalidMagic") ExecEventHalfBlend(Event_MagicInvalid, blend_type) end act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end -- Check if Player is Enchanting a Weapon in the Left Hand if IsWeaponEnchantMagic() == TRUE and c_Style == HAND_LEFT_BOTH then SetVariable("IndexMagicHand", magic_hand) act(DebugLogOutput, "Event_MagicInvalid_Left") ExecEventHalfBlend(Event_MagicInvalid, blend_type) act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end -- Check if the Animation Type of the Magic is something related to Magic for Shields if magic_index == MAGIC_REQUEST_ORDER_SHIELD then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_SHIELD) == TRUE then SetVariable("MagicRight_ShieldCategory", 1) end else SetVariable("MagicRight_ShieldCategory", 0) end if magic_index == MAGIC_REQUEST_GRAVITY or magic_index == MAGIC_REQUEST_METEOR or magic_index == MAGIC_REQUEST_BLASTING or magic_index == MAGIC_REQUEST_DRILL or magic_index == MAGIC_REQUEST_MAGIC_SPARK or magic_index == 115 or magic_index == 120 or magic_index == 121 or magic_index == 157 or magic_index == 82 or magic_index == 150 or magic_index == 156 or magic_index == 161 then if IsWeaponCatalyst(wep_hand) == TRUE or isCasterAsh == TRUE then SetVariable("Magic_SpecialStaffCategory", 2) else SetVariable("Magic_SpecialStaffCategory", 0) end elseif magic_index == 141 or magic_index == 128 or magic_index == 146 then if env(GetEquipWeaponSpecialCategoryNumber, wep_hand) == 290 or isCasterAsh == TRUE then SetVariable("Magic_SpecialStaffCategory", 1) else SetVariable("Magic_SpecialStaffCategory", 0) end else SetVariable("Magic_SpecialStaffCategory", 0) end if magic_index == MAGIC_REQUEST_WEAPON_ENCHANT or magic_index == MAGIC_REQUEST_THUNDER_ENCHANT or magic_index == MAGIC_REQUEST_WEAPON_ENCHANT_B or magic_index == MAGIC_REQUEST_HOLY_ENCHANT then if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_DUELING_SHIELD) == TRUE then SetVariable("Magic_DuelingShieldCategory", 1) else SetVariable("Magic_DuelingShieldCategory", 0) end else SetVariable("Magic_DuelingShieldCategory", 0) end local is_atk_auto_aim = FALSE if magic_index == MAGIC_REQUEST_WHIP or magic_index == MAGIC_REQUEST_SLASH or magic_index == MAGIC_REQUEST_QUICKSLASH or magic_index == MAGIC_REQUEST_FLAME_GRAB or magic_index == MAGIC_REQUEST_CRUSH or magic_index == MAGIC_REQUEST_CHOP or magic_index == MAGIC_REQUEST_SCYTHE then is_atk_auto_aim = TRUE end if magic_index == 127 and env(GetSpEffectID, 19975) == TRUE then return TRUE end TriggerBeforeSpellcast() if ExecComboMagic(magic_hand, blend_type, lastMagicMem, magic_index) == TRUE then elseif ExecQuickMagic(magic_hand, quick_type, blend_type) == TRUE then elseif ExecStealthMagic(magic_hand, magic_index, blend_type) == TRUE then elseif is_ride == TRUE then ExecEventAllBody("W_RideMagicLaunch") elseif magic_hand == HAND_RIGHT and (magic_index ~= MAGIC_REQUEST_MAD_THROW or c_Style ~= HAND_LEFT_BOTH) then ExecEventHalfBlend(Event_MagicLaunchRight, blend_type) else ExecEventHalfBlend(Event_MagicLaunchLeft, blend_type) end act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecQuickMagic(magic_hand, quick_type, blend_type) if env(IsOnMount) == TRUE or IsQuickMagic() == FALSE then return FALSE end if quick_type == QUICKTYPE_NORMAL or quick_type == QUICKTYPE_RUN then return FALSE elseif quick_type == QUICKTYPE_DASH then if magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireRightDash, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireLeftDash, blend_type) return TRUE end elseif quick_type == QUICKTYPE_ROLLING then if magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireRightStep, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireLeftStep, blend_type) return TRUE end elseif quick_type == QUICKTYPE_BACKSTEP then if magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireRightBackStep, blend_type) return TRUE else ExecEventHalfBlend(Event_QuickMagicFireLeftBackStep, blend_type) return TRUE end elseif quick_type == QUICKTYPE_ATTACK or quick_type == QUICKTYPE_COMBO then if ForwardLeg() == 1 then if magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireRightAttackRight, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireLeftAttackRight, blend_type) return TRUE end elseif magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireRightAttackLeft, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_QuickMagicFireLeftAttackLeft, blend_type) return TRUE end end return FALSE end function ExecComboMagic(magic_hand, blend_type, lastUsedMagicAnim, magicAnim) -- 100600 "[HKS] Right Combo Magic 1: Window" -- 100601 "[HKS] Right Combo Magic 2: Window" -- 100605 "[HKS] Left Combo Magic 1: Window" -- 100606 "[HKS] Left Combo Magic 2: Window" if lastUsedMagicAnim ~= magicAnim then return FALSE end if IsComboMagic() == FALSE then return FALSE end if env(IsOnMount) == TRUE then if env(GetSpEffectID, 100600) == TRUE then TriggerBeforeSpellcast() ExecEventAllBody("W_RideMagicFireCombo1") return TRUE elseif env(GetSpEffectID, 100601) == TRUE then TriggerBeforeSpellcast() ExecEventAllBody("W_RideMagicFireCombo2") return TRUE else return FALSE end elseif magic_hand == HAND_RIGHT then if env(GetSpEffectID, 100600) == TRUE then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_MagicFireRight2, blend_type) return TRUE elseif env(GetSpEffectID, 100601) == TRUE then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_MagicFireRight3, blend_type) return TRUE else return FALSE end elseif env(GetSpEffectID, 100605) == TRUE then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_MagicFireLeft2, blend_type) return TRUE elseif env(GetSpEffectID, 100606) == TRUE then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_MagicFireLeft3, blend_type) return TRUE else return FALSE end end function ExecStealthMagic(magic_hand, magic_type, blend_type) if c_IsStealth == FALSE then return FALSE end if IsStealthMagic(magic_type) == FALSE then return FALSE end if magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_StealthMagicRightLaunch, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_StealthMagicLeftLaunch, blend_type) return TRUE end end function ExecRollingMagic(magic_hand, magic_type, blend_type) if IsRollingMagic(magic_type) == FALSE then return FALSE end local rollingAngle = GetVariable("MoveAngle") local turn_target_angle = 0 local rollingDirection = 0 local turn_angle_real = 200 if GetVariable("IsLockon") == false and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE or env(GetSpEffectID, 100002) == TRUE then rollingDirection = 0 else if rollingAngle <= GetVariable("RollingAngleThresholdRightFrontTest") and rollingAngle >= GetVariable("RollingAngleThresholdLeftFrontTest") then rollingDirection = 0 turn_target_angle = rollingAngle elseif rollingAngle > GetVariable("RollingAngleThresholdRightFrontTest") and rollingAngle < GetVariable("RollingAngleThresholdRightBackTest") then rollingDirection = 3 turn_target_angle = rollingAngle - 90 elseif rollingAngle < GetVariable("RollingAngleThresholdLeftFrontTest") and rollingAngle > GetVariable("RollingAngleThresholdLeftBackTest") then rollingDirection = 2 turn_target_angle = rollingAngle + 90 else rollingDirection = 1 turn_target_angle = rollingAngle - 180 end turn_angle_real = math.abs(GetVariable("TurnAngle") - rollingAngle) if turn_angle_real > 180 then turn_angle_real = 360 - turn_angle_real end end SetVariable("RollingMagicDirection", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) SetVariable("TurnAngleReal", turn_angle_real) if GetVariable("MoveSpeedLevel") < 0.1 then if magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_MagicFireRight, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_MagicFireLeft, blend_type) return TRUE end elseif magic_hand == HAND_RIGHT then TriggerBeforeSpellcast() ExecEventHalfBlend(Event_RollingMagicRight, blend_type) return TRUE else TriggerBeforeSpellcast() ExecEventHalfBlend(Event_RollingMagicLeft, blend_type) return TRUE end end function ExecGesture() if c_HasActionRequest == FALSE then return FALSE end if env(ActionRequest, ACTION_ARM_GESTURE) == FALSE then return FALSE end local request = env(GetGestureRequestNumber) if request == 109 then request = 108 elseif request == 113 or request == 116 then request = 110 end local animID = 80000 + request * 10 SetVariable("GestureID", request) if request == INVALID then return FALSE end local isloop = FALSE if env(DoesAnimExist, animID + 1) == TRUE then isloop = TRUE end if isloop == TRUE then if GetLocomotionState() == PLAYER_STATE_MOVE then ExecEventHalfBlend(Event_GestureLoopStart, UPPER) return TRUE else ExecEventHalfBlend(Event_GestureLoopStart, ALLBODY) return TRUE end elseif GetLocomotionState() == PLAYER_STATE_MOVE then ExecEventHalfBlend(Event_GestureStart, UPPER) return TRUE else ExecEventHalfBlend(Event_GestureStart, ALLBODY) return TRUE end end function ExecStealthItem(blend_type, item_type) if item_type ~= ITEM_RECOVER and item_type ~= ITEM_SOUL and item_type ~= ITEM_DRINK and item_type ~= ITEM_DRINK_MP and item_type ~= ITEM_NO_DRINK and item_type ~= ITEM_EATJERKY and item_type ~= ITEM_ELIXIR and item_type ~= ITEM_SUMMONBUDDY and item_type ~= ITEM_RETURNBUDDY and item_type ~= ITEM_ELIXIR2 and item_type ~= ITEM_INVALID then return FALSE end if blend_type == ALLBODY and MoveStart(LOWER, Event_Stealth_Move, FALSE) == TRUE then blend_type = UPPER end if item_type == ITEM_RECOVER or item_type == ITEM_EATJERKY then if ConsumeItemDetection() then return FALSE end end -- Flasks if item_type == ITEM_DRINK or item_type == ITEM_DRINK_MP then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then ExecEventHalfBlend(Event_StealthItemDrinkNothing, blend_type) elseif IsNodeActive("StealthItemDrinking_Upper_CMSG") == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_StealthItemDrinking, blend_type) else SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_StealthItemDrinkStart, blend_type) end elseif item_type == ITEM_NO_DRINK then if IsNodeActive("StealthItemDrinkingMP_Upper_CMSG") == TRUE or IsNodeActive("StealthItemDrinking_Upper_CMSG") == TRUE then ExecEventHalfBlend(Event_StealthItemDrinkEmpty, blend_type) else ExecEventHalfBlend(Event_StealthItemDrinkStart, blend_type) end elseif IsNodeActive("StealthItemOneShot_Blend") == TRUE then SetVariable("IndexItemUseAnim_SelfTrans", item_type) ExecEventHalfBlend(Event_StealthItemOneShot_SelfTrans, blend_type) else SetVariable("IndexItemUseAnim", item_type) ExecEventHalfBlend(Event_StealthItemOneShot, blend_type) end act(SetIsItemAnimationPlaying) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function IsUseStaminaItem(item_type) if item_type == ITEM_THROW_KNIFE or item_type == ITEM_THROW_BOTTLE or item_type == ITEM_QUICK_THROW_KNIFE or item_type == ITEM_THROW_SPEAR then return TRUE end return FALSE end function ExecItem(quick_type, blend_type) if c_HasActionRequest == FALSE then return FALSE end if env(ActionRequest, ACTION_ARM_USE_ITEM) == FALSE then return FALSE end if env(IsItemUseMenuOpened) == TRUE then return FALSE end if env(IsItemUseMenuOpening) == TRUE then ResetRequest() act(OpenMenuWhenUsingItem) return TRUE end act(UseItemDecision) local item_type = env(GetItemAnimType) local hand = HAND_RIGHT local kind = env(GetEquipWeaponCategory, hand) if IsUseStaminaItem(item_type) == TRUE and env(GetStamina) <= 0 then return FALSE end if blend_type == ALLBODY then if c_IsStealth == TRUE then if MoveStart(LOWER, Event_Stealth_Move, FALSE) == TRUE then blend_type = UPPER end elseif MoveStart(LOWER, Event_Move, FALSE) == TRUE then blend_type = UPPER end end if c_IsStealth == TRUE then if ExecStealthItem(blend_type, item_type) == TRUE then return TRUE end blend_type = ALLBODY end if item_type == ITEM_RECOVER then if ConsumeItemDetection() then return FALSE end ExecEventHalfBlend(Event_ItemRecover, blend_type) elseif item_type == ITEM_WEAPON_ENCHANT then if kind == WEAPON_CATEGORY_BACKHAND_SWORD then SetVariable("ItemWeaponType", 1) elseif kind == WEAPON_CATEGORY_DUELING_SHIELD then SetVariable("ItemWeaponType", 2) else SetVariable("ItemWeaponType", 0) end ExecEventHalfBlend(Event_ItemWeaponEnchant, blend_type) elseif item_type == ITEM_THROW_KNIFE then ExecEventHalfBlend(Event_ItemThrowKnife, blend_type) elseif item_type == ITEM_THROW_BOTTLE then ExecEventHalfBlend(Event_ItemThrowBottle, blend_type) elseif item_type == ITEM_MEGANE then if env(GetStateChangeType, 15) == TRUE then ExecEventHalfBlend(Event_ItemMeganeEnd, ALLBODY) else ExecEventHalfBlend(Event_ItemMeganeStart, ALLBODY) end elseif item_type == ITEM_REPAIR then ExecEventHalfBlend(Event_ItemWeaponRepair, ALLBODY) elseif item_type == ITEM_PRAY then ExecEventHalfBlend(Event_ItemPrayMulti, blend_type) elseif item_type == ITEM_TRAP then ExecEventHalfBlend(Event_ItemTrap, blend_type) elseif item_type == ITEM_MESSAGE then ExecEventHalfBlend(Event_ItemMessage, ALLBODY) elseif item_type == ITEM_SOUL then ExecEventHalfBlend(Event_ItemSoul, blend_type) elseif item_type == ITEM_DRINK then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then ExecEventHalfBlend(Event_ItemDrinkNothing, blend_type) elseif IsNodeActive("ItemDrinking_Upper_CMSG") == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinking, blend_type) else SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinkStart, blend_type) end elseif item_type == ITEM_TRANSFORM_DRAGONPRIEST then -- if env(GetSpEffectID, 19980) == TRUE or env(GetSpEffectID, 19981) == TRUE then -- SetVariable("ItemTransformType", 1) -- else -- SetVariable("ItemTransformType", 0) -- end ExecEventHalfBlend(Event_ItemTransformDragonPriest, blend_type) elseif item_type == ITEM_DRAGONTHROWSPEAR then ExecEventHalfBlend(Event_ItemDragonThrowSpearMax, blend_type) elseif item_type == ITEM_SHOCK_WAVE then ExecEventHalfBlend(Event_ItemShockWeaveStart, blend_type) elseif item_type == ITEM_THORN then ExecEventHalfBlend(Event_ItemThorn, blend_type) elseif item_type == ITEM_QUICK_WEAPON_ENCHANT then if kind == WEAPON_CATEGORY_DUELING_SHIELD then SetVariable("ItemWeaponType", 1) else SetVariable("ItemWeaponType", 0) end if quick_type == QUICKTYPE_NORMAL or quick_type == QUICKTYPE_RUN then ExecEventHalfBlend(Event_QuickItemEnchantNormal, blend_type) elseif quick_type == QUICKTYPE_DASH then ExecEventHalfBlend(Event_QuickItemEnchantDash, blend_type) elseif quick_type == QUICKTYPE_ROLLING or quick_type == QUICKTYPE_BACKSTEP then ExecEventHalfBlend(Event_QuickItemEnchantStep, blend_type) elseif quick_type == QUICKTYPE_ATTACK then if ForwardLeg() == 1 then ExecEventHalfBlend(Event_QuickItemEnchantAttackRight, blend_type) else ExecEventHalfBlend(Event_QuickItemEnchantAttackLeft, blend_type) end else return FALSE end elseif item_type == ITEM_QUICK_THROW_KNIFE then if quick_type == QUICKTYPE_NORMAL or quick_type == QUICKTYPE_RUN then ExecEventHalfBlend(Event_QuickItemThrowKnifeNormal, ALLBODY) elseif quick_type == QUICKTYPE_DASH then ExecEventHalfBlend(Event_QuickItemThrowKnifeDash, ALLBODY) elseif quick_type == QUICKTYPE_ROLLING or quick_type == QUICKTYPE_BACKSTEP then ExecEventHalfBlend(Event_QuickItemThrowKnifeStep, ALLBODY) elseif quick_type == QUICKTYPE_ATTACK then if ForwardLeg() == 1 then ExecEventHalfBlend(Event_QuickItemThrowKnifeAttackRight, ALLBODY) else ExecEventHalfBlend(Event_QuickItemThrowKnifeAttackLeft, ALLBODY) end elseif quick_type == QUICKTYPE_COMBO then if ForwardLeg() == 1 then ExecEventHalfBlend(Event_QuickItemThrowKnifeAttackRight2, ALLBODY) else ExecEventHalfBlend(Event_QuickItemThrowKnifeAttackLeft2, ALLBODY) end else return FALSE end elseif item_type == ITEM_QUICK_THROW_BOTTLE then return FALSE elseif item_type == ITEM_SWITCH_EXPLOSIVE then ExecEventHalfBlend(Event_ItemSwitchExplosive, blend_type) elseif item_type == ITEM_DRINK_MP then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then ExecEventHalfBlend(Event_ItemDrinkNothing, blend_type) elseif IsNodeActive("ItemDrinkingMP_Upper_CMSG") == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinkingMP, blend_type) else SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinkStartMP, blend_type) end elseif item_type == ITEM_STRING_BOTTLE then ExecEventHalfBlend(Event_ItemThrowBackBottle, blend_type) elseif item_type == ITEM_CRY_SICKNESS then ExecEventHalfBlend(Event_ItemCrySickness, blend_type) elseif item_type == ITEM_CRY_SICKNESS_PHANTOM then ExecEventHalfBlend(Event_ItemCrySicknessPhantom, blend_type) elseif item_type == 70 then -- daergraf transform local Event_ItemTransformDaergraf = {"W_ItemTransformDaergraf", ITEM_DEF0, ITEMNORMAL_DEF1, 63} -- if env(GetSpEffectID, 19984) == TRUE or env(GetSpEffectID, 19983) == TRUE then -- SetVariable("ItemTransformType", 1) -- else -- SetVariable("ItemTransformType", 0) -- end ExecEventHalfBlend(Event_ItemTransformDaergraf, blend_type) elseif item_type == ITEM_TRANSFORM_GODMAN then -- if env(GetSpEffectID, 19982) == TRUE or env(GetSpEffectID, 19983) == TRUE then -- SetVariable("ItemTransformType", 1) -- else -- SetVariable("ItemTransformType", 0) -- end ExecEventHalfBlend(Event_ItemTransformGodman, blend_type) elseif item_type == ITEM_OLDMONK then ExecEventHalfBlend(Event_ItemDragonFullStartAfter, blend_type) elseif item_type == ITEM_EATJERKY then if ConsumeItemDetection() then return FALSE end ExecEventHalfBlend(Event_ItemEatJerky, blend_type) elseif item_type == ITEM_LANTERN then if env(GetSpEffectID, 3245) == TRUE then ExecEventHalfBlend(Event_ItemLanternOff, blend_type) else ExecEventHalfBlend(Event_ItemLanternOn, blend_type) end elseif item_type == ITEM_ELIXIR then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemElixir, blend_type) elseif item_type == ITEM_HORN then ExecEventHalfBlend(Event_ItemHorn, blend_type) elseif item_type == ITEM_COPY_SLEEP then ExecEventHalfBlend(Event_ItemCopySleep, blend_type) elseif item_type == ITEM_VOICE then -- Duplicate Condition #1 ExecEventHalfBlend(Event_ItemVoice, blend_type) elseif item_type == ITEM_SUMMONHORSE then SetVariable("RideOnSummonTest", 0) SetVariable("IndexItemUseAnim", item_type) SetVariable("ItemDashSpeedIndex", 0) if GetVariable("MoveSpeedIndex") >= 1 then SetVariable("ItemDashSpeedIndex", 1) end if GetVariable("MoveSpeedLevel") >= 0.9 then IsSummonDash = TRUE else IsSummonDash = FALSE end ExecEventHalfBlend(Event_ItemDash, blend_type) elseif item_type == ITEM_VOICE then -- Duplicate Condition #2 ExecEventHalfBlend(Event_ItemReturnBuddy, blend_type) elseif item_type == ITEM_SUMMONBUDDY then ExecEventHalfBlend(Event_ItemSummonBuddy, blend_type) elseif item_type == ITEM_HOST then ExecEventHalfBlend(Event_ItemHost, blend_type) elseif item_type == ITEM_MULTIKICK then ExecEventHalfBlend(Event_ItemMultKick, blend_type) elseif item_type == ITEM_TONGUE then ExecEventHalfBlend(Event_ItemTongue, blend_type) elseif item_type == ITEM_HOLYSYMBOL then ExecEventHalfBlend(Event_ItemHolySymbol, blend_type) elseif item_type == ITEM_ELIXIR2 then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemElixir2, blend_type) elseif item_type == ITEM_DANCING_SWORDSMAN_FIRE then ExecEventHalfBlend(Event_ItemDancingSwordsmanFire, blend_type) elseif item_type == ITEM_SWITCH then ExecEventHalfBlend(Event_ItemSwitch, blend_type) elseif item_type == ITEM_ERDTREE then ExecEventHalfBlend(Event_ItemErdtree, blend_type) elseif item_type == ITEM_NIGHT_BELL then -- 100800 "[HKS] Item Combo Window" local is_combo = env(GetSpEffectID, 100800) if is_combo == TRUE then ExecEventHalfBlend(Event_ItemCombo, blend_type) elseif IsNodeActive("ItemOneshot_Upper") == TRUE then SetVariable("IndexItemUseAnim_SelfTrans", item_type) ExecEventHalfBlend(Event_ItemOneShot_SelfTrans, blend_type) else SetVariable("IndexItemUseAnim", item_type) ExecEventHalfBlend(Event_ItemOneShot, blend_type) end elseif item_type == 52 then -- Mimic's Veil ResetMimicry() if IsNodeActive("ItemOneshot_Upper") == TRUE then SetVariable("IndexItemUseAnim_SelfTrans", item_type) ExecEventHalfBlend(Event_ItemOneShot_SelfTrans, blend_type) else SetVariable("IndexItemUseAnim", item_type) ExecEventHalfBlend(Event_ItemOneShot, blend_type) end elseif item_type == ITEM_THROW_BIGBOTTLE then ExecEventHalfBlend(Event_ItemThrowBigBottle, blend_type) elseif item_type == ITEM_TRANSFORM_GODMAN_NPC then ExecEventHalfBlend(Event_ItemTransformGodmanNPC, blend_type) elseif item_type == ITEM_TRANSFORM_GODMANBREATH_NPC then ExecEventHalfBlend(Event_ItemTransformGodmanBreathNPC, blend_type) elseif item_type == ITEM_AROMAWIDE then ExecEventHalfBlend(Event_ItemAromaWide, blend_type) elseif item_type == ITEM_AROMAUP then ExecEventHalfBlend(Event_ItemAromaUp, blend_type) elseif item_type == ITEM_AROMAFRONT then ExecEventHalfBlend(Event_ItemAromaFront, blend_type) elseif item_type == ITEM_AROMADRINK then ExecEventHalfBlend(Event_ItemAromaDrink, blend_type) elseif item_type == ITEM_AROMABREATH then ExecEventHalfBlend(Event_ItemAromaBreath, blend_type) elseif item_type == ITEM_NO_DRINK then if IsNodeActive("ItemDrinkingMP_Upper_CMSG") == TRUE or IsNodeActive("ItemDrinking_Upper_CMSG") == TRUE then if blend_type == ALLBODY and MoveStart(LOWER, Event_MoveLong, FALSE) == TRUE then blend_type = UPPER end ExecEventHalfBlend(Event_ItemDrinkEmpty, blend_type) else ExecEventHalfBlend(Event_ItemDrinkStart, blend_type) end elseif item_type == ITEM_INVALID then ExecEventHalfBlend(Event_ItemInvalid, blend_type) elseif IsNodeActive("ItemOneshot_Upper") == TRUE then SetVariable("IndexItemUseAnim_SelfTrans", item_type) ExecEventHalfBlend(Event_ItemOneShot_SelfTrans, blend_type) else SetVariable("IndexItemUseAnim", item_type) ExecEventHalfBlend(Event_ItemOneShot, blend_type) end act(SetIsItemAnimationPlaying) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecLadderItem(hand) if c_HasActionRequest == FALSE then return FALSE end if env(ActionRequest, ACTION_ARM_USE_ITEM) == FALSE then return FALSE end if env(IsItemUseMenuOpened) == TRUE then return FALSE end if env(IsItemUseMenuOpening) == TRUE then ResetRequest() act(OpenMenuWhenUsingItem) return TRUE end act(UseItemDecision) local item_type = env(GetItemAnimType) local event = "W_ItemLadderInvalid" local event_hand = "Left" if hand == HAND_STATE_RIGHT then event_hand = "Right" end if item_type == ITEM_RECOVER then if ConsumeItemDetection() then return FALSE end event = "W_ItemLadderRecover" elseif item_type == ITEM_SOUL then event = "W_ItemLadderSoul" elseif item_type == ITEM_EATJERKY then if ConsumeItemDetection() then return FALSE end event = "W_ItemLadderEatJerky" elseif item_type == ITEM_ELIXIR then event = "W_ItemLadderElixir" elseif item_type == ITEM_ELIXIR2 then event = "W_ItemLadderElixir2" elseif item_type == ITEM_DRINK then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then event = "W_ItemLadderDrinkNothing" elseif IsNodeActive("ItemLadderDrinkingRight_CMSG") == TRUE then event = "W_ItemLadderDrinking" event_hand = "Right" elseif IsNodeActive("ItemLadderDrinkingLeft_CMSG") == TRUE then event = "W_ItemLadderDrinking" event_hand = "Left" else event = "W_ItemLadderDrinkStart" end elseif item_type == ITEM_DRINK_MP then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then event = "W_ItemLadderDrinkNothing" elseif IsNodeActive("ItemLadderDrinkingRight_CMSG00") == TRUE then event = "W_ItemLadderDrinkingMP" event_hand = "Right" elseif IsNodeActive("ItemLadderDrinkingLeft_CMSG00") == TRUE then event = "W_ItemLadderDrinkingMP" event_hand = "Left" else event = "W_ItemLadderDrinkMPStart" end elseif item_type == ITEM_NO_DRINK then if IsNodeActive("ItemLadderDrinkingMPRight_CMSG") == TRUE or IsNodeActive("ItemLadderDrinkingRight_CMSG") == TRUE then event = "W_ItemLadderDrinkEmpty" event_hand = "Right" elseif IsNodeActive("ItemLadderDrinkingLeft_CMSG") == TRUE or IsNodeActive("ItemLadderDrinkingMPLeft_CMSG") == TRUE then event = "W_ItemLadderDrinkEmpty" event_hand = "Left" else event = "W_ItemLadderDrinkStart" end end act(SetIsItemAnimationPlaying) ExecEvent(event .. event_hand) return TRUE end function GetWeaponChangeType(hand) local left_offset = 0 local pos = env(GetWeaponStorageSpotType, hand) if hand == HAND_LEFT then left_offset = 4 end if pos == 0 then return WEAPON_CHANGE_REQUEST_RIGHT_WAIST + left_offset elseif pos == 1 then return WEAPON_CHANGE_REQUEST_RIGHT_BACK + left_offset elseif pos == 2 then return WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER + left_offset elseif pos == 3 then return WEAPON_CHANGE_REQUEST_RIGHT_SPEAR + left_offset end return WEAPON_CHANGE_REQUEST_INVALID end function ExecWeaponChange(blend_type) local kind = WEAPON_CHANGE_REQUEST_INVALID if c_HasActionRequest == FALSE then return FALSE end if env(IsGeneralAnimCancelPossible) == FALSE and env(IsStayState) == FALSE then return FALSE end if env(GetSpEffectID, 100730) == TRUE then return FALSE end -- new trick code start if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE and env(IsGeneralAnimCancelPossible) == TRUE then if env(ActionDuration, ACTION_ARM_ACTION) > 0 then if (env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionRequest, ACTION_ARM_L2) == TRUE) and c_Style == HAND_RIGHT_BOTH then HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE if env(ActionRequest, ACTION_ARM_L1) == TRUE then HandChangeTest_ToR1 = TRUE else HandChangeTest_ToR2 = TRUE end return ExecHandChange(HAND_RIGHT, TRUE, blend_type) elseif c_Style == HAND_LEFT_BOTH and (env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE) then HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE if env(ActionRequest, ACTION_ARM_R1) == TRUE then HandChangeTest_ToL1 = TRUE else HandChangeTest_ToL2 = TRUE end return ExecHandChange(HAND_LEFT, TRUE, blend_type) end end end -- new trick code end if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then if env(ActionDuration, ACTION_ARM_ACTION) > 0 then HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE if env(ActionRequest, ACTION_ARM_R1) == TRUE then HandChangeTest_ToR1 = TRUE else HandChangeTest_ToR2 = TRUE end return ExecHandChange(HAND_RIGHT, TRUE, blend_type) end elseif (env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionRequest, ACTION_ARM_L2) == TRUE) and env(ActionDuration, ACTION_ARM_ACTION) > 0 then HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE if env(ActionRequest, ACTION_ARM_L1) == TRUE then HandChangeTest_ToL1 = TRUE else HandChangeTest_ToL2 = TRUE end return ExecHandChange(HAND_LEFT, TRUE, blend_type) end if env(ActionRequest, ACTION_ARM_CHANGE_WEAPON_R) == TRUE then kind = GetWeaponChangeType(HAND_RIGHT) elseif env(ActionRequest, ACTION_ARM_CHANGE_WEAPON_L) == TRUE then kind = GetWeaponChangeType(HAND_LEFT) else return FALSE end if kind == WEAPON_CHANGE_REQUEST_INVALID then return FALSE end SetVariable("WeaponChangeType", kind) if blend_type == ALLBODY and MoveStart(LOWER, Event_Move, FALSE) == TRUE then blend_type = UPPER end local event = Event_WeaponChangeStart if c_IsStealth == TRUE then event = Event_StealthWeaponChangeStart end ExecEventHalfBlend(event, blend_type) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function SetHandChangeStyle(s, e) SetVariable("HandChangeStartIndex", s) SetVariable("HandChangeEndIndex", e) end function GetHandChangeType(hand) local left_offset = 0 local pos = env(GetWeaponStorageSpotType, hand) if hand == HAND_LEFT then left_offset = 4 end if pos == 0 then return WEAPON_CHANGE_REQUEST_RIGHT_WAIST + left_offset elseif pos == 1 then return WEAPON_CHANGE_REQUEST_RIGHT_BACK + left_offset elseif pos == 2 then return WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER + left_offset elseif pos == 3 then return WEAPON_CHANGE_REQUEST_RIGHT_SPEAR + left_offset end return WEAPON_CHANGE_REQUEST_INVALID end function ExecJump(is_multi_jump) is_multi_jump = is_multi_jump or false if not is_multi_jump then -- Note: Restored original value during full remake. Repo values was ACTION_ARM_JUMP instead of ACTION_ARM_CHANGE_STYLE -- note: Original decompile of 1.10 has ACTION_ARM_CHANGE_STYLE instead of jump if env(ActionRequest, ACTION_ARM_CHANGE_STYLE) == FALSE and env(IsAIJumpRequested) == FALSE then return FALSE end if env(GetStamina) <= 0 and env(IsAIJumpRequested) == FALSE then ResetRequest() return FALSE end end if ShouldDoStaminaCost() == TRUE and env(GetSpEffectID, Jewel_of_the_Devious) == FALSE then -- Jewel of the Devious (Rogue) AddStamina(STAMINA_REDUCE_JUMP) end SetWeightIndex() -- Jump: Overweight if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT and env(IsAIJumpRequested) == FALSE then local jumpangle = env(GetJumpAngle) * 0.01 if jumpangle > -45 and jumpangle < 45 then SetVariable("JumpOverweightIndex", 0) elseif jumpangle >= 0 and jumpangle <= 100 then SetVariable("JumpOverweightIndex", 3) elseif jumpangle >= -100 and jumpangle <= 0 then SetVariable("JumpOverweightIndex", 2) else SetVariable("JumpOverweightIndex", 1) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEventAllBody("W_Jump_Overweight") return TRUE end local style = c_Style if style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 0) elseif style == HAND_RIGHT_BOTH then SetVariable("JumpAttack_HandCondition", 1) elseif style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 4) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) IS_ATTACKED_JUMPMAGIC = FALSE if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end local JumpMoveLevel = 0 if GetVariable("LocomotionState") == 1 and GetVariable("MoveSpeedIndex") == 2 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") >= 0.6 then JumpMoveLevel = 1 end if ShouldDoSlowEffect() == TRUE then JumpMoveLevel = 0 end -- Keep JumpMoveLevel for multi-jump if is_multi_jump then JumpMoveLevel = g_Jump_MoveLevel else g_Jump_MoveLevel = JumpMoveLevel end if JumpMoveLevel == 2 then if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEvent("W_Jump_D") return TRUE elseif JumpMoveLevel == 1 then if GetVariable("IsLockon") == FALSE and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE then SetVariable("JumpDirection", 0) SetVariable("JumpAngle", 0) else local turn_target_angle = 0 local jumpangle = env(GetJumpAngle) * 0.01 if jumpangle > -45 and jumpangle < 45 then turn_target_angle = jumpangle SetVariable("JumpDirection", 0) SetVariable("JumpAngle", 0) elseif jumpangle >= 0 and jumpangle <= 100 then turn_target_angle = jumpangle - 90 SetVariable("JumpDirection", 3) SetVariable("JumpAngle", 90) elseif jumpangle >= -100 and jumpangle <= 0 then turn_target_angle = jumpangle + 90 SetVariable("JumpDirection", 2) SetVariable("JumpAngle", -90) else turn_target_angle = jumpangle - 180 SetVariable("JumpDirection", 1) SetVariable("JumpAngle", 180) end if GetVariable("IsLockon") == true then act(TurnToLockonTargetImmediately, turn_target_angle) else act(FaceDirection, turn_target_angle) end end SetVariable("IsEnableDirectionJumpTAE", true) if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEvent("W_Jump_F") return TRUE else SetVariable("JumpReachSelector", 0) if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEvent("W_Jump_N") return TRUE end end function ExecJumpLoopDirect(jump_type) local style = c_Style if style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 0) elseif style == HAND_RIGHT_BOTH then SetVariable("JumpAttack_HandCondition", 1) elseif style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 4) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end if jump_type == 2 then ExecEvent("W_Jump_Loop") return TRUE elseif GetVariable("MoveSpeedLevel") >= 0.6 then SetVariable("IsEnableDirectionJumpTAE", true) ExecEvent("W_Jump_Loop") return TRUE else SetVariable("JumpReachSelector", 0) ExecEvent("W_Jump_Loop") return TRUE end end function ExecHandChange(hand, is_force, blend_type, no_reset) if is_force == FALSE then if env(IsCOMPlayer) ~= TRUE then return FALSE end if c_HasActionRequest == FALSE or env(IsPrecisionShoot) == TRUE then return FALSE end if env(ActionRequest, ACTION_ARM_CHANGE_STYLE_R) == TRUE and env(ActionDuration, ACTION_ARM_R1) < 100 then elseif env(ActionRequest, ACTION_ARM_CHANGE_STYLE_L) == TRUE and env(ActionDuration, ACTION_ARM_L1) < 100 then hand = HAND_LEFT else return FALSE end end local style = c_Style local kind = nil if style == HAND_RIGHT then if hand == HAND_RIGHT then if env(IsTwoHandPossible, HAND_RIGHT) == FALSE then return FALSE end kind = GetHandChangeType(HAND_LEFT) if kind == WEAPON_CHANGE_REQUEST_LEFT_WAIST then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(LEFT_TO_WAIST, LEFT_FROM_WAIST) else SetHandChangeStyle(LEFT_TO_WAIST, BOTH_FROM_ALL) end elseif kind == WEAPON_CHANGE_REQUEST_LEFT_BACK then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(LEFT_TO_BACK, LEFT_FROM_BACK) else SetHandChangeStyle(LEFT_TO_BACK, BOTH_FROM_ALL) end elseif kind == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(LEFT_TO_SHOULDER, LEFT_FROM_SHOULDER) else SetHandChangeStyle(LEFT_TO_SHOULDER, BOTH_FROM_ALL) end elseif kind == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(LEFT_TO_SPEAR, LEFT_FROM_SPEAR) else SetHandChangeStyle(LEFT_TO_SPEAR, BOTH_FROM_ALL) end elseif IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(LEFT_TO_SPEAR, LEFT_FROM_SPEAR) else SetHandChangeStyle(LEFT_TO_SPEAR, BOTH_FROM_ALL) end act(Unknown9999, 1) else if env(IsTwoHandPossible, HAND_LEFT) == FALSE then return FALSE end kind = GetHandChangeType(HAND_RIGHT) if kind == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then if IsDualBladeSpecific(HAND_LEFT) == TRUE then SetHandChangeStyle(RIGHT_TO_WAIST, RIGHT_FROM_WAIST) else SetHandChangeStyle(RIGHT_TO_WAIST, BOTHLEFT_FROM_ALL) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_BACK then if IsDualBladeSpecific(HAND_LEFT) == TRUE then SetHandChangeStyle(RIGHT_TO_BACK, RIGHT_FROM_BACK) else SetHandChangeStyle(RIGHT_TO_BACK, BOTHLEFT_FROM_ALL) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then if IsDualBladeSpecific(HAND_LEFT) == TRUE then SetHandChangeStyle(RIGHT_TO_SHOULDER, RIGHT_FROM_SHOULDER) else SetHandChangeStyle(RIGHT_TO_SHOULDER, BOTHLEFT_FROM_ALL) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SPEAR then if IsDualBladeSpecific(HAND_LEFT) == TRUE then SetHandChangeStyle(RIGHT_TO_SPEAR, RIGHT_FROM_SPEAR) else SetHandChangeStyle(RIGHT_TO_SPEAR, BOTHLEFT_FROM_ALL) end elseif IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(RIGHT_TO_BACK, RIGHT_FROM_BACK) else SetHandChangeStyle(RIGHT_TO_BACK, BOTHLEFT_FROM_ALL) end act(Unknown9999, 2) end elseif style == HAND_RIGHT_BOTH then kind = GetHandChangeType(HAND_LEFT) if kind == WEAPON_CHANGE_REQUEST_LEFT_WAIST then SetHandChangeStyle(BOTH_TO_WAIST, LEFT_FROM_WAIST) elseif kind == WEAPON_CHANGE_REQUEST_LEFT_BACK then SetHandChangeStyle(BOTH_TO_BACK, LEFT_FROM_BACK) elseif kind == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then SetHandChangeStyle(BOTH_TO_SHOULDER, LEFT_FROM_SHOULDER) else SetHandChangeStyle(BOTH_TO_BACK, LEFT_FROM_BACK) end act(Unknown9999, 3) elseif style == HAND_LEFT_BOTH then kind = GetHandChangeType(HAND_RIGHT) if kind == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then SetHandChangeStyle(BOTHRIGHT_TO_WAIST, RIGHT_FROM_WAIST) elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_BACK then SetHandChangeStyle(BOTHRIGHT_TO_BACK, RIGHT_FROM_BACK) elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then SetHandChangeStyle(BOTHRIGHT_TO_SHOULDER, RIGHT_FROM_SHOULDER) else SetHandChangeStyle(BOTHRIGHT_TO_BACK, RIGHT_FROM_SPEAR) end act(Unknown9999, 1) end if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end local event = Event_HandChangeStart if c_IsStealth == TRUE then event = Event_StealthHandChangeStart end -- Kmstr's new trick weapon code adapted from Clever's Trick Weapon functionality START if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if style == HAND_RIGHT and style ~= HAND_RIGHT_BOTH and style ~= HAND_LEFT_BOTH then if hand == HAND_LEFT and IsSemiTrickWeapon(HAND_LEFT) == TRUE then -- if 0 < GetVariable("MoveSpeedLevel") then -- event = Event_AttackCrossbowBothLeftEmpty -- else -- event = Event_AttackCrossbowLeftEmpty --037340 -- end elseif hand == HAND_LEFT and IsSemiTrickWeapon(HAND_LEFT) == FALSE then elseif hand == HAND_RIGHT and IsSemiTrickWeapon(HAND_RIGHT) == FALSE then else if 0 < GetVariable("MoveSpeedLevel") then event = Event_AttackCrossbowBothRightEmpty else event = Event_AttackCrossbowRightEmpty --037040 end end elseif style == HAND_RIGHT_BOTH and IsSemiTrickWeapon(HAND_RIGHT) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then event = Event_AttackCrossbowBothRightReload else event = Event_AttackCrossbowRightReload --037030 end end if style == HAND_LEFT and style ~= HAND_LEFT_BOTH and IsSemiTrickWeapon(HAND_LEFT) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then event = Event_AttackCrossbowBothLeftReload else event = Event_AttackCrossbowLeftReload --037330 end elseif style == HAND_LEFT_BOTH and IsSemiTrickWeapon(HAND_LEFT) == TRUE then -- if 0 < GetVariable("MoveSpeedLevel") then -- event = Event_AttackCrossbowBothLeftReload -- else -- event = Event_AttackCrossbowLeftReload --037330 -- end end end if no_reset == TRUE then ExecEventHalfBlendNoReset(event, blend_type) else ExecEventHalfBlend(event, blend_type) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function GetEvasionRequest() if env(GetStamina) < STAMINA_MINIMUM then return ATTACK_REQUEST_INVALID end if env(ActionRequest, ACTION_ARM_ROLLING) == TRUE then return ATTACK_REQUEST_ROLLING elseif env(ActionDuration, ACTION_ARM_L1) > 0 then if env(ActionRequest, ACTION_ARM_EMERGENCYSTEP) == TRUE then if env(IsEmergencyEvasionPossible, 0) == TRUE or env(IsEmergencyEvasionPossible, 1) == TRUE then return ATTACK_REQUEST_EMERGENCYSTEP end elseif env(ActionRequest, ACTION_ARM_BACKSTEP) == TRUE then return ATTACK_REQUEST_BACKSTEP else return ATTACK_REQUEST_INVALID end elseif env(ActionRequest, ACTION_ARM_BACKSTEP) == TRUE then return ATTACK_REQUEST_BACKSTEP end return ATTACK_REQUEST_INVALID end HandChangeControlTest8_RelaeseA = TRUE c_RollingAngle = 0 c_ArtsRollingAngle = 0 function ExecEvasion(backstep_limit, estep, is_usechainrecover) if c_HasActionRequest == FALSE then return FALSE end local request = GetEvasionRequest() if env(ActionRequest, ACTION_ARM_L3) == TRUE and c_IsStealth == FALSE then StealthTransitionIndexUpdate() ExecEvent("W_Stealth_to_Stealth_Idle") return TRUE elseif env(ActionRequest, ACTION_ARM_L3) == TRUE and c_IsStealth == TRUE then StealthTransitionIndexUpdate() ExecEvent("W_Stealth_to_Idle") return TRUE end if request == ATTACK_REQUEST_INVALID then return FALSE end if backstep_limit == TRUE and request == ATTACK_REQUEST_BACKSTEP and env(GetEventEzStateFlag, 0) == TRUE then return FALSE end SetWeightIndex() ----------------------- -- Roll ----------------------- if request == ATTACK_REQUEST_ROLLING then if is_usechainrecover == TRUE then local damagecount = GetVariable("DamageCount") if damagecount >= 4 then if env(GetEventEzStateFlag, 5) == FALSE then return FALSE end elseif damagecount == 3 then if env(GetEventEzStateFlag, 4) == FALSE then return FALSE end elseif damagecount == 2 then if env(GetEventEzStateFlag, 3) == FALSE then return FALSE end elseif damagecount <= 1 and env(GetEventEzStateFlag, 2) == FALSE then if env(GetSpEffectID, 100720) == TRUE then ResetRequest() end return FALSE end end if env(GetStamina) <= 0 then ResetRequest() return FALSE end if env(GetFallHeight) > 150 then return FALSE end local rollingEvent = "W_Rolling" local is_selfTrans = FALSE if IsNodeActive("Rolling_CMSG") == TRUE then is_selfTrans = TRUE end if estep == ESTEP_DOWN then rollingEvent = "W_EStepDown" elseif c_IsStealth == TRUE and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_OVERWEIGHT then rollingEvent = "W_Stealth_Rolling" elseif is_selfTrans == TRUE then rollingEvent = rollingEvent .. "_Selftrans" end if ShouldDoStaminaCost() == TRUE and env(GetSpEffectID, Jewel_of_the_Devious) == FALSE then -- Jewel of the Devious (Rogue) AddStamina(STAMINA_REDUCE_ROLLING) end if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end local turn_angle_real = 200 if GetVariable("IsLockon") == false and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE or env(GetSpEffectID, 100002) == TRUE then SetVariable("RollingOverweightIndex", 0) if is_selfTrans == TRUE then SetVariable("RollingDirectionIndex_SelfTrans", 0) else SetVariable("RollingDirectionIndex", 0) end elseif GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT then if c_RollingAngle <= 45 and c_RollingAngle >= -45 then SetVariable("RollingOverweightIndex", 0) elseif c_RollingAngle > 45 and c_RollingAngle < 135 then SetVariable("RollingOverweightIndex", 3) elseif c_RollingAngle >= 135 then SetVariable("RollingOverweightIndex", 1) elseif c_RollingAngle < -45 and c_RollingAngle > -135 then SetVariable("RollingOverweightIndex", 2) else SetVariable("RollingOverweightIndex", 1) end act(TurnToLockonTargetImmediately) turn_angle_real = math.abs(GetVariable("TurnAngle") - c_RollingAngle) if turn_angle_real > 180 then turn_angle_real = 360 - turn_angle_real end else local turn_target_angle = 0 local rollingDirection = 0 if c_RollingAngle <= GetVariable("RollingAngleThresholdRightFrontTest") and c_RollingAngle >= GetVariable("RollingAngleThresholdLeftFrontTest") then rollingDirection = 0 turn_target_angle = c_RollingAngle elseif c_RollingAngle > GetVariable("RollingAngleThresholdRightFrontTest") and c_RollingAngle < GetVariable("RollingAngleThresholdRightBackTest") then rollingDirection = 3 turn_target_angle = c_RollingAngle - 90 elseif c_RollingAngle < GetVariable("RollingAngleThresholdLeftFrontTest") and c_RollingAngle > GetVariable("RollingAngleThresholdLeftBackTest") then rollingDirection = 2 turn_target_angle = c_RollingAngle + 90 else rollingDirection = 1 turn_target_angle = c_RollingAngle - 180 end if is_selfTrans == TRUE then SetVariable("RollingDirectionIndex_SelfTrans", rollingDirection) else SetVariable("RollingDirectionIndex", rollingDirection) end if GetVariable("IsLockon") == true then act(TurnToLockonTargetImmediately, turn_target_angle) else act(FaceDirection, turn_target_angle) end turn_angle_real = math.abs(GetVariable("TurnAngle") - c_RollingAngle) if turn_angle_real > 180 then turn_angle_real = 360 - turn_angle_real end end SetVariable("TurnAngleReal", turn_angle_real) if is_selfTrans == TRUE then SetVariable("RollingAngleRealSelftrans", c_RollingAngle) else SetVariable("RollingAngleReal", c_RollingAngle) end ExecEventAllBody(rollingEvent) elseif request == ATTACK_REQUEST_EMERGENCYSTEP then if MoveStart(ALLBODY, Event_ChainRecover, FALSE) then else return FALSE end elseif request == ATTACK_REQUEST_BACKSTEP then -- if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 722 and IsGuard() == TRUE then -- return FALSE -- end ResetDamageCount() if env(GetStamina) <= 0 then ResetRequest() return FALSE end if ShouldDoStaminaCost() == TRUE and env(GetSpEffectID, Jewel_of_the_Devious) == FALSE then -- Jewel of the Devious (Rogue) AddStamina(STAMINA_REDUCE_BACKSTEP) end if IsEnableGuard() == TRUE and IsGuard() == TRUE and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_OVERWEIGHT then SetVariable("BackStepGuardLayer", 1) SetVariable("EnableTAE_BackStep", false) ExecEvent("W_DefaultBackStep") ExecEvent("W_BackStepGuardOn_UpperLayer") else SetVariable("BackStepGuardLayer", 0) SetVariable("EnableTAE_BackStep", true) ExecEventAllBody("W_DefaultBackStep") end else return FALSE end if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function IsGuard() if env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) > 0 then return TRUE end return FALSE end function ExecQuickTurn(blend_type, turn_type) if blend_type == LOWER and IsLowerQuickTurn() == TRUE then return FALSE end if GetVariable("IsLockon") == false then return FALSE end if env(GetSpEffectID, 19946) == TRUE then return FALSE end local turn_angle = GetVariable("TurnAngle") if math.abs(turn_angle) < 45 then return FALSE end SetVariable("TurnType", turn_type) if turn_angle >= 45 then ExecEventHalfBlend(Event_QuickTurnRight180, blend_type) else ExecEventHalfBlend(Event_QuickTurnLeft180, blend_type) end return TRUE end function ExecDashTurn() if GetVariable("MoveSpeedLevel") <= 0 then return FALSE end local angle = math.abs(hkbGetVariable("TurnAngle")) if angle > 90 then ExecEventAllBody("W_Dash180") return TRUE end return FALSE end function ExitQuickTurnLower() if env(IsAnimEnd, 2) == TRUE or env(GetEventEzStateFlag, 1) == TRUE then return TRUE end if GetVariable("IsLockon") == false then return TRUE end return FALSE end function ExecQuickTurnOnCancelTiming() if env(IsMoveCancelPossible) == FALSE then return FALSE end if ExecQuickTurn(ALLBODY, TURN_TYPE_DEFAULT) == TRUE then return TRUE end return FALSE end function ExecFallStart(fall_type) if env(IsFalling) == FALSE then return FALSE end if fall_type == FALL_TYPE_DEFAULT then ExecEventAllBody("W_FallStart") elseif fall_type == FALL_TYPE_JUMP then if env(GetGeneralTAEFlag, 0) == TRUE then ExecEventAllBody("W_FallJumpStart") else ExecEventNoReset("W_FallStart") end elseif fall_type == FALL_TYPE_FACEDOWN_LOOP then ExecEventAllBody("W_FallLoopFaceDown") elseif fall_type == FALL_TYPE_FACEDOWN then ExecEventAllBody("W_FallStartFaceDown") elseif fall_type == FALL_TYPE_FACEUP_LOOP then ExecEventAllBody("W_FallLoopFaceUp") elseif fall_type == FALL_TYPE_FACEUP then ExecEventAllBody("W_FallStartFaceUp") else local damage_angle = env(GetReceivedDamageDirection) if damage_angle == DAMAGE_DIR_BACK then if fall_type == FALL_TYPE_FORCE_LOOP then ExecEventAllBody("W_FallLoopFaceDown") else ExecEventAllBody("W_FallStartFaceDown") end elseif fall_type == FALL_TYPE_FORCE_LOOP then ExecEventAllBody("W_FallLoopFaceUp") else ExecEventAllBody("W_FallStartFaceUp") end end return TRUE end function ExecAddDamage(damage_dir, attack_dir, damage_level, is_guard, is_damaged, is_justGuard) if is_damaged == FALSE then return end if env(GetBehaviorID, 2) == TRUE then return end if is_guard == TRUE and is_justGuard == TRUE and env(GetSpEffectID, 102022) == TRUE then return end if is_guard == TRUE then SetVariable("AddDamageGuardBlend", 1) else SetVariable("AddDamageLv0_Blend", 1) local pre_index = GetVariable("IndexDamageLv0_Random") local index = (pre_index + math.random(1, 2)) % 3 SetVariable("IndexDamageLv0_Random", index) end if is_guard == TRUE and is_justGuard == TRUE then act(AddSpEffect, 102020) act(AddSpEffect, 102022) ExecEventNoReset("W_AddDamageJustGuardStartFront") return end if damage_dir == DAMAGE_DIR_LEFT then if attack_dir == ATTACK_DIR_FRONT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartLeft") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_UP then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartLeft") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_DOWN then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartLeft") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_LEFT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartFront") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_RIGHT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartBack") return else ExecEventNoReset("W_AddDamageLv0") return end end elseif damage_dir == DAMAGE_DIR_RIGHT then if attack_dir == ATTACK_DIR_FRONT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartRight") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_UP then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartRight") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_DOWN then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartRight") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_LEFT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartBack") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_RIGHT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartFront") return else ExecEventNoReset("W_AddDamageLv0") return end end elseif damage_dir == DAMAGE_DIR_FRONT then if attack_dir == ATTACK_DIR_FRONT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartFront") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_UP then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartFront") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_DOWN then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartFront") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_LEFT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartRight") return else ExecEventNoReset("W_AddDamageLv0") return end elseif attack_dir == ATTACK_DIR_RIGHT then if is_guard == TRUE then ExecEventNoReset("W_AddDamageGuardStartLeft") return else ExecEventNoReset("W_AddDamageLv0") return end end elseif damage_dir == DAMAGE_DIR_BACK then ExecEventNoReset("W_AddDamageLv0") end end function ExecPassiveAction(is_parry, fall_type, is_attackwhileguard) if env(HasThrowRequest) == TRUE then ResetDamageCount() return TRUE end if ExecDeath() == TRUE then return TRUE end if env(ActionRequest, ACTION_ARM_BUDDY_DISAPPEAR) == TRUE then ExecEventAllBody("W_Event60505") return TRUE end if ExecTalk() == TRUE then ResetDamageCount() return TRUE end if ExecMovableEventAnim() == TRUE then ResetDamageCount() return TRUE end if env(CheckForEventAnimPlaybackRequest) == TRUE then ResetDamageCount() return TRUE end if ExecDamage(is_parry, is_attackwhileguard) == TRUE then return TRUE end if ExecFallStart(fall_type) == TRUE then ResetDamageCount() return TRUE end return FALSE end function ExecMovableEventAnim() local eventID = env(GetEventID) local commandID = env(GetCommandIDFromEvent, 0) if eventID <= -1 and not (commandID >= 60070 and commandID <= 60071) then return FALSE end local event = Event_EventHalfBlend60071 if eventID == 60071 or commandID == 60071 then event = Event_EventHalfBlend60071 elseif eventID == 60070 or commandID == 60070 then if c_IsStealth == TRUE then event = Event_EventHalfBlend360070 else event = Event_EventHalfBlend60071 end else ExecEventAllBody("W_Event" .. eventID) return TRUE end local lower_state = ALLBODY local locomotion = GetVariable("LocomotionState") if locomotion == PLAYER_STATE_MOVE then lower_state = UPPER end ExecEventHalfBlend(event, lower_state) return TRUE end function ExecRideEventAnim() local eventID = env(GetEventID) if eventID <= -1 then return FALSE end if eventID == 60070 then ExecEventAllBody("W_Event160070") elseif eventID == 50250 then ExecEventAllBody("W_Event150250") else return FALSE end return TRUE end function IsLandDead(height) if env(GetHP) <= 0 then return TRUE end if height > 20 and env(GetStateChangeType, 266) == FALSE then if env(IsInvincibleDebugMode) == FALSE or HasCheatEffect() == TRUE then act(AddSpEffect, 148) return TRUE end end return FALSE end function ExecDeath() if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH or env(GetHP) <= 0 then if env(GetSpEffectID, 560) == TRUE then return FALSE end local damage_angle = env(GetReceivedDamageDirection) SetVariable("DamageDirection", damage_angle) if env(GetKnockbackDistance) < 0 then if damage_angle == DAMAGE_DIR_LEFT then damage_angle = DAMAGE_DIR_RIGHT elseif damage_angle == DAMAGE_DIR_RIGHT then damage_angle = DAMAGE_DIR_LEFT elseif damage_angle == DAMAGE_DIR_FRONT then damage_angle = DAMAGE_DIR_BACK elseif damage_angle == DAMAGE_DIR_BACK then damage_angle = DAMAGE_DIR_FRONT end end local damage_level = env(GetDamageLevel) if env(GetDamageSpecialAttribute, 3) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_STONE) elseif env(GetSpEffectID, 19700) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_CRY) elseif env(GetSpEffectID, 102351) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_SLEEP) elseif env(GetSpEffectID, 9913) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_TRINA_EVENT) elseif env(GetSpecialAttribute) == 25 then act(DebugLogOutput, "DEATY_TYPE_MAD") SetVariable("IndexDeath", DEATH_TYPE_MAD) elseif env(IsOnLadder) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_LADDER) elseif env(GetIsWeakPoint) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_WEAK) elseif damage_level == DAMAGE_LEVEL_EXLARGE or damage_level == DAMAGE_LEVEL_SMALL_BLOW then SetVariable("IndexDeath", DEATH_TYPE_BLAST) elseif damage_level == DAMAGE_LEVEL_UPPER then SetVariable("IndexDeath", DEATH_TYPE_UPPER) elseif damage_level == DAMAGE_LEVEL_FLING then SetVariable("IndexDeath", DEATH_TYPE_FLING) elseif env(GetSpecialAttribute) == DAMAGE_ELEMENT_POISON or env(GetSpecialAttribute) == DAMAGE_ELEMENT_BLIGHT then SetVariable("IndexDeath", DEATH_TYPE_POISON) else local damageState = 0 local physicalType = env(GetPhysicalAttribute) local elementType = env(GetSpecialAttribute) local deathRandom = math.random(0, 100) if elementType == DAMAGE_ELEMENT_FIRE then damageState = 4 elseif physicalType == DAMAGE_PHYSICAL_SLASH and deathRandom < 70 then damageState = 1 elseif physicalType == DAMAGE_PHYSICAL_THRUST and deathRandom < 70 then damageState = 2 elseif physicalType == DAMAGE_PHYSICAL_BLUNT and deathRandom < 70 then damageState = 3 end SetVariable("DamageState", damageState) act(DebugLogOutput, "DeathStart DamageState=" .. damageState .. " rand=" .. deathRandom) local isMad = env(GetDamageSpecialAttribute, 6) act(DebugLogOutput, "elementType=" .. elementType .. " IsMad=" .. isMad) if damage_angle == DAMAGE_DIR_BACK then SetVariable("IndexDeath", DEATH_TYPE_COMMON_BACK) else SetVariable("IndexDeath", DEATH_TYPE_COMMON) end end BlightpoleOffHandler() ExecEventAllBody("W_DeathStart") return TRUE elseif env(IsInvincibleDebugMode) == FALSE then if env(GetStateChangeType, CONDITION_TYPE_STONE) == TRUE or env(GetStateChangeType, CONDITION_TYPE_CRYSTAL) == TRUE or env(GetDamageSpecialAttribute, 3) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_STONE) BlightpoleOffHandler() ExecEventAllBody("W_DeathStart") return TRUE elseif env(GetSpEffectID, 19700) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_CRY) BlightpoleOffHandler() ExecEventAllBody("W_DeathStart") return TRUE elseif env(GetSpEffectID, 102351) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_SLEEP) BlightpoleOffHandler() ExecEventAllBody("W_DeathStart") return TRUE end end end function CalcDamageCount() act(DebugLogOutput, "Calc DamageCount") if env(GetBehaviorID, 9) == TRUE then SetVariable("UseChainRecover", 1) return else local damagecount = GetVariable("DamageCount") SetVariable("DamageCount", damagecount + 1) SetVariable("UseChainRecover", 1) end end function ResetDamageCount() SetVariable("DamageCount", 0) SetVariable("UseChainRecover", 0) end function ExecDamage(is_parry, is_attackwhileguard) local damage_level = env(GetDamageLevel) local damage_type = env(GetReceivedDamageType) local is_damaged = env(HasReceivedAnyDamage) if env(GetSpEffectType, 32) == TRUE and env(GetSpEffectID, 19925) == FALSE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ResetRequest() ExecEventAllBody("W_DamageBind") Replanning() return TRUE end if env(GetDamageSpecialAttribute, 5) == TRUE then ExecEventAllBody("W_DamageSleepResist") act(AddSpEffect, 100751) -- Sleep Debuff Resist act(AddSpEffect, 100742) -- Sleep Immunity Resist return TRUE end if env(GetDamageSpecialAttribute, 6) == TRUE then FrenzyProcHandler(false) return TRUE end if (env(GetDamageSpecialAttribute, 2) == TRUE and env(GetSpEffectID, 1499100) == FALSE) -- Blood Revelry or env(GetDamageSpecialAttribute, 4) == TRUE or env(GetSpEffectID, 1638001) == TRUE or env(GetSpEffectID, 1638140) == TRUE then -- Fiendish Ritual if damage_level == DAMAGE_LEVEL_NONE then if IsNodeActive("SwordArtsOneShot Selector") == TRUE and c_SwordArtsID == 136 then elseif env(GetSpEffectID, 6340) == TRUE or env(GetSpEffectID, 1650) == TRUE or env(GetSpEffectID, 1851) == TRUE then else damage_level = DAMAGE_LEVEL_SMALL end elseif damage_level ~= DAMAGE_LEVEL_SMALL and damage_level ~= DAMAGE_LEVEL_MIDDLE and damage_level == DAMAGE_LEVEL_MINIMUM then end end if damage_level <= DAMAGE_LEVEL_NONE and (is_damaged == FALSE or env(IsPartDamageAdditiveBlendInvalid) == TRUE) and (damage_type == DAMAGE_TYPE_INVALID or damage_type == DAMAGE_TYPE_WEAK_POINT or damage_type == DAMAGE_LEVEL_MINIMUM) then return FALSE end if env(GetBehaviorID, 1) == TRUE then return FALSE end OnExecDamageTrue() -- Raptors of the Mist Dodge if env(GetSpEffectID, 100500) == TRUE then ExecEventAllBody("W_SwordArtsStandDodge") act(AddSpEffect, 5635) ResetDamageCount() return TRUE elseif env(GetSpEffectID, 100501) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") act(AddSpEffect, 5635) ResetDamageCount() return TRUE end -- Raptors of Conv Marika Hammer dodge if env(GetSpEffectID, 100510) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldLeft_Cancel") act(AddSpEffect, 5635) ResetDamageCount() return TRUE end local attack_dir = env(GetAtkDirection) local damage_angle = env(GetReceivedDamageDirection) local style = c_Style if damage_type == DAMAGE_TYPE_PARRY then ExecEventAllBody("W_DamageParry") return TRUE end if damage_type >= DAMAGE_TYPE_GUARDED and damage_type <= DAMAGE_TYPE_WALL_LEFT then DebugPrint(1, damage_type) Replanning() if damage_level ~= DAMAGE_LEVEL_NONE then AttackBlockDetection() end if damage_type == DAMAGE_TYPE_GUARDED or damage_type == DAMAGE_TYPE_GUARDED_LEFT then if damage_type == DAMAGE_TYPE_GUARDED_LEFT then SetVariable("GuardDamageIndex", 2) elseif style == HAND_RIGHT then SetVariable("GuardDamageIndex", 0) elseif style == HAND_LEFT or style == HAND_RIGHT_BOTH then SetVariable("GuardDamageIndex", 1) else SetVariable("GuardDamageIndex", 0) end if damage_level == DAMAGE_LEVEL_NONE or damage_level == DAMAGE_LEVEL_MINIMUM then act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_Repelled_Small") elseif damage_level == DAMAGE_LEVEL_SMALL then act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_Repelled_Small") elseif damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_LARGE or damage_level == DAMAGE_LEVEL_EXLARGE or damage_level == DAMAGE_LEVEL_PUSH or damage_level == DAMAGE_LEVEL_FLING or damage_level == DAMAGE_LEVEL_SMALL_BLOW or damage_level == DAMAGE_LEVEL_UPPER or damage_level == DAMAGE_LEVEL_EX_BLAST or damage_level == DAMAGE_LEVEL_BREATH then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) ExecEventAllBody("W_Repelled_Large") else act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_Repelled_Small") end return TRUE elseif damage_type == DAMAGE_TYPE_GUARDBREAK then if is_parry == TRUE then return FALSE end if env(GetSpEffectID, 175) == TRUE then return FALSE end local guardindex = GUARD_STYLE_DEFAULT if style == HAND_RIGHT then guardindex = env(GetGuardMotionCategory, HAND_LEFT) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_TORCH) == TRUE then SetVariable("IsTorchGuard", TRUE) else SetVariable("IsTorchGuard", FALSE) end if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 end if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 if env(GetSpEffectID, 176) == TRUE then SetVariable("GuardBreakDuelingShieldState", 1) end end elseif style == HAND_LEFT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_LEFT) end if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 end elseif style == HAND_RIGHT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_RIGHT) end if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 end end SetVariable("IndexGuard", guardindex) act(SetDamageAnimType, DAMAGE_FLAG_GUARD_BREAK) if c_SwordArtsID == 202 and style == HAND_RIGHT and c_SwordArtsHand == HAND_RIGHT then ExecEventAllBody("W_GuardBreakRight") else ExecEventAllBody("W_GuardBreak") end return TRUE elseif damage_type == DAMAGE_TYPE_WALL_RIGHT then if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then SetVariable("GuardDamageIndex", 1) else SetVariable("GuardDamageIndex", 0) end act(SetDamageAnimType, DAMAGE_FLAG_GUARD_BREAK) ExecEventAllBody("W_Repelled_Wall") return TRUE elseif damage_type == DAMAGE_TYPE_WALL_LEFT then if style == HAND_LEFT_BOTH then SetVariable("GuardDamageIndex", 1) else SetVariable("GuardDamageIndex", 2) end act(SetDamageAnimType, DAMAGE_FLAG_GUARD_BREAK) ExecEventAllBody("W_Repelled_Wall") return TRUE elseif damage_type == DAMAGE_TYPE_GUARDBREAK_BLAST then act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) ExecEventAllBody("W_DamageLv7_SmallBlow") return TRUE elseif damage_type == DAMAGE_TYPE_GUARDBREAK_FLING then act(SetDamageAnimType, DAMAGE_FLAG_FLING) ExecEventAllBody("W_DamageLv6_Fling") return TRUE end elseif damage_type == DAMAGE_TYPE_GUARD then if damage_level ~= DAMAGE_LEVEL_NONE then AttackBlockDetection() end if is_parry == TRUE or is_attackwhileguard == TRUE then return FALSE end if env(GetSpEffectID, 175) == TRUE then return FALSE end if env(GetSpEffectID, 176) == TRUE then return FALSE end local guardindex = GUARD_STYLE_DEFAULT if style == HAND_RIGHT then guardindex = env(GetGuardMotionCategory, HAND_LEFT) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_TORCH) == TRUE then SetVariable("IsTorchGuard", TRUE) else SetVariable("IsTorchGuard", FALSE) end if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 end elseif style == HAND_LEFT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_LEFT) end if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 end elseif style == HAND_RIGHT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_RIGHT) end if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_DUELING_SHIELD then guardindex = 3 end end SetVariable("IndexGuard", guardindex) local guard_damage_level = env(GetGuardLevelAction) if env(GetSpEffectID, 171) == TRUE and guard_damage_level < 3 then guard_damage_level = 3 end if guard_damage_level > 0 then if guard_damage_level == 1 then act(SetDamageAnimType, DAMAGE_FLAG_GUARD_SMALL) if env(GetSpEffectID, 102001) == TRUE or env(GetSpEffectID, 102011) == TRUE or env(GetSpEffectID, 102013) == TRUE or env(GetSpEffectID, 102015) == TRUE then SetJustGuardSucceedEffect(1) ExecEventAllBody("W_GuardDamageSmall_JustGuard") else ExecEventAllBody("W_GuardDamageSmall") end elseif guard_damage_level == 3 then act(SetDamageAnimType, DAMAGE_FLAG_GUARD_LARGE) if env(GetSpEffectID, 102001) == TRUE or env(GetSpEffectID, 102011) == TRUE or env(GetSpEffectID, 102013) == TRUE or env(GetSpEffectID, 102015) == TRUE then SetJustGuardSucceedEffect(2) ExecEventAllBody("W_GuardDamageMiddle_JustGuard") else ExecEventAllBody("W_GuardDamageMiddle") end elseif guard_damage_level == 4 and env(GetSpEffectID, Jewel_of_the_Resolute) == FALSE then act(SetDamageAnimType, DAMAGE_FLAG_GUARD_EXLARGE) if env(GetSpEffectID, 102001) == TRUE or env(GetSpEffectID, 102011) == TRUE or env(GetSpEffectID, 102013) == TRUE or env(GetSpEffectID, 102015) == TRUE then SetJustGuardSucceedEffect(2) ExecEventAllBody("W_GuardDamageLarge_JustGuard") else ExecEventAllBody("W_GuardDamageLarge") end else act(SetDamageAnimType, DAMAGE_FLAG_GUARD_LARGE) if env(GetSpEffectID, 102001) == TRUE or env(GetSpEffectID, 102011) == TRUE or env(GetSpEffectID, 102013) == TRUE or env(GetSpEffectID, 102015) == TRUE then SetJustGuardSucceedEffect(2) ExecEventAllBody("W_GuardDamageMiddle_JustGuard") else ExecEventAllBody("W_GuardDamageMiddle") end end return TRUE else if env(GetSpEffectID, 102001) == TRUE or env(GetSpEffectID, 102011) == TRUE or env(GetSpEffectID, 102013) == TRUE or env(GetSpEffectID, 102015) == TRUE then SetJustGuardSucceedEffect(1) ExecAddDamage(damage_angle, attack_dir, damage_level, TRUE, is_damaged, TRUE) else ExecAddDamage(damage_angle, attack_dir, damage_level, TRUE, is_damaged, FALSE) end return FALSE end end if env(GetKnockbackDistance) < 0 then if damage_angle == DAMAGE_DIR_LEFT then damage_angle = DAMAGE_DIR_RIGHT elseif damage_angle == DAMAGE_DIR_RIGHT then damage_angle = DAMAGE_DIR_LEFT elseif damage_angle == DAMAGE_DIR_FRONT then damage_angle = DAMAGE_DIR_BACK elseif damage_angle == DAMAGE_DIR_BACK then damage_angle = DAMAGE_DIR_FRONT end end if env(GetSpEffectID, 89) == TRUE or env(GetSpEffectID, 100640) == TRUE then if damage_level == DAMAGE_LEVEL_EXLARGE then act(RequestAIJumpInterupt) elseif damage_level == DAMAGE_LEVEL_LARGE or damage_level == DAMAGE_LEVEL_PUSH or damage_level == DAMAGE_LEVEL_FLING or damage_level == DAMAGE_LEVEL_SMALL_BLOW or damage_level == DAMAGE_LEVEL_UPPER or damage_level == DAMAGE_LEVEL_EX_BLAST or damage_level == DAMAGE_LEVEL_BREATH or env(GetIsWeakPoint) == TRUE then act(RequestAIJumpInterupt) damage_level = DAMAGE_LEVEL_SMALL_BLOW elseif damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_SMALL then CalcDamageCount() act(RequestAIJumpInterupt) hkbFireEvent("W_JumpDamage_Start") SetVariable("Int16Variable04", 0) act(SetDamageAnimType, 3) ResetRequest() return TRUE else damage_level = DAMAGE_LEVEL_NONE end end local height = env(GetFallHeight) / 100 if env(IsFalling) == TRUE and env(GetBehaviorID, 10) == TRUE and height >= 10 then damage_level = DAMAGE_LEVEL_NONE end if env(GetIsWeakPoint) == TRUE and env(GetBehaviorID, 15) == FALSE then CalcDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_WEAK) ExecEventAllBody("W_DamageWeak") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_NONE then ExecAddDamage(damage_angle, attack_dir, damage_level, FALSE, is_damaged, FALSE) OnTakingHit(true) return FALSE elseif damage_level == DAMAGE_LEVEL_SMALL then CalcDamageCount() SetVariable("DamageDirection", damage_angle) SetVariable("IndexDamageLv1_Small_AttackDirection", attack_dir) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_DamageLv1_Small") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_MIDDLE then CalcDamageCount() SetVariable("DamageDirection", damage_angle) SetVariable("IndexDamageLv2_Middle_AttackDirection", attack_dir) act(SetDamageAnimType, DAMAGE_FLAG_MEDIUM) ExecEventAllBody("W_DamageLv2_Middle") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_LARGE then CalcDamageCount() SetVariable("DamageDirection", damage_angle) SetVariable("IndexDamageLv3_Large_AttackDirection", attack_dir) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() if env(GetBehaviorID, 3) == TRUE then ExecEventAllBody("W_DamageLarge2") return TRUE else ExecEventAllBody("W_DamageLv3_Large") return TRUE end elseif damage_level == DAMAGE_LEVEL_EXLARGE then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_LARGE_BLOW) ExecEventAllBody("W_DamageLv4_ExLarge") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_EX_BLAST then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_LARGE_BLOW) ExecEventAllBody("W_DamageLV10_ExBlast") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_PUSH then if env(GetBehaviorID, 14) == TRUE then act(AddSpEffect, 19865) end CalcDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_PUSH) ExecEventAllBody("W_DamageLv5_Push") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_SMALL_BLOW then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) ExecEventAllBody("W_DamageLv7_SmallBlow") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_UPPER then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_LARGE_BLOW) if env(GetBehaviorID, 10) == TRUE then SetVariable("DamageLv9_Behavior", 1) elseif env(GetBehaviorID, 13) == TRUE then SetVariable("DamageLv9_Behavior", 2) else SetVariable("DamageLv9_Behavior", 0) end ExecEventAllBody("W_DamageLv9_Upper") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_MINIMUM then CalcDamageCount() local pre_index = GetVariable("IndexDamageLv8_Minimum_Random") local index = (pre_index + math.random(1, 2)) % 3 SetVariable("IndexDamageLv8_Minimum_Random", index) act(SetDamageAnimType, DAMAGE_FLAG_MINIMUM) ExecEventAllBody("W_DamageLv8_Minimum") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_FLING then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_FLING) ExecEventAllBody("W_DamageLv6_Fling") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_BREATH then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetDamageAnimType, DAMAGE_FLAG_BREATH) ExecEventAllBody("W_DamageLv11_Breath") Replanning() return TRUE end return FALSE end function GetLandIndex(height, is_jump) if 8 < height then return LAND_HEAVY elseif height > 4 then return LAND_MIDDLE elseif is_jump == TRUE and height > 0 then return LAND_JUMP else return LAND_DEFAULT end end function FallCommonFunction(is_enable_falling_death, is_jump, fall_style) local height = env(GetFallHeight) / 100 local damage_type = env(GetReceivedDamageType) local style = c_Style if damage_type == DAMAGE_TYPE_DEATH_FALLING then BlightpoleOffHandler() if fall_style == FALL_FACEUP then ExecEventAllBody("W_FallDeathFaceUp") elseif fall_style == FALL_FACEDOWN then ExecEventAllBody("W_FallDeathFaceDown") else ExecEventAllBody("W_FallDeath") end return TRUE end if is_enable_falling_death ~= TRUE or not (height >= 60) or env(GetStateChangeType, 266) == TRUE then else BlightpoleOffHandler() if fall_style == FALL_FACEUP then ExecEventAllBody("W_FallDeathFaceUp") elseif fall_style == FALL_FACEDOWN then ExecEventAllBody("W_FallDeathFaceDown") else ExecEventAllBody("W_FallDeath") end return TRUE end act(SetIsEquipmentMenuAccessOn) if env(IsLanding) == TRUE then IS_ATTACKED_JUMPMAGIC = FALSE if env(GetStateChangeType, 266) == TRUE then Replanning() SetVariable("LandIndex", LAND_MIDDLE) ExecEventAllBody("W_Land") return TRUE end if fall_style == FALL_DEFAULT then if IsLandDead(height) == TRUE then if height > 8 then SetVariable("IndexDeath", DEATH_TYPE_LAND) else SetVariable("IndexDeath", DEATH_TYPE_LAND_LOW) end ExecEventAllBody("W_DeathStart") return TRUE else if height > 1.3 then local landIndex = GetLandIndex(height, is_jump) SetVariable("LandIndex", landIndex) Replanning() local JumpMoveLevel = 0 if landIndex ~= LAND_HEAVY then if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end end if ShouldDoSlowEffect() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 2 then ExecEventNoReset("W_Jump_Land_To_Dash") return TRUE elseif JumpMoveLevel == 1 then SetVariable("JumpLandMoveDirection", GetVariable("MoveDirection")) ExecEventNoReset("W_Jump_Land_To_Run") return TRUE else ExecEventAllBody("W_Land") end else act(Unknown9999) if height > 0.3 then ExecEventAllBody("W_LandLow") else ExecEventAllBody("W_Idle") end end return TRUE end elseif fall_style == FALL_FACEUP then if IsLandDead(height) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_LAND_FACEUP) ExecEventAllBody("W_DeathStart") else Replanning() ExecEventAllBody("W_LandFaceUp") end return TRUE elseif fall_style == FALL_FACEDOWN then if IsLandDead(height) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_LAND_FACEDOWN) ExecEventAllBody("W_DeathStart") else Replanning() ExecEventAllBody("W_LandFaceDown") end return TRUE elseif fall_style == FALL_LADDER then if IsLandDead(height) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_LAND) ExecEventAllBody("W_DeathStart") else Replanning() ExecEventAllBody("W_LadderFallLanding") end return TRUE end end local arrowHand = HAND_RIGHT if style == HAND_LEFT_BOTH then arrowHand = HAND_LEFT end local is_arrow = GetEquipType(arrowHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) if is_arrow == TRUE then if env(ActionRequest, 0) == TRUE then act(ChooseBowAndArrowSlot, 0) g_ArrowSlot = 0 elseif env(ActionRequest, 1) == TRUE then act(ChooseBowAndArrowSlot, 1) g_ArrowSlot = 1 end end if fall_style == FALL_DEFAULT and height >= 0.2 then if ExecFallMagic() == TRUE then return TRUE elseif ExecFallAttack() == TRUE then return TRUE end end return FALSE end function ExecFallAttack() if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE or env(ActionRequest, ACTION_ARM_L1) == TRUE and IsEnableDualWielding() == HAND_RIGHT then local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local is_arrow = GetEquipType(hand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) local is_staff = GetEquipType(hand, WEAPON_CATEGORY_STAFF) if env(ActionRequest, ACTION_ARM_R1) == TRUE or is_arrow == TRUE then if is_staff == TRUE then return FALSE end SetVariable("JumpAttackForm", 1) SetVariable("JumpAttackFormRequest", 0) elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then SetVariable("JumpAttackForm", 2) SetVariable("JumpAttackFormRequest", 1) elseif env(ActionRequest, ACTION_ARM_L1) == TRUE then if IsEnableDualWielding() ~= HAND_RIGHT then return FALSE end SetVariable("JumpAttackForm", 3) SetVariable("JumpAttackFormRequest", 2) end if is_arrow == TRUE and (style == HAND_LEFT_BOTH or style == HAND_RIGHT_BOTH) and env(IsOutOfAmmo, hand) == TRUE then return FALSE end if GetEquipType(hand, WEAPON_CATEGORY_CROSSBOW) == TRUE and env(GetBoltLoadingState, hand) == FALSE then return FALSE end if style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 0) elseif style == HAND_RIGHT_BOTH then SetVariable("JumpAttack_HandCondition", 1) elseif style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 4) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttack_Land", 0) if is_arrow == TRUE then ShotArrow() end ExecEventAllBody("W_JumpAttack_Start_Falling") return TRUE end return FALSE end function ExecGuardOnCancelTiming(guardcondition, blend_type) if env(IsGuardFromAtkCancel) == FALSE then return FALSE end act(DebugLogOutput, "ExecGuardOnCancelTiming " .. guardcondition) if guardcondition == TO_GUARDON and DeflectActive() == TRUE and env(ActionRequest, ACTION_ARM_L1) == TRUE then guardcondition = FALSE end if guardcondition == TO_GUARDON then if ExecGuard(Event_GuardOn, blend_type) == TRUE then return TRUE end elseif ExecGuard(Event_GuardStart, blend_type) == TRUE then return TRUE end return FALSE end function LadderIdleCommonFunction(hand) act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then return TRUE end if ExecLadderDamageIdle(hand) == TRUE then return TRUE end if ExecLadderAttack(hand) == TRUE then return TRUE end if ExecLadderItem(hand) == TRUE then return TRUE end if ExecLadderMove(hand) == TRUE then return TRUE end return FALSE end function LadderMoveCommonFunction(hand, is_no_damage) act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then return TRUE end if is_no_damage == FALSE and ExecLadderDamageMove() == TRUE then end if env(IsAnimEnd, 1) == TRUE then if CheckLadderDamage(hand) == TRUE then return TRUE end if ExecLadderAttack(hand) == TRUE then return TRUE end if ExecLadderItem(hand) == TRUE then return TRUE end if ExecLadderMove(hand) == TRUE then return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderIdleLeft") else ExecEvent("W_LadderIdleRight") end return TRUE end return FALSE end function LadderAttackCommonFunction(hand) act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then return TRUE end if ExecLadderDamageIdle(hand) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then if ExecLadderAttack(hand) == TRUE then return TRUE end if ExecLadderItem(hand) == TRUE then return TRUE end if ExecLadderMove(hand) == TRUE then return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderIdleLeft") else ExecEvent("W_LadderIdleRight") end return TRUE end return FALSE end function LadderDamageCommonFunction(hand) act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then return TRUE end if ExecLadderDamageIdle(hand) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then if ExecLadderAttack(hand) == TRUE then return TRUE end if ExecLadderItem(hand) == TRUE then return TRUE end if ExecLadderMove(hand) == TRUE then return TRUE end if hand == HAND_STATE_RIGHT then ExecEvent("W_LadderIdleRight") else ExecEvent("W_LadderIdleLeft") end return TRUE end return FALSE end function LadderEndCommonFunction() act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecFallStart(FALL_TYPE_DEFAULT) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecJump() == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end return FALSE end function LadderItemCommonFunction(hand, tonext) act(SetIsItemAnimationPlaying) act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then return TRUE end if ExecLadderDamageIdle(hand) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then if ExecLadderItem(hand) == TRUE then return TRUE end if tonext == FALSE then if ExecLadderAttack(hand) == TRUE then return TRUE end if ExecLadderMove(hand) == TRUE then return TRUE end if hand == HAND_STATE_RIGHT then ExecEvent("W_LadderIdleRight") else ExecEvent("W_LadderIdleLeft") end return TRUE end return FALSE end return FALSE end function CheckLadderDamage(hand) local damage_flag = Flag_LadderDamage if damage_flag == LADDER_DAMAGE_SMALL then act(ChangeStamina, -30) if ExecLadderFall() == TRUE then return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderDamageSmallLeft") else ExecEvent("W_LadderDamageSmallRight") end elseif damage_flag == LADDER_DAMAGE_LARGE then act(ChangeStamina, -40) if ExecLadderFall() == TRUE then return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderDamageLargeLeft") else ExecEvent("W_LadderDamageLargeRight") end else Flag_LadderDamage = LADDER_DAMAGE_NONE return FALSE end Flag_LadderDamage = LADDER_DAMAGE_NONE return TRUE end function ExecLadderDeath() local hp = env(GetHP) if hp <= 0 or env(GetStateChangeType, CONDITION_TYPE_STONE) == TRUE or env(GetStateChangeType, CONDITION_TYPE_CRYSTAL) == TRUE or env(GetDamageSpecialAttribute, 3) == TRUE then ExecEvent("W_LadderDeathStart") return TRUE end return FALSE end function ExecLadderDamageIdle(hand) if env(HasReceivedAnyDamage) == FALSE then return FALSE end if env(GetStamina) <= 80 then act(ChangeStamina, -40) if ExecLadderFall() == TRUE then return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderDamageLargeLeft") else ExecEvent("W_LadderDamageLargeRight") end else act(ChangeStamina, -30) if ExecLadderFall() == TRUE then return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderDamageSmallLeft") else ExecEvent("W_LadderDamageSmallRight") end end return TRUE end function ExecLadderDamageMove() if env(HasReceivedAnyDamage) == FALSE then return FALSE end if env(GetStamina) <= 80 then Flag_LadderDamage = LADDER_DAMAGE_LARGE else Flag_LadderDamage = LADDER_DAMAGE_SMALL end return TRUE end function ExecLadderFall() if env(GetStamina) > 0 and env(GetDamageSpecialAttribute, 5) == FALSE then return FALSE end ExecEvent("W_LadderFallStart") return TRUE end function GetLadderEventCommand(is_start) if env(IsCOMPlayer) == FALSE then return env(GetCommandIDFromEvent, 0) else local req_up = env(ActionRequest, ACTION_ARM_LADDERUP) local req_down = env(ActionRequest, ACTION_ARM_LADDERDOWN) if is_start == TRUE then if req_up == TRUE then return LADDER_ACTION_START_BOTTOM elseif req_down == TRUE then return LADDER_ACTION_START_TOP end elseif req_up == TRUE then if env(IsReachTopOfLadder) == TRUE then return LADDER_EVENT_COMMAND_END_TOP else return LADDER_EVENT_COMMAND_UP end elseif req_down == TRUE then if env(IsReachBottomOfLadder) == TRUE then return LADDER_EVENT_COMMAND_END_BOTTOM else return LADDER_EVENT_COMMAND_DOWN end end return INVALID end end function ExecLadderMove(hand) local sp_action = env(ActionDuration, ACTION_ARM_SP_MOVE) if sp_action == 0 then if Flag_LadderJump == LADDER_JUMP_WHEN_RELEASE and env(ActionRequest, ACTION_ARM_BACKSTEP) == TRUE and env(IsOnLastRungOfLadder) == FALSE then LadderSendCommand(LADDER_EVENT_COMMAND_EXIT) LadderSetActionState(LADDER_ACTION_INVALID) ExecEvent("W_LadderDrop") return TRUE end Flag_LadderJump = LADDER_JUMP_SP_RELEASED elseif sp_action < 150 then if Flag_LadderJump == LADDER_JUMP_SP_RELEASED then Flag_LadderJump = LADDER_JUMP_WHEN_RELEASE end else Flag_LadderJump = LADDER_JUMP_INVALID end local event_command = GetLadderEventCommand(FALSE) if event_command <= 0 then return FALSE end if event_command == LADDER_EVENT_COMMAND_UP then if env(IsCOMPlayer) == TRUE and env(DoesLadderHaveCharacters, LADDER_UP_CHECK_DIST, 1, 1) == TRUE then if hand == HAND_STATE_RIGHT then ExecEvent("W_LadderAttackUpRight") else ExecEvent("W_LadderAttackUpLeft") end return TRUE end if env(IsSomeoneOnLadder, LADDER_UP_CHECK_DIST, 0) == TRUE then return FALSE end if env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then SetVariable("IsFastUp", TRUE) else SetVariable("IsFastUp", FALSE) end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderUpLeft") else ExecEvent("W_LadderUpRight") end return TRUE elseif event_command == LADDER_EVENT_COMMAND_DOWN then if env(IsCOMPlayer) == TRUE and env(DoesLadderHaveCharacters, LADDER_DOWN_CHECK_DIST, 0, 1) == TRUE then if hand == HAND_STATE_RIGHT then ExecEvent("W_LadderAttackDownRight") else ExecEvent("W_LadderAttackDownLeft") end return TRUE end if env(IsSomeoneUnderLadder, LADDER_DOWN_CHECK_DIST, 0) == TRUE then return FALSE end if env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then ExecEvent("W_LadderCoastStart") return TRUE end if hand == HAND_STATE_LEFT then ExecEvent("W_LadderDownLeft") else ExecEvent("W_LadderDownRight") end return TRUE elseif event_command == LADDER_EVENT_COMMAND_END_TOP then if hand == HAND_STATE_LEFT then ExecEvent("W_LadderEndTopLeft") else ExecEvent("W_LadderEndTopRight") end return TRUE elseif event_command == LADDER_EVENT_COMMAND_END_BOTTOM then if hand == HAND_STATE_LEFT then ExecEvent("W_LadderEndBottomLeft") else ExecEvent("W_LadderEndBottomRight") end return TRUE end return FALSE end function LadderStart() local event_command = GetLadderEventCommand(TRUE) if event_command == LADDER_ACTION_START_BOTTOM then ExecEvent("W_LadderAttachBottom") return TRUE elseif event_command == LADDER_ACTION_START_TOP then ExecEvent("W_LadderAttachTop") return TRUE end return FALSE end function LadderSetActionState(state) act(SetLadderActionState, state) end function LadderSendCommand(event_call) act(SendMessageIDToEvents, event_call) end function ExecLadderAttack(hand) if env(GetStamina) <= 0 then return FALSE end if env(ActionRequest, ACTION_ARM_R1) == TRUE then if hand == HAND_STATE_RIGHT then ExecEvent("W_LadderAttackUpRight") else ExecEvent("W_LadderAttackUpLeft") end return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then if hand == HAND_STATE_RIGHT then ExecEvent("W_LadderAttackDownRight") else ExecEvent("W_LadderAttackDownLeft") end return TRUE end return FALSE end function LadderCoastCommonFunction(hand, is_start) act(SetIsEquipmentMenuAccessOn) if ExecLadderDeath() == TRUE then return TRUE end if ExecLadderDamageMove() == TRUE then end if is_start == FALSE then if env(IsOnLastRungOfLadder) == TRUE then ExecEvent("W_LadderCoastLanding") return TRUE end local event_command = GetLadderEventCommand(FALSE) if env(ActionDuration, ACTION_ARM_SP_MOVE) <= 0 or env(MovementRequestDuration) <= 0 or event_command > 0 and event_command ~= LADDER_EVENT_COMMAND_DOWN or env(IsSomeoneUnderLadder, LADDER_DOWN_CHECK_DIST, 0) == TRUE then act(LadderSlideDownCancel) if env(GetNumberOfRungsBelowOnLadder) % 2 == 0 then ExecEvent("W_LadderCoastStopRight") else ExecEvent("W_LadderCoastStopLeft") end return TRUE end elseif env(IsAnimEnd, 1) == TRUE then if CheckLadderDamage(hand) == TRUE then return TRUE end ExecEvent("W_LadderCoastLeft") return TRUE end return FALSE end function IdleCommonFunction() if env(IsCOMPlayer) == TRUE then act(LockonSystemUnableToTurnAngle, 15, 15) else act(LockonSystemUnableToTurnAngle, 45, 45) end act(Wait) act(AllowBuddyWarp) SetEnableAimMode() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if LadderStart() == TRUE then return TRUE end if c_IsStealth == FALSE and ExecQuickTurn(ALLBODY, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuard(Event_GuardStart, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStance(ALLBODY) == TRUE then return TRUE end if ExecRide() == TRUE then return TRUE end local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" if c_IsStealth == TRUE then r1 = "W_AttackRightLightStealth" b1 = "W_AttackBothLightStealth" end if ExecAttack(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if c_IsStealth == TRUE then if MoveStart(ALLBODY, Event_Stealth_Move, FALSE) == TRUE then return TRUE end elseif MoveStart(ALLBODY, Event_Move, FALSE) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end return FALSE end function SetAttackQueue(r1, r2, l1, l2, b1, b2) g_r1 = r1 g_r2 = r2 g_l1 = l1 g_l2 = l2 g_b1 = b1 g_b2 = b2 end function ClearAttackQueue() g_r1 = "W_AttackRightLight1" g_r2 = "W_AttackRightHeavy1Start" g_l1 = "W_AttackLeftLight1" g_l2 = "W_AttackLeftHeavy1" g_b1 = "W_AttackBothLight1" g_b2 = "W_AttackBothHeavy1Start" end function AttackCommonFunction(r1, r2, l1, l2, b1, b2, guardcondition, use_atk_queue, comboCount, gen_hand) if gen_hand == nil then gen_hand = FALSE end SetVariable("ToggleDash", 0) act(FallPreventionAssist) SetThrowAtkInvalid() SetAIActionState() if env(GetSpEffectID, 102050) == TRUE then act(LockonFixedAngleCancel) end local bool = FALSE if guardcondition == TO_GUARDON then bool = TRUE end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, bool) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_ATTACK, ALLBODY) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if ExecMagic(QUICKTYPE_ATTACK, ALLBODY, FALSE) == TRUE then return TRUE end if ExecAttack(r1, r2, l1, l2, b1, b2, guardcondition, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(guardcondition, ALLBODY) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end local move_event = Event_Move if env(GetSpEffectID, 102051) == TRUE then move_event = Event_MoveLong end if MoveStartonCancelTiming(move_event, gen_hand) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end return FALSE end function BackStabCommonFunction() SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_ATTACK, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_ATTACK, ALLBODY, FALSE) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end return FALSE end function ThrowCommonFunction(estep) if env(IsThrowing) == FALSE then if ExecDeath() == TRUE then return TRUE end if env(CheckForEventAnimPlaybackRequest) == TRUE then return TRUE end if ExecDamage(FALSE) == TRUE then return TRUE end end if ExecFallStart(FALL_TYPE_DEFAULT) == TRUE then return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, estep, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_MoveQuick, FALSE) == TRUE then return TRUE end return FALSE end function GestureCommonFunction(blend_type) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end return FALSE end function GestureLoopCommonFunction(blend_type, lower_state, is_start) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end local canmove = FALSE if env(GetEventEzStateFlag, 0) == TRUE then if env(HasActionRequest) == TRUE then ExecEventHalfBlend(Event_GestureEnd, lower_state) return TRUE end if canmove == FALSE and 0 < GetVariable("MoveSpeedLevel") then ExecEventHalfBlend(Event_GestureEnd, lower_state) return TRUE end end return FALSE end function MagicCommonFunction(blend_type, quick_type, is_throw) if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end if GetVariable("MoveSpeedLevel") <= 0 then act(FallPreventionAssist) end if is_throw ~= TRUE then SetThrowAtkInvalid() end SetAIActionState() act(SetIsMagicInUse, TRUE) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end return FALSE end function ArrowCommonFunction(blend_type, is_allbody_turn, turn_type, is_stance_end) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if c_IsStealth == FALSE then if is_allbody_turn == TRUE then if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end elseif blend_type ~= UPPER and ExecQuickTurn(LOWER, turn_type) == TRUE then return FALSE end end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if is_stance_end == TRUE and ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end return FALSE end function CrossbowCommonFunction(blend_type, is_nonturn) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if is_nonturn == FALSE and blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return FALSE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end return FALSE end function Evasion_Activate() ActivateRightArmAdd(START_FRAME_A02) end function Evasion_Update() UpdateRightArmAdd() end function Evasion_Deactivate() end function EvasionCommonFunction(fall_type, r1, r2, l1, l2, b1, b2, quick_type) SetAIActionState() SetEnableAimMode() if ExecPassiveAction(FALSE, fall_type, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if IsNodeActive("BackStepGuardOn_UpperLayer Selector") == TRUE then act(DebugLogOutput, "BackStepGuardOn") if ExecGuardOnCancelTiming(TO_GUARDON, ALLBODY) == TRUE then return TRUE end if env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) > 0 then act(DebugLogOutput, "BackStepGuard_ToGuardOn") end elseif ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(quick_type, ALLBODY) == TRUE then return TRUE end if ExecMagic(quick_type, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack(r1, r2, l1, l2, b1, b2, FALSE, ALLBODY, FALSE, FALSE, TRUE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_MoveLong, FALSE) == TRUE then return TRUE end return FALSE end function DamageCommonFunction(guardcondition, estep, fall_type) if ExecPassiveAction(FALSE, fall_type, FALSE) == TRUE then return TRUE end SetVariable("ToggleDash", 0) SetEnableAimMode() if c_SwordArtsID == 352 and (c_SwordArtsHand == HAND_LEFT or c_Style == HAND_RIGHT_BOTH) and env(GetSpEffectID, 102340) == TRUE and 0 < env(ActionDuration, ACTION_ARM_L2) then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) ExecEventAllBody("W_SwordArtsBothGuardCounter") return TRUE else SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) ExecEventAllBody("W_SwordArtsLeftGuardCounter") return TRUE end end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then ResetDamageCount() return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then ResetDamageCount() return TRUE end local is_usechainrecover = GetVariable("UseChainRecover") if ExecEvasion(TRUE, estep, is_usechainrecover) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then ResetDamageCount() return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then ResetDamageCount() return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then ResetDamageCount() return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", guardcondition, ALLBODY, FALSE, FALSE, FALSE) == TRUE then ResetDamageCount() return TRUE end if env(IsMoveCancelPossible) == TRUE then ResetDamageCount() end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecGuardOnCancelTiming(guardcondition, ALLBODY) == TRUE then ResetDamageCount() return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then ResetDamageCount() return TRUE end return FALSE end function QuickTurnCommonFunction() act(SetIsEquipmentMenuAccessOff) act(AllowBuddyWarp) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, UPPER) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, UPPER) == TRUE then return TRUE end if ExecWeaponChange(UPPER) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, UPPER) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, UPPER, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(UPPER) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, UPPER, FALSE, FALSE, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end return FALSE end function LandCommonFunction() act(SetIsEquipmentMenuAccessOn) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end return FALSE end function ItemCommonFunction(blend_type) act(SetIsEquipmentMenuAccessOff) if env(GetStateChangeType, 15) == FALSE then act(SetIsItemAnimationPlaying) end if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end if GetVariable("MoveSpeedLevel") <= 0 then act(FallPreventionAssist) end SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end return FALSE end function StealthItemCommonFunction(blend_type) act(SetIsItemAnimationPlaying) if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end if GetVariable("MoveSpeedLevel") <= 0 then act(FallPreventionAssist) end SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Stealth_Move, FALSE) == TRUE then act(DebugLogOutput, "StealthItemCommonFunction MoveStartonCancelTiming") return TRUE end return FALSE end function QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, blend_type, quick_type) act(SetIsItemAnimationPlaying) if GetVariable("MoveSpeedLevel") <= 0 then act(FallPreventionAssist) end SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecWeaponChange(blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecAttack(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecItem(quick_type, blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecMagic(QUICKTYPE_ATTACK, ALLBODY, FALSE) == TRUE then ClearAttackQueue() return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then ClearAttackQueue() return TRUE end return FALSE end function StopCommonFunction(is_dash_stop) act(Wait) if is_dash_stop == TRUE then if c_IsStealth == TRUE then act(LockonSystemUnableToTurnAngle, 0, 0) else act(LockonSystemUnableToTurnAngle, 180, 180) end elseif env(IsCOMPlayer) == TRUE then act(LockonSystemUnableToTurnAngle, 15, 15) else act(LockonSystemUnableToTurnAngle, 45, 45) end SetEnableAimMode() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if LadderStart() == TRUE then return TRUE end if is_dash_stop == FALSE and c_IsStealth == FALSE and ExecQuickTurn(ALLBODY, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuard(Event_GuardStart, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStance(ALLBODY) == TRUE then return TRUE end if ExecRide() == TRUE then return TRUE end local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" if c_IsStealth == TRUE then r1 = "W_AttackRightLightStealth" b1 = "W_AttackBothLightStealth" end if ExecAttack(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if env(GetSpEffectID, 100170) == TRUE then act(LockonFixedAngleCancel) if ExecDashTurn() == TRUE then return TRUE end end if c_IsStealth == TRUE then if MoveStart(ALLBODY, Event_Stealth_Move, FALSE) == TRUE then return TRUE end elseif MoveStart(ALLBODY, Event_Move, FALSE) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end return FALSE end function MoveCommonFunction(blend_type) act(Wait) act(AllowBuddyWarp) SetEnableAimMode() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if LadderStart() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecGuard(Event_GuardStart, blend_type) == TRUE then return TRUE end local speed = GetVariable("MoveSpeedIndex") if speed == 2 then if ExecItem(QUICKTYPE_DASH, blend_type) == TRUE then return TRUE end elseif speed == 1 then if ExecItem(QUICKTYPE_RUN, blend_type) == TRUE then return TRUE end elseif ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if speed == 2 then if ExecMagic(QUICKTYPE_DASH, blend_type, FALSE) == TRUE then return TRUE end elseif ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if ExecArtsStance(blend_type) == TRUE then return TRUE end if ExecRide() == TRUE then return TRUE end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if speed == 2 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" elseif c_IsStealth == TRUE then r1 = "W_AttackRightLightStealth" b1 = "W_AttackBothLightStealth" end if ExecAttack(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, UPPER, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end if ExecStop() == TRUE then return TRUE end return FALSE end function GuardCommonFunction(is_guard_end, blend_type, is_just_guard) act(Wait) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if env(GetSpEffectID, 170) == TRUE then return FALSE end if LadderStart() == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if is_guard_end == TRUE then if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end elseif env(ActionRequest, ACTION_ARM_L2) == TRUE and ExecArtsStance(blend_type) == TRUE then return TRUE end if GetVariable("MoveSpeedIndex") == 2 then if ExecItem(QUICKTYPE_DASH, blend_type) == TRUE then return TRUE end elseif GetVariable("MoveSpeedIndex") == 1 then if ExecItem(QUICKTYPE_RUN, blend_type) == TRUE then return TRUE end elseif ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if GetVariable("MoveSpeedIndex") == 2 then if ExecMagic(QUICKTYPE_DASH, blend_type, FALSE) == TRUE then return TRUE end elseif GetVariable("MoveSpeedIndex") == 1 then if ExecMagic(QUICKTYPE_RUN, blend_type, FALSE) == TRUE then return TRUE end elseif ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if GetVariable("MoveSpeedLevelReal") > 1.1 then if ExecAttack("W_AttackRightLightDash", "W_AttackRightHeavyDash", nil, "W_AttackLeftHeavy1", "W_AttackBothDash", "W_AttackBothHeavyDash", FALSE, UPPER, FALSE, FALSE, FALSE) == TRUE then return TRUE end else local guard_attack = TRUE if is_guard_end == TRUE then guard_attack = FALSE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", guard_attack, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end end if is_just_guard == TRUE then if env(GetSpEffectID, 20100006) == TRUE and JUSTGUARD_IS_FIRSTFRAME == FALSE and (env(ActionCancelRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) <= 0) then ExecEventHalfBlendNoReset(Event_GuardEnd, blend_type) return TRUE end JUSTGUARD_IS_FIRSTFRAME = FALSE if env(ActionRequest, ACTION_ARM_L1) == TRUE and ExecGuard(Event_GuardStart, blend_type) == TRUE then return TRUE end elseif is_guard_end == FALSE then if env(ActionCancelRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) <= 0 then ExecEventHalfBlendNoReset(Event_GuardEnd, blend_type) return TRUE end elseif (env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) > 0) and ExecGuard(Event_GuardStart, blend_type) == TRUE then return TRUE end return FALSE end function ArtsCommonFunction(r1, r2, l1, l2, b1, b2, guardcondition, artsr1, artsr2, gen_trans, can_throw, blend_type) if can_throw == FALSE then SetThrowAtkInvalid() end SetAIActionState() act(SetIsEquipmentMenuAccessOff) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecWeaponChange(blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecItem(QUICKTYPE_ATTACK, blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecMagic(QUICKTYPE_ATTACK, blend_type, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack(r1, r2, l1, l2, b1, b2, guardcondition, blend_type, artsr1, artsr2, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then ClearAttackQueue() return TRUE end if ExecJump() == TRUE then ClearAttackQueue() return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then ClearAttackQueue() return TRUE end local guardcondition = FALSE if env(GetSpEffectID, 100410) == TRUE then guardcondition = TO_GUARDON end if c_SwordArtsID ~= 335 and ExecGuardOnCancelTiming(guardcondition, blend_type) == TRUE then ClearAttackQueue() return TRUE end if MoveStartonCancelTiming(Event_Move, gen_trans) == TRUE then ClearAttackQueue() return TRUE end if ExecGesture() == TRUE then ClearAttackQueue() return TRUE end return FALSE end function ArtsParryCommonFunction() SetAIActionState() if ExecPassiveAction(TRUE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_ATTACK, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_ATTACK, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end return FALSE end function ArtsStanceCommonFunction(r1, r2, l1, l2, b1, b2, blend_type, turn_type, artsr1, artsr2, is_stance_end, enable_turn) if is_stance_end == FALSE then SetThrowAtkInvalid() end SetAIActionState() act(SetIsEquipmentMenuAccessOff) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if c_SwordArtsID ~= 335 and env(ActionDuration, ACTION_ARM_L1) < 440 and ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if is_stance_end == TRUE and ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end if ExecAttack(r1, r2, l1, l2, b1, b2, FALSE, blend_type, artsr1, artsr2, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and enable_turn and ExecQuickTurn(LOWER, turn_type) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then if is_stance_end == TRUE then SetArtsGeneratorTransitionIndex() end ClearAttackQueue() return TRUE end return FALSE end function ArtsChargeShotCommonFunction() SetAIActionState() if env(GetEventEzStateFlag, 1) == FALSE then act(SetTurnSpeed, 0) end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end return FALSE end function WeaponChangeCommonFunction(blend_type) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100002) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" end if ExecAttack(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end return FALSE end function HandChangeCommonFunction(blend_type) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, blend_type, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100002) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" end if ExecAttack(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end return FALSE end function ChainRecoverCommonFunction() SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, blend_type) == TRUE then return TRUE end if ExecWeaponChange(blend_type) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, blend_type) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(blend_type) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end return FALSE end function Event_Activate() ActivateRightArmAdd(START_FRAME_NONE) SetVariable("IsEventActivate", true) end function Event_Update() if GetVariable("IsEventActivate") == false then UpdateRightArmAdd() end SetVariable("IsEventActivate", false) end function EventCommonFunction() if env(GetEventEzStateFlag, 0) == FALSE then act(SetIsEventAnim) end act(SetIsEquipmentMenuAccessOn) if env(HasThrowRequest) == TRUE then return TRUE end if ExecTalkDeath() == TRUE then return TRUE end if ExecDeath() == TRUE then return TRUE end if ExecTalkDamage() == TRUE then return TRUE end if env(GetSpEffectID, 9913) == FALSE and ExecDamage(FALSE) == TRUE then return TRUE end if ExecFallStart(FALL_TYPE_DEFAULT) == TRUE then return TRUE end if ExecTalk() == TRUE then return TRUE end if ExecQuickTurnOnCancelTiming() == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end local moveEvent = Event_MoveQuick if c_IsStealth == TRUE then moveEvent = Event_Stealth_Move end if MoveStartonCancelTiming(moveEvent, FALSE) == TRUE then return TRUE end return FALSE end function HalfBlendLowerCommonFunction(event, lower_state, to_idle_on_cancel, disable_stealth_move) if disable_stealth_move == nil then disable_stealth_move = FALSE end if lower_state == LOWER_MOVE then if ExecStopHalfBlend(event, to_idle_on_cancel) == TRUE then return TRUE end else local blend_type = LOWER if env(IsMoveCancelPossible) == TRUE then blend_type = ALLBODY end local move_event = Event_Move if c_IsStealth == TRUE and disable_stealth_move == FALSE then move_event = Event_Stealth_Move end if MoveStart(blend_type, move_event, FALSE) == TRUE then return TRUE end if lower_state == LOWER_END_TURN then ExecEventHalfBlendNoReset(event, LOWER) return TRUE end end return FALSE end function HalfBlendLowerCommonFunctionNoSync(event, lower_state, to_idle_on_cancel, is_fire_upper_on_move) if lower_state == LOWER_MOVE then if ExecStopHalfBlend(event, to_idle_on_cancel) == TRUE then return TRUE end else local blend_type = LOWER if env(IsMoveCancelPossible) == TRUE then blend_type = ALLBODY end if MoveStart(blend_type, Event_MoveNoSync, FALSE) == TRUE then if is_fire_upper_on_move == TRUE and blend_type == LOWER then ExecEventHalfBlend(event, UPPER) end return TRUE end if lower_state == LOWER_END_TURN then ExecEventHalfBlendNoReset(event, LOWER) return TRUE end end return FALSE end function HalfBlendUpperCommonFunction(lower_state) local exit_flag = FALSE if env(IsAnimEnd, 1) == TRUE then exit_flag = TRUE end if lower_state ~= LOWER_IDLE and env(GetEventEzStateFlag, 0) == TRUE then exit_flag = TRUE end if exit_flag == FALSE then return FALSE end if lower_state == LOWER_TURN then local turn_state = GetVariable("UpperDefaultState01") local event = Event_QuickTurnRight180Mirror if turn_state == QUICKTURN_LEFT180_DEF1 then event = Event_QuickTurnLeft180Mirror end ExecEventHalfBlendNoReset(event) elseif lower_state == LOWER_MOVE then if c_IsStealth == TRUE then ExecEventHalfBlendNoReset(Event_Stealth_Move, UPPER) else ExecEventHalfBlendNoReset(Event_Move, UPPER) end elseif c_IsStealth == TRUE then ExecEventNoReset("W_Stealth_Idle") else ExecEventNoReset("W_Idle") end return TRUE end function ArrowLowerCommonFunction(event, lower_state, to_idle_on_cancel) if lower_state == LOWER_MOVE then if ExecStopHalfBlend(event, to_idle_on_cancel) == TRUE then ShotArrow() return end else if lower_state ~= LOWER_TURN then local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end if env(GetEquipWeaponCategory, hand) ~= WEAPON_CATEGORY_LARGE_ARROW then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then return end elseif env(IsPrecisionShoot) == FALSE and MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end if lower_state == LOWER_END_TURN then ShotArrow() ExecEventHalfBlendNoReset(event, LOWER) end end end function Idle_onActivate() SetVariable("MoveSpeedLevelReal", 0) ClearAttackQueue() act(Wait) act(RequestThrowAnimInterrupt) act(DisallowAdditiveTurning, TRUE) end function Idle_onUpdate() SetEnableMimicry() if IdleCommonFunction() == TRUE then SetVariable("ArtsTransition", 0) end end function Idle_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function DashStop_onActivate() act(Wait) end function DashStop_onUpdate() if StopCommonFunction(TRUE) == TRUE then return end end function RunStopFront_onActivate() act(Wait) end function RunStopFront_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function RunStopBack_onActivate() act(Wait) end function RunStopBack_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function RunStopLeft_onActivate() act(Wait) end function RunStopLeft_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function RunStopRight_onActivate() act(Wait) end function RunStopRight_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function WalkStopFront_onActivate() act(Wait) end function WalkStopFront_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function WalkStopBack_onActivate() act(Wait) end function WalkStopBack_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function WalkStopLeft_onActivate() act(Wait) end function WalkStopLeft_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function WalkStopRight_onActivate() act(Wait) end function WalkStopRight_onUpdate() SetEnableMimicry() if StopCommonFunction(FALSE) == TRUE then return end end function Dash180_onActivate() act(SetIsTurnAnimInProgress) end function Dash180_onUpdate() act(SetIsTurnAnimInProgress) if QuickTurnCommonFunction() == TRUE then return end end function Rolling_onUpdate() act(DisallowAdditiveTurning, TRUE) SetThrowAtkInvalid() if env(GetSpEffectID, 100390) == TRUE then ResetDamageCount() end SetEnableAimMode() if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end SetRollingTurnCondition(FALSE) end function Rolling_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Rolling_Selftrans_onUpdate() act(DisallowAdditiveTurning, TRUE) SetThrowAtkInvalid() if env(GetSpEffectID, 100390) == TRUE then ResetDamageCount() end SetEnableAimMode() if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end SetRollingTurnCondition(TRUE) end function Rolling_Selftrans_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function DefaultBackStep_onActivate() ResetDamageCount() end function DefaultBackStep_onUpdate() act(SetIsEquipmentMenuAccessOff) act(DisallowAdditiveTurning, TRUE) if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothBackstep", "W_AttackBothHeavy1Start", QUICKTYPE_BACKSTEP) == TRUE then return end end function DefaultBackStep_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function BackStepGuardOn_UpperLayer_onUpdate() act(SetIsEquipmentMenuAccessOff) if ExecGuardOnCancelTiming(TO_GUARDON, ALLBODY) == TRUE then return end if IsGuard() == FALSE then SetVariable("EnableTAE_BackStep", true) ExecEventNoReset("W_BackStepGuardEnd_UpperLayer") return end end function BackStepGuardEnd_UpperLayer_onUpdate() act(SetIsEquipmentMenuAccessOff) if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventSyncNoReset("Event_BackStepGuardOut") end end function EStepDown_onUpdate() SetThrowAtkInvalid() SetEnableAimMode() if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end SetRollingTurnCondition(FALSE) end function ChainRecover_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ChainRecoverCommonFunction() == TRUE then return end if lower_state == LOWER_MOVE and env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendLowerCommonFunction(Event_ChainRecoverMirror, lower_state, FALSE) == TRUE then return end end function Move_Activate() SetWeightIndex() end function Move_Update() SetWeightIndex() end function Move_onActivate() act(SwitchMotion, TRUE) end function Move_onUpdate() act(SwitchMotion, TRUE) local move_speed = GetVariable("MoveSpeedIndex") if move_speed == 2 then SetThrowAtkInvalid() end if g_TimeActEditor_08 >= 1 then act(Set4DirectionMovementThreshold, GetVariable("MagicRightWalkAngle_FrontLeft"), GetVariable("MagicRightWalkAngle_FrontRight"), GetVariable("MagicRightWalkAngle_BackLeft"), GetVariable("MagicRightWalkAngle_BackRight")) elseif 1 <= g_TimeActEditor_09 then act(Set4DirectionMovementThreshold, GetVariable("MagicLeftWalkAngle_FrontLeft"), GetVariable("MagicLeftWalkAngle_FrontRight"), GetVariable("MagicLeftWalkAngle_BackLeft"), GetVariable("MagicLeftWalkAngle_BackRight")) elseif hkbGetVariable("MoveType") < 0.5 then act(Set4DirectionMovementThreshold, 60, 45, 60, 60) elseif hkbGetVariable("StanceMoveType") == 0 then act(Set4DirectionMovementThreshold, 70, 40, 60, 20) else act(Set4DirectionMovementThreshold, 40, 70, 60, 20) end SpeedUpdate() if env(IsCOMPlayer) == TRUE then local npc_turn_speed = 240 if move_speed == 2 then npc_turn_speed = 180 else local dir = GetVariable("MoveDirection") if dir == 0 then npc_turn_speed = 90 end end SetTurnSpeed(npc_turn_speed) end if hkbGetVariable("MoveDirection") == 3 or hkbGetVariable("MoveDirection") == 2 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 1 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 0 then act(SetMovementScaleMult, 0.98) end end function MoveNoSync_onActivate() act(SwitchMotion, TRUE) end function MoveNoSync_onUpdate() Move_onUpdate() end function Move_Upper_onActivate() act(Wait) end function Move_Upper_onUpdate() SetEnableMimicry() if MoveCommonFunction(UPPER) == TRUE then SetVariable("ArtsTransition", 0) end end function Guard_Activate() local hand = HAND_LEFT if c_Style == HAND_RIGHT_BOTH then hand = HAND_RIGHT end act(DebugLogOutput, "Guard_Activate ( ) ") SetGuardHand(hand) ActivateRightArmAdd(START_FRAME_NONE) end function Guard_Update() UpdateRightArmAdd() local hand = HAND_LEFT if c_Style == HAND_RIGHT_BOTH then hand = HAND_RIGHT end if env(GetEquipWeaponSpecialCategoryNumber, hand) == 289 then act(AddSpEffect, 19860) end end function GuardDamage_Active() ActivateRightArmAdd(START_FRAME_A02) end function GuardDamage_Update() UpdateRightArmAdd() end function BackStepGuardOn_Upper_Active() ActivateRightArmAdd(START_FRAME_A02) end function BackStepGuardOn_Upper_Update() UpdateRightArmAdd() end function BackStepGuardEnd_Upper_Active() ActivateRightArmAdd(START_FRAME_A02) end function BackStepGuardEnd_Upper_Update() UpdateRightArmAdd() end function GuardStart_Upper_onActivate() act(Wait) end function GuardStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) act(DisallowAdditiveTurning, TRUE) else act(DisallowAdditiveTurning, FALSE) end if GuardCommonFunction(FALSE, blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventHalfBlend(Event_GuardOn, blend_type) return end if HalfBlendLowerCommonFunction(Event_GuardStart, lower_state, FALSE) == TRUE then return end end function GuardStart_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardOn_Upper_onActivate() act(Wait) end function GuardOn_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) act(DisallowAdditiveTurning, TRUE) else act(DisallowAdditiveTurning, FALSE) end if GuardCommonFunction(FALSE, blend_type, FALSE) == TRUE then return end if HalfBlendLowerCommonFunction(Event_GuardOn, lower_state, FALSE) == TRUE then return end end function GuardOn_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardEnd_Upper_onActivate() act(Wait) end function GuardEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) act(DisallowAdditiveTurning, TRUE) else act(DisallowAdditiveTurning, FALSE) end if GuardCommonFunction(TRUE, blend_type, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and (env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE) then ExecEventHalfBlendNoReset(Event_MoveQuick, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_GuardEnd, lower_state, FALSE) == TRUE then return end end function JustGuardStartCommonFunction(event) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) act(DisallowAdditiveTurning, TRUE) else act(DisallowAdditiveTurning, FALSE) end if GuardCommonFunction(FALSE, blend_type, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventHalfBlend(Event_GuardOn, blend_type) return end if HalfBlendLowerCommonFunction(event, lower_state, FALSE) == TRUE then return end end function GuardStart_JustGuard_Upper_onActivate() act(Wait) JUSTGUARD_IS_FIRSTFRAME = TRUE end function GuardStart_JustGuard_Upper_onUpdate() JustGuardStartCommonFunction(Event_GuardStart_JustGuard) end function GuardStart_JustGuard_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardStart_JustGuard_SelfTrans_Upper_onActivate() act(Wait) JUSTGUARD_IS_FIRSTFRAME = TRUE end function GuardStart_JustGuard_SelfTrans_Upper_onUpdate() JustGuardStartCommonFunction(Event_GuardStart_JustGuard) end function GuardStart_JustGuard_SelfTrans_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardStart_JustGuard2_Upper_onActivate() act(Wait) JUSTGUARD_IS_FIRSTFRAME = TRUE end function GuardStart_JustGuard2_Upper_onUpdate() JustGuardStartCommonFunction(Event_GuardStart_JustGuard2) end function GuardStart_JustGuard2_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardStart_JustGuard3_Upper_onActivate() act(Wait) JUSTGUARD_IS_FIRSTFRAME = TRUE end function GuardStart_JustGuard3_Upper_onUpdate() JustGuardStartCommonFunction(Event_GuardStart_JustGuard3) end function GuardStart_JustGuard3_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardStart_JustGuard4_Upper_onActivate() act(Wait) JUSTGUARD_IS_FIRSTFRAME = TRUE end function GuardStart_JustGuard4_Upper_onUpdate() JustGuardStartCommonFunction(Event_GuardStart_JustGuard4) end function GuardStart_JustGuard4_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function GuardStart_JustGuard4_SelfTrans_Upper_onActivate() act(Wait) JUSTGUARD_IS_FIRSTFRAME = TRUE end function GuardStart_JustGuard4_SelfTrans_Upper_onUpdate() JustGuardStartCommonFunction(Event_GuardStart_JustGuard4_SelfTrans) end function GuardStart_JustGuard4_SelfTrans_Upper_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function FallStart_onUpdate() if FallCommonFunction(TRUE, FALSE, FALL_DEFAULT) == TRUE then return end end function FallJumpStart_onUpdate() if FallCommonFunction(TRUE, TRUE, FALL_DEFAULT) == TRUE then return end end function FallLoop_onUpdate() if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE then ExecEvent("W_FallDeath") return end elseif env(IsHamariFallDeath, 12) == TRUE then ExecEvent("W_FallDeath") return end if FallCommonFunction(TRUE, FALSE, FALL_DEFAULT) == TRUE then return end end function Land_onUpdate() if LandCommonFunction() == TRUE then return end end function LandLow_onActivate() act(Wait) end function LandLow_onUpdate() if IdleCommonFunction() == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end end function FallStartFaceUp_onUpdate() if FallCommonFunction(TRUE, FALSE, FALL_FACEUP) == TRUE then return end end function FallStartFaceDown_onUpdate() if FallCommonFunction(TRUE, FALSE, FALL_FACEDOWN) == TRUE then return end end function FallLoopFaceUp_onUpdate() if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE then ExecEvent("W_FallDeathFaceUp") return end elseif env(IsHamariFallDeath, 12) == TRUE then ExecEvent("W_FallDeathFaceUp") return end if FallCommonFunction(TRUE, FALSE, FALL_FACEUP) == TRUE then return end end function FallLoopFaceDown_onUpdate() if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE then ExecEvent("W_FallDeathFaceDown") return end elseif env(IsHamariFallDeath, 12) == TRUE then ExecEvent("W_FallDeathFaceDown") return end if FallCommonFunction(TRUE, FALSE, FALL_FACEDOWN) == TRUE then return end end function LandFaceUp_onUpdate() if LandCommonFunction() == TRUE then return end end function LandFaceDown_onUpdate() if LandCommonFunction() == TRUE then return end end function Damage_Activate() ActivateRightArmAdd(START_FRAME_NONE) end function Damage_Update() UpdateRightArmAdd() end function Damage_NoThrowDef_Update() if env(GetSpEffectID, 30) == FALSE and env(GetSpEffectID, 19970) == FALSE and env(GetSpEffectID, 19865) == FALSE then SetThrowDefInvalid() end end function DamageSABreak_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageSleepResist_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageMad_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageBind_onActivate() ResetRequest() end function DamageBind_onUpdate() act(SetIsMagicInUse, 0) act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end if env(GetSpEffectType, 32) == FALSE then ExecEventAllBody("W_Idle") end end function DamageLv1_Small_onUpdate() act(SetMovementScaleMult, 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageLv2_Middle_onUpdate() act(SetMovementScaleMult, 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageLv3_Large_onUpdate() act(SetMovementScaleMult, 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageLarge2_onUpdate() act(SetMovementScaleMult, 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageWeak_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageLv8_Minimum_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageLv6_Fling_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_FACEDOWN_LOOP) == TRUE then return end end function DamageLv4_ExLarge_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_FORCE_LOOP) == TRUE then return end end function DamageLv5_Push_onUpdate() act(SetMovementScaleMult, 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end end function DamageLv7_SmallBlow_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_FORCE_LOOP) == TRUE then return end end function DamageLv9_Upper_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_FACEDOWN_LOOP) == TRUE then return end end function DamageLV10_ExBlast_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_FORCE_LOOP) == TRUE then return end end function DamageLv11_Breath_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_FORCE_LOOP) == TRUE then return end end function DamageParry_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardDamageSmall_onActivate() JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE end function GuardDamageSmall_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end if DeflectActive() == TRUE then SetJustGuardReinputState() end end function GuardDamageMiddle_onActivate() JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE end function GuardDamageMiddle_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end if DeflectActive() == TRUE then SetJustGuardReinputState() end end function GuardDamageLarge_onActivate() JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE end function GuardDamageLarge_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end if DeflectActive() == TRUE then SetJustGuardReinputState() end end function SetJustGuardSucceedEffect(level) act(AddSpEffect, 102019) if env(GetSpEffectID, 102000) == FALSE then return end if env(GetSpEffectID, 102010) == TRUE or env(GetSpEffectID, 102009) == TRUE then act(AddSpEffect, 102010) elseif env(GetSpEffectID, 102008) == TRUE then if level > 1 then act(AddSpEffect, 102010) else act(AddSpEffect, 102009) end elseif env(GetSpEffectID, 102007) == TRUE then if level > 2 then act(AddSpEffect, 102010) elseif level == 2 then act(AddSpEffect, 102009) else act(AddSpEffect, 102008) end elseif level > 3 then act(AddSpEffect, 102010) elseif level == 3 then act(AddSpEffect, 102009) elseif level == 2 then act(AddSpEffect, 102008) else act(AddSpEffect, 102007) end end function SetJustGuardReinputState() if env(ActionDuration, ACTION_ARM_L1) > 0 then if JUSTGUARD_RELEASE_GUARD_BUTTON == TRUE then if env(GetSpEffectID, 102018) == TRUE or env(GetSpEffectID, 102017) == TRUE or env(GetSpEffectID, 102016) == TRUE or env(GetSpEffectID, 102015) == TRUE then act(AddSpEffect, 102017) elseif env(GetSpEffectID, 102014) == TRUE or env(GetSpEffectID, 102013) == TRUE then act(AddSpEffect, 102015) elseif env(GetSpEffectID, 102012) == TRUE or env(GetSpEffectID, 102011) == TRUE then act(AddSpEffect, 102013) else act(AddSpEffect, 102011) end end JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE else JUSTGUARD_RELEASE_GUARD_BUTTON = TRUE end end function GuardDamageSmall_JustGuard_onActivate() JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE end function GuardDamageSmall_JustGuard_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end SetJustGuardReinputState() end function GuardDamageMiddle_JustGuard_onActivate() JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE end function GuardDamageMiddle_JustGuard_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end SetJustGuardReinputState() end function GuardDamageLarge_JustGuard_onActivate() JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE end function GuardDamageLarge_JustGuard_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end SetJustGuardReinputState() end function GuardBreak_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardBreakRight_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function Repelled_Wall_onUpdate() act(FallPreventionAssist) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function Repelled_Small_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function Repelled_Large_onUpdate() if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardDamageExLarge_onUpdate() if DamageCommonFunction(FALSE, ESTEP_DOWN, FALL_TYPE_DEFAULT) == TRUE then return end end function DeathIdle_onActivate() BlightpoleOffHandler() act(SetDeathStay, TRUE) end function DeathIdle_onDeactivate() act(SetDeathStay, FALSE) end function QuickTurnLeft180_Upper_onUpdate() if QuickTurnCommonFunction() == TRUE then return end if GetVariable("IsLockon") == false then ExecEventNoReset("W_Idle") return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_Idle") return end end function QuickTurnRight180_Upper_onUpdate() if QuickTurnCommonFunction() == TRUE then return end if GetVariable("IsLockon") == false then ExecEventNoReset("W_Idle") return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_Idle") return end end function AttackRight_Activate() SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_RIGHT) ActivateRightArmAdd(START_FRAME_NONE) end function AttackRight_Update() UpdateRightArmAdd() end function AttackRightWhileGuard_Activate() SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_LEFT) end function AttackRightLight1_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end local r1 = "W_AttackRightLight2" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1SubStart", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightLight2_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(2, HAND_RIGHT) == TRUE then local r1 = "W_AttackRightLight3" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight3", "W_AttackBothHeavy1Start", FALSE, TRUE, 2) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLight3_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(3, HAND_RIGHT) == TRUE then local r1 = "W_AttackRightLight4" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1SubStart", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight4", "W_AttackBothHeavy1Start", FALSE, TRUE, 3) == TRUE then return end end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLight4_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(4, HAND_RIGHT) == TRUE then local r1 = "W_AttackRightLight5" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 4) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLight5_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(5, HAND_RIGHT) == TRUE then local r1 = "W_AttackRightLight6" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1SubStart", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight6", "W_AttackBothHeavy1Start", FALSE, TRUE, 5) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLight6_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLightStep_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightLightStealth_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightLightFastStep_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLightDash_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightHeavyDash_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightWhileGuard_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", TO_GUARDON, TRUE, 0) == TRUE then return end end function AttackRightHeavy1SubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackRightHeavy1Start") return end end function AttackRightLightSubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackRightLight2") return end end function AttackRightHeavy1Start_onUpdate() act(SetSpecialInterpolation, 0, FALSE) if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_R2) and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_R2) and 0 -- Conv Smithscript Rosary < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackRightHeavy1End") return end end function AttackRightHeavy1End_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightHeavy2Start_onUpdate() if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_R2) > 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100290) == TRUE then if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 953 then ExecEventAllBody("W_AttackRightSpecial1") else ExecEventAllBody("W_AttackRightSpecial2") end return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_R2) > 0 --- Conv Smithscript Rosary and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100295) == TRUE then if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 953 then ExecEventAllBody("W_AttackRightSpecial2") else ExecEventAllBody("W_AttackRightSpecial1") end return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackRightHeavy2End") return end end function AttackRightHeavy2End_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightHeavySpecial1SubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackRightHeavySpecial1Start") return end end function AttackRightHeavySpecial1Start_onUpdate() act(SetSpecialInterpolation, 0, FALSE) if env(IsAnimEnd, 0) == TRUE then SetRightSpecialHeavyAttackGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end local gen_trans = FALSE if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 852 or env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 667 then gen_trans = TRUE end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0, gen_trans) == TRUE then return end if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackRightHeavySpecial1End") return end end function AttackRightHeavySpecial1End_onUpdate() if env(IsAnimEnd, 0) == TRUE then SetRightSpecialHeavyAttackGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end local gen_trans = FALSE if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 852 or env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 667 then gen_trans = TRUE end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0, gen_trans) == TRUE then return end end function AttackRightHeavySpecial2Start_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackRightHeavySpecial2End") return end end function AttackRightHeavySpecial2End_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightSpecial1_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightSpecial2_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightBackstep_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackLeft_Activate() SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) ActivateRightArmAdd(START_FRAME_A02) end function AttackLeft_Update() SetVariable("IndexDamageParryHand", 1) UpdateRightArmAdd() end function AttackLeft_Deactivate() SetVariable("IndexDamageParryHand", 0) end function AttackLeftLight1_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy1_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy2", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy2_onUpdate() if IsEnableNextAttack(2, HAND_LEFT) == TRUE then if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy3", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy3_onUpdate() if IsEnableNextAttack(3, HAND_LEFT) == TRUE then if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy4", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 3) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy4_onUpdate() if IsEnableNextAttack(4, HAND_LEFT) == TRUE then if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy5", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy5_onUpdate() if env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) == 988 and TRUE == IsEnableGuard() and TRUE == IsGuard() then -- smithscript rosary left hand guard spear l1 = "W_AttackLeftHeavy5" end if IsEnableNextAttack(5, HAND_LEFT) == TRUE then if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy6", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy6_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackDual_Activate() SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_LEFT) act(SetThrowPossibilityState_Defender, 400000) end function AttackDualLight1_onUpdate() local l1 = "W_AttackLeftLight2" if g_ComboReset == TRUE or GetDualAttackMaxNumber(HAND_RIGHT) <= 1 then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualLight2_onUpdate() local l1 = "W_AttackLeftLight3" if g_ComboReset == TRUE or GetDualAttackMaxNumber(HAND_RIGHT) <= 2 then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualLight3_onUpdate() local l1 = "W_AttackLeftLight4" if g_ComboReset == TRUE or GetDualAttackMaxNumber(HAND_RIGHT) <= 3 then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualLight4_onUpdate() local l1 = "W_AttackLeftLight5" if g_ComboReset == TRUE or GetDualAttackMaxNumber(HAND_RIGHT) <= 4 then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualLight5_onUpdate() local l1 = "W_AttackLeftLight6" if g_ComboReset == TRUE or GetDualAttackMaxNumber(HAND_RIGHT) <= 5 then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualLight6_onUpdate() local l1 = "W_AttackLeftLight1" if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualDash_onUpdate() local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualRolling_onUpdate() local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualStealth_onUpdate() local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualBackStep_onUpdate() local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then l1 = "W_AttackLeftLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackDualLightSubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackDualLight2") return end end function AttackBoth_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end function AttackBothLight1_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end local b1 = "W_AttackBothLight2" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1SubStart", FALSE, TRUE, 1) == TRUE then return end end function AttackBothLight2_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(2, HAND_RIGHT) == TRUE then local b1 = "W_AttackBothLight3" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight3", "W_AttackRightHeavy1Start", "W_AttackBothLeft3", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 2) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLight3_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(3, HAND_RIGHT) == TRUE then local b1 = "W_AttackBothLight4" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight4", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1SubStart", FALSE, TRUE, 3) == TRUE then return end end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLight4_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(4, HAND_RIGHT) == TRUE then local b1 = "W_AttackBothLight5" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight5", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1SubStart", FALSE, TRUE, 4) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLight5_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if IsEnableNextAttack(5, HAND_RIGHT) == TRUE then local b1 = "W_AttackBothLight6" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight6", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1SubStart", FALSE, TRUE, 5) == TRUE then return end elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLight6_onUpdate() -- Conv Smithscript Rosary if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1SubStart", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeft1_onUpdate() if AttackCommonFunction("W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothLeft2_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft3", "W_AttackLeftHeavy1", "W_AttackBothLight3", "W_AttackBothHeavy1Start", FALSE, TRUE, 2) == TRUE then return end end function AttackBothLeft3_onUpdate() if AttackCommonFunction("W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, TRUE, 3) == TRUE then return end end function AttackBothLeftDash_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeftStep_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeftSpecial1_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeftSpecial2", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeftSpecial2_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeftSpecial3", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeftSpecial3_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeftSpecial4", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeftSpecial4_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeftSpecial5", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLeftSpecial5_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLightSubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackBothLight2") return end end function AttackBothHeavy1SubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackBothHeavy1Start") return end end function AttackBothHeavy1Start_onUpdate() act(SetSpecialInterpolation, 0, FALSE) if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_R2) and 0 --- Conv Smithscript Rosary < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100295) == TRUE then ExecEventAllBody("W_AttackBothSpecial2") return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_R2) and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackBothSpecial1") return end local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackBothHeavy1End") return end end function AttackBothHeavy1End_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothHeavy2Start_onUpdate() if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_R2) > 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100290) == TRUE then local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end if env(GetEquipWeaponSpecialCategoryNumber, hand) == 953 then ExecEventAllBody("W_AttackBothSpecial1") else ExecEventAllBody("W_AttackBothSpecial2") end return end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_R2) > 0 --- Conv Smithscript Rosary and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100295) == TRUE then local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end if env(GetEquipWeaponSpecialCategoryNumber, hand) == 953 then ExecEventAllBody("W_AttackBothSpecial2") else ExecEventAllBody("W_AttackBothSpecial1") end return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackBothHeavy2End") return end end function AttackBothHeavy2End_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothHeavySpecial1SubStart_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_AttackBothHeavySpecial1Start") return end end function AttackBothHeavySpecial1Start_onUpdate() act(SetSpecialInterpolation, 0, FALSE) if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackBothHeavySpecial1End") return end end function AttackBothHeavySpecial1End_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothHeavySpecial2Start_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackBothHeavySpecial2End") return end end function AttackBothHeavySpecial2End_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothSpecial1_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothBackstep", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothSpecial2_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothBackstep", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothDash_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothHeavyDash_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothLightStep_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothLightStealth_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothBackstep_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothLightGuard_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", TO_GUARDON, TRUE, 0) == TRUE then return end end function AttackRightLightCounter_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightHeavyCounter_onUpdate() local r1 = "W_AttackRightLightSubStart" local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" b1 = "W_AttackBothLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothLightCounter_onUpdate() local r1 = "W_AttackRightLightSubStart" local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" b1 = "W_AttackBothLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightSubStart", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothHeavyCounter_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackArrowRight_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end function AttackArrowLeft_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end function AttackArrowRightStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if ArrowLowerCommonFunction(Event_AttackArrowRightStart, lower_state, FALSE) == TRUE then return end end function AttackArrowRightStartContinue_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if ArrowLowerCommonFunction(Event_AttackArrowRightStartContinue, lower_state, FALSE) == TRUE then return end end function AttackArrowRightLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end if ArrowLowerCommonFunction(Event_AttackArrowRightLoop, lower_state, FALSE) == TRUE then return end end function AttackArrowRightFire_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetStamina) > 0 then local request = GetAttackRequest(FALSE) if request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then if env(GetEquipWeaponCategory, HAND_RIGHT) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else SetVariable("NoAmmo", 0) ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end end end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function AttackArrowRightFireMove_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetStamina) > 0 then local request = GetAttackRequest(FALSE) if request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then if env(GetEquipWeaponCategory, HAND_RIGHT) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else SetVariable("NoAmmo", 0) act(DebugLogOutput, "AttackArrowRightStartContinue 0") ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, blend_type) act(DebugLogOutput, "AttackArrowRightStartContinue") return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, blend_type) return end end end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_AttackArrowRightFireMove, lower_state, FALSE) == TRUE then return end end function AttackArrowRightFireDash_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetStamina) > 0 then local request = GetAttackRequest(FALSE) if request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then if env(GetEquipWeaponCategory, HAND_RIGHT) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else SetVariable("NoAmmo", 0) ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end end end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function AttackArrowRightFireStep_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetStamina) > 0 then local request = GetAttackRequest(FALSE) if request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then if env(GetEquipWeaponCategory, HAND_RIGHT) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else SetVariable("NoAmmo", 0) ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end end end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function AttackArrowLeftStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackArrowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackArrowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end end if ArrowLowerCommonFunction(Event_AttackArrowLeftStart, lower_state, FALSE) == TRUE then return end end function AttackArrowLeftStartContinue_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackArrowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackArrowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end end if ArrowLowerCommonFunction(Event_AttackArrowLeftStartContinue, lower_state, FALSE) == TRUE then return end end function AttackArrowLeftLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end if ArrowLowerCommonFunction(Event_AttackArrowLeftLoop, lower_state, FALSE) == TRUE then return end end function AttackArrowLeftFire_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetStamina) <= 0 then return end local request = GetAttackRequest(FALSE) if request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 then if env(GetEquipWeaponCategory, HAND_LEFT) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_ARROW then ExecEventHalfBlend(Event_AttackArrowLeftStartContinue, ALLBODY) else ExecEventHalfBlend(Event_AttackArrowLeftStart, ALLBODY) end return end elseif env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftStart, ALLBODY) return end end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function AttackArrowLeftFireMove_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetStamina) > 0 then local request = GetAttackRequest(FALSE) if request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 then if env(GetEquipWeaponCategory, HAND_LEFT) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") return else SetVariable("NoAmmo", 0) ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftStartContinue, blend_type) return end elseif env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_AttackArrowLeftStartContinue, blend_type) return end end end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_AttackArrowLeftFireMove, lower_state, FALSE) == TRUE then return end end function AttackArrowLeftFireDash_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function AttackArrowLeftFireStep_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function NoArrow_onUpdate() if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end end function AttackCrossbowRight_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end function AttackCrossbowLeft_Activate() SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) ActivateRightArmAdd(START_FRAME_A02) end function AttackCrossbowLeft_Update() UpdateRightArmAdd() end function AttackCrossbowRightStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackCrossbowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackCrossbowRightFire, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackCrossbowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackCrossbowRightFire, blend_type) return end end if HalfBlendLowerCommonFunction(Event_AttackCrossbowRightLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowRightLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowRightFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowRightFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowRightLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowRightFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowRightFire, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowRightReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 80, 60, 60) local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowBothRightReload, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowRightReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowRightEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowBothRightEmpty, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowRightEmpty, lower_state, FALSE) == TRUE then return end end function AttackCrossbowLeftStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_AttackCrossbowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackCrossbowLeftFire, blend_type) return end elseif env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventHalfBlend(Event_AttackCrossbowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackCrossbowLeftFire, blend_type) return end end if HalfBlendLowerCommonFunction(Event_AttackCrossbowLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowLeftLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_L1) then ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowLeftFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowLeftFire, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowLeftReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 45, 60, 60) local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowBothLeftReload, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowLeftReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowLeftEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowBothLeftEmpty, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowLeftEmpty, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothLeftStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end elseif env(ActionDuration, ACTION_ARM_l2) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothLeftLoop, blend_type) return else ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowBothLeftLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_L1) then ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ShotArrow() ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowBothLeftFire_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftFire, lower_state, FALSE) == TRUE then ShotArrow() return end end function AttackCrossbowBothLeftReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 80, 60, 60) local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if GetVariable("MoveSpeedLevel") == 0 then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowLeftReload, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothLeftEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if GetVariable("MoveSpeedLevel") == 0 then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowLeftEmpty, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftEmpty, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothRightStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end local fireEvent = Event_AttackCrossbowBothRightFire if c_Style == HAND_LEFT_BOTH then fireEvent = Event_AttackCrossbowBothLeftFire end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end end fireEvent = HalfBlendLowerCommonFunction fireEvent = fireEvent(Event_AttackCrossbowBothRightLoop, lower_state, FALSE) if fireEvent == TRUE then ShotArrow() return end end function AttackCrossbowBothRightStartContinue_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end local fireEvent = Event_AttackCrossbowBothRightFire if c_Style == HAND_LEFT_BOTH then fireEvent = Event_AttackCrossbowBothLeftFire end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end end fireEvent = HalfBlendLowerCommonFunction fireEvent = fireEvent(Event_AttackCrossbowBothRightLoop, lower_state, FALSE) if fireEvent == TRUE then ShotArrow() return end end function AttackCrossbowBothRightLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end local fireEvent = Event_AttackCrossbowBothRightFire if c_Style == HAND_LEFT_BOTH then fireEvent = Event_AttackCrossbowBothLeftFire end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventHalfBlend(fireEvent, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventHalfBlend(fireEvent, blend_type) return end fireEvent = HalfBlendLowerCommonFunction fireEvent = fireEvent(Event_AttackCrossbowBothRightLoop, lower_state, FALSE) if fireEvent == TRUE then ShotArrow() return end end function AttackCrossbowBothRightFire_Upper_onUpdate() act(SetIsPreciseShootingPossible) local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothRightFire, lower_state, FALSE) == TRUE then ShotArrow() return end end -- Convergence Unique function AttackCrossbowBothRightFire_Upper_onDeactivate() AnimSpeedupLib() end -- Convergence Unique function AttackCrossbowBothLeftFire_Upper_onDeactivate() AnimSpeedupLib() end function AttackCrossbowBothRightReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 80, 60, 60) local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if GetVariable("MoveSpeedLevel") == 0 then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowRightReload, blend_type) return end else act(SetIsPreciseShootingPossible) end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothRightReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothRightEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if IsSemiTrickWeapon(HAND_RIGHT) == TRUE or IsSemiTrickWeapon(HAND_LEFT) == TRUE then if GetVariable("MoveSpeedLevel") == 0 then -- New trick weapon ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) return end end if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothRightEmpty, lower_state, FALSE) == TRUE then return end end function StealthAttackCrossbowRightStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowRightLoop, blend_type) return else ExecEventHalfBlend(Event_StealthAttackCrossbowRightFire, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowRightLoop, blend_type) return else ExecEventHalfBlend(Event_StealthAttackCrossbowRightFire, blend_type) return end end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowRightLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function StealthAttackCrossbowRightLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowRightFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowRightFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowRightLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function StealthAttackCrossbowRightFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowRightFire, lower_state, FALSE) == TRUE then ShotArrow() return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowRightEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowRightEmpty, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowRightReload_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowRightReload, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowLeftStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_StealthAttackCrossbowLeftFire, blend_type) return end elseif env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftLoop, blend_type) return else ExecEventHalfBlend(Event_StealthAttackCrossbowLeftFire, blend_type) return end end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end if env(IsMoveCancelPossible) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowLeftLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_L1) then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function StealthAttackCrossbowLeftFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowLeftFire, lower_state, FALSE) == TRUE then ShotArrow() return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowLeftEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowLeftEmpty, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowLeftReload_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowLeftReload, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowBothLeftStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftLoop, blend_type) return else ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftFire, blend_type) return end elseif env(ActionDuration, ACTION_ARM_l2) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftLoop, blend_type) return else ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftFire, blend_type) return end end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function StealthAttackCrossbowBothLeftLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_L1) then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ShotArrow() ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function StealthAttackCrossbowBothLeftFire_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothLeftFire, lower_state, FALSE) == TRUE then ShotArrow() return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowBothLeftEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothLeftEmpty, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowBothLeftReload_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothLeftReload, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowBothRightStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end local fireEvent = Event_StealthAttackCrossbowBothRightFire if c_Style == HAND_LEFT_BOTH then fireEvent = Event_StealthAttackCrossbowBothLeftFire end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end end fireEvent = HalfBlendLowerCommonFunction fireEvent = fireEvent(Event_StealthAttackCrossbowBothRightLoop, lower_state, FALSE) if fireEvent == TRUE then ShotArrow() return end end function StealthAttackCrossbowBothRightLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if CrossbowCommonFunction(blend_type, FALSE) == TRUE then return end local fireEvent = Event_StealthAttackCrossbowBothRightFire if c_Style == HAND_LEFT_BOTH then fireEvent = Event_StealthAttackCrossbowBothLeftFire end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ExecEventHalfBlend(fireEvent, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ExecEventHalfBlend(fireEvent, blend_type) return end fireEvent = HalfBlendLowerCommonFunction fireEvent = fireEvent(Event_StealthAttackCrossbowBothRightLoop, lower_state, FALSE) if fireEvent == TRUE then ShotArrow() return end end function StealthAttackCrossbowBothRightFire_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothRightFire, lower_state, FALSE) == TRUE then ShotArrow() return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowBothRightReload_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothRightReload, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthAttackCrossbowBothRightEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothRightEmpty, lower_state, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then if GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function SwordArts_Activate() local hand = c_SwordArtsHand SetAttackHand(hand) SetGuardHand(hand) ActivateRightArmAdd(START_FRAME_NONE) end function SwordArts_Update() UpdateRightArmAdd() end function DrawStanceRightStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then act(SetIsPreciseShootingPossible) if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowStanceCommonFunction(blend_type, FALSE) == TRUE then return end end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_CROSSBOW) == TRUE then act(SetIsPreciseShootingPossible) if CrossbowStanceCommonFunction(blend_type, FALSE) == TRUE then return end end local r1 = "W_DrawStanceRightAttackLight" local r2 = "W_DrawStanceRightAttackHeavy" local b1 = "W_DrawStanceRightAttackLight" local b2 = "W_DrawStanceRightAttackHeavy" if c_SwordArtsID == 239 or c_SwordArtsID == 309 then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy1Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy1Start" end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfChargeCancelEarly, blend_type) else ExecEventAllBody("W_SwordArtsChargeCancelEarly") end return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelLate") return end end if env(GetSpEffectID, 100530) == TRUE then r1 = "W_SwordArtsStanceAttackLightStart" r2 = "W_SwordArtsStanceAttackHeavyStart" b1 = "W_SwordArtsStanceAttackLightStart" b2 = "W_SwordArtsStanceAttackHeavyStart" elseif env(GetSpEffectID, 100540) == TRUE then r1 = "W_SwordArtsStanceAttackLight180" r2 = "W_SwordArtsStanceAttackHeavy180" b1 = "W_SwordArtsStanceAttackLight180" b2 = "W_SwordArtsStanceAttackHeavy180" end local enable_turn = TRUE if c_SwordArtsID == 309 then enable_turn = FALSE end if ArtsStanceCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, enable_turn) == TRUE then return end if env(GetSpEffectID, 19945) == TRUE then SetVariable("DrawStanceRightEndType", 1) else SetVariable("DrawStanceRightEndType", 0) end if env(GetGeneralTAEFlag, 10) == TRUE and (env(ActionDuration, ACTION_ARM_L2) < 200 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE) then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then local index = c_SwordArtsID if index == 10 or index == 11 or index == 340 or index == 341 or index == 309 or index == 121 then drawStanceNoSyncLoop_NoMP = GetVariable("IsEnoughArtPointsL2") ExecEventHalfBlendNoReset(Event_DrawStanceNoSyncLoop, blend_type) else ExecEventHalfBlendNoReset(Event_DrawStanceRightLoop, blend_type) end return end if HalfBlendLowerCommonFunction(Event_DrawStanceRightStart, lower_state, FALSE) == TRUE then return end end function DrawStanceRightLoop_Upper_onUpdate() if c_SwordArtsID == 318 or c_SwordArtsID == 287 or c_SwordArtsID == 299 or c_SwordArtsID == 266 or c_SwordArtsID == 340 then -- conv marika hammer SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) else SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) end local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then act(DebugLogOutput, "ArrowStanceRightLoop") act(SetIsPreciseShootingPossible) if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowStanceCommonFunction(blend_type, FALSE) == TRUE then return end end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_CROSSBOW) == TRUE then act(SetIsPreciseShootingPossible) if CrossbowStanceCommonFunction(blend_type, FALSE) == TRUE then return end end local r1 = "W_DrawStanceRightAttackLight" local r2 = "W_DrawStanceRightAttackHeavy" local b1 = "W_DrawStanceRightAttackLight" local b2 = "W_DrawStanceRightAttackHeavy" if c_SwordArtsID == 239 then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy1Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy1Start" end if env(GetSpEffectID, 100530) == TRUE then r1 = "W_SwordArtsStanceAttackLightStart" r2 = "W_SwordArtsStanceAttackHeavyStart" b1 = "W_SwordArtsStanceAttackLightStart" b2 = "W_SwordArtsStanceAttackHeavyStart" elseif env(GetSpEffectID, 100540) == TRUE then r1 = "W_SwordArtsStanceAttackLight180" r2 = "W_SwordArtsStanceAttackHeavy180" b1 = "W_SwordArtsStanceAttackLight180" b2 = "W_SwordArtsStanceAttackHeavy180" end if ArtsStanceCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, TRUE) == TRUE then return end if env(GetSpEffectID, 19945) == TRUE then SetVariable("DrawStanceRightEndType", 1) else SetVariable("DrawStanceRightEndType", 0) end if c_SwordArtsID == 239 then if env(GetStamina) <= 0 then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end if GetVariable("IsEnoughArtPointsL2") == 1 then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end end if (c_SwordArtsID == 25 or c_SwordArtsID == 121) and env(GetStamina) <= 0 then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_LARGE_ARROW) == TRUE and MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_LARGE_ARROW) == FALSE and c_SwordArtsID ~= 105 and c_SwordArtsID ~= 108 and c_SwordArtsID ~= 169 and HalfBlendLowerCommonFunction(Event_DrawStanceRightLoop, lower_state, FALSE) == TRUE then return end end drawStanceNoSyncLoop_NoMP = 0 function DrawStanceNoSyncLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 90, 90) end local r1 = "W_DrawStanceRightAttackLight" local r2 = "W_DrawStanceRightAttackHeavy" local b1 = "W_DrawStanceRightAttackLight" local b2 = "W_DrawStanceRightAttackHeavy" if env(GetSpEffectID, 100530) == TRUE then r1 = "W_SwordArtsStanceAttackLightStart" r2 = "W_SwordArtsStanceAttackHeavyStart" b1 = "W_SwordArtsStanceAttackLightStart" b2 = "W_SwordArtsStanceAttackHeavyStart" elseif env(GetSpEffectID, 100540) == TRUE then r1 = "W_SwordArtsStanceAttackLight180" r2 = "W_SwordArtsStanceAttackHeavy180" b1 = "W_SwordArtsStanceAttackLight180" b2 = "W_SwordArtsStanceAttackHeavy180" end if ArtsStanceCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, FALSE) == TRUE then return end if env(GetSpEffectID, 19945) == TRUE then SetVariable("DrawStanceRightEndType", 1) else SetVariable("DrawStanceRightEndType", 0) end if env(GetEventEzStateFlag, 0) == TRUE and (env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE or env(GetStamina) <= 0 or drawStanceNoSyncLoop_NoMP == FALSE and GetVariable("IsEnoughArtPointsL2") == 1 or drawStanceNoSyncLoop_NoMP == FALSE and GetVariable("IsEnoughArtPointsL2_DrawStanceNoSyncLoop") == 1) then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end if HalfBlendLowerCommonFunctionNoSync(Event_DrawStanceNoSyncLoop, lower_state, FALSE, TRUE) == TRUE then return end end function DrawStanceNoSyncLoopMax_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 90, 90) end local r1 = "W_DrawStanceRightAttackMaxLight" local r2 = "W_DrawStanceRightAttackMaxHeavy" local b1 = "W_DrawStanceRightAttackMaxLight" local b2 = "W_DrawStanceRightAttackMaxHeavy" if env(GetSpEffectID, 100530) == TRUE then r1 = "W_DrawStanceRightAttackMaxLightR90" r2 = "W_DrawStanceRightAttackMaxHeavyR90" b1 = "W_DrawStanceRightAttackMaxLightR90" b2 = "W_DrawStanceRightAttackMaxHeavyR90" elseif env(GetSpEffectID, 100540) == TRUE then r1 = "W_DrawStanceRightAttackMaxLight180" r2 = "W_DrawStanceRightAttackMaxHeavy180" b1 = "W_DrawStanceRightAttackMaxLight180" b2 = "W_DrawStanceRightAttackMaxHeavy180" -- Doesn't exist in Vanilla, used for other things in Convergence -- elseif env(GetSpEffectID, 100550) == TRUE then -- r1 = "W_DrawStanceRightAttackMaxLightL90" -- r2 = "W_DrawStanceRightAttackMaxHeavyL90" -- b1 = "W_DrawStanceRightAttackMaxLightL90" -- b2 = "W_DrawStanceRightAttackMaxHeavyL90" end if ArtsStanceCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, blend_type, TRUE, TRUE, FALSE, FALSE) == TRUE then return end if env(GetSpEffectID, 19945) == TRUE then SetVariable("DrawStanceRightEndType", 1) else SetVariable("DrawStanceRightEndType", 0) end if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, c_SwordArtsHand) if sp_kind == 248 and env(GetStamina) <= 0 then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) return end if HalfBlendLowerCommonFunctionNoSync(Event_DrawStanceRightLoopMaxNoSync, lower_state, FALSE, TRUE) == TRUE then return end end function DrawStanceRightEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then act(SetIsPreciseShootingPossible) if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end end local enable_turn = TRUE if c_SwordArtsID == 309 then enable_turn = FALSE end if ArtsStanceCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", blend_type, TURN_TYPE_DEFAULT, FALSE, FALSE, TRUE, enable_turn) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetArtsGeneratorTransitionIndex() return end if lower_state == LOWER_END_TURN then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_DrawStanceRightEnd, lower_state, FALSE) == TRUE then return end end function DrawStanceRightAttackLight_onUpdate() if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetSpEffectID, 100280) == TRUE and (g_ArrowSlot == 0 and env(ActionDuration, ACTION_ARM_R1) <= 0 or g_ArrowSlot == 1 and env(ActionDuration, ACTION_ARM_R2) <= 0) then ExecEventAllBody("W_DrawStanceRightAttackLightCancel") return end if ArrowStanceCommonFunction(ALLBODY, TRUE) == TRUE then return end end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_STRAIGHT_SWORD then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy2Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy2Start" end local artsr1 = FALSE local artsr2 = FALSE if env(GetSpEffectID, 19921) == TRUE and env(ActionDuration, ACTION_ARM_L2) > 0 then r1 = "W_DrawStanceRightAttackLight" r2 = "W_DrawStanceRightAttackHeavy" b1 = "W_DrawStanceRightAttackLight" b2 = "W_DrawStanceRightAttackHeavy" artsr1 = TRUE artsr2 = TRUE end if c_SwordArtsID == 318 or c_SwordArtsID == 287 or c_SwordArtsID == 266 or c_SwordArtsID == 340 then if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" b1 = "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end end if c_SwordArtsID == 299 then -- Conv Marika Hammer if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" b1 = "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, artsr1, artsr2, TRUE, FALSE, ALLBODY) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then local blend_type = ALLBODY if c_SwordArtsID ~= 105 and c_SwordArtsID ~= 108 and c_SwordArtsID ~= 169 and MoveStart(LOWER, Event_Move, FALSE) == TRUE then blend_type = UPPER end if env(ActionDuration, ACTION_ARM_L2) <= 0 then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) else ExecEventHalfBlend(Event_DrawStanceRightLoop, blend_type) end end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function DrawStanceRightAttackLightCancel_onUpdate() if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if ArrowStanceCommonFunction(ALLBODY, TRUE) == TRUE then return end end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then local blend_type = ALLBODY if MoveStart(LOWER, Event_Move, FALSE) == TRUE then blend_type = UPPER end if env(ActionDuration, ACTION_ARM_L2) <= 0 then ExecEventHalfBlend(Event_DrawStanceRightEnd, blend_type) else ExecEventHalfBlend(Event_DrawStanceRightLoop, blend_type) end end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function DrawStanceHalfRightAttackLight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_CROSSBOW) == TRUE and env(ActionDuration, ACTION_ARM_L2) > 0 then act(SetIsPreciseShootingPossible) if CrossbowStanceCommonFunction(blend_type, TRUE) == TRUE then return end end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_DrawStanceHalfRightAttackLight, lower_state, FALSE) == TRUE then return end end function SwordArtsStanceAttackLightStart_onUpdate() local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_STRAIGHT_SWORD then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy2Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy2Start" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsStanceAttackLight180_onUpdate() local r1 = "W_AttackRightLight1" local r2 = "W_AttackBothRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_STRAIGHT_SWORD then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy2Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy2Start" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function DrawStanceRightAttackHeavy_onUpdate() local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100250) == TRUE then r2 = "W_DrawStanceRightAttackHeavy2" b2 = "W_DrawStanceRightAttackHeavy2" else r2 = "W_AttackRightHeavy1Start" b2 = "W_AttackBothHeavy1Start" end if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_STRAIGHT_SWORD then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy2Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy2Start" end if c_SwordArtsID == 299 then -- Conv Marika Hammer if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_SwordArtsLoopEnd") elseif env(GetSpEffectID, 100670) == TRUE and env(IsTruelyLanding) == TRUE then ExecEventAllBody("W_SwordArtsLoopEnd") end end -- No clue why this is here --load bearing random edit if env(GetSpEffectID, 100101) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly") end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 then -- conv marika hammer if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelLate") return end end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function DrawStanceRightAttackHeavy2_onUpdate() if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end end function SwordArtsStanceAttackHeavyStart_onUpdate() local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_STRAIGHT_SWORD then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy2Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy2Start" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsStanceAttackHeavy180_onUpdate() local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_STRAIGHT_SWORD then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy2Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy2Start" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsOneShot_onUpdate() local canThrow = FALSE local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if c_SwordArtsID == 130 or c_SwordArtsID == 55 or c_SwordArtsID == 323 or c_SwordArtsID == 259 then canThrow = TRUE end if c_WeaponSwordArts == "31350000" and SkardeShieldVisualAshes[c_SwordArtsID] then SkardeShieldHandler(TRUE, TRUE) end if env(GetSpEffectID, 102050) == TRUE then act(LockonFixedAngleCancel) end local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100058) == TRUE then -- Conv Marika Hammer r1 = "W_DrawStanceRightAttackLight" b1 = "W_DrawStanceRightAttackLight" end if env(GetSpEffectID, 100059) == TRUE then -- Conv Marika Hammer r2 = "W_DrawStanceRightAttackHeavy" b2 = "W_DrawStanceRightAttackHeavy" end if c_SwordArtsID == 157 or c_SwordArtsID == 113 then r1 = "W_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if c_SwordArtsID == 1 or c_SwordArtsID == 2 or c_SwordArtsID == 6 or c_SwordArtsID == 7 or c_SwordArtsID == 130 or c_SwordArtsID == 131 or c_SwordArtsID == 170 or c_SwordArtsID == 171 or c_SwordArtsID == 191 or c_SwordArtsID == 198 or c_SwordArtsID == 65 or c_SwordArtsID == 243 or c_SwordArtsID == 283 or c_SwordArtsID == 300 or c_SwordArtsID == 370 then r1 = "W_AttackRightLight2" b1 = "W_AttackBothLight2" end if (c_SwordArtsID == 115 or c_SwordArtsID == 116 or c_SwordArtsID == 193 or (c_SwordArtsID == 342 and c_WeaponSwordArts == "60540000")) and env(GetSpEffectID, 100660) == TRUE then if env(IsTruelyLanding) == TRUE then ExecEventAllBody("W_SwordArtsLoopEnd") else ExecEventAllBody("W_SwordArtsLoopLoop") end end if c_SwordArtsID == 229 or c_SwordArtsID == 323 then if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_SwordArtsLoopEnd") elseif env(GetSpEffectID, 100670) == TRUE and env(IsTruelyLanding) == TRUE then ExecEventAllBody("W_SwordArtsLoopEnd") end end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, canThrow, ALLBODY) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 1 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 3 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 4 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 5 elseif c_SwordArtsID == 343 and (c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH) then -- Conv Fingerslayer Blade arts_idx = 8 elseif c_SwordArtsID == 388 then -- Smithscript Rosary if env(GetSpEffectID, 2425) == TRUE then arts_idx = 4 -- 040201 end end SetVariable("SwordArtsChargeCategory", arts_idx) ExecEventAllBody("W_SwordArtsChargeCancelEarly") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelLate") return end elseif env(GetSpEffectID, 100287) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return end if c_SwordArtsID == 356 then act(ReserveArtsPointsUse, ACTION_ARM_L2, c_SwordArtsHand) if env(HasEnoughArtsPoints, ACTION_ARM_L2, c_SwordArtsHand) == FALSE and env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly") end end if env(IsAnimEnd, 0) == TRUE then local arts_category = c_SwordArtsID + 600 local loop_animID = SWORDARTS_ANIM_ID_RIGHT_LOOP if env(DoesAnimExist, arts_category, loop_animID) == TRUE and (c_SwordArtsID ~= 201 and c_SwordArtsID ~= 202 or GetVariable("IsEnoughArtPointsL2") == FALSE) and not (c_SwordArtsID == 342 and c_WeaponSwordArts == "60530000") then if env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventAllBody("W_SwordArtsLoopLoop") else ExecEventAllBody("W_SwordArtsLoopEnd") end return end SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsOneShot_Sub_onUpdate() local canThrow = FALSE local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, canThrow, ALLBODY) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then if GetVariable("SwordArtsSubCategory") == 0 then SetVariable("SwordArtsSubCategory2", 0) elseif GetVariable("SwordArtsSubCategory") == 1 then SetVariable("SwordArtsSubCategory2", 1) end ExecEventAllBody("W_SwordArtsChargeCancelEarly_Sub") return end elseif env(GetSpEffectID, 100287) == TRUE then if GetVariable("SwordArtsSubCategory") == 0 then SetVariable("SwordArtsSubCategory2", 0) elseif GetVariable("SwordArtsSubCategory") == 1 then SetVariable("SwordArtsSubCategory2", 1) end ExecEventAllBody("W_SwordArtsOneShotComboEnd_2_Sub") return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfOneShot_Upper_onUpdate() local canThrow = FALSE if c_SwordArtsID == 130 or c_SwordArtsID == 55 then canThrow = TRUE end local blend_type, lower_state = GetHalfBlendInfo() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfChargeCancelEarly, blend_type) else ExecEventAllBody("W_SwordArtsChargeCancelEarly") end return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelLate") return elseif env(GetSpEffectID, 100288) == TRUE then -- egg mace conv ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return elseif env(GetSpEffectID, 100289) == TRUE then -- egg mace conv ExecEventAllBody("W_SwordArtsChargeCancelEarly_Sub") return end elseif env(GetSpEffectID, 100287) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return end if c_SwordArtsID == 206 and env(ActionDuration, ACTION_ARM_L2) <= 0 and env(GetSpEffectID, 100700) == FALSE then ExecEventHalfBlend(Event_SwordArtsHalfLoopEnd, blend_type) return end if env(IsAnimEnd, 1) == TRUE then local arts_category = c_SwordArtsID + 600 local loop_animID = SWORDARTS_ANIM_ID_RIGHT_LOOP if env(DoesAnimExist, arts_category, loop_animID) == TRUE and (c_SwordArtsID ~= 201 and c_SwordArtsID ~= 202 or GetVariable("IsEnoughArtPointsL2") == FALSE) then if c_SwordArtsID == 334 then SetVariable("IsMadTorch", 1) else SetVariable("IsMadTorch", 0) end if env(ActionDuration, ACTION_ARM_L2) > 0 then if c_SwordArtsID == 334 and GetVariable("IsEnoughArtPointsL2_MadTorchEnd") == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfLoopEnd, blend_type) else ExecEventHalfBlend(Event_SwordArtsHalfLoopLoop, blend_type) end else ExecEventHalfBlend(Event_SwordArtsHalfLoopEnd, blend_type) end return end SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfOneShot, lower_state, FALSE) == TRUE then return end end function SwordArtsOneShotComboEnd_onUpdate() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if c_SwordArtsID == 113 then r1 = "W_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return elseif env(GetSpEffectID, 100288) == TRUE then -- fingerslayer blade conv ExecEventAllBody("W_SwordArtsChargeCancelLate") return elseif env(GetSpEffectID, 100289) == TRUE then -- fingerslayer blade conv ExecEventAllBody("W_SwordArtsChargeCancelEarly_Sub") return end elseif env(GetSpEffectID, 100287) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsOneShotComboEnd_MesmerSowrdArts_onUpdate() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if c_SwordArtsID == 113 then r1 = "W_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return end elseif env(GetSpEffectID, 100287) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfOneShotComboEnd_Upper_onUpdate() local canThrow = FALSE if c_SwordArtsID == 130 or c_SwordArtsID == 55 then canThrow = TRUE end local blend_type, lower_state = GetHalfBlendInfo() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 then if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelEarly2") return end elseif env(GetSpEffectID, 100287) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfOneShotCombo1, lower_state, FALSE) == TRUE then return end end function SwordArtsOneShotComboEnd_2_onUpdate() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfOneShotComboEnd_2_Upper_onUpdate() local canThrow = FALSE if c_SwordArtsID == 130 or c_SwordArtsID == 55 then canThrow = TRUE end local blend_type, lower_state = GetHalfBlendInfo() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfOneShotCombo2, lower_state, FALSE) == TRUE then return end end function SwordArtsOneShotShieldLeft_onUpdate() local index = SWORDARTS_PARRY + GetVariable("SwordArtsOneShotShieldIndex") local canThrow = FALSE local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if index == SWORDARTS_PARRY or index == SWORDARTS_SPELL_PARRY or index == SWORDARTS_PROJECTILE_PARRY or index == SWORDARTS_BUCKLER_PARRY or index == SWORDARTS_DAGGER_PARRY then canThrow = TRUE end if c_WeaponSwordArts == "31350000" and SkardeShieldVisualAshes[c_SwordArtsID] then SkardeShieldHandler(TRUE, TRUE) end if env(ActionDuration, ACTION_ARM_L2) <= 0 then local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 1 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 2 end SetVariable("SwordArtsOneShotShieldCancelCategory", arts_idx) if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldLeft_Cancel") elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldLeft_Cancel") end end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then local arts_category = c_SwordArtsID + 600 local loop_animID = SWORDARTS_ANIM_ID_RIGHT_LOOP if env(DoesAnimExist, arts_category, loop_animID) == TRUE and (c_SwordArtsID ~= 201 and c_SwordArtsID ~= 202 or GetVariable("IsEnoughArtPointsL2") == FALSE) then if env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventAllBody("W_SwordArtsLeftLoopLoop") else ExecEventAllBody("W_SwordArtsLeftLoopEnd") end return end SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsLeftGuardCounter_onUpdate() local canThrow = FALSE if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsBothGuardCounter_onUpdate() local canThrow = FALSE if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfOneShotShieldLeft_Upper_onUpdate() local index = SWORDARTS_PARRY + GetVariable("SwordArtsOneShotShieldIndex") local canThrow = FALSE if index == SWORDARTS_PARRY or index == SWORDARTS_SPELL_PARRY or index == SWORDARTS_PROJECTILE_PARRY or index == SWORDARTS_BUCKLER_PARRY or index == SWORDARTS_DAGGER_PARRY then canThrow = TRUE end local blend_type, lower_state = GetHalfBlendInfo() local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 1 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 2 end SetVariable("SwordArtsOneShotShieldCancelCategory", arts_idx) if 0 >= env(ActionDuration, ACTION_ARM_L2) then if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldLeft_Cancel") elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldLeft_Cancel") end end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then local arts_category = c_SwordArtsID + 600 local loop_animID = SWORDARTS_ANIM_ID_RIGHT_LOOP if env(DoesAnimExist, arts_category, loop_animID) == TRUE and (c_SwordArtsID ~= 201 and c_SwordArtsID ~= 202 or GetVariable("IsEnoughArtPointsL2") == FALSE) then if 0 < env(ActionDuration, ACTION_ARM_L2) then if c_SwordArtsID == 334 then SetVariable("IsMadTorch", 1) else SetVariable("IsMadTorch", 0) end if c_SwordArtsID == 334 and GetVariable("IsEnoughArtPointsL2") == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfLeftLoopEnd, blend_type) else ExecEventHalfBlend(Event_SwordArtsHalfLeftLoopLoop, blend_type) end else ExecEventHalfBlend(Event_SwordArtsHalfLeftLoopEnd, blend_type) end return end SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfOneShotShieldLeft, lower_state, FALSE) == TRUE then return end end function SwordArtsOneShotShieldLeft_Cancel_onUpdate() local index = SWORDARTS_PARRY + GetVariable("SwordArtsOneShotShieldIndex") local canThrow = FALSE local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if index == SWORDARTS_PARRY or index == SWORDARTS_SPELL_PARRY or index == SWORDARTS_PROJECTILE_PARRY or index == SWORDARTS_BUCKLER_PARRY or index == SWORDARTS_DAGGER_PARRY then canThrow = TRUE end if c_WeaponSwordArts == "31350000" and SkardeShieldVisualAshes[c_SwordArtsID] then SkardeShieldHandler(TRUE, TRUE) end if env(GetSpEffectID, 100058) == TRUE and env(ActionRequest, ACTION_ARM_R1) == TRUE then -- Conv Marika Hammer ExecEventAllBody("W_DrawStanceRightAttackLight") return end if env(GetSpEffectID, 100059) == TRUE and env(ActionRequest, ACTION_ARM_R2) == TRUE then -- Conv Marika Hammer ExecEventAllBody("W_DrawStanceRightAttackHeavy") return end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsOneShotShieldBoth_onUpdate() local index = SWORDARTS_PARRY + GetVariable("SwordArtsOneShotShieldIndex") local canThrow = FALSE local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if index == SWORDARTS_PARRY or index == SWORDARTS_SPELL_PARRY or index == SWORDARTS_PROJECTILE_PARRY or index == SWORDARTS_BUCKLER_PARRY or index == SWORDARTS_DAGGER_PARRY then canThrow = TRUE end if c_WeaponSwordArts == "31350000" and SkardeShieldVisualAshes[c_SwordArtsID] then SkardeShieldHandler(TRUE, TRUE) end if env(ActionDuration, ACTION_ARM_L2) <= 0 then local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == 47 then arts_idx = 1 elseif arts_cat == 48 then arts_idx = 2 elseif arts_cat == 57 then arts_idx = 3 end SetVariable("SwordArtsOneShotShieldCancelCategory", arts_idx) if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldBoth_Cancel") elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldBoth_Cancel") end end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then local arts_category = c_SwordArtsID + 600 local loop_animID = SWORDARTS_ANIM_ID_RIGHT_LOOP if env(DoesAnimExist, arts_category, loop_animID) == TRUE and (c_SwordArtsID ~= 201 and c_SwordArtsID ~= 202 or GetVariable("IsEnoughArtPointsL2") == FALSE) then if env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventAllBody("W_SwordArtsBothLoopLoop") else ExecEventAllBody("W_SwordArtsBothLoopEnd") end return end SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsOneShotShieldBoth_Cancel_onUpdate() local index = SWORDARTS_PARRY + GetVariable("SwordArtsOneShotShieldIndex") local canThrow = FALSE local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if index == SWORDARTS_PARRY or index == SWORDARTS_SPELL_PARRY or index == SWORDARTS_PROJECTILE_PARRY or index == SWORDARTS_BUCKLER_PARRY or index == SWORDARTS_DAGGER_PARRY then canThrow = TRUE end if c_WeaponSwordArts == "31350000" and SkardeShieldVisualAshes[c_SwordArtsID] then SkardeShieldHandler(TRUE, TRUE) end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfOneShotShieldBoth_Upper_onUpdate() local index = SWORDARTS_PARRY + GetVariable("SwordArtsOneShotShieldIndex") local canThrow = FALSE if index == SWORDARTS_PARRY or index == SWORDARTS_SPELL_PARRY or index == SWORDARTS_PROJECTILE_PARRY or index == SWORDARTS_BUCKLER_PARRY or index == SWORDARTS_DAGGER_PARRY then canThrow = TRUE end local blend_type, lower_state = GetHalfBlendInfo() local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == 47 then arts_idx = 1 elseif arts_cat == 48 then arts_idx = 2 end SetVariable("SwordArtsOneShotShieldCancelCategory", arts_idx) if 0 >= env(ActionDuration, ACTION_ARM_L2) then if env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldBoth_Cancel") elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldBoth_Cancel") end end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then local arts_category = c_SwordArtsID + 600 local loop_animID = SWORDARTS_ANIM_ID_RIGHT_LOOP if env(DoesAnimExist, arts_category, loop_animID) == TRUE and (c_SwordArtsID ~= 201 and c_SwordArtsID ~= 202 or GetVariable("IsEnoughArtPointsL2") == FALSE) then if 0 < env(ActionDuration, ACTION_ARM_L2) then if c_SwordArtsID == 334 then SetVariable("IsMadTorch", 1) else SetVariable("IsMadTorch", 0) end if c_SwordArtsID == 334 and GetVariable("IsEnoughArtPointsL2") == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfBothLoopEnd, blend_type) else ExecEventHalfBlend(Event_SwordArtsHalfBothLoopLoop, blend_type) end else ExecEventHalfBlend(Event_SwordArtsHalfBothLoopEnd, blend_type) end return end SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfOneShotShieldBoth, lower_state, FALSE) == TRUE then return end end function SwordArtsRolling_onUpdate() SetEnableAimMode() local r1 = "W_AttackRightLightStep" local b1 = "W_AttackBothLightStep" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if GetVariable("SwordArtsRollingDirection") ~= 0 then r1 = "W_AttackRightBackstep" b1 = "W_AttackBothBackstep" end if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsRolling_SelfTrans_onUpdate() SetEnableAimMode() local r1 = "W_AttackRightLightStep" local b1 = "W_AttackBothLightStep" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if GetVariable("SwordArtsRollingDirection") ~= 0 then r1 = "W_AttackRightBackstep" b1 = "W_AttackBothBackstep" end if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsRolling_SelfTrans2_onUpdate() SetEnableAimMode() local r1 = "W_AttackRightLightStep" local b1 = "W_AttackBothLightStep" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if GetVariable("SwordArtsRollingDirection") ~= 0 then r1 = "W_AttackRightBackstep" b1 = "W_AttackBothBackstep" end if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsRolling_Sub_onUpdate() local rollingAngle = c_ArtsRollingAngle rollingAngle = GetVariable("MoveAngle") local turn_target_angle = 0 local rollingDirection = 0 if c_SwordArtsID == 276 then if rollingAngle <= 0 and rollingAngle >= -180 then rollingDirection = 2 turn_target_angle = rollingAngle + 90 elseif rollingAngle > 0 and rollingAngle < 180 then rollingDirection = 3 turn_target_angle = rollingAngle - 90 else rollingDirection = 2 turn_target_angle = rollingAngle + 90 end end if c_SwordArtsID == 313 then if rollingAngle <= 0 and rollingAngle >= -120 then rollingDirection = 2 turn_target_angle = rollingAngle + 90 elseif rollingAngle > 0 and rollingAngle < 120 then rollingDirection = 3 turn_target_angle = rollingAngle - 90 else rollingDirection = 1 turn_target_angle = rollingAngle - 180 end end SetVariable("SwordArtsRollingDirection", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 0) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 1) == TRUE then act(SetSpecialInterpolation, 0, TRUE) ExecEventAllBody("W_SwordArtsRolling") return end end function SwordArtsLoopLoop_onUpdate() local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if c_SwordArtsID == 115 or c_SwordArtsID == 116 or c_SwordArtsID == 193 or (c_SwordArtsID == 342 and c_WeaponSwordArts == "60540000") then local height = env(GetFallHeight) / 100 local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_FallDeath") return TRUE end if not (height >= 60) or env(GetStateChangeType, 266) == TRUE then else ExecEventAllBody("W_FallDeath") return TRUE end if env(GetSpEffectID, 100670) == TRUE and env(IsTruelyLanding) == TRUE then ExecEventAllBody("W_SwordArtsLoopEnd") end elseif c_SwordArtsID == 13 then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE) if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(GetStamina) <= 0 or env(HasEnoughArtsPoints, ACTION_ARM_R2, c_SwordArtsHand) == FALSE then ExecEventAllBody("W_SwordArtsLoopEnd") return end elseif env(ActionDuration, ACTION_ARM_L2) <= 0 or env(GetStamina) <= 0 or GetVariable("IsEnoughArtPointsL2") == 0 and env(HasEnoughArtsPoints, ACTION_ARM_L2, c_SwordArtsHand) == FALSE then ExecEventAllBody("W_SwordArtsLoopEnd") return end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end end function SwordArtsHalfLoopLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if c_SwordArtsID == 334 then SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if c_SwordArtsID == 334 then SetVariable("IsMadTorch", 1) if env(GetSpEffectID, 100700) == FALSE and (env(ActionDuration, ACTION_ARM_L2) <= 0 or env(GetStamina) <= 0 or GetVariable("IsEnoughArtPointsL2") == 1 and env(HasEnoughArtsPoints, ACTION_ARM_L2, c_SwordArtsHand) == FALSE) then ExecEventHalfBlend(Event_SwordArtsHalfLoopEnd, blend_type) return end else SetVariable("IsMadTorch", 0) if env(GetSpEffectID, 100700) == FALSE and (env(ActionDuration, ACTION_ARM_L2) <= 0 or env(GetStamina) <= 0 or GetVariable("IsEnoughArtPointsL2") == 0 and env(HasEnoughArtsPoints, ACTION_ARM_L2, c_SwordArtsHand) == FALSE) then ExecEventHalfBlend(Event_SwordArtsHalfLoopEnd, blend_type) return end end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfLoopLoop, lower_state, FALSE) == TRUE then return end end function SwordArtsLoopEnd_onUpdate() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfLoopEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfLoopEnd, lower_state, FALSE) == TRUE then return end end function SwordArtsBothLoopLoop_onUpdate() if env(ActionDuration, ACTION_ARM_L2) <= 0 then ExecEventAllBody("W_SwordArtsBothLoopEnd") return end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end end function SwordArtsBothLoopEnd_onUpdate() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfBothLoopLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE or env(GetStamina) <= 0 or GetVariable("IsEnoughArtPointsL2") == 1 then if c_SwordArtsID == 334 then SetVariable("IsMadTorch", 1) else SetVariable("IsMadTorch", 0) end ExecEventHalfBlend(Event_SwordArtsHalfBothLoopEnd, blend_type) return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfBothLoopLoop, lower_state, FALSE) == TRUE then return end end function SwordArtsHalfBothLoopEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfBothLoopEnd, lower_state, FALSE) == TRUE then return end end function SwordArtsHalfLeftLoopLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE or env(GetStamina) <= 0 or GetVariable("IsEnoughArtPointsL2") == 1 then if c_SwordArtsID == 334 then SetVariable("IsMadTorch", 1) else SetVariable("IsMadTorch", 0) end ExecEventHalfBlend(Event_SwordArtsHalfLeftLoopEnd, blend_type) return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfLeftLoopLoop, lower_state, FALSE) == TRUE then return end end function SwordArtsHalfLeftLoopEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfLeftLoopEnd, lower_state, FALSE) == TRUE then return end end function SwordArtsLeftLoopLoop_onUpdate() if env(ActionDuration, ACTION_ARM_L2) <= 0 then ExecEventAllBody("W_SwordArtsLeftLoopEnd") return end if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end end function SwordArtsHalfLeftLoopLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, canThrow, ALLBODY) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE or env(GetStamina) <= 0 or GetVariable("IsEnoughArtPointsL2") == 1 then ExecEventHalfBlend(Event_SwordArtsHalfLeftLoopEnd, blend_type) return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfLeftLoopLoop, lower_state, FALSE) == TRUE then return end end function SwordArtsLeftLoopEnd_onUpdate() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, FALSE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfLeftLoopEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ArtsCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, TRUE, TRUE, canThrow, blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfLeftLoopEnd, lower_state, FALSE) == TRUE then return end end function SwordArtsChargeCancelEarly_onUpdate() local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if env(GetSpEffectID, 102050) == TRUE then act(LockonFixedAngleCancel) end if c_WeaponSwordArts == "31350000" and SkardeShieldVisualAshes[c_SwordArtsID] then SkardeShieldHandler(TRUE, TRUE) end local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if c_SwordArtsID == 198 or c_SwordArtsID == 283 or c_SwordArtsID == 300 or c_SwordArtsID == 370 then r1 = "W_AttackRightLight2" b1 = "W_AttackBothLight2" end if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsChargeCancelLate_onUpdate() if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end end function SwordArtsChargeCancelEarly2_onUpdate() if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end end function SwordArtsChargeCancelEarly_Sub_onUpdate() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsHalfChargeCancelEarly_Upper_onUpdate() local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" local blend_type, lower_state = GetHalfBlendInfo() if env(GetSpEffectID, 100054) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100055) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" end if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r2 = "W_SwordArtsOneShotComboEnd_2" b2 = "W_SwordArtsOneShotComboEnd_2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsHalfChargeCancelEarly, lower_state, FALSE) == TRUE then return end end function SwordArtsStandDodge_onUpdate() if ExecDamage(FALSE, FALSE) == TRUE then return TRUE end if ExecFallAttack() == TRUE then return end if env(IsFalling) == TRUE or env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_FallLoop") return end end function SwordArtsLeft_Activate() SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) end function SwordArtsArrowStanceStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end act(SetIsPreciseShootingPossible) if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowStanceCommonFunction(blend_type, FALSE) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE and (env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE) then ShotArrow() ExecEventHalfBlend(Event_SwordArtsArrowStanceEnd, blend_type) if lower_state == LOWER_MOVE then ExecEventHalfBlendNoReset(Event_Move, LOWER) end return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() ExecEventHalfBlend(Event_SwordArtsArrowStanceLoop, blend_type) return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceStartMirror, lower_state, FALSE) == TRUE then ShotArrow() return end end function SetSwordArtsWepCategory_DrawStanceRightAttackLight() local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == WEAPON_CATEGORY_LARGE_ARROW then arts_idx = 1 end SetVariable("DrawStanceRightAttackLightCategory", arts_idx) end function ArrowStanceCommonFunction(blend_type, checkHold) local request = GetAttackRequest(FALSE) local arrowHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then arrowHand = HAND_LEFT end if (request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT) and (checkHold == FALSE or env(ActionDuration, ACTION_ARM_L2) > 0) then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_NoArrow") return TRUE end if env(GetStamina) > 0 then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) SetSwordArtsWepCategory_DrawStanceRightAttackLight() ShotArrow() ExecEventAllBody("W_DrawStanceRightAttackLight") return TRUE end elseif (request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2) and (checkHold == FALSE or env(ActionDuration, ACTION_ARM_L2) > 0) then act(ResetInputQueue) g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_NoArrow") return TRUE end if env(GetStamina) > 0 then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) SetSwordArtsWepCategory_DrawStanceRightAttackLight() ShotArrow() ExecEventAllBody("W_DrawStanceRightAttackLight") return TRUE end end return FALSE end function CrossbowStanceCommonFunction(blend_type, IsShooting) local request = GetAttackRequest(FALSE) local arrowHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then arrowHand = HAND_LEFT end if IsShooting == TRUE then if env(ActionDuration, ACTION_ARM_L2) > 0 and (request == ATTACK_REQUEST_RIGHT_CROSSBOW or request == ATTACK_REQUEST_LEFT_CROSSBOW or request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW or request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW or request == ATTACK_REQUEST_RIGHT_CROSSBOW2 or request == ATTACK_REQUEST_LEFT_CROSSBOW2 or request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 or request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW2) then ShotArrow() ExecEventHalfBlend(Event_DrawStanceRightStart, blend_type) return TRUE end elseif (request == ATTACK_REQUEST_RIGHT_CROSSBOW or request == ATTACK_REQUEST_LEFT_CROSSBOW or request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW or request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW) and env(ActionDuration, ACTION_ARM_L2) > 0 then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) return TRUE end if env(GetStamina) > 0 then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) SetSwordArtsWepCategory_DrawStanceRightAttackLight() ShotArrow() if IsHalfBlendArts(c_SwordArtsID) == TRUE then local blend_type, lower_state = GetHalfBlendInfo() ExecEventHalfBlend(Event_DrawStanceHalfRightAttackLight, blend_type) else ExecEventAllBody("W_DrawStanceRightAttackLight") end return TRUE end elseif (request == ATTACK_REQUEST_RIGHT_CROSSBOW2 or request == ATTACK_REQUEST_LEFT_CROSSBOW2 or request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 or request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW2) and env(ActionDuration, ACTION_ARM_L2) > 0 then act(ResetInputQueue) g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) return TRUE end if env(GetStamina) > 0 then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) SetSwordArtsWepCategory_DrawStanceRightAttackLight() ShotArrow() if IsHalfBlendArts(c_SwordArtsID) == TRUE then local blend_type, lower_state = GetHalfBlendInfo() ExecEventHalfBlend(Event_DrawStanceHalfRightAttackLight, blend_type) else ExecEventAllBody("W_DrawStanceRightAttackLight") end return TRUE end end return FALSE end function SwordArtsArrowStanceLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowStanceCommonFunction(blend_type, FALSE) == TRUE then return end if env(ActionDuration, ACTION_ARM_L2) <= 0 or env(ActionCancelRequest, ACTION_ARM_L2) == TRUE then ShotArrow() ExecEventHalfBlend(Event_SwordArtsArrowStanceEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function SwordArtsArrowDrawStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() ExecEventHalfBlend(Event_SwordArtsArrowDrawLoop, blend_type) return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceStartMirror, lower_state, FALSE) == TRUE then ShotArrow() return end end function SwordArtsArrowDrawLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if g_ArrowSlot == 0 and 0 >= env(ActionDuration, ACTION_ARM_R1) or g_ArrowSlot == 1 and 0 >= env(ActionDuration, ACTION_ARM_R2) then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) ShotArrow() ExecEventAllBody("W_SwordArtsArrowFire") return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceLoop, lower_state, FALSE) == TRUE then ShotArrow() return end end function SwordArtsArrowFire_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetSpEffectID, 100280) == TRUE and (g_ArrowSlot == 0 and env(ActionDuration, ACTION_ARM_R1) <= 0 or g_ArrowSlot == 1 and env(ActionDuration, ACTION_ARM_R2) <= 0) then ShotArrow() ExecEventAllBody("W_SwordArtsArrowFireEnd") return end if ArrowStanceCommonFunction(ALLBODY, TRUE) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then ShotArrow() if env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventHalfBlendNoReset(Event_SwordArtsArrowStanceLoop, ALLBODY) return else ExecEventHalfBlend(Event_SwordArtsArrowStanceEnd, ALLBODY) return end end end function SwordArtsArrowFireEnd_onUpdate() act(SetIsPreciseShootingPossible) if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if ArrowStanceCommonFunction(ALLBODY, TRUE) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then ShotArrow() if env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventHalfBlendNoReset(Event_SwordArtsArrowStanceLoop, ALLBODY) return else ExecEventHalfBlend(Event_SwordArtsArrowStanceEnd, ALLBODY) return end end end function SwordArtsArrowStanceEnd_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_DEFAULT) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_DEFAULT) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceEnd, lower_state, TRUE) == TRUE then ShotArrow() return end end function WeaponChangeStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if WeaponChangeCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_WeaponChangeEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_WeaponChangeStartMirror, lower_state, FALSE) == TRUE then return end end function StealthWeaponChangeStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if WeaponChangeCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_StealthWeaponChangeEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthWeaponChangeStart, lower_state, FALSE) == TRUE then return end end function WeaponChangeEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if WeaponChangeCommonFunction(blend_type) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_WeaponChangeEndMirror, lower_state, FALSE) == TRUE then return end end function StealthWeaponChangeEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if WeaponChangeCommonFunction(blend_type) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Stealth_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthWeaponChangeEnd, lower_state, FALSE) == TRUE then return end end function HandChangeStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if HandChangeCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_HandChangeEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_HandChangeStartMirror, lower_state, FALSE) == TRUE then return end end function StealthHandChangeStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if HandChangeCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_StealthHandChangeEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthHandChangeStart, lower_state, FALSE) == TRUE then return end end function HandChangeEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if HandChangeCommonFunction(blend_type) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_HandChangeEndMirror, lower_state, FALSE) == TRUE then return end end function HandChangeEnd_Upper_onDeactivate() HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE end function StealthHandChangeEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if HandChangeCommonFunction(blend_type) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Stealth_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthHandChangeEnd, lower_state, FALSE) == TRUE then return end end function StealthHandChangeEnd_Upper_onDeactivate() HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE end function Item_Upper_Activate() ActivateRightArmAdd(START_FRAME_NONE) end function Item_Upper_Update() UpdateRightArmAdd() end function QuickItemEnchantNormal_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, blend_type, QUICKTYPE_NORMAL) == TRUE then return end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if HalfBlendUpperCommonFunction(lower_state) == TRUE then ClearAttackQueue() return end if HalfBlendLowerCommonFunction(Event_QuickItemEnchantNormal, lower_state, FALSE, TRUE) == TRUE then return end end function QuickItemEnchantDash_Upper_onActivate() act(LockonFixedAngleCancel) end function QuickItemEnchantDash_Upper_onUpdate() act(LockonFixedAngleCancel) local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" local b1 = "W_AttackBothLight1" local b2 = "W_AttackBothHeavy1Start" if GetVariable("MoveSpeedIndex") >= 1 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" end local blend_type, lower_state = GetHalfBlendInfo() if QuickItemCommonFunction(r1, r2, g_l1, g_l2, b1, b2, blend_type, QUICKTYPE_NORMAL) == TRUE then return end if env(GetSpEffectID, 100220) == FALSE and HalfBlendLowerCommonFunction(Event_StopHalfBlendDashStop, lower_state, FALSE) == TRUE then SetVariable("MoveSpeedLevelReal", 0) return end if env(IsMoveCancelPossible) == TRUE then ExecEvent("W_Idle") return end end function QuickItemEnchantStep_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, blend_type, QUICKTYPE_NORMAL) == TRUE then return end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if HalfBlendUpperCommonFunction(lower_state) == TRUE then ClearAttackQueue() return end if HalfBlendLowerCommonFunction(Event_QuickItemEnchantStep, lower_state, FALSE, TRUE) == TRUE then return end end function QuickItemEnchantAttackRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, blend_type, QUICKTYPE_NORMAL) == TRUE then return end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if HalfBlendUpperCommonFunction(lower_state) == TRUE then ClearAttackQueue() return end if HalfBlendLowerCommonFunction(Event_QuickItemEnchantAttackRight, lower_state, FALSE, TRUE) == TRUE then return end end function QuickItemEnchantAttackLeft_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, blend_type, QUICKTYPE_NORMAL) == TRUE then return end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if HalfBlendUpperCommonFunction(lower_state) == TRUE then ClearAttackQueue() return end if HalfBlendLowerCommonFunction(Event_QuickItemEnchantAttackLeft, lower_state, FALSE, TRUE) == TRUE then return end end function QuickItemThrowKnifeNormal_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_COMBO) == TRUE then return end end function QuickItemThrowKnifeDash_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_COMBO) == TRUE then return end end function QuickItemThrowKnifeStep_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_COMBO) == TRUE then return end end function QuickItemThrowKnifeAttackRight_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_COMBO) == TRUE then return end end function QuickItemThrowKnifeAttackRight2_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_ATTACK) == TRUE then return end end function QuickItemThrowKnifeAttackLeft_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_COMBO) == TRUE then return end end function QuickItemThrowKnifeAttackLeft2_Upper_onUpdate() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_ATTACK) == TRUE then return end end function ItemRecover_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemRecover, lower_state, FALSE) == TRUE then return end end function ItemEatJerky_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemRecover, lower_state, FALSE) == TRUE then return end end function ItemLanternOn_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemRecover, lower_state, FALSE, TRUE) == TRUE then return end end function ItemLanternOff_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemRecover, lower_state, FALSE, TRUE) == TRUE then return end end function ItemElixir_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemRecover, lower_state, FALSE) == TRUE then return end end function ItemHorn_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemRecover, lower_state, FALSE, TRUE) == TRUE then return end end function ItemWeaponEnchant_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemWeaponEnchant, lower_state, FALSE, TRUE) == TRUE then return end end function ItemThrowKnife_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThrowKnife, lower_state, FALSE, TRUE) == TRUE then return end end function ItemThrowBottle_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThrowBottle, lower_state, FALSE, TRUE) == TRUE then return end end function ItemMeganeStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then act(RemoveBinoculars) return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlend(Event_ItemMeganeLoop, blend_type) return end if HalfBlendLowerCommonFunction(Event_ItemMeganeStart, lower_state, FALSE, TRUE) == TRUE then act(RemoveBinoculars) return end end function ItemMeganeLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then act(RemoveBinoculars) return end if HalfBlendLowerCommonFunction(Event_ItemMeganeLoop, lower_state, FALSE) == TRUE then act(RemoveBinoculars) return end end function ItemMeganeEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemMeganeEnd, lower_state, FALSE) == TRUE then return end end function ItemWeaponRepair_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemWeaponRepair, lower_state, FALSE) == TRUE then return end end function ItemSoul_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemSoul, lower_state, FALSE) == TRUE then return end end function ItemMessage_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemMessage, lower_state, FALSE, TRUE) == TRUE then return end end function ItemPray_Upper_onUpdate() act(SetAllowedThrowDefenseType, 255) local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if GetVariable("RideOnSummonTest") == 1 then if env(IsMovingOnMount) == TRUE then FireRideEvent("W_RideOn", "W_RideOn", FALSE) return TRUE elseif env(IsIdleOnMount) == TRUE then ExecEventAllBody("W_Idle") return TRUE end elseif env(IsSummoningRide) == TRUE then if env(IsNewRidingTest) == TRUE then SetVariable("RideOnSummonTest", 1) FireRideEvent("W_RideOn", "W_RideOn", FALSE) else SetVariable("RideOnSummonTest", 0) ExecEventAllBody("W_RideAdjustFromCalling") end return TRUE elseif env(GetEventEzStateFlag, 0) == TRUE then act(Mounting) return TRUE end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemPray, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTrap_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTrap, lower_state, FALSE, TRUE) == TRUE then return end end function ItemDrinkStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end local isEnd = env(IsAnimEnd, 1) if env(GetEventEzStateFlag, 0) == TRUE or isEnd == TRUE then local item_type = env(GetItemAnimType) if item_type ~= ITEM_NO_DRINK then ExecEventHalfBlendNoReset(Event_ItemDrinking, blend_type) return elseif item_type == ITEM_NO_DRINK and isEnd == TRUE then ExecEventHalfBlendNoReset(Event_ItemDrinkEmpty, blend_type) return end end if HalfBlendLowerCommonFunction(Event_ItemDrinkStart, lower_state, FALSE) == TRUE then return end end function ItemDrinkNothing_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDrinkNothing, lower_state, FALSE) == TRUE then return end end function ItemDrinking_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_ItemDrinkEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_ItemDrinking, lower_state, FALSE) == TRUE then return end end function ItemDrinkEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDrinkEnd, lower_state, FALSE) == TRUE then return end end function ItemShockWeaveStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemShockWeaveStart, lower_state, FALSE) == TRUE then return end end function ItemShockWeaveEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemShockWeaveEnd, lower_state, FALSE) == TRUE then return end end function ItemDrinkStartMP_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then ExecEventHalfBlendNoReset(Event_ItemDrinkingMP, blend_type) return end if HalfBlendLowerCommonFunction(Event_ItemDrinkStartMP, lower_state, FALSE) == TRUE then return end end function ItemDrinkingMP_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_ItemDrinkEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_ItemDrinkingMP, lower_state, FALSE) == TRUE then return end end function ItemThrowSpear_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThrowSpear, lower_state, FALSE, TRUE) == TRUE then return end end function DragonFullStartAfter_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThrowSpear, lower_state, FALSE, TRUE) == TRUE then return end end function ItemPrayMulti_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemPrayMulti, lower_state, FALSE, TRUE) == TRUE then return end end function ItemReturnBuddy_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemReturnBuddy, lower_state, FALSE, TRUE) == TRUE then return end end function ItemSummonBuddy_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemSummonBuddy, lower_state, FALSE, TRUE) == TRUE then return end end function ItemCopySleep_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemCopySleep, lower_state, FALSE) == TRUE then return end end function ItemVoice_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemVoice, lower_state, FALSE, TRUE) == TRUE then return end end function ItemHolySymbol_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemHolySymbol, lower_state, FALSE, TRUE) == TRUE then return end end function ItemHost_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemHost, lower_state, FALSE, TRUE) == TRUE then return end end function ItemMultKick_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemMultKick, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTongue_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTongue, lower_state, FALSE, TRUE) == TRUE then return end end function ItemThrowBackBottle_Upper_onUpdate() act(LockonFixedAngleCancel) local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThrowBackBottle, lower_state, FALSE, TRUE) == TRUE then return end end function ItemAromaWide_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemAromaWide, lower_state, FALSE, TRUE) == TRUE then return end end function ItemAromaUp_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemAromaUp, lower_state, FALSE, TRUE) == TRUE then return end end function ItemAromaBreath_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemAromaBreath, lower_state, FALSE, TRUE) == TRUE then return end end function ItemAromaDrink_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemAromaDrink, lower_state, FALSE, TRUE) == TRUE then return end end function ItemAromaFront_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemAromaFront, lower_state, FALSE, TRUE) == TRUE then return end end function ItemDrinkEmpty_Upper_onActivate() if env(IsCOMPlayer) == TRUE then act(AddSpEffect, 5630) end end function ItemDrinkEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDrinkEmpty, lower_state, FALSE) == TRUE then return end end function ItemDragonThrowSpearMax_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDragonThrowSpearMax, lower_state, FALSE, TRUE) == TRUE then return end if env(ActionDuration, ACTION_ARM_USE_ITEM) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventHalfBlend(Event_ItemDragonThrowSpearCancel, blend_type) return end end function ItemDragonThrowSpearCancel_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDragonThrowSpearCancel, lower_state, FALSE, TRUE) == TRUE then return end end function ItemThrowBigBottle_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThrowBigBottle, lower_state, FALSE, TRUE) == TRUE then return end end function ItemDancingSwordsmanFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDancingSwordsmanFire, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTransformDragonPriest_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTransformDragonPriest, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTransformGodman_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTransformGodman, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTransformDaergraf_Upper_onUpdate() -- Daergraf transform item local blend_type, lower_state = GetHalfBlendInfo() local Event_ItemTransformDaergraf = {"W_ItemTransformDaergraf", ITEM_DEF0, ITEMNORMAL_DEF1, 63} if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTransformDaergraf, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTransformGodmanNPC_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTransformGodmanNPC, lower_state, FALSE, TRUE) == TRUE then return end end function ItemTransformGodmanBreathNPC_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemTransformGodmanBreathNPC, lower_state, FALSE, TRUE) == TRUE then return end end function ItemCrySickness_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemCrySickness, lower_state, FALSE, TRUE) == TRUE then return end end function ItemCrySicknessPhantom_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemCrySicknessPhantom, lower_state, FALSE, TRUE) == TRUE then return end end function ItemSwitchExplosive_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemSwitchExplosive, lower_state, FALSE, TRUE) == TRUE then return end end function ItemSwitch_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemSwitch, lower_state, FALSE, TRUE) == TRUE then return end end function ItemThorn_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemThorn, lower_state, FALSE, TRUE) == TRUE then return end end function ItemErdtree_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemErdtree, lower_state, FALSE, TRUE) == TRUE then return end end function ItemElixir2_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemElixir2, lower_state, FALSE, TRUE) == TRUE then return end end function ItemOneShot_Upper_onUpdate() if GetVariable("IndexItemUseAnim") == 52 then SetEnableMimicry() end local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemOneShot, lower_state, FALSE, TRUE) == TRUE then return end end function ItemOneShot_SelfTrans_Upper_onUpdate() if GetVariable("IndexItemUseAnim_SelfTrans") == 52 then SetEnableMimicry() end local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemOneShot_SelfTrans, lower_state, FALSE, TRUE) == TRUE then return end end function ItemCombo_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemCombo, lower_state, FALSE, TRUE) == TRUE then return end end IsSummonDash = FALSE function ItemDash_Upper_onUpdate() act(LockonFixedAngleCancel) act(SetAllowedThrowDefenseType, 255) local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if GetLocomotionState() == PLAYER_STATE_MOVE and GetVariable("MoveSpeedIndex") >= 1 and GetVariable("ItemDashSpeedIndex") == 0 then act(DebugLogOutput, "SummonHorse ChangeSpeedIndex") IsSummonDash = TRUE SetVariable("ItemDashSpeedIndex", 1) end if env(IsSummoningRide) == TRUE then act(DebugLogOutput, "SummonHorse SummonRequest true") if env(IsNewRidingTest) == TRUE and IsSummonDash == TRUE then act(DebugLogOutput, "SummonHorse RideOnDash") SetVariable("RideOnSummonTest", 2) FireRideEvent("W_RideOn", "W_RideOnDash", FALSE) elseif env(IsNewRidingTest) == TRUE then act(DebugLogOutput, "SummonHorse RideOn") SetVariable("RideOnSummonTest", 1) FireRideEvent("W_RideOn", "W_RideOn", FALSE) else SetVariable("RideOnSummonTest", 0) ExecEventAllBody("W_RideAdjustFromCalling") end return elseif env(GetEventEzStateFlag, 0) == TRUE then if GetVariable("MoveSpeedLevel") >= 0.9 then else IsSummonDash = FALSE end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") end act(Mounting) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDash, lower_state, FALSE, TRUE) == TRUE then return end end function ItemInvalid_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemInvalid, lower_state, FALSE, TRUE) == TRUE then return end end function ItemLadderRecoverRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderSoulRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderElixirRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderElixir2Right_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderEatJerkyRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderDrinkStartRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, TRUE) == TRUE then return end local isEnd = env(IsAnimEnd, 1) if env(GetEventEzStateFlag, 0) == TRUE or isEnd == TRUE then local item_type = env(GetItemAnimType) if item_type ~= ITEM_NO_DRINK then ExecEvent("W_ItemLadderDrinkingRight") return elseif item_type == ITEM_NO_DRINK and isEnd == TRUE then ExecEvent("W_ItemLadderDrinkEmptyRight") return end end end function ItemLadderDrinkingRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_ItemLadderDrinkEndRight") return end end function ItemLadderDrinkMPStartRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, TRUE) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then ExecEvent("W_ItemLadderDrinkingMPRight") return end end function ItemLadderDrinkingMPRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_ItemLadderDrinkEndRight") return end end function ItemLadderDrinkEndRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderDrinkEmptyRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderDrinkNothingRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderInvalidRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderItemCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function ItemLadderRecoverLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderSoulLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderElixirLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderElixir2Left_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderEatJerkyLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderDrinkStartLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end local isEnd = env(IsAnimEnd, 1) if env(GetEventEzStateFlag, 0) == TRUE or isEnd == TRUE then local item_type = env(GetItemAnimType) if item_type ~= ITEM_NO_DRINK then ExecEvent("W_ItemLadderDrinkingLeft") return elseif item_type == ITEM_NO_DRINK and isEnd == TRUE then ExecEvent("W_ItemLadderDrinkEmptyLeft") return end end end function ItemLadderDrinkingLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_ItemLadderDrinkEndLeft") return end end function ItemLadderDrinkMPStartLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then ExecEvent("W_ItemLadderDrinkingMPLeft") return end end function ItemLadderDrinkingMPLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_ItemLadderDrinkEndLeft") return end end function ItemLadderDrinkEndLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderDrinkEmptyLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderDrinkNothingLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function ItemLadderInvalidLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderItemCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function GestureStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GestureCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_GestureStart, lower_state, FALSE) == TRUE then return end end function GestureLoopStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GestureLoopCommonFunction(blend_type, lower_state, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlend(Event_GestureLoop, blend_type) return end if HalfBlendLowerCommonFunction(Event_GestureLoopStart, lower_state, FALSE) == TRUE then return end end function GestureLoop_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GestureLoopCommonFunction(blend_type, lower_state, FALSE) == TRUE then return end if HalfBlendLowerCommonFunction(Event_GestureLoop, lower_state, FALSE) == TRUE then return end end function GestureEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GestureCommonFunction() == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_GestureEnd, lower_state, FALSE) == TRUE then return end end function Magic_Upper_Activate() end function MagicRight_Upper_Activate() local style = c_Style act(DebugLogOutput, "MagicRight_Upper_Activate check" .. style .. " ==" .. HAND_LEFT_BOTH) if style == HAND_LEFT_BOTH then SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) else SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_RIGHT) end ActivateRightArmAdd(START_FRAME_NONE) end function MagicRight_Upper_Update() UpdateRightArmAdd() end function MagicLeft_Upper_Activate() act(DebugLogOutput, "MagicLeft_Upper_Activate") SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) ActivateRightArmAdd(START_FRAME_A02) end function MagicLeft_Upper_Update() UpdateRightArmAdd() end function MagicLaunchRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() local magic_index = env(GetMagicAnimType) if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(GetMagicAnimType) ~= MAGIC_REQUEST_CRYSTAL_MOON and blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE then if ExecRollingMagic(HAND_RIGHT, magic_index, blend_type) == TRUE then return else ExecEventHalfBlend(Event_MagicFireRight, blend_type) return end end if HalfBlendLowerCommonFunction(Event_MagicLaunchRight, lower_state, FALSE) == TRUE then return end end function MagicLoopRight_Upper_onUpdate() TriggerBeforeSpellcast() act(NotifyAIOfBehaviourState, IDX_AINOTE_STATETYPE, IDX_AINOTE_STATETYPE_CHARGEMAGIC) local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local button = ACTION_ARM_R1 if IsCasterAsh() == TRUE or (c_SwordArtsID == SPELLCASTING_ASH and c_SwordArtsHand == HAND_LEFT and c_Style == HAND_LEFT_BOTH) then button = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand, true) == TRUE then button = ACTION_ARM_R2 end if env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE or env(GetStamina) <= 0 then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) end return end if HalfBlendLowerCommonFunction(Event_MagicLoopRight, lower_state, FALSE) == TRUE then return end end local _unchargableSpells = { [6540] = true, -- Nox's Mark } function MagicFireRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() local is_throw = FALSE local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_MAD_THROW then is_throw = TRUE end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, is_throw) == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local button = ACTION_ARM_R1 if IsCasterAsh() == TRUE or (c_SwordArtsID == SPELLCASTING_ASH and c_SwordArtsHand == HAND_LEFT and c_Style == HAND_LEFT_BOTH) then button = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand, true) == TRUE then button = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end if CheckIfHoldMagic() == TRUE and (env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE) then if env(ActionDuration, button) > 0 then ExecEventHalfBlend(Event_MagicLoopRight, blend_type) return else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireRight, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicFireRightCancel_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireRightCancel, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicLaunchLeft_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() local magic_index = env(GetMagicAnimType) if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(GetMagicAnimType) ~= MAGIC_REQUEST_CRYSTAL_MOON and blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE then if ExecRollingMagic(HAND_LEFT, magic_index, blend_type) == TRUE then return else ExecEventHalfBlend(Event_MagicFireLeft, blend_type) end end if HalfBlendLowerCommonFunction(Event_MagicLaunchLeft, lower_state, FALSE) == TRUE then return end end function MagicLoopLeft_Upper_onUpdate() act(NotifyAIOfBehaviourState, IDX_AINOTE_STATETYPE, IDX_AINOTE_STATETYPE_CHARGEMAGIC) local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local button = ACTION_ARM_L1 if LastHeldMagicButton >= 0 then button = LastHeldMagicButton end if env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or env(GetStamina) <= 0 then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) else ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) end end if HalfBlendLowerCommonFunction(Event_MagicLoopLeft, lower_state, FALSE) == TRUE then return end end function MagicFireLeftCancel_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireLeftCancel, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicFireRight2_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local mp_condition = 0 if GetVariable("IndexChargeMagicType") == 2 then mp_condition = 33 end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local button = ACTION_ARM_R1 if IsCasterAsh() == TRUE then button = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand, true) == TRUE then button = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or mp_condition >= env(GetFP))) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireRight2, lower_state, FALSE) == TRUE then return end end function MagicFireRight3_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local mp_condition = 0 if GetVariable("IndexChargeMagicType") == 2 then mp_condition = 33 end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local button = ACTION_ARM_R1 if IsCasterAsh() == TRUE then button = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand, true) == TRUE then button = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or mp_condition >= env(GetFP))) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireRightCancel3, blend_type) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireRight3, lower_state, FALSE) == TRUE then return end end function MagicFireLeft_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() local is_throw = FALSE local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_MAD_THROW then is_throw = TRUE end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, is_throw) == TRUE then return end local button = ACTION_ARM_L1 if LastHeldMagicButton >= 0 then button = LastHeldMagicButton end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end if CheckIfHoldMagic() == TRUE and (env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE) then if env(ActionDuration, button) > 0 then ExecEventHalfBlend(Event_MagicLoopLeft, blend_type) return else ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireLeft, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicFireRightCancel2_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireRight2, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicFireRightCancel3_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireRight3, lower_state, FALSE) == TRUE then return end end function MagicFireLeftCancel2_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireLeft2, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicFireLeft2_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local button = ACTION_ARM_L1 if IsWeaponCatalyst(HAND_LEFT) == TRUE then button = ACTION_ARM_L2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireLeft2, lower_state, FALSE) == TRUE then return end end function MagicFireLeftCancel3_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireLeftCancel3, lower_state, FALSE) == TRUE then return end end function MagicFireLeft3_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local button = ACTION_ARM_L1 if IsWeaponCatalyst(HAND_LEFT) == TRUE then button = ACTION_ARM_L2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireLeftCancel3, blend_type) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireLeftCancel3, lower_state, FALSE) == TRUE then return end end function QuickMagicFireRightDash_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireRightDash, lower_state, FALSE) == TRUE then return end end function QuickMagicFireRightStep_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireRightStep, lower_state, FALSE) == TRUE then return end end function QuickMagicFireRightBackStep_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireRightBackStep, lower_state, FALSE) == TRUE then return end end function QuickMagicFireRightAttackLeft_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireRightAttackLeft, lower_state, FALSE) == TRUE then return end end function QuickMagicFireRightAttackRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireRightAttackRight, lower_state, FALSE) == TRUE then return end end function QuickMagicFireLeftDash_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireLeftDash, lower_state, FALSE) == TRUE then return end end function QuickMagicFireLeftStep_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireLeftStep, lower_state, FALSE) == TRUE then return end end function QuickMagicFireLeftBackStep_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireLeftBackStep, lower_state, FALSE) == TRUE then return end end function QuickMagicFireLeftAttackRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireLeftAttackRight, lower_state, FALSE) == TRUE then return end end function QuickMagicFireLeftAttackLeft_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_QuickMagicFireLeftAttackRight, lower_state, FALSE) == TRUE then return end end function MagicFireRightJump_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local button = ACTION_ARM_R1 if IsCasterAsh() == TRUE then button = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand, true) == TRUE then button = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireRightJumpCancel, blend_type) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireRightJump, lower_state, FALSE) == TRUE then return end end function MagicFireRightJumpCancel_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireRightJumpCancel, lower_state, FALSE) == TRUE then return end end function MagicFireLeftJump_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local wep_hand = HAND_LEFT local button = ACTION_ARM_L1 if LastHeldMagicButton >= 0 then button = LastHeldMagicButton end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventHalfBlend(Event_MagicFireRightJumpCancel, blend_type) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireLeftJump, lower_state, FALSE) == TRUE then return end end function MagicFireLeftJumpCancel_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicFireLeftJumpCancel, lower_state, FALSE) == TRUE then return end end function StealthMagicRightLaunch_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlend(Event_StealthMagicRightFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthMagicRightLaunch, lower_state, FALSE, FALSE) == TRUE then return end end function StealthMagicRightFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Stealth_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthMagicRightFire, lower_state, FALSE, FALSE) == TRUE then return end end function StealthMagicLeftLaunch_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlend(Event_StealthMagicLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthMagicLeftLaunch, lower_state, FALSE, FALSE) == TRUE then return end end function StealthMagicLeftFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Stealth_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthMagicLeftFire, lower_state, FALSE, FALSE) == TRUE then return end end function RollingMagicRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_RollingMagicRight, lower_state, FALSE) == TRUE then return end end function RollingMagicLeft_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(blend_type, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_RollingMagicLeft, lower_state, FALSE) == TRUE then return end end function MagicInvalid_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_ATTACK, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_MagicInvalidMirror, lower_state, FALSE) == TRUE then return end end function ThrowBackStab_Activate() act(InvokeBackstab) local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end function ThrowBackStab_onActivate() SetVariable("ThrowHandIndex", 0) end function ThrowBackStab_onUpdate() if env(HasThrowRequest) == FALSE then if BackStabCommonFunction() == TRUE then return end else ResetRequest() return end end function Throw_Activate() ResetRequest() SetVariable("MoveSpeedLevelReal", 0) SetThrowInvalid() local id = env(GetThrowAnimID) if id >= 0 then SetVariable("ThrowID", id) end if c_Style == HAND_LEFT_BOTH then SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) else SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_RIGHT) end SetVariable("ThrowHandIndex", 0) SetVariable("ThrowHoldBlendWeight", 0) SetVariable("ThrowHolding", false) SetVariable("ThrowNoRegistTime", 0) end function Throw_Update() SetThrowInvalid() end function Throw_Deactivate() act(RequestThrowAnimInterrupt) end function ThrowAtk_onActivate() CriticalHitDetection() Replanning() end function ThrowAtk_onUpdate() if ThrowCommonFunction(FALSE) == TRUE then act(RequestThrowAnimInterrupt) return end end function ThrowDef_onActivate() Replanning() end function ThrowDef_onUpdate() OnTakingHit(true) if env(GetSpEffectID, 19682) == TRUE and env(GetSpEffectID, 19681) == TRUE then act(AddSpEffect, 19680) end if env(GetEventEzStateFlag, 0) == TRUE and env(GetSpEffectID, 19680) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_CHARM) ExecEvent("W_DeathStart") return end SetThrowDefBlendWeight() if env(IsThrowSelfDeath) == TRUE then ExecEvent("ThrowDeath") return end if env(IsThrowSuccess) == TRUE then ExecEvent("W_ThrowEscape") return end if ThrowCommonFunction(ESTEP_DOWN) == TRUE then act(RequestThrowAnimInterrupt) return end end function ThrowEscape_onUpdate() if ThrowCommonFunction() == TRUE then act(RequestThrowAnimInterrupt) return end end function ThrowDeath_onActivate() BlightpoleOffHandler() act(SetThrowState, THROW_TYPE_DEATH) end function ThrowDeathIdle_onActivate() BlightpoleOffHandler() act(SetThrowState, THROW_TYPE_INVALID) end function Event_onActivate() ResetEventState() SetVariable("TestIsEventBlend", 1) if GetVariable("TestIsEventBlend") then local testmoveangle = env(GetObjActTargetDirection) SetVariable("TestMoveAngle", testmoveangle) TestBlendrate = 0 end blendtimemax = env(GetObjActRemainingInterpolateTime) end function Event_onUpdate() if GetVariable("TestIsEventBlend") then blendtime = env(GetObjActRemainingInterpolateTime) if blendtime > 0 then if blendtime > EVENT_BLEND_RATE * 2 then SetVariable("TestEventBlend_Move", 1) SetVariable("TestEventBlend_Event", 0) else local blendstoptime = blendtimemax / 2 if blendstoptime < 300 then blendstoptime = 300 elseif blendstoptime > 750 then blendstoptime = 750 end local blendmove = (blendtime - 300) / EVENT_BLEND_RATE local blendevent = 1 - (blendtime - 300) / EVENT_BLEND_RATE if blendmove < 0 then blendmove = 0 end if blendevent > 1 then blendevent = 1 end SetVariable("TestEventBlend_Move", blendmove) SetVariable("TestEventBlend_Event", blendevent) end end end end function Event26001_onActivate() ResetEventState() act(SetTurnAnimCorrectionRate, 90) end function Event26001_onUpdate() act(SetIsTurnAnimInProgress) if EventCommonFunction() == TRUE then return end end function Event26011_onActivate() ResetEventState() act(SetTurnAnimCorrectionRate, 90) end function Event26011_onUpdate() act(SetIsTurnAnimInProgress) if EventCommonFunction() == TRUE then return end end function Event26020_onActivate() ResetEventState() end function Event26020_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event26030_onActivate() ResetEventState() end function Event26030_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event26021_onActivate() ResetEventState() act(SetTurnAnimCorrectionRate, 180) end function Event26021_onUpdate() act(SetIsTurnAnimInProgress) if EventCommonFunction() == TRUE then return end end function Event26031_onActivate() ResetEventState() act(SetTurnAnimCorrectionRate, 180) end function Event26031_onUpdate() act(SetIsTurnAnimInProgress) if EventCommonFunction() == TRUE then return end end function Event50050_onActivate() ResetEventState() end function Event50050_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event50050_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event50250_onActivate() ResetEventState() end function Event50250_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event50250_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60000_onActivate() ResetEventState() end function Event60000_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60000_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60001_onActivate() ResetEventState() end function Event60001_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60001_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60002_onActivate() ResetEventState() end function Event60002_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60002_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60003_onActivate() ResetEventState() end function Event60003_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60003_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60010_onActivate() ResetEventState() end function Event60010_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60020_onActivate() ResetEventState() end function Event60020_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60030_onActivate() ResetEventState() end function Event60030_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60040_onActivate() ResetEventState() end function Event60040_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60060_onActivate() ResetEventState() end function Event60060_onUpdate() PositionTrackerReset(true) if EventCommonFunction() == TRUE then return end end function Event60070_onActivate() ResetEventState() end function Event60070_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60070_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60071_onActivate() ResetEventState() end function Event60071_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60071_onDeactivate() act(SetIsEventActionPossible, FALSE) end function EventHalfBlend60071_Upper_onActivate() ResetEventState() end function EventHalfBlend60071_Upper_onUpdate() act(SetIsEventActionPossible, TRUE) act(Wait) local blend_type, lower_state = GetHalfBlendInfo() if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Move, UPPER) act(SetIsEventActionPossible, FALSE) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then act(SetIsEventActionPossible, FALSE) return end if HalfBlendLowerCommonFunction(Event_EventHalfBlend60071, lower_state, FALSE) == TRUE then act(SetIsEventActionPossible, FALSE) return end end function EventHalfBlend60071_Upper_onDeactivate() act(SetIsEventActionPossible, FALSE) end function EventHalfBlend360070_Upper_onActivate() ResetEventState() end function EventHalfBlend360070_Upper_onUpdate() act(SetIsEventActionPossible, TRUE) act(Wait) local blend_type, lower_state = GetHalfBlendInfo() if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end if lower_state == LOWER_MOVE and env(IsMoveCancelPossible) == TRUE then ExecEventHalfBlendNoReset(Event_Stealth_Move, UPPER) act(SetIsEventActionPossible, FALSE) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then act(SetIsEventActionPossible, FALSE) return end if HalfBlendLowerCommonFunction(Event_EventHalfBlend360070, lower_state, FALSE) == TRUE then act(SetIsEventActionPossible, FALSE) return end end function EventHalfBlend360070_Upper_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60080_onActivate() ResetEventState() end function Event60080_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60090_onActivate() ResetEventState() end function Event60090_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60090_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60100_onActivate() ResetEventState() end function Event60100_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60110_onActivate() ResetEventState() end function Event60110_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60120_onActivate() ResetEventState() end function Event60120_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60130_onActivate() ResetEventState() end function Event60130_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60131_onActivate() ResetEventState() end function Event60131_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60160_onActivate() ResetEventState() end function Event60160_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60160_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60170_onActivate() ResetEventState() end function Event60170_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60170_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60180_onActivate() ResetEventState() end function Event60180_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60180_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60190_onActivate() ResetEventState() end function Event60190_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60190_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60200_onActivate() ResetEventState() end function Event60200_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60201_onActivate() ResetEventState() end function Event60201_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60202_onActivate() ResetEventState() end function Event60202_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60210_onActivate() ResetEventState() end function Event60210_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60220_onActivate() ResetEventState() end function Event60220_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60230_onActivate() ResetEventState() end function Event60230_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60231_onActivate() ResetEventState() end function Event60231_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60240_onActivate() ResetEventState() end function Event60240_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60241_onActivate() ResetEventState() end function Event60241_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60250_onActivate() ResetEventState() end function Event60250_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60260_onActivate() ResetEventState() end function Event60260_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60265_onActivate() ResetEventState() end function Event60265_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60270_onActivate() ResetEventState() end function Event60270_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60370_onActivate() ResetEventState() end function Event60370_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60380_onActivate() ResetEventState() end function Event60380_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60390_onActivate() ResetEventState() end function Event60390_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60400_onActivate() ResetEventState() end function Event60400_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60450_onActivate() ResetEventState() end function Event60450_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60451_onActivate() ResetEventState() end function Event60451_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60455_onActivate() ResetEventState() end function Event60455_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60456_onActivate() ResetEventState() end function Event60455_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60460_onActivate() ResetEventState() end function Event60460_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60470_onActivate() ResetEventState() end function Event60470_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60471_onActivate() ResetEventState() end function Event60471_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60472_onActivate() ResetEventState() end function Event60472_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60473_onActivate() ResetEventState() end function Event60473_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60480_onActivate() ResetEventState() end function Event60480_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60481_onActivate() ResetEventState() end function Event60481_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60482_onActivate() ResetEventState() end function Event60482_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60490_onActivate() ResetEventState() end function Event60490_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60500_onActivate() ResetEventState() end function Event60500_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60501_onActivate() ResetEventState() end function Event60501_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60502_onActivate() ResetEventState() end function Event60502_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60503_onActivate() ResetEventState() end function Event60503_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60504_onActivate() ResetEventState() end function Event60504_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60505_onActivate() ResetEventState() end function Event60505_onUpdate() if env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end end function Event60505_onDeactivate() act(ChangeBuddyState) end function Event60520_onActivate() ResetEventState() end function Event60520_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60521_onActivate() ResetEventState() end function Event60521_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60522_onActivate() ResetEventState() end function Event60522_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60523_onActivate() ResetEventState() end function Event60523_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60524_onActivate() ResetEventState() end function Event60524_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60525_onActivate() ResetEventState() end function Event60525_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60530_onActivate() ResetEventState() end function Event60530_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60550_onActivate() ResetEventState() end function Event60550_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60560_onActivate() ResetEventState() end function Event60560_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60750_onActivate() ResetEventState() end function Event60750_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60760_onActivate() ResetEventState() end function Event60760_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60780_onActivate() ResetEventState() end function Event60780_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60790_onActivate() ResetEventState() end function Event60790_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60800_onActivate() ResetEventState() end function Event60800_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60810_onActivate() ResetEventState() end function Event60810_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60811_onActivate() ResetEventState() end function Event60811_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63000_onActivate() ResetEventState() end function Event63000_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63010_onActivate() ResetEventState() end function Event63010_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63020_onActivate() ResetEventState() end function Event63020_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63021_onActivate() ResetEventState() end function Event63040_onActivate() ResetEventState() end function Event63040_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63050_onActivate() ResetEventState() end function Event63050_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63060_onActivate() ResetEventState() end function Event63060_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63061_onActivate() ResetEventState() end function Event63061_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63070_onActivate() ResetEventState() end function Event63070_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63080_onActivate() ResetEventState() end function Event63080_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63090_onActivate() ResetEventState() end function Event63090_onUpdate() if EventCommonFunction() == TRUE then return end end function Event65012_onActivate() ResetEventState() end function Event65012_onUpdate() if EventCommonFunction() == TRUE then return end end function Event65013_onActivate() ResetEventState() end function Event65013_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67000_onActivate() ResetEventState() end function Event67000_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67001_onActivate() ResetEventState() end function Event67001_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67010_onActivate() ResetEventState() end function Event67010_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67011_onActivate() ResetEventState() end function Event67011_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67020_onActivate() ResetEventState() end function Event67020_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67030_onActivate() ResetEventState() end function Event67030_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67040_onActivate() ResetEventState() end function Event67040_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67050_onActivate() ResetEventState() end function Event67050_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67060_onActivate() ResetEventState() end function Event67060_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67070_onActivate() ResetEventState() end function Event67070_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67080_onActivate() ResetEventState() end function Event67080_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67090_onActivate() ResetEventState() end function Event67090_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67080_onActivate() ResetEventState() end function Event67080_onUpdate() if EventCommonFunction() == TRUE then return end end function Event67100_onActivate() ResetEventState() end function Event67100_onUpdate() if EventCommonFunction() == TRUE then return end end function Event68043_onActivate() ResetEventState() end function Event68043_onUpdate() if EventCommonFunction() == TRUE then return end end function Event68110_onActivate() ResetEventState() end function Event68110_onUpdate() if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_BonfireLevelUpLoop") return end if EventCommonFunction() == TRUE then return end end function Event69000_onActivate() ResetEventState() end function Event69000_onUpdate() if EventCommonFunction() == TRUE then return end end function Event69001_onActivate() ResetEventState() end function Event69001_onUpdate() if EventCommonFunction() == TRUE then return end end function Event69002_onActivate() ResetEventState() end function Event69002_onUpdate() if EventCommonFunction() == TRUE then return end end function Event69003_onActivate() ResetEventState() end function Event69003_onUpdate() if EventCommonFunction() == TRUE then return end end function Event69010_onActivate() ResetEventState() end function Event69010_onUpdate() if EventCommonFunction() == TRUE then return end end function Event69030_onActivate() ResetEventState() end function Event69030_onUpdate() if EventCommonFunction() == TRUE then return end end function Event6000_onActivate() ResetEventState() end function Event6000_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event6000_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event6001_onActivate() ResetEventState() end function Event6001_onUpdate() if env(GetSpEffectID, 10665) == TRUE then act(SetIsEventActionPossible, FALSE) else act(SetIsEventActionPossible, TRUE) end if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event6001_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event6002_onActivate() ResetEventState() end function Event6002_onUpdate() if EventCommonFunction() == TRUE then return end end function Event17140_onActivate() ResetEventState() end function Event18140_onActivate() ResetEventState() end function Event18140_onUpdate() act(SetDeathStay, TRUE) end function Event18140_onDeactivate() act(SetDeathStay, FALSE) end function Event99999_onActivate() ResetEventState() end function Event99999_onUpdate() if EventCommonFunction() == TRUE then return end end function Event150250_onActivate() ResetEventState() end function Event150250_onUpdate() act(SetIsEventActionPossible, TRUE) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then act(SetIsEventActionPossible, FALSE) return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event150250_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event160070_onActivate() ResetEventState() end function Event160070_onUpdate() act(SetIsEventActionPossible, TRUE) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then act(SetIsEventActionPossible, FALSE) return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event160070_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event360070_onActivate() ResetEventState() end function Event360070_onUpdate() act(SetIsEventActionPossible, TRUE) if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Stealth_Idle") act(SetIsEventActionPossible, FALSE) return end if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event360070_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Ladder_Activate() act(ClearSlopeInfo) act(SetIsEquipmentMenuAccessOn) Flag_LadderDamage = LADDER_DAMAGE_NONE Flag_LadderJump = LADDER_JUMP_INVALID SetThrowInvalid() end function Ladder_Update() SetThrowInvalid() LadderSetActionState(INVALID) end function LadderAttachBottom_onUpdate() if env(IsObjActInterpolatedMotion) == TRUE then return end ExecEvent("W_LadderStartBottom") end function LadderAttachTop_onUpdate() if env(IsObjActInterpolatedMotion) == TRUE then return end ExecEvent("W_LadderStartTop") end function LadderStartTop_onActivate() act(ClearSlopeInfo) end function LadderStartTop_onUpdate() LadderSetActionState(LADDER_ACTION_START_TOP) if LadderMoveCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end end function LadderStartBottom_onActivate() act(ClearSlopeInfo) end function LadderStartBottom_onUpdate() LadderSetActionState(LADDER_ACTION_START_BOTTOM) if LadderMoveCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end end function LadderUpRight_onActivate() LadderSendCommand(LADDER_CALL_UP) end function LadderUpRight_onUpdate() LadderSetActionState(LADDER_ACTION_UP_RIGHT) if LadderMoveCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function LadderUpLeft_onActivate() LadderSendCommand(LADDER_CALL_UP) end function LadderUpLeft_onUpdate() LadderSetActionState(LADDER_ACTION_UP_LEFT) if LadderMoveCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function LadderDownLeft_onActivate() LadderSendCommand(LADDER_CALL_DOWN) end function LadderDownLeft_onUpdate() LadderSetActionState(LADDER_ACTION_DOWN_LEFT) if LadderMoveCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function LadderDownRight_onActivate() LadderSendCommand(LADDER_CALL_DOWN) end function LadderDownRight_onUpdate() LadderSetActionState(LADDER_ACTION_DOWN_RIGHT) if LadderMoveCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function LadderEndBottomLeft_onActivate() LadderSendCommand(LADDER_EVENT_COMMAND_EXIT) end function LadderEndBottomLeft_onUpdate() LadderSetActionState(LADDER_ACTION_END_BOTTOM) if LadderEndCommonFunction() == TRUE then return end end function LadderEndBottomRight_onActivate() LadderSendCommand(LADDER_CALL_DOWN) end function LadderEndBottomRight_onUpdate() LadderSetActionState(LADDER_ACTION_END_BOTTOM) if LadderEndCommonFunction() == TRUE then return end end function LadderEndTopLeft_onActivate() LadderSendCommand(LADDER_CALL_UP) end function LadderEndTopLeft_onUpdate() LadderSetActionState(LADDER_ACTION_END_TOP) if LadderEndCommonFunction() == TRUE then return end end function LadderEndTopRight_onActivate() LadderSendCommand(LADDER_CALL_UP) end function LadderEndTopRight_onUpdate() LadderSetActionState(LADDER_ACTION_END_TOP) if LadderEndCommonFunction() == TRUE then return end end function LadderIdleLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderIdleCommonFunction(HAND_STATE_LEFT) == TRUE then return end end function LadderIdleRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderIdleCommonFunction(HAND_STATE_RIGHT) == TRUE then return end end function LadderAttackUpRight_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_UP_RIGHT) if LadderAttackCommonFunction(HAND_STATE_RIGHT) == TRUE then return end end function LadderAttackUpLeft_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_UP_LEFT) if LadderAttackCommonFunction(HAND_STATE_LEFT) == TRUE then return end end function LadderAttackDownRight_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_DOWN_RIGHT) if LadderAttackCommonFunction(HAND_STATE_RIGHT) == TRUE then return end end function LadderAttackDownLeft_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_DOWN_RIGHT) if LadderAttackCommonFunction(HAND_STATE_LEFT) == TRUE then return end end function LadderCoastStart_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_START) if LadderCoastCommonFunction(HAND_STATE_LEFT, TRUE) == TRUE then return end end function LadderCoastRight_onActivate() LadderSendCommand(LADDER_CALL_DOWN) end function LadderCoastRight_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_RIGHT) if LadderCoastCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function LadderCoastLeft_onActivate() LadderSendCommand(LADDER_CALL_DOWN) end function LadderCoastLeft_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_LEFT) if LadderCoastCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function LadderCoastStopLeft_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_STOP) if LadderMoveCommonFunction(HAND_STATE_LEFT, FALSE) == TRUE then return end end function LadderCoastStopRight_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_STOP) if LadderMoveCommonFunction(HAND_STATE_RIGHT, FALSE) == TRUE then return end end function LadderCoastLanding_onActivate() LadderSendCommand(LADDER_CALL_DOWN) end function LadderCoastLanding_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_LANDING) if LadderEndCommonFunction() == TRUE then return end end function LadderDamageLargeRight_onUpdate() LadderSetActionState(LADDER_ACTION_DAMAGE_LARGE) if LadderDamageCommonFunction(HAND_STATE_RIGHT) == TRUE then return end end function LadderDamageSmallRight_onUpdate() LadderSetActionState(LADDER_ACTION_DAMAGE_SMALL) if LadderDamageCommonFunction(HAND_STATE_RIGHT) == TRUE then return end end function LadderDamageLargeLeft_onUpdate() LadderSetActionState(LADDER_ACTION_DAMAGE_LARGE) if LadderDamageCommonFunction(HAND_STATE_LEFT) == TRUE then return end end function LadderDamageSmallLeft_onUpdate() LadderSetActionState(LADDER_ACTION_DAMAGE_SMALL) if LadderDamageCommonFunction(HAND_STATE_LEFT) == TRUE then return end end function LadderDeathStart_onActivate() BlightpoleOffHandler() LadderSendCommand(LADDER_EVENT_COMMAND_EXIT) end function LadderDeathLoop_onUpdate() BlightpoleOffHandler() if env(IsLanding) == TRUE then ExecEvent("LadderDeathLand") end local height = env(GetFallHeight) / 100 if height > 60 then ExecEvent("W_LadderDeathIdle") end end function LadderDeathIdle_onActivate() act(SetDeathStay, TRUE) end function LadderDeathIdle_onDeactivate() act(SetDeathStay, FALSE) end function LadderFallStart_onActivate() LadderSendCommand(LADDER_EVENT_COMMAND_EXIT) end function LadderFallLoop_onUpdate() if FallCommonFunction(TRUE, FALSE, FALL_LADDER) == TRUE then return end end function LadderFallLanding_onUpdate() if LandCommonFunction() == TRUE then return end end function LadderDrop_onUpdate() act(SetMovementScaleMult, math.random(160, 200) / 100) act(SetIsEquipmentMenuAccessOn) if env(IsFalling) == TRUE then ExecEventAllBody("W_FallLoop") return end end function Initialize() SetBonfireIndex() ClearAttackQueue() act(AddSpEffect, 6990) act(AddSpEffect, 6300) if env(IsFemale) == FALSE then c_IsFemale = TRUE end end function SetBonfireIndex() SetVariable("IndexBonfire", 0) end function SetThrowAtkInvalid() act(SetAllowedThrowAttackType, THROW_STATE_INVALID) end function SetThrowDefInvalid() act(SetAllowedThrowDefenseType, THROW_STATE_INVALID) end function SetThrowInvalid() act(SetAllowedThrowAttackType, THROW_STATE_INVALID) act(SetAllowedThrowDefenseType, THROW_STATE_INVALID) end function AddDamageDefault_onUpdate() SetVariable("AddDamageBlend", 0) end function AddDamageDefaultGuard_onUpdate() SetVariable("AddDamageGuardBlend", 0) end function SAMagic_Default_onUpdate() SetVariable("SAMagicBlendRate", 0) end function DamageDirNoAdd_onUpdate() SetVariable("DamageDirBlendRate", 0) end function AddDamageLv0_Default_onUpdate() SetVariable("AddDamageLv0_Blend", 0) end function ChangeMoveSpeedIndex(index) SetVariable("MoveSpeedIndex", index) if index >= 2 then SetVariable("MoveSpeedIndexBLR", 1) else SetVariable("MoveSpeedIndexBLR", index) end end function SpeedUpdate() local stick_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local is_aim = env(IsPrecisionShoot) local is_lockon = GetVariable("IsLockon") if is_aim == TRUE then if stick_level > 1 then stick_level = 1 end elseif env(GetSpEffectID, 100020) == TRUE and stick_level > 1 then stick_level = 1 elseif IsForceSprint() == TRUE then stick_level = 2 AddStamina(1) end local speed = GetMoveSpeed(stick_level) SetVariable("MoveSpeedLevelReal", speed) if env(GetStamina) <= 0 then act(AddSpEffect, 100020) end local weight = math.mod(env(GetMoveAnimParamID), 20) if is_aim == TRUE then ChangeMoveSpeedIndex(0) elseif weight == WEIGHT_OVERWEIGHT then ChangeMoveSpeedIndex(0) -- Ironjar Aromatic elseif env(GetSpEffectID, 503520) == TRUE and env(GetSpEffectID, 341300) == FALSE then ChangeMoveSpeedIndex(0) -- Forced Slow Walk/Jump elseif env(GetSpEffectID, 4101) == TRUE and env(GetSpEffectID, 341300) == FALSE then -- Duplicate Condition #1 ChangeMoveSpeedIndex(0) elseif g_IsMimicry == TRUE and env(GetSpEffectID, 390620) == FALSE then if stick_level > 1.1 then ResetMimicry() else ChangeMoveSpeedIndex(0) end -- Forced Slow Walk/Jump elseif env(GetSpEffectID, 4101) == TRUE and env(GetSpEffectID, 341300) == FALSE then -- Duplicate Condition #2 if stick_level > 1.1 then ChangeMoveSpeedIndex(1) end -- [Slug: Slowing Shot] or [Unk] elseif (env(GetSpEffectID, 425) == TRUE or env(GetSpEffectID, 19670) == TRUE) and env(GetSpEffectID, 341300) == FALSE then if stick_level > 1.1 then ChangeMoveSpeedIndex(1) end -- Dashing elseif env(GetSpEffectID, 100220) == TRUE then ChangeMoveSpeedIndex(2) else local runLevel = 0.6 if GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("MoveSpeedIndex") >= 1 then runLevel = 0.4 end -- Sprint (stick + O) if stick_level > 1.1 then if env(GetSpEffectID, 100020) == TRUE then ChangeMoveSpeedIndex(1) SetVariable("ToggleDash", 0) else act(LockonFixedAngleCancel) ChangeMoveSpeedIndex(2) end -- Normal Walk (stick) elseif runLevel < stick_level then ChangeMoveSpeedIndex(1) if env(GetSpEffectID, 100002) == FALSE and (GetVariable("IsEnableToggleDashTest") >= 2 or env(GetSpEffectID, 100301) == FALSE) then SetVariable("ToggleDash", 0) end -- Stop else ChangeMoveSpeedIndex(0) if env(GetSpEffectID, 100002) == FALSE and (GetVariable("IsEnableToggleDashTest") >= 2 or env(GetSpEffectID, 100301) == FALSE) then SetVariable("ToggleDash", 0) end end end if env(GetSpEffectID, 100002) == TRUE then act(SetStaminaRecoveryDisabled) SellswordJewelSprintingVisual() end end function GetMoveSpeed(stick_level) local speed = GetVariable("MoveSpeedLevelReal") local inc_val = ACCELERATION_WALK_SPEED_UP local dec_val = ACCELERATION_SPEED_DOWN if stick_level == 2 then inc_val = ACCELERATION_DASH_SPEED_UP dec_val = ACCELERATION_DASH_SPEED_DOWN end local ret = ConvergeValue(stick_level, speed, inc_val, dec_val) return ret end function StealthTransitionIndexUpdate() local move_speed_level = GetVariable("MoveSpeedLevel") local MoveIndex = GetVariable("MoveSpeedIndex") if MoveIndex == 2 then SetVariable("StealthTransitionIndex", 3) elseif MoveIndex == 1 then SetVariable("StealthTransitionIndex", 2) elseif move_speed_level > 0 then SetVariable("StealthTransitionIndex", 1) else SetVariable("StealthTransitionIndex", 0) end end function SetThrowDefBlendWeight() if env(DoesAnimExist, GetVariable("ThrowID") + 4) == FALSE then return end local regist_num = env(GetThrowDefenseCount) local dT = GetDeltaTime() local blend_weight = GetVariable("ThrowHoldBlendWeight") local is_holding = GetVariable("ThrowHolding") local no_regist_time = GetVariable("ThrowNoRegistTime") if regist_num > 0 then is_holding = true end if is_holding == true then if regist_num <= 0 then no_regist_time = no_regist_time + dT end if no_regist_time > 0.7 then is_holding = false else blend_weight = blend_weight + 2 * dT if blend_weight > 0.99 then blend_weight = 0.99 end SetVariable("IsEnableTAEThrowHold", true) end else no_regist_time = 0 blend_weight = blend_weight - 4 * dT if blend_weight < 0.01 then blend_weight = 0.01 SetVariable("IsEnableTAEThrowHold", false) else SetVariable("IsEnableTAEThrowHold", true) end end SetVariable("ThrowHoldBlendWeight", blend_weight) SetVariable("ThrowHolding", is_holding) SetVariable("ThrowNoRegistTime", no_regist_time) end function SetNpcTurnSpeed(turn_speed) if env(IsCOMPlayer) == TRUE and turn_speed >= 0 then act(SetTurnSpeed, turn_speed) end end function GetDeltaTime() return env(ObtainedDT) / 1000 end function GetConstVariable() c_HasActionRequest = CheckActionRequest() c_RollingAngle = env(GetRollAngle) * 0.01 c_ArtsRollingAngle = env(GetSwordArtsRollAngle) * 0.01 c_Style = env(GetWeaponSwitchState) c_SwordArtsID, c_SwordArtsHand = GetSwordArtInfo() c_IsEnableSwordArts = IsEnableSwordArts() c_IsStealth = env(GetSpEffectID, 8001) end function GetHalfBlendInfo() local blend_type = ALLBODY local lower_state = LOWER_IDLE if GetLocomotionState() == PLAYER_STATE_MOVE then blend_type = UPPER lower_state = LOWER_MOVE elseif IsLowerQuickTurn() == TRUE then if ExitQuickTurnLower() == TRUE then lower_state = LOWER_END_TURN else blend_type = UPPER lower_state = LOWER_TURN end end return blend_type, lower_state end ------------------------------- -- Main Update ------------------------------- function Update() GetConstVariable() SetStyleSpecialEffect() act(SwitchMotion, FALSE) if env(ActionDuration, ACTION_ARM_ACTION) > 0 then SetThrowAtkInvalid() end SetVariable("EyeBlinkBlend", 1 - g_TimeActEditor_11) act(LockonSystemUnableToTurnAngle, 0, 0) if env(IsOnMount) == TRUE then act(LockonFixedAngleCancel) if env(GetSpiritspringJumpHeight) > 0 or env(GetSpEffectID, 183) == TRUE then act(AddSpEffect, 185) end end SetVariable("LocomotionState", GetLocomotionState()) SetMoveType() ChangeWaistTwist(-10, 0, -20, 0) if IsLowerQuickTurn() == TRUE then SetVariable("LookAtTwist30_OnGain", 1) else SetVariable("LookAtTwist30_OnGain", 0.1) end GreyOutSwordArtFE() SetArtCancelType() if GetVariable("IsKeepAttackQueue") == false then ClearAttackQueue() end if c_Style == HAND_LEFT_BOTH then SetVariable("IndexHandBothStyle", 1) else SetVariable("IndexHandBothStyle", 0) end GetTimeActEditorVariable() UpdatePostureTwist() if env(GetSpEffectID, 503040) == TRUE or env(GetSpEffectID, 390620) == TRUE then g_IsMimicry = TRUE else g_IsMimicry = FALSE end if g_EnableMimicry == FALSE and g_EnableMimicry_Jewel == FALSE and g_IsMimicry == TRUE then ResetMimicry() end g_EnableMimicry = FALSE g_EnableMimicry_Jewel = FALSE if env(GetSpEffectID, 503317) == TRUE then if env(GetSpEffectID, 503315) == TRUE then act(AddSpEffect, 503312) elseif env(GetSpEffectID, 9642) == TRUE then else act(AddSpEffect, 503313) end end if env(IsPrecisionShoot) == TRUE and env(GetSpEffectID, 19990) == TRUE and env(GetSpEffectID, 3240) == FALSE then act(AddSpEffect, 19991) end -- Verdigris Talisman if env(GetSpEffectID, 19985) == TRUE then SetWeightIndex() if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_HEAVY then act(AddSpEffect, 19986) elseif GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT then act(AddSpEffect, 19987) elseif GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_MEDIUM then act(AddSpEffect, 19988) elseif GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_LIGHT then act(AddSpEffect, 19989) end end -- Euporia local isChangingWeaponRight = FALSE local isChangingWeaponLeft = FALSE if IsNodeActive("WeaponChangeStart_Selector00") == TRUE or IsNodeActive("WeaponChangeEnd_Selector00") == TRUE or IsNodeActive("WeaponChangeStart_Selector01") == TRUE or IsNodeActive("WeaponChangeEnd_Selector01") == TRUE or IsNodeActive("RideWeaponChangeStart_Selector") == TRUE or IsNodeActive("RideWeaponChangeEnd_Selector") == TRUE then if GetVariable("WeaponChangeType") <= WEAPON_CHANGE_REQUEST_RIGHT_SPEAR and GetVariable("WeaponChangeType") ~= WEAPON_CHANGE_REQUEST_INVALID then isChangingWeaponRight = TRUE else isChangingWeaponLeft = TRUE end end if env(GetSpEffectID, 19875) == TRUE then if isChangingWeaponLeft == FALSE and (c_Style == HAND_RIGHT or c_Style == HAND_LEFT_BOTH) and env(GetSwordArtID, HAND_LEFT) == 328 then act(AddSpEffect, 19887) end if isChangingWeaponRight == FALSE and (c_Style == HAND_RIGHT or c_Style == HAND_RIGHT_BOTH) and env(GetSwordArtID, HAND_RIGHT) == 328 then act(AddSpEffect, 19883) end elseif env(GetSpEffectID, 19874) == TRUE then if isChangingWeaponLeft == FALSE and (c_Style == HAND_RIGHT or c_Style == HAND_LEFT_BOTH) and env(GetSwordArtID, HAND_LEFT) == 328 then act(AddSpEffect, 19885) end if isChangingWeaponRight == FALSE and (c_Style == HAND_RIGHT or c_Style == HAND_RIGHT_BOTH) and env(GetSwordArtID, HAND_RIGHT) == 328 then act(AddSpEffect, 19881) end end if env(GetSpEffectID, 102380) == TRUE then act(AddSpEffect, 102381) end ImportModules() ModdedUpdate() g_FrameCount = g_FrameCount + 1 end function CopyLocalMatrix(source, dest) local sourceMatrix = hkbGetBoneLocalSpace(source) hkbSetBoneLocalSpace(dest, sourceMatrix) end function CopyModelMatrix(source, dest) local sourceMatrix = hkbGetBoneModelSpace(source) hkbSetBoneModelSpace(dest, sourceMatrix) end function CalculateFootTarget2(source, YaxisOffset, dest) local sourceMatrix = hkbGetBoneModelSpace(dest) local sourcePosition = hkbGetBoneModelSpace(source):getTranslation() sourcePosition[1] = sourcePosition[1] + YaxisOffset sourceMatrix:setTranslation(sourcePosition) hkbSetBoneModelSpace(dest, sourceMatrix) end function Master_Layer_onGenerate() local offset = 0.866 CalculateFootTarget2("L_Foot", offset, "L_Foot_Target2") CopyModelMatrix("L_Foot", "L_Foot_Target") CalculateFootTarget2("R_Foot", offset, "R_Foot_Target2") CopyModelMatrix("R_Foot", "R_Foot_Target") end function ModifiersLayer_onGenerate() CopyLocalMatrix("Neck", "Collar") end ---------------------------------------- -- Torrent ---------------------------------------- function Ride_Activate() end function Ride_Update() if IsEnableFeedAddBlend == TRUE then Ride_Feed_Rate = 1 act(ApplyRideBlend, "Ride_Feed_AddBlend", 1) else Ride_Feed_Rate = ConvergeValue(0, Ride_Feed_Rate, 4, 4) act(ApplyRideBlend, "Ride_Feed_AddBlend", Ride_Feed_Rate) end if RIDE_ISENABLE_DOUBLEJUMP == FALSE and env(IsMountInFallLoop) == TRUE then RIDE_ISENABLE_DOUBLEJUMP = TRUE end end function Ride_Deactivate() if IsNodeActive("Jump_RideOff LayerGenerator") == FALSE then act(Dismount) end end function Ride_NoThrow_Activate() SetThrowInvalid() end function Ride_NoThrow_Update() SetThrowInvalid() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end function ExecRide() if env(IsSummoningRide) == TRUE then SetVariable("RideOnSummonTest", 1) FireRideEvent("W_RideOn", "W_RideOn", FALSE) return TRUE elseif env(ActionRequest, ACTION_ARM_RIDEON) == TRUE then act(Mounting) return TRUE end return FALSE end function FireRideEvent(upper_event, lower_event, lower_only) if lower_only == TRUE then act(PlayRideAnim, lower_event) else ExecEventAllBody(upper_event) act(PlayRideAnim, lower_event) end end function FireRideEventNoReset(upper_event, lower_event, lower_only) if lower_only == TRUE then act(PlayRideAnim, lower_event) else ExecEventNoReset(upper_event) act(PlayRideAnim, lower_event) end end -- Torrent Dismount function ExecRideOff(is_force, rideOffAnyway) if is_force == FALSE and env(ActionRequest, ACTION_ARM_L3) == FALSE then return FALSE end if is_force == FALSE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ResetRequest() return FALSE end local unhorseDir = -1 if env(GetMountReceivedDamageDirection, 2) == TRUE then unhorseDir = 2 elseif env(GetMountReceivedDamageDirection, 3) == TRUE then unhorseDir = 3 elseif env(GetMountReceivedDamageDirection, 1) == TRUE then unhorseDir = 1 end if unhorseDir < 0 then if rideOffAnyway == FALSE then return FALSE else unhorseDir = 2 end end local event = "W_RideOff" local event_under = "W_RideOff" if env(GetSpEffectID, 19995) == TRUE then event = "W_RideDamage_Fall_AbyssalForest" event_under = "W_RideDamage_Fall_AbyssalForest" elseif GetVariable("MoveSpeedLevel") >= 0.9 and rideOffAnyway ~= TRUE then event = "W_Jump_RideOff" if GetVariable("MoveSpeedLevel") >= 1.5 or 1 <= GetVariable("ToggleDash") then event_under = "W_RideOffGallop" SetVariable("RideOff_Jump_Speed", 1) else event_under = "W_RideOffDash" SetVariable("RideOff_Jump_Speed", 0) end local style = c_Style if style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 0) elseif style == HAND_RIGHT_BOTH then SetVariable("JumpAttack_HandCondition", 1) elseif style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 4) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) SetVariable("IsEnableDirectionJumpTAE", true) if GetVariable("IsEnableToggleDashTest") == 2 then SetVariable("ToggleDash", 0) end elseif unhorseDir == 2 then SetVariable("Int16Variable02", 0) elseif unhorseDir == 3 then SetVariable("Int16Variable02", 1) elseif unhorseDir == 1 then SetVariable("Int16Variable02", 2) end FireRideEvent(event, event_under, FALSE) return TRUE end function RideReActionFunction() local isEnableForceRideOff = FALSE if env(IsAutomaticTesting) == TRUE then if env(InNoRidingArea) == TRUE and env(IsRidingPcMount) == TRUE and env(IsMountInFallLoop) == TRUE then isEnableForceRideOff = TRUE end elseif (env(InNoRidingArea) == TRUE or env(IsMultiplayer) == TRUE or env(GetSpEffectType, 433) == TRUE) and env(IsRidingPcMount) == TRUE and env(IsMountInFallLoop) == TRUE then isEnableForceRideOff = TRUE end if isEnableForceRideOff == TRUE then ExecRideOff(TRUE, TRUE) if env(GetSpEffectID, 19995) == FALSE then act(AddSpEffect, 181) end return TRUE end if ExecRideDeath() == TRUE then return TRUE end if ExecRideDamage() == TRUE then return TRUE end if ExecRideEventAnim() == TRUE then return TRUE end return FALSE end function ExecRideDeath() if env(GetDamageSpecialAttribute, 3) == TRUE then SetVariable("IndexRideDeath", RIDE_DEATH_TYPE_STONE) BlightpoleOffHandler() FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return TRUE elseif env(GetHP) <= 0 then if env(GetDamageSpecialAttribute, 6) == TRUE or env(GetSpecialAttribute) == 25 then SetVariable("IndexRideDeath", RIDE_DEATH_TYPE_MAD) else SetVariable("IndexRideDeath", RIDE_DEATH_TYPE_COMMON) end BlightpoleOffHandler() FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return TRUE elseif env(IsMountDead) <= 0 then FireRideEvent("W_RideDamage_Fall", "W_RideDeath", FALSE) return TRUE end return FALSE end function ExecRideDamage() local damage_level = env(GetDamageLevel) local damage_type = env(GetReceivedDamageType) local is_damaged = env(HasReceivedAnyDamage) local damage_angle = env(GetReceivedDamageDirection) local damage_level_under = env(GetMountDamageLevel) local damage_type_under = env(GetMountRecievedDamageType) local is_damaged_under = env(HasMountReceivedAnyDamage) local damage_angle_under = env(GetMountRecievedDamageAngle) if damage_type == DAMAGE_TYPE_PARRY then FireRideEvent("W_RideDamage_Fall", "W_RideRun_End", FALSE) return TRUE end if damage_type == DAMAGE_TYPE_WALL_RIGHT or damage_type == DAMAGE_TYPE_WALL_LEFT then if GetVariable("RideAttackHand") == HAND_LEFT then SetVariable("GuardDamageIndex", 2) else SetVariable("GuardDamageIndex", 0) end ExecEventAllBody("W_RideRepelledWall") return TRUE elseif damage_type == DAMAGE_TYPE_GUARDED or damage_type == DAMAGE_TYPE_GUARDED_LEFT then Replanning() if GetVariable("RideAttackHand") == HAND_LEFT then SetVariable("GuardDamageIndex", 2) else SetVariable("GuardDamageIndex", 0) end if damage_level == DAMAGE_LEVEL_NONE or damage_level == DAMAGE_LEVEL_MINIMUM or damage_level == DAMAGE_LEVEL_SMALL then SetVariable("DamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_RideRepelledSmall") return TRUE else act(SetDamageAnimType, DAMAGE_FLAG_LARGE) SetVariable("DamageDirection", 2) ExecEventAllBody("W_RideRepelledLarge") return TRUE end elseif damage_type == DAMAGE_TYPE_GUARD then if env(GetSpEffectID, 175) == TRUE then return FALSE end if env(GetSpEffectID, 176) == TRUE then return FALSE end FireRideEvent("W_Ride_SA_Add_Guard", "W_Ride_SA_Add", FALSE) SetVariable("Ride_SA_Add_Blend", 1) act(ApplyRideBlend, "Ride_SA_Add_Blend", 1) return FALSE elseif damage_type == DAMAGE_TYPE_GUARDBREAK then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) SetVariable("DamageDirection", 2) ExecEventAllBody("W_RideRepelledLarge") return TRUE end if env(IsMountFalling) == TRUE then FireRideEvent("W_RideFall_Start", "W_RideFall_Start", FALSE) return TRUE end if env(GetPoise) <= 0 and (damage_level > DAMAGE_LEVEL_NONE or damage_level_under > DAMAGE_LEVEL_NONE) and (is_damaged == TRUE or is_damaged_under == TRUE) then FireRideEvent("W_RideDamage_Fall", "W_RideRun_End", FALSE) return TRUE end if env(GetDamageSpecialAttribute, 5) == TRUE then FireRideEvent("W_RideDamage_Fall", "W_RideRun_End", FALSE) return TRUE end if env(GetDamageSpecialAttribute, 6) == TRUE then FrenzyProcHandler(true) Replanning() return TRUE end if env(GetSpEffectType, 32) == TRUE then FireRideEvent("W_RideDamageBind_Start", "W_RideDeath", FALSE) Replanning() return TRUE end if (env(GetSpecialAttribute) == 5 or env(GetMountSpecialAttribute) == 5) and GetVariable("MoveSpeedLevel") > 1.5 then SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 1) act(ApplyRideBlend, "RideDamageDefaultState", 1) act(ApplyDamageFlag, DAMAGE_FLAG_MIDDLE) Replanning() FireRideEvent("W_RideDamageMiddle", "W_Ride_DamageMiddle", FALSE) return TRUE elseif env(GetSpecialAttribute) == 8 or env(GetMountSpecialAttribute) == 8 then SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 1) act(ApplyRideBlend, "RideDamageDefaultState", 1) act(ApplyDamageFlag, DAMAGE_FLAG_MIDDLE) Replanning() FireRideEvent("W_RideDamageMiddle", "W_Ride_DamageMiddle", FALSE) return TRUE end if (env(GetDamageSpecialAttribute, 2) == TRUE and env(GetSpEffectID, 1499100) == FALSE) -- Blood Revelry or env(GetDamageSpecialAttribute, 4) == TRUE or env(GetSpEffectID, 1638001) == TRUE or env(GetSpEffectID, 1638140) == TRUE then -- Fiendish Ritual if damage_level == DAMAGE_LEVEL_NONE then damage_level = DAMAGE_LEVEL_SMALL elseif damage_level ~= DAMAGE_LEVEL_SMALL and damage_level ~= DAMAGE_LEVEL_MIDDLE and damage_level == DAMAGE_LEVEL_MINIMUM then end end if damage_level <= DAMAGE_LEVEL_NONE and damage_level_under <= DAMAGE_LEVEL_NONE and (is_damaged == FALSE and is_damaged_under == FALSE or env(IsPartDamageAdditiveBlendInvalid) == TRUE) and (damage_type == DAMAGE_TYPE_INVALID or damage_type == DAMAGE_TYPE_WEAK_POINT or damage_type == DAMAGE_LEVEL_MINIMUM) and (damage_type_under == DAMAGE_TYPE_INVALID or damage_type_under == DAMAGE_TYPE_WEAK_POINT or damage_type_under == DAMAGE_LEVEL_MINIMUM) then return FALSE end SetVariable("BlendRideDamageFire", 0) act(ApplyRideBlend, "BlendRideDamageFire", 0) SetVariable("Ride_SA_Add_Blend", 0) act(ApplyRideBlend, "Ride_SA_Add_Blend", 0) if env(GetSpecialAttribute) == 5 or env(GetSpecialAttribute) == 8 or env(GetMountSpecialAttribute) == 5 or env(GetMountSpecialAttribute) == 8 then return FALSE end if env(GetIsWeakPoint) == TRUE then SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) act(ApplyDamageFlag, DAMAGE_FLAG_WEAK) FireRideEvent("W_RideDamageWeakTop", "W_Ride_DamageWeakTop", FALSE) Replanning() return TRUE elseif env(GetMountIsWeakPoint) == TRUE then SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) act(ApplyDamageFlag, DAMAGE_FLAG_WEAK) FireRideEvent("W_RideDamageWeakUnder", "W_Ride_DamageWeakUnder", FALSE) Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_EXLARGE or damage_level == DAMAGE_LEVEL_SMALL_BLOW or damage_level == DAMAGE_LEVEL_UPPER or damage_level == DAMAGE_LEVEL_EX_BLAST or damage_level == DAMAGE_LEVEL_BREATH or damage_level_under == DAMAGE_LEVEL_EXLARGE or damage_level_under == DAMAGE_LEVEL_SMALL_BLOW or damage_level_under == DAMAGE_LEVEL_UPPER or damage_level_under == DAMAGE_LEVEL_EX_BLAST or damage_level_under == DAMAGE_LEVEL_BREATH then local damage_angle_real = damage_angle if damage_level <= DAMAGE_LEVEL_NONE then damage_angle_real = damage_angle_under end SetVariable("DamageDirection", damage_angle_real) act(ApplyRideBlend, "DamageDirection", damage_angle_real) act(ApplyDamageFlag, DAMAGE_FLAG_LARGE_BLOW) FireRideEvent("W_RideDamageExLarge", "W_Ride_DamageExLarge", FALSE) Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_LARGE or damage_level == DAMAGE_LEVEL_FLING or damage_level_under == DAMAGE_LEVEL_LARGE or damage_level_under == DAMAGE_LEVEL_FLING then if env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE or env(GetMountSpecialAttribute) == DAMAGE_ELEMENT_FIRE then SetVariable("BlendRideDamageFire", 1) act(ApplyRideBlend, "BlendRideDamageFire", 1) act(ApplyRideBlend, "IndexFireRideDamageVariation", 0) FireRideEvent("W_RideFireMiddleDamageBlend_Add", "W_Ride_FireMiddleDamageBlend_Add", FALSE) end SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 2) act(ApplyRideBlend, "RideDamageDefaultState", 2) act(ApplyDamageFlag, DAMAGE_FLAG_LARGE) FireRideEvent("W_RideDamageLarge", "W_Ride_DamageLarge", FALSE) Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_PUSH or damage_level_under == DAMAGE_LEVEL_MIDDLE or damage_level_under == DAMAGE_LEVEL_PUSH then if env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE or env(GetMountSpecialAttribute) == DAMAGE_ELEMENT_FIRE then SetVariable("BlendRideDamageFire", 1) act(ApplyRideBlend, "BlendRideDamageFire", 1) act(ApplyRideBlend, "IndexFireRideDamageVariation", 0) FireRideEvent("W_RideFireMiddleDamageBlend_Add", "W_Ride_FireMiddleDamageBlend_Add", FALSE) end SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 1) act(ApplyRideBlend, "RideDamageDefaultState", 1) act(ApplyDamageFlag, DAMAGE_FLAG_MEDIUM) FireRideEvent("W_RideDamageMiddle", "W_Ride_DamageMiddle", FALSE) Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_SMALL or damage_level_under == DAMAGE_LEVEL_SMALL then if env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE or env(GetMountSpecialAttribute) == DAMAGE_ELEMENT_FIRE then SetVariable("BlendRideDamageFire", 1) act(ApplyRideBlend, "BlendRideDamageFire", 1) act(ApplyRideBlend, "IndexFireRideDamageVariation", 0) FireRideEvent("W_RideFireSmallDamageBlend_Add", "W_Ride_FireSmallDamageBlend_Add", FALSE) end SetVariable("DamageDirection", 2) act(ApplyRideBlend, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 0) act(ApplyRideBlend, "RideDamageDefaultState", 0) act(ApplyDamageFlag, DAMAGE_FLAG_SMALL) FireRideEvent("W_RideDamageSmall", "W_Ride_DamageSmall", FALSE) Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_NONE or damage_level == DAMAGE_LEVEL_MINIMUM or damage_level_under == DAMAGE_LEVEL_NONE or damage_level_under == DAMAGE_LEVEL_MINIMUM then local index = 0 SetVariable("IndexRide_SA_Add_Random", index) act(ApplyRideBlend, "IndexRide_SA_Add_Random", index) act(ApplyDamageFlag, DAMAGE_FLAG_MINIMUM) FireRideEvent("W_Ride_SA_Add", "W_Ride_SA_Add", FALSE) SetVariable("Ride_SA_Add_Blend", 1) act(ApplyRideBlend, "Ride_SA_Add_Blend", 1) end return FALSE end function RideFallCommonFunction() local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return TRUE end if env(ActionRequest, 6) == TRUE and env(GetSpEffectID, 100902) == TRUE and RIDE_ISENABLE_DOUBLEJUMP == TRUE then local height = env(GetMountFallHeight) / 100 if env(GetStamina) <= 0 or height > DISABLEJUMP_FALLDIST then ResetRequest() else if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end if GetVariable("MoveSpeedLevel") >= 1.5 then FireRideEvent("W_RideJump2_D", "W_RideJump2_D", FALSE) elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideJump2_F", "W_RideJump2_F", FALSE) else FireRideEvent("W_RideJump2_N", "W_RideJump2_N", FALSE) end end RIDE_ISENABLE_DOUBLEJUMP = FALSE return TRUE end return FALSE end function RideRequestFunction(ride_move_type, enable_turn, lower_only) if env(IsOnMount) == FALSE then act(Dismount) ExecEventAllBody("W_Idle") return TRUE end if enable_turn == TRUE then if GetVariable("MoveSpeedLevel") >= 0.9 then SetVariable("Int16Variable01", 1) else SetVariable("Int16Variable01", 0) end local turn_angle = GetVariable("TurnAngle") if math.abs(turn_angle) >= 135 and RIDE_TURN_STATE == 0 then if turn_angle < 0 then FireRideEvent("W_RideTurn_Left180", "W_RideTurn_Left180", FALSE) else FireRideEvent("W_RideTurn_Right180", "W_RideTurn_Right180", FALSE) end return TRUE end end if ExecRideStop(ride_move_type, lower_only) == TRUE then if lower_only == FALSE then return TRUE else return FALSE end end local move_speed_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local next_ride_move_type = RIDE_MOVE_TYPE_IDLE -- Out of Stamina: limit move speed if env(GetSpEffectID, 100020) == TRUE and move_speed_level > 1 then move_speed_level = 1 end if math.abs(move_angle) <= 45 then -- Gallop if move_speed_level > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP -- Dash elseif move_speed_level > 0.6 then next_ride_move_type = RIDE_MOVE_TYPE_DASH -- Idle elseif move_speed_level > 0 then next_ride_move_type = RIDE_MOVE_TYPE_WALK else next_ride_move_type = RIDE_MOVE_TYPE_IDLE end end if ride_move_type ~= next_ride_move_type or env(GetMountSpEffectID, 101008) == TRUE then if next_ride_move_type == RIDE_MOVE_TYPE_IDLE then if GetVariable("IsEnableToggleDashTest") == 4 then SetVariable("ToggleDash", 0) end if env(GetMountSpEffectID, 101005) == FALSE and env(GetMountSpEffectID, 101006) == FALSE and env(GetMountSpEffectID, 101007) == FALSE then FireRideEvent("W_RideIdle", "W_RideIdle", lower_only) else return FALSE end elseif next_ride_move_type == RIDE_MOVE_TYPE_WALK then if GetVariable("IsEnableToggleDashTest") == 4 then SetVariable("ToggleDash", 0) end FireRideEvent("W_RideWalk", "W_RideWalk", lower_only) elseif next_ride_move_type == RIDE_MOVE_TYPE_DASH then if env(GetSpEffectID, 100901) == TRUE and (ride_move_type == RIDE_MOVE_TYPE_IDLE or ride_move_type == RIDE_MOVE_TYPE_OTHER) and lower_only == TRUE then FireRideEvent("W_RideDash", "W_RideRun", lower_only) else FireRideEvent("W_RideDash", "W_RideDash", lower_only) end elseif env(GetSpEffectID, 100901) == TRUE and (ride_move_type == RIDE_MOVE_TYPE_IDLE or ride_move_type == RIDE_MOVE_TYPE_OTHER) and lower_only == TRUE then FireRideEvent("W_RideDash", "W_RideRun", lower_only) else FireRideEvent("W_RideGallop", "W_RideGallop", lower_only) end if lower_only == FALSE then return TRUE end end return FALSE end function ExecRideStop(ride_move_type, lower_only) local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level > 0 then return FALSE end if env(GetMountSpEffectID, 101005) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101007) == TRUE then return FALSE end local stop_speed_type = ride_move_type if ride_move_type == RIDE_MOVE_TYPE_IDLE or ride_move_type == RIDE_MOVE_TYPE_OTHER then if env(GetMountSpEffectID, 101000) == TRUE then stop_speed_type = RIDE_MOVE_TYPE_WALK elseif env(GetMountSpEffectID, 101001) == TRUE then stop_speed_type = RIDE_MOVE_TYPE_DASH elseif env(GetMountSpEffectID, 101002) == TRUE then stop_speed_type = RIDE_MOVE_TYPE_GALLOP end end if stop_speed_type == RIDE_MOVE_TYPE_IDLE or stop_speed_type == RIDE_MOVE_TYPE_OTHER then return FALSE end if stop_speed_type == RIDE_MOVE_TYPE_WALK then FireRideEvent("W_RideWalk_End", "W_RideWalk_End", lower_only) elseif stop_speed_type == RIDE_MOVE_TYPE_DASH then FireRideEvent("W_RideDash_End", "W_RideDash_End", lower_only) else FireRideEvent("W_RideGallop_End", "W_RideGallop_End", lower_only) end return TRUE end function ExecRideAttack(r1, r2, l1, l2) local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local is_arrow = GetEquipType(attackHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_CROSSBOW) local is_staff = GetEquipType(attackHand, WEAPON_CATEGORY_STAFF) local is_weaponStaff = FALSE if IsWeaponCatalyst(attackHand, true) == TRUE then is_weaponStaff = TRUE end if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return FALSE end if env(GetStamina) < 0 then ResetRequest() return FALSE end if env(ActionRequest, 0) == TRUE and is_staff == FALSE or env(ActionRequest, 1) == TRUE and is_staff == TRUE then act(ResetInputQueue) SetVariable("RideAttackHand", HAND_RIGHT) if is_arrow == TRUE then if GetEquipType(attackHand, WEAPON_CATEGORY_CROSSBOW) == TRUE and env(GetBoltLoadingState, attackHand) == FALSE then if attackHand == HAND_LEFT then ExecEventAllBody("W_RideAttackCrossbowLeftReload") else ExecEventAllBody("W_RideAttackCrossbowRightReload") end return TRUE end g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if env(IsOutOfAmmo, attackHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ShotArrow() ExecEventAllBody("W_RideAttackArrowStart") return TRUE end ExecEventAllBody(r1) elseif env(ActionRequest, 1) == TRUE and is_weaponStaff == FALSE then act(ResetInputQueue) SetVariable("RideAttackHand", HAND_RIGHT) if is_arrow == TRUE then if GetEquipType(attackHand, WEAPON_CATEGORY_CROSSBOW) == TRUE and env(GetBoltLoadingState, attackHand) == FALSE then if attackHand == HAND_LEFT then ExecEventAllBody("W_RideAttackCrossbowLeftReload") else ExecEventAllBody("W_RideAttackCrossbowRightReload") end return TRUE end g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if env(IsOutOfAmmo, attackHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ShotArrow() ExecEventAllBody("W_RideAttackArrowStart") return TRUE elseif GetEquipType(attackHand, WEAPON_CATEGORY_STAFF) == TRUE then return FALSE end ExecEventAllBody(r2) elseif env(ActionRequest, 2) == TRUE or env(ActionRequest, 3) == TRUE and is_staff == TRUE then act(ResetInputQueue) SetVariable("RideAttackHand", HAND_LEFT) if is_arrow == TRUE then return FALSE end ExecEventAllBody(l1) elseif env(ActionRequest, 3) == TRUE then act(ResetInputQueue) SetVariable("RideAttackHand", HAND_LEFT) if is_arrow == TRUE then return FALSE end ExecEventAllBody(l2) else return FALSE end WeaponAttackDetection() SetInterruptType(INTERRUPT_FINDATTACK) return TRUE end function ExecRideItem() if c_HasActionRequest == FALSE then return FALSE end local hand = HAND_RIGHT local kind = env(GetEquipWeaponCategory, hand) if kind == WEAPON_CATEGORY_BACKHAND_SWORD then SetVariable("ItemWeaponType", 1) elseif kind == WEAPON_CATEGORY_DUELING_SHIELD then SetVariable("ItemWeaponType", 2) else SetVariable("ItemWeaponType", 0) end if env(ActionRequest, ACTION_ARM_USE_ITEM) == FALSE then return FALSE end if env(IsItemUseMenuOpened) == TRUE then return FALSE end if env(IsItemUseMenuOpening) == TRUE then ResetRequest() act(OpenMenuWhenUsingItem) return TRUE end act(UseItemDecision) local item_type = env(GetItemAnimType) local is_combo = env(GetSpEffectID, 100800) if is_combo == TRUE and item_type ~= ITEM_NIGHT_BELL then return FALSE end local pre_item_type = GetVariable("PreItemType") SetVariable("PreItemType", item_type) if item_type == ITEM_DRINK then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then ExecEventAllBody("W_RideItemDrinkNothing") elseif IsNodeActive("RideItemDrinking_CMSG") == TRUE and pre_item_type == ITEM_DRINK then ExecEventAllBody("W_RideItemDrinking") else ExecEventAllBody("W_RideItemDrinkStart") end elseif item_type == ITEM_DRINK_MP then if env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then ExecEventAllBody("W_RideItemDrinkNothing") elseif IsNodeActive("RideItemDrinking_CMSG") == TRUE and pre_item_type == ITEM_DRINK_MP then ExecEventAllBody("W_RideItemDrinking") else ExecEventAllBody("W_RideItemDrinkStart") end elseif item_type == ITEM_SUMMONHORSE then ExecRideOff(TRUE, FALSE) elseif item_type == ITEM_MEGANE then if env(GetStateChangeType, 15) == TRUE then ExecEventAllBody("W_RideItemMeganeEnd") else ExecEventAllBody("W_RideItemMeganeStart") end elseif item_type == 27 then if env(GetSpEffectID, 3245) == TRUE then ExecEventAllBody("W_RideItemLanternOff") else SetVariable("IndexItemUseAnim", item_type) ExecEventAllBody("W_RideItemOneShot") end elseif item_type == ITEM_ELIXIR then ExecEventAllBody("W_RideItemElixir") elseif item_type == ITEM_QUICK_THROW_KNIFE then if IsNodeActive("RideItemQuick1_CMSG") == TRUE or IsNodeActive("RideItemQuick3_CMSG") == TRUE then ExecEventAllBody("W_RideItemQuick2") elseif IsNodeActive("RideItemQuick2_CMSG") == TRUE then ExecEventAllBody("W_RideItemQuick3") else ExecEventAllBody("W_RideItemQuick1") end elseif item_type == ITEM_NIGHT_BELL then if is_combo == TRUE then ExecEventAllBody("W_RideItemCombo") else SetVariable("IndexItemUseAnim", item_type) ExecEventAllBody("W_RideItemOneShot") end elseif item_type == ITEM_NO_DRINK then if IsNodeActive("RideItemDrinking_CMSG") == TRUE then ExecEventAllBody("W_RideItemDrinkEmpty") else ExecEventAllBody("W_RideItemDrinkStart") end elseif item_type == ITEM_INVALID then ExecEventAllBody("W_RideItemInvalid") else SetVariable("IndexItemUseAnim", item_type) ExecEventAllBody("W_RideItemOneShot") end act(ApplyRideBlend, "Ride_Feed_AddBlend", 0) act(SetIsItemAnimationPlaying) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecRideMagic() if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, TRUE) == TRUE then return TRUE else return FALSE end end function ExecRideGesture() if c_HasActionRequest == FALSE then return FALSE end if env(ActionRequest, ACTION_ARM_GESTURE) == FALSE then return FALSE else ResetRequest() return FALSE end local request = env(GetGestureRequestNumber) if request == INVALID then return FALSE end local isloop = FALSE local upper_only = TRUE if request == 9 then elseif request == 1 then upper_only = FALSE end if isloop == TRUE then SetVariable("IndexGesture", request) ExecEventAllBody("W_RideGesture") return TRUE elseif upper_only == FALSE then SetVariable("IndexGesture", request) act(ApplyRideBlend, "IndexGesture", request) FireRideEvent("W_RideGesture", "W_RideGesture") else SetVariable("IndexGesture", request) ExecEventAllBody("W_RideGestureUpper") return TRUE end return FALSE end function ExecRideWeaponChange(blend_type) local startkind = WEAPON_CHANGE_REQUEST_INVALID local endKind = WEAPON_CHANGE_REQUEST_INVALID if env(ActionRequest, ACTION_ARM_CHANGE_WEAPON_R) == TRUE then startkind = GetWeaponChangeType(HAND_RIGHT) endKind = GetWeaponChangeType(HAND_RIGHT) elseif env(ActionRequest, ACTION_ARM_CHANGE_WEAPON_L) == TRUE then if c_Style == HAND_LEFT_BOTH then startkind = GetWeaponChangeType(HAND_LEFT) + 4 endKind = GetWeaponChangeType(HAND_RIGHT) + 8 else startkind = GetWeaponChangeType(HAND_LEFT) endKind = GetWeaponChangeType(HAND_LEFT) end else return FALSE end if startkind == WEAPON_CHANGE_REQUEST_INVALID then return FALSE end if env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE then ResetRequest() return FALSE end SetVariable("WeaponChangeType", startkind) SetVariable("RideWeaponChangeEndType", endKind) ExecEventAllBody("W_RideWeaponChangeStart") act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecRideHandChange(hand, is_force) if is_force == FALSE then if c_HasActionRequest == FALSE or env(IsPrecisionShoot) == TRUE then return FALSE end if env(IsCOMPlayer) == TRUE then if env(ActionRequest, ACTION_ARM_CHANGE_STYLE_R) == TRUE then elseif env(ActionRequest, ACTION_ARM_CHANGE_STYLE_L) == TRUE then hand = HAND_LEFT else return FALSE end elseif env(ActionDuration, ACTION_ARM_ACTION) <= 0 then return FALSE elseif env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_RIGHT or c_Style == HAND_RIGHT_BOTH then hand = HAND_LEFT else hand = HAND_RIGHT end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionRequest, ACTION_ARM_L2) == TRUE then if c_Style == HAND_RIGHT or c_Style == HAND_RIGHT_BOTH then hand = HAND_LEFT else hand = HAND_RIGHT end else return FALSE end end if env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE then ResetRequest() return FALSE end local style = c_Style local kind = GetHandChangeType(HAND_RIGHT) local leftKind = GetHandChangeType(HAND_LEFT) local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if style == HAND_RIGHT or style == HAND_RIGHT_BOTH then if hand == HAND_RIGHT then return FALSE else if env(IsTwoHandPossible, HAND_LEFT) == FALSE then return FALSE end local firstKind = RIDE_RIGHT_TO_WAIST local endKind = RIDE_BOTHLEFT_FROM_WAIST if kind == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then firstKind = RIDE_RIGHT_TO_WAIST elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_BACK then firstKind = RIDE_RIGHT_TO_BACK elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then firstKind = RIDE_RIGHT_TO_SHOULDER else firstKind = RIDE_RIGHT_TO_SPEAR end if leftKind == WEAPON_CHANGE_REQUEST_LEFT_WAIST then endKind = RIDE_BOTHLEFT_FROM_WAIST elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_BACK then endKind = RIDE_BOTHLEFT_FROM_BACK elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then endKind = RIDE_BOTHLEFT_FROM_SHOULDER else endKind = RIDE_BOTHLEFT_FROM_SPEAR end act(DebugLogOutput, "RideHandChange ToBothLeft start=" .. firstKind .. " end" .. endKind) SetHandChangeStyle(firstKind, endKind) act(Unknown9999, 2) end elseif style == HAND_LEFT_BOTH then local firstKind = RIDE_LEFT_TO_WAIST local endKind = RIDE_RIGHT_FROM_LEFTWAIST_FROM_MIDDLE if leftKind == WEAPON_CHANGE_REQUEST_LEFT_WAIST then firstKind = RIDE_LEFT_TO_WAIST elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_BACK then firstKind = RIDE_LEFT_TO_BACK elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then firstKind = RIDE_LEFT_TO_SHOULDER else firstKind = RIDE_LEFT_TO_SPEAR end if kind == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then endKind = RIDE_RIGHT_FROM_LEFTWAIST_FROM_MIDDLE elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_BACK then endKind = RIDE_RIGHT_FROM_RIGHTBACK_FROM_MIDDLE elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then endKind = RIDE_RIGHT_FROM_RIGHTSHOULDER_FROM_MIDDLE else endKind = RIDE_RIGHT_FROM_RIGHTSPEAR_FROM_MIDDLE end SetHandChangeStyle(firstKind, endKind) act(Unknown9999, 1) end ExecEventAllBody("W_RideHandChangeStart") act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function RideWeaponChangeStart_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideWeaponChangeStart_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideReActionFunction() == TRUE then return end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_RideWeaponChangeEnd") end local lower_only = TRUE if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, lower_only) == TRUE then return end end function RideWeaponChangeStart_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideWeaponChangeEnd_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideWeaponChangeEnd_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideReActionFunction() == TRUE then return end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideWeaponChangeEnd_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideHandChangeStart_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideHandChangeStart_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_RideHandChangeEnd") return end end function RideHandChangeStart_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideHandChangeEnd_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideHandChangeEnd_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideReActionFunction() == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsMoveCancelPossible) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideHandChangeEnd_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function IsEnableRideAttackHard2(hand) local style = c_Style if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local kind = env(GetEquipWeaponCategory, hand) if kind == WEAPON_CATEGORY_RAPIER or kind == WEAPON_CATEGORY_LARGE_RAPIER then return TRUE else return FALSE end end function RideGesture_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end function RideGestureUpper_onUpdate() SetAIActionState() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicLaunch_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_RideMagicFire") return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicLaunch_Upper_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_RideMagicFire") return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicFire_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local buttonR = ACTION_ARM_R1 local buttonL = ACTION_ARM_L1 if IsCasterAsh() == TRUE then buttonL = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand) == TRUE then buttonL = ACTION_ARM_L2 end if IsWeaponCatalyst(wep_hand, true) == TRUE then buttonR = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventAllBody("W_RideMagicFireCancel") return end if CheckIfHoldMagic() == TRUE and (env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 0) == TRUE) then if env(ActionDuration, buttonR) > 0 or (c_SwordArtsID == SPELLCASTING_ASH and env(ActionDuration, buttonL) > 0) then ExecEventAllBody("W_RideMagicLoop") return else ExecEventAllBody("W_RideMagicFireCancel") return end end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicLoop_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local buttonR = ACTION_ARM_R1 local buttonL = ACTION_ARM_L1 if IsCasterAsh() == TRUE then buttonL = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand) == TRUE then buttonL = ACTION_ARM_L2 end if IsWeaponCatalyst(wep_hand, true) == TRUE then buttonR = ACTION_ARM_R2 end if env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE or env(GetStamina) <= 0 then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventAllBody("W_RideMagicFireCombo1Cancel") else ExecEventAllBody("W_RideMagicFireCancel") end return end local lower_only = TRUE local enable_turn = FALSE if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicFireCancel_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicFireCombo1_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local buttonR = ACTION_ARM_R1 local buttonL = ACTION_ARM_L1 if IsCasterAsh() == TRUE then buttonL = ACTION_ARM_L2 elseif IsWeaponCatalyst(wep_hand) == TRUE then buttonL = ACTION_ARM_L2 end if IsWeaponCatalyst(wep_hand, true) == TRUE then buttonR = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventAllBody("W_RideMagicFireCombo1Cancel") return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicFireCombo1Cancel_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicFireCombo2_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local buttonR = ACTION_ARM_R1 local buttonL = ACTION_ARM_L1 if IsWeaponCatalyst(wep_hand) == TRUE then buttonL = ACTION_ARM_L2 end if IsWeaponCatalyst(wep_hand, true) == TRUE then buttonR = ACTION_ARM_R2 end if (env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE)) or _unchargableSpells[LastCastMagicID] then ExecEventAllBody("W_RideMagicFireCombo2Cancel") return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicFireCombo2Cancel_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideMagicInvalid_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideItemDrinkStart_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemDrinkStart_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local isEnd = env(IsAnimEnd, 1) if env(GetEventEzStateFlag, 0) == TRUE or isEnd == TRUE then local item_type = env(GetItemAnimType) if item_type ~= ITEM_NO_DRINK then ExecEventNoReset("W_RideItemDrinking") return elseif item_type == ITEM_NO_DRINK and isEnd == TRUE then ExecEventNoReset("W_RideItemDrinkEmpty") return end end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideItemDrinking_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemDrinking_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideItemDrinkEnd") return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideItemDrinkEnd_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemDrinkEnd_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideItemDrinkEmpty_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemDrinkEmpty_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemInvalid_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemInvalid_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemDrinkNothing_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemDrinkNothing_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemWhistle_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemWhistle_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemElixir_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemElixir_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemHorn_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemHorn_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemQuick1_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemQuick1_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemQuick2_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemQuick2_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemQuick3_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemQuick3_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemOneShot_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemOneShot_onUpdate() if GetVariable("PreItemType") == ITEM_HORSE_FEED then IsEnableFeedAddBlend = TRUE end act(SetIsItemAnimationPlaying) SetAIActionState() if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end local item_type = env(GetItemAnimType) if item_type == ITEM_DRAGONTHROWSPEAR and env(ActionDuration, ACTION_ARM_USE_ITEM) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEvent("W_RideItemDragonThrowSpearCancel") return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemOneShot_onDeactivate() IsEnableFeedAddBlend = FALSE end function RideItemDragonThrowSpearCancel_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemDragonThrowSpearCancel_onUpdate() act(SetIsItemAnimationPlaying) SetAIActionState() if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemLanternOff_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemLanternOff_onUpdate() act(SetIsItemAnimationPlaying) SetAIActionState() if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemCombo_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideItemCombo_onUpdate() act(SetIsItemAnimationPlaying) SetAIActionState() if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemMeganeStart_onUpdate() act(SetIsItemAnimationPlaying) SetAIActionState() if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideItemMeganeLoop_onUpdate() SetAIActionState() if env(GetStateChangeType, 15) == FALSE then act(SetIsItemAnimationPlaying) end if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideItemMeganeEnd_onUpdate() SetAIActionState() act(SetIsItemAnimationPlaying) if RideReActionFunction() == TRUE then return end if ExecRideItem() == TRUE then return TRUE end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideAdjust_onUpdate() act(SetAllowedThrowDefenseType, 255) if env(IsMovingOnMount) == TRUE then FireRideEvent("W_RideOn", "W_RideOn", FALSE) return TRUE elseif env(IsIdleOnMount) == TRUE then ExecEventAllBody("W_Idle") return TRUE end end function RideAdjustFromCalling_onUpdate() act(SetAllowedThrowDefenseType, 255) if env(IsMovingOnMount) == TRUE then if GetVariable("RideOnSummonTest") == 1 then FireRideEvent("W_RideOn", "W_RideOn", FALSE) else ExecEventAllBody("W_RideOn") end return TRUE elseif env(IsIdleOnMount) == TRUE then ExecEventAllBody("W_Idle") return TRUE end end function RideOn_onUpdate() act(ApplyRideBlend, "AddBlend02", 0) Ride_HeadDown_Rate = 0 act(SetAllowedThrowDefenseType, 255) SetAIActionState() SetVariable("Int16Variable01", 0) local lower_only = TRUE if env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE elseif env(GetEventEzStateFlag, 0) ~= TRUE then return end local move_speed_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local next_ride_move_type = RIDE_MOVE_TYPE_IDLE if math.abs(move_angle) <= 45 then if move_speed_level > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6 then next_ride_move_type = RIDE_MOVE_TYPE_DASH elseif move_speed_level > 0 then next_ride_move_type = RIDE_MOVE_TYPE_WALK else next_ride_move_type = RIDE_MOVE_TYPE_IDLE end end if next_ride_move_type == RIDE_MOVE_TYPE_IDLE then if lower_only == FALSE then FireRideEvent("W_RideIdle", "W_RideIdle", lower_only) end elseif next_ride_move_type == RIDE_MOVE_TYPE_WALK then FireRideEvent("W_RideWalk", "W_RideWalk", lower_only) elseif next_ride_move_type == RIDE_MOVE_TYPE_DASH then FireRideEvent("W_RideDash", "W_RideDash", lower_only) else FireRideEvent("W_RideGallop", "W_RideGallop", lower_only) end end function RideOnDash_onUpdate() act(SetAllowedThrowDefenseType, 255) SetAIActionState() SetVariable("Int16Variable01", 0) local lower_only = TRUE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE elseif env(GetEventEzStateFlag, 0) ~= TRUE then return end local move_speed_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local next_ride_move_type = RIDE_MOVE_TYPE_IDLE if math.abs(move_angle) <= 45 then if move_speed_level > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6 then next_ride_move_type = RIDE_MOVE_TYPE_DASH elseif move_speed_level > 0 then next_ride_move_type = RIDE_MOVE_TYPE_WALK else next_ride_move_type = RIDE_MOVE_TYPE_IDLE end end if next_ride_move_type == RIDE_MOVE_TYPE_IDLE then if lower_only == FALSE then FireRideEvent("W_RideIdle", "W_RideIdle", lower_only) end elseif next_ride_move_type == RIDE_MOVE_TYPE_WALK then FireRideEvent("W_RideWalk", "W_RideWalk", lower_only) elseif next_ride_move_type == RIDE_MOVE_TYPE_DASH then FireRideEvent("W_RideDash", "W_RideDash", lower_only) else FireRideEvent("W_RideGallop", "W_RideGallop", lower_only) end end function RideOff_onUpdate() act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_NORMAL) == TRUE then act(Dismount) return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then act(Dismount) ExecEventAllBody("W_Idle") return TRUE end end function RideIdle_onActivate() act(Wait) end function RideIdle_onUpdate() act(Wait) SetVariable("Int16Variable01", 0) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_IDLE, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then SetVariable("ToggleDash", 0) end end function RideWalk_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_WALK, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then SetVariable("ToggleDash", 0) end end function RideWalk_End_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) end if RideRequestFunction(RIDE_MOVE_TYPE_IDLE, TRUE, FALSE) == TRUE then return end end function RideDash_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_DASH, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then SetVariable("ToggleDash", 0) end end -- Initial Movement after "O" Press (approx 6 seconds) function RideDashAccelerate_onUpdate() act(Wait) SetEnableAimMode() if env(GetStamina) <= 0 then act(AddSpEffect, 100020) end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if ExecRideStop(RIDE_MOVE_TYPE_OTHER, FALSE) == TRUE then return end if (env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end -- Initial Movement after secondary "O" Press during Dash (approx 6 seconds) function RideDashAccelerateContinue_onUpdate() act(Wait) SetEnableAimMode() if env(GetStamina) <= 0 then act(AddSpEffect, 100020) end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if ExecRideStop(RIDE_MOVE_TYPE_OTHER, FALSE) == TRUE then return end if (env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideMoveStaminaConsume() if env(IsOnMount) == FALSE then return end if env(GetStamina) <= 0 then act(AddSpEffect, 100020) end -- Gallop if env(GetMountSpEffectID, 101002) == TRUE then act(SetStaminaRecoveryDisabled) local dT = GetDeltaTime() dash_dt_sum = dash_dt_sum + dT if dash_dt_sum > 0.065 then dash_dt_sum = 0 if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, -1) end end end end function RideDash_End_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) end if RideRequestFunction(RIDE_MOVE_TYPE_IDLE, TRUE, FALSE) == TRUE then return end end -- Sustained Movement after "O" Press function RideGallop_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_GALLOP, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then end end function RideGallop_End_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) end if RideRequestFunction(RIDE_MOVE_TYPE_IDLE, TRUE, FALSE) == TRUE then return end end function RideDamage_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamage_M_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamage_H_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideRepelledWall_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideRepelledSmall_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideRepelledLarge_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideDamageSmall_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamageMiddle_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamageLarge_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamageExLarge_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamageWeakTop_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideDamageWeakUnder_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if (env(MovementRequest) == TRUE or env(IsAnimEnd, 1) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function Ride_SA_Add_Default_onUpdate() SetVariable("Ride_SA_Add_Blend", 0) act(ApplyRideBlend, "BlendRidden_SA_Add", 0) end function RideFireDamageBlend_Default_onUpdate() SetVariable("BlendRideDamageFire", 0) act(ApplyRideBlend, "BlendRiddenDamageFire", 0) end function RideDamage_Fall_onUpdate() act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) act(Dismount) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return TRUE end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function RideDamage_Fall_AbyssalForest_onUpdate() act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return TRUE end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function RideDamage_Fall_AbyssalForest_onDeactivate() act(Dismount) end function RideDamageMad_onUpdate() act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) if env(GetSpecialAttribute) == 25 and 0 >= env(GetHP) and env(IsOnMount) == TRUE then SetVariable("IndexRideDeath", RIDE_DEATH_TYPE_MAD) FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end act(Dismount) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return TRUE end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function RideDamageBind_Start_onUpdate() act(SetIsMagicInUse, 0) act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) act(Dismount) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return TRUE end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_RideDamageBind_Loop") return end end function RideDamageBind_Loop_onUpdate() act(SetIsMagicInUse, 0) act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) act(Dismount) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return TRUE end if env(GetSpEffectType, 32) == FALSE then ExecEventAllBody("W_RideDamageBind_End") end end function RideDamageBind_End_onUpdate() act(SetIsMagicInUse, 0) act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) act(Dismount) if DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return TRUE end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_Idle") return end end function RideDeath_Idle_onActivate() act(SetDeathStay, TRUE) end function RideDeath_Idle_onDeactivate() act(SetDeathStay, FALSE) end function RideAttackCommonFunction(r1, r2, l1, l2) if RideCommonFunction(r1, r2, l1, l2) == TRUE then return TRUE end if c_Style == HAND_LEFT_BOTH then SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) else SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_RIGHT) end return FALSE end Ride_HighJump_Height = 0 Ride_HeadDown_Rate = 0 Ride_Feed_Rate = 0 IsEnableFeedAddBlend = FALSE function RideCommonFunction(r1, r2, l1, l2) Ride_HeadDown_Rate = EaseInOutVal(g_TimeActEditor_07, Ride_HeadDown_Rate, 0.8, 1.5, "EaseInOutStartVal1", "EaseInOutTargetVal1", "EaseInOutTimer1") act(ApplyRideBlend, "AddBlend02", Ride_HeadDown_Rate) if RideReActionFunction() == TRUE then return TRUE end if ExecRideDashAccelerate() == TRUE then return TRUE end if ExecRideWeaponChange() == TRUE then return TRUE end if ExecRideOff(FALSE, FALSE) == TRUE then return TRUE end local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local isShield = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD) -- Jumping if env(ActionRequest, 6) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) ~= 1 and env(GetSpEffectID, 100280) == FALSE or isShield == TRUE) then if env(GetStamina) <= 0 then ResetRequest() else local highJumpHeight = env(GetSpiritspringJumpHeight) -- Normal Spiritspring Jump if highJumpHeight > 0 then act(DebugLogOutput, "RideJumpHigh Height=" .. highJumpHeight .. "cm") Ride_HighJump_Height = highJumpHeight + 700 FireRideEvent("W_RideJumpHigh", "W_RideJumpHigh", FALSE) return TRUE end -- Normal Jump if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end if 1.5 <= GetVariable("MoveSpeedLevel") then FireRideEvent("W_RideJump_D", "W_RideJump_D", FALSE) elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideJump_F", "W_RideJump_F", FALSE) else FireRideEvent("W_RideJump_N", "W_RideJump_N", FALSE) end return TRUE end end if ExecRideHandChange(HAND_RIGHT, FALSE) == TRUE then return TRUE end if ExecRideMagic() == TRUE then return TRUE end if ExecRideAttack(r1, r2, l1, l2) == TRUE then return TRUE end if ExecRideItem() == TRUE then return TRUE end if ExecRideGesture() == TRUE then return TRUE end return FALSE end function ExecRideDashAccelerate() if env(GetStamina) <= 0 or env(GetSpEffectID, 100020) == TRUE then ResetRequest() return FALSE end local testControl = 3 if testControl == 2 or testControl == 12 then SetVariable("IsEnableToggleDashTest", 0) if env(ActionRequest, ACTION_ARM_ROLLING) == TRUE and env(GetStamina) <= 0 then ResetRequest() end local evasionRequest = GetEvasionRequest() if evasionRequest == ATTACK_REQUEST_ROLLING then if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) end if IsNodeActive("RideDashAccelerate CMSG") == TRUE or IsNodeActive("RideDashAccelerateContinue CMSG") == TRUE then FireRideEvent("W_RideDashAccelerateContinue", "W_RideDashAccelerateContinue", FALSE) else FireRideEvent("W_RideDashAccelerate", "W_RideDashAccelerate", FALSE) end return TRUE end elseif testControl == 3 or testControl == 13 then SetVariable("IsEnableToggleDashTest", 4) local evasionRequest = env(ActionRequest, ACTION_ARM_SP_MOVE) if evasionRequest == TRUE and env(GetStamina) <= 0 then ResetRequest() end if env(GetSpEffectID, 100903) == TRUE then return FALSE end -- "O" Pressed if evasionRequest == TRUE then if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) end SetVariable("ToggleDash", 1) if IsNodeActive("RideDashAccelerate CMSG") == TRUE or IsNodeActive("RideDashAccelerateContinue CMSG") == TRUE then FireRideEvent("W_RideDashAccelerateContinue", "W_RideDashAccelerateContinue", FALSE) else FireRideEvent("W_RideDashAccelerate", "W_RideDashAccelerate", FALSE) end return TRUE end else SetVariable("IsEnableToggleDashTest", 0) if RideDashAccelerateTest == 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then act(DebugLogOutput, "RideDashAccel") end local evasionRequest = env(ActionDuration, ACTION_ARM_SP_MOVE) if (env(IsStayState) == TRUE or env(IsGeneralAnimCancelPossible) == TRUE) and evasionRequest > 0 and 0 >= RideDashAccelerateTest and env(GetStamina) > 0 then if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) end if IsNodeActive("RideDashAccelerate CMSG") == TRUE or IsNodeActive("RideDashAccelerateContinue CMSG") == TRUE then FireRideEvent("W_RideDashAccelerateContinue", "W_RideDashAccelerateContinue", FALSE) else FireRideEvent("W_RideDashAccelerate", "W_RideDashAccelerate", FALSE) end return TRUE end RideDashAccelerateTest = env(ActionDuration, ACTION_ARM_SP_MOVE) if IsNodeActive("RideDashAccelerate CMSG") == FALSE and IsNodeActive("RideDashAccelerateContinue CMSG") == FALSE then if env(ActionRequest, ACTION_ARM_ROLLING) == TRUE and env(GetStamina) <= 0 then ResetRequest() end local evasionRequest = GetEvasionRequest() if evasionRequest == ATTACK_REQUEST_ROLLING and env(GetStamina) > 0 then if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) end if IsNodeActive("RideDashAccelerate CMSG") == TRUE or IsNodeActive("RideDashAccelerateContinue CMSG") == TRUE then FireRideEvent("W_RideDashAccelerateContinue", "W_RideDashAccelerateContinue", FALSE) else FireRideEvent("W_RideDashAccelerate", "W_RideDashAccelerate", FALSE) end return TRUE end end end return FALSE end function RideAttack_BackKick_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_BackKick_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end function RideAttack_BackKick_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Top_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_R_Top_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top02", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_R_Top_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Top02_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_R_Top02_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top03", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_R_Top02_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Top03_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_R_Top03_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_R_Top03_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Hard1_Start_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) SetVariable("RideAttack_JumpCondition", 0) end function RideAttack_R_Hard1_Start_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) local r2 = "W_RideAttack_R_Hard1_Start" if IsEnableRideAttackHard2(HAND_RIGHT) == TRUE and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 241 then r2 = "W_RideAttack_R_Hard2_Start" end if RideAttackCommonFunction("W_RideAttack_R_Top", r2, "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local isShield = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD) if env(ActionRequest, 6) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end SetVariable("RideJumpAttack_Land", 0) FireRideEvent("W_RideAttack_Jump_R_Hard1", jumpEvent, FALSE) return TRUE end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_RideAttack_R_Hard1_End") return end end function RideAttack_R_Hard1_Start_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Hard1_End_onActivate() act(ResetInputQueue) end function RideAttack_R_Hard1_End_onUpdate() act(DisallowAdditiveTurning, TRUE) local r2 = "W_RideAttack_R_Hard1_Start" if IsEnableRideAttackHard2(HAND_RIGHT) == TRUE and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 241 then r2 = "W_RideAttack_R_Hard2_Start" end if RideAttackCommonFunction("W_RideAttack_R_Top", r2, "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if env(GetSpEffectID, 131) == FALSE and (GetVariable("RideAttack_JumpCondition") == 0 or env(IsMoveCancelPossible) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_R_Hard1_End_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Hard2_Start_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) SetVariable("RideAttack_JumpCondition", 0) end function RideAttack_R_Hard2_Start_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local isShield = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD) if env(ActionRequest, 6) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end SetVariable("RideJumpAttack_Land", 0) FireRideEvent("W_RideAttack_Jump_R_Hard2", jumpEvent, FALSE) return TRUE end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_RideAttack_R_Hard2_End") return end end function RideAttack_R_Hard2_Start_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_R_Hard2_End_onActivate() act(ResetInputQueue) end function RideAttack_R_Hard2_End_onUpdate() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if env(GetSpEffectID, 131) == FALSE and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_R_Hard2_End_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Hard1_Start_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) SetVariable("RideAttack_JumpCondition", 0) end function RideAttack_L_Hard1_Start_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) local l2 = "W_RideAttack_L_Hard1_Start" if IsEnableRideAttackHard2(HAND_RIGHT) == TRUE and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 241 then l2 = "W_RideAttack_L_Hard2_Start" end if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", l2) == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local isShield = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD) if env(ActionRequest, 6) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end SetVariable("RideJumpAttack_Land", 0) FireRideEvent("W_RideAttack_Jump_L_Hard1", jumpEvent, FALSE) return TRUE end if env(ActionDuration, ACTION_ARM_L2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_RideAttack_L_Hard1_End") return end end function RideAttack_L_Hard1_Start_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Hard1_End_onActivate() act(ResetInputQueue) end function RideAttack_L_Hard1_End_onUpdate() act(DisallowAdditiveTurning, TRUE) local l2 = "W_RideAttack_L_Hard1_Start" if IsEnableRideAttackHard2(HAND_RIGHT) == TRUE and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 241 then l2 = "W_RideAttack_L_Hard2_Start" end if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", l2) == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if env(GetSpEffectID, 131) == FALSE and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_L_Hard1_End_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Hard2_Start_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) SetVariable("RideAttack_JumpCondition", 0) end function RideAttack_L_Hard2_Start_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local isShield = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD) if env(ActionRequest, 6) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end SetVariable("RideJumpAttack_Land", 0) FireRideEvent("W_RideAttack_Jump_L_Hard2", jumpEvent, FALSE) return TRUE end if env(ActionDuration, ACTION_ARM_L2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_RideAttack_L_Hard2_End") return end end function RideAttack_L_Hard2_Start_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Hard2_End_onActivate() act(ResetInputQueue) end function RideAttack_L_Hard2_End_onUpdate() act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if env(GetSpEffectID, 131) == FALSE and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_L_Hard2_End_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Top_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_L_Top_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) local r1 = "W_RideAttack_R_Top" if RideAttackCommonFunction(r1, "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top02", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_L_Top_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Top02_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_L_Top02_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) local r1 = "W_RideAttack_R_Top" if RideAttackCommonFunction(r1, "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top03", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_L_Top02_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttack_L_Top03_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) act(ResetInputQueue) end function RideAttack_L_Top03_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) local r1 = "W_RideAttack_R_Top" if RideAttackCommonFunction(r1, "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttack_L_Top03_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttackArrowStart_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction() == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventAllBody("W_RideAttackArrowLoop") return else local fireEvent = "W_RideAttackArrowFire" if c_Style == HAND_LEFT_BOTH and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then fireEvent = "W_RideAttackCrossbowLeftFire" end ExecEventAllBody(fireEvent) return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventAllBody("W_RideAttackArrowLoop") return else local fireEvent = "W_RideAttackArrowFire" if c_Style == HAND_LEFT_BOTH and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then fireEvent = "W_RideAttackCrossbowLeftFire" end ExecEventAllBody(fireEvent) return end end end function RideAttackArrowStartContinue_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction() == TRUE then return end if RideReActionFunction() == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then hkbFireEvent("W_RideAttackArrowLoop") return else hkbFireEvent("W_RideAttackArrowFire") return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then hkbFireEvent("W_RideAttackArrowLoop") return else hkbFireEvent("W_RideAttackArrowFire") return end end if ExecRideItem() == TRUE then return TRUE end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end end function RideAttackArrowLoop_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) act(DisallowAdditiveTurning, TRUE) if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if g_ArrowSlot == 0 then ShotArrow() if env(ActionDuration, ACTION_ARM_R1) <= 0 then local fireEvent = "W_RideAttackArrowFire" if c_Style == HAND_LEFT_BOTH and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then fireEvent = "W_RideAttackCrossbowLeftFire" end ExecEventAllBody(fireEvent) return end elseif env(ActionDuration, ACTION_ARM_R2) <= 0 then ShotArrow() local fireEvent = "W_RideAttackArrowFire" if c_Style == HAND_LEFT_BOTH and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then fireEvent = "W_RideAttackCrossbowLeftFire" end ExecEventAllBody(fireEvent) return end end function RideAttackArrowFire_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) act(DisallowAdditiveTurning, TRUE) local arrowHand = 1 if c_Style == HAND_LEFT_BOTH then arrowHand = 0 end local is_crossbow = GetEquipType(arrowHand, WEAPON_CATEGORY_CROSSBOW) if env(ActionRequest, 0) == TRUE and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ShotArrow() ExecEventAllBody("W_RideAttackArrowStartContinue") return TRUE elseif env(ActionRequest, 1) == TRUE and env(ActionDuration, 1) > 0 and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ShotArrow() ExecEventAllBody("W_RideAttackArrowStartContinue") return TRUE end if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then hkbFireEvent("W_RideIdle") end end function RideAttackArrowFire_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideAttackCrossbowLeftFire_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) act(DisallowAdditiveTurning, TRUE) local arrowHand = 1 if c_Style == HAND_LEFT_BOTH then arrowHand = 0 end local is_crossbow = GetEquipType(arrowHand, WEAPON_CATEGORY_CROSSBOW) if env(ActionRequest, 0) == TRUE and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ShotArrow() ExecEventAllBody("W_RideAttackArrowStartContinue") return TRUE elseif env(ActionRequest, 1) == TRUE and env(ActionDuration, 1) > 0 and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ShotArrow() ExecEventAllBody("W_RideAttackArrowStartContinue") return TRUE end if RideAttackCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then hkbFireEvent("W_RideIdle") end end function RideAttackCrossbowLeftFire_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function RideNoArrow_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then hkbFireEvent("W_RideIdle") end end function RideAttackCrossbowRightReload_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then hkbFireEvent("W_RideIdle") end end function RideAttackCrossbowLeftReload_onUpdate() SetAIActionState() act(SetIsPreciseShootingPossible) if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end local lower_only = TRUE local enable_turn = FALSE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE enable_turn = TRUE end if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, enable_turn, lower_only) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then hkbFireEvent("W_RideIdle") end end function RideJumpCommonFunction(jump_type, lower_only, isSecond, isHighJump) act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING and isHighJump == FALSE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return TRUE end local height = env(GetMountFallHeight) / 100 if env(IsMountTrulyLanding) == TRUE and IsLandDead(height) == TRUE and isHighJump == FALSE and env(GetSpEffectID, 185) == FALSE then act(DebugLogOutput, height) FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if RideReActionFunction() == TRUE then return TRUE end if env(ActionRequest, 6) == TRUE and env(GetSpEffectID, 100902) == TRUE and RIDE_ISENABLE_DOUBLEJUMP == TRUE then if env(GetStamina) <= 0 or height > DISABLEJUMP_FALLDIST then ResetRequest() else if ShouldDoStaminaCost() == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) end if GetVariable("MoveSpeedLevel") >= 1.5 then FireRideEvent("W_RideJump2_D", "W_RideJump2_D", FALSE) elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideJump2_F", "W_RideJump2_F", FALSE) else FireRideEvent("W_RideJump2_N", "W_RideJump2_N", FALSE) end RIDE_ISENABLE_DOUBLEJUMP = FALSE return TRUE end end if env(IsMountTrulyLanding) == TRUE and env(GetMountSpEffectID, 98) == TRUE and env(GetMountSpEffectID, 140) == FALSE then if GetVariable("MoveSpeedLevel") > 1.5 then FireRideEvent("W_RideJump_Land_To_Gallop", "W_RideJump_Land_To_Gallop", lower_only) return TRUE elseif GetVariable("MoveSpeedLevel") > 0.6 then FireRideEvent("W_RideJump_Land_To_Dash", "W_RideJump_Land_To_Dash", lower_only) return TRUE end local landEvent = "W_RideJump_Land_N" if jump_type == 3 then landEvent = "W_RideJump_Land_D" elseif jump_type == 2 then landEvent = "W_RideJump_Land_F" end act(DebugLogOutput, landEvent) FireRideEvent(landEvent, landEvent, lower_only) return TRUE end local enable_jumpAttack = TRUE local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end if GetEquipType(attackHand, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_CROSSBOW) == TRUE then enable_jumpAttack = FALSE end local is_staff = GetEquipType(attackHand, WEAPON_CATEGORY_STAFF) if enable_jumpAttack == TRUE then if env(ActionRequest, ACTION_ARM_R1) == TRUE and is_staff == FALSE or env(ActionRequest, ACTION_ARM_R2) == TRUE and is_staff == TRUE then SetVariable("RideJumpAttack_Land", 0) SetVariable("IndexRideJumpType", jump_type) ExecEventAllBody("W_RideAttack_Jump_R") RideJumpLoop_IsSecond = isSecond return TRUE elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and is_staff == FALSE or env(ActionRequest, ACTION_ARM_L2) == TRUE and is_staff == TRUE then SetVariable("RideJumpAttack_Land", 0) SetVariable("IndexRideJumpType", jump_type) ExecEventAllBody("W_RideAttack_Jump_L") RideJumpLoop_IsSecond = isSecond return TRUE end end if env(IsAnimEnd, 0) == TRUE and lower_only == FALSE then SetVariable("IndexRideJumpType", jump_type) if isHighJump == TRUE then ExecEventNoReset("W_RideJumpHigh_FallLoop") elseif isSecond == TRUE then ExecEventNoReset("W_RideJump2_Loop") else ExecEventNoReset("W_RideJump_Loop") end return TRUE end return FALSE end function RideJump_N_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_N_onUpdate() if RideJumpCommonFunction(0, FALSE, FALSE, FALSE) == TRUE then return end end function RideJump_F_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_F_onUpdate() if RideJumpCommonFunction(2, FALSE, FALSE, FALSE) == TRUE then return end end function RideJump_D_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_D_onUpdate() if RideJumpCommonFunction(3, FALSE, FALSE, FALSE) == TRUE then return end end function RideJump_Loop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Loop_onUpdate() if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end elseif env(IsHamariFallDeath, 12) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if env(GetSpiritspringJumpHeight) > 0 or env(GetSpEffectID, 183) == TRUE then act(AddSpEffect, 186) end if RideJumpCommonFunction(GetVariable("IndexRideJumpType"), FALSE, FALSE, FALSE) == TRUE then return end end function RideJump2_N_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump2_N_onUpdate() if RideJumpCommonFunction(0, FALSE, TRUE, FALSE) == TRUE then return end end function RideJump2_F_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump2_F_onUpdate() if RideJumpCommonFunction(2, FALSE, TRUE, FALSE) == TRUE then return end end function RideJump2_D_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump2_D_onUpdate() if RideJumpCommonFunction(3, FALSE, TRUE) == TRUE then return end end function RideJump2_Loop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump2_Loop_onUpdate() if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end elseif env(IsHamariFallDeath, 12) == TRUE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if env(GetSpiritspringJumpHeight) > 0 or env(GetSpEffectID, 183) == TRUE then act(AddSpEffect, 186) end if RideJumpCommonFunction(GetVariable("IndexRideJumpType"), FALSE, TRUE, FALSE) == TRUE then return end end function RideJump_Land_N_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Land_N_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsMoveCancelPossible) == TRUE then local moveType = RIDE_MOVE_TYPE_IDLE if env(IsAnimEnd, 0) == TRUE then moveType = RIDE_MOVE_TYPE_OTHER end if RideRequestFunction(moveType, TRUE, FALSE) == TRUE then return end end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) end end function RideJump_Land_F_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Land_F_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE then local moveType = RIDE_MOVE_TYPE_IDLE if env(IsAnimEnd, 0) == TRUE then moveType = RIDE_MOVE_TYPE_OTHER end if RideRequestFunction(moveType, TRUE, FALSE) == TRUE then return end end end function RideJump_Land_D_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Land_D_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE then local moveType = RIDE_MOVE_TYPE_IDLE if env(IsAnimEnd, 0) == TRUE then moveType = RIDE_MOVE_TYPE_OTHER end if RideRequestFunction(moveType, TRUE, FALSE) == TRUE then return end end end function RideJump_Land_To_Dash_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Land_To_Dash_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if ExecRideStop(RIDE_MOVE_TYPE_OTHER, FALSE) == TRUE then return end if (env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideJump_Land_To_Gallop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Land_To_Gallop_onUpdate() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if ExecRideStop(RIDE_MOVE_TYPE_OTHER, FALSE) == TRUE then return end if (env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE) and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end end function RideJumpHigh_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJumpHigh_onUpdate() act(AddSpEffect, 185) if env(ActionRequest, 6) == TRUE then FireRideEvent("W_RideJumpHigh2", "W_RideJumpHigh2", FALSE) RIDE_ISENABLE_DOUBLEJUMP = FALSE return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then rideJumpHighLoop_StopTime = 0 lastFallHeight = 0 rideJumpHighLoop_IsStop = FALSE FireRideEvent("W_RideJumpHighLoop", "W_RideJumpHighLoop", FALSE) return end if RideJumpCommonFunction(0, FALSE, FALSE, TRUE) == TRUE then return end end function RideJumpHighLoop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJumpHighLoop_onUpdate() act(AddSpEffect, 185) local fallHeight = env(GetMountFallHeight) local dT = env(ObtainedDT) / 1000 local upSpeed = (fallHeight - lastFallHeight) / dT if upSpeed < 50 then rideJumpHighLoop_IsStop = TRUE rideJumpHighLoop_StopTime = rideJumpHighLoop_StopTime + dT act(DebugLogOutput, "RideJumpHigh current=" .. fallHeight .. "cm target=" .. Ride_HighJump_Height .. "cm upSpeed=" .. upSpeed .. "cm stopTime=" .. rideJumpHighLoop_StopTime) if rideJumpHighLoop_StopTime > 5 then act(DebugLogOutput, "RideJumpHigh Force end") FireRideEvent("W_RideJumpHighEnd", "W_RideJumpHighEnd", FALSE) return end else rideJumpHighLoop_IsStop = FALSE rideJumpHighLoop_StopTime = 0 act(DebugLogOutput, "RideJumpHigh current=" .. fallHeight .. "cm target=" .. Ride_HighJump_Height .. "cm upSpeed=" .. upSpeed) end if -fallHeight > Ride_HighJump_Height then FireRideEvent("W_RideJumpHighEnd", "W_RideJumpHighEnd", FALSE) return end lastFallHeight = fallHeight if RideJumpCommonFunction(0, FALSE, FALSE, TRUE) == TRUE then return end end function RideJumpHighEnd_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJumpHighEnd_onUpdate() act(AddSpEffect, 185) if env(ActionRequest, 6) == TRUE then FireRideEvent("W_RideJumpHigh2", "W_RideJumpHigh2", FALSE) RIDE_ISENABLE_DOUBLEJUMP = FALSE return end if RideJumpCommonFunction(0, FALSE, FALSE, TRUE) == TRUE then return end end function RideJumpHigh2_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJumpHigh2_onUpdate() act(AddSpEffect, 185) if RideJumpCommonFunction(0, FALSE, FALSE, TRUE) == TRUE then return end end function RideJumpHigh_FallLoop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJumpHigh_FallLoop_onUpdate() act(AddSpEffect, 185) if RideJumpCommonFunction(GetVariable("IndexRideJumpType"), FALSE, FALSE, TRUE) == TRUE then return end end function RideJump_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_onUpdate() SetAIActionState() if GetVariable("IsEnableToggleDashTest") == 2 or GetVariable("IsEnableToggleDashTest") == 4 then SetVariable("ToggleDash", 0) end act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) if RideReActionFunction() == TRUE then SetVariable("Int16Variable05", 0) return end if env(IsMountInFallLoop) == FALSE then if env(ActionRequest, ACTION_ARM_R1) == TRUE and env(GetMountSpEffectID, 98) == TRUE then act(ResetInputQueue) SetVariable("RideJumpAttack_Land", 0) ExecEventAllBody("W_RideAttack_Jump_R") return elseif env(ActionRequest, ACTION_ARM_R2) == TRUE and 0 < env(ActionDuration, 1) and env(GetMountSpEffectID, 98) == FALSE then act(ResetInputQueue) SetVariable("Int16Variable05", 0) hkbFireEvent("W_RideAttack_R_Hard1_Start") return elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and env(GetMountSpEffectID, 98) == TRUE then act(ResetInputQueue) SetVariable("RideJumpAttack_Land", 0) ExecEventAllBody("W_RideAttack_Jump_L") return elseif env(ActionRequest, ACTION_ARM_L2) == TRUE and 0 < env(ActionDuration, 3) then act(ResetInputQueue) SetVariable("Int16Variable05", 0) hkbFireEvent("W_RideAttack_L_Hard1_Start") return end elseif RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and GetVariable("MoveSpeedLevel") > 0 and env(IsMountFalling) == FALSE and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then SetVariable("Int16Variable05", 0) return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) SetVariable("Int16Variable05", 0) return end end function RideJumpAttackCommonFunction() if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end elseif env(IsHamariFallDeath, 12) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end end function RideAttack_Jump_R_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_R_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) RideJumpAttackCommonFunction() if GetVariable("RideJumpAttack_Land") == 1 then if RideCommonFunction("W_RideAttack_R_Top02", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end else if ExecRideStop(RIDE_MOVE_TYPE_OTHER, TRUE) == TRUE then return end if (env(GetMountSpEffectID, 101100) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101005) == TRUE) and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, TRUE) == TRUE then return end end elseif env(GetMountSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetMountSpEffectID, 140) == FALSE then SetVariable("RideJumpAttack_Land", 1) RideJumpCommonFunction(GetVariable("IndexRideJumpType"), TRUE, FALSE, FALSE) elseif env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideJumpLoop_IsSecond == TRUE then FireRideEvent("W_RideJump2_Loop", "W_RideJump2_Loop", FALSE) else FireRideEvent("W_RideJump_Loop", "W_RideJump_Loop", FALSE) end return end end function RideAttack_Jump_R_Hard1_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_R_Hard1_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) if GetVariable("RideJumpAttack_Land") == 1 then local r2 = "W_RideAttack_R_Hard1_Start" if IsEnableRideAttackHard2(HAND_RIGHT) == TRUE and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 241 then r2 = "W_RideAttack_R_Hard2_Start" end if RideCommonFunction("W_RideAttack_R_Top", r2, "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end else if ExecRideStop(RIDE_MOVE_TYPE_OTHER, TRUE) == TRUE then return end if (env(GetMountSpEffectID, 101100) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101005) == TRUE) and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, TRUE) == TRUE then return end end elseif env(GetMountSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetMountSpEffectID, 140) == FALSE then SetVariable("RideJumpAttack_Land", 1) RideJumpCommonFunction(GetVariable("IndexRideJumpType"), TRUE, FALSE, FALSE) elseif env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideJump_Loop", "W_RideJump_Loop", FALSE) return end end function RideAttack_Jump_R_Hard2_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_R_Hard2_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) if GetVariable("RideJumpAttack_Land") == 1 then if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end else if ExecRideStop(RIDE_MOVE_TYPE_OTHER, TRUE) == TRUE then return end if (env(GetMountSpEffectID, 101100) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101005) == TRUE) and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, TRUE) == TRUE then return end end elseif env(GetMountSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetMountSpEffectID, 140) == FALSE then SetVariable("RideJumpAttack_Land", 1) RideJumpCommonFunction(GetVariable("IndexRideJumpType"), TRUE, FALSE, FALSE) elseif env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideJump_Loop", "W_RideJump_Loop", FALSE) return end end function RideAttack_Jump_L_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_L_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) RideJumpAttackCommonFunction() if GetVariable("RideJumpAttack_Land") == 1 then if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top02", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end else if ExecRideStop(RIDE_MOVE_TYPE_OTHER, TRUE) == TRUE then return end if (env(GetMountSpEffectID, 101100) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101005) == TRUE) and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, TRUE) == TRUE then return end end elseif env(GetMountSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetMountSpEffectID, 140) == FALSE then SetVariable("RideJumpAttack_Land", 1) RideJumpCommonFunction(GetVariable("IndexRideJumpType"), TRUE, FALSE, FALSE) elseif env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideJump_Loop", "W_RideJump_Loop", FALSE) return end end function RideAttack_Jump_L_Hard1_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_L_Hard1_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) if GetVariable("RideJumpAttack_Land") == 1 then local l2 = "W_RideAttack_L_Hard1_Start" if IsEnableRideAttackHard2(HAND_RIGHT) == TRUE and env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) ~= 241 then l2 = "W_RideAttack_L_Hard2_Start" end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", l2) == TRUE then return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end else if ExecRideStop(RIDE_MOVE_TYPE_OTHER, TRUE) == TRUE then return end if (env(GetMountSpEffectID, 101100) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101005) == TRUE) and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, TRUE) == TRUE then return end end elseif env(GetMountSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetMountSpEffectID, 140) == FALSE then SetVariable("RideJumpAttack_Land", 1) RideJumpCommonFunction(GetVariable("IndexRideJumpType"), TRUE, FALSE, FALSE) elseif env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideJump_Loop", "W_RideJump_Loop", FALSE) return end end function RideAttack_Jump_L_Hard2_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_L_Hard2_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) if GetVariable("RideJumpAttack_Land") == 1 then if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then if RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end else if ExecRideStop(RIDE_MOVE_TYPE_OTHER, TRUE) == TRUE then return end if (env(GetMountSpEffectID, 101100) == TRUE or env(GetMountSpEffectID, 101006) == TRUE or env(GetMountSpEffectID, 101005) == TRUE) and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, FALSE, TRUE) == TRUE then return end end elseif env(GetMountSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetMountSpEffectID, 140) == FALSE then SetVariable("RideJumpAttack_Land", 1) RideJumpCommonFunction(GetVariable("IndexRideJumpType"), TRUE, FALSE, FALSE) elseif env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideJump_Loop", "W_RideJump_Loop", FALSE) return end end function RideTurn_Left180_onUpdate() RIDE_TURN_STATE = 1 if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end function RideTurn_Left180_onDeactivate() RIDE_TURN_STATE = 0 end function RideTurn_Right180_onUpdate() RIDE_TURN_STATE = 1 if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end function RideTurn_Right180_onDeactivate() RIDE_TURN_STATE = 0 end function RideTurn_Left90_onUpdate() RIDE_TURN_STATE = 1 if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end function RideTurn_Left90_onDeactivate() RIDE_TURN_STATE = 0 end function RideTurn_Right90_onUpdate() RIDE_TURN_STATE = 1 if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(MovementRequest) == TRUE and RideRequestFunction(RIDE_MOVE_TYPE_OTHER, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end function RideTurn_Right90_onDeactivate() RIDE_TURN_STATE = 0 end function RideFall_Start_onUpdate() if RideFallCommonFunction() == TRUE then return end if env(IsMountInFallLoop) == TRUE then local height = env(GetMountFallHeight) if IsLandDead(height / 100) == TRUE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if height < 900 and height >= 200 then if GetVariable("MoveSpeedLevel") > 1.5 then FireRideEvent("W_RideJump_Land_To_Gallop", "W_RideJump_Land_To_Gallop", lower_only) return elseif GetVariable("MoveSpeedLevel") > 0.6 then FireRideEvent("W_RideJump_Land_To_Dash", "W_RideJump_Land_To_Dash", lower_only) return else FireRideEvent("W_RideFall_Land", "W_RideFall_Land", FALSE) return end elseif height >= 200 then FireRideEvent("W_RideFall_Land", "W_RideFall_Land", FALSE) return elseif GetVariable("MoveSpeedLevel") > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then FireRideEvent("W_RideGallop", "W_RideGallop", FALSE) return elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideDash", "W_RideDash", FALSE) return elseif GetVariable("MoveSpeedLevel") > 0 then FireRideEvent("W_RideWalk", "W_RideWalk", FALSE) return else FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideFall_Loop", "W_RideFall_Loop", FALSE) return end end function RideFall_Loop_onUpdate() if RideFallCommonFunction() == TRUE then return end if env(GetSpiritspringJumpHeight) > 0 or env(GetSpEffectID, 183) == TRUE then act(AddSpEffect, 186) end if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end elseif env(IsHamariFallDeath, 12) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if env(IsMountInFallLoop) == TRUE then local height = env(GetMountFallHeight) if IsLandDead(height / 100) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if height < 900 then if GetVariable("MoveSpeedLevel") > 1.5 then FireRideEvent("W_RideJump_Land_To_Gallop", "W_RideJump_Land_To_Gallop", lower_only) return elseif GetVariable("MoveSpeedLevel") > 0.6 then FireRideEvent("W_RideJump_Land_To_Dash", "W_RideJump_Land_To_Dash", lower_only) return end end FireRideEvent("W_RideFall_Land", "W_RideFall_Land", FALSE) return end end function RideFall_Land_onUpdate() if RideFallCommonFunction() == TRUE then return end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE then local moveType = RIDE_MOVE_TYPE_IDLE if env(IsAnimEnd, 0) == TRUE then moveType = RIDE_MOVE_TYPE_OTHER end if RideRequestFunction(moveType, TRUE, FALSE) == TRUE then return end end end function Jump_Activate() Jump_InitWeaponRef = FALSE Jump_LeftWeaponRef = FALSE ActivateRightArmAdd(START_FRAME_A02) ResetDamageCount() end function Jump_Update() UpdateRightArmAdd() if Jump_LeftWeaponRef == FALSE and (IsNodeActive("Jump_N Selector_Magic_Left") == TRUE or IsNodeActive("Jump_F Selector_Magic_Left") == TRUE or IsNodeActive("Jump_D Selector_Magic_Left") == TRUE or IsNodeActive("Jump_Loop_Magic_Left_CMSG") == TRUE or IsNodeActive("Jump_Land_Common_Magic_Left_Swing_Selector") == TRUE or IsNodeActive("JumpMagic_Start_Falling_ConditionSelector_Left") == TRUE or IsNodeActive("JumpMagic_Start_Falling_F_ConditionSelector_Left") == TRUE or IsNodeActive("JumpMagic_Start_Falling_D_ConditionSelector_Left") == TRUE or IsNodeActive("JumpMagic_Start_Falling_D_ConditionSelector_Left") == TRUE) then SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) Jump_InitWeaponRef = TRUE Jump_LeftWeaponRef = TRUE end if Jump_InitWeaponRef == FALSE then local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) Jump_InitWeaponRef = TRUE act(SetThrowPossibilityState_Defender, 400000) end end function JumpAttackRight_Activate() SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_LEFT) end function JumpAttackLeft_Activate() SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) end function JumpAttackBoth_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) end -- Called from: -- JumpAttack_Start_Falling_onUpdate -- JumpAttack_Start_Falling_F_onUpdate -- JumpAttack_Start_Falling_D_onUpdate -- JumpCommonFunction -- Jump_Loop_onUpdate function Act_Jump() SetEnableAimMode() if env(GetSpEffectID, 32) == FALSE then SetThrowAtkInvalid() end local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_FallDeath") return TRUE elseif env(GetHP) <= 0 and (env(GetSpecialAttribute) == DAMAGE_ELEMENT_POISON or env(GetSpecialAttribute) == DAMAGE_ELEMENT_BLIGHT) then SetVariable("IndexDeath", DEATH_TYPE_POISON) ExecEventAllBody("W_DeathStart") return TRUE end local height = env(GetFallHeight) / 100 if env(IsTruelyLanding) == TRUE and IsLandDead(height) == TRUE then if height > 8 then SetVariable("IndexDeath", DEATH_TYPE_LAND) else SetVariable("IndexDeath", DEATH_TYPE_LAND_LOW) end ExecEventAllBody("W_DeathStart") return TRUE end if ExecDamage(FALSE, FALSE) == TRUE then return TRUE end end function ExecArrowBothJumpLandAttack() local is_both_arrow = FALSE local is_both_large_arrow = FALSE local is_both_ballista = FALSE local arrowHand = 0 local fireEvent = Event_AttackArrowRightFireMove local loopEvent = Event_AttackArrowRightLoop if c_Style == HAND_RIGHT_BOTH then is_both_large_arrow = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) is_both_ballista = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_BALLISTA) arrowHand = 1 if is_both_ballista == TRUE then fireEvent = Event_AttackCrossbowBothRightFire loopEvent = Event_AttackCrossbowBothRightLoop end elseif c_Style == HAND_LEFT_BOTH then is_both_large_arrow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) is_both_ballista = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) arrowHand = 0 if is_both_ballista == TRUE then fireEvent = Event_AttackCrossbowBothRightFire loopEvent = Event_AttackCrossbowBothRightLoop else fireEvent = Event_AttackArrowLeftFireMove loopEvent = Event_AttackArrowLeftLoop end end if is_both_large_arrow == FALSE and is_both_ballista == FALSE then return FALSE end if g_ArrowSlot == 0 then act(ChooseBowAndArrowSlot, 0) if env(IsOutOfAmmo, arrowHand) == TRUE then if is_both_ballista == TRUE then ExecEventHalfBlend(Event_AttackCrossbowBothRightEmpty, ALLBODY) else ExecEventAllBody("W_NoArrow") end return TRUE end if 0 < env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventHalfBlend(loopEvent, ALLBODY) return TRUE elseif 1 <= GetVariable("JumpAttack_HandCondition") then ShotArrow() ExecEventHalfBlend(fireEvent, ALLBODY) return TRUE end else act(ChooseBowAndArrowSlot, 1) if env(IsOutOfAmmo, arrowHand) == TRUE then if is_both_ballista == TRUE then ExecEventHalfBlend(Event_AttackCrossbowBothRightEmpty, ALLBODY) else ExecEventAllBody("W_NoArrow") end return TRUE end if 0 < env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventHalfBlend(loopEvent, ALLBODY) return TRUE elseif 1 <= GetVariable("JumpAttack_HandCondition") then ShotArrow() ExecEventHalfBlend(fireEvent, ALLBODY) return TRUE end end return FALSE end function JumpAttack_Start_Falling_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function JumpAttack_Start_Falling_onUpdate() act(AIJumpState) SetAIActionState() if Act_Jump() == TRUE then return end if GetVariable("JumpAttackFormRequest") == 0 then SetVariable("JumpAttackForm", 1) elseif GetVariable("JumpAttackFormRequest") == 1 then SetVariable("JumpAttackForm", 2) elseif GetVariable("JumpAttackFormRequest") == 2 then SetVariable("JumpAttackForm", 3) end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetSpEffectID, 140) == FALSE and GetVariable("JumpAttack_Land") == 0 then local height = env(GetFallHeight) / 100 local landIndex = GetLandIndex(height, FALSE) if landIndex == LAND_HEAVY then SetVariable("JumpAttack_Land", 2) else SetVariable("JumpAttack_Land", 1) end return end if env(GetSpEffectID, 146) == TRUE then if GetVariable("JumpAttack_Land") == 2 then SetVariable("SwingPose", 5) else SetVariable("SwingPose", 4) end hkbFireEvent("W_Jump_Land_N") return end if env(GetEventEzStateFlag, 0) == TRUE and ExecArrowBothJumpLandAttack() == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function JumpAttack_Start_Falling_F_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function JumpAttack_Start_Falling_F_onUpdate() act(AIJumpState) SetAIActionState() if Act_Jump() == TRUE then return end if GetVariable("JumpAttackFormRequest") == 0 then SetVariable("JumpAttackForm", 1) elseif GetVariable("JumpAttackFormRequest") == 1 then SetVariable("JumpAttackForm", 2) elseif GetVariable("JumpAttackFormRequest") == 2 then SetVariable("JumpAttackForm", 3) end if GetVariable("JumpAttackForm") >= 0 then end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetSpEffectID, 140) == FALSE then SetVariable("JumpAttack_Land", 1) return end if env(GetSpEffectID, 146) == TRUE then SetVariable("SwingPose", 4) hkbFireEvent("W_Jump_Land_F") return end if env(GetEventEzStateFlag, 0) == TRUE and ExecArrowBothJumpLandAttack() == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function JumpAttack_Start_Falling_D_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function JumpAttack_Start_Falling_D_onUpdate() act(AIJumpState) SetAIActionState() if Act_Jump() == TRUE then return end if GetVariable("JumpAttackFormRequest") == 0 then SetVariable("JumpAttackForm", 1) elseif GetVariable("JumpAttackFormRequest") == 1 then SetVariable("JumpAttackForm", 2) elseif GetVariable("JumpAttackFormRequest") == 2 then SetVariable("JumpAttackForm", 3) end if GetVariable("JumpAttackForm") >= 0 then end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetSpEffectID, 140) == FALSE then SetVariable("JumpAttack_Land", 1) return end if env(GetSpEffectID, 146) == TRUE then SetVariable("SwingPose", 4) hkbFireEvent("W_Jump_Land_D") return end if env(GetEventEzStateFlag, 0) == TRUE and ExecArrowBothJumpLandAttack() == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function JumpCommonFunction(jump_type) act(AIJumpState) if GetVariable("JumpAttackForm") == 0 then act(NotifyAIOfBehaviourState, IDX_AINOTE_STATETYPE, IDX_AINOTE_STATETYPE_JUMP_NONATTACK) elseif env(GetSpEffectID, 102050) == TRUE then act(LockonFixedAngleCancel) end act(DisallowAdditiveTurning, TRUE) local height = env(GetFallHeight) / 100 local equip_arm_no = 1 if c_Style == HAND_LEFT_BOTH then equip_arm_no = 0 end -- Jump if Act_Jump() == TRUE then return TRUE end -- Jump Fall if env(GetSpEffectID, 145) == FALSE and GetVariable("JumpAttack_Land") == 0 then hkbFireEvent("W_Jump_Loop") return TRUE end local arrowHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then arrowHand = HAND_LEFT end local is_arrow = GetEquipType(arrowHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) if GetVariable("JumpAttackForm") == 0 and is_arrow == TRUE then if env(ActionRequest, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, 0) g_ArrowSlot = 0 elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, 1) g_ArrowSlot = 1 end end local is_staff = GetEquipType(equip_arm_no, WEAPON_CATEGORY_STAFF) local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local isWeaponStaff = FALSE if IsWeaponCatalyst(wep_hand, true) == TRUE then isWeaponStaff = TRUE end -- Magic if ExecJumpMagic(jump_type) == TRUE then -- Mid Air Ashes of Wah elseif env(ActionDuration, ACTION_ARM_L2) > 0 and IsJumpArts() == TRUE and env(GetSpEffectID, 140) == TRUE and GetVariable("JumpAttackForm") == 0 then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 0) SetVariable("JumpAttackForm", 1) SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) act(AddSpEffect, 4087) ExecEventAllBody("W_SwordArtsOneShotShieldBoth") -- 040030 SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE -- Catalyst: R1 elseif is_staff == TRUE and env(ActionRequest, ACTION_ARM_R1) == TRUE then -- Weapon Catalyst: R2 elseif isWeaponStaff == TRUE and env(ActionRequest, ACTION_ARM_R2) == TRUE then -- Bow elseif is_arrow == TRUE and (c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH) and env(IsOutOfAmmo, arrowHand) == TRUE then -- Crossbow elseif GetEquipType(arrowHand, WEAPON_CATEGORY_CROSSBOW) == TRUE and (env(GetBoltLoadingState, arrowHand) == FALSE or env(IsOutOfAmmo, arrowHand) == TRUE) then -- Jump Attack elseif env(GetSpEffectID, 140) == TRUE and GetVariable("JumpAttackForm") == 0 then if env(ActionRequest, ACTION_ARM_R1) == TRUE or is_arrow == TRUE and env(ActionRequest, ACTION_ARM_R2) == TRUE then if is_arrow == TRUE then ShotArrow() end ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 0) SetVariable("JumpAttackForm", 1) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() OnWeaponAttack(true) return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then if is_arrow == TRUE then ShotArrow() end ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 1) SetVariable("JumpAttackForm", 2) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() OnWeaponAttack(true) return TRUE elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and IsEnableDualWielding() == HAND_RIGHT then if is_arrow == TRUE then ShotArrow() end ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 2) SetVariable("JumpAttackForm", 3) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() OnWeaponAttack(true) return TRUE end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetSpEffectID, 140) == FALSE then if jump_type == 0 then SetVariable("JumpAttack_Land", 1) SetVariable("JumpMotion_Override", 0) if GetVariable("JumpMotion_Override") < 0.01 then SetVariable("JumpUseMotion_Bool", 1) end elseif jump_type >= 1 then if is_arrow == TRUE then ShotArrow() end ExecEventAllBody("W_Jump_Attack_Land_F") end OnWeaponAttack(true) return TRUE end elseif env(GetSpEffectID, 140) == FALSE and GetVariable("JumpAttack_Land") == 0 and GetVariable("JumpAttackForm") == 0 then SetVariable("JumpAttack_Land", 0) if env(ActionRequest, ACTION_ARM_R1) == TRUE or is_arrow == TRUE and env(ActionRequest, ACTION_ARM_R2) == TRUE then SetVariable("JumpAttackFormRequest", 0) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() if jump_type == 0 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling") elseif jump_type == 1 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling_F") elseif jump_type == 2 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling_D") end OnWeaponAttack(true) return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then SetVariable("JumpAttackFormRequest", 1) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() if jump_type == 0 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling") elseif jump_type == 1 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling_F") elseif jump_type == 2 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling_D") end OnWeaponAttack(true) return TRUE elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and IsEnableDualWielding() == HAND_RIGHT then SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("JumpAttackFormRequest", 2) if jump_type == 0 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling") elseif jump_type == 1 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling_F") elseif jump_type == 2 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_JumpAttack_Start_Falling_D") end OnWeaponAttack(true) return TRUE end end -- Landing if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetSpEffectID, 140) == FALSE and env(IsAIJumping) == FALSE then local landIndex = GetLandIndex(height, FALSE) SetVariable("LandIndex", landIndex) if GetVariable("JumpAttackForm") == 0 then local JumpMoveLevel = 0 if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end if ShouldDoSlowEffect() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 2 then hkbFireEvent("W_Jump_Land_To_Dash") elseif JumpMoveLevel == 1 then SetVariable("JumpLandMoveDirection", GetVariable("MoveDirection")) hkbFireEvent("W_Jump_Land_To_Run") elseif jump_type == 0 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_Jump_Land_N") elseif jump_type == 1 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_Jump_Land_F") elseif jump_type == 2 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_Jump_Land_D") end return TRUE else if jump_type == 0 then SetVariable("JumpAttack_Land", 1) SetVariable("JumpMotion_Override", 0) if GetVariable("JumpMotion_Override") < 0.01 then SetVariable("JumpUseMotion_Bool", 1) end elseif jump_type >= 1 then if is_arrow == TRUE then ShotArrow() end ExecEventAllBody("W_Jump_Attack_Land_F") end return TRUE end -- 146 "[HKS] Swing Window" elseif env(GetSpEffectID, 146) == TRUE and GetVariable("JumpAttackForm") ~= 0 then SetVariable("SwingPose", 4) if jump_type == 0 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_Jump_Land_N") elseif jump_type == 1 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_Jump_Land_F") elseif jump_type == 2 then if is_arrow == TRUE then ShotArrow() end ExecEventNoReset("W_Jump_Land_D") end return TRUE elseif env(GetEventEzStateFlag, 0) == TRUE and GetVariable("JumpAttackForm") ~= 0 and ExecArrowBothJumpLandAttack() == TRUE then return TRUE end return FALSE end function ExecJumpMagic(jump_type) if c_HasActionRequest == FALSE then return FALSE end local wep_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then wep_hand = HAND_LEFT end local buttonR = ACTION_ARM_MAGIC_R local buttonL = ACTION_ARM_MAGIC_L if IsWeaponCatalyst(wep_hand, true) == TRUE then buttonR = ACTION_ARM_MAGIC_R2 end if c_Style == HAND_RIGHT and IsWeaponCatalyst(HAND_LEFT) == TRUE then buttonL = ACTION_ARM_MAGIC_L2 end if env(ActionRequest, buttonR) == FALSE and env(ActionRequest, buttonL) == FALSE and not (c_SwordArtsID == SPELLCASTING_ASH) then return FALSE end if env(GetStamina) <= 0 then ResetRequest() return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() return FALSE end if env(IsMagicUseMenuOpened) == TRUE then return FALSE end local style = c_Style local magic_hand = HAND_RIGHT local wep_hand = HAND_RIGHT local delayActRequestNo = -1 local is_samagic = FALSE if env(ActionRequest, buttonR) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_R if style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE and IsWeaponCatalyst(wep_hand) == FALSE then return FALSE end wep_hand = HAND_LEFT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE and IsWeaponCatalyst(wep_hand) == FALSE then return FALSE end wep_hand = HAND_RIGHT end elseif env(ActionRequest, buttonL) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_L if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then return FALSE end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE and IsWeaponCatalyst(HAND_LEFT) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT act(DebugLogOutput, "MagicLeft") elseif c_SwordArtsID == SPELLCASTING_ASH and env(ActionDuration, ACTION_ARM_L2) > 0 then act(UpdateMagicIdToActive) if style == HAND_RIGHT_BOTH then delayActRequestNo = ACTION_ARM_MAGIC_R2 elseif style == HAND_LEFT_BOTH then delayActRequestNo = ACTION_ARM_MAGIC_R2 wep_hand = HAND_LEFT else delayActRequestNo = ACTION_ARM_MAGIC_L2 wep_hand = c_SwordArtsHand magic_hand = c_SwordArtsHand end else return FALSE end act(DecideMagicUse) act(NotifyAIMagicCast) if IsJumpMagic() == FALSE and IsQuickMagic() == FALSE then ResetRequest() return FALSE end if env(IsMagicUseable, wep_hand, 0) == FALSE then ResetRequest() return FALSE end local magic_index = env(GetMagicAnimType) if magic_index == 254 or magic_index == 255 then ResetRequest() return FALSE end local is_atk_auto_aim = FALSE if magic_index == MAGIC_REQUEST_WHIP or magic_index == MAGIC_REQUEST_SLASH or magic_index == MAGIC_REQUEST_QUICKSLASH or magic_index == MAGIC_REQUEST_FLAME_GRAB or magic_index == MAGIC_REQUEST_CRUSH or magic_index == MAGIC_REQUEST_CHOP or magic_index == MAGIC_REQUEST_SCYTHE then is_atk_auto_aim = TRUE end if IsJumpMagic() == TRUE then TriggerBeforeSpellcast() if magic_hand == HAND_RIGHT then ExecEventHalfBlend(Event_MagicFireRightJump, ALLBODY) else ExecEventHalfBlend(Event_MagicFireLeftJump, ALLBODY) end IS_ATTACKED_JUMPMAGIC = TRUE act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE elseif env(GetSpEffectID, 140) == TRUE and GetVariable("JumpAttackForm") == 0 then TriggerBeforeSpellcast() ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttackForm", 4) if wep_hand == HAND_LEFT and c_Style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 2) else SetVariable("JumpAttack_HandCondition", 0) end act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE elseif env(GetSpEffectID, 140) == FALSE and GetVariable("JumpAttack_Land") == 0 and GetVariable("JumpAttackForm") == 0 then SetVariable("JumpAttack_Land", 0) SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttackForm", 4) if wep_hand == HAND_LEFT and c_Style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 2) else SetVariable("JumpAttack_HandCondition", 0) end TriggerBeforeSpellcast() if jump_type == 0 then ExecEventNoReset("W_JumpAttack_Start_Falling") elseif jump_type == 1 then ExecEventNoReset("W_JumpAttack_Start_Falling_F") elseif jump_type == 2 then ExecEventNoReset("W_JumpAttack_Start_Falling_D") end act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end end function ExecFallMagic() if c_HasActionRequest == FALSE then return FALSE end if env(ActionRequest, ACTION_ARM_MAGIC_R) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_L) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_R2) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_L2) == FALSE then return FALSE end if env(GetStamina) <= 0 then ResetRequest() return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() return FALSE end if env(IsMagicUseMenuOpened) == TRUE then return FALSE end local style = c_Style local magic_hand = HAND_RIGHT local wep_hand = HAND_RIGHT local delayActRequestNo = -1 local is_samagic = FALSE local atkRequest = GetAttackRequest(FALSE) if env(ActionRequest, ACTION_ARM_MAGIC_R) == TRUE and not (c_SwordArtsID == SPELLCASTING_ASH and c_Style == HAND_LEFT_BOTH) then delayActRequestNo = ACTION_ARM_MAGIC_R if style == HAND_LEFT_BOTH then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_LEFT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_RIGHT end elseif env(ActionRequest, ACTION_ARM_MAGIC_L) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_L if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then return FALSE end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT act(DebugLogOutput, "MagicLeft") elseif env(ActionRequest, ACTION_ARM_MAGIC_R2) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_R2 if style == HAND_LEFT_BOTH then if IsWeaponCatalyst(HAND_LEFT, true) == FALSE then return FALSE end wep_hand = HAND_LEFT else if IsWeaponCatalyst(HAND_RIGHT, true) == FALSE then return FALSE end wep_hand = HAND_RIGHT end elseif env(ActionRequest, ACTION_ARM_MAGIC_L2) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_L2 if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then return FALSE end if IsWeaponCatalyst(HAND_LEFT) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT act(DebugLogOutput, "MagicLeft") elseif c_SwordArtsID == SPELLCASTING_ASH and (env(ActionDuration, ACTION_ARM_L2) > 0 or atkRequest == SWORDARTS_REQUEST_BOTH_NORMAL) then act(UpdateMagicIdToActive) if style == HAND_RIGHT_BOTH then delayActRequestNo = ACTION_ARM_MAGIC_R2 elseif style == HAND_LEFT_BOTH then delayActRequestNo = ACTION_ARM_MAGIC_R2 wep_hand = HAND_LEFT else delayActRequestNo = ACTION_ARM_MAGIC_L2 wep_hand = c_SwordArtsHand magic_hand = c_SwordArtsHand end else return FALSE end act(DecideMagicUse) act(NotifyAIMagicCast) if IsJumpMagic() == FALSE and IsQuickMagic() == FALSE then ResetRequest() return FALSE end if env(IsMagicUseable, wep_hand, 0) == FALSE then ResetRequest() return FALSE end local magic_index = env(GetMagicAnimType) if magic_index == 254 or magic_index == 255 then ResetRequest() return FALSE end local is_atk_auto_aim = FALSE if magic_index == MAGIC_REQUEST_WHIP or magic_index == MAGIC_REQUEST_SLASH or magic_index == MAGIC_REQUEST_QUICKSLASH or magic_index == MAGIC_REQUEST_FLAME_GRAB or magic_index == MAGIC_REQUEST_CRUSH or magic_index == MAGIC_REQUEST_CHOP or magic_index == MAGIC_REQUEST_SCYTHE then is_atk_auto_aim = TRUE end if IsJumpMagic() == TRUE then TriggerBeforeSpellcast() if magic_hand == HAND_RIGHT then ExecEventHalfBlend(Event_MagicFireRightJump, ALLBODY) else ExecEventHalfBlend(Event_MagicFireLeftJump, ALLBODY) end IS_ATTACKED_JUMPMAGIC = TRUE act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE else SetVariable("JumpAttack_Land", 0) SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttackForm", 4) if wep_hand == HAND_LEFT and c_Style == HAND_RIGHT then SetVariable("JumpAttack_HandCondition", 2) else SetVariable("JumpAttack_HandCondition", 0) end TriggerBeforeSpellcast() ExecEventNoReset("W_JumpAttack_Start_Falling") act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end end function Jump_Overweight_onActivate() SetAIActionState() end function Jump_Overweight_onUpdate() SetAIActionState() if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function Jump_Overweight_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_N_onActivate() act(AIJumpState) SetAIActionState() end function Jump_N_onUpdate() SetAIActionState() JUMP_STATE_1 = 1 JUMP_STATE_2 = 0 JUMP_STATE_3 = 0 if GetVariable("JumpReachSelector") == 0 and 0 < GetVariable("MoveSpeedLevel") then SetVariable("JumpReachSelector", 1) if GetVariable("IsLockon") == true then local jumpangle = GetVariable("MoveAngle") if jumpangle > -45 and jumpangle < 45 then SetVariable("JumpDirection", 0) elseif jumpangle >= 45 and jumpangle <= 135 then SetVariable("JumpDirection", 3) elseif jumpangle >= -135 and jumpangle <= -45 then SetVariable("JumpDirection", 2) else SetVariable("JumpDirection", 1) end else SetVariable("JumpDirection", 0) end end if JumpCommonFunction(0) == TRUE then return end end function Jump_N_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_F_onActivate() act(AIJumpState) SetAIActionState() end function Jump_F_onUpdate() SetAIActionState() JUMP_STATE_1 = 0 JUMP_STATE_2 = 1 JUMP_STATE_3 = 0 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) if JumpCommonFunction(1) == TRUE then return end end function Jump_F_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_D_onActivate() act(AIJumpState) SetAIActionState() end function Jump_D_onUpdate() SetAIActionState() JUMP_STATE_1 = 0 JUMP_STATE_2 = 0 JUMP_STATE_3 = 1 if GetVariable("JumpAttackForm") == 0 then act(LockonFixedAngleCancel) end if JumpCommonFunction(2) == TRUE then return end end function Jump_D_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_RideOff_onActivate() act(AIJumpState) SetAIActionState() end function Jump_RideOff_onUpdate() SetAIActionState() JUMP_STATE_1 = 0 JUMP_STATE_2 = 0 JUMP_STATE_3 = 1 if GetVariable("JumpAttackForm") == 0 then act(LockonFixedAngleCancel) end if JumpCommonFunction(2) == TRUE then act(Dismount) return end end function Jump_RideOff_onDeactivate() act(Dismount) act(DisallowAdditiveTurning, FALSE) end function Jump_Loop_onActivate() SetAIActionState() end function Jump_Loop_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE then ExecEvent("W_FallDeath") return end elseif env(IsHamariFallDeath, 12) == TRUE then ExecEvent("W_FallDeath") return end local height = env(GetFallHeight) / 100 if not (height >= 60) or env(GetStateChangeType, 266) == TRUE then else ExecEventAllBody("W_FallDeath") return TRUE end if Act_Jump() == TRUE then return end local equip_arm_no = 1 if c_Style == HAND_LEFT_BOTH then equip_arm_no = 0 end local arrowHand = 1 if c_Style == HAND_LEFT_BOTH then arrowHand = 0 end local is_arrow = GetEquipType(arrowHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) if is_arrow == TRUE then if env(ActionRequest, 0) == TRUE then act(ChooseBowAndArrowSlot, 0) g_ArrowSlot = 0 elseif env(ActionRequest, 1) == TRUE then act(ChooseBowAndArrowSlot, 1) g_ArrowSlot = 1 end end if ExecJumpMagic(0) == TRUE then -- Mid Air Ashes of Wah elseif env(ActionDuration, ACTION_ARM_L2) > 0 and IsJumpArts() == TRUE then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 0) SetVariable("JumpAttackForm", 1) SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) act(AddSpEffect, 4087) ExecEventAllBody("W_SwordArtsOneShotShieldBoth") -- 040030 SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE elseif env(GetEquipWeaponCategory, equip_arm_no) == WEAPON_CATEGORY_STAFF and env(ActionRequest, 0) == TRUE then elseif is_arrow == TRUE and (c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH or GetEquipType(arrowHand, WEAPON_CATEGORY_CROSSBOW) == TRUE) and env(IsOutOfAmmo, arrowHand) == TRUE then elseif GetEquipType(arrowHand, WEAPON_CATEGORY_CROSSBOW) == TRUE and env(GetBoltLoadingState, arrowHand) == FALSE then elseif env(ActionRequest, ACTION_ARM_R1) == TRUE and GetVariable("JumpAttackForm") == 0 then SetVariable("JumpAttackForm", 1) SetVariable("JumpAttackFormRequest", 0) if is_arrow == TRUE then ShotArrow() end hkbFireEvent("W_JumpAttack_Start_Falling") return elseif env(ActionRequest, ACTION_ARM_R2) == TRUE and GetVariable("JumpAttackForm") == 0 then if is_arrow == TRUE then SetVariable("JumpAttackForm", 1) SetVariable("JumpAttackFormRequest", 0) ShotArrow() hkbFireEvent("W_JumpAttack_Start_Falling") return end SetVariable("JumpAttackForm", 2) SetVariable("JumpAttackFormRequest", 1) hkbFireEvent("W_JumpAttack_Start_Falling") return elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and IsEnableDualWielding() == HAND_RIGHT then SetVariable("JumpAttackForm", 3) SetVariable("JumpAttackFormRequest", 2) if is_arrow == TRUE then ShotArrow() end hkbFireEvent("W_JumpAttack_Start_Falling") return end if 1 <= GetVariable("JumpAttackForm") then act(ResetInputQueue) end local landIndex = GetLandIndex(height, FALSE) if env(GetSpEffectID, 141) == TRUE then SetVariable("SwingPose", 0) elseif env(GetSpEffectID, 142) == TRUE then SetVariable("SwingPose", 0) elseif env(GetSpEffectID, 143) == TRUE then SetVariable("SwingPose", 0) elseif env(GetSpEffectID, 144) == TRUE then if landIndex == LAND_HEAVY then SetVariable("SwingPose", 3) else SetVariable("SwingPose", 2) end elseif env(GetSpEffectID, 145) == TRUE then SetVariable("SwingPose", 4) elseif landIndex == LAND_HEAVY then SetVariable("SwingPose", 3) else SetVariable("SwingPose", 2) end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE then SetVariable("LandIndex", landIndex) local JumpMoveLevel = 0 if landIndex == 0 and GetVariable("JumpAttackForm") == 0 then if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end end if ShouldDoSlowEffect() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 2 then ExecEventNoReset("W_Jump_Land_To_Dash") return elseif JumpMoveLevel == 1 then SetVariable("JumpLandMoveDirection", GetVariable("MoveDirection")) ExecEventNoReset("W_Jump_Land_To_Run") return end if landIndex > 0 then ResetRequest() end if JUMP_STATE_1 == 1 then ExecEventNoReset("W_Jump_Land_N") elseif JUMP_STATE_2 == 1 then ExecEventNoReset("W_Jump_Land_F") elseif JUMP_STATE_3 == 1 then ExecEventNoReset("W_Jump_Land_D") else ExecEventNoReset("W_Jump_Land_N") end return end end function Jump_Loop_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_LandAttack_Normal_onActivate() act(ResetInputQueue) SetAIActionState() end function Jump_LandAttack_Normal_onUpdate() SetAIActionState() if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function Jump_LandAttack_Normal_onDeactivate() SetVariable("JumpAttackForm", 0) SetVariable("SwingPose", 0) end function Jump_LandAttack_Hard_onActivate() act(ResetInputQueue) SetAIActionState() end function Jump_LandAttack_Hard_onUpdate() SetAIActionState() if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function Jump_LandAttack_Hard_onDeactivate() SetVariable("JumpAttackForm", 0) SetVariable("SwingPose", 0) end function JumpLandCommonFunction() SetEnableAimMode() if env(GetSpEffectID, 141) == TRUE then if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_Jump_LandAttack_Normal", "W_Jump_LandAttack_Hard", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_Jump_LandAttack_Normal", "W_Jump_LandAttack_Hard", QUICKTYPE_ROLLING) == TRUE then if GetEquipType(arrowHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) == TRUE then ShotArrow() end return TRUE end elseif GetVariable("JumpAttackForm") == 1 or GetVariable("JumpAttackForm") == 2 or GetVariable("JumpAttackForm") == 3 then if env(GetEventEzStateFlag, 0) == TRUE and ExecArrowBothJumpLandAttack() == TRUE then return TRUE end local r1 = "W_AttackRightLightSubStart" local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" b1 = "W_AttackBothLight1" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight2", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return TRUE end elseif EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return TRUE end return FALSE end function Jump_Land_N_onUpdate() if JumpLandCommonFunction() == TRUE then return end end function Jump_Land_N_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Jump_Land_F_onUpdate() if JumpLandCommonFunction() == TRUE then return end end function Jump_Land_D_onUpdate() if JumpLandCommonFunction() == TRUE then return end end function Jump_Attack_Land_F_onUpdate() if JumpLandCommonFunction() == TRUE then return end if env(GetSpEffectID, 146) == TRUE then SetVariable("SwingPose", 4) hkbFireEvent("W_Jump_Land_N") return end end function Jump_Land_To_Run_onUpdate() act(SwitchMotion, TRUE) SetEnableAimMode() SetVariable("JumpLandMoveDirection", GetVariable("MoveDirection")) SetVariable("MoveSpeedLevelReal", 1) if ExecStop() == TRUE then return end if env(IsMoveCancelPossible) == TRUE and MoveStart(ALLBODY, Event_MoveLong, FALSE) == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_NORMAL) == TRUE then return end end function Jump_Land_To_Dash_onUpdate() act(LockonFixedAngleCancel) SetEnableAimMode() SetVariable("MoveSpeedLevelReal", 2) if ExecStop() == TRUE then return end if env(IsMoveCancelPossible) == TRUE and MoveStart(ALLBODY, Event_MoveLong, FALSE) == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightDash", "W_AttackRightHeavyDash", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothDash", "W_AttackBothHeavyDash", QUICKTYPE_NORMAL) == TRUE then return end end function JumpDamage_Start_onActivate() act(ResetInputQueue) end function JumpDamage_Start_onUpdate() JUMP_STATE_1 = 1 JUMP_STATE_2 = 0 JUMP_STATE_3 = 0 act(DenyEventAnimPlaybackRequest) local height = env(GetFallHeight) / 100 local damage_type = env(GetReceivedDamageType) if env(GetSpEffectID, 19935) == TRUE then if env(IsHamariFallDeath, 20) == TRUE then ExecEventAllBody("W_FallDeath") return end elseif env(IsHamariFallDeath, 12) == TRUE then ExecEventAllBody("W_FallDeath") return end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE then hkbFireEvent("W_JumpDamage_Land") return end end function JumpDamage_Land_onActivate() act(ResetInputQueue) end function JumpDamage_Land_onUpdate() act(DenyEventAnimPlaybackRequest) if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function SetStealthState(state) SetVariable("StealthState", state) end function Stealth_Deactivate() SetStealthState(STEALTH_NONE) end function StealthActionCommonFunction(fall_type, r1, r2, l1, l2, b1, b2, quick_type) SetAIActionState() SetEnableAimMode() if ExecPassiveAction(FALSE, fall_type, FALSE) == TRUE then return TRUE end if ExecJump() == TRUE then return TRUE end if ExecHandChange(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, ALLBODY) == TRUE then return TRUE end if ExecWeaponChange(ALLBODY) == TRUE then return TRUE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end if ExecItem(quick_type, ALLBODY) == TRUE then return TRUE end if ExecMagic(quick_type, ALLBODY, FALSE) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if ExecAttack(r1, r2, l1, l2, b1, b2, FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_MoveLong, FALSE) == TRUE then return TRUE end return FALSE end function StealthAttackArrow_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) end function StealthAttackArrowStart_Upper_onActivate() act(ResetInputQueue) end function StealthAttackArrowStart_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_StealthAttackArrowLoop, blend_type) return else ExecEventAllBody("W_StealthAttackArrowShot") return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_StealthAttackArrowLoop, blend_type) return else ExecEventAllBody("W_StealthAttackArrowShot") return end end if ArrowLowerCommonFunction(Event_StealthAttackArrowStart, lower_state, FALSE) == TRUE then return end end function StealthAttackArrowStartContinue_Upper_onActivate() act(ResetInputQueue) end function StealthAttackArrowStartContinue_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ShotArrow() if g_ArrowSlot == 0 then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_StealthAttackArrowLoop, blend_type) return else ExecEventAllBody("W_StealthAttackArrowShot") return end elseif env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_StealthAttackArrowLoop, blend_type) return else ExecEventAllBody("W_StealthAttackArrowShot") return end end if ArrowLowerCommonFunction(Event_StealthAttackArrowStartContinue, lower_state, FALSE) == TRUE then return end end function StealthAttackArrowLoop_Upper_onUpdate() act(SetIsPreciseShootingPossible) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if g_ArrowSlot == 0 then if 0 >= env(ActionDuration, ACTION_ARM_R1) then ShotArrow() ExecEventAllBody("W_StealthAttackArrowShot") return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ShotArrow() ExecEventAllBody("W_StealthAttackArrowShot") return end if ArrowLowerCommonFunction(Event_StealthAttackArrowLoop, lower_state, FALSE) == TRUE then return end end function StealthAttackArrowShot_onUpdate() act(SetIsPreciseShootingPossible) SetStealthState(STEALTH_ATTACK_ARROWSHOT) if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(GetStamina) > 0 then local request = GetAttackRequest(FALSE) local hand = HAND_RIGHT local IsContinue = FALSE if request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then IsContinue = TRUE elseif request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 then IsContinue = TRUE hand = HAND_LEFT end if IsContinue == TRUE then if env(GetEquipWeaponCategory, hand) ~= WEAPON_CATEGORY_LARGE_ARROW then if env(IsOutOfAmmo, hand) == TRUE then ExecEventAllBody("W_NoArrow") return else SetVariable("NoAmmo", 0) ShotArrow() ExecEventHalfBlend(Event_StealthAttackArrowStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, hand) == TRUE then ExecEventAllBody("W_NoArrow") return else ShotArrow() ExecEventHalfBlend(Event_StealthAttackArrowStartContinue, ALLBODY) return end end end if env(IsMoveCancelPossible) == TRUE then if 0 < GetVariable("MoveSpeedLevel") then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return else hkbFireEvent("W_Stealth_Idle") return end end end function StealthItemOneShot_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function StealthItemOneShot_SelfTrans_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function StealthItemDrinkStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end local isEnd = env(IsAnimEnd, 1) if env(GetEventEzStateFlag, 0) == TRUE or isEnd == TRUE then local item_type = env(GetItemAnimType) if item_type ~= ITEM_NO_DRINK then ExecEventHalfBlendNoReset(Event_StealthItemDrinking, blend_type) return elseif item_type == ITEM_NO_DRINK and isEnd == TRUE then ExecEventHalfBlendNoReset(Event_StealthItemDrinkEmpty, blend_type) return end end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function StealthItemDrinking_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_StealthItemDrinkEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function StealthItemDrinkEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function StealthItemDrinkEmpty_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function StealthItemDrinkNothing_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) elseif lower_state == LOWER_TURN then SetVariable("TurnType", TURN_TYPE_STANCE) end if StealthItemCommonFunction(blend_type) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_StealthItemOneShot, lower_state, FALSE) == TRUE then return end end function Stealth_to_Stealth_Idle_onUpdate() act(SwitchMotion, TRUE) act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetEnableAimMode() SetStealthState(STEALTH_TO_STEALTHIDLE) SpeedUpdate() StealthTransitionIndexUpdate() if GetVariable("MoveSpeedIndex") == 2 then act(LockonFixedAngleCancel) end if env(IsMoveCancelPossible) == TRUE and GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return end if StealthActionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStealth", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStealth", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function Stealth_to_Idle_onUpdate() act(SwitchMotion, TRUE) act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetEnableAimMode() SetStealthState(STEALTH_TO_IDLE) SpeedUpdate() StealthTransitionIndexUpdate() if GetVariable("MoveSpeedIndex") == 2 then act(LockonFixedAngleCancel) end if env(IsMoveCancelPossible) == TRUE and GetVariable("MoveSpeedLevel") > 0 then MoveStart(ALLBODY, Event_Move, FALSE) return else end if StealthActionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStealth", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStealth", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function Stealth_Idle_onUpdate() act(Wait) act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetEnableAimMode() SetStealthState(STEALTH_IDLE) if IdleCommonFunction() == TRUE then return end if ExecArtsStance(ALLBODY) == TRUE then return end if ExecGuard(Event_GuardStart, ALLBODY) == TRUE then return end end function Stealth_Move_onActivate() act(SwitchMotion, TRUE) end function Stealth_Move_onUpdate() act(SwitchMotion, TRUE) local move_speed = GetVariable("MoveSpeedIndex") if move_speed == 2 then SetThrowAtkInvalid() end if g_TimeActEditor_08 >= 1 then act(Set4DirectionMovementThreshold, GetVariable("MagicRightWalkAngle_FrontLeft"), GetVariable("MagicRightWalkAngle_FrontRight"), GetVariable("MagicRightWalkAngle_BackLeft"), GetVariable("MagicRightWalkAngle_BackRight")) elseif 1 <= g_TimeActEditor_09 then act(Set4DirectionMovementThreshold, GetVariable("MagicLeftWalkAngle_FrontLeft"), GetVariable("MagicLeftWalkAngle_FrontRight"), GetVariable("MagicLeftWalkAngle_BackLeft"), GetVariable("MagicLeftWalkAngle_BackRight")) elseif hkbGetVariable("MoveType") < 0.5 then act(Set4DirectionMovementThreshold, 60, 45, 60, 60) elseif hkbGetVariable("StanceMoveType") == 0 then act(Set4DirectionMovementThreshold, 70, 40, 60, 20) else act(Set4DirectionMovementThreshold, 40, 70, 60, 20) end SpeedUpdate() if env(IsCOMPlayer) == TRUE then local npc_turn_speed = 240 if move_speed == 2 then npc_turn_speed = 180 else local dir = GetVariable("MoveDirection") if dir == 0 then npc_turn_speed = 90 end end SetTurnSpeed(npc_turn_speed) end if hkbGetVariable("MoveDirection") == 3 or hkbGetVariable("MoveDirection") == 2 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 1 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 0 then act(SetMovementScaleMult, 0.98) end end function Stealth_Move_Upper_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() if MoveCommonFunction(UPPER) == TRUE then return end end function StealthStopCommonFunction(is_dash_stop) act(Wait) act(SwitchMotion, TRUE) act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetEnableAimMode() SetStealthState(STEALTH_STOP) if StopCommonFunction(is_dash_stop) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Stealth_Idle") return TRUE end return FALSE end function StealthDashStop_onUpdate() if StealthStopCommonFunction(TRUE) == TRUE then return end end function StealthRunStopFront_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function StealthRunStopBack_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function StealthRunStopLeft_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function StealthRunStopRight_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function Stealth_Rolling_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() SetStealthState(STEALTH_ROLLING) if env(IsAnimEnd, 1) == TRUE then hkbFireEvent("W_Stealth_Idle") return end if env(IsMoveCancelPossible) == TRUE and MoveStart(ALLBODY, Event_Stealth_Move, FALSE) == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end SetRollingTurnCondition(FALSE) end function Stealth_RollingSelftrans_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() SetStealthState(STEALTH_ROLLING_SELFTRANS) if env(IsAnimEnd, 1) == TRUE and MoveStart(ALLBODY, Event_Stealth_Move, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE and GetVariable("MoveSpeedLevel") <= 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end SetRollingTurnCondition(TRUE) end function AddBlendSpeak_onUpdate() if env(IsAnimEnd, 2) == TRUE then SetVariable("AddBlendSpeakIndex", math.random(0, 2)) act(DebugLogOutput, "AddBlendSpeak_end") ExecEventAllBody("W_AddBlendSpeak") end end local blendtimemax = 0 local blendtime = 0 local EVENT_BLEND_RATE = 1000 ------------------------------------------ -- Must be last for the global variables to be read ------------------------------------------ global = {} function dummy() end global.__index = function(table, element) return dummy end setmetatable(_G, global)