------------------------------------------ -- Fixed decompiled c0000.hks for ELDEN RING -- Refined from decompiles by Vawser -- Curated at: https://github.com/ividyon/EldenRingHKS ------------------------------------------ -- Version 16 (For ER HKS last updated in 1.15.1) ------------------------------------------ -- Changelog: -- 2022-12-15 - AshenOne: ExecMagic (line 2090), moving an if block so left-hand casting works as intended -- 2022-12-16 - ivi: Updated for 1.08.1 -- 2022-12-28 - Kirnifr: fixed Torrent dash -- 2023-01-27 - Massive overhaul and improvements by Vawser from Vigil -- Properly fixes Torrent dash as well as flick animation issues -- proper act/env naming instead of IDs, proper spacing, useful comments -- 2023-01-27 - Minor oversight fixes -- 2023-01-27 - Put on GitHub via philiquaz' initiative -- 2023-02-14 - Minor comment changes -- 2023-03-19 - Support for custom Ashes of War -- 2023-09-22 - Halvard: updated for 1.10 -- - fixed the function declaration of "ExecComboMagic", it was missing two parameters. -- - removed an "act(SetAttackType, -1)" from the function "DamageBind_onUpdate()", -- all act 109 were removed many patches ago, this one was overlooked when updating this file. -- - Updated the function "DrawStanceRightLoop_Upper_onUpdate()" to match changes done in 1.09 -- that change the follow-up attacks done after the "spinning wheel" ash of war. -- - Added a note in the "ExecJump()" function, as it is changed compared to the raw decompile -- I'm not sure if this was intended by previous authors of this file or simply a mistake. -- For now I'm only adding a note to highlight that it was changed and leaving it at that. -- - manually read through the entire file to make sure no other changes done by -- FromSoftware in previous patch updates were still missing. -- 2024-06-28 - Exelot: Updated to ER v1.12.1 [DLC Initial Release] -- - Recreated the entire HKS file from a fresh (raw) decompiled. -- This added all the new functions that were missing. -- It also fixed a bunch of logic that was incorrect due to the non-raw decompile. -- The reason for this is because of the attempt on a 1-on-1 update had a lot of issues with it. -- - Fixed a error in ExecAttack where the 9 in arts_cat == 9 replaced with: -- SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD instead of -- SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD. -- - Reintroduced missing variables that were in use (blend time related). -- - Recreation fixed the torrent bugs -- 2024-06-29 - ivi: Fixed a bug with IsAttackSwordArts which prevented Ashes of War from working -- 2024-07-17 - Exelot: -- - Fixed a bug with SetSwordArtsPointInfo causing various ashes to not having the right Ash of War -- while not having enough stats. -- - Added a missing check for jumping. -- - Fixed a bug that would cause Ashes of War such as Carian Grandeur to not have the ability to be cast uncharged. -- 2024-07-18 - ivi: Fixed SwordArtsDiffCategory & SwordArtsPutOppositeWeapon function changes not carried over from new common_define (Twinblade AotC: Wings) -- 2024-07-23 - Exelot: -- - Renamed env GetWeaponID into a less confusing name: GetSwordArtID -- - Renamed act Test_SpEffectDelete into ClearSpEffect and added a comment for it's args. -- - Added a new logic expansion section with a new function that allows for easy addition of new Weapon Catalysts. -- 2024-07-30 - Exelot: Updated to ER v1.13 -- 2024-08-29 - ivi: Fixed SwordArtsCategory table missing variations of existing arts for new weapon types -- 2024-09-11 - Exelot: Updated to ER v1.14 -- 2024-10-02 - ivi: Updated to ER v1.15 -- 2024-10-03 - Exelot: Named almost all remaining acts and envs thanks to a list provided by ElaDiDu. Some of the existing ones have been renamed. ------------------------------------------ -- Known issues: -- N/A ------------------------------------------ -- UnlockLockOn ------------------------------------------ function UnlockLockOn() if env(GetSpEffectID, 102050) == TRUE then act(LockonFixedAngleCancel) end end ------------------------------------------ -- Idle Anim Jumper ------------------------------------------ function VIZZO_MainUpdate() VIZZO_AnimJumper() end function VIZZO_AnimJumper() if (env(1116, 9000000) == TRUE) then -- Anim Cancel ExecEventAllBody("W_Idle") act(AddSpEffect, 9000100) end end ------------------------------------------ -- Air Dash ------------------------------------------ mod_AirDashFrameCount = 0 mod_AirDashCount = 0 mod_AirDashDisableHold = 0 function ModAirDash() if env(ActionDuration, ACTION_ARM_L3) > 0 then mod_AirDashDisableHold = mod_AirDashDisableHold + 1 else mod_AirDashDisableHold = 0 end if env(IsLanding) == FALSE and env(IsSummoningRide) == FALSE and mod_AirDashDisableHold < 9 then mod_AirDashFrameCount = mod_AirDashFrameCount + 1 if mod_AirDashFrameCount > 10 and env(ActionDuration, ACTION_ARM_L3) > 0 and mod_AirDashCount < 1 then mod_AirDashCount = mod_AirDashCount +1 ModExecAirDash() end end end function ModExecAirDash() local weight = math.mod(env(GetMoveAnimParamID), 20) if weight == WEIGHT_LIGHT then SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_OVERWEIGHT) elseif weight == WEIGHT_NORMAL then SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_OVERWEIGHT) elseif weight == WEIGHT_HEAVY then SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_OVERWEIGHT) end ExecEvent("W_Rolling") end function ModDoubleJump() if env(IsLanding) == TRUE then mod_AirDashFrameCount = 0 mod_AirDashCount = 0 end 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, 503520) == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) elseif env(GetSpEffectID, 5520) == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) elseif env(GetSpEffectID, 425) == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) elseif env(GetSpEffectID, 4101) == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) elseif env(GetSpEffectID, 4100) == TRUE and weight ~= WEIGHT_OVERWEIGHT then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) elseif env(GetSpEffectID, 19670) == 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.0010000000474974513 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 and (style == HAND_LEFT_BOTH or style == HAND_RIGHT_BOTH) then 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 env(GetSpEffectID, 102000) == 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.3499999940395355 SetVariable("ToggleDash", 0) SetWeightIndex() if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT and stop_speed > 0.3499999940395355 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 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if env(IsOnMount) == TRUE then return FALSE end if style ~= HAND_LEFT_BOTH and c_SwordArtsHand == 0 then if IsWeaponCatalyst(sp_kind) == TRUE then return FALSE end if IsShieldArts(arts_id) == TRUE then return TRUE else return FALSE end else if style == HAND_RIGHT and IsWeaponCatalyst(sp_kind) == 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, -- Raptor of the Mists 160 -- White Shadow's Lure } local aow_whitelist = { 273, -- Raging Beast 276, -- Blind Spot 313, -- Dynastic Sickleplay 348 -- Discus Hurl } if IsShieldArts(arts_id) == TRUE or IsRollingArts(arts_id) == TRUE or IsEnchantArts(arts_id) == TRUE or Contains(aow_blacklist, arts_id) == TRUE then if Contains(aow_whitelist, arts_id) then return TRUE else return FALSE end else return TRUE end end function IsHalfBlendArts(arts_id) local aow_list = { 13, -- Prelate Charge 16, -- Giant Hunt 20, -- Spinning Weapon 33, -- New BloodTax 50, -- Glintblade Phalanx 58, -- Gravitas 66, -- Carian Grandeur 69, -- Black Flame Tornado 71, -- Firebreather 72, -- Blood Blade 73, -- Phantom Slash 76, -- Poisonous Mist 110, -- Hoarfrost Stomp 130, -- Determination 132, -- Assassin Gambit 133, -- Golden Vow 134, -- Sacred Order 135, -- Shared Order 140, -- Barbaric Roar 142, -- Beast Roar 144, -- Braggart Roar 150, -- Endure 151, -- Vow of the Indomitable 152, -- Holy Ground 157, -- Raptor of Mist 160, -- White Shadow Lure 168, -- Zamor Ice Storm 173, -- Nebula 174, -- Death Flare 182, -- Knowledge Above All 183, -- Devourer of Worlds 184, -- Familal Rancor 192, -- Sorcery of the Crozier 195, -- Fires of Slumber 197, -- Contagious Fury 199, -- Spinning Weapon 200, -- Surge of Faith 202, -- Tongues of Fire 203, -- Oracular Bubble 204, -- Bubble Shower 205, -- Great Oracular Bubble 206, -- Sea of Magma 208, -- Moonlight Greatsword 209, -- Siluria Woe 210, -- Rallying Standard 212, -- Eochaid Dancing Blade 213, -- Soul Stifler 215, -- Shriek of Milos 216, -- Reduvia Blood Blade 217, -- Glintstone Dart 219, -- Night and Flame Stance 222, -- Establish Order 224, -- Spearcall Ritual 234, -- Bloodboon Ritual 242, -- Oath of Vengeance 253, -- Last Rites 348, -- Discus Hurl 349, -- Flower Dragonbolt 356, -- Jori Inquisition 358, -- Deadly Poison Spray 361, -- Scattershot Claws 368, -- Bloodfiend Bloodboon 369, -- Dragonform Flame 262, -- Piercing Throw 263, -- Scattershot Throw 264, -- Wall of Sparks 265, -- Rolling Sparks 272, -- Hone Blade 301, -- Needle Piercer 318, -- Moon and Fire Stance 319, -- Devonia Vortex 328, -- Euporia Vortex 334, -- Feeble Lord's Frenzied Flame 335 -- Repeating Fire } if Contains(aow_list, arts_id) == TRUE 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, -- Torch Attack 71, -- Firebreather 90, -- Shield Bash 91, -- Barricade Shield 92, -- Parry 93, -- Buckler Parry 95, -- Carian Retaliation 96, -- Storm Wall 97, -- Golden Parry 98, -- Shield Crash 99, -- Thops's Barrier 151, -- Vow of the Indomitable 152, -- Holy Ground 195, -- Fires of Slumber 196, -- Golden Retaliation 197, -- Contagious Fury 201, -- Flame Spit 202, -- Tongues of Fire 207, -- Viper Bite 211, -- Bear Witness! 322, -- Sleep Evermore 324, -- Moore's Charge 348, -- Discus Hurl 352, -- Revenge of the Night 354, -- Blindfold of Happiness 355, -- Blindfold of Happiness (2?) 359, -- Roaring Bash 399, -- Shield Strike 334 -- Feeble Lord's Frenzied Flame } if Contains(aow_list, arts_id) == TRUE then return TRUE else return FALSE end end function IsStanceArts(arts_id) local aow_list = { 10, -- Wild Strikes 11, -- Spinning Strikes 14, -- Unsheathe 15, -- Square Off 21, -- UNUSED 25, -- Spinning Chain 35, -- Gravitas 100, -- Through and Through 101, -- Barrage 102, -- Mighty Shot 103, -- Enchanted Shot 104, -- UNUSED 105, -- Rain of Arrows 106, -- UNUSED 107, -- UNUSED 108, -- Sky Shot 169, -- Radahn's Rain 178, -- Transient Moonlight 219, -- Night-and-Flame Stance 239, -- Spinning Wheel 278, -- Overhead Stance 279, -- Wing Stance 309, -- Unending Dance 318, -- Moon-and-Fire Stance 335, -- Repeating Fire 337, -- Fan Shot 340, -- UNUSED 341, -- UNUSED 342, -- UNUSED 343, -- UNUSED 346, -- UNUSED 347, -- UNUSED 357, -- Igor's Drake Hunt 371, -- Rancor Shot 377, -- Staff Mastery 378, -- Bloody Dive 379, -- Arch Staff 389 -- Judgement Cut } if Contains(aow_list, arts_id) == TRUE then return TRUE else return FALSE end end function IsArrowStanceArts(arts_id) local aow_list = { 100, -- Through and Through 101, -- Barrage 102, -- Mighty Shot 103, -- Enchanted Shot 104, -- UNUSED 105, -- Rain of Arrows 106, -- UNUSED 107, -- UNUSED 108, -- Sky Shot 169, -- Radahn's Rain 337, -- Fan Shot 357, -- Igor's Drake Hunt 371 -- Rancor Shot } if Contains(aow_list, arts_id) == TRUE then return TRUE else return FALSE end end function IsAttackStanceArts(arts_id) local aow_list = { 10, -- Wild Strikes 11, -- Spinning Strikes 25, -- Spinning Chain 239, -- Spinning Wheel 309, -- Unending Dance 340, -- UNUSED 341 -- UNUSED } if Contains(aow_list, arts_id) == TRUE then return TRUE else return FALSE end end function IsRollingArts(arts_id) local aow_list = { 155, -- Quickstep 156, -- Bloodhound's Step 273, -- Raging Beast 276, -- Blind Spot 313 -- Dynastic Sickleplay } if Contains(aow_list, arts_id) == TRUE then return TRUE else return FALSE end 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 if IsStanceArts(arts_id) == TRUE then 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 then request = SWORDARTS_REQUEST_RIGHT_STEP animID = SWORDARTS_ANIM_ID_RIGHT_STEP_FRONT 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 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, -- Torch Attack 92, -- Parry 93, -- Buckler Parry 94, -- UNUSED 112 -- Kick } local hand = 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 Contains(aow_list_noFPUse, artsID) == TRUE 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 and IsNodeActive("DrawStanceRightAttackLight_Selector") == TRUE then 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 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 then SetVariable("IsEnoughArtPointsL2_DrawStanceRightStart", sel) else SetVariable("IsEnoughArtPointsL2_DrawStanceRightStart", 0) end if artsID == 318 then 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 GetSwordArtsPutOppositeWeapon() == FALSE then SetVariable("ArtsTransition", 0) return 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 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 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 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, MAGIC_REQUEST_QUICKENBULLET, MAGIC_REQUEST_QUICKSLASH, MAGIC_REQUEST_QUICK_FLAME } if (magic_type == MAGIC_REQUEST_WEAPON_ENCHANT2 and c_Style == HAND_RIGHT) or Contains(magic_type_list, magic_type) == TRUE then return TRUE end return FALSE end function IsWeaponEnchantMagic() local magic_type = env(GetMagicAnimType) local magic_type_list = { MAGIC_REQUEST_WEAPON_ENCHANT, MAGIC_REQUEST_WEAPON_ENCHANT2, MAGIC_REQUEST_WEAPON_ENCHANT_B, MAGIC_REQUEST_THUNDER_ENCHANT, MAGIC_REQUEST_HOLY_ENCHANT } if Contains(magic_type_list, magic_type) == TRUE then return TRUE end return FALSE end function IsJumpMagic() local magic_type = env(GetMagicAnimType) local magic_type_list = { MAGIC_REQUEST_FLYING_BREATH, MAGIC_REQUEST_ELDER_DRAGON_BREATH } if Contains(magic_type_list, magic_type) == TRUE then return TRUE end return FALSE end function IsComboMagic() return IsMagicAnimExists(env(GetMagicAnimType), 45020) 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, 114 } if Contains(magic_type_list, magic_type) == TRUE then return TRUE end return FALSE end function IsRollingMagic(magic_type) local magic_type_list = { 127 } if Contains(magic_type_list, magic_type) == TRUE then return TRUE end return FALSE end -- Duchess - Reset dodge combo (removed conditional isduchess) function SetLadyCombo() if SPEED_COMBO_NUMBER_RIGHT == 0 or IsNodeActive("Rolling_CMSG") == TRUE or IsNodeActive("LadyBackStep2_Selector") == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE then else SPEED_COMBO_NUMBER_RIGHT = 0 end if SPEED_COMBO_NUMBER_LEFT == 0 or IsNodeActive("Rolling_CMSG") == TRUE or IsNodeActive("LadyBackStep2_Selector") == TRUE then else SPEED_COMBO_NUMBER_LEFT = 0 end if SPEED_COMBO_NUMBER_BOTH == 0 or IsNodeActive("Rolling_CMSG") == TRUE or IsNodeActive("LadyBackStep2_Selector") == TRUE then else SPEED_COMBO_NUMBER_BOTH = 0 end if SPEED_COMBO_NUMBER_DUAL == 0 or IsNodeActive("Rolling_CMSG") == TRUE or IsNodeActive("LadyBackStep2_Selector") == TRUE then else SPEED_COMBO_NUMBER_DUAL = 0 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) 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) if env(ActionDuration, ACTION_ARM_ACTION) > 0 then request_r1 = FALSE request_r2 = FALSE request_l1 = FALSE request_l2 = FALSE end -- 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if IsWeaponCatalyst(sp_kind) == 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 then 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == 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_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) if request == ATTACK_REQUEST_INVALID then return FALSE end act(DebugLogOutput, "ExecAttack request=" .. request) local style = c_Style local swordartpoint_hand = HAND_RIGHT local atk_hand = HAND_RIGHT local guard_hand = HAND_RIGHT local is_find_atk = TRUE 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 -- 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" if env(GetSpEffectID, 173) == TRUE or env(GetSpEffectID, 174) == 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 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 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 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 -- Unknown: Heavy Special if env(GetSpEffectID, 1721) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown (DLC): Heavy Special if env(GetSpEffectID, 102101) == TRUE then 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 and r1 == "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" then 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 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 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 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 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 return TRUE end return FALSE elseif request == ATTACK_REQUEST_LEFT_REVERSAL then ExecEventAllBody("W_AttackLeftReversal") elseif request == SWORDARTS_REQUEST_LEFT_NORMAL then 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 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 then 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 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 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 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 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 IsHalfBlendArts(c_SwordArtsID) == TRUE then 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.20000000298023224 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 if IsNodeActive("SwordArtsRolling Selector MP") == TRUE or IsNodeActive("SwordArtsRolling Selector MP_SelfTrans2") == TRUE then is_self_trans = TRUE elseif (arts_id == 155 or arts_id == 156) 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.20000000298023224 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 if is_self_trans == TRUE then if arts_id == 155 or arts_id == 156 then 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 env(GetSpEffectID, 102360) == FALSE 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 == 155 or arts_id == 156 then 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 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 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 ExecEventAllBody("W_AttackArrowRightFireStep") elseif c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackArrowStart, ALLBODY) else 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 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 ExecEventAllBody("W_AttackArrowLeftFireStep") elseif c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackArrowStart, ALLBODY) else 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 ExecEventHalfBlend(Event_StealthAttackCrossbowRightStart, blend_type) else 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 ExecEventHalfBlend(Event_StealthAttackCrossbowLeftStart, blend_type) else 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 ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightStart, blend_type) else 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 ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftStart, blend_type) else 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() 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 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_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_WHIP or kind == WEAPON_CATEGORY_PERFUME_BOTTLE or kind == WEAPON_CATEGORY_DUELING_SHIELD or kind == WEAPON_CATEGORY_BEAST_CLAW then max_num = 4 elseif kind == WEAPON_CATEGORY_TWINBLADE or kind == WEAPON_CATEGORY_AX or kind == WEAPON_CATEGORY_HAMMER or kind == WEAPON_CATEGORY_LARGE_RAPIER or kind == WEAPON_CATEGORY_LARGE_KATANA or kind == WEAPON_CATEGORY_EXTRALARGE_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_STRAIGHT_SWORD or kind == WEAPON_CATEGORY_BACKHAND_SWORD or kind == WEAPON_CATEGORY_KATANA or kind == WEAPON_CATEGORY_LARGE_SCYTHE or kind == WEAPON_CATEGORY_LIGHT_LARGE_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) 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 or sp_kind == 265 then return TRUE end if GetEquipType(hand, WEAPON_CATEGORY_RAPIER, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_LARGE_CURVEDSWORD, WEAPON_CATEGORY_LARGE_RAPIER, WEAPON_CATEGORY_SHORT_SWORD, WEAPON_CATEGORY_LARGE_SWORD, WEAPON_CATEGORY_SPEAR, WEAPON_CATEGORY_LARGE_SPEAR, WEAPON_CATEGORY_LARGE_SCYTHE, WEAPON_CATEGORY_STRAIGHT_SWORD, WEAPON_CATEGORY_CLAW, WEAPON_CATEGORY_FIST, WEAPON_CATEGORY_HALBERD, WEAPON_CATEGORY_TWINBLADE, WEAPON_CATEGORY_AX, WEAPON_CATEGORY_LARGE_AX, WEAPON_CATEGORY_HAMMER, WEAPON_CATEGORY_LARGE_HAMMER, WEAPON_CATEGORY_FLAIL, WEAPON_CATEGORY_EXTRALARGE_SWORD, WEAPON_CATEGORY_BEAST_CLAW, WEAPON_CATEGORY_THROW_DAGGER, WEAPON_CATEGORY_LIGHT_LARGE_SWORD, WEAPON_CATEGORY_LARGE_KATANA, WEAPON_CATEGORY_KATANA, WEAPON_CATEGORY_PERFUME_BOTTLE, WEAPON_CATEGORY_BACKHAND_SWORD) == TRUE then 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) --disable dualwield for gunslinger if rightSpecialKind == 269 or leftSpecialKind == 269 then return -1 elseif rightSpecialKind == 272 or leftSpecialKind == 272 then return -1 elseif leftSpecialKind == 66 then return -1 elseif leftSpecialKind == 77 then return -1 elseif leftSpecialKind == 88 then return -1 elseif 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 then 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 then if leftKind == WEAPON_CATEGORY_LARGE_SWORD or leftKind == WEAPON_CATEGORY_LARGE_CURVEDSWORD then 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 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_CURVEDSWORD then if leftKind == WEAPON_CATEGORY_CURVEDSWORD then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_KATANA then if leftKind == WEAPON_CATEGORY_KATANA or leftSpecialKind == 104 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_HAMMER then if leftKind == WEAPON_CATEGORY_HAMMER or leftKind == WEAPON_CATEGORY_LARGE_AX then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_AX then if leftKind == WEAPON_CATEGORY_AX or leftKind == WEAPON_CATEGORY_HAMMER 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 then if leftKind == WEAPON_CATEGORY_LARGE_AX or leftKind == WEAPON_CATEGORY_LARGE_HAMMER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_HAMMER then if leftKind == WEAPON_CATEGORY_LARGE_HAMMER or leftKind == WEAPON_CATEGORY_LARGE_AX 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 end elseif rightKind == WEAPON_CATEGORY_LARGE_SPEAR then if leftKind == WEAPON_CATEGORY_LARGE_SPEAR then return HAND_RIGHT 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 end elseif rightKind == WEAPON_CATEGORY_LARGE_CURVEDSWORD then if leftKind == WEAPON_CATEGORY_LARGE_CURVEDSWORD or leftKind == WEAPON_CATEGORY_LARGE_SWORD then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_FIST then if 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 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 then if leftKind == WEAPON_CATEGORY_LARGE_KATANA 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) -- 110 Broadsword -- 182 Morning Star -- 207 Serpent-Hunter -- 832 Starscourge Greatsword -- 852 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 specialcategory == 110 or specialcategory == 832 or specialcategory == 852 or specialcategory == 255 or specialcategory == 257 then return FALSE end if specialcategory == 182 or specialcategory == 207 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 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 then 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 then 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 sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local buttonR = ACTION_ARM_MAGIC_R local buttonL = ACTION_ARM_MAGIC_L if IsWeaponCatalyst(sp_kind_R) == TRUE then buttonR = ACTION_ARM_MAGIC_R2 end if IsWeaponCatalyst(sp_kind_L) == TRUE and is_ride == FALSE then buttonL = ACTION_ARM_MAGIC_L2 end if env(ActionRequest, buttonL) == TRUE and env(ActionRequest, buttonR) == FALSE and is_ride == TRUE then ResetRequest() return FALSE end -- 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 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 then delayActRequestNo = ACTION_ARM_MAGIC_R2 if style == HAND_LEFT_BOTH then local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == FALSE then return FALSE end wep_hand = HAND_LEFT else local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if IsWeaponCatalyst(sp_kind) == 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 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 if style == HAND_RIGHT then local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT else return FALSE end 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) 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(IsMagicUseable, wep_hand, 0) == FALSE 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 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(env(GetEquipWeaponSpecialCategoryNumber, wep_hand)) == TRUE then SetVariable("Magic_SpecialStaffCategory", 0) 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 then SetVariable("Magic_SpecialStaffCategory", 0) 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 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 ExecEventHalfBlend(Event_QuickMagicFireRightDash, blend_type) return TRUE else ExecEventHalfBlend(Event_QuickMagicFireLeftDash, blend_type) return TRUE end elseif quick_type == QUICKTYPE_ROLLING then if magic_hand == HAND_RIGHT then ExecEventHalfBlend(Event_QuickMagicFireRightStep, blend_type) return TRUE else ExecEventHalfBlend(Event_QuickMagicFireLeftStep, blend_type) return TRUE end elseif quick_type == QUICKTYPE_BACKSTEP then if magic_hand == HAND_RIGHT then 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 ExecEventHalfBlend(Event_QuickMagicFireRightAttackRight, blend_type) return TRUE else ExecEventHalfBlend(Event_QuickMagicFireLeftAttackRight, blend_type) return TRUE end elseif magic_hand == HAND_RIGHT then ExecEventHalfBlend(Event_QuickMagicFireRightAttackLeft, blend_type) return TRUE else 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 ExecEventAllBody("W_RideMagicFireCombo1") return TRUE elseif env(GetSpEffectID, 100601) == TRUE then ExecEventAllBody("W_RideMagicFireCombo2") return TRUE else return FALSE end elseif magic_hand == HAND_RIGHT then if env(GetSpEffectID, 100600) == TRUE then ExecEventHalfBlend(Event_MagicFireRight2, blend_type) return TRUE elseif env(GetSpEffectID, 100601) == TRUE then ExecEventHalfBlend(Event_MagicFireRight3, blend_type) return TRUE else return FALSE end elseif env(GetSpEffectID, 100605) == TRUE then ExecEventHalfBlend(Event_MagicFireLeft2, blend_type) return TRUE elseif env(GetSpEffectID, 100606) == TRUE then 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 ExecEventHalfBlend(Event_StealthMagicRightLaunch, blend_type) return TRUE else 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.10000000149011612 then if magic_hand == HAND_RIGHT then ExecEventHalfBlend(Event_MagicFireRight, blend_type) return TRUE else ExecEventHalfBlend(Event_MagicFireLeft, blend_type) return TRUE end elseif magic_hand == HAND_RIGHT then ExecEventHalfBlend(Event_RollingMagicRight, blend_type) return TRUE else 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 -- 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 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 == 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 == 25 then ExecEventHalfBlend(Event_ItemDragonFullStartAfter, blend_type) elseif item_type == 26 then ExecEventHalfBlend(Event_ItemEatJerky, blend_type) elseif item_type == 27 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.8999999761581421 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 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 event = "W_ItemLadderRecover" elseif item_type == ITEM_SOUL then event = "W_ItemLadderSoul" elseif item_type == ITEM_EATJERKY then 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 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() -- 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 if env(GetSpEffectID, 102360) == FALSE then 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.009999999776482582 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.009999999776482582) 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.6000000238418579 then JumpMoveLevel = 1 end -- Ironjar Aromatic if env(GetSpEffectID, 503520) == TRUE then JumpMoveLevel = 0 -- Unknown elseif env(GetSpEffectID, 5520) == TRUE then JumpMoveLevel = 0 -- Slug: Slow elseif env(GetSpEffectID, 425) == TRUE then JumpMoveLevel = 0 -- Sanguine Noble: Slow elseif env(GetSpEffectID, 4101) == TRUE then JumpMoveLevel = 0 -- Sanguine Noble: Slow elseif env(GetSpEffectID, 4100) == TRUE then JumpMoveLevel = 0 -- Unknown (DLC) elseif env(GetSpEffectID, 19670) == TRUE then JumpMoveLevel = 0 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.009999999776482582 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.009999999776482582) 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.6000000238418579 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 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 env(GetSpEffectID, 102360) == FALSE then 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 ResetDamageCount() if env(GetStamina) <= 0 then ResetRequest() return FALSE end if env(GetSpEffectID, 102360) == FALSE then 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 elseif height > 20 and env(IsInvincibleDebugMode) == FALSE and env(GetStateChangeType, 266) == FALSE then return TRUE 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 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) ExecEventAllBody("W_DeathStart") return TRUE elseif env(GetSpEffectID, 19700) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_CRY) ExecEventAllBody("W_DeathStart") return TRUE elseif env(GetSpEffectID, 102351) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_SLEEP) 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") return TRUE end if env(GetDamageSpecialAttribute, 6) == TRUE then ExecEventAllBody("W_DamageMad") return TRUE end if env(GetDamageSpecialAttribute, 2) == TRUE or env(GetDamageSpecialAttribute, 4) == TRUE then 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 -- Raptors of the Mist Dodge if env(GetSpEffectID, 100500) == TRUE then ExecEventAllBody("W_SwordArtsStandDodge") 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_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 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 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) 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 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 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(SetCanChangeEquipmentOn) 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.2999999523162842 then local landIndex = GetLandIndex(height, is_jump) SetVariable("LandIndex", landIndex) Replanning() local JumpMoveLevel = 0 if landIndex ~= LAND_HEAVY then if GetVariable("MoveSpeedLevel") > 1.100000023841858 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6000000238418579 then JumpMoveLevel = 1 end end if env(GetSpEffectID, 503520) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 5520) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 425) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 4101) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 4100) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 19670) == 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.30000001192092896 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.20000000298023224 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) 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 env(GetSpEffectID, 102000) == 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOff) 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(SetCanChangeEquipmentOn) 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(SetCanChangeEquipmentOff) 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.100000023841858 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(SetCanChangeEquipmentOff) 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(SetCanChangeEquipmentOff) 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(SetCanChangeEquipmentOn) 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 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 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() act(DebugLogOutput, "Rolling_SpeedRight=" .. SPEED_COMBO_NUMBER_RIGHT) if env(GetSpEffectID, 100390) == TRUE then ResetDamageCount() end SetEnableAimMode() if env(GetSpEffectID, 701530) == TRUE and GetVariable("RollingVariationIndex") == ROLLING_HIGHGUARD then local guardindex = GUARD_STYLE_HIGHGUARD SetVariable("IndexGuardStyle", guardindex) local hand = HAND_LEFT if c_Style == HAND_RIGHT_BOTH then hand = HAND_RIGHT end act(DebugLogOutput, "Guard_Activate ( ) ") SetGuardHand(hand) if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end local blend_type, lower_state = GetHalfBlendInfo() if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventHalfBlend(Event_GuardOn, blend_type) return end else local r1 = "W_AttackRightLightStep" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLightStep" if SPEED_COMBO_NUMBER_RIGHT == 1 and (IsEnableNextAttack(1, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight2" elseif SPEED_COMBO_NUMBER_RIGHT == 2 and (IsEnableNextAttack(2, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight3" elseif SPEED_COMBO_NUMBER_RIGHT == 3 and (IsEnableNextAttack(3, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight4" elseif SPEED_COMBO_NUMBER_RIGHT == 4 and (IsEnableNextAttack(4, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight5" elseif SPEED_COMBO_NUMBER_RIGHT == 5 and (IsEnableNextAttack(5, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight6" end if SPEED_COMBO_NUMBER_LEFT == 1 and IsEnableNextAttack(1, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy2" elseif SPEED_COMBO_NUMBER_LEFT == 2 and IsEnableNextAttack(2, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy3" elseif SPEED_COMBO_NUMBER_LEFT == 3 and IsEnableNextAttack(3, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy4" elseif SPEED_COMBO_NUMBER_LEFT == 4 and IsEnableNextAttack(4, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy5" elseif SPEED_COMBO_NUMBER_LEFT == 5 and IsEnableNextAttack(5, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy6" end if SPEED_COMBO_NUMBER_BOTH == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight2" elseif SPEED_COMBO_NUMBER_BOTH == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight3" elseif SPEED_COMBO_NUMBER_BOTH == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight4" elseif SPEED_COMBO_NUMBER_BOTH == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight5" elseif SPEED_COMBO_NUMBER_BOTH == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight6" end if SPEED_COMBO_NUMBER_DUAL == 1 and GetDualAttackMaxNumber(HAND_RIGHT) >= 2 then l1 = "W_AttackLeftLight2" elseif SPEED_COMBO_NUMBER_DUAL == 2 and 3 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight3" elseif SPEED_COMBO_NUMBER_DUAL == 3 and GetDualAttackMaxNumber(HAND_RIGHT) >= 4 then l1 = "W_AttackLeftLight4" elseif SPEED_COMBO_NUMBER_DUAL == 4 and GetDualAttackMaxNumber(HAND_RIGHT) >= 5 then l1 = "W_AttackLeftLight5" elseif SPEED_COMBO_NUMBER_DUAL == 5 and 6 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight6" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, l2, b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end end SetRollingTurnCondition(FALSE) SPEED_COMBO_ALLOW_ROLL = FALSE end function Rolling_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Rolling_Selftrans_onUpdate() act(DisallowAdditiveTurning, TRUE) if IsDemonSwordMode() == FALSE then SetThrowAtkInvalid() end act(DebugLogOutput, "Rolling_Selftrans_SpeedRight=" .. SPEED_COMBO_NUMBER_RIGHT) if env(GetSpEffectID, 100390) == TRUE then ResetDamageCount() end if env(GetSpEffectID, 701530) == TRUE and GetVariable("RollingVariationIndex") == ROLLING_HIGHGUARD then local guardindex = GUARD_STYLE_HIGHGUARD SetVariable("IndexGuardStyle", guardindex) local hand = HAND_LEFT if c_Style == HAND_RIGHT_BOTH then hand = HAND_RIGHT end act(DebugLogOutput, "Guard_Activate ( ) ") SetGuardHand(hand) if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end local blend_type, lower_state = GetHalfBlendInfo() if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventHalfBlend(Event_GuardOn, blend_type) return end else SetEnableAimMode() local r1 = "W_AttackRightLightStep" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLightStep" if SPEED_COMBO_NUMBER_RIGHT == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight2" elseif SPEED_COMBO_NUMBER_RIGHT == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight3" elseif SPEED_COMBO_NUMBER_RIGHT == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight4" elseif SPEED_COMBO_NUMBER_RIGHT == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight5" elseif SPEED_COMBO_NUMBER_RIGHT == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight6" end if SPEED_COMBO_NUMBER_LEFT == 1 and IsEnableNextAttack(1, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy2" elseif SPEED_COMBO_NUMBER_LEFT == 2 and IsEnableNextAttack(2, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy3" elseif SPEED_COMBO_NUMBER_LEFT == 3 and IsEnableNextAttack(3, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy4" elseif SPEED_COMBO_NUMBER_LEFT == 4 and IsEnableNextAttack(4, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy5" elseif SPEED_COMBO_NUMBER_LEFT == 5 and IsEnableNextAttack(5, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy6" end if SPEED_COMBO_NUMBER_BOTH == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight2" elseif SPEED_COMBO_NUMBER_BOTH == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight3" elseif SPEED_COMBO_NUMBER_BOTH == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight4" elseif SPEED_COMBO_NUMBER_BOTH == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight5" elseif SPEED_COMBO_NUMBER_BOTH == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight6" end if SPEED_COMBO_NUMBER_DUAL == 1 and GetDualAttackMaxNumber(HAND_RIGHT) >= 2 then l1 = "W_AttackLeftLight2" elseif SPEED_COMBO_NUMBER_DUAL == 2 and 3 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight3" elseif SPEED_COMBO_NUMBER_DUAL == 3 and GetDualAttackMaxNumber(HAND_RIGHT) >= 4 then l1 = "W_AttackLeftLight4" elseif SPEED_COMBO_NUMBER_DUAL == 4 and GetDualAttackMaxNumber(HAND_RIGHT) >= 5 then l1 = "W_AttackLeftLight5" elseif SPEED_COMBO_NUMBER_DUAL == 5 and 6 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight6" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, l2, b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end end SetRollingTurnCondition(TRUE) SPEED_COMBO_ALLOW_ROLL = FALSE end function Rolling_Selftrans_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function DefaultBackStep_onActivate() ResetDamageCount() end function DefaultBackStep_onUpdate() act(SetCanChangeEquipmentOff) 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 LadyBackStep_onActivate() ResetDamageCount() end function LadyBackStep_onUpdate() 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 LadyBackStep_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function LadyBackStep2_onActivate() ResetDamageCount() end function LadyBackStep2_onUpdate() act(DisallowAdditiveTurning, TRUE) local r1 = "W_AttackRightBackstep" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothBackstep" if SPEED_COMBO_NUMBER_RIGHT == 1 and (IsEnableNextAttack(1, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight2" elseif SPEED_COMBO_NUMBER_RIGHT == 2 and (IsEnableNextAttack(2, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight3" elseif SPEED_COMBO_NUMBER_RIGHT == 3 and (IsEnableNextAttack(3, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight4" elseif SPEED_COMBO_NUMBER_RIGHT == 4 and (IsEnableNextAttack(4, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight5" elseif SPEED_COMBO_NUMBER_RIGHT == 5 and (IsEnableNextAttack(5, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight6" end if SPEED_COMBO_NUMBER_LEFT == 1 and IsEnableNextAttack(1, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy2" elseif SPEED_COMBO_NUMBER_LEFT == 2 and IsEnableNextAttack(2, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy3" elseif SPEED_COMBO_NUMBER_LEFT == 3 and IsEnableNextAttack(3, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy4" elseif SPEED_COMBO_NUMBER_LEFT == 4 and IsEnableNextAttack(4, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy5" elseif SPEED_COMBO_NUMBER_LEFT == 5 and IsEnableNextAttack(5, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy6" end if SPEED_COMBO_NUMBER_BOTH == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight2" elseif SPEED_COMBO_NUMBER_BOTH == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight3" elseif SPEED_COMBO_NUMBER_BOTH == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight4" elseif SPEED_COMBO_NUMBER_BOTH == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight5" elseif SPEED_COMBO_NUMBER_BOTH == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight6" end if SPEED_COMBO_NUMBER_DUAL == 1 and GetDualAttackMaxNumber(HAND_RIGHT) >= 2 then l1 = "W_AttackLeftLight2" elseif SPEED_COMBO_NUMBER_DUAL == 2 and GetDualAttackMaxNumber(HAND_RIGHT) >= 3 then l1 = "W_AttackLeftLight3" elseif SPEED_COMBO_NUMBER_DUAL == 3 and GetDualAttackMaxNumber(HAND_RIGHT) >= 4 then l1 = "W_AttackLeftLight4" elseif SPEED_COMBO_NUMBER_DUAL == 4 and GetDualAttackMaxNumber(HAND_RIGHT) >= 5 then l1 = "W_AttackLeftLight5" elseif SPEED_COMBO_NUMBER_DUAL == 5 and GetDualAttackMaxNumber(HAND_RIGHT) >= 6 then l1 = "W_AttackLeftLight6" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, l2, b1, "W_AttackBothHeavy1Start", QUICKTYPE_BACKSTEP) == TRUE then return end end function LadyBackStep2_onDeactivate() act(DisallowAdditiveTurning, FALSE) end --function BackStepGuardOn_UpperLayer_onUpdate() -- act(SetCanChangeEquipmentOff) -- 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(SetCanChangeEquipmentOff) -- 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.9599999785423279) elseif hkbGetVariable("MoveDirection") == 1 then act(SetMovementScaleMult, 0.9599999785423279) elseif hkbGetVariable("MoveDirection") == 0 then act(SetMovementScaleMult, 0.9800000190734863) 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 env(GetSpEffectID, 102000) == 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 env(GetSpEffectID, 102000) == 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 env(GetSpEffectID, 102000) == TRUE then SetJustGuardReinputState() end end function SetJustGuardSucceedEffect(level) 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 act(AddSpEffect, 102019) 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() 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() --combo between dodges SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_ALLOW_ROLL = TRUE SPEED_COMBO_ALLOW_ROLL = TRUE 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() SPEED_COMBO_NUMBER_RIGHT = 2 SPEED_COMBO_ALLOW_ROLL = TRUE SPEED_COMBO_ALLOW_ROLL = TRUE 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() SPEED_COMBO_NUMBER_RIGHT = 3 SPEED_COMBO_ALLOW_ROLL = TRUE SPEED_COMBO_ALLOW_ROLL = TRUE 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 elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLight4_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 4 SPEED_COMBO_ALLOW_ROLL = TRUE SPEED_COMBO_ALLOW_ROLL = TRUE 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() SPEED_COMBO_NUMBER_RIGHT = 5 SPEED_COMBO_ALLOW_ROLL = TRUE SPEED_COMBO_ALLOW_ROLL = TRUE 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() SPEED_COMBO_NUMBER_RIGHT = 0 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() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_ALLOW_ROLL = TRUE 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() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_ALLOW_ROLL = TRUE 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() SPEED_COMBO_NUMBER_RIGHT = 1 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() SPEED_COMBO_NUMBER_RIGHT = 1 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() SPEED_COMBO_NUMBER_RIGHT = 1 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() SPEED_COMBO_NUMBER_RIGHT = 1 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 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 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 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 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() SPEED_COMBO_NUMBER_RIGHT = 1 ExecTravelMagnification(ATTACK_RIGHT_BACKSTEP) 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() SPEED_COMBO_NUMBER_LEFT = 1 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() SPEED_COMBO_NUMBER_LEFT = 1 if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy2", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftHeavy2_onUpdate() SPEED_COMBO_NUMBER_LEFT = 2 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() SPEED_COMBO_NUMBER_LEFT = 3 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() SPEED_COMBO_NUMBER_LEFT = 4 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() SPEED_COMBO_NUMBER_LEFT = 5 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() SPEED_COMBO_NUMBER_LEFT = 0 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() SPEED_COMBO_NUMBER_DUAL = 1 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() SPEED_COMBO_NUMBER_DUAL = 2 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() SPEED_COMBO_NUMBER_DUAL = 3 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() SPEED_COMBO_NUMBER_DUAL = 4 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() SPEED_COMBO_NUMBER_DUAL = 5 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() SPEED_COMBO_NUMBER_DUAL = 0 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() SPEED_COMBO_NUMBER_DUAL = 1 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() SPEED_COMBO_NUMBER_DUAL = 1 local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then l1 = "W_AttackLeftLight1" end local isEnableDualWielding = IsEnableDualWielding() if isEnableDualWielding == INVALID 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() SPEED_COMBO_NUMBER_DUAL = 1 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() SPEED_COMBO_NUMBER_DUAL = 1 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() SPEED_COMBO_NUMBER_BOTH = 1 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() SPEED_COMBO_NUMBER_BOTH = 2 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() SPEED_COMBO_NUMBER_BOTH = 3 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 elseif AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothLight4_onUpdate() SPEED_COMBO_NUMBER_BOTH = 4 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() SPEED_COMBO_NUMBER_BOTH = 5 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() SPEED_COMBO_NUMBER_BOTH = 0 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() SPEED_COMBO_NUMBER_BOTH = 1 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_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() SPEED_COMBO_NUMBER_BOTH = 1 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 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() SPEED_COMBO_NUMBER_BOTH = 1 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() SPEED_COMBO_NUMBER_BOTH = 1 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() SPEED_COMBO_NUMBER_BOTH = 1 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() SPEED_COMBO_NUMBER_BOTH = 1 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() SPEED_COMBO_NUMBER_BOTH = 1 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() SPEED_COMBO_NUMBER_RIGHT = 1 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() SPEED_COMBO_NUMBER_BOTH = 1 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 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 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 ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then 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) ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else 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") ExecEventHalfBlend(Event_AttackArrowRightStartContinue, blend_type) act(DebugLogOutput, "AttackArrowRightStartContinue") return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else 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) ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else 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) ExecEventHalfBlend(Event_AttackArrowRightStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") return else 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 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 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 ExecEventHalfBlend(Event_AttackArrowLeftFireMove, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then 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 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 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) ExecEventHalfBlend(Event_AttackArrowLeftStartContinue, blend_type) return end elseif env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") return else 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 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 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 ExecEventHalfBlend(Event_AttackCrossbowRightFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ExecEventHalfBlend(Event_AttackCrossbowRightFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowRightLoop, lower_state, FALSE) == TRUE then 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 return end end function AttackCrossbowRightReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 80, 60, 60) 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_AttackCrossbowRightReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowRightEmpty_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_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 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 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 ExecEventHalfBlend(Event_AttackCrossbowLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ExecEventHalfBlend(Event_AttackCrossbowLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowLeftLoop, lower_state, FALSE) == TRUE then 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 return end end function AttackCrossbowLeftReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 45, 60, 60) 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_AttackCrossbowLeftReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowLeftEmpty_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_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 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 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 ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then 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 return end end function AttackCrossbowBothLeftReload_Upper_onUpdate() act(Set4DirectionMovementThreshold, 60, 80, 60, 60) 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_AttackCrossbowBothLeftReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothLeftEmpty_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_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 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 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 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 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 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_AttackCrossbowBothRightLoop, lower_state, FALSE) if fireEvent == TRUE then 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 return end end function AttackCrossbowBothRightReload_Upper_onUpdate() act(SetIsPreciseShootingPossible) act(Set4DirectionMovementThreshold, 60, 80, 60, 60) 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_AttackCrossbowBothRightReload, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothRightEmpty_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_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 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 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 ExecEventHalfBlend(Event_StealthAttackCrossbowRightFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then ExecEventHalfBlend(Event_StealthAttackCrossbowRightFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowRightLoop, lower_state, FALSE) == TRUE then 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 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 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 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 ExecEventHalfBlend(Event_StealthAttackCrossbowLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowLeftLoop, lower_state, FALSE) == TRUE then 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 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 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 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 ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftFire, blend_type) return end elseif 0 >= env(ActionDuration, ACTION_ARM_L2) then ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_StealthAttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then 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 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 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 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 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 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(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 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 then 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 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" 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 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 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 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 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 if c_SwordArtsID == 130 or c_SwordArtsID == 55 or c_SwordArtsID == 323 then canThrow = 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 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) 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 end SetVariable("SwordArtsChargeCategory", arts_idx) ExecEventAllBody("W_SwordArtsChargeCancelEarly") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelLate") return end 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) 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 and 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 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 end 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 end 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 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 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 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 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 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 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 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 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 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 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() if c_SwordArtsID == 115 or c_SwordArtsID == 116 or c_SwordArtsID == 193 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() if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return 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 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 ExecEventHalfBlend(Event_SwordArtsArrowStanceEnd, blend_type) if lower_state == LOWER_MOVE then ExecEventHalfBlendNoReset(Event_Move, LOWER) end return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlend(Event_SwordArtsArrowStanceLoop, blend_type) return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceStartMirror, lower_state, FALSE) == TRUE then 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() 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() 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 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() 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() 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 ExecEventHalfBlend(Event_SwordArtsArrowStanceEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceLoop, lower_state, FALSE) == TRUE then 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 ExecEventHalfBlend(Event_SwordArtsArrowDrawLoop, blend_type) return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceStartMirror, lower_state, FALSE) == TRUE then 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) ExecEventAllBody("W_SwordArtsArrowFire") return end if HalfBlendLowerCommonFunction(Event_SwordArtsArrowStanceLoop, lower_state, FALSE) == TRUE then 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 ExecEventAllBody("W_SwordArtsArrowFireEnd") return end if ArrowStanceCommonFunction(ALLBODY, TRUE) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then 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 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 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 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.8999999761581421 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() 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == 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 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_R2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_L2 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_R2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or mp_condition >= env(GetFP)) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_R2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or mp_condition >= env(GetFP)) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_R2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then button = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, button) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) 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() Replanning() end function ThrowAtk_onUpdate() if ThrowCommonFunction(FALSE) == TRUE then act(RequestThrowAnimInterrupt) return end end function ThrowDef_onActivate() Replanning() end function ThrowDef_onUpdate() 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() act(SetThrowState, THROW_TYPE_DEATH) end function ThrowDeathIdle_onActivate() 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() 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(SetCanChangeEquipmentOn) 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() LadderSendCommand(LADDER_EVENT_COMMAND_EXIT) end function LadderDeathLoop_onUpdate() 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(SetCanChangeEquipmentOn) 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 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) elseif env(GetSpEffectID, 503520) == TRUE then ChangeMoveSpeedIndex(0) elseif env(GetSpEffectID, 4101) == TRUE then -- Duplicate Condition #1 ChangeMoveSpeedIndex(0) elseif g_IsMimicry == TRUE then if stick_level > 1.100000023841858 then ResetMimicry() else ChangeMoveSpeedIndex(0) end elseif env(GetSpEffectID, 4101) == TRUE then -- Duplicate Condition #2 if stick_level > 1.100000023841858 then ChangeMoveSpeedIndex(1) end elseif env(GetSpEffectID, 425) == TRUE or env(GetSpEffectID, 19670) == TRUE then if stick_level > 1.100000023841858 then ChangeMoveSpeedIndex(1) end elseif env(GetSpEffectID, 100220) == TRUE then ChangeMoveSpeedIndex(2) else local runLevel = 0.6000000238418579 if GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("MoveSpeedIndex") >= 1 then runLevel = 0.4000000059604645 end -- Sprint (stick + O) if stick_level > 1.100000023841858 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) 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.699999988079071 then is_holding = false else blend_weight = blend_weight + 2 * dT if blend_weight > 0.9900000095367432 then blend_weight = 0.9900000095367432 end SetVariable("IsEnableTAEThrowHold", true) end else no_regist_time = 0 blend_weight = blend_weight - 4 * dT if blend_weight < 0.009999999776482582 then blend_weight = 0.009999999776482582 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.009999999776482582 c_ArtsRollingAngle = env(GetSwordArtsRollAngle) * 0.009999999776482582 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() VIZZO_MainUpdate() -- AnimJumper ModDoubleJump() ModAirDash() UnlockLockOn() SetLadyCombo() 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.10000000149011612) 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() g_IsMimicry = env(GetSpEffectID, 503040) if g_EnableMimicry == FALSE and g_IsMimicry == TRUE then ResetMimicry() end g_EnableMimicry = 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 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) 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 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.8659999966621399 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.8999999761581421 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.009999999776482582) 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) 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 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 FireRideEvent("W_RideDamageMad", "W_RideRun_End", FALSE) 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 or env(GetDamageSpecialAttribute, 4) == TRUE then 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 env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 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.8999999761581421 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.8999999761581421 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP -- Dash elseif move_speed_level > 0.6000000238418579 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 sp_kind = env(GetEquipWeaponSpecialCategoryNumber, attackHand) local is_weaponStaff = FALSE if IsWeaponCatalyst(sp_kind) == 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 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 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 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then buttonR = ACTION_ARM_R2 buttonL = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventAllBody("W_RideMagicFireCancel") return end if CheckIfHoldMagic() == TRUE and (env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 0) == TRUE) then if env(ActionDuration, buttonR) > 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then buttonR = ACTION_ARM_R2 buttonL = ACTION_ARM_L2 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then buttonR = ACTION_ARM_R2 buttonL = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then buttonR = ACTION_ARM_R2 buttonL = ACTION_ARM_L2 end if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, buttonR) <= 0 and env(ActionDuration, buttonL) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) 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.8999999761581421 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6000000238418579 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.8999999761581421 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6000000238418579 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.06499999761581421 then dash_dt_sum = 0 if env(GetSpEffectID, 102360) == FALSE 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.800000011920929, 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) 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 env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 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 env(GetSpEffectID, 102360) == FALSE 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 env(GetSpEffectID, 102360) == FALSE 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 env(GetSpEffectID, 102360) == FALSE 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 env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 then jumpEvent = "W_RideJump_F" end if env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 then jumpEvent = "W_RideJump_F" end if env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 then jumpEvent = "W_RideJump_F" end if env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 then jumpEvent = "W_RideJump_F" end if env(GetSpEffectID, 102360) == FALSE 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 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 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 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 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 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 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 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 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 env(GetSpEffectID, 102360) == FALSE 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.6000000238418579 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.6000000238418579 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.6000000238418579 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.8999999761581421 then FireRideEvent("W_RideGallop", "W_RideGallop", FALSE) return elseif GetVariable("MoveSpeedLevel") >= 0.6000000238418579 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.6000000238418579 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 ExecEventHalfBlend(loopEvent, ALLBODY) return TRUE elseif 1 <= GetVariable("JumpAttack_HandCondition") then 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 ExecEventHalfBlend(loopEvent, ALLBODY) return TRUE elseif 1 <= GetVariable("JumpAttack_HandCondition") then 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then isWeaponStaff = TRUE end -- Magic if ExecJumpMagic(jump_type) == TRUE then -- 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 ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 0) SetVariable("JumpAttackForm", 1) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 1) SetVariable("JumpAttackForm", 2) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and IsEnableDualWielding() == HAND_RIGHT then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 2) SetVariable("JumpAttackForm", 3) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() 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.009999999776482582 then SetVariable("JumpUseMotion_Bool", 1) end elseif jump_type >= 1 then ExecEventAllBody("W_Jump_Attack_Land_F") end 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 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 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 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 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 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 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.100000023841858 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6000000238418579 then JumpMoveLevel = 1 end -- Ironjar Aromatic if TRUE == env(GetSpEffectID, 503520) then JumpMoveLevel = 0 -- Unknown elseif TRUE == env(GetSpEffectID, 5520) then JumpMoveLevel = 0 -- Slug: Slow elseif TRUE == env(GetSpEffectID, 425) then JumpMoveLevel = 0 -- Sanguine Noble: Slow elseif TRUE == env(GetSpEffectID, 4101) then JumpMoveLevel = 0 -- Sanguine Noble: Slow elseif TRUE == env(GetSpEffectID, 4100) then JumpMoveLevel = 0 elseif env(GetSpEffectID, 19670) == 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 ExecEventNoReset("W_Jump_Land_N") elseif jump_type == 1 then ExecEventNoReset("W_Jump_Land_F") elseif jump_type == 2 then 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.009999999776482582 then SetVariable("JumpUseMotion_Bool", 1) end elseif jump_type >= 1 then 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 ExecEventNoReset("W_Jump_Land_N") elseif jump_type == 1 then ExecEventNoReset("W_Jump_Land_F") elseif jump_type == 2 then 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, wep_hand) if IsWeaponCatalyst(sp_kind) == TRUE then buttonR = ACTION_ARM_MAGIC_R2 end local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if c_Style == HAND_RIGHT and IsWeaponCatalyst(sp_kind_L) == TRUE then buttonL = ACTION_ARM_MAGIC_L2 end if env(ActionRequest, buttonR) == FALSE and env(ActionRequest, buttonL) == 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 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(sp_kind) == FALSE then return FALSE end wep_hand = HAND_LEFT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE and IsWeaponCatalyst(sp_kind) == 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(sp_kind_L) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT act(DebugLogOutput, "MagicLeft") 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 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 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 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 if env(ActionRequest, ACTION_ARM_MAGIC_R) == TRUE 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == FALSE then return FALSE end wep_hand = HAND_LEFT else local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if IsWeaponCatalyst(sp_kind) == 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT act(DebugLogOutput, "MagicLeft") 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 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 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.4000000059604645 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 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) 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) 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) 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.100000023841858 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6000000238418579 then JumpMoveLevel = 1 end end if env(GetSpEffectID, 503520) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 5520) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 425) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 4101) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 4100) == TRUE then JumpMoveLevel = 0 elseif env(GetSpEffectID, 19670) == 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 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 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 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 ExecEventAllBody("W_StealthAttackArrowShot") return end elseif 0 >= env(ActionDuration, ACTION_ARM_R2) then 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) ExecEventHalfBlend(Event_StealthAttackArrowStartContinue, ALLBODY) return end elseif env(IsOutOfAmmo, hand) == TRUE then ExecEventAllBody("W_NoArrow") return else 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.9599999785423279) elseif hkbGetVariable("MoveDirection") == 1 then act(SetMovementScaleMult, 0.9599999785423279) elseif hkbGetVariable("MoveDirection") == 0 then act(SetMovementScaleMult, 0.9800000190734863) 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) act(DebugLogOutput, "Stealth_Rolling_SpeedRight=" .. SPEED_COMBO_NUMBER_RIGHT) 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 local r1 = "W_AttackRightLightStep" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLightStep" if SPEED_COMBO_NUMBER_RIGHT == 1 and (IsEnableNextAttack(1, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight2" elseif SPEED_COMBO_NUMBER_RIGHT == 2 and (IsEnableNextAttack(2, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight3" elseif SPEED_COMBO_NUMBER_RIGHT == 3 and (IsEnableNextAttack(3, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight4" elseif SPEED_COMBO_NUMBER_RIGHT == 4 and (IsEnableNextAttack(4, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight5" elseif SPEED_COMBO_NUMBER_RIGHT == 5 and (IsEnableNextAttack(5, HAND_RIGHT) == TRUE or SPEED_COMBO_ALLOW_ROLL == TRUE) then r1 = "W_AttackRightLight6" end if SPEED_COMBO_NUMBER_LEFT == 1 and IsEnableNextAttack(1, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy2" elseif SPEED_COMBO_NUMBER_LEFT == 2 and IsEnableNextAttack(2, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy3" elseif SPEED_COMBO_NUMBER_LEFT == 3 and IsEnableNextAttack(3, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy4" elseif SPEED_COMBO_NUMBER_LEFT == 4 and IsEnableNextAttack(4, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy5" elseif SPEED_COMBO_NUMBER_LEFT == 5 and IsEnableNextAttack(5, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy6" end if SPEED_COMBO_NUMBER_BOTH == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight2" elseif SPEED_COMBO_NUMBER_BOTH == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight3" elseif SPEED_COMBO_NUMBER_BOTH == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight4" elseif SPEED_COMBO_NUMBER_BOTH == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight5" elseif SPEED_COMBO_NUMBER_BOTH == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight6" end if SPEED_COMBO_NUMBER_DUAL == 1 and GetDualAttackMaxNumber(HAND_RIGHT) >= 2 then l1 = "W_AttackLeftLight2" elseif SPEED_COMBO_NUMBER_DUAL == 2 and 3 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight3" elseif SPEED_COMBO_NUMBER_DUAL == 3 and GetDualAttackMaxNumber(HAND_RIGHT) >= 4 then l1 = "W_AttackLeftLight4" elseif SPEED_COMBO_NUMBER_DUAL == 4 and GetDualAttackMaxNumber(HAND_RIGHT) >= 5 then l1 = "W_AttackLeftLight5" elseif SPEED_COMBO_NUMBER_DUAL == 5 and 6 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight6" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, l2, b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end SetRollingTurnCondition(FALSE) SPEED_COMBO_ALLOW_ROLL = FALSE end function Stealth_RollingSelftrans_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() SetStealthState(STEALTH_ROLLING_SELFTRANS) act(DebugLogOutput, "Stealth_RollingSelftrans_SpeedRight=" .. SPEED_COMBO_NUMBER_RIGHT) 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 local r1 = "W_AttackRightLightStep" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLightStep" if SPEED_COMBO_NUMBER_RIGHT == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight2" elseif SPEED_COMBO_NUMBER_RIGHT == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight3" elseif SPEED_COMBO_NUMBER_RIGHT == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight4" elseif SPEED_COMBO_NUMBER_RIGHT == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight5" elseif SPEED_COMBO_NUMBER_RIGHT == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then r1 = "W_AttackRightLight6" end if SPEED_COMBO_NUMBER_LEFT == 1 and IsEnableNextAttack(1, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy2" elseif SPEED_COMBO_NUMBER_LEFT == 2 and IsEnableNextAttack(2, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy3" elseif SPEED_COMBO_NUMBER_LEFT == 3 and IsEnableNextAttack(3, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy4" elseif SPEED_COMBO_NUMBER_LEFT == 4 and IsEnableNextAttack(4, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy5" elseif SPEED_COMBO_NUMBER_LEFT == 5 and IsEnableNextAttack(5, HAND_LEFT) == TRUE then l2 = "W_AttackLeftHeavy6" end if SPEED_COMBO_NUMBER_BOTH == 1 and IsEnableNextAttack(1, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight2" elseif SPEED_COMBO_NUMBER_BOTH == 2 and IsEnableNextAttack(2, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight3" elseif SPEED_COMBO_NUMBER_BOTH == 3 and IsEnableNextAttack(3, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight4" elseif SPEED_COMBO_NUMBER_BOTH == 4 and IsEnableNextAttack(4, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight5" elseif SPEED_COMBO_NUMBER_BOTH == 5 and IsEnableNextAttack(5, HAND_RIGHT) == TRUE then b1 = "W_AttackBothLight6" end if SPEED_COMBO_NUMBER_DUAL == 1 and GetDualAttackMaxNumber(HAND_RIGHT) >= 2 then l1 = "W_AttackLeftLight2" elseif SPEED_COMBO_NUMBER_DUAL == 2 and 3 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight3" elseif SPEED_COMBO_NUMBER_DUAL == 3 and GetDualAttackMaxNumber(HAND_RIGHT) >= 4 then l1 = "W_AttackLeftLight4" elseif SPEED_COMBO_NUMBER_DUAL == 4 and GetDualAttackMaxNumber(HAND_RIGHT) >= 5 then l1 = "W_AttackLeftLight5" elseif SPEED_COMBO_NUMBER_DUAL == 5 and 6 <= GetDualAttackMaxNumber(HAND_RIGHT) then l1 = "W_AttackLeftLight6" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, l2, b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end SetRollingTurnCondition(TRUE) SPEED_COMBO_ALLOW_ROLL = FALSE 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 ------------------------------------------ -- Core: Includes from common_define ------------------------------------------ -- ivi: Constants for distinction of regular numbers to what exactly these mean. SWORD_ART_DIFF_CAT_DEFAULT = 0 SWORD_ART_DIFF_CAT_LARGE_WEAPON = 2 SWORD_ART_DIFF_CAT_POLEARM = 3 SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD = 4 SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD = 5 SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD = 8 SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD = 9 -- Stores possible override animations that exist for Sword Arts. -- Key: Sword Art ID (TAE ID minus 600) -- Possible values: -- -- 0: Idle (Default or Large Rapier) -- 2: Idle (Great Weapon) -- 3: Idle (Polearm) -- 4: Idle (Great Weapon) + Small Shield -- 5: Idle (Polearm) + Small Shield -- 8: Idle (Great Weapon) + Large Shield -- 9: Idle (Polearm) + Large Shield -- 20-59: Weapon Category SwordArtsCategory = { [0] = {SWORD_ART_DIFF_CAT_DEFAULT}, [1] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_FIST, WEAPON_CATEGORY_DUELING_SHIELD}, [2] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [3] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_TWINBLADE, WEAPON_CATEGORY_BACKHAND_SWORD}, [4] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [5] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [6] = {SWORD_ART_DIFF_CAT_DEFAULT}, [7] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [8] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_DUELING_SHIELD}, [9] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_DUELING_SHIELD}, [10] = {SWORD_ART_DIFF_CAT_DEFAULT}, [11] = {SWORD_ART_DIFF_CAT_DEFAULT}, [12] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [13] = {SWORD_ART_DIFF_CAT_DEFAULT}, [14] = {SWORD_ART_DIFF_CAT_DEFAULT}, [15] = {SWORD_ART_DIFF_CAT_DEFAULT}, [16] = {SWORD_ART_DIFF_CAT_DEFAULT}, [17] = {SWORD_ART_DIFF_CAT_DEFAULT}, [18] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_POLEARM}, [19] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_BACKHAND_SWORD}, [20] = {SWORD_ART_DIFF_CAT_DEFAULT}, [21] = {SWORD_ART_DIFF_CAT_DEFAULT}, [22] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_TWINBLADE}, [23] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_TWINBLADE}, [24] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_TWINBLADE, WEAPON_CATEGORY_BACKHAND_SWORD}, [25] = {SWORD_ART_DIFF_CAT_DEFAULT}, [50] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [51] = {SWORD_ART_DIFF_CAT_DEFAULT}, [52] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_TWINBLADE}, [53] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [54] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, WEAPON_CATEGORY_TWINBLADE}, [55] = {SWORD_ART_DIFF_CAT_DEFAULT}, [56] = {SWORD_ART_DIFF_CAT_DEFAULT}, [57] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON}, [58] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_BACKHAND_SWORD, WEAPON_CATEGORY_DUELING_SHIELD}, [59] = {SWORD_ART_DIFF_CAT_DEFAULT}, [61] = {SWORD_ART_DIFF_CAT_DEFAULT}, [62] = {SWORD_ART_DIFF_CAT_DEFAULT}, [63] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_BACKHAND_SWORD}, [64] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_FIST, WEAPON_CATEGORY_MARTIAL_ARTS, WEAPON_CATEGORY_DUELING_SHIELD, WEAPON_CATEGORY_BEAST_CLAW}, [65] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_POLEARM}, [66] = {SWORD_ART_DIFF_CAT_DEFAULT}, [67] = {SWORD_ART_DIFF_CAT_DEFAULT}, [68] = {SWORD_ART_DIFF_CAT_DEFAULT}, [69] = {SWORD_ART_DIFF_CAT_DEFAULT}, [70] = {SWORD_ART_DIFF_CAT_DEFAULT}, [71] = {SWORD_ART_DIFF_CAT_DEFAULT}, [72] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_BACKHAND_SWORD}, [73] = {SWORD_ART_DIFF_CAT_DEFAULT}, [74] = {SWORD_ART_DIFF_CAT_DEFAULT}, [75] = {SWORD_ART_DIFF_CAT_DEFAULT}, [76] = {SWORD_ART_DIFF_CAT_DEFAULT}, [90] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_DUELING_SHIELD}, [91] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD, SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD, SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD, SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_DUELING_SHIELD}, [92] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_SHORT_SWORD, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_THROW_DAGGER}, [93] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [94] = {SWORD_ART_DIFF_CAT_DEFAULT}, [95] = {SWORD_ART_DIFF_CAT_DEFAULT}, [96] = {SWORD_ART_DIFF_CAT_DEFAULT}, [97] = {SWORD_ART_DIFF_CAT_DEFAULT}, [98] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_DUELING_SHIELD}, [99] = {SWORD_ART_DIFF_CAT_DEFAULT}, [100] = {SWORD_ART_DIFF_CAT_DEFAULT}, [101] = {SWORD_ART_DIFF_CAT_DEFAULT}, [102] = {SWORD_ART_DIFF_CAT_DEFAULT}, [103] = {SWORD_ART_DIFF_CAT_DEFAULT}, [105] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_LARGE_ARROW}, [106] = {SWORD_ART_DIFF_CAT_DEFAULT}, [108] = {SWORD_ART_DIFF_CAT_DEFAULT}, [110] = {SWORD_ART_DIFF_CAT_DEFAULT}, [107] = {SWORD_ART_DIFF_CAT_DEFAULT}, [109] = {SWORD_ART_DIFF_CAT_DEFAULT}, [111] = {SWORD_ART_DIFF_CAT_DEFAULT}, [112] = {SWORD_ART_DIFF_CAT_DEFAULT}, [113] = {SWORD_ART_DIFF_CAT_DEFAULT}, [114] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [115] = {SWORD_ART_DIFF_CAT_DEFAULT}, [116] = {SWORD_ART_DIFF_CAT_DEFAULT}, [117] = {SWORD_ART_DIFF_CAT_DEFAULT}, [118] = {SWORD_ART_DIFF_CAT_DEFAULT}, [130] = {SWORD_ART_DIFF_CAT_DEFAULT}, [131] = {SWORD_ART_DIFF_CAT_DEFAULT}, [132] = {SWORD_ART_DIFF_CAT_DEFAULT}, [133] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [134] = {SWORD_ART_DIFF_CAT_DEFAULT}, [135] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [136] = {SWORD_ART_DIFF_CAT_DEFAULT}, [137] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_BACKHAND_SWORD, WEAPON_CATEGORY_LARGE_KATANA}, [140] = {SWORD_ART_DIFF_CAT_DEFAULT}, [141] = {SWORD_ART_DIFF_CAT_DEFAULT}, [142] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [143] = {SWORD_ART_DIFF_CAT_DEFAULT}, [144] = {SWORD_ART_DIFF_CAT_DEFAULT}, [150] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, WEAPON_CATEGORY_FIST, WEAPON_CATEGORY_MARTIAL_ARTS, WEAPON_CATEGORY_PERFUME_BOTTLE, WEAPON_CATEGORY_DUELING_SHIELD, WEAPON_CATEGORY_BEAST_CLAW}, [151] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [152] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [155] = {SWORD_ART_DIFF_CAT_DEFAULT}, [156] = {SWORD_ART_DIFF_CAT_DEFAULT}, [157] = {SWORD_ART_DIFF_CAT_DEFAULT}, [160] = {SWORD_ART_DIFF_CAT_DEFAULT}, [165] = {SWORD_ART_DIFF_CAT_DEFAULT}, [166] = {SWORD_ART_DIFF_CAT_DEFAULT}, [167] = {SWORD_ART_DIFF_CAT_DEFAULT}, [168] = {SWORD_ART_DIFF_CAT_DEFAULT}, [196] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [256] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_TWINBLADE}, [257] = {SWORD_ART_DIFF_CAT_DEFAULT}, [258] = {SWORD_ART_DIFF_CAT_DEFAULT}, [260] = {SWORD_ART_DIFF_CAT_DEFAULT}, [261] = {SWORD_ART_DIFF_CAT_DEFAULT}, [262] = {SWORD_ART_DIFF_CAT_DEFAULT}, [263] = {SWORD_ART_DIFF_CAT_DEFAULT}, [264] = {SWORD_ART_DIFF_CAT_DEFAULT}, [265] = {SWORD_ART_DIFF_CAT_DEFAULT}, [269] = {SWORD_ART_DIFF_CAT_DEFAULT}, [273] = {SWORD_ART_DIFF_CAT_DEFAULT}, [274] = {SWORD_ART_DIFF_CAT_DEFAULT}, [276] = {SWORD_ART_DIFF_CAT_DEFAULT}, [277] = {SWORD_ART_DIFF_CAT_DEFAULT}, [278] = {SWORD_ART_DIFF_CAT_DEFAULT}, [279] = {SWORD_ART_DIFF_CAT_DEFAULT}, [280] = {SWORD_ART_DIFF_CAT_DEFAULT}, [281] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_DUELING_SHIELD}, [282] = {SWORD_ART_DIFF_CAT_DEFAULT}, [283] = {SWORD_ART_DIFF_CAT_DEFAULT}, [284] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [285] = {SWORD_ART_DIFF_CAT_DEFAULT}, [286] = {SWORD_ART_DIFF_CAT_DEFAULT}, [305] = {SWORD_ART_DIFF_CAT_DEFAULT}, [357] = {SWORD_ART_DIFF_CAT_DEFAULT}, [340] = {SWORD_ART_DIFF_CAT_DEFAULT}, [341] = {SWORD_ART_DIFF_CAT_DEFAULT}, [342] = {SWORD_ART_DIFF_CAT_DEFAULT}, [343] = {SWORD_ART_DIFF_CAT_DEFAULT}, [399] = {SWORD_ART_DIFF_CAT_DEFAULT} } -- Determines which override of a Sword Art animation to play, based on the size or type of the weapon. -- The return of this function is processed to a different ID by the cases that use it. -- -- artID: Weapon Arts ID (TAE id minus 600) -- swordArtsTypeNew in SwordArtsParam -- idleCat: Stay Anim Category (Idle animation index for weapon) -- wepmotionOneHandId and wepmotionBothHandId in EquipParamWeapon -- wepCat: Weapon Animation Category (TAE ID for weapon type) -- wepmotionCategory in EquipParamWeapon -- -- Possible returns: -- -- 0: Idle (Default or Large Rapier) -- 2: Idle (Great Weapon) -- 3: Idle (Polearm) -- 4: Idle (Great Weapon) + Small Shield -- 5: Idle (Polearm) + Small Shield -- 8: Idle (Great Weapon) + Large Shield -- 9: Idle (Polearm) + Large Shield -- 20-59: Weapon Category function GetSwordArtsDiffCategory(artID, idleCat, wepCat) -- If TAE ID above 770 (except 796), no overrides, only a single default animation. Also DLC stuff if 170 <= artID and artID < 255 and artID ~= 196 or artID >= 300 and artID ~= 305 and artID ~= 357 and artID ~= 399 or artID == 275 or artID == 272 then return SWORD_ART_DIFF_CAT_DEFAULT end -- For TAE ID 769 (Radahn's Rain), return 45 (Greatbow) if artID == 169 then return WEAPON_CATEGORY_LARGE_ARROW end -- Allows some weapon categories to query for whether the Sword Art permits a cousin category. -- Only used to allow Claws to use Fist Sword Arts. local wep_cat1 = wepCat if wepCat == WEAPON_CATEGORY_CLAW then wep_cat1 = WEAPON_CATEGORY_FIST elseif wep_cat1 == WEAPON_CATEGORY_LIGHT_LARGE_SWORD then return 0 end -- Idle animation TAEs. Two-hand is ignored. local idle_cat0 = idleCat if idle_cat0 >= 10 then idle_cat0 = idle_cat0 - 10 end -- Override for heavy thrusting swords (usually 3) if wepCat == WEAPON_CATEGORY_LARGE_RAPIER then idle_cat0 = SWORD_ART_DIFF_CAT_DEFAULT end if (artID == 90 or artID == 98 or artID == 151 or artID == 152) and env(GetEquipWeaponCategory, c_SwordArtsHand) == WEAPON_CATEGORY_DUELING_SHIELD and (c_Style == HAND_LEFT or c_Style == HAND_RIGHT) then return 0 end -- ivi: CASE 0: Not in table if SwordArtsCategory[artID] == nil then return SWORD_ART_DIFF_CAT_DEFAULT end -- CASE 1: Shields if c_SwordArtsHand == HAND_LEFT and c_Style ~= HAND_LEFT_BOTH then local shield_cat = -1 if idle_cat0 == 2 and wepCat == WEAPON_CATEGORY_SMALL_SHIELD then shield_cat = SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD elseif idle_cat0 == 3 and wepCat == WEAPON_CATEGORY_SMALL_SHIELD then shield_cat = SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD elseif idle_cat0 == 2 and wepCat == WEAPON_CATEGORY_LARGE_SHIELD then shield_cat = SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD elseif idle_cat0 == 3 and wepCat == WEAPON_CATEGORY_LARGE_SHIELD then shield_cat = SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD end if shield_cat ~= -1 then -- Only check if shields for i = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][i] == shield_cat then env(DebugLogOutput, "GetSwordArtsDiffCategory shield_cat:" .. shield_cat) return shield_cat end end end end -- CASE 2: Weapon Categories for j = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][j] == wepCat then env(DebugLogOutput, "GetSwordArtsDiffCategory wepCat0:" .. wepCat) return wepCat end end -- ivi: Additional check to avoid unnecessary second loop if wep_cat1 ~= nil then -- CASE 3: Auxiliary weapon category (Some weapon categories count the same as others) for j = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][j] == wep_cat1 then env(DebugLogOutput, "GetSwordArtsDiffCategory wepCat1:" .. wep_cat1) return wep_cat1 end end end -- Shield Arts (90 is Shield Bash, 99 is Thops Barrier) if artID >= 90 and artID <= 99 and (c_SwordArtsHand ~= HAND_LEFT or c_Style == HAND_LEFT_BOTH) then return SWORD_ART_DIFF_CAT_DEFAULT end -- CASE 4: Idle categories for j = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][j] == idle_cat0 then env(DebugLogOutput, "GetSwordArtsDiffCategory idle_cat0:" .. idle_cat0) return idle_cat0 end end return SWORD_ART_DIFF_CAT_DEFAULT end -- Table storing information about weapon arts. -- Concerns playing a "weapon retrieval" animation after -- the sword art was executed. -- -- Table key: Sword Art ID (TAE ID minus 600) -- Value 1: Right hand, weapon art cast from right hand -- Value 2: Right hand, weapon art cast from left hand -- Value 3: Left hand -- -- TRUE: Weapon was sheathed during animation, play retrieval animation. -- FALSE: Weapon was used to perform the sword art, no retrieval animation. SwordArtPutOppositeWeapon = { [0] = {TRUE, FALSE, TRUE}, [1] = {TRUE, FALSE, TRUE}, [2] = {TRUE, FALSE, TRUE}, [3] = {TRUE, FALSE, TRUE}, -- 4 (Not present) [5] = {FALSE, FALSE, TRUE}, [6] = {TRUE, FALSE, TRUE}, [7] = {FALSE, FALSE, FALSE}, [8] = {FALSE, FALSE, TRUE}, [9] = {FALSE, FALSE, TRUE}, [10] = {TRUE, FALSE, TRUE}, [11] = {TRUE, FALSE, TRUE}, [12] = {TRUE, FALSE, TRUE}, [13] = {FALSE, FALSE, FALSE}, [14] = {TRUE, FALSE, TRUE}, [15] = {TRUE, FALSE, TRUE}, [16] = {FALSE, FALSE, TRUE}, [17] = {FALSE, FALSE, FALSE}, [18] = {FALSE, FALSE, TRUE}, [19] = {TRUE, FALSE, TRUE}, [20] = {TRUE, FALSE, TRUE}, -- 21 (Present) [22] = {TRUE, FALSE, TRUE}, [23] = {FALSE, FALSE, TRUE}, [24] = {FALSE, FALSE, TRUE}, [25] = {TRUE, FALSE, TRUE}, -- 26-49 (Not present) [50] = {FALSE, FALSE, TRUE}, [51] = {FALSE, FALSE, TRUE}, [52] = {FALSE, FALSE, TRUE}, [53] = {FALSE, FALSE, TRUE}, [54] = {FALSE, FALSE, TRUE}, [55] = {TRUE, FALSE, FALSE}, [56] = {TRUE, FALSE, TRUE}, [57] = {FALSE, FALSE, TRUE}, [58] = {FALSE, FALSE, FALSE}, [59] = {TRUE, FALSE, TRUE}, [61] = {TRUE, FALSE, TRUE}, [62] = {TRUE, FALSE, FALSE}, [63] = {TRUE, FALSE, TRUE}, [64] = {FALSE, FALSE, TRUE}, [65] = {FALSE, FALSE, TRUE}, [66] = {TRUE, FALSE, TRUE}, [67] = {FALSE, FALSE, TRUE}, [68] = {TRUE, FALSE, TRUE}, [69] = {TRUE, FALSE, TRUE}, [70] = {TRUE, FALSE, TRUE}, [71] = {TRUE, FALSE, TRUE}, [72] = {TRUE, FALSE, TRUE}, [73] = {FALSE, FALSE, TRUE}, [74] = {FALSE, FALSE, TRUE}, [75] = {TRUE, FALSE, TRUE}, [76] = {FALSE, FALSE, FALSE}, -- 77-89 (Not present) [90] = {TRUE, FALSE, TRUE}, [91] = {FALSE, FALSE, FALSE}, [92] = {FALSE, FALSE, TRUE}, [93] = {FALSE, FALSE, TRUE}, [94] = {FALSE, FALSE, TRUE}, [95] = {FALSE, FALSE, TRUE}, [96] = {FALSE, FALSE, TRUE}, [97] = {FALSE, FALSE, TRUE}, [98] = {TRUE, TRUE, TRUE}, [99] = {FALSE, FALSE, FALSE}, [100] = {FALSE, FALSE, FALSE}, [101] = {FALSE, FALSE, FALSE}, [102] = {FALSE, FALSE, FALSE}, [103] = {FALSE, FALSE, FALSE}, -- 104 (Not present) [105] = {FALSE, FALSE, FALSE}, [106] = {FALSE, FALSE, FALSE}, -- 107 (Not Present) [108] = {FALSE, FALSE, FALSE}, -- 109 (Not present) [110] = {FALSE, FALSE, TRUE}, [111] = {FALSE, FALSE, TRUE}, [112] = {FALSE, FALSE, TRUE}, [113] = {FALSE, FALSE, TRUE}, [114] = {TRUE, FALSE, TRUE}, [115] = {FALSE, FALSE, TRUE}, [116] = {FALSE, FALSE, TRUE}, [117] = {TRUE, FALSE, TRUE}, [118] = {TRUE, FALSE, TRUE}, -- 119-129 (Not present) [130] = {FALSE, FALSE, TRUE}, [131] = {FALSE, FALSE, TRUE}, [132] = {TRUE, FALSE, TRUE}, [133] = {FALSE, FALSE, TRUE}, [134] = {TRUE, FALSE, TRUE}, [135] = {TRUE, FALSE, TRUE}, [136] = {TRUE, FALSE, TRUE}, [137] = {FALSE, FALSE, TRUE}, [140] = {FALSE, FALSE, TRUE}, [141] = {FALSE, FALSE, TRUE}, [142] = {FALSE, FALSE, TRUE}, [143] = {FALSE, FALSE, TRUE}, [144] = {FALSE, FALSE, TRUE}, [150] = {FALSE, FALSE, TRUE}, [151] = {FALSE, FALSE, TRUE}, [152] = {TRUE, TRUE, TRUE}, [155] = {FALSE, FALSE, TRUE}, [156] = {FALSE, FALSE, TRUE}, [157] = {FALSE, FALSE, TRUE}, [160] = {FALSE, FALSE, TRUE}, [165] = {TRUE, FALSE, TRUE}, [166] = {TRUE, FALSE, TRUE}, [167] = {FALSE, FALSE, TRUE}, [168] = {FALSE, FALSE, TRUE}, [169] = {FALSE, FALSE, FALSE}, [170] = {TRUE, FALSE, TRUE}, [171] = {FALSE, FALSE, TRUE}, [172] = {TRUE, FALSE, FALSE}, [173] = {TRUE, FALSE, TRUE}, [174] = {FALSE, FALSE, TRUE}, [175] = {TRUE, FALSE, TRUE}, [176] = {TRUE, FALSE, TRUE}, [177] = {TRUE, FALSE, TRUE}, [178] = {TRUE, FALSE, TRUE}, [179] = {TRUE, FALSE, TRUE}, -- 180 -- 181 [182] = {FALSE, FALSE, TRUE}, [183] = {TRUE, FALSE, TRUE}, [184] = {TRUE, FALSE, TRUE}, [185] = {TRUE, FALSE, TRUE}, [186] = {TRUE, FALSE, TRUE}, [187] = {FALSE, FALSE, TRUE}, [188] = {TRUE, FALSE, TRUE}, [189] = {TRUE, FALSE, TRUE}, [190] = {FALSE, FALSE, FALSE}, [191] = {TRUE, FALSE, FALSE}, [192] = {TRUE, FALSE, TRUE}, [193] = {FALSE, FALSE, TRUE}, [194] = {FALSE, FALSE, TRUE}, [195] = {FALSE, TRUE, FALSE}, [196] = {FALSE, FALSE, FALSE}, [197] = {FALSE, FALSE, FALSE}, [198] = {FALSE, FALSE, TRUE}, [199] = {TRUE, FALSE, TRUE}, [200] = {TRUE, FALSE, TRUE}, [201] = {TRUE, TRUE, FALSE}, [202] = {TRUE, TRUE, FALSE}, [203] = {TRUE, FALSE, TRUE}, [204] = {TRUE, FALSE, TRUE}, [205] = {TRUE, FALSE, TRUE}, [206] = {FALSE, FALSE, TRUE}, [207] = {TRUE, FALSE, TRUE}, [208] = {TRUE, FALSE, TRUE}, [209] = {TRUE, FALSE, TRUE}, [210] = {FALSE, FALSE, TRUE}, [211] = {FALSE, FALSE, FALSE}, [212] = {FALSE, FALSE, TRUE}, [213] = {TRUE, FALSE, TRUE}, [214] = {TRUE, FALSE, TRUE}, [215] = {TRUE, FALSE, TRUE}, [216] = {FALSE, FALSE, TRUE}, [217] = {FALSE, FALSE, TRUE}, [218] = {TRUE, FALSE, TRUE}, [219] = {TRUE, FALSE, FALSE}, [220] = {FALSE, FALSE, TRUE}, [221] = {FALSE, FALSE, TRUE}, [222] = {TRUE, FALSE, TRUE}, [223] = {TRUE, FALSE, TRUE}, [224] = {TRUE, FALSE, TRUE}, [225] = {TRUE, FALSE, TRUE}, [226] = {TRUE, FALSE, TRUE}, [227] = {TRUE, FALSE, TRUE}, [228] = {TRUE, FALSE, TRUE}, [229] = {TRUE, FALSE, TRUE}, [230] = {FALSE, FALSE, TRUE}, [231] = {TRUE, FALSE, TRUE}, [232] = {TRUE, FALSE, FALSE}, [233] = {FALSE, FALSE, TRUE}, [234] = {TRUE, FALSE, TRUE}, [235] = {TRUE, FALSE, TRUE}, [236] = {FALSE, FALSE, TRUE}, [237] = {FALSE, FALSE, TRUE}, [238] = {TRUE, FALSE, TRUE}, [239] = {TRUE, FALSE, TRUE}, [240] = {TRUE, FALSE, TRUE}, [241] = {TRUE, FALSE, TRUE}, [242] = {TRUE, FALSE, TRUE}, [243] = {FALSE, FALSE, TRUE}, [244] = {TRUE, FALSE, TRUE}, [245] = {FALSE, FALSE, TRUE}, [246] = {TRUE, FALSE, TRUE}, [247] = {FALSE, FALSE, FALSE}, [248] = {TRUE, FALSE, FALSE}, [249] = {TRUE, FALSE, FALSE}, [250] = {TRUE, FALSE, TRUE}, [251] = {TRUE, FALSE, TRUE}, [252] = {TRUE, FALSE, FALSE}, [253] = {TRUE, FALSE, TRUE}, [254] = {TRUE, FALSE, TRUE}, [255] = {FALSE, FALSE, TRUE}, [256] = {FALSE, FALSE, TRUE}, [257] = {FALSE, FALSE, TRUE}, [258] = {TRUE, FALSE, FALSE}, [259] = {FALSE, FALSE, TRUE}, [260] = {TRUE, FALSE, TRUE}, [261] = {FALSE, FALSE, TRUE}, [262] = {FALSE, FALSE, TRUE}, [263] = {TRUE, FALSE, TRUE}, [264] = {FALSE, FALSE, TRUE}, [265] = {FALSE, FALSE, TRUE}, [266] = {FALSE, FALSE, TRUE}, [267] = {FALSE, FALSE, TRUE}, [268] = {FALSE, FALSE, TRUE}, [269] = {FALSE, FALSE, TRUE}, [270] = {FALSE, FALSE, TRUE}, [271] = {FALSE, FALSE, TRUE}, [272] = {TRUE, FALSE, TRUE}, [273] = {TRUE, FALSE, TRUE}, [274] = {TRUE, FALSE, TRUE}, [275] = {TRUE, FALSE, TRUE}, [276] = {FALSE, FALSE, TRUE}, [277] = {TRUE, FALSE, TRUE}, [278] = {TRUE, FALSE, TRUE}, [279] = {FALSE, FALSE, TRUE}, [280] = {FALSE, FALSE, TRUE}, [281] = {FALSE, FALSE, FALSE}, [282] = {TRUE, FALSE, TRUE}, [283] = {FALSE, FALSE, TRUE}, [284] = {FALSE, FALSE, FALSE}, [285] = {TRUE, FALSE, TRUE}, [286] = {FALSE, FALSE, TRUE}, [287] = {FALSE, FALSE, TRUE}, [288] = {FALSE, FALSE, TRUE}, [289] = {FALSE, FALSE, TRUE}, [290] = {FALSE, FALSE, TRUE}, [291] = {FALSE, FALSE, TRUE}, [292] = {FALSE, FALSE, TRUE}, [293] = {FALSE, FALSE, TRUE}, [294] = {FALSE, FALSE, TRUE}, [295] = {FALSE, FALSE, TRUE}, [296] = {FALSE, FALSE, TRUE}, [297] = {FALSE, FALSE, TRUE}, [298] = {FALSE, FALSE, TRUE}, [299] = {FALSE, FALSE, TRUE}, [300] = {TRUE, FALSE, TRUE}, [301] = {FALSE, FALSE, TRUE}, [302] = {FALSE, FALSE, TRUE}, [303] = {FALSE, FALSE, TRUE}, [304] = {TRUE, FALSE, TRUE}, [305] = {FALSE, FALSE, TRUE}, [306] = {FALSE, FALSE, TRUE}, [307] = {FALSE, FALSE, TRUE}, [308] = {TRUE, FALSE, TRUE}, [309] = {TRUE, FALSE, TRUE}, [310] = {TRUE, FALSE, TRUE}, [311] = {TRUE, FALSE, TRUE}, [312] = {FALSE, FALSE, TRUE}, [313] = {TRUE, FALSE, TRUE}, [314] = {TRUE, FALSE, TRUE}, [315] = {TRUE, FALSE, TRUE}, [316] = {TRUE, FALSE, TRUE}, [317] = {TRUE, FALSE, TRUE}, [318] = {TRUE, FALSE, TRUE}, [319] = {FALSE, FALSE, TRUE}, [320] = {TRUE, FALSE, TRUE}, [321] = {FALSE, FALSE, TRUE}, [322] = {TRUE, FALSE, TRUE}, [323] = {FALSE, FALSE, TRUE}, [324] = {TRUE, TRUE, TRUE}, [325] = {FALSE, FALSE, TRUE}, [326] = {FALSE, FALSE, TRUE}, [327] = {TRUE, FALSE, TRUE}, [328] = {FALSE, FALSE, TRUE}, [329] = {TRUE, FALSE, TRUE}, [330] = {FALSE, FALSE, TRUE}, [331] = {TRUE, FALSE, TRUE}, [332] = {FALSE, FALSE, TRUE}, [333] = {FALSE, FALSE, TRUE}, [334] = {FALSE, FALSE, TRUE}, [335] = {TRUE, FALSE, TRUE}, [336] = {TRUE, FALSE, TRUE}, [337] = {FALSE, FALSE, FALSE}, [338] = {FALSE, FALSE, TRUE}, [339] = {FALSE, FALSE, TRUE}, [340] = {TRUE, FALSE, TRUE}, [341] = {TRUE, FALSE, TRUE}, [342] = {TRUE, FALSE, TRUE}, [343] = {TRUE, FALSE, TRUE}, [344] = {TRUE, FALSE, FALSE}, [345] = {TRUE, FALSE, FALSE}, [346] = {FALSE, FALSE, FALSE}, [347] = {FALSE, FALSE, FALSE}, [348] = {FALSE, FALSE, TRUE}, [349] = {FALSE, FALSE, TRUE}, [350] = {TRUE, FALSE, TRUE}, [351] = {TRUE, FALSE, TRUE}, [352] = {FALSE, FALSE, TRUE}, [353] = {TRUE, FALSE, TRUE}, [354] = {TRUE, FALSE, TRUE}, [355] = {TRUE, FALSE, TRUE}, [356] = {FALSE, FALSE, TRUE}, [357] = {FALSE, FALSE, FALSE}, [358] = {FALSE, FALSE, TRUE}, [359] = {TRUE, FALSE, TRUE}, [360] = {FALSE, FALSE, TRUE}, [361] = {TRUE, FALSE, TRUE}, [362] = {TRUE, FALSE, TRUE}, [363] = {FALSE, FALSE, TRUE}, [364] = {TRUE, TRUE, TRUE}, [365] = {FALSE, FALSE, TRUE}, [366] = {FALSE, FALSE, TRUE}, [367] = {FALSE, FALSE, TRUE}, [368] = {TRUE, FALSE, TRUE}, [369] = {FALSE, FALSE, TRUE}, [370] = {FALSE, FALSE, TRUE}, [371] = {FALSE, FALSE, FALSE}, [372] = {FALSE, FALSE, TRUE}, [373] = {FALSE, FALSE, TRUE}, [374] = {FALSE, FALSE, TRUE}, [375] = {FALSE, FALSE, TRUE}, [376] = {FALSE, FALSE, TRUE}, [377] = {FALSE, FALSE, TRUE}, [378] = {FALSE, FALSE, TRUE}, [379] = {FALSE, FALSE, TRUE}, [380] = {FALSE, FALSE, TRUE}, [399] = {FALSE, FALSE, TRUE} } -- Decides whether to perform a "retrieve weapon" animation after finishing a Weapon Art. -- See the above table for reference. function GetSwordArtsPutOppositeWeapon() -- ivi: In Fromsoft's original code, this was nil by default. FALSE is more forgiving for custom weapon arts. local result = FALSE -- ivi: Add sanity check for absent entries (custom Sword Arts). if SwordArtPutOppositeWeapon[c_SwordArtsID] ~= nil then if c_Style == HAND_RIGHT then if HAND_RIGHT == c_SwordArtsHand then if c_SwordArtsID == 276 and GetVariable("SwordArtsRollingDirection") == 3 then result = TRUE -- DLC special case else result = SwordArtPutOppositeWeapon[c_SwordArtsID][1] -- Right hand, weapon art cast from right hand end else result = SwordArtPutOppositeWeapon[c_SwordArtsID][2] -- Right hand, weapon art cast from left hand end elseif env(GetEquipWeaponCategory, c_SwordArtsHand) == WEAPON_CATEGORY_THROW_DAGGER or env(GetEquipWeaponCategory, c_SwordArtsHand) == WEAPON_CATEGORY_BACKHAND_SWORD then result = SwordArtPutOppositeWeapon[c_SwordArtsID][1] -- DLC special case else result = SwordArtPutOppositeWeapon[c_SwordArtsID][3] -- Left hand end end return result end ------------------------------------------ -- Core: Helper Functions ------------------------------------------ function Contains(tab, val) for index, value in ipairs(tab) do if value == val then return TRUE end end return FALSE end ------------------------------------------ -- Core: Logic Expansion ------------------------------------------ function IsWeaponCatalyst(sp_kind) local weaponCatalystSpKinds = { 293, -- Carian Sorcery Sword 283, -- Great Shield Catalyst 284, -- Small Shield Catalyst 285, -- Medium Shield Catalyst } if Contains(weaponCatalystSpKinds, sp_kind) == TRUE then return TRUE end return FALSE end ------------------------ -- Core: Global Variables ------------------------ HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE HandChangeTest_L = FALSE HandChangeTest_R = FALSE HandChangeTest_Time = 233 SPEED_COMBO_NUMBER_RIGHT = 0 SPEED_COMBO_NUMBER_LEFT = 0 SPEED_COMBO_NUMBER_BOTH = 0 SPEED_COMBO_NUMBER_DUAL = 0 SPEED_COMBO_ALLOW_ROLL = FALSE JUMP_STATE_1 = 0 JUMP_STATE_2 = 0 JUMP_STATE_3 = 0 RIDE_TURN_STATE = 0 PROTO5 = 0 DAMAGE_ELEMENT_DEFAULT = 0 DAMAGE_ELEMENT_MAGIC = 10 DAMAGE_ELEMENT_FIRE = 11 DAMAGE_ELEMENT_LIGHTNING = 12 DAMAGE_ELEMENT_DARK = 13 DAMAGE_ELEMENT_POISON = 20 DAMAGE_ELEMENT_BLIGHT = 21 DAMAGE_ELEMENT_BLOOD = 22 DAMAGE_ELEMENT_FROSTBITE = 23 DAMAGE_ELEMENT_SLEEP = 24 DAMAGE_ELEMENT_MAD = 25 DAMAGE_ELEMENT_CURSE = 26 DAMAGE_ELEMENT_NONE = 254 DAMAGE_ELEMENT_MATERIAL_1 = 255 DAMAGE_PHYSICAL_SLASH = 0 DAMAGE_PHYSICAL_BLUNT = 1 DAMAGE_PHYSICAL_THRUST = 2 DAMAGE_PHYSICAL_NORMAL = 3 IS_ATTACKED_JUMPMAGIC = FALSE g_IsMimicry = 0 g_EnableMimicry = 0 g_ComboReset = FALSE lastUsedMagicAnim = -1 Jump_InitWeaponRef = FALSE Jump_LeftWeaponRef = FALSE Event_MoveQuick = {"W_MoveQuick", MOVE_DEF0} local blendtimemax = 0 local blendtime = 0 local EVENT_BLEND_RATE = 1000 -- Torrent RIDE_MOVE_TYPE_IDLE = 0 RIDE_MOVE_TYPE_WALK = 1 RIDE_MOVE_TYPE_RUN = 2 RIDE_MOVE_TYPE_DASH = 3 RIDE_MOVE_TYPE_GALLOP = 4 RIDE_MOVE_TYPE_OTHER = 10 RIDE_ISENABLE_DOUBLEJUMP = TRUE RideDashAccelerateTest = 0 RideJumpLoop_IsSecond = FALSE DISABLEJUMP_FALLDIST = 20 rideJumpHighLoop_StopTime = 0 lastFallHeight = 0 rideJumpHighLoop_IsStop = FALSE -- DLC JUSTGUARD_IS_FIRSTFRAME = TRUE JUSTGUARD_RELEASE_GUARD_BUTTON = FALSE -- Added -- ACTION_ARM_JUMP = ACTION_ARM_CHANGE_STYLE -- Unused after remake ------------------------ -- Conditions -- env( , ) -- * are optional ------------------------ IsGeneralAnimEnd = 0 IsAttackAnimEnd = 1 AnimIDOffset = 9 AdditiveBlendAnim = 10 AdditiveBlendAnimOfSlot = 11 IsAtkRequest = 100 -- args: IsAtkReleaseRequest = 101 IsChainAtkRequest = 102 GetAtkDuration = 103 GetWeaponSwitchRequest = 104 GetCommandIDFromEvent = 105 GetAIActionType = 106 GetAIChainActionType = 107 GetChainEvadeRequest = 108 GetWeaponChangeRequest = 109 GetAnimIDFromMoveParam = 110 IsThereAnyAtkRequest = 111 IsThereAnyChainAtkRequest = 112 IsItemUseMenuOpening = 113 IsMagicUseMenuOpening = 114 IsItemUseMenuOpened = 115 IsMagicUseMenuOpened = 116 GetBlendAnimIDFromMoveParam = 117 GetAIChainStepType = 118 GetTransitionToSpecialStayAnimID = 119 GetAIAtkCancelType = 120 GetWeaponCancelType = 121 -- args: IsWeaponCancelPossible = 122 GetAIDefenseCancelType = 123 GetAIVersusBackstabCancelType = 124 IsFalling = 200 IsLanding = 201 GetReceivedDamageType = 202 IsActiveActionValid = 203 GetActionEventNumber = 204 IsNormalDmgPassThroughDuringThrow = 205 IsThrowing = 206 GetWeaponSwitchState = 207 IsEquipmentSwitchPossible = 209 IsAnimCancelPossibleInAtkRelease = 210 IsEmergencyStopAnimPlaying = 211 GetLockRangeState = 212 GetLockAngleState = 213 IsAnimCancelPossibleInDamageHit = 214 IsChangeToScrapeAtk = 215 IsChangeToDeflectAtk = 216 IsChangeToAfterParrySuccess = 217 IsChangeFromNormalToBigAtk = 218 GetMovementType = 219 IsLargeAtkComboPossible = 220 IsMapActionPossible = 221 GetReceivedDamageDirection = 222 GetMapActionID = 223 GetFallHeight = 224 GetEquipWeaponCategory = 225 -- args: IsHoldingBow = 226 GetMagicAnimType = 227 WasNotLargeAtk = 228 IsBackAtkPossible = 229 IsAfterParryAtkPossible = 230 GetItemAnimType = 231 IsMagicUseable = 232 -- args: , IsItemUseable = 233 IsPrecisionShoot = 234 IsFireDamaged = 235 GetDamageLevel = 236 GetGuardLevelAction = 237 IsNewLeftHandAtkFromStay = 238 IsParryFromIdle = 239 IsGuardFromIdle = 240 IsNewLeftHandAtkFromAtkCancel = 241 IsParryFromAtkCancel = 242 IsGuardFromAtkCancel = 243 IsTiedUp = 244 IsOutOfAmmo = 245 -- args: # 1 is left slot, 0 is right slot IsUseCatLanding = 246 GetHoverMoveState = 247 IsTruelyLanding = 248 IsRightHandMagic = 249 IsChangeToSpecialStayAnim = 250 GetSpecialStayAnimID = 251 AcquireSpecialDamageAnimationID = 252 IsRunTurnAnimPlaying = 253 IsGenerateAction = 254 GetSpecialStayCancelAnimID = 255 HasReceivedAnyDamage = 256 GetMoveAnimParamID = 257 GetGuardLevel = 258 IsRequestTurnAnimStart = 259 IsTurningWithAnim = 260 IsFlying = 261 IsAbilityInsufficient = 262 -- args: GetEquipWeightRatioForFalling = 263 GetFlightMotionState = 264 GetIsWeakPoint = 265 GetMoveAnimBlendRatio = 266 GetLadderActionState = 267 IsInDisguise = 268 IsCoopWait = 269 IsCoop = 270 IsSpecialTransitionPossible = 271 GetLandingAnimBlendRatio = 272 GetThrowAnimID = 273 DidOpponentDieFromThrow = 274 HasThrowEnded = 275 IsThrowSelfDeath = 276 IsThrowSuccess = 277 GetGuardMotionCategory = 278 -- args: IsBeingThrown = 279 IsSelfThrow = 280 IsThrowDeathState = 281 GetNewLockState = 282 IsOnLadder = 283 GetPhysicalAttribute = 284 GetSpecialAttribute = 285 GetSpecialStayDeathAnimID = 286 HasReceivedAnyDamage_AnimEnd = 287 EggGrowth_IsHeadScratch = 288 EggGrowth_IsBecomeEggHead = 289 IsStop = 290 IsSomeoneOnLadder = 291 -- args: , IsSomeoneUnderLadder = 292 -- args: , GetLadderHandState = 293 DoesLadderHaveCharacters = 294 -- args: , , IsLadderRightHandStayState = 295 IsDescendingToFloor = 296 IsInputDirectionMatch = 297 IsSpecialTransition2Possible = 298 IsVersusDivineDamage = 299 IsGeneralAnimCancelPossible = 300 GetEventEzStateFlag = 301 -- args: IsLadderEventEnd = 302 IsReachBottomOfLadder = 303 IsReachTopOfLadder = 304 GetStateChangeType = 305 -- args: IsOnLastRungOfLadder = 306 GetWeaponDurability = 311 IsWeaponBroken = 312 IsAnimEndBySkillCancel = 313 EggGrowth_IsBecomeEgghead_SecondStage = 314 IsHamariFallDeath = 315 -- args: IsClient = 316 IsSlope = 317 IsSwitchState = 318 IsPressUpKey = 319 IsSpecialTurning = 320 GetIntValueForTest = 321 IsObjActInterpolatedMotion = 322 GetObjActTargetDirection = 323 GetObjActRemainingInterpolateTime = 324 IsGap = 325 GetSwordArtID = 326 -- args: IsMovingLaterally = 327 IsNet = 328 HasBrokenSA = 329 IsEmergencyQuickTurnActivated = 330 IsDoubleChantPossible = 331 IsAnimOver = 332 ObtainedDT = 333 GetBehaviorID = 334 -- args: IsTwoHandPossible = 335 -- args: IsPartDamageAdditiveBlendInvalid = 336 IsThrowPosRealign = 337 GetBoltLoadingState = 338 -- args: IsAnimEnd = 339 -- args: IsTwinSwords = 340 -- args: GetTurnAngleForDelayedTurn = 341 GetThrowDefenseCount = 342 IsEmergencyEvasionPossible = 343 -- args: HasEnoughArtsPoints = 344 -- args: