------------------------------------------ -- Fixed decompiled c0000.hks for ELDEN RING: NIGHTREIGHN -- Decompiled using the DSLuaDecompiler by ElaDiDu (fork from original by katalash) -- Curated at: https://github.com/ividyon/EldenRingHKS ------------------------------------------ -- Version 11 (For ER:NR HKS last updated in 1.03.1) ------------------------------------------ -- Changelog: -- 2025-06-07 - Exelot: Initial Release -- - All env calls and act calls are replaced with their named counterparts -- - Notated all new Unknown env and act calls -- - Minor code cleanup -- - Ported SwordArtsCategory, SwordArtPutOppositeWeapon and MagicPutOppositeWeapon from common_define.hks conform with the ER HKS -- - Renamed all SwordArtsCategory entries for clarity -- - Ported the Contains function from the Elden Ring Community HKS -- - Cleaned up a bunch of f0_localX variables and functions that made it hard to read -- 2025-06-07 - Exelot: -- - Renamed env Unknown383 to GetMagicCocktailAffinityCount ( Thanks to ivi ) -- - Fixed a bug with the function GetEquipType ( Thanks to VIZZO ) -- 2025-06-26 - ivi: -- - Fixed erroneous heroFootOffsetTables, some cleanup -- 2025-07-27 - El Fonz0: -- - Identified many unknown env and act calls -- - Renamed env 160 and 161 to be more accurate -- - Slightly renamed DAMAGE_ELEMENT enums and added STATUS_EFFECT enums for env 409 -- - Replaced instances of ACTION_ARM_CHANGE_STYLE with ACTION_ARM_JUMP -- - Cleaned up rest of f0_local3 functions -- - Trimmed floats with trailing numbers (ex. 0.3000000012) -- - Added some comments -- - Fixed vanilla issue with Recluse's Magic Blade not able to be held indefinitely on controller -- - Fixed vanilla issue with TravelMagnifcation function where it wasn't applying the proper boost to non-dash attacks -- - Implemented a fix for crossbows/ballistas being inconsistent on holding shot inputs -- - Some code cleanup on some AttackCrossbowBothRight update functions -- - Added ARROW_SLOT enums -- - Added MAGIC_SLOT enums -- - Added WEAPON_REF enums -- - Added SUMMON enums for Revenant's skill -- - Added a helper variable 'c_MainHand' that defaults to HAND_RIGHT and changes to HAND_LEFT for 2H Left -- - Added a helper variable 'c_GuardHand' that defaults to HAND_LEFT and changes to HAND_RIGHT for 2H Right -- 2025-07-29 - El Fonz0: -- - Implemented a bandaid fix for a bug apparently caused by decomp where performing a back dodge with Duchess caused you to back dodge towards target -- - Added ROLLING variation enums -- - Added some comments for Surge Sprint toggling off and Rolling_Selftrans2 (Duchess repeated first dodge) -- 2025-08-01 - El Fonz0: -- - Updated with changes from 1.02 -- - Slightly optimized IsDualBladeSpecific function -- - Censored references to new heroes with generic ones -- 2025-08-12 - El Fonz0: -- - Updated with changes from 1.02.1 -- - Renamed ROLLING enum 8 to be more accurate -- - Identified env calls 386 and 387 - used in c9997 -- 2025-09-23 - El Fonz0: -- - Updated with changes from 1.02.2 -- 2025-09-24 - El Fonz0: -- - Updated with changes from 1.02.3 -- 2025-12-08 - El Fonz0: -- - Updated with changes from 1.03 NR DLC -- - Reverted DLC hero censoring -- - Noted new env and act calls -- 2025-12-10 - ccx: -- - Fixed an issue where Undertaker’s auto-dodge caused abnormal rolling behavior (during the skill’s active period, dodging in any direction would make you dash toward the enemy). -- - Also optimized Duchess’s special dodge logic to make it feel closer to the original experience. -- 2025-12-17 - El Fonz0: -- - Updated with changes from 1.03.1 ------------------------------------------ -- Known issues: -- N/A -- To-Do: -- Identify Unknown env and act calls -- Code Cleanup -- Add more comments ------------------------------------------ -- Core: Functions ------------------------------------------ function Modpage() if env(GetSpEffectID, 690001) == TRUE then openurl(690001, "www.nexusmods.com/eldenringnightreign/mods/578") act(Wait) end end function Discord() if env(GetSpEffectID, 690002) == TRUE then openurl2(690002) act(Wait) end end function Patreon() if env(GetSpEffectID, 690003) == TRUE then openurl(690003, "patreon.com/DaybreakTeam?utm_medium=unknown&utm_source=join_link&utm_campaign=creatorshare_creator&utm_content=copyLink") act(Wait) end end function Kofi() if env(GetSpEffectID, 690004) == TRUE then openurl(690004, "ko-fi.com/churchguard") act(Wait) end end function openurl(spEffect, url) act(ClearSpEffect, spEffect) os.execute('start "link" "https://' .. url .. '/"') end function openurl2(spEffect, url) act(ClearSpEffect, spEffect) os.execute('start "link" "https://discord.gg/mMWgsdTnWw"') end 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) SetVariable("MoveWeightIndex", MOVE_WEIGHT_LIGHT) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_LIGHT) if env(GetHeroID) == HERO_POWER then SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_MEDIUM) end if SetSlowFeet() == TRUE then if env(GetSpEffectID, 46328) == TRUE or env(GetSpEffectID, 46329) == TRUE then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) elseif env(GetSpEffectID, 4100) == FALSE then SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) SetVariable("EvasionWeightIndex", EVASION_WEIGHT_INDEX_HEAVY) else SetVariable("MoveWeightIndex", MOVE_WEIGHT_HEAVY) end end return end function SetSlowFeet() if env(GetSpEffectID, 503520) == TRUE then return TRUE elseif env(GetSpEffectID, 5520) == TRUE then return TRUE elseif env(GetSpEffectID, 425) == TRUE then return TRUE elseif env(GetSpEffectID, 426) == TRUE then return TRUE elseif env(GetSpEffectID, 42312) == TRUE then return TRUE elseif env(GetSpEffectID, 4101) == TRUE then return TRUE elseif env(GetSpEffectID, 4100) == TRUE then return TRUE elseif env(GetSpEffectID, 46328) == TRUE or env(GetSpEffectID, 46329) == TRUE then return TRUE end return FALSE end function SetAIActionState() act(SetAIAttackState, env(GetNpcAIAttackRequestIDAfterBlend)) end function SetAttackHand(hand) act(WeaponParameterReference, hand) end function SetGuardHand(hand) if IsDemonSwordMode() == TRUE then act(GuardParameterReference, WEAPON_REF_SKILL) else act(GuardParameterReference, hand) end end function ResetRightArmAdd() SetVariable("RightArmAddWeight_a02", 0) SetVariable("RightArmAddWeight_a03", 0) 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 end end function BanSprint() if GetVariable("MoveSpeedIndex") >= 3 then SetVariable("MoveSpeedIndex", 2) end end function Replanning() act(DoAIReplanningAtCancelTiming) end function AddStamina(num) if env(GetHeroID) == HERO_SPEED then num = num * STAMINA_CONSUMERATE_SPEED end if env(GetStateChangeType, CONDITION_TYPE_NIGHT) == FALSE and (num == STAMINA_REDUCE_DASHJUMP or num == STAMINA_REDUCE_SPRINTJUMP) then return FALSE end act(SetStaminaRecoveryDisabled) act(ChangeStamina, num) end function GetLocomotionState() local state = GetVariable("LowerDefaultState00") if state == MOVE_DEF0 or state == STEALTHMOVE_DEF0 then if env(GetSpEffectID, 100000) == TRUE then return PLAYER_STATE_MOVE elseif env(GetSpEffectID, 100001) == TRUE then return PLAYER_STATE_MOVE elseif env(GetSpEffectID, 100002) == TRUE then return PLAYER_STATE_MOVE end end return PLAYER_STATE_IDLE end function SetInterruptType(num) act(AINotifyAttackType, num) end function SetTurnSpeed(turn_speed) act(SetTurnSpeed, turn_speed) end function SetRollingTurnCondition(is_selftrans) local rolling_angle = "RollingAngleReal" if is_selftrans == TRUE then rolling_angle = "RollingAngleRealSelftrans" end if GetVariable("IsLockon") == true then local angle = GetVariable("TurnAngleReal") if angle > 180 then SetTurnSpeed(0) elseif angle > 90 then SetTurnSpeed(360) end elseif env(IsPrecisionShoot) == TRUE then SetTurnSpeed(0) SetVariable("TurnAngleReal", 300) elseif math.abs(GetVariable(rolling_angle)) > 0.001 then SetTurnSpeed(0) elseif GetVariable("TurnAngleReal") > 200 then SetTurnSpeed(0) end end function IsLowerQuickTurn() if GetVariable("LowerDefaultState00") == QUICKTURN_DEF0 and env(GetSpEffectID, 100010) == TRUE then return TRUE end return FALSE end function IsLowerBackStep() if GetVariable("LowerDefaultState00") == BACKSTEP_DEF0 then return TRUE end return FALSE end function IsDualBladeSpecific(hand) return env(IsTwinSwords, hand) 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 if IsDemonSwordMode() == TRUE then return TRUE end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if style == HAND_RIGHT and GetEquipType(hand, WEAPON_CATEGORY_STAFF) == TRUE then return FALSE end if IsWeaponCanGuard() == FALSE then return FALSE end if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then if sp_kind == 635 then return FALSE elseif sp_kind == 637 then return FALSE elseif sp_kind == 627 then return FALSE elseif sp_kind == 639 then return FALSE elseif sp_kind == 640 then return FALSE elseif sp_kind == 647 then return FALSE end end if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then else local left_kind = env(GetEquipWeaponCategory, HAND_LEFT) if left_kind == 60 then return FALSE elseif left_kind == 58 then return FALSE elseif left_kind == 61 then return FALSE end end local right_kind = env(GetEquipWeaponCategory, HAND_RIGHT) local is_shield_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, 57) if style == HAND_RIGHT then if right_kind == 57 and is_shield_left == FALSE then return FALSE end end if IsEnableDualWielding() ~= -1 then return FALSE end return TRUE end function IsEnableHighGuard() if env(GetHeroID) ~= HERO_TANK then return FALSE end if IsEnableDualWielding() ~= -1 then return FALSE end local is_shield_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, 57) local is_shield_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, 57) local fuckyou = GetEquipType(HAND_BOTH, 57) local style = c_Style if env(GetSpEffectID, 701540) == TRUE and fuckyou == FALSE then return FALSE end if style == HAND_RIGHT_BOTH then if is_shield_right == TRUE then return TRUE else return FALSE end end if is_shield_left == TRUE then return TRUE end return FALSE end function ExecGuard(event, blend_type, is_demonswordstance) if GetVariable("AddFookShotBlend") == 1 then return FALSE end if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return FALSE end if c_IsStealth == TRUE then blend_type = ALLBODY end local style = c_Style local hand = HAND_LEFT local is_demonswordstance = is_demonswordstance if env(ActionRequest, ACTION_ARM_L1) == TRUE or env(ActionDuration, ACTION_ARM_L1) > 0 then if env(GetStamina) <= 0 then return FALSE end local is_shootingweapon_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) local is_shootingweapon_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) local is_large_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW) local is_large_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) local is_ballista_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) local is_ballista_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_BALLISTA) if style == HAND_LEFT_BOTH and is_shootingweapon_left == TRUE then if is_large_arrow_left == TRUE or is_ballista_left == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end ExecEventHalfBlend(Event_AttackArrowRightStart, blend_type) elseif style == HAND_RIGHT_BOTH and is_shootingweapon_right == TRUE then if is_large_arrow_right == TRUE or is_ballista_right == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end ExecEventHalfBlend(Event_AttackArrowRightStart, blend_type) elseif 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 env(GetHeroID) == HERO_TANK and env(GetSpEffectID, 701530) == TRUE then guardindex = GUARD_STYLE_HIGHGUARD elseif IsDemonSwordMode() == TRUE then guardindex = GUARD_STYLE_DEMONSWORD elseif kind == WEAPON_CATEGORY_TORCH and style == HAND_RIGHT then guardindex = GUARD_STYLE_TORCH if sp_kind == 250 then SetVariable("IndexTorchColor", 1) elseif sp_kind == 251 then SetVariable("IndexTorchColor", 2) else SetVariable("IndexTorchColor", 0) end elseif sp_kind == 240 and style == HAND_RIGHT then guardindex = GUARD_STYLE_TORCH elseif (style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH) and env(GetStayAnimCategory) ~= 15 and env(GetStayAnimCategory) ~= 0 and env(GetStayAnimCategory) ~= 2 and env(GetStayAnimCategory) ~= 3 then guardindex = GUARD_STYLE_DEFAULT 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 ExecEventHalfBlend(event, blend_type, is_demonswordstance) return TRUE end end return FALSE end function ResetRequest() act(ResetInputQueue) end function CheckActionRequest() return env(HasActionRequest) end function ExecStop() if GetVariable("MoveSpeedLevel") > 0 and env(GetSpEffectID, 100200) == FALSE then return FALSE end local stop_speed = GetVariable("MoveSpeedLevelReal") local stop_speed2 = GetVariable("MoveSpeedIndex") local movedirection = GetVariable("MoveDirection") SetVariable("ToggleDash", 0) SetWeightIndex() if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT and stop_speed > 0.35 then stop_speed = 0.35 end if GetVariable("MoveSpeedIndex") > 2 then if c_IsStealth == TRUE then ExecEventAllBody("W_StealthDashStop") else ExecEventAllBody("W_SprintStop") end elseif stop_speed >= 0 and stop_speed <= 1 then if stop_speed <= 0.35 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 -- Undertaker - Trance Movement elseif env(GetHeroID) == HERO_ATTACKER and (env(GetSpEffectID, 709000) == TRUE or env(GetSpEffectID, 709010) == TRUE) then ExecEventAllBody("W_DashStop") 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) 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) if GetVariable("MoveSpeedLevel") <= 0 then return FALSE end if env(GetSpEffectID, 100200) == TRUE then return FALSE end if env(GetSpEffectID, 102100) == TRUE then ExecEventAllBody("W_NearDeathMove") return TRUE end if blend_type ~= LOWER then if gen_hand == FALSE then SetVariable("ArtsTransition", 0) elseif gen_hand == SET_SKILL_HAND_RIGHT then SetSkillGeneratorTransitionIndex(gen_hand) elseif gen_hand == SET_SKILL_HAND_LEFT then SetSkillGeneratorTransitionIndex(gen_hand) elseif gen_hand == SET_SKILL_HAND_BOTH then SetSkillGeneratorTransitionIndex(gen_hand) elseif gen_hand == SET_SKILL_HAND_ARROW then SetArrowGeneratorTransitionIndex(hand_left) 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 env(GetSpEffectID, 102040) == TRUE then if GetVariable("MoveSpeedIndex") >= 3 then hkbFireEvent("W_Rolling_To_Sprint") return TRUE elseif GetVariable("MoveSpeedLevel") >= 2 then hkbFireEvent("W_Rolling_To_Dash") return TRUE elseif GetVariable("MoveSpeedLevel") >= 1 then hkbFireEvent("W_Rolling_To_Run") return TRUE end end 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() 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)) elseif env(ActionDuration, ACTION_ARM_ACTION) > 0 or env(ActionDuration, ACTION_ARM_SKILL) > 0 or env(ActionDuration, ACTION_ARM_ULTRA) > 0 then act(SetWeaponCancelType, 2) else act(SetWeaponCancelType, 2) 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 then art_hand = HAND_RIGHT art_id = env(GetSwordArtID, HAND_RIGHT) else art_hand = HAND_LEFT art_id = weaponswordartid end end return art_id, art_hand end function IsEnableSwordArts() 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 c_Style == HAND_RIGHT and env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_STAFF 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(Unknown9999, 1) return end if c_SwordArtsID == SWORDARTS_PARRY then act(Unknown9999, 1) else act(Unknown9999, 0) end end function IsAttackSwordArts(arts_id) 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 arts_id == 157 or arts_id == 160 then if Contains(aow_whitelist, arts_id) then return TRUE else return FALSE end else return TRUE end end function IsHalfBlendArts(arts_id) if arts_id == 20 or arts_id == 58 or arts_id == 168 or arts_id == 182 or arts_id == 183 or arts_id == 202 or arts_id == 206 or arts_id == 217 or arts_id == 184 or arts_id == 199 or arts_id == 203 or arts_id == 213 or arts_id == 328 or arts_id == 335 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) if 90 <= arts_id and arts_id <= 99 or arts_id == 17 or arts_id == 71 or arts_id == 151 or arts_id == 152 or arts_id == 201 or arts_id == 202 or arts_id == 207 or arts_id == 196 or arts_id == 197 or arts_id == 195 or arts_id == 211 or arts_id == 399 then return TRUE else return FALSE end end function IsStanceArts(arts_id) if arts_id == 10 or arts_id == 11 or arts_id == 14 or arts_id == 15 or arts_id == 21 or arts_id == 178 or arts_id == 100 or arts_id == 101 or arts_id == 102 or arts_id == 103 or arts_id == 104 or arts_id == 105 or arts_id == 106 or arts_id == 107 or arts_id == 108 or arts_id == 337 or arts_id == 80 or arts_id == 81 or arts_id == 25 or arts_id == 219 or arts_id == 239 or arts_id == 169 or arts_id == 260 or arts_id == 318 or arts_id == 278 or arts_id == 279 or arts_id == 26 or arts_id == 29 or arts_id == 32 or arts_id == 38 or arts_id == 335 or arts_id == 43 or arts_id == 42 or arts_id == 47 then return TRUE else return FALSE end end function IsArrowStanceArts(arts_id) if arts_id == 100 or arts_id == 101 or arts_id == 102 or arts_id == 103 or arts_id == 104 or arts_id == 105 or arts_id == 106 or arts_id == 107 or arts_id == 108 or arts_id == 169 or arts_id == 337 or arts_id == 80 then return TRUE else return FALSE end end function IsAttackStanceArts(arts_id) if arts_id == 10 or arts_id == 11 or arts_id == 25 or arts_id == 239 then return TRUE elseif env(GetSpEffectID, 100490) == FALSE and arts_id == 38 then return TRUE else return FALSE end end function IsRollingArts(arts_id) if arts_id == 155 or arts_id == 156 or arts_id == 276 or arts_id == 313 or arts_id == 27 or arts_id == 28 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 IsRollingArts(arts_id) == TRUE then request = SWORDARTS_REQUEST_RIGHT_STEP animID = SWORDARTS_ANIM_ID_RIGHT_STEP_FRONT elseif env(GetSpEffectID, 100052) == TRUE then request = SWORDARTS_REQUEST_RIGHT_COMBO_1 animID = SWORDARTS_ANIM_ID_RIGHT_COMBO_1 elseif env(GetSpEffectID, 100053) == TRUE and arts_id ~= 325 then request = SWORDARTS_REQUEST_RIGHT_COMBO_2 animID = SWORDARTS_ANIM_ID_RIGHT_COMBO_2 elseif env(GetSpEffectID, 100053) == TRUE and arts_id == 325 then if env(GetSpEffectID, 8981920) == TRUE then act(ClearSpEffect, 8981920) request = SWORDARTS_REQUEST_RIGHT_COMBO_2 animID = SWORDARTS_ANIM_ID_RIGHT_COMBO_2 end 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 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 artsID == 92 or artsID == 93 or artsID == 94 or artsID == 112 or artsID == 17 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 val = "IsEnoughArtPointsR1" 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 then 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 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 SetVariable(val, sel) end function SetStormRulerArtsPointInfo(r1, r2, b1, b2) local button = ACTION_ARM_R1 local val = "IsEnoughArtPointsL2" if r1 == "W_StormRuler_AttackLight1" or r2 == "W_StormRuler_AttackLight1" or b1 == "W_StormRuler_AttackLight1" or b2 == "W_StormRuler_AttackLight1" then button = ACTION_ARM_R1 val = "IsEnoughArtPointsR1" elseif r1 == "W_StormRuler_AttackLight2" or r2 == "W_StormRuler_AttackLight2" or b1 == "W_StormRuler_AttackLight2" or b2 == "W_StormRuler_AttackLight2" then button = ACTION_ARM_R1 val = "IsEnoughArtPointsR1_2" elseif r1 == "W_StormRuler_AttackLight3" or r2 == "W_StormRuler_AttackLight3" or b1 == "W_StormRuler_AttackLight3" or b2 == "W_StormRuler_AttackLight3" then button = ACTION_ARM_R1 val = "IsEnoughArtPointsR1_3" elseif r1 == "W_StormRuler_AttackHeavy" or r2 == "W_StormRuler_AttackHeavy" or b1 == "W_StormRuler_AttackHeavy" or b2 == "W_StormRuler_AttackHeavy" then button = ACTION_ARM_R2 val = "IsEnoughArtPointsR2" else return false end local hand = c_SwordArtsHand act(ReserveArtsPointsUse, button, hand) local sel = 0 local artsID = env(GetSwordArtID, hand) if env(HasEnoughArtsPoints, button, hand) == FALSE then sel = 1 end SetVariable(val, sel) 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 if c_SwordArtsID == 38 then if env(GetSpEffectID, 100490) == TRUE then return FALSE else return TRUE end 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 idle_cat < 10 then SetVariable("ArtsTransition", 0) return end SetVariable("ArtsTransition", 9) end return 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 return end function SetRightSpecialHeavyAttackGeneratorTransitionIndex() 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 return end function SetAttackHeavyTypeB1GeneratorTransitionIndex() local style = c_Style if style == HAND_RIGHT then local hand = HAND_LEFT 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 idle_cat < 10 then SetVariable("ArtsTransition", 0) return end SetVariable("ArtsTransition", 9) end return end function SkillGeneratorTransitionIndex() 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 idle_cat < 10 then SetVariable("ArtsTransition", 0) return end SetVariable("ArtsTransition", 9) end return end function SetArrowGeneratorTransitionIndex(hand_left) local style = c_Style local hand = HAND_LEFT local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if sp_kind_L == 999 then sp_kind_L = 522 end if sp_kind_R == 999 then sp_kind_R = 522 end if style == HAND_RIGHT then local hand = HAND_LEFT if hand_left == TRUE then hand = HAND_RIGHT if sp_kind_R == 522 then SetVariable("ArtsTransition", 0) return end elseif sp_kind_L == 522 then SetVariable("ArtsTransition", 1) return 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", 0) end return end function SetSkillGeneratorTransitionIndex(skill_type) local style = c_Style local hand = HAND_LEFT local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if sp_kind_L == 999 then sp_kind_L = 522 end if sp_kind_R == 999 then sp_kind_R = 522 end if env(GetSpEffectID, 9621) == TRUE then return end if skill_type == SET_SKILL_HAND_RIGHT then if sp_kind_R == 522 then SetVariable("ArtsTransition", 0) return end hand = HAND_RIGHT 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 elseif skill_type == SET_SKILL_HAND_LEFT then if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then SetVariable("ArtsTransition", 0) return end if sp_kind_L == 522 then SetVariable("ArtsTransition", 0) return end hand = HAND_LEFT 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) else SetVariable("ArtsTransition", 0) end elseif skill_type == SET_SKILL_HAND_BOTH then if style == HAND_RIGHT then hand = HAND_RIGHT if sp_kind_R == 522 then hand = HAND_LEFT if sp_kind_L == 522 then SetVariable("ArtsTransition", 0) return end 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 elseif style == HAND_RIGHT_BOTH then hand = HAND_RIGHT local changetype = GetHandChangeType(hand) if 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 elseif style == HAND_LEFT_BOTH then hand = HAND_LEFT local changetype = GetHandChangeType(hand) if changetype == WEAPON_CHANGE_REQUEST_LEFT_WAIST then SetVariable("ArtsTransition", 6) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_BACK then SetVariable("ArtsTransition", 6) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then SetVariable("ArtsTransition", 7) elseif changetype == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then SetVariable("ArtsTransition", 8) else SetVariable("ArtsTransition", 0) end end end return end function IsMagicAnimExists(magic_type, anim_id) local animExists = FALSE animExists = env(DoesAnimExist, magic_type + 400, anim_id) return animExists end function IsQuickMagic() local magic_type = env(GetMagicAnimType) if magic_type == MAGIC_REQUEST_WEAPON_ENCHANT2 and c_Style == HAND_RIGHT or magic_type == MAGIC_REQUEST_STONE_SHOTGUN or magic_type == MAGIC_REQUEST_QUICKENBULLET or magic_type == MAGIC_REQUEST_QUICKSLASH or magic_type == MAGIC_REQUEST_QUICK_FLAME then return TRUE end return FALSE end function IsCreateMagic() local magic_type = env(GetMagicAnimType) if magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE or magic_type == MAGIC_REQUEST_CREATEMAGIC_MAGICAL or magic_type == MAGIC_REQUEST_CREATEMAGIC_THUNDER or magic_type == MAGIC_REQUEST_CREATEMAGIC_HOLY or magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE_MAGICAL or magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE_THUNDER or magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE_HOLY or magic_type == MAGIC_REQUEST_CREATEMAGIC_MAGICAL_THUNDER or magic_type == MAGIC_REQUEST_CREATEMAGIC_MAGICAL_HOLY or magic_type == MAGIC_REQUEST_CREATEMAGIC_THUNDER_HOLY or magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE_MAGICAL_THUNDER or magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE_MAGICAL_HOLY or magic_type == MAGIC_REQUEST_CREATEMAGIC_FIRE_THUNDER_HOLY or magic_type == MAGIC_REQUEST_CREATEMAGIC_MAGICAL_THUNDER_HOLY then return TRUE end return FALSE end function IsWeaponEnchantMagic() local magic_type = env(GetMagicAnimType) if magic_type == MAGIC_REQUEST_WEAPON_ENCHANT or magic_type == MAGIC_REQUEST_WEAPON_ENCHANT2 or magic_type == MAGIC_REQUEST_WEAPON_ENCHANT_B or magic_type == MAGIC_REQUEST_THUNDER_ENCHANT or magic_type == MAGIC_REQUEST_HOLY_ENCHANT then return TRUE end return FALSE end function IsJumpMagic() local magic_type = env(GetMagicAnimType) if magic_type == MAGIC_REQUEST_FLYING_BREATH or magic_type == MAGIC_REQUEST_ELDER_DRAGON_BREATH then return TRUE end return FALSE end function IsComboMagic() local magic_type = env(GetMagicAnimType) return IsMagicAnimExists(magic_type, 45020) end function IsChargeMagic() local magic_type = env(GetMagicAnimType) return IsMagicAnimExists(magic_type, 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) if magic_type == 26 or magic_type == 114 then return TRUE else return FALSE end end -- Wylder Skill - Claw Shot function IsFookShotMode() if env(GetHeroID) == HERO_BALANCE and GetVariable("AddFookShotBlend") == 1 then return TRUE end return FALSE end -- Revenant Skill - Summon Spirit function IsSummonNecromanceMode() if env(GetHeroID) == HERO_NECROMANCER and env(GetSpEffectID, 103010) == TRUE then return TRUE end return FALSE end -- Executor Skill - Cursed Sword function IsDemonSwordMode() if env(GetHeroID) == HERO_TECHNICAL and env(GetSpEffectID, 707060) == TRUE then return TRUE end return FALSE end -- Executor Ultimate - Aspects of the Crucible: Beast function IsDemonBeastMode() if env(GetHeroID) == HERO_TECHNICAL and env(GetSpEffectID, 707115) == TRUE then return TRUE end return FALSE end -- Scholar Skill - Analyse function IsPhotoShootMode() if env(GetHeroID) == HERO_BUFFER and env(GetSpEffectID, 603080) == TRUE then return TRUE end return FALSE end -- Undertaker Skill - Trance function IsTranceMode() if env(GetHeroID) == HERO_ATTACKER and (env(GetSpEffectID, 709000) == TRUE or env(GetSpEffectID, 709010) == TRUE) then return TRUE end return FALSE end -- Determine if player should be directly killed function IsDirectDeath() -- If player isn't a hero or has speffect 102130 if env(GetHeroID) == HERO_NONE or env(GetSpEffectID, 102130) == TRUE then return TRUE end -- Check if player is solo and some value being 0/2/3 if env(IsMultiplayer) == FALSE and (env(Unknown389) == 0 or env(Unknown389) == 2 or env(Unknown389) == 3) then -- Check if player is vs a Night boss/Nightlord if env(GetSpEffectID, 102120) == TRUE then -- Check if player doesn't have auto revival from a Wending Grace, Favor of Noklateo, or Solo Revival -- DLC - Check another effect if env(GetSpEffectID, 540155) == FALSE and env(GetSpEffectID, 6999100) == FALSE and env(GetSpEffectID, 6999500) == FALSE and env(GetSpEffectID, 8970061) == FALSE then return TRUE end elseif env(GetSpEffectID, 8970061) == FALSE then return TRUE end end -- Check if player fell into a death zone, like off a cliff if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH_FALLING then return TRUE end return FALSE end function ExecRainEffect() if env(GetSpEffectID, 99872) == TRUE or env(GetSpEffectID, 99877) == TRUE then act(AddSpEffect, 99881) return TRUE elseif env(GetSpEffectID, 99871) == TRUE or env(GetSpEffectID, 99876) == TRUE then act(AddSpEffect, 99880) return TRUE elseif env(GetSpEffectID, 99880) == TRUE or env(GetSpEffectID, 99881) == TRUE then act(AddSpEffect, 99882) return TRUE else return FALSE end end function ExecFookShot() if env(GetHeroID) ~= HERO_BALANCE then return FALSE end if GetVariable("AddFookShotBlend") == 1 and env(ActionDurationAlternate, ACTION_ARM_L2) <= 0 and env(ActionDuration, ACTION_ARM_SKILL) <= 0 then if env(IsLanding) == TRUE then ExecEventAllBody("W_FookShotFire") return TRUE else ExecEventAllBody("W_AirFookShotFire") return TRUE end end return FALSE end function FookShotHit() FOOKSHOT_TARGET_DIST = env(GetFookshotTargetDistance) return end function CalculateKnockbackRate() local fookshot_pull_dist = 2000 local fookshot_goal_dist = 250 local fookshot_knockback_dist = 300 local fookshot_knockback_rate = 1 fookshot_pull_dist = FOOKSHOT_TARGET_DIST - fookshot_goal_dist fookshot_knockback_rate = fookshot_pull_dist / fookshot_knockback_dist if fookshot_knockback_rate <= 0.5 then fookshot_knockback_rate = 0.5 end FOOKSHOT_KNOCKBACK_RATE = fookshot_knockback_rate FOOKSHOT_TARGET_DIST = 300 return end -- Duchess Skill - Restage function ExecChangeDejavuBlend() if env(GetHeroID) ~= HERO_SPEED then return FALSE end if GetVariable("AddDejavuBlend") ~= 1 then return FALSE end if GetVariable("IndexDejavuBlend") == 2 or IsNodeActive("Idle_CMSG") == TRUE or IsNodeActive("Move_Upper Selector") == TRUE or IsNodeActive("Stop_SM") == TRUE or IsNodeActive("Rolling_CMSG") == TRUE or IsNodeActive("Rolling_Selftrans_CMSG") == TRUE or IsNodeActive("LadyBackStep_Selector") == TRUE or IsNodeActive("LadyBackStep2_Selector") == TRUE then elseif IsNodeActive("NewJump Script") == TRUE and GetVariable("JumpAttackForm") == 0 then else SetVariable("IndexDejavuBlend", 2) end if env(GetSpEffectID, 703546) == TRUE then SetVariable("AddDejavuBlend", 0) end return FALSE end -- Duchess Skill - Restage function ExecDejavu() if env(GetHeroID) ~= HERO_SPEED then return FALSE end if GetVariable("AddDejavuBlend") ~= 0 then return FALSE end if env(IsCharacterSkillReady) == FALSE then return FALSE end if env(GetHP) <= 0 then return FALSE end if env(ActionDuration, ACTION_ARM_SKILL) > 0 then if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then SetVariable("IndexDejavuBlend", 1) else SetVariable("IndexDejavuBlend", 0) end if env(GetStateChangeType, 2271) == TRUE then SetVariable("IsRelic_Dejavu", 1) else SetVariable("IsRelic_Dejavu", 0) end if env(GetSpEffectID, 7500300) == TRUE then act(AddSpEffect, 7500301) end SetVariable("AddDejavuBlend", 1) act(ResetInputQueue) return TRUE end return FALSE end -- Undertaker - Skill function ExecChangeTranceBlend() if env(GetHeroID) ~= HERO_ATTACKER then return FALSE end if GetVariable("AddTranceBlend") ~= 1 then return FALSE elseif GetVariable("IndexTranceBlend") == 3 then if env(GetSpEffectID, 709021) == TRUE then if env(IsUltimateArtReady) == TRUE then SetVariable("AddTranceBlend", 1) SetVariable("IndexTranceBlend", 0) SetVariable("IsEnhanceTrance", 1) act(ResetInputQueue) return TRUE else SetVariable("AddTranceBlend", 1) SetVariable("IndexTranceBlend", 0) SetVariable("IsEnhanceTrance", 0) act(ResetInputQueue) return TRUE end elseif env(ActionDuration, ACTION_ARM_SKILL) <= 0 then SetVariable("IndexTranceBlend", 0) SetVariable("IsEnhanceTrance", 0) act(ResetInputQueue) return TRUE elseif env(ActionDurationAlternate, ACTION_ARM_R2) > 0 and env(IsUltimateArtReady) == TRUE then SetVariable("IndexTranceBlend", 0) SetVariable("IsEnhanceTrance", 1) act(ResetInputQueue) return TRUE else return FALSE end elseif GetVariable("IndexTranceBlend") ~= 2 and IsNodeActive("Idle_CMSG") ~= TRUE and IsNodeActive("Move_Upper Selector") ~= TRUE and IsNodeActive("Stop_SM") ~= TRUE and IsNodeActive("Rolling_CMSG") ~= TRUE and IsNodeActive("Rolling_Selftrans_CMSG") ~= TRUE and IsNodeActive("LadyBackStep_Selector") ~= TRUE then if IsNodeActive("LadyBackStep2_Selector") == TRUE then elseif IsNodeActive("NewJump Script") == TRUE and GetVariable("JumpAttackForm") == 0 then else SetVariable("IndexTranceBlend", 2) end end if env(GetSpEffectID, 709020) == TRUE then SetVariable("AddTranceBlend", 0) end return FALSE end -- Recluse - Skill Relic function ExecElementalAbsorption_TerraMagicus() if env(GetSpEffectID, 7032801) == TRUE then return FALSE -- Absorbed any element elseif env(GetSpEffectID, 706000) == TRUE or env(GetSpEffectID, 706001) == TRUE or env(GetSpEffectID, 706002) == TRUE or env(GetSpEffectID, 706003) == TRUE then act(AddSpEffect, 7032801) end return FALSE end -- Undertaker - Skill function ExecTrance() if env(GetHeroID) ~= HERO_ATTACKER then return FALSE elseif env(GetSpEffectID, 709000) == TRUE or env(GetSpEffectID, 709010) == TRUE then return FALSE elseif ISENABLE_TRANCESTART == FALSE then if env(ActionDuration, ACTION_ARM_SKILL) <= 0 then ISENABLE_TRANCESTART = TRUE end return FALSE elseif env(IsCharacterSkillReady) == FALSE then return FALSE elseif env(GetHP) <= 0 then return FALSE elseif env(ActionDuration, ACTION_ARM_SKILL) > 0 then ISENABLE_TRANCESTART = FALSE ISENABLE_TRANCEEND = FALSE SetVariable("IndexTranceBlend", 3) SetVariable("IsEnhanceTrance", 0) SetVariable("AddTranceBlend", 1) act(ResetInputQueue) return FALSE else return FALSE end end -- Undertaker - Skill function ExecTranceEnd() if env(GetHeroID) ~= HERO_ATTACKER then return FALSE elseif env(GetHP) <= 0 then return FALSE elseif GetVariable("IndexTranceBlend") == 3 then return FALSE elseif ISENABLE_TRANCEEND == FALSE then if env(ActionDuration, ACTION_ARM_SKILL) <= 0 then ISENABLE_TRANCEEND = TRUE end return FALSE elseif env(ActionDuration, ACTION_ARM_SKILL) > 0 then if env(GetSpEffectID, 709010) == TRUE then ISENABLE_TRANCESTART = FALSE ISENABLE_TRANCEEND = TRUE act(AddSpEffect, 709001) act(AddSpEffect, 709002) act(AddSpEffect, 709055) act(ResetInputQueue) return TRUE elseif env(GetSpEffectID, 709000) == TRUE then ISENABLE_TRANCESTART = FALSE ISENABLE_TRANCEEND = TRUE act(AddSpEffect, 709011) act(AddSpEffect, 709071) act(AddSpEffect, 709055) act(ResetInputQueue) return TRUE end end return FALSE end -- Undertaker - Bonus Ultimate function ExecAttackerUltCounterReset() if env(GetHeroID) ~= HERO_ATTACKER then return FALSE elseif env(Unknown389) ~= 0 then return FALSE else ATTACKER_ULT_COUNTER = 0 return FALSE end end -- Duchess - Reset dodge combo function SetLadyComobo() if env(GetHeroID) ~= HERO_SPEED then return FALSE end if SPEED_COMBO_NUMBER_RIGHT == 0 or IsNodeActive("Rolling_CMSG") == TRUE or IsNodeActive("LadyBackStep2_Selector") == 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 -- Trigger successful guarding effects function ExecGuardBuff() if env(GetReceivedDamageType) == DAMAGE_TYPE_GUARD then act(AddSpEffect, 7030601) -- Relic: Art guage +1% act(AddSpEffect, 7036101) -- Relic: HP Recovery +8 act(AddSpEffect, 8650001) -- Passive: HP Recovery +10 act(AddSpEffect, 8650101) -- Passive: FP Recovery +2 act(AddSpEffect, 8652001) -- Passive: Poise +12% act(AddSpEffect, 8652011) -- Passive: Poise +18% act(AddSpEffect, 8652021) -- Passive: Poise +24% act(AddSpEffect, 8652101) -- Passive: Dmg Negation +14% act(AddSpEffect, 8652111) -- Passive: Dmg Negation +19% act(AddSpEffect, 8652121) -- Passive: Dmg Negation +24% end return FALSE end -- Change flask effect depending on ally heal/gradual heal/fp restore -- Gradual and FP Flask can combine normally function ExecChangeFlask() if env(GetSpEffectID, 7010299) == TRUE then -- Has 'Flask Also Heals Allies' effect if env(GetSpEffectID, 7010200) == TRUE then -- Has 'Gradual Restoration by Flask' effect if env(GetSpEffectID, 8440200) == TRUE then -- Ally+Gradual Flask act(AddSpEffect, 7010230) act(AddSpEffect, 7010231) act(AddSpEffect, 7010281) act(AddSpEffect, 7010282) else -- Ally Flask act(AddSpEffect, 7010220) act(AddSpEffect, 7010280) end -- Has 'Gradual Restoration by Flask' effect elseif env(GetSpEffectID, 8440200) == TRUE then -- Gradual Flask act(AddSpEffect, 7010230) act(AddSpEffect, 7010231) end -- Has 'Unifying Fate' effect (FP on Flask) if env(GetSpEffectID, 8970020) == TRUE then -- Has 'Flask Also Heals Allies' effect if env(GetSpEffectID, 7010200) == TRUE then -- Ally+FP Flask act(AddSpEffect, 7010250) act(AddSpEffect, 7010283) else if env(GetSpEffectID, 8440200) == FALSE then act(AddSpEffect, 501000) end -- FP Flask act(AddSpEffect, 7010250) end end end return FALSE end -- Favor of the Great Hollow - Ult charge when out of flasks function ExecUltCharge() if env(GetFlaskCount) ~= 0 then if ESTUS_COUNTER == 0 then ESTUS_COUNTER = 1 end return FALSE elseif env(GetHP) <= 0 then return FALSE elseif env(GetSpEffectID, 6999610) == FALSE or env(GetSpEffectID, 6999611) == TRUE or env(GetSpEffectID, 6999613) == TRUE then if ESTUS_COUNTER == 1 then ESTUS_COUNTER = 0 end return FALSE elseif ESTUS_COUNTER == 1 then act(AddSpEffect, 6999611) ESTUS_COUNTER = 0 end return FALSE end function SetMoveType() -- Lower body faces right if env(GetSpEffectID, 100130) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 1) -- Lower body squats elseif env(GetSpEffectID, 100140) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 2) -- Lower body faces left elseif env(GetSpEffectID, 100150) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 0) -- Lower body slight bend elseif env(GetSpEffectID, 100160) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 3) -- Lower body faces right - allows faster movement elseif env(GetSpEffectID, 100135) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 4) -- Revenant - lower body during skill elseif env(GetSpEffectID, 103000) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 5) -- Revenant - lower body while casting skill (floaty) elseif env(GetSpEffectID, 103001) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 6) -- Guardian - lower body for Steel Guard elseif env(GetSpEffectID, 701530) == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 8) -- Executor - lower body for Skill Cursed Sword elseif IsDemonSwordMode() == TRUE then SetVariable("MoveType", ConvergeValue(1, hkbGetVariable("MoveType"), 5, 5)) SetVariable("StanceMoveType", 9) else SetVariable("MoveType", ConvergeValue(0, hkbGetVariable("MoveType"), 5, 5)) end return end function SetStyleSpecialEffect() 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 HandChangeTest_ToR1 = FALSE HandChangeTest_ToR2 = FALSE HandChangeTest_ToL1 = FALSE HandChangeTest_ToL2 = FALSE function GetAttackRequest(is_guard, blend_type) 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_large_arrow = GetEquipType(hand, 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 is_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) local is_large_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW) local is_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) local is_large_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) 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 end if request_r1 == TRUE and is_staff == FALSE then if is_both ~= TRUE then if c_SwordArtsID == 335 and env(GetSpEffectID, 6750002) == TRUE then return ATTACK_REQUEST_BOTH_LIGHT end end if is_both == TRUE then if is_arrow == TRUE then if is_large_arrow == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_FIRE_RIGHT elseif is_crossbow == TRUE or is_ballista == TRUE then if is_ballista == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end if c_SwordArtsID == 335 and env(GetSpEffectID, 6750002) == TRUE then return ATTACK_REQUEST_BOTH_LIGHT else return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW end else return ATTACK_REQUEST_BOTH_LIGHT end else if is_arrow == TRUE then if is_large_arrow == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_FIRE_RIGHT elseif is_crossbow == TRUE or is_ballista == TRUE then if is_ballista == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_RIGHT_CROSSBOW end if 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) local is_halberd = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_HALBERD) if is_spear == TRUE or is_rapier == TRUE or is_large_spear == TRUE or is_large_rapier == TRUE or is_halberd == 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_crossbow == TRUE then g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) return ATTACK_REQUEST_RIGHT_CROSSBOW end return ATTACK_REQUEST_RIGHT_LIGHT end else return ATTACK_REQUEST_RIGHT_LIGHT end end end if env(ActionRequest, ACTION_ARM_ULTRA) == TRUE then if env(GetSpEffectID, 709300) == TRUE and env(GetSpEffectID, 102065) == FALSE and env(IsCOMPlayer) == FALSE then if env(GetHeroID) == HERO_ATTACKER and env(ActionDuration, ACTION_ARM_SKILL) > 0 then return ATTACK_REQUEST_INVALID else act(DebugLogOutput, "ウルト実行") return ATTACK_REQUEST_ULTRA end elseif env(GetSpEffectID, 102065) == TRUE or env(IsCOMPlayer) == TRUE then return ATTACK_REQUEST_INVALID elseif env(IsUltimateArtReady) == FALSE then return ATTACK_REQUEST_INVALID elseif env(GetHeroID) == HERO_ATTACKER and env(ActionDuration, ACTION_ARM_SKILL) > 0 then return ATTACK_REQUEST_INVALID else act(DebugLogOutput, "ウルト実行") return ATTACK_REQUEST_ULTRA end end if request_r2 == TRUE then local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if IsWeaponCatalyst(sp_kind) == TRUE then return ATTACK_REQUEST_INVALID end if env(ActionDuration, ACTION_ARM_ACTION) > 0 then if env(IsUltimateArtReady) == FALSE or env(GetSpEffectID, 102065) == TRUE or env(IsCOMPlayer) == TRUE then return ATTACK_REQUEST_INVALID else act(DebugLogOutput, "ウルト実行") return ATTACK_REQUEST_ULTRA end elseif is_staff == FALSE then if is_arrow == TRUE then if is_large_arrow == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_FIRE_RIGHT2 elseif is_crossbow == TRUE then g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) if is_both == TRUE then if c_SwordArtsID == 335 and env(GetSpEffectID, 6750002) == TRUE then return ATTACK_REQUEST_BOTH_LIGHT else return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 end else return ATTACK_REQUEST_RIGHT_CROSSBOW2 end elseif is_ballista == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 elseif is_both == TRUE then return ATTACK_REQUEST_BOTH_HEAVY else return ATTACK_REQUEST_RIGHT_HEAVY end end end 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) local kind = env(GetEquipWeaponCategory, hand) if is_shield_left == TRUE then if style == HAND_RIGHT_BOTH then else return ATTACK_REQUEST_INVALID end end if kind == 60 or kind == 61 or kind == 58 or kind == 53 or kind == 55 then if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then if sp_kind == 249 then return ATTACK_REQUEST_INVALID else return ATTACK_REQUEST_INVALID end end end if kind == 20 and style == HAND_BOTH then return ATTACK_REQUEST_INVALID end if GetEquipType(HAND_LEFT, 57) == TRUE then if is_both_right == FALSE then return ATTACK_REQUEST_INVALID end end if IsDemonSwordMode() == TRUE then return ATTACK_REQUEST_INVALID end if is_shield_right == TRUE and is_both_right == TRUE then return ATTACK_REQUEST_INVALID end if style == HAND_RIGHT_BOTH then is_both_right = TRUE end if sp_kind == 178 then if env(GetSpEffectID, 100052) == TRUE then ExecEventAllBody("W_AttackLeftHeavy3") end end if is_both_right == TRUE then if env(GetSpEffectID, 140) == FALSE and env(GetSpEffectID, 145) == FALSE then if sp_kind == 627 or sp_kind == 249 or sp_kind == 635 or sp_kind == 637 or sp_kind == 639 or sp_kind == 640 or sp_kind == 647 then if env(GetStamina) <= 0 then return ATTACK_REQUEST_INVALID else if env(GetSpEffectID, 100421) == TRUE then ExecEventAllBody("W_AttackBothLeft2") elseif env(GetSpEffectID, 100422) == TRUE then ExecEventAllBody("W_AttackBothLeft3") elseif env(GetSpEffectID, 100423) == TRUE then ExecEventAllBody("W_AttackBothLeft4") elseif env(GetSpEffectID, 100424) == TRUE then ExecEventAllBody("W_AttackBothLeft5") elseif env(GetSpEffectID, 100002) == TRUE then ExecEventAllBody("W_AttackBothLeftDash") elseif env(GetSpEffectID, 100360) == TRUE then ExecEventAllBody("W_AttackDualRolling") else ExecEventAllBody("W_AttackBothLeft1") end end end end elseif style == HAND_LEFT_BOTH then if sp_kind == 627 or sp_kind == 249 or sp_kind == 635 or sp_kind == 637 or sp_kind == 639 or sp_kind == 640 or sp_kind == 647 then if env(GetSpEffectID, 140) == FALSE and env(GetSpEffectID, 145) == FALSE then if env(GetStamina) <= 0 then return ATTACK_REQUEST_INVALID else if env(GetSpEffectID, 100421) == TRUE then ExecEventAllBody("W_AttackBothLeft2") elseif env(GetSpEffectID, 100422) == TRUE then ExecEventAllBody("W_AttackBothLeft3") elseif env(GetSpEffectID, 100423) == TRUE then ExecEventAllBody("W_AttackBothLeft4") elseif env(GetSpEffectID, 100424) == TRUE then ExecEventAllBody("W_AttackBothLeft5") elseif env(GetSpEffectID, 100002) == TRUE then ExecEventAllBody("W_AttackBothLeftDash") elseif env(GetSpEffectID, 100360) == TRUE then ExecEventAllBody("W_AttackBothLeft1") else ExecEventAllBody("W_AttackBothLeft1") end end end end end if c_SwordArtsID == 399 then if style == HAND_RIGHT_BOTH then return ATTACK_REQUEST_INVALID elseif style == HAND_LEFT_BOTH then return ATTACK_REQUEST_INVALID end end local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end if style == HAND_RIGHT or HAND_RIGHT_BOTH then hand = HAND_RIGHT elseif style == HAND_LEFT or HAND_LEFT_BOTH then hand = HAND_LEFT end local is_crossbow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) 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) is_ballista = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) if style == HAND_LEFT_BOTH and is_arrow_left == TRUE then if is_large_arrow_left == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_TPSMODE elseif style == HAND_LEFT_BOTH and is_crossbow_left == TRUE then g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) return ATTACK_REQUEST_ARROW_TPSMODE elseif style == HAND_RIGHT_BOTH and is_arrow_right == TRUE then if is_large_arrow_right == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_TPSMODE elseif style == HAND_RIGHT_BOTH and is_crossbow_right == TRUE then g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) return ATTACK_REQUEST_ARROW_TPSMODE elseif style == HAND_RIGHT == true and is_arrow_left == TRUE then if is_ballista == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) return ATTACK_REQUEST_LEFT_CROSSBOW else if is_large_arrow_left == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_FIRE_LEFT end elseif is_crossbow == TRUE then if is_both == FALSE then g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) 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) 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 if env(ActionRequest, ACTION_ARM_SKILL) == TRUE then if env(IsCharacterSkillReady) == FALSE or env(GetSpEffectID, 102065) == TRUE or env(GetHeroID) == HERO_SPEED or env(GetHeroID) == HERO_ATTACKER then return ATTACK_REQUEST_INVALID else act(DebugLogOutput, "ウルト実行") return ATTACK_REQUEST_SKILL end end if request_l2 == TRUE then act(DebugLogOutput, "action request ACTION_ARM_L2") if env(ActionDuration, ACTION_ARM_ACTION) > 0 then if env(IsCharacterSkillReady) == FALSE or env(GetSpEffectID, 102065) == TRUE or env(GetHeroID) == HERO_SPEED or env(GetHeroID) == HERO_ATTACKER then return ATTACK_REQUEST_INVALID else act(DebugLogOutput, "ウルト実行") return ATTACK_REQUEST_SKILL end end if IsDemonSwordMode() == TRUE then return ATTACK_REQUEST_DEMONSWORDARTS end if is_both == FALSE then is_staff = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) if is_staff == TRUE then return ATTACK_REQUEST_INVALID end end if is_both == FALSE then local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if IsWeaponCatalyst(sp_kind) == TRUE then return ATTACK_REQUEST_INVALID end end if c_SwordArtsID == 399 then is_duelingshieldleft = GetEquipType(HAND_LEFT, 57) if is_both == FALSE and is_duelingshieldleft == FALSE then return ATTACK_REQUEST_RIGHT_LIGHT elseif is_duelingshieldleft == TRUE and 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 return swordartrequest 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 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) is_ballista = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) if is_arrow_left == TRUE then if is_ballista == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) return ATTACK_REQUEST_LEFT_CROSSBOW else if is_large_arrow_left == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end return ATTACK_REQUEST_ARROW_FIRE_LEFT end elseif is_crossbow == TRUE then if is_both == FALSE then g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) return ATTACK_REQUEST_LEFT_CROSSBOW else return ATTACK_REQUEST_INVALID end else return ATTACK_REQUEST_LEFT_HEAVY end end end return ATTACK_REQUEST_INVALID end function ExecAttack(r1, r2, l1, l2, b1, b2, is_guard, blend_type, artsr1, artsr2, is_stealth_rolling) if GetVariable("AddFookShotBlend") == 1 then return FALSE end 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) -- Surge Sprint - Dash attacks during start if env(GetSpEffectID, 102001) == TRUE then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" end if env(IsSpecialTransitionPossible) == TRUE then r1 = "W_AttackRightLight1" l1 = "W_AttackLeftLight1" b1 = "W_AttackBothLight1" if env(GetSpEffectID, 132) == FALSE then r2 = "W_AttackRightHeavy1Start" l2 = "W_AttackLeftHeavy1" b2 = "W_AttackBothHeavy1Start" end if env(GetSpEffectID, 604210) == TRUE then r1 = "W_StormRuler_AttackLight1" b1 = "W_StormRuler_AttackLight1" r2 = "W_StormRuler_AttackLight1" b2 = "W_StormRuler_AttackLight1" end end if env(GetSpEffectID, 133) == TRUE then if r2 == "W_AttackRightHeavy1Start" then r2 = "W_AttackRightHeavy1SubStart" end if b2 == "W_AttackBothHeavy1Start" then b2 = "W_AttackBothHeavy1SubStart" end 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 -- Guard Counters if env(GetSpEffectID, 173) == TRUE or env(GetSpEffectID, 174) == 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 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 -- Guardian Unique Halberd Charged Guard Counter 2H if GetEquipType(atk_hand, WEAPON_CATEGORY_HALBERD) == TRUE and env(GetHeroID) == HERO_TANK then ExecEventAllBody("W_AttackBothHeavyCounterStart") else ExecEventAllBody("W_AttackBothHeavyCounter") end -- Guardian Unique Halberd Charged Guard Counter 1H elseif GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_HALBERD) == TRUE and env(GetHeroID) == HERO_TANK then ExecEventAllBody("W_AttackRightHeavyCounterStart") else ExecEventAllBody("W_AttackRightHeavyCounter") end return TRUE end if env(GetSpEffectID, 174) == TRUE then return FALSE end end if env(GetSpEffectID, 100630) == TRUE and ExecFallAttack() == TRUE then return TRUE end if request == ATTACK_REQUEST_RIGHT_LIGHT then if Ienv(GetSpEffectID, 6750015) == TRUE and is_both ~= TRUE then if env(GetSpEffectID, 6750010) == TRUE then ExecEventAllBody("W_AttackRightLight2") r1 = "W_AttackRightLight2" elseif env(GetSpEffectID, 6750011) == TRUE then ExecEventAllBody("W_AttackRightLight3") elseif env(GetSpEffectID, 6750012) == TRUE then ExecEventAllBody("W_AttackRightLight4") elseif env(GetSpEffectID, 6750013) == TRUE then ExecEventAllBody("W_AttackRightLight5") end end if c_SwordArtsID == 39 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r1 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 40 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r1 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 38 then if env(GetFP) >= 8 then if env(GetSpEffectID, 100050) == TRUE then r1 = "W_SwordArtsOneShotShieldBoth" elseif env(GetSpEffectID, 100051) == TRUE then r1 = "W_SwordArtsOneShotShieldLeft" end end end if c_SwordArtsID == 45 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r1 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 318 then if env(GetSpEffectID, 100050) == TRUE then r1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then r1 = "W_SwordArtsOneShotComboEnd_2" end end if c_SwordArtsID == 32 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldBoth") r1 = "W_SwordArtsOneShotShieldBoth" elseif env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") r1 = "W_SwordArtsOneShotComboEnd_2" end end if env(GetSpEffectID, 100061) == TRUE then if env(GetSpEffectID, 100062) == TRUE then r1 = "W_AttackRightLight2" end end if env(GetSpEffectID, 19903) == TRUE then r1 = "W_AttackRightLight3" elseif env(GetSpEffectID, 19904) == TRUE then r1 = "W_AttackRightLight4" end if artsr1 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE, r1) if r1 == "W_DrawStanceRightAttackLight" then SetSwordArtsWepCategory_DrawStanceRightAttackLight() end end SetStormRulerArtsPointInfo(r1, r2, b1, b2) 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 GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == TRUE and r1 ~= "W_AttackRightLight2" and r1 ~= "W_AttackRightLight3" then r1 = "W_AttackRightLight1" end ExecEventAllBody(r1) elseif request == ATTACK_REQUEST_RIGHT_HEAVY then if c_SwordArtsID == 38 then if env(GetFP) >= 12 then if env(GetSpEffectID, 100052) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100053) == TRUE then r2 = "W_DrawStanceRightAttackHeavy" end end end if env(GetSpEffectID, 100491) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r2 = "W_SwordArtsOneShotComboEnd" end if c_SwordArtsID == 39 or c_SwordArtsID == 40 or c_SwordArtsID == 45 or c_SwordArtsID == 46 then if env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") r2 = "W_SwordArtsOneShotComboEnd_2" end end if c_SwordArtsID == 27 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r2 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 32 then if env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_DrawStanceRightAttackHeavy") r2 = "W_DrawStanceRightAttackHeavy" elseif env(GetSpEffectID, 100052) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r2 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 42 then if env(GetSpEffectID, 100052) == TRUE then ExecEventAllBody("W_DrawStanceRightAttackHeavy") r2 = "W_DrawStanceRightAttackHeavy" end end if c_SwordArtsID == 313 or c_SwordArtsID == 29 or c_SwordArtsID == 31 then if env(GetSpEffectID, 100050) == TRUE then r2 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 30 and env(GetSpEffectID, 100050) == TRUE then local MadKingRand = 0 MadKingRand = math.random(0, 5) if MadKingRand == 0 or MadKingRand == 1 then ExecEventAllBody("W_SwordArtsOneShotComboEnd") r2 = "W_SwordArtsOneShotComboEnd" elseif MadKingRand == 2 or MadKingRand == 3 then ExecEventAllBody("W_SwordArtsOneShotShieldLeft") r2 = "W_SwordArtsOneShotShieldLeft" elseif MadKingRand == 5 then ExecEventAllBody("W_SwordArtsOneShotShieldBoth") r2 = "W_SwordArtsOneShotShieldBoth" end end if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, r2) end SetStormRulerArtsPointInfo(r1, r2, b1, b2) local IsEnableSpecialAttack = FALSE if env(GetSpEffectID, 1681) == TRUE or env(GetSpEffectID, 1686) == TRUE or env(GetSpEffectID, 841) == TRUE or env(GetSpEffectID, 891) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if env(GetSpEffectID, 1811) == TRUE or env(GetSpEffectID, 1816) == TRUE or env(GetSpEffectID, 1092401) == TRUE or env(GetSpEffectID, 1092451) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end if env(GetSpEffectID, 1716) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if env(GetSpEffectID, 1721) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if env(GetSpEffectID, 8960100) == TRUE then if r2 == "W_AttackRightHeavy1Start" then r2 = "W_AttackRightHeavyTypeB1Start" elseif r2 == "W_AttackRightHeavy1SubStart" then r2 = "W_AttackRightHeavyTypeB1Start" elseif r2 == "W_AttackRightHeavy2Start" then r2 = "W_AttackRightHeavyTypeB2Start" end 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 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 local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if sp_kind == 178 then if env(GetSpEffectID, 100052) == TRUE then l2 = "W_AttackLeftHeavy2" end end atk_hand = HAND_LEFT guard_hand = HAND_LEFT ExecEventAllBody(l2) elseif request == ATTACK_REQUEST_BOTH_LIGHT then if env(GetSpEffectID, 6750015) == TRUE and is_both == TRUE then if env(GetSpEffectID, 6750010) == TRUE then ExecEventAllBody("W_AttackBothLight2") elseif env(GetSpEffectID, 6750011) == TRUE then ExecEventAllBody("W_AttackBothLight3") elseif env(GetSpEffectID, 6750012) == TRUE then ExecEventAllBody("W_AttackBothLight4") elseif env(GetSpEffectID, 6750013) == TRUE then ExecEventAllBody("W_AttackBothLight5") end end if c_SwordArtsID == 39 or c_SwordArtsID == 40 or c_SwordArtsID == 45 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") b1 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 38 then if env(GetFP) >= 8 then if env(GetSpEffectID, 100050) == TRUE then b1 = "W_SwordArtsOneShotShieldBoth" elseif env(GetSpEffectID, 100051) == TRUE then b1 = "W_SwordArtsOneShotShieldLeft" end end end if c_SwordArtsID == 318 then if env(GetSpEffectID, 100050) == TRUE then b1 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100051) == TRUE then b1 = "W_SwordArtsOneShotComboEnd_2" end end if c_SwordArtsID == 32 then if env(GetSpEffectID, 100050) == TRUE then ExecEventAllBody("W_SwordArtsOneShotShieldBoth") b1 = "W_SwordArtsOneShotShieldBoth" elseif env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") b1 = "W_SwordArtsOneShotComboEnd_2" end end if env(GetSpEffectID, 100061) == TRUE then if env(GetSpEffectID, 100062) == TRUE then b1 = "W_AttackBothLight2" end end if env(GetSpEffectID, 19903) == TRUE then b1 = "W_AttackBothLight3" elseif env(GetSpEffectID, 19904) == TRUE then b1 = "W_AttackBothLight4" end if artsr1 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE, b1) if b1 == "W_DrawStanceRightAttackLight" then SetSwordArtsWepCategory_DrawStanceRightAttackLight() end end SetStormRulerArtsPointInfo(r1, r2, b1, b2) 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 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 ExecEventAllBody(b1) elseif request == ATTACK_REQUEST_BOTH_LEFT then if r1 == "W_AttackRightLightDash" then l1 = "W_AttackBothLeftDash" elseif r1 == "W_AttackRightLightStep" then l1 = "W_AttackBothLeftStep" elseif l1 == "W_AttackLeftLight1" then l1 = "W_AttackBothLeft1" elseif l1 == "W_AttackLeftLight2" then l1 = "W_AttackBothLeft2" end ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_BOTH_HEAVY then if c_SwordArtsID == 38 then if env(GetFP) >= 12 then if env(GetSpEffectID, 100052) == TRUE then b2 = "W_SwordArtsOneShotComboEnd" elseif env(GetSpEffectID, 100053) == TRUE then b2 = "W_DrawStanceRightAttackHeavy" end end end if env(GetSpEffectID, 100491) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") b2 = "W_SwordArtsOneShotComboEnd" end if c_SwordArtsID == 39 or c_SwordArtsID == 40 or c_SwordArtsID == 45 then if env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") b2 = "W_SwordArtsOneShotComboEnd_2" end end if c_SwordArtsID == 46 then if env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") b2 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 313 or c_SwordArtsID == 27 or c_SwordArtsID == 29 or c_SwordArtsID == 31 then if env(GetSpEffectID, 100050) == TRUE then b2 = "W_SwordArtsOneShotComboEnd" end end if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, b2) end if c_SwordArtsID == 30 and env(GetSpEffectID, 100050) == TRUE then local MadKingRand = 0 MadKingRand = math.random(0, 2) if MadKingRand == 0 then ExecEventAllBody("W_SwordArtsOneShotComboEnd") b2 = "W_SwordArtsOneShotComboEnd" elseif MadKingRand == 1 then ExecEventAllBody("W_SwordArtsOneShotShieldLeft") b2 = "W_SwordArtsOneShotShieldLeft" elseif MadKingRand == 2 then ExecEventAllBody("W_SwordArtsOneShotShieldBoth") b2 = "W_SwordArtsOneShotShieldBoth" end end if c_SwordArtsID == 32 then if env(GetSpEffectID, 100051) == TRUE then ExecEventAllBody("W_DrawStanceRightAttackHeavy") b2 = "W_DrawStanceRightAttackHeavy" elseif env(GetSpEffectID, 100052) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd") b2 = "W_SwordArtsOneShotComboEnd" end end if c_SwordArtsID == 42 then if env(GetSpEffectID, 100052) == TRUE then ExecEventAllBody("W_DrawStanceRightAttackHeavy") b2 = "W_DrawStanceRightAttackHeavy" end end if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, b2) end SetStormRulerArtsPointInfo(r1, r2, b1, b2) local IsEnableSpecialAttack = FALSE if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1681) == TRUE or env(GetSpEffectID, 1686) == TRUE or env(GetSpEffectID, 841) == TRUE or env(GetSpEffectID, 886) == TRUE or env(GetSpEffectID, 891) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and (env(GetSpEffectID, 1683) == TRUE or env(GetSpEffectID, 1688) == TRUE or env(GetSpEffectID, 843) == TRUE or env(GetSpEffectID, 888) == TRUE or env(GetSpEffectID, 893) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1811) == TRUE or env(GetSpEffectID, 1816) == TRUE or env(GetSpEffectID, 1861) == TRUE or env(GetSpEffectID, 1092401) == 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) or env(GetSpEffectID, 1092451) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end 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 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 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, 8960100) == TRUE then if b2 == "W_AttackBothHeavy1Start" then b2 = "W_AttackRightHeavyTypeB1Start" elseif b2 == "W_AttackBothHeavy1SubStart" then b2 = "W_AttackRightHeavyTypeB1Start" elseif b2 == "W_AttackBothHeavy2Start" then b2 = "W_AttackRightHeavyTypeB2Start" end end ExecEventAllBody(b2) elseif request == ATTACK_REQUEST_DUAL_RIGHT then if env(GetSpEffectID, 19903) == TRUE then l1 = "W_AttackDualLight3" elseif env(GetSpEffectID, 19904) == TRUE then l1 = "W_AttackDualLight4" end 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 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 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 l1 = "W_AttackDualLight2" end else l1 = "W_AttackDualLight1" end is_Dual = TRUE ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_LEFT_REVERSAL then ExecEventAllBody("W_AttackLeftReversal") elseif request == ATTACK_REQUEST_DEMONSWORDARTS then if env(GetSpEffectID, 707051) == TRUE then SetVariable("IndexDemonSwordArts", 0) else SetVariable("IndexDemonSwordArts", 1) end ExecEventAllBody("W_DemonSwordArts") 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 arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == 2 then arts_idx = 1 elseif arts_cat == 3 then arts_idx = 2 elseif arts_cat == 4 then arts_idx = 3 elseif arts_cat == 5 then arts_idx = 4 elseif arts_cat == 8 then arts_idx = 5 elseif arts_cat == 9 then arts_idx = 6 elseif arts_cat == 20 then arts_idx = 7 elseif arts_cat == 28 then arts_idx = 8 elseif arts_cat == 47 then arts_idx = 9 elseif arts_cat == 48 then arts_idx = 10 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) 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 arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) if IsHalfBlendArts(c_SwordArtsID) == TRUE then if c_SwordArtsHand == HAND_LEFT then local arts_idx = 0 if arts_cat == 2 then arts_idx = 1 elseif arts_cat == 3 then arts_idx = 2 elseif arts_cat == 4 then arts_idx = 3 elseif arts_cat == 5 then arts_idx = 4 elseif arts_cat == 8 then arts_idx = 5 elseif arts_cat == 9 then arts_idx = 6 elseif arts_cat == 20 then arts_idx = 7 elseif arts_cat == 28 then arts_idx = 8 elseif arts_cat == 47 then arts_idx = 9 elseif arts_cat == 48 then arts_idx = 10 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldLeft, blend_type) else local arts_idx = 0 if arts_cat == 2 then arts_idx = 1 elseif arts_cat == 3 then arts_idx = 2 elseif arts_cat == 20 then arts_idx = 3 elseif arts_cat == 24 then arts_idx = 4 elseif arts_cat == 28 then arts_idx = 5 elseif arts_cat == 42 then arts_idx = 6 elseif arts_cat == 47 then arts_idx = 7 elseif arts_cat == 48 then arts_idx = 8 elseif arts_cat == 53 then arts_idx = 3 end SetVariable("SwordArtsOneShotCategory", arts_idx) ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) end else local arts_idx = 0 if arts_cat == 20 then arts_idx = 1 elseif arts_cat == 28 then arts_idx = 2 elseif arts_cat == 47 then arts_idx = 3 elseif arts_cat == 48 then arts_idx = 4 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) ExecEventAllBody("W_SwordArtsOneShotShieldBoth") 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 arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == 2 then arts_idx = 1 elseif arts_cat == 3 then arts_idx = 2 elseif arts_cat == 20 then arts_idx = 3 elseif arts_cat == 24 then arts_idx = 4 elseif arts_cat == 28 then arts_idx = 5 elseif arts_cat == 42 then arts_idx = 6 elseif arts_cat == 47 then arts_idx = 7 elseif arts_cat == 48 then arts_idx = 8 elseif arts_cat == 53 then arts_idx = 3 elseif c_SwordArtsID == 257 and wep_cat == 24 then arts_idx = 4 elseif c_SwordArtsID == 328 and env(GetSpEffectID, 19875) == TRUE and env(GetSpEffectID, 19874) == TRUE and GetVariable("IsEnoughArtPointsL2") == 0 then arts_idx = 4 elseif c_SwordArtsID == 328 and env(GetSpEffectID, 19874) == TRUE and env(GetSpEffectID, 19875) == FALSE and GetVariable("IsEnoughArtPointsL2") == 0 then arts_idx = 11 end SetVariable("SwordArtsOneShotCategory", arts_idx) local combo_idx = 0 if arts_cat == 2 then combo_idx = 1 elseif arts_cat == 3 then combo_idx = 2 elseif arts_cat == 24 then combo_idx = 3 elseif arts_cat == 42 then combo_idx = 4 end SetVariable("SwordArtsOneShotComboCategory", combo_idx) 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 if 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.2 then rollingAngle = GetVariable("MoveAngle") end local turn_target_angle = 0 local rollingDirection = 0 local turn_angle_real = 200 local is_self_trans = FALSE if IsNodeActive("SwordArtsRolling Selector MP") == TRUE then is_self_trans = TRUE end if GetVariable("IsLockon") == false and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE or env(GetSpEffectID, 100002) == TRUE then rollingDirection = 0 else 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 if rollingAngle <= GetVariable("RollingAngleThresholdRightFrontTest") and GetVariable("RollingAngleThresholdLeftFrontTest") <= rollingAngle then rollingDirection = 0 turn_target_angle = rollingAngle elseif GetVariable("RollingAngleThresholdRightFrontTest") < rollingAngle and rollingAngle < GetVariable("RollingAngleThresholdRightBackTest") then rollingDirection = 3 turn_target_angle = rollingAngle - 90 elseif rollingAngle < GetVariable("RollingAngleThresholdLeftFrontTest") and GetVariable("RollingAngleThresholdLeftBackTest") < rollingAngle 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 if GetVariable("IsLockon") == true then act(TurnToLockonTargetImmediately, turn_target_angle) else act(FaceDirection, turn_target_angle) end end if is_self_trans == TRUE then SetVariable("SwordArtsRollingDirection_SelfTrans", rollingDirection) SetVariable("RollingAngleRealSelftrans", rollingAngle) else SetVariable("SwordArtsRollingDirection", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) end SetVariable("TurnAngleReal", turn_angle_real) SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if GetVariable("IsEnoughArtPointsL2") == 1 then AddStamina(STAMINA_REDUCE_ARTS_QUICKSTEP * STAMINA_CONSUMERATE_LOWSTATUS) else AddStamina(STAMINA_REDUCE_ARTS_QUICKSTEP) end local arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == 2 then arts_idx = 1 end SetVariable("SwordArtsRollingCategory", arts_idx) if is_self_trans == TRUE then ExecEventAllBody("W_SwordArtsRolling_SelfTrans") 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_SKILL then if env(GetHeroID) == HERO_BALANCE then if env(GetSpEffectID, 104900) == TRUE then ExecEventAllBody("W_BirdAct_MoveStart") else atk_hand = HAND_LEFT SetVariable("AddFookShotBlend", 1) ResetRequest() end elseif env(GetHeroID) == HERO_TANK then ExecEventAllBody("W_WindAttackStart") elseif env(GetHeroID) == HERO_SHOOTER then SetVariable("HurtDaggerIndex", 0) SetVariable("HurtDaggerIndex00", 0) ExecEventAllBody("W_HurtDaggerAttack") elseif env(GetHeroID) == HERO_SPEED then elseif env(GetHeroID) == HERO_POWER then ExecEventAllBody("W_SmashAttackStanceStart") elseif env(GetHeroID) == HERO_NECROMANCER then ExecEventHalfBlend(Event_NecromanceModeStart, blend_type) elseif env(GetHeroID) == HERO_MAGIC then SetVariable("IndexElementalAbsorption", 1) if env(GetMagicCocktailAffinityCount) == 3 then ExecCreateMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) elseif env(GetSpEffectID, 706010) == TRUE then ExecEventHalfBlend(Event_ElementalAbsorption2Start, blend_type) elseif env(GetSpEffectID, 706011) == TRUE then ExecEventHalfBlend(Event_ElementalAbsorption3Start, blend_type) else ExecEventHalfBlend(Event_ElementalAbsorptionStart, blend_type) end elseif env(GetHeroID) == HERO_TECHNICAL then if GetVariable("AddDemonSwordModeBlend") == 0 then SetVariable("AddDemonSwordModeBlend", 1) ExecEventHalfBlend(Event_DemonSwordStanceStart, blend_type) else ExecEventHalfBlend(Event_DemonSwordStanceEnd, blend_type) end elseif env(GetHeroID) == HERO_BUFFER then ExecEventHalfBlend(Event_PhotoShootStart, blend_type) elseif env(GetHeroID) == HERO_ATTACKER then end elseif request == ATTACK_REQUEST_ULTRA then if env(GetHeroID) == HERO_BALANCE then atk_hand = HAND_LEFT SetVariable("IndexPileBunker", 0) if env(GetSpEffectID, 100002) == TRUE then SetVariable("IndexPileBunker", 2) elseif env(GetSpEffectID, 700510) == TRUE then SetVariable("IndexPileBunker", 1) end ExecEventAllBody("W_PileBunkerStart") elseif env(GetHeroID) == HERO_TANK then ExecEventAllBody("W_DragoonJumpStart") elseif env(GetHeroID) == HERO_SHOOTER then ExecEventAllBody("W_LongBowSnipeStart") elseif env(GetHeroID) == HERO_SPEED then ExecEventAllBody("W_AllHideStart") elseif env(GetHeroID) == HERO_POWER then ExecEventAllBody("W_RockWallAttackStart") elseif env(GetHeroID) == HERO_NECROMANCER then ExecEventAllBody("W_LivingDeadStart") elseif env(GetHeroID) == HERO_MAGIC then ExecEventAllBody("W_BloodMagicStart") elseif env(GetHeroID) == HERO_TECHNICAL then ExecEventAllBody("W_DemonBeastStart") elseif env(GetHeroID) == HERO_BUFFER then ExecEventAllBody("W_JointChainStart") elseif env(GetHeroID) == HERO_ATTACKER then if env(GetSpEffectID, 709300) == TRUE then SetVariable("IsBonusUlt", 1) else SetVariable("IsBonusUlt", 0) end ATTACKER_ULT_COUNTER = ATTACKER_ULT_COUNTER + 1 ExecEventAllBody("W_BlinkStakeStart") end elseif request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then if request == ATTACK_REQUEST_ARROW_FIRE_RIGHT then is_find_atk = FALSE if r1 == "W_AttackRightLightSubStart" then r1 = Event_AttackArrowBothFireLight2 end if c_Style == HAND_RIGHT_BOTH and env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW or c_Style == HAND_LEFT_BOTH and env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_LARGE_ARROW or c_Style == HAND_RIGHT and env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW then if r1 == Event_AttackArrowBothFireLight2 then ExecEventHalfBlend(Event_AttackArrowBothFireLight2, blend_type) else ExecEventHalfBlend(Event_AttackArrowBothFireLight1, blend_type) end elseif r1 == "W_AttackRightLightDash" then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then ExecEventAllBody("W_AttackArrowBothFireDash") else ExecEventAllBody("W_AttackArrowBothFireDash") end if env(GetHeroID) ~= HERO_SPEED then return FALSE end elseif r1 == "W_AttackRightBackstep" and (env(GetHeroID) ~= HERO_SPEED or SPEED_COMBO_NUMBER_RIGHT == 0 and SPEED_COMBO_NUMBER_BOTH == 0) then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then ExecEventAllBody("W_AttackArrowBothFireBackStep") else ExecEventAllBody("W_AttackArrowBothFireBackStep") end elseif r1 == "W_AttackRightLightStep" and (env(GetHeroID) ~= HERO_SPEED or SPEED_COMBO_NUMBER_RIGHT == 0 and SPEED_COMBO_NUMBER_BOTH == 0) then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then ExecEventAllBody("W_AttackArrowBothFireStep") else ExecEventAllBody("W_AttackArrowBothFireStep") end elseif r1 == "W_StormRuler_AttackLight1" or b1 == "W_StormRuler_AttackLight1" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackLight1") elseif r1 == "W_StormRuler_AttackLight2" or b1 == "W_StormRuler_AttackLight2" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackLight2") elseif r1 == "W_StormRuler_AttackLight3" or b1 == "W_StormRuler_AttackLight3" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackLight3") elseif r1 == "W_StormRuler_AttackHeavy" or b1 == "W_StormRuler_AttackHeavy" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackHeavy") elseif c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then if r1 == Event_AttackArrowBothFireLight2 or SPEED_COMBO_NUMBER_BOTH == 1 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight2, blend_type) elseif r1 == Event_AttackArrowBothFireLight3 or SPEED_COMBO_NUMBER_BOTH == 2 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight3, blend_type) elseif r1 == Event_AttackArrowBothFireLight4 or SPEED_COMBO_NUMBER_BOTH == 3 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight4, blend_type) else ExecEventHalfBlend(Event_AttackArrowBothFireLight1, blend_type) end elseif c_Style == HAND_RIGHT then if r1 == Event_AttackArrowBothFireLight2 or SPEED_COMBO_NUMBER_RIGHT == 1 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight2, blend_type) elseif r1 == Event_AttackArrowBothFireLight3 or SPEED_COMBO_NUMBER_RIGHT == 2 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight3, blend_type) elseif r1 == Event_AttackArrowBothFireLight4 or SPEED_COMBO_NUMBER_RIGHT == 3 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight4, blend_type) else ExecEventHalfBlend(Event_AttackArrowBothFireLight1, blend_type) end elseif c_Style == HAND_LEFT then if r1 == Event_AttackArrowBothFireLight2 or SPEED_COMBO_NUMBER_LEFT == 1 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight2, blend_type) elseif r1 == Event_AttackArrowBothFireLight3 or SPEED_COMBO_NUMBER_LEFT == 2 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight3, blend_type) elseif r1 == Event_AttackArrowBothFireLight4 or SPEED_COMBO_NUMBER_LEFT == 3 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowBothFireLight4, blend_type) else ExecEventHalfBlend(Event_AttackArrowBothFireLight1, blend_type) end end else is_find_atk = FALSE if c_Style == HAND_RIGHT_BOTH and env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW or c_Style == HAND_LEFT_BOTH and env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_LARGE_ARROW or c_Style == HAND_RIGHT and env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW then if r2 == Event_AttackArrowBothFireHeavy2Start then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy2Start, blend_type) else ExecEventHalfBlend(Event_AttackArrowBothFireHeavy1Start, blend_type) end elseif r2 == "W_AttackRightHeavyDash" then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then ExecEventAllBody("W_AttackArrowBothFireDashHeavy") else ExecEventAllBody("W_AttackArrowBothFireDashHeavy") end elseif r1 == "W_StormRuler_AttackLight1" or b1 == "W_StormRuler_AttackLight1" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackLight1") elseif r1 == "W_StormRuler_AttackLight2" or b1 == "W_StormRuler_AttackLight2" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackLight2") elseif r1 == "W_StormRuler_AttackLight3" or b1 == "W_StormRuler_AttackLight3" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackLight3") elseif r1 == "W_StormRuler_AttackHeavy" or b1 == "W_StormRuler_AttackHeavy" then SetStormRulerArtsPointInfo(r1, r2, b1, b2) ExecEventAllBody("W_StormRuler_AttackHeavy") elseif r2 == Event_AttackArrowBothFireHeavy2Start then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy2Start, blend_type) else ExecEventHalfBlend(Event_AttackArrowBothFireHeavy1Start, blend_type) end end elseif request == ATTACK_REQUEST_ARROW_TPSMODE then -- TPS Mode = Third Person Shooter Mode is_find_atk = FALSE if style == HAND_RIGHT_BOTH then ExecEventHalfBlend(Event_AttackArrowRightStart, blend_type) elseif style == HAND_LEFT_BOTH then 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 atk_hand = HAND_LEFT guard_hand = HAND_LEFT if request == ATTACK_REQUEST_ARROW_FIRE_LEFT then is_find_atk = FALSE if c_Style == HAND_RIGHT_BOTH and env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW or c_Style == HAND_LEFT_BOTH and env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_LARGE_ARROW or c_Style == HAND_RIGHT and env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_LARGE_ARROW then if l1 == Event_AttackArrowLeftFireLight2 or SPEED_COMBO_NUMBER_LEFT == 1 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowLeftFireLight2, blend_type) else ExecEventHalfBlend(Event_AttackArrowLeftFireLight1, blend_type) end elseif l1 == Event_AttackArrowLeftFireLight2 or SPEED_COMBO_NUMBER_LEFT == 1 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowLeftFireLight2, blend_type) elseif l1 == Event_AttackArrowLeftFireLight3 or SPEED_COMBO_NUMBER_LEFT == 2 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowLeftFireLight3, blend_type) elseif l1 == Event_AttackArrowLeftFireLight4 or SPEED_COMBO_NUMBER_LEFT == 3 and env(GetHeroID) == HERO_SPEED then ExecEventHalfBlend(Event_AttackArrowLeftFireLight4, blend_type) else ExecEventHalfBlend(Event_AttackArrowLeftFireLight1, blend_type) end 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(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) elseif GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == TRUE then ExecEventHalfBlend(Event_AttackCrossbowBothRightStart, 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(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) elseif GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == TRUE then ExecEventHalfBlend(Event_AttackCrossbowBothLeftStart, 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 = 1 if c_Style == HAND_LEFT_BOTH then arrowHand = 0 end if 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 GetEquipType(HAND_LEFT, WEAPON_CATEGORY_TORCH) == TRUE then index = 2 SetVariable("IsAttackWhileTorchGuard", TRUE) else SetVariable("IsAttackWhileTorchGuard", FALSE) end SetVariable("IndexAttackWhileGuard", index) if env(GetSpEffectID, 701530) == TRUE then SetVariable("IndexAttackWhileGuard", 3) end 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(SetLeftWeaponAnimOffset, 400000) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE 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 ExecAirUlt() local cur_stamina = env(GetStamina) if cur_stamina <= 0 and GetVariable("StaminaComboResetTest") == 1 then g_ComboReset = TRUE end local request = GetAttackRequest(is_guard) local style = c_Style if request == ATTACK_REQUEST_INVALID then return FALSE end if env(ActionRequest, ACTION_ARM_L2) == TRUE then ResetRequest() return FALSE end if env(ActionRequest, ACTION_ARM_SKILL) == FALSE and env(ActionRequest, ACTION_ARM_ULTRA) == FALSE then return FALSE end if env(GetSpEffectID, 102510) == TRUE then return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() return FALSE end if env(Unknown389) == 0 and ATTACKER_ULT_COUNTER >= 2 then ResetRequest() return FALSE end if request == ATTACK_REQUEST_SKILL then if env(GetHeroID) == HERO_BALANCE then SetVariable("AddFookShotBlend", 1) ResetRequest() return TRUE elseif env(GetHeroID) == HERO_SHOOTER then SetVariable("HurtDaggerIndex", 0) SetVariable("HurtDaggerIndex00", 0) ExecEventAllBody("W_AirHurtDaggerAttack") ResetRequest() return TRUE else return FALSE end elseif request == ATTACK_REQUEST_ULTRA then if env(GetHeroID) == HERO_BALANCE then 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 SetVariable("JumpAttack_HandCondition", 1) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 3) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) IS_ATTACKED_JUMPMAGIC = FALSE ExecEventAllBody("W_AirPileBunkerStart") return TRUE elseif env(GetHeroID) == HERO_TANK then ExecEventAllBody("W_AirDragoonJumpStart") return TRUE elseif env(GetHeroID) == HERO_SPEED then ExecEventAllBody("W_AirAllHideStart") return TRUE elseif env(GetHeroID) == HERO_ATTACKER then if env(GetSpEffectID, 709300) == TRUE then SetVariable("IsBonusUlt", 1) else SetVariable("IsBonusUlt", 0) end ATTACKER_ULT_COUNTER = ATTACKER_ULT_COUNTER + 1 ExecEventAllBody("W_AirBlinkStakeStart") return TRUE else return FALSE end else return FALSE end end function ExecSummon() local blend_type, lower_state = GetHalfBlendInfo() -- Dismiss Summon if env(ActionRequest, ACTION_ARM_L2) == TRUE then if env(IsSummonActive, SUMMON_HELEN) == TRUE or env(IsSummonActive, SUMMON_FREDERICK) == TRUE or env(IsSummonActive, SUMMON_SEBASTIAN) == TRUE then SetVariable("IsEnableSummonAct", 0) else SetVariable("IsEnableSummonAct", 1) end ExecEventHalfBlend(Event_NecromanceSummonReturn, blend_type) return TRUE end -- Summon Helen if env(ActionRequest, ACTION_ARM_R1) == TRUE then if env(IsSummonInactive, SUMMON_HELEN) == TRUE then if env(IsSummonActive, SUMMON_HELEN) == TRUE then SetVariable("IsEnableSummonAct", 0) elseif env(GetSummonHealthPercent, SUMMON_HELEN) > 0 then SetVariable("IsEnableSummonAct", 0) else SetVariable("IsEnableSummonAct", 1) end else SetVariable("IsEnableSummonAct", 1) end ExecEventHalfBlend(Event_NecromanceSummon1, blend_type) return TRUE end -- Summon Frederick if env(ActionRequest, ACTION_ARM_R2) == TRUE then if env(IsSummonInactive, SUMMON_FREDERICK) == TRUE then if env(IsSummonActive, SUMMON_FREDERICK) == TRUE then SetVariable("IsEnableSummonAct", 0) elseif env(GetSummonHealthPercent, SUMMON_FREDERICK) > 0 then SetVariable("IsEnableSummonAct", 0) else SetVariable("IsEnableSummonAct", 1) end else SetVariable("IsEnableSummonAct", 1) end ExecEventHalfBlend(Event_NecromanceSummon2, blend_type) return TRUE end -- Summon Sebastian if env(ActionRequest, ACTION_ARM_L1) == TRUE then if env(IsSummonInactive, SUMMON_SEBASTIAN) == TRUE then if env(IsSummonActive, SUMMON_SEBASTIAN) == TRUE then SetVariable("IsEnableSummonAct", 0) elseif env(GetSummonHealthPercent, SUMMON_SEBASTIAN) > 0 then SetVariable("IsEnableSummonAct", 0) else SetVariable("IsEnableSummonAct", 1) end else SetVariable("IsEnableSummonAct", 1) end ExecEventHalfBlend(Event_NecromanceSummon3, blend_type) return TRUE end return FALSE end function ExecPhotoShoot() local blend_type, lower_state = GetHalfBlendInfo() if env(ActionRequest, ACTION_ARM_L2) == TRUE or env(ActionDuration, ACTION_ARM_L2) > 0 then SetVariable("IsBuffMode", 0) ExecEventHalfBlend(Event_PhotoShootAct, blend_type) return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE or env(ActionDuration, ACTION_ARM_R2) > 0 then SetVariable("IsBuffMode", 1) ExecEventHalfBlend(Event_PhotoShootAct, blend_type) return TRUE end return FALSE end function FookShotCommonFunction(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) SetAIActionState() local bool = FALSE if guardcondition == TO_GUARDON then bool = TRUE end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, bool, FALSE) == TRUE then return TRUE end if env(IsTruelyLanding) == TRUE then 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 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 ExecMagic(QUICKTYPE_ATTACK, ALLBODY, 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(guardcondition, ALLBODY) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, gen_hand) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE end end return FALSE end 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 function GetAttackMaxNumber(hand) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) local kind = env(GetEquipWeaponCategory, hand) local max_num = 1 if kind == WEAPON_CATEGORY_ARROW or kind == WEAPON_CATEGORY_LARGE_ARROW or kind == WEAPON_CATEGORY_CROSSBOW or kind == WEAPON_CATEGORY_SMALL_ARROW then max_num = 1 elseif kind == WEAPON_CATEGORY_EXTRALARGE_SWORD or kind == WEAPON_CATEGORY_LARGE_SPEAR or kind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER or kind == WEAPON_CATEGORY_LARGE_SHIELD or kind == WEAPON_CATEGORY_STAFF then max_num = 3 if env(GetHeroID) == HERO_POWER and kind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER then max_num = 4 end elseif kind == WEAPON_CATEGORY_TORCH or kind == WEAPON_CATEGORY_LARGE_SWORD or kind == WEAPON_CATEGORY_LARGE_AX or kind == WEAPON_CATEGORY_FLAIL or kind == WEAPON_CATEGORY_SPEAR or kind == WEAPON_CATEGORY_HALBERD or kind == WEAPON_CATEGORY_LARGE_CURVEDSWORD or kind == WEAPON_CATEGORY_SMALL_SHIELD or kind == WEAPON_CATEGORY_MIDDLE_SHIELD or kind == WEAPON_CATEGORY_LARGE_SCYTHE or kind == WEAPON_CATEGORY_WHI or kind == 61 then max_num = 4 elseif kind == WEAPON_CATEGORY_STRAIGHT_SWORD or kind == WEAPON_CATEGORY_TWINBLADE or kind == WEAPON_CATEGORY_KATANA or kind == WEAPON_CATEGORY_AX or kind == WEAPON_CATEGORY_HAMMER or kind == WEAPON_CATEGORY_LARGE_RAPIER then max_num = 5 elseif kind == WEAPON_CATEGORY_LARGE_HAMMER then if sp_kind == 634 and env(GetHeroID) ~= HERO_POWER then max_num = 3 else max_num = 4 end elseif kind == 60 then if sp_kind == 249 then if env(GetSpEffectID, 6750001) == TRUE and env(GetSpEffectID, 6750002) == FALSE then max_num = 5 elseif env(GetSpEffectID, 6750002) == TRUE and env(GetSpEffectID, 6750001) == FALSE then max_num = 4 else max_num = 5 end else max_num = 5 end elseif kind == 55 then max_num = 6 elseif kind == 57 then max_num = 4 elseif kind == 53 then max_num = 6 elseif kind == WEAPON_CATEGORY_SHORT_SWORD or kind == WEAPON_CATEGORY_CLAW or kind == WEAPON_CATEGORY_RAPIER or kind == WEAPON_CATEGORY_FIST or kind == WEAPON_CATEGORY_CURVEDSWORD or kind == 58 then max_num = 6 end return max_num end function GetDualAttackMaxNumber(hand) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, 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 == 61 then max_num = 3 elseif kind == WEAPON_CATEGORY_TWINBLADE or kind == WEAPON_CATEGORY_STRAIGHT_SWORD or kind == WEAPON_CATEGORY_AX or kind == WEAPON_CATEGORY_HAMMER or kind == WEAPON_CATEGORY_FLAIL or kind == WEAPON_CATEGORY_SHORT_SWORD or kind == WEAPON_CATEGORY_LARGE_RAPIER then max_num = 4 elseif kind == WEAPON_CATEGORY_CLAW or kind == WEAPON_CATEGORY_FIST or kind == 58 then max_num = 6 elseif kind == 60 then local style = c_Style if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH and env(GetSpEffectID, 6750002) == TRUE then max_num = 5 else max_num = 4 end elseif kind == WEAPON_CATEGORY_CURVEDSWORD then if sp_kind == 637 then max_num = 3 else max_num = 4 end elseif kind == WEAPON_CATEGORY_KATANA then if sp_kind == 647 then max_num = 3 else max_num = 4 end elseif kind == 55 then max_num = 6 elseif kind == WEAPON_CATEGORY_RAPIER then if sp_kind == 627 then max_num = 3 else max_num = 4 end 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) if GetEquipType(hand, WEAPON_CATEGORY_RAPIER, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_LARGE_RAPIER, 53) == TRUE then return TRUE else return FALSE end end function IsEnableBackStepCancel(hand) if env(GetHeroID) ~= HERO_BUFFER then return FALSE end local style = c_Style if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local kind = env(GetEquipWeaponCategory, hand) if GetEquipType(hand, WEAPON_CATEGORY_RAPIER) == TRUE then return TRUE else return FALSE end end function IsEnableDualWielding() local rightKind = env(GetEquipWeaponCategory, HAND_RIGHT) local leftKind = env(GetEquipWeaponCategory, HAND_LEFT) local rightSpecialKind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) local leftSpecialKind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then return -1 end if env(GetHeroID) == HERO_NECROMANCER and leftSpecialKind == 999 then if rightSpecialKind == 999 then return HAND_RIGHT else return -1 end elseif env(GetHeroID) == HERO_NECROMANCER and rightSpecialKind == 999 then if leftSpecialKind == 999 then return HAND_RIGHT else return -1 end elseif rightSpecialKind == 860 or leftSpecialKind == 860 then return -1 elseif rightSpecialKind == 635 then return HAND_RIGHT elseif rightKind == WEAPON_CATEGORY_SHORT_SWORD then if rightSpecialKind == 104 then if leftSpecialKind == 104 then return HAND_RIGHT end elseif leftKind == WEAPON_CATEGORY_SHORT_SWORD and leftSpecialKind ~= 104 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 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_EXTRALARGE_SWORD then if rightSpecialKind == 635 then if leftKind == WEAPON_CATEGORY_SHORT_SWORD then return HAND_RIGHT end elseif leftKind == WEAPON_CATEGORY_EXTRALARGE_SWORD and rightSpecialKind ~= 635 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_RAPIER then if rightSpecialKind == 627 then if leftKind == WEAPON_CATEGORY_RAPIER then return HAND_LEFT elseif leftKind == WEAPON_CATEGORY_CLAW then return HAND_RIGHT end else if leftKind == WEAPON_CATEGORY_RAPIER then return HAND_RIGHT end 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 then return HAND_RIGHT end elseif rightKind == 53 then if leftKind == 53 then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_AX then if leftKind == WEAPON_CATEGORY_AX then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER then if leftKind == WEAPON_CATEGORY_EXTRALARGE_AXHAMMER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_AX then if leftKind == WEAPON_CATEGORY_LARGE_AX then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_LARGE_HAMMER then if leftKind == WEAPON_CATEGORY_LARGE_HAMMER then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_FLAIL then if leftKind == WEAPON_CATEGORY_FLAIL then return HAND_RIGHT end elseif rightKind == WEAPON_CATEGORY_SPEAR then if leftKind == WEAPON_CATEGORY_SPEAR then return HAND_RIGHT end elseif rightKind == 55 then if leftKind == 55 then return HAND_RIGHT end elseif rightKind == 58 then if leftKind == 58 then return HAND_RIGHT end elseif rightKind == 60 then if leftKind == 60 then return HAND_RIGHT end elseif rightKind == 61 then if leftKind == 61 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 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 and leftKind == WEAPON_CATEGORY_LARGE_SCYTHE then return HAND_RIGHT end return -1 end function ExecTravelMagnification(attack_type) local stick_level = GetVariable("MoveSpeedLevel") if stick_level > 1 then stick_level = 1 end if GetVariable("IsLockon") == true then stick_level = 1 end local correction_factor_rate = 1.5 -- Vanilla fix - not every check was attack_type == X, -- resulting in everything passing this check and using the lesser correction_factor_rate if attack_type == ATTACK_RIGHT_DASH or attack_type == ATTACK_RIGHT_HEAVYDASH or attack_type == ATTACK_BOTH_DASH or attack_type == ATTACK_BOTH_HEAVYDASH then correction_factor_rate = 1.25 end local travel_magnification = stick_level * correction_factor_rate if travel_magnification < 1 then travel_magnification = 1 end act(SetMovementScaleMult, travel_magnification) return TRUE end function ExecArtsStance(blend_type) if c_SwordArtsID == 318 then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) end if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return FALSE end if GetVariable("AddFookShotBlend") == 1 then return FALSE end if IsDemonSwordMode() == TRUE then return FALSE end 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, WEAPON_CATEGORY_BALISTA) local is_crossbow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) 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 if c_SwordArtsID == 38 then if env(GetFP) >= 8 then if env(GetSpEffectID, 100002) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return FALSE end if env(GetSpEffectID, 100490) == TRUE then ExecEventHalfBlend(Event_DrawStanceRightLoop, blend_type) return FALSE end end elseif c_SwordArtsID == 26 then if env(GetSpEffectID, 100490) == TRUE then ExecEventHalfBlend(Event_DrawStanceRightLoop, blend_type) return FALSE end elseif c_SwordArtsID == 279 then if env(GetSpEffectID, 100490) == TRUE then ExecEventHalfBlend(Event_DrawStanceRightLoop, blend_type) return FALSE end elseif c_SwordArtsID == 29 then if env(GetSpEffectID, 100490) == TRUE then ExecEventHalfBlend(Event_DrawStanceRightLoop, blend_type) return FALSE end end if c_SwordArtsID == 38 then if env(GetFP) >= 8 then if env(GetSpEffectID, 100054) == TRUE then ExecEventAllBody("W_StormRuler_AttackLight1") return FALSE elseif env(GetSpEffectID, 100055) == TRUE then ExecEventAllBody("W_StormRuler_AttackHeavy") return FALSE elseif env(GetSpEffectID, 100058) == TRUE then ExecEventAllBody("W_StormRuler_AttackLight2") return FALSE elseif env(GetSpEffectID, 100059) == TRUE then ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") return FALSE end end end SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) ExecEventHalfBlend(Event_DrawStanceRightStart, blend_type) 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 lastUsedMagicAnim = -1 function ExecMagic(quick_type, blend_type, is_ride) if GetVariable("AddFookShotBlend") == 1 then return FALSE end 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 magic_req = MAGIC_RIGHT_FIRST_SLOT local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) 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 and IsWeaponCatalyst(sp_kind_L) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_req = MAGIC_LEFT_FIRST_SLOT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE and IsWeaponCatalyst(sp_kind_R) == 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 magic_req = MAGIC_LEFT_FIRST_SLOT act(DebugLogOutput, "MagicLeft") elseif env(ActionRequest, ACTION_ARM_MAGIC_R_HEAVY) == 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_L) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_req = MAGIC_LEFT_SECOND_SLOT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE and IsWeaponCatalyst(sp_kind_R) == FALSE then return FALSE end wep_hand = HAND_RIGHT magic_req = MAGIC_RIGHT_SECOND_SLOT end elseif env(ActionRequest, ACTION_ARM_MAGIC_L_HEAVY) == 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 magic_req = MAGIC_LEFT_SECOND_SLOT act(DebugLogOutput, "MagicLeft") else return FALSE end act(DecideMagicUse, magic_req) act(NotifyAIMagicCast) if magic_req == MAGIC_RIGHT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_LEFT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_RIGHT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) elseif magic_req == MAGIC_LEFT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) else SetVariable("MagicRight_ShieldCategory", 0) SetVariable("IndexMagicSlot", MAGIC_SLOT_CREATE) end 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") elseif env(GetSpEffectID, 8885100) == TRUE then ExecEventHalfBlend(Event_MagicPointRecoveryLaunch, blend_type) 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") if env(GetSpEffectID, 8885100) == TRUE then ExecEventHalfBlend(Event_MagicPointRecoveryLaunch, blend_type) else ExecEventHalfBlend(Event_MagicInvalid, blend_type) end end act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end 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 if magic_index == MAGIC_REQUEST_ORDER_SHIELD then if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_SHIELD) == TRUE then SetVariable("MagicRight_ShieldCategory", 1) else SetVariable("MagicRight_ShieldCategory", 0) end else SetVariable("MagicRight_ShieldCategory", 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 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 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) 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 ExecCreateMagic(quick_type, blend_type, is_ride) if c_HasActionRequest == FALSE then return FALSE end if env(GetStamina) <= 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 magic_req = MAGIC_CREATION_SLOT SetVariable("MagicRight_ShieldCategory", 0) act(DecideMagicUse, magic_req) if magic_req == MAGIC_RIGHT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_LEFT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_RIGHT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) elseif magic_req == MAGIC_LEFT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) else SetVariable("IndexMagicSlot", MAGIC_SLOT_CREATE) end 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 ExecEventHalfBlend(Event_MagicLaunchRight, blend_type) act(SetIsMagicInUse, TRUE) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecGesture() if GetVariable("AddFookShotBlend") == 1 then return FALSE end 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 == 141 then request = 140 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 request == 140 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_INVALID then return FALSE end if blend_type == ALLBODY and MoveStart(LOWER, Event_Stealth_Move, FALSE) == TRUE then blend_type = UPPER end if item_type == ITEM_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 ExecItem(quick_type, blend_type) if GetVariable("AddFookShotBlend") == 1 then return FALSE end 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 if env(GetSpEffectID, 102001) == TRUE then quick_type = QUICKTYPE_DASH end act(UseItemDecision) local item_type = env(GetItemAnimType) if item_type ~= ITEM_DRINK and IsDemonSwordMode() == TRUE then return FALSE end 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) and env(GetStamina) <= 0 then return FALSE end if env(GetSpEffectID, 102180) == FALSE and 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 item_type == ITEM_RECOVER then ExecEventHalfBlend(Event_ItemRecover, blend_type) elseif item_type == ITEM_WEAPON_ENCHANT then 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 SetVariable("IsBaphometBuff", 0) if env(GetSpEffectID, 49753) == TRUE or env(GetSpEffectID, 49754) == TRUE or env(GetSpEffectID, 49755) == TRUE then SetVariable("IsBaphometBuff", 1) if env(GetStateChangeType, 2000) == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemExpansionUse, blend_type) elseif IsNodeActive("ItemDrinking_Upper_CMSG") == TRUE or IsNodeActive("ItemDrinking_Upper_Baphomet_CMSG") == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinking, blend_type) else SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinkStart, blend_type) end elseif env(GetStateChangeType, CONDITION_TYPE_NO_EST) == TRUE then ExecEventHalfBlend(Event_ItemDrinkNothing, blend_type) elseif env(GetStateChangeType, 2000) == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemExpansionUse, 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_SHOCK_WAVE then ExecEventHalfBlend(Event_ItemShockWeaveStart, blend_type) elseif item_type == ITEM_QUICK_WEAPON_ENCHANT then 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, ALLBODY) elseif quick_type == QUICKTYPE_ATTACK then if ForwardLeg() == 1 then ExecEventHalfBlend(Event_QuickItemEnchantAttackRight, ALLBODY) else ExecEventHalfBlend(Event_QuickItemEnchantAttackLeft, ALLBODY) 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_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_THROW_SPEAR then ExecEventHalfBlend(Event_ItemThrowSpear, blend_type) elseif item_type == 25 then ExecEventHalfBlend(Event_ItemDragonFullStartAfter, blend_type) elseif item_type == 26 then if env(GetSpEffectID, 7050300) == TRUE then ExecEventHalfBlend(Event_ItemExpansionUse, blend_type) else ExecEventHalfBlend(Event_ItemEatJerky, blend_type) end 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 ExecEventHalfBlend(Event_ItemVoice, blend_type) elseif item_type == ITEM_SUMMONHORSE then SetVariable("RideOnSummonTest", 0) SetVariable("IndexItemUseAnim", item_type) SetVariable("ItemDashSpeedIndex", 0) if GetVariable("MoveSpeedIndex") >= 1 then SetVariable("ItemDashSpeedIndex", 1) end if GetVariable("MoveSpeedLevel") >= 0.9 then IsSummonDash = TRUE else IsSummonDash = FALSE end ExecEventHalfBlend(Event_ItemDash, blend_type) elseif item_type == ITEM_VOICE then 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_NIGHT_BELL then 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_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 SetVariable("IsBaphometBuff", 0) if env(GetSpEffectID, 49753) == TRUE or env(GetSpEffectID, 49754) == TRUE or env(GetSpEffectID, 49755) == TRUE then SetVariable("IsBaphometBuff", 1) if env(GetStateChangeType, 2000) == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemExpansionUse, blend_type) elseif IsNodeActive("ItemDrinking_Upper_CMSG") == TRUE or IsNodeActive("ItemDrinking_Upper_Baphomet_CMSG") == TRUE then SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinking, blend_type) else SetInterruptType(INTERRUPT_USEITEM) ExecEventHalfBlend(Event_ItemDrinkStart, blend_type) end elseif 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_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 hand == HAND_RIGHT and GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_KATANA) == TRUE then pos = 0 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 HandChangeTest_L = FALSE HandChangeTest_R = FALSE HandChangeTest_Time = 233 function ExecWeaponChange(blend_type) if GetVariable("AddFookShotBlend") == 1 then return FALSE end if IsDemonSwordMode() == TRUE then return FALSE end if env(GetSpEffectID, 9621) == TRUE then return FALSE end 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, 700530) == TRUE then return FALSE end if env(ActionRequest, ACTION_ARM_CHANGE_STYLE_R) == TRUE and env(ActionDurationAlternate, ACTION_ARM_R1) < 100 then return ExecHandChange(HAND_RIGHT, TRUE, blend_type) elseif env(ActionRequest, ACTION_ARM_CHANGE_STYLE_L) == TRUE and env(ActionDurationAlternate, ACTION_ARM_L1) < 100 then return ExecHandChange(HAND_LEFT, TRUE, blend_type) end if env(ActionRequest, ACTION_ARM_CHANGE_WEAPON_R) == TRUE then RELIC_WEAPONCHANGE_ENCHANT = 0 kind = GetWeaponChangeType(HAND_RIGHT) elseif env(ActionRequest, ACTION_ARM_CHANGE_WEAPON_L) == TRUE then RELIC_WEAPONCHANGE_ENCHANT = 1 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 hand == HAND_RIGHT and GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_KATANA) == TRUE then pos = 0 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() if env(ActionRequest, ACTION_ARM_JUMP) == FALSE and env(IsAIJumpRequested) == FALSE then return FALSE end if ExecGroundNonCombatAreaEnter(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGroundNonCombatAreaLeave(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if env(GetStamina) <= 0 and env(IsAIJumpRequested) == FALSE then ResetRequest() return FALSE end SetWeightIndex() if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_OVERWEIGHT and env(IsAIJumpRequested) == FALSE then local jumpangle = env(GetJumpAngle) * 0.01 if jumpangle > -45 and jumpangle < 45 then SetVariable("JumpOverweightIndex", 0) elseif jumpangle >= 0 and jumpangle <= 100 then SetVariable("JumpOverweightIndex", 3) elseif jumpangle >= -100 and jumpangle <= 0 then SetVariable("JumpOverweightIndex", 2) else SetVariable("JumpOverweightIndex", 1) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEventAllBody("W_Jump_Overweight") return TRUE end local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if style == HAND_RIGHT then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 0) end elseif style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end elseif style == HAND_LEFT_BOTH then local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) SetVariable("JumpAttack_HandCondition", 1) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 3) elseif ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) IS_ATTACKED_JUMPMAGIC = FALSE local highJumpHeight = env(GetSpiritspringJumpHeight) if highJumpHeight > 0 or env(GetSpEffectID, 102501) == TRUE or env(GetSpEffectID, 98215) == TRUE then SetVariable("IsAttackWhileTorchGuard", highJumpHeight / 100) if highJumpHeight <= 3000 then SetVariable("IndexSuperJump", 0) elseif highJumpHeight <= 4500 then SetVariable("IndexSuperJump", 1) elseif highJumpHeight <= 6000 then SetVariable("IndexSuperJump", 2) elseif highJumpHeight <= 7500 then SetVariable("IndexSuperJump", 3) else SetVariable("IndexSuperJump", 3) end if env(GetSpEffectID, 99215) == TRUE then SetVariable("IndexSuperJump", 5) elseif env(GetSpEffectID, 99216) == TRUE then SetVariable("IndexSuperJump", 4) elseif env(GetSpEffectID, 99217) == TRUE then SetVariable("IndexSuperJump", 5) elseif env(GetSpEffectID, 99218) == TRUE then SetVariable("IndexSuperJump", 0) elseif env(GetSpEffectID, 102501) == TRUE then SetVariable("IndexSuperJump", 4) elseif env(GetSpEffectID, 98210) == TRUE then SetVariable("IndexSuperJump", 6) elseif env(GetSpEffectID, 98215) == TRUE then SetVariable("IndexSuperJump", 7) if IsFookShotMode() == TRUE then ExecFookShotModeEnd() end elseif env(GetSpEffectID, 98217) == TRUE then SetVariable("IndexSuperJump", 8) elseif env(GetSpEffectID, 98218) == TRUE then SetVariable("IndexSuperJump", 9) end ExecEvent("W_SuperJump") return TRUE end local JumpMoveLevel = 0 if GetVariable("LocomotionState") == 1 and GetVariable("MoveSpeedIndex") == 3 or IsNodeActive("SprintStart_Selector") == TRUE or IsNodeActive("Jump_Land_To_Sprint_Height_Selector") == TRUE or IsNodeActive("Rolling_To_Sprint_Light_CMSG") == TRUE then JumpMoveLevel = 3 elseif GetVariable("LocomotionState") == 1 and GetVariable("MoveSpeedIndex") == 2 or IsNodeActive("Jump_Land_To_Dash_Light_CMSG") == TRUE or IsNodeActive("Jump_Land_To_Dash_Heavy_CMSG") == TRUE or IsNodeActive("Jump_Land_To_Dash_Over_CMSG") == TRUE then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") >= 0.6 then JumpMoveLevel = 1 end if SetSlowFeet() == TRUE then JumpMoveLevel = 0 end if env(GetSpEffectID, 700511) == TRUE then if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("JumpFookShotVariation", 0) AddStamina(STAMINA_REDUCE_SPRINTJUMP) ExecEvent("W_Jump_FookShot") return TRUE elseif JumpMoveLevel == 3 then if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() AddStamina(STAMINA_REDUCE_SPRINTJUMP) ExecEvent("W_Jump_S") return TRUE elseif JumpMoveLevel == 2 then if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() AddStamina(STAMINA_REDUCE_DASHJUMP) ExecEvent("W_Jump_D") return TRUE elseif JumpMoveLevel == 1 then if GetVariable("IsLockon") == false and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE then SetVariable("JumpDirection", 0) SetVariable("JumpAngle", 0) else local turn_target_angle = 0 local jumpangle = env(GetJumpAngle) * 0.01 if jumpangle > -45 and jumpangle < 45 then turn_target_angle = jumpangle SetVariable("JumpDirection", 0) SetVariable("JumpAngle", 0) elseif jumpangle >= 0 and jumpangle <= 100 then turn_target_angle = jumpangle - 90 SetVariable("JumpDirection", 3) SetVariable("JumpAngle", 90) elseif jumpangle >= -100 and jumpangle <= 0 then turn_target_angle = jumpangle + 90 SetVariable("JumpDirection", 2) SetVariable("JumpAngle", -90) else turn_target_angle = jumpangle - 180 SetVariable("JumpDirection", 1) SetVariable("JumpAngle", 180) end if GetVariable("IsLockon") == true then act(TurnToLockonTargetImmediately, turn_target_angle) else act(FaceDirection, turn_target_angle) end end SetVariable("IsEnableDirectionJumpTAE", true) if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEvent("W_Jump_F") return TRUE else SetVariable("JumpReachSelector", 0) if env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) end act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() ExecEvent("W_Jump_N") return TRUE end end function ExecJumpLoopDirect(jump_type) local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if style == HAND_RIGHT then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 0) end elseif style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end elseif style == HAND_LEFT_BOTH then local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 3) elseif ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) if jump_type == 2 then ExecEvent("W_Jump_Loop") return TRUE elseif GetVariable("MoveSpeedLevel") >= 0.6 then SetVariable("IsEnableDirectionJumpTAE", true) ExecEvent("W_Jump_Loop") return TRUE else SetVariable("JumpReachSelector", 0) ExecEvent("W_Jump_Loop") return TRUE end end function ExecHandChange(hand, is_force, blend_type, no_reset) if GetVariable("AddFookShotBlend") == 1 then return FALSE end if IsDemonSwordMode() == TRUE then return FALSE end 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(ActionDurationAlternate, ACTION_ARM_R1) < 100 then elseif env(ActionRequest, ACTION_ARM_CHANGE_STYLE_L) == TRUE and env(ActionDurationAlternate, ACTION_ARM_L1) < 100 then hand = HAND_LEFT else return FALSE end end if env(GetSpEffectID, 700530) == TRUE then return FALSE end if env(GetSpEffectID, 5031) == TRUE then return FALSE 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 ExecGroundNonCombatAreaEnter(hand, is_force, blend_type, no_reset) if GetVariable("WeaponBehaviorRight") == 0 then return FALSE end if env(GetSpEffectID, 9621) == FALSE then return FALSE end if IsFookShotMode() == TRUE then ExecFookShotModeEnd() end if IsSummonNecromanceMode() == TRUE then ExecEventHalfBlend(Event_NecromanceModeFinish, blend_type) return TRUE end if IsDemonSwordMode() == TRUE then ExecEventHalfBlend(Event_DemonSwordStanceEnd, blend_type) return TRUE end if IsDemonBeastMode() == TRUE then return FALSE end if IsPhotoShootMode() == TRUE then ExecEventHalfBlend(Event_PhotoShootFinish, blend_type) return end if env(GetSpEffectID, 601000) == TRUE then SetVariable("AddNonCombatAreaEnterBlend", 1) ExecEventNoReset("W_AddNonCombatAreaEnter") return TRUE 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 sp_kind_R == 522 then if sp_kind_L == 522 then SetVariable("WeaponBehaviorRight", 0) return TRUE else ExecGroundNonCombatAreaEnterLeft(HAND_Left, FALSE, ALLBODY) return TRUE end end if kind == WEAPON_CHANGE_REQUEST_RIGHT_BACK then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(0, 0) else SetHandChangeStyle(0, 0) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(1, 1) else SetHandChangeStyle(1, 1) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(2, 2) else SetHandChangeStyle(2, 2) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SPEAR then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(3, 3) else SetHandChangeStyle(3, 3) end elseif IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(0, 0) else SetHandChangeStyle(0, 0) end local event = Event_GroundNonCombatAreaEnterStart ExecEventHalfBlend(event, blend_type) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("WeaponBehaviorRight", 0) return TRUE end function ExecGroundNonCombatAreaLeave(hand, is_force, blend_type, no_reset) if env(GetSpEffectID, 9621) == TRUE then return FALSE end if IsDemonBeastMode() == TRUE then return FALSE end if GetVariable("WeaponBehaviorRight") == 1 then 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 sp_kind_R == 522 then if sp_kind_L == 522 then SetVariable("WeaponBehaviorRight", 1) return TRUE else ExecGroundNonCombatAreaLeaveLeft(HAND_Left, FALSE, ALLBODY) return TRUE end end if kind == WEAPON_CHANGE_REQUEST_RIGHT_BACK then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(0, 0) else SetHandChangeStyle(0, 0) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_WAIST then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(1, 1) else SetHandChangeStyle(1, 1) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SHOULDER then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(2, 2) else SetHandChangeStyle(2, 2) end elseif kind == WEAPON_CHANGE_REQUEST_RIGHT_SPEAR then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(3, 3) else SetHandChangeStyle(3, 3) end elseif IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(0, 0) else SetHandChangeStyle(0, 0) end local event = Event_GroundNonCombatAreaLeaveStart ExecEventHalfBlend(event, blend_type) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("WeaponBehaviorRight", 1) return TRUE end function ExecGroundNonCombatAreaEnterLeft(hand, is_force, blend_type, no_reset) if env(GetSpEffectID, 9621) == FALSE then return FALSE end if GetVariable("WeaponBehaviorRight") == 0 then 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 sp_kind_L == 522 then SetVariable("WeaponBehaviorRight", 0) return TRUE end if leftKind == WEAPON_CHANGE_REQUEST_LEFT_BACK then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(4, 4) else SetHandChangeStyle(4, 4) end elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_WAIST then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(5, 5) else SetHandChangeStyle(5, 5) end elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(6, 6) else SetHandChangeStyle(6, 6) end elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(7, 7) else SetHandChangeStyle(7, 7) end elseif IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(4, 4) else SetHandChangeStyle(4, 4) end local event = Event_GroundNonCombatAreaEnterStart_Left ExecEventHalfBlend(event, blend_type) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("WeaponBehaviorRight", 0) return TRUE end function ExecGroundNonCombatAreaLeaveLeft(hand, is_force, blend_type, no_reset) if env(GetSpEffectID, 9621) == TRUE then return FALSE end if GetVariable("WeaponBehaviorRight") == 1 then 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 sp_kind_L == 522 then SetVariable("WeaponBehaviorRight", 1) return TRUE end if leftKind == WEAPON_CHANGE_REQUEST_LEFT_BACK then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(4, 4) else SetHandChangeStyle(4, 4) end elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_WAIST then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(5, 5) else SetHandChangeStyle(5, 5) end elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_SHOULDER then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(6, 6) else SetHandChangeStyle(6, 6) end elseif leftKind == WEAPON_CHANGE_REQUEST_LEFT_SPEAR then if IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(7, 7) else SetHandChangeStyle(7, 7) end elseif IsDualBladeSpecific(HAND_RIGHT) == TRUE then SetHandChangeStyle(4, 4) else SetHandChangeStyle(4, 4) end local event = Event_GroundNonCombatAreaLeaveStart_Left ExecEventHalfBlend(event, blend_type) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("WeaponBehaviorRight", 1) 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 estep == ESTEP_LAND then SetWeightIndex() SetVariable("RollingVariationIndex", ROLLING_DEFAULT) local rollingEvent = "W_Rolling" local is_selfTrans = FALSE if IsNodeActive("Rolling_CMSG") == TRUE then is_selfTrans = TRUE end if is_selfTrans == TRUE then rollingEvent = rollingEvent .. "_Selftrans" end local turn_angle_real = 200 c_RollingAngle = GetVariable("MoveAngle") 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) return TRUE end if c_HasActionRequest == FALSE then return FALSE end local request = GetEvasionRequest() local speedlevel = GetVariable("MoveSpeedIndex") if env(GetSpEffectID, 103020) == FALSE and request == ATTACK_REQUEST_INVALID then return FALSE end if ExecGroundNonCombatAreaEnter(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGroundNonCombatAreaLeave(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if backstep_limit == TRUE and request == ATTACK_REQUEST_BACKSTEP and env(GetEventEzStateFlag, 0) == TRUE then return FALSE end SetWeightIndex() if env(GetHeroID) == HERO_MAGIC and env(GetSpEffectID, 1800200) == TRUE then SetVariable("RollingVariationIndex", ROLLING_CREATEMAGIC_THUNDER) elseif IsEnableHighGuard() == TRUE and IsGuard() == TRUE then SetVariable("RollingVariationIndex", ROLLING_HIGHGUARD) elseif env(GetHeroID) == HERO_MAGIC and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_MAGIC) elseif IsNodeActive("FookShotMove_CMSG") == TRUE and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_FOOKSHOT) elseif env(GetHeroID) == HERO_SPEED and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_SPEED) elseif env(GetHeroID) == HERO_TANK and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_TANK) elseif IsDemonSwordMode() == TRUE and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_DEMONSWORD) elseif env(GetHeroID) == HERO_BUFFER and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_BUFFER) elseif env(GetHeroID) == HERO_ATTACKER and (env(GetSpEffectID, 709000) == TRUE or env(GetSpEffectID, 709010) == TRUE) and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then SetVariable("RollingVariationIndex", ROLLING_TRANCE) else SetVariable("RollingVariationIndex", ROLLING_DEFAULT) end 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 return FALSE end end if 0 >= env(GetStamina) 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 if env(GetHeroID) == HERO_SPEED and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then if env(GetSpEffectID, 703550) == TRUE then rollingEvent = rollingEvent .. "_Selftrans" else rollingEvent = rollingEvent .. "_Selftrans2" end else rollingEvent = rollingEvent .. "_Selftrans" end if env(GetHeroID) == HERO_SPEED then SetVariable("RollingDuration", 0.1) else SetVariable("RollingDuration", 0.1) end elseif IsNodeActive("Rolling_Selftrans2_CMSG") == TRUE and env(GetHeroID) == HERO_SPEED and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_HEAVY then if env(GetSpEffectID, 703550) == TRUE then rollingEvent = rollingEvent .. "_Selftrans" end SetVariable("RollingDuration", 0.1) end AddStamina(STAMINA_REDUCE_ROLLING) SetVariable("ToggleDash", 0) 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) if env(GetHeroID) == HERO_SPEED then SetVariable("RollingDirectionIndex", rollingDirection) end else SetVariable("RollingDirectionIndex", rollingDirection) if env(GetHeroID) == HERO_SPEED then SetVariable("RollingDirectionIndex_SelfTrans", rollingDirection) end 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 0 >= env(GetStamina) then ResetRequest() return FALSE end AddStamina(STAMINA_REDUCE_BACKSTEP) if IsEnableGuard() == TRUE and IsGuard() == TRUE and IsDemonSwordMode() == FALSE and GetVariable("EvasionWeightIndex") ~= EVASION_WEIGHT_INDEX_OVERWEIGHT then if GetVariable("IndexGuardStyle") == GUARD_STYLE_HIGHGUARD 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_TORCH and style == HAND_RIGHT then guardindex = GUARD_STYLE_TORCH if sp_kind == 250 then SetVariable("IndexTorchColor", 1) elseif sp_kind == 251 then SetVariable("IndexTorchColor", 2) else SetVariable("IndexTorchColor", 0) end elseif sp_kind == 240 and style == HAND_RIGHT then guardindex = GUARD_STYLE_TORCH elseif (style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH) and env(GetStayAnimCategory) ~= 15 and env(GetStayAnimCategory) ~= 0 and env(GetStayAnimCategory) ~= 2 and env(GetStayAnimCategory) ~= 3 then guardindex = GUARD_STYLE_DEFAULT end SetVariable("IndexGuardStyle", guardindex) end SetVariable("BackStepGuardLayer", 1) SetVariable("EnableTAE_BackStep", false) ExecEvent("W_DefaultBackStep") ExecEvent("W_BackStepGuardOn_UpperLayer") else SetVariable("BackStepGuardLayer", 0) SetVariable("EnableTAE_BackStep", true) if env(GetHeroID) == HERO_SPEED then if env(GetSpEffectID, 703565) == FALSE then ExecEventAllBody("W_LadyBackStep2") else ExecEventAllBody("W_LadyBackStep") end elseif env(GetSpEffectID, 103020) == TRUE then ExecEventAllBody("W_SmashAttackStep_Back_AllBody") else ExecEventAllBody("W_DefaultBackStep") end end else return FALSE end SetVariable("ToggleDash", 0) 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 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 if env(GetSpEffectID, 102010) == TRUE then ExecEventAllBody("W_Sprint180") return TRUE elseif env(GetSpEffectID, 102610) == TRUE then ExecEventAllBody("W_BirdDepartureFall180") return TRUE else ExecEventAllBody("W_Dash180") return TRUE end 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 JUMPS = 0 if IsNodeActive("FookShotMove_CMSG") == TRUE or IsNodeActive("AirFookShotMove_Land_CMSG") == TRUE then SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) IS_ATTACKED_JUMPMAGIC = FALSE SetVariable("JumpFookShotVariation", 1) ExecEventAllBody("W_Jump_FookShot") elseif IsNodeActive("AirFookShotMove_CMSG") == TRUE then SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) IS_ATTACKED_JUMPMAGIC = FALSE SetVariable("JumpFookShotVariation", 2) ExecEventAllBody("W_Jump_FookShot") elseif IsNodeActive("DragoonJumpStart_CMSG") == TRUE then ExecEventNoReset("W_AirDragoonJumpLoop") elseif 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_demonsword_justguard) if is_damaged == FALSE then return end if env(GetBehaviorID, 2) == 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_demonsword_justguard == TRUE then if damage_dir == DAMAGE_DIR_BACK then ExecEventNoReset("W_AddDamageLv0") return else ExecEventNoReset("W_AddDamageGuardStartDemonSword") return end elseif 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") return end end function ExecPassiveAction(is_parry, fall_type, is_attackwhileguard, is_neardeathrevival) if env(HasThrowRequest) == TRUE then ResetDamageCount() return TRUE end if is_neardeathrevival == FALSE then if ExecNearDeath() == TRUE then return TRUE end if ExecDeath() == TRUE then return TRUE end 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 ExecBirdAct() == TRUE then return TRUE end if ExecFallStart(fall_type) == TRUE then ResetDamageCount() return TRUE end if ExecFookShot() == TRUE then 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 ExecNearDeath() if env(IsInvincibleDebugMode) == TRUE then return FALSE end if env(GetHeroID) == HERO_NONE or env(GetSpEffectID, 102130) == TRUE then return FALSE end if IsDirectDeath() == TRUE then return FALSE end if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH or env(GetHP) <= 0 then if GetVariable("IndexNearDeath") == 11 then if GetVariable("ThrowDeathState") == 0 then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 0) ExecEventAllBody("W_NearDeathStart") return TRUE elseif GetVariable("ThrowDeathState") == 1 then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 1) ExecEventAllBody("W_NearDeathStart") return TRUE end else SetVariable("IndexNearDeath", 0) SetVariable("DamageState", 0) 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(GetSpecialAttribute) == DAMAGE_ELEMENT_MADNESS then act(DebugLogOutput, "DEATY_TYPE_MAD") SetVariable("IndexNearDeath", DEATH_TYPE_MAD) elseif env(GetIsWeakPoint) == TRUE then SetVariable("IndexNearDeath", DEATH_TYPE_WEAK) elseif damage_level == DAMAGE_LEVEL_EXLARGE or damage_level == DAMAGE_LEVEL_SMALL_BLOW then SetVariable("IndexNearDeath", DEATH_TYPE_BLAST) elseif damage_level == DAMAGE_LEVEL_UPPER then SetVariable("IndexNearDeath", DEATH_TYPE_UPPER) elseif damage_level == DAMAGE_LEVEL_FLING then SetVariable("IndexNearDeath", DEATH_TYPE_FLING) elseif env(GetSpecialAttribute) == DAMAGE_ELEMENT_POISON or env(GetSpecialAttribute) == DAMAGE_ELEMENT_ROT then SetVariable("IndexNearDeath", DEATH_TYPE_POISON) else local damageState = 0 local physicalType = env(GetPhysicalAttribute) local elementType = env(GetSpecialAttribute) local deathRandom = 0 deathRandom = math.random(0, 100) if elementType == DAMAGE_ELEMENT_FIRE then damageState = 4 end SetVariable("DamageState", damageState) act(DebugLogOutput, "DeathStart DamageState=" .. damageState .. " rand=" .. deathRandom) local isMad = env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) act(DebugLogOutput, "elementType=" .. elementType .. " IsMad=" .. isMad) SetVariable("IndexNearDeath", DEATH_TYPE_COMMON) end ExecEventAllBody("W_NearDeathStart") return TRUE end end if env(GetStateChangeType, CONDITION_TYPE_STONE) == TRUE or env(GetStateChangeType, CONDITION_TYPE_CRYSTAL) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_DEATH) == TRUE then -- Prevent death during Retaliate or while affected by Immortal March if env(GetSpEffectID, 704000) == TRUE or env(GetSpEffectID, 705000) == TRUE or env(GetSpEffectID, 705010) == TRUE then return FALSE else SetVariable("IndexNearDeath", DEATH_TYPE_STONE) SetVariable("DamageState", 0) ExecEventAllBody("W_NearDeathStart") return TRUE end end end function ExecDeath() if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH or env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH_FALLING 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, STATUS_EFFECT_DEATH) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_STONE) elseif env(GetSpecialAttribute) == DAMAGE_ELEMENT_MADNESS 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_ROT then SetVariable("IndexDeath", DEATH_TYPE_POISON) else local damageState = 0 local physicalType = env(GetPhysicalAttribute) local elementType = env(GetSpecialAttribute) local deathRandom = 0 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, STATUS_EFFECT_MADNESS) 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 and (env(GetStateChangeType, CONDITION_TYPE_STONE) == TRUE or env(GetStateChangeType, CONDITION_TYPE_CRYSTAL) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_DEATH) == TRUE) then -- Prevent death during Retaliate or while affected by Immortal March if env(GetSpEffectID, 704000) == TRUE or env(GetSpEffectID, 705000) == TRUE or env(GetSpEffectID, 705010) == TRUE then return FALSE else SetVariable("IndexDeath", DEATH_TYPE_STONE) 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 is_damaged = env(HasReceivedAnyDamage) if env(GetSpEffectID, 102551) == TRUE then return FALSE end -- ChrActionFlag 24 "Super Armor" if env(IsDamageMotionOff) == TRUE then return FALSE end if env(Unknown426) == TRUE then return FALSE end if env(GetSpEffectID, 708050) == TRUE and is_damaged == TRUE then act(AddSpEffect, 708052) return FALSE end if env(Unknown1012) == TRUE then return FALSE end if env(GetSpEffectID, 51370) == TRUE and is_damaged == TRUE then if env(GetSpEffectID, 51382) == TRUE then act(AddSpEffect, 51382) act(AddSpEffect, 51381) act(AddSpEffect, 51380) elseif env(GetSpEffectID, 51381) == TRUE then act(AddSpEffect, 51382) act(AddSpEffect, 51381) act(AddSpEffect, 51380) elseif env(GetSpEffectID, 51380) == TRUE then act(AddSpEffect, 51381) act(AddSpEffect, 51380) else act(AddSpEffect, 51380) end end -- Wylder's Sixth Sense if env(IsCheatDeathTriggered) == TRUE then SetVariable("EvasionWeightIndex", 0) SetVariable("RollingDirectionIndex_SelfTrans", 1) if env(GetCheatDeathAtkDirection) == 0 then SetVariable("RollingDirectionIndex", 3) elseif env(GetCheatDeathAtkDirection) == 1 then SetVariable("RollingDirectionIndex", 2) elseif env(GetCheatDeathAtkDirection) == 2 then SetVariable("RollingDirectionIndex", 1) elseif env(GetCheatDeathAtkDirection) == 3 then SetVariable("RollingDirectionIndex", 0) end -- Relic: Art gauge greatly filled when ability is activated if env(GetSpEffectID, 7032400) == TRUE then act(AddSpEffect, 7032401) end SetVariable("RollingVariationIndex", ROLLING_CHEATDEATH) ExecEventAllBody("W_Rolling") return TRUE end -- Undertaker - Enhanced Trance Auto-Dodge if env(IsEnhancedTranceHit) == TRUE then SetVariable("EvasionWeightIndex", 0) SetVariable("RollingDirectionIndex_SelfTrans", 1) if env(GetEnhancedTranceAtkDirection) == 0 then SetVariable("RollingDirectionIndex", 3) elseif env(GetEnhancedTranceAtkDirection) == 1 then SetVariable("RollingDirectionIndex", 2) elseif env(GetEnhancedTranceAtkDirection) == 2 then SetVariable("RollingDirectionIndex", 1) elseif env(GetEnhancedTranceAtkDirection) == 3 then SetVariable("RollingDirectionIndex", 0) end SetVariable("RollingVariationIndex", ROLLING_TRANCE_ENHANCE) ExecEventAllBody("W_Rolling") return TRUE end local damage_level = env(GetDamageLevel) local damage_type = env(GetReceivedDamageType) local is_demonsword_justguard = FALSE if env(GetSpEffectType, 32) == TRUE then act(SetKnockbackFlag, DAMAGE_FLAG_SMALL) ResetRequest() ExecEventAllBody("W_DamageBind") Replanning() return TRUE end if env(GetBehaviorID, BEH_IDENTIFIER_FOOKSHOT) == TRUE then FookShotHit() end if env(GetBehaviorID, BEH_IDENTIFIER_FOOKSHOTPULL) == TRUE then CalculateKnockbackRate() damage_level = DAMAGE_LEVEL_PUSH else FOOKSHOT_KNOCKBACK_RATE = 1 end -- White Horn (Raider Remembrance) - Trigger special event anim if env(GetHP) <= 1 and env(GetSpEffectID, 99320) == TRUE then hkbFireEvent("W_Event61030") return end if env(GetDamageSpecialAttribute, STATUS_EFFECT_SLEEP) == TRUE then -- Maris Sleep - Play special anim and apply increasing damage effect if env(GetSpEffectID, 25100) == TRUE or env(GetSpEffectID, 25101) == TRUE or env(GetSpEffectID, 25102) == TRUE or env(GetSpEffectID, 25103) == TRUE or env(GetSpEffectID, 25105) == TRUE or env(GetSpEffectID, 25106) == TRUE then if env(GetSpEffectID, 45702) == TRUE then elseif env(GetSpEffectID, 45701) == TRUE then act(AddSpEffect, 45702) elseif env(GetSpEffectID, 45700) == TRUE then act(AddSpEffect, 45701) else act(AddSpEffect, 45700) end ExecEventAllBody("W_DamageComatoseSleep") return TRUE else ExecEventAllBody("W_DamageSleepResist") return TRUE end end if env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE then ExecEventAllBody("W_DamageMad") return TRUE end -- Gnoster - Trigger parasite from Faurtis's roar if env(GetSpEffectID, 46006) == TRUE and (env(GetSpEffectID, 46000) == TRUE or env(GetSpEffectID, 46001) == TRUE or env(GetSpEffectID, 46002) == TRUE or env(GetSpEffectID, 46003) == TRUE or env(GetSpEffectID, 46004) == TRUE) then ExecEventAllBody("W_DamageParasite") return TRUE end if env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOODLOSS) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_FROSTBITE) == TRUE then if damage_level == DAMAGE_LEVEL_NONE then if IsNodeActive("SwordArtsOneShot Selector") == TRUE and c_SwordArtsID == 136 then elseif IsNodeActive("BloodMagicStart_CMSG") == TRUE and env(GetSpEffectID, 7032900) == TRUE then elseif env(GetSpEffectID, 22200) ~= TRUE and env(GetSpEffectID, 22201) ~= TRUE and env(GetSpEffectID, 22202) ~= TRUE and env(GetSpEffectID, 22203) ~= TRUE and env(GetSpEffectID, 22204) ~= TRUE and env(GetSpEffectID, 22205) ~= TRUE and env(GetSpEffectID, 22206) ~= TRUE and env(GetSpEffectID, 22207) ~= TRUE and env(GetSpEffectID, 22208) ~= TRUE and env(GetSpEffectID, 22209) ~= TRUE then if env(GetSpEffectID, 22210) == TRUE then else damage_level = DAMAGE_LEVEL_SMALL end end elseif damage_level ~= DAMAGE_LEVEL_SMALL and damage_level ~= DAMAGE_LEVEL_MIDDLE and damage_level == DAMAGE_LEVEL_MINIMUM then end end if env(GetMarkingDamageID) == 8700 then if damage_level == DAMAGE_LEVEL_NONE then damage_level = DAMAGE_LEVEL_MIDDLE elseif damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_MINIMUM then damage_level = DAMAGE_LEVEL_LARGE 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 -- Raptor of the Mist 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 local is_demonsword_justguard_break = FALSE if damage_type == DAMAGE_TYPE_GUARDBREAK and IsDemonSwordMode() == TRUE and env(GetSpEffectID, 707000) == TRUE then damage_type = DAMAGE_TYPE_GUARD is_demonsword_justguard_break = 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(SetKnockbackFlag, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_Repelled_Small") elseif damage_level == DAMAGE_LEVEL_SMALL then act(SetKnockbackFlag, 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(SetKnockbackFlag, DAMAGE_FLAG_LARGE) ExecEventAllBody("W_Repelled_Large") else act(SetKnockbackFlag, 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 elseif style == HAND_LEFT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_LEFT) end elseif style == HAND_RIGHT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_RIGHT) end end SetVariable("IndexGuard", guardindex) if env(GetSpEffectID, 701530) == TRUE then SetVariable("IndexGuard", 3) end if IsDemonSwordMode() == TRUE then if IsNodeActive("DemonSwordStanceEnd_CMSG00") == TRUE then is_demonsword_justguard = TRUE SetVariable("IndexGuardTechnical", 0) ExecAddDamage(damage_angle, attack_dir, damage_level, TRUE, is_damaged, is_demonsword_justguard) return FALSE else if env(GetSpEffectID, 707000) == TRUE then is_demonsword_justguard = TRUE SetVariable("IndexGuardTechnical", 0) else is_demonsword_justguard = FALSE SetVariable("IndexGuardTechnical", 1) end SetVariable("IndexGuard", 4) end end act(SetKnockbackFlag, 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(SetKnockbackFlag, 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(SetKnockbackFlag, DAMAGE_FLAG_GUARD_BREAK) ExecEventAllBody("W_Repelled_Wall") return TRUE elseif damage_type == DAMAGE_TYPE_GUARDBREAK_BLAST then act(SetKnockbackFlag, DAMAGE_FLAG_SMALL_BLOW) ExecEventAllBody("W_DamageLv7_SmallBlow") return TRUE elseif damage_type == DAMAGE_TYPE_GUARDBREAK_FLING then act(SetKnockbackFlag, 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 or IsNodeActive("DemonSwordCounter_CMSG") == TRUE then return FALSE end if IsNodeActive("ResonanceGuardStart_CMSG") == 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 elseif style == HAND_LEFT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_LEFT) end elseif style == HAND_RIGHT_BOTH then SetVariable("IsTorchGuard", FALSE) if env(GetStayAnimCategory) == 15 then guardindex = env(GetGuardMotionCategory, HAND_RIGHT) end end SetVariable("IndexGuard", guardindex) if env(GetSpEffectID, 701530) == TRUE then SetVariable("IndexGuard", 3) end if IsDemonSwordMode() == TRUE then if IsNodeActive("DemonSwordStanceEnd_CMSG00") == TRUE or IsNodeActive("DemonSwordArts Selector") == TRUE then is_demonsword_justguard = TRUE SetVariable("IndexGuardTechnical", 0) ExecAddDamage(damage_angle, attack_dir, damage_level, TRUE, is_damaged, is_demonsword_justguard) return FALSE else if env(GetSpEffectID, 707000) == TRUE then is_demonsword_justguard = TRUE SetVariable("IndexGuardTechnical", 0) else is_demonsword_justguard = FALSE SetVariable("IndexGuardTechnical", 1) end SetVariable("IndexGuard", 4) end end local guard_damage_level = env(GetGuardLevelAction) if env(GetSpEffectID, 171) == TRUE and guard_damage_level < 3 then guard_damage_level = 3 end if is_demonsword_justguard_break == TRUE then guard_damage_level = 4 end if guard_damage_level > 0 then local guard_damage_direction = env(GetAtkDirection) if guard_damage_direction == 0 then SetVariable("IndexGuardDirection", 0) elseif guard_damage_direction == 1 then SetVariable("IndexGuardDirection", 0) elseif guard_damage_direction == 2 then SetVariable("IndexGuardDirection", 0) elseif guard_damage_direction == 3 then SetVariable("IndexGuardDirection", 1) elseif guard_damage_direction == 4 then SetVariable("IndexGuardDirection", 2) end if IsNodeActive("DemonSwordStanceStart_CMSG01") == TRUE then ExecEventAllBody("W_GuardDamageDemonSword_Start") elseif IsNodeActive("DemonSwordStanceEnd_Upper_CMSG") == TRUE then ExecEventAllBody("W_GuardDamageDemonSword_End") elseif guard_damage_level == 1 then act(SetKnockbackFlag, DAMAGE_FLAG_GUARD_SMALL) ExecEventAllBody("W_GuardDamageSmall") elseif guard_damage_level == 3 then act(SetKnockbackFlag, DAMAGE_FLAG_GUARD_LARGE) ExecEventAllBody("W_GuardDamageMiddle") elseif guard_damage_level == 4 then act(SetKnockbackFlag, DAMAGE_FLAG_GUARD_EXLARGE) ExecEventAllBody("W_GuardDamageLarge") else act(SetKnockbackFlag, DAMAGE_FLAG_GUARD_LARGE) ExecEventAllBody("W_GuardDamageMiddle") end return TRUE else ExecAddDamage(damage_angle, attack_dir, damage_level, TRUE, is_damaged, is_demonsword_justguard) 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(SetKnockbackFlag, 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(GetSpEffectID, 5760) == FALSE then CalcDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_WEAK) act(AddSpEffect, 5760) ExecEventAllBody("W_DamageWeak") Replanning() return TRUE else if env(GetHeroID) == HERO_POWER then if damage_level == DAMAGE_LEVEL_NONE then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 3 elseif damage_level == DAMAGE_LEVEL_MINIMUM then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 5 elseif damage_level == DAMAGE_LEVEL_SMALL then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 15 elseif damage_level == DAMAGE_LEVEL_MIDDLE then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 20 elseif damage_level == DAMAGE_LEVEL_PUSH then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 20 elseif damage_level == DAMAGE_LEVEL_LARGE then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 25 elseif damage_level == DAMAGE_LEVEL_EXLARGE then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 30 elseif damage_level == DAMAGE_LEVEL_EX_BLAST then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 30 elseif damage_level == DAMAGE_LEVEL_SMALL_BLOW then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 30 elseif damage_level == DAMAGE_LEVEL_UPPER then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 30 elseif damage_level == DAMAGE_LEVEL_FLING then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 30 elseif damage_level == DAMAGE_LEVEL_BREATH then POWER_DAMAGE_COUNTER = POWER_DAMAGE_COUNTER + 30 end if POWER_DAMAGE_COUNTER >= 100 and env(GetSpEffectID, 704011) == FALSE then act(AddSpEffect, 704011) end end if IsNodeActive("DamageComatoseSleepLoop_CMSG") == TRUE then ExecEventAllBody("W_DamageComatoseSleepEnd") return TRUE elseif env(GetHeroID) == HERO_POWER and env(GetSpEffectID, 103020) == TRUE and (is_damaged == TRUE or damage_level ~= DAMAGE_LEVEL_NONE) then SetVariable("AddDamageSmashAttackStance_Blend", 1) ExecEventNoReset("W_AddDamageSmashAttackStance") return FALSE 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(SetKnockbackFlag, 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(SetKnockbackFlag, 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(SetKnockbackFlag, 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(SetKnockbackFlag, 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(SetKnockbackFlag, DAMAGE_FLAG_LARGE_BLOW) ExecEventAllBody("W_DamageLV10_ExBlast") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_PUSH then if env(GetBehaviorID, BEH_IDENTIFIER_FOOKSHOTPULL) == TRUE then CalcDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_PUSH, FOOKSHOT_KNOCKBACK_RATE) ExecEventAllBody("W_DamageLv5_Push") Replanning() return TRUE else CalcDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_PUSH) ExecEventAllBody("W_DamageLv5_Push") Replanning() return TRUE end elseif damage_level == DAMAGE_LEVEL_SMALL_BLOW then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_SMALL_BLOW) ExecEventAllBody("W_DamageLv7_SmallBlow") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_UPPER then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_LARGE_BLOW) 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(SetKnockbackFlag, DAMAGE_FLAG_MINIMUM) ExecEventAllBody("W_DamageLv8_Minimum") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_FLING then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_FLING) ExecEventAllBody("W_DamageLv6_Fling") Replanning() return TRUE elseif damage_level == DAMAGE_LEVEL_BREATH then ResetDamageCount() SetVariable("DamageDirection", damage_angle) act(SetKnockbackFlag, DAMAGE_FLAG_BREATH) ExecEventAllBody("W_DamageLv11_Breath") Replanning() return TRUE end end return FALSE end function ExecBirdAct() if env(GetBirdEventID) == 1 then ExecEventAllBody("W_BirdAct_MoveStart") return TRUE elseif env(GetBirdEventID) == 4 then ExecEventAllBody("W_Departure_MoveStart") return TRUE end return FALSE end function ExecRuneBonus() local dT = GetDeltaTime() RUNE_BONUS = RUNE_BONUS + dT local rand = math.random(1, 100) if env(GetSpEffectID, 8970011) == TRUE and RUNE_BONUS > 1.2 then rand = math.random(1, 100) RUNE_BONUS = 0 if rand <= 8 then act(AddSpEffect, 8970012) end end end -- Handle perma boosts to resists from consuming boluses function ExecEnhancedResistance() if ENHANCED_RESISTANCE == 1 then return FALSE end local enhancedResistID = nil if (env(GetSpEffectID, 3060) == TRUE or env(GetSpEffectID, 708450) == TRUE or env(GetSpEffectID, 708453) == TRUE or env(GetSpEffectID, 708455) == TRUE or env(GetSpEffectID, 708458) == TRUE or env(GetSpEffectID, 7050202) == TRUE) and FALSE == env(GetSpEffectID, 540010) then enhancedResistID = 540001 SetVariable("EnhancedResistance_Poison", GetVariable("EnhancedResistance_Poison") + 1) elseif (env(GetSpEffectID, 3070) == TRUE or env(GetSpEffectID, 708470) == TRUE or env(GetSpEffectID, 708473) == TRUE or env(GetSpEffectID, 708475) == TRUE or env(GetSpEffectID, 708478) == TRUE or env(GetSpEffectID, 7050214) == TRUE) and FALSE == env(GetSpEffectID, 540030) then enhancedResistID = 540021 SetVariable("EnhancedResistance_Corruption", GetVariable("EnhancedResistance_Corruption") + 1) elseif (env(GetSpEffectID, 3050) == TRUE or env(GetSpEffectID, 708430) == TRUE or env(GetSpEffectID, 708433) == TRUE or env(GetSpEffectID, 708435) == TRUE or env(GetSpEffectID, 708438) == TRUE or env(GetSpEffectID, 7050205) == TRUE) and FALSE == env(GetSpEffectID, 540050) then enhancedResistID = 540041 SetVariable("EnhancedResistance_Blood", GetVariable("EnhancedResistance_Blood") + 1) elseif (env(GetSpEffectID, 3090) == TRUE or env(GetSpEffectID, 708480) == TRUE or env(GetSpEffectID, 708483) == TRUE or env(GetSpEffectID, 708485) == TRUE or env(GetSpEffectID, 708488) == TRUE or env(GetSpEffectID, 7050217) == TRUE) and FALSE == env(GetSpEffectID, 540070) then enhancedResistID = 540061 SetVariable("EnhancedResistance_Death", GetVariable("EnhancedResistance_Death") + 1) elseif (env(GetSpEffectID, 3092) == TRUE or env(GetSpEffectID, 708490) == TRUE or env(GetSpEffectID, 708493) == TRUE or env(GetSpEffectID, 708495) == TRUE or env(GetSpEffectID, 708498) == TRUE or env(GetSpEffectID, 7050208) == TRUE) and FALSE == env(GetSpEffectID, 540090) then enhancedResistID = 540081 SetVariable("EnhancedResistance_Frostbite", GetVariable("EnhancedResistance_Frostbite") + 1) elseif (env(GetSpEffectID, 3055) == TRUE or env(GetSpEffectID, 708440) == TRUE or env(GetSpEffectID, 708443) == TRUE or env(GetSpEffectID, 708445) == TRUE or env(GetSpEffectID, 708448) == TRUE or env(GetSpEffectID, 7050211) == TRUE) and FALSE == env(GetSpEffectID, 5400110) then enhancedResistID = 540101 SetVariable("EnhancedResistance_Sleep", GetVariable("EnhancedResistance_Sleep") + 1) elseif (env(GetSpEffectID, 3065) == TRUE or env(GetSpEffectID, 708460) == TRUE or env(GetSpEffectID, 708463) == TRUE or env(GetSpEffectID, 708465) == TRUE or env(GetSpEffectID, 708468) == TRUE or env(GetSpEffectID, 7050219) == TRUE) and FALSE == env(GetSpEffectID, 540130) then enhancedResistID = 540121 SetVariable("EnhancedResistance_Madness", GetVariable("EnhancedResistance_Madness") + 1) else return end if env(GetSpEffectID, enhancedResistID + 9) == TRUE then elseif env(GetSpEffectID, enhancedResistID + 8) == TRUE then act(AddSpEffect, enhancedResistID + 9) elseif env(GetSpEffectID, enhancedResistID + 7) == TRUE then act(AddSpEffect, enhancedResistID + 8) elseif env(GetSpEffectID, enhancedResistID + 6) == TRUE then act(AddSpEffect, enhancedResistID + 7) elseif env(GetSpEffectID, enhancedResistID + 5) == TRUE then act(AddSpEffect, enhancedResistID + 6) elseif env(GetSpEffectID, enhancedResistID + 4) == TRUE then act(AddSpEffect, enhancedResistID + 5) elseif env(GetSpEffectID, enhancedResistID + 3) == TRUE then act(AddSpEffect, enhancedResistID + 4) elseif env(GetSpEffectID, enhancedResistID + 2) == TRUE then act(AddSpEffect, enhancedResistID + 3) elseif env(GetSpEffectID, enhancedResistID + 1) == TRUE then act(AddSpEffect, enhancedResistID + 2) elseif env(GetSpEffectID, enhancedResistID) == TRUE then act(AddSpEffect, enhancedResistID + 1) else act(AddSpEffect, enhancedResistID) end end function ExecSprintStart() if IsNodeActive("GroundNonCombatArea_Upper_SM") == TRUE then return FALSE end if IsDemonSwordMode() == TRUE then ISENABLE_DEMONSWORDSTANCE_TO_SPRINTSTART = TRUE ExecEventHalfBlend(Event_DemonSwordStanceEnd, UPPER) return TRUE end if IsSummonNecromanceMode() and (IsNodeActive("NecromanceModeLoop_Upper Selector") == TRUE or IsNodeActive("NecromanceModeStart_CMSG00") == TRUE) then ISENABLE_SPRINTSTOP = FALSE act(LockonFixedAngleCancel) ExecEventAllBody("W_SprintStart") return TRUE end if env(GetSpEffectID, 701530) == TRUE then return FALSE end if env(GetStateChangeType, CONDITION_TYPE_NIGHT) == TRUE and env(GetSpEffectID, 100020) == TRUE then return FALSE end local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_MOVE then if IsNodeActive("Move_Upper Selector") == TRUE then ISENABLE_SPRINTSTOP = FALSE if IsNodeActive("FookShotFire_Walk_Upper_CMSG") == FALSE then act(LockonFixedAngleCancel) end ExecEventAllBody("W_SprintStart") return TRUE end else ISENABLE_SPRINTSTOP = FALSE if IsNodeActive("FookShotFire_Walk_Upper_CMSG") == FALSE then act(LockonFixedAngleCancel) end ExecEventAllBody("W_SprintStart") return TRUE end end function ExecFookShotModeEnd() SetVariable("AddFookShotBlend", 0) SetVariable("AddFookShotBlendSelector", 0) end function GetLandIndex(height, is_jump) if 8 < height then return LAND_HEAVY elseif is_jump == TRUE and height > 0 then return LAND_JUMP else return LAND_DEFAULT end end function GetLandIndex2(height, is_jump) if 10 < height then return LAND_ROLLING elseif is_jump == TRUE and height > 1.5 then return LAND_SPEEDUP else return LAND_DEFAULT end end function FallCommonFunction(is_enable_falling_death, is_jump, fall_style) SprintUpdate() local height = env(GetFallHeight) / 100 local damage_type = env(GetReceivedDamageType) local style = c_Style if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecAttackerUltCounterReset() 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 ExecAttackerUltCounterReset() 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 ExecDamage(FALSE, FALSE) == TRUE then return TRUE end if ExecBirdAct() == TRUE then return TRUE end if ExecFookShot() == TRUE then return TRUE end act(SetCanChangeEquipmentOn) if env(IsLanding) == TRUE then IS_ATTACKED_JUMPMAGIC = FALSE ExecAttackerUltCounterReset() 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 if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end return TRUE else if height > 1.3 then local landIndex = GetLandIndex(height, is_jump) local landIndex2 = GetLandIndex2(height, is_jump) SetVariable("LandIndex", landIndex) SetVariable("LandIndex2", landIndex2) Replanning() local JumpMoveLevel = 0 if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end if JUMPS == 1 and GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 3 end if SetSlowFeet() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 3 then ExecEventNoReset("W_Jump_Land_To_Sprint") return elseif JumpMoveLevel >= 1 and landIndex == LAND_HEAVY then ExecEvasion(FALSE, ESTEP_LAND, FALSE) return TRUE elseif 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 SetVariable("LandToMoveIndex", 0) ExecEventAllBody("W_Land") end else act(Unknown9999) if height > 0.3 then ExecEventAllBody("W_LandLow") else ExecEventAllBody("W_Idle") end end return TRUE end elseif fall_style == FALL_FACEUP then if IsLandDead(height) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_LAND_FACEUP) if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end 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) if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end else Replanning() ExecEventAllBody("W_LandFaceDown") end return TRUE elseif fall_style == FALL_LADDER then if IsLandDead(height) == TRUE then SetVariable("IndexDeath", DEATH_TYPE_LAND) if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end 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, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) g_ArrowSlot = ARROW_SLOT_SMALL elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) g_ArrowSlot = ARROW_SLOT_SMALL end end if fall_style ~= FALL_DEFAULT or not (height >= 0.2) or GetVariable("AddFookShotBlend") == 1 then elseif ExecAirUlt() == TRUE then return TRUE elseif ExecFallMagic() == TRUE then return TRUE elseif ExecFallItem() == TRUE then return TRUE elseif ExecFallAttack() == TRUE then return TRUE end return FALSE end function BirdActCommonFunction(move_style, is_start) SetAIActionState() act(DisallowAdditiveTurning, TRUE) local height = env(GetFallHeight) / 100 local damage_type = env(GetReceivedDamageType) local style = c_Style SetVariable("AddBirdActMoveLoop_Up", env(GetBirdMovementDirectionTime, 0) / 10000) SetVariable("AddBirdActMoveLoop_Down", env(GetBirdMovementDirectionTime, 1) / 10000) SetVariable("AddBirdActMoveLoop_Left", env(GetBirdMovementDirectionTime, 2) / 10000) SetVariable("AddBirdActMoveLoop_Right", env(GetBirdMovementDirectionTime, 3) / 10000) local turn_angle = hkbGetVariable("TurnAngle") local add_left = GetVariable("AddBirdActFallLoop_Left") local add_right = GetVariable("AddBirdActFallLoop_Right") if turn_angle > 0 and turn_angle <= 180 then if add_right < 1 then SetVariable("AddBirdActFallLoop_Right", add_right + 0.1) end if add_left > 0 then SetVariable("AddBirdActFallLoop_Left", add_left - 0.1) end elseif turn_angle < 0 and turn_angle >= -180 then if add_left < 1 then SetVariable("AddBirdActFallLoop_Left", add_left + 0.1) end if add_right > 0 then SetVariable("AddBirdActFallLoop_Right", add_right - 0.1) end else if add_left > 0 then SetVariable("AddBirdActFallLoop_Left", add_left - 0.1) end if add_right > 0 then SetVariable("AddBirdActFallLoop_Right", add_right - 0.1) end end local is_dead = FALSE if env(GetHP) <= 0 then is_dead = TRUE end if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_FallDeath") return TRUE elseif is_dead == TRUE and move_style ~= MOVE_SEPARATION then ExecEventAllBody("W_BirdAct_SeparationFallStart") return TRUE end if ExecDamage(FALSE, FALSE) == TRUE then return TRUE end if ExecBirdAct() == TRUE then return TRUE end if env(GetBirdActionID) == 1 and (move_style == MOVE_BIRDACT or move_style == MOVE_DEPARTURE) then ExecEventAllBody("W_BirdAct_SeparationFallStart") return TRUE end if env(GetBirdActionID) == 2 and is_start == FALSE then if is_dead == TRUE then if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end elseif move_style == MOVE_BIRDACT then ExecEventNoReset("W_BirdAct_FallEnd") elseif move_style == MOVE_DEPARTURE then ExecEventNoReset("W_Departure_FallEnd") end return TRUE end if env(IsTruelyLanding) == TRUE and is_start == FALSE then local landIndex = GetLandIndex(height, FALSE) local landIndex2 = GetLandIndex2(height, FALSE) SetVariable("LandIndex", landIndex) SetVariable("LandIndex2", landIndex2) if is_dead == TRUE then if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end elseif move_style == MOVE_BIRDACT then ExecEventNoReset("W_BirdAct_FallEnd") return elseif move_style == MOVE_DEPARTURE then ExecEventNoReset("W_Departure_FallEnd") return elseif move_style == MOVE_SEPARATION then ExecEventNoReset("W_Jump_Land_To_Sprint") return else ExecEventNoReset("W_Jump_Land_To_Sprint") return end end if is_dead == FALSE then 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, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) g_ArrowSlot = ARROW_SLOT_SMALL elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) g_ArrowSlot = ARROW_SLOT_SMALL end end if not (height >= 0.2) or GetVariable("AddFookShotBlend") == 1 then elseif ExecAirUlt() == TRUE then return TRUE elseif ExecFallMagic() == TRUE then return TRUE elseif ExecFallItem() == TRUE then return TRUE elseif ExecFallAttack() == TRUE then return TRUE end if move_style == MOVE_SEPARATION and ExecFookShot() == TRUE then return TRUE end end return 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 sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) 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 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 if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 3) else SetVariable("JumpAttackForm", 3) SetVariable("JumpAttackFormRequest", 2) end 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 if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 0) end elseif style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end elseif style == HAND_LEFT_BOTH then local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 3) elseif ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) 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 IsDemonSwordMode() == TRUE then if env(ActionRequest, ACTION_ARM_L1) == TRUE then if ExecGuard(Event_GuardStart, blend_type) == TRUE then return TRUE end elseif env(IsGuardFromAtkCancel) == FALSE then return FALSE end elseif env(IsGuardFromAtkCancel) == FALSE then return FALSE end act(DebugLogOutput, "ExecGuardOnCancelTiming " .. guardcondition) 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then LadderSetActionState(LADDER_ACTION_INVALID) 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, STATUS_EFFECT_DEATH) == 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, STATUS_EFFECT_SLEEP) == 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() act(Unknown2080) if env(HasDodgedThrowAttack) == TRUE then ExecEvent("W_ThrowCounter") return TRUE end 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, 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 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_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if ExecAttack(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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 if IsDemonSwordMode() == TRUE and env(ActionDuration, ACTION_ARM_L3) > 0 then ExecEventHalfBlend(Event_DemonSwordStanceEnd, ALLBODY) 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) SetAIActionState() local bool = FALSE if guardcondition == TO_GUARDON then bool = TRUE end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, bool, 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 if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end 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 ExecMagic(QUICKTYPE_ATTACK, ALLBODY, 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(guardcondition, ALLBODY) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, 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, 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 ExecAttack("W_AttackRightLight2", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_ATTACK, ALLBODY, 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, gen_hand) 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 if ExecBirdAct() == TRUE then return TRUE end end if env(GetThrowFreedomType) == 0 then ExecEventAllBody("W_FallStartFaceUp") return TRUE elseif env(GetThrowFreedomType) == 1 then ExecEventAllBody("W_FallStartFaceDown") return TRUE elseif env(GetThrowFreedomType) == 2 then SetVariable("DamageDirection", 2) ExecEventAllBody("W_DamageLv5_Push") return TRUE elseif env(GetThrowFreedomType) == 3 then SetVariable("DamageDirection", 3) ExecEventAllBody("W_DamageLv5_Push") return TRUE elseif env(GetThrowFreedomType) == 4 then SetVariable("DamageDirection", 2) ExecEventAllBody("W_DamageLv7_SmallBlow") return TRUE elseif env(GetThrowFreedomType) == 5 then SetVariable("DamageDirection", 3) ExecEventAllBody("W_DamageLv7_SmallBlow") return TRUE end if env(GetSpEffectID, 99820) == TRUE then ExecEventAllBody("W_Idle") return TRUE 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_MoveQuick, gen_hand) == TRUE then return TRUE end return FALSE end function GestureCommonFunction(blend_type) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and ExecQuickTurn(LOWER, TURN_TYPE_DEFAULT) == TRUE then return TRUE end if is_start == TRUE and env(GetEventEzStateFlag, 0) == FALSE then return FALSE end if ExecEvasion(FALSE, ESTEP_NONE, FALSE) == TRUE then return TRUE end local canmove = TRUE if GetVariable("IndexGestureLoop") == 0 then canmove = FALSE end if env(GetEventEzStateFlag, 0) == TRUE and 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 return FALSE end function MagicCommonFunction(blend_type, quick_type, is_throw) SetVariable("ToggleDash", 0) if 0 >= GetVariable("MoveSpeedLevel") then act(FallPreventionAssist) end SetAIActionState() act(SetIsMagicInUse, TRUE) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 if ExecMagic(QUICKTYPE_NORMAL, blend_type, 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, 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_ATTACK, blend_type, FALSE) == TRUE then return TRUE end if ExecGuardOnCancelTiming(FALSE, blend_type) == TRUE then return TRUE end if is_stance_end == TRUE and ExecArtsStanceOnCancelTiming(blend_type) == 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 return FALSE end function SummonNecromanceCommonFunction(blend_type, is_allbody_turn, turn_type, is_stance_end) SetAIActionState() SetThrowAtkInvalid() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 ExecSummon() == TRUE then return end if ExecJump() == 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 if env(ActionRequest, ACTION_ARM_SKILL) == TRUE then ExecEventHalfBlend(Event_NecromanceModeFinish, blend_type) return end return FALSE end function PhotoShootCommonFunction(blend_type, is_allbody_turn, turn_type, is_stance_end) SetAIActionState() SetThrowAtkInvalid() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 ExecPhotoShoot() == TRUE then return end if ExecJump() == 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 if env(ActionRequest, ACTION_ARM_SKILL) == TRUE then ExecEventHalfBlend(Event_PhotoShootFinish, blend_type) return end return FALSE end function CrossbowCommonFunction(blend_type, is_nonturn) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 ExecMagic(QUICKTYPE_NORMAL, blend_type, 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 AirFookShotCommonFunction(r1, r2, l1, l2, b1, b2, guardcondition, use_atk_queue, comboCount, gen_hand) SetVariable("RightArmAddWeight_a02", 0) if gen_hand == nil then gen_hand = FALSE end SetVariable("ToggleDash", 0) act(FallPreventionAssist) SetAIActionState() local bool = FALSE if guardcondition == TO_GUARDON then bool = TRUE end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, bool, 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 if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end 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 ExecMagic(QUICKTYPE_ATTACK, ALLBODY, 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(guardcondition, ALLBODY) == TRUE then return TRUE end if ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, gen_hand) == TRUE then return TRUE end if ExecGesture() == TRUE then return TRUE 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, gen_trans) SetAIActionState() SetEnableAimMode() if ExecPassiveAction(FALSE, fall_type, FALSE, FALSE) == TRUE then return TRUE end if env(HasDodgedThrowAttack) == TRUE then ExecEvent("W_ThrowCounter") return TRUE end if ExecJump() == TRUE then return TRUE end if env(GetSpEffectID, 5031) == FALSE and 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 ExecArtsStanceOnCancelTiming(ALLBODY) == TRUE then return TRUE end if env(GetSpEffectID, 701530) == TRUE then if ExecAttack(r1, r2, l1, l2, b1, b2, TRUE, ALLBODY, FALSE, FALSE, TRUE) == TRUE then return TRUE end elseif ExecAttack(r1, r2, l1, l2, b1, b2, FALSE, ALLBODY, FALSE, FALSE, TRUE) == TRUE then return TRUE end if ExecMagic(quick_type, ALLBODY, FALSE) == TRUE then return TRUE end if gen_trans == AttackArrow then if MoveStartonCancelTiming(Event_MoveLong, AttackArrow) == TRUE then return TRUE end elseif MoveStartonCancelTiming(Event_MoveLong, FALSE) == TRUE then return TRUE end return FALSE end function DamageCommonFunction(guardcondition, estep, fall_type) if ExecPassiveAction(FALSE, fall_type, FALSE, FALSE) == TRUE then return TRUE end SetVariable("ToggleDash", 0) SetEnableAimMode() 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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(AllowBuddyWarp) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 ExecMagic(QUICKTYPE_NORMAL, UPPER, FALSE) == TRUE then return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return TRUE end return FALSE end function LandCommonFunction() SprintUpdate() if IsNodeActive("LandHeavyToMove_CMSG") == TRUE then 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 else if GetVariable("LandToMoveIndex") == 0 and GetVariable("MoveSpeedLevel") > 0 then SetVariable("LandToMoveIndex", 1) end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, 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 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 end return FALSE end function ItemCommonFunction(blend_type, is_end) if env(GetStateChangeType, 15) == FALSE then act(SetIsItemAnimationPlaying) end SetVariable("ToggleDash", 0) if 0 >= GetVariable("MoveSpeedLevel") then act(FallPreventionAssist) end SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 if (c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH) and is_end == TRUE and env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Idle") return TRUE end return FALSE end function StealthItemCommonFunction(blend_type) act(SetIsItemAnimationPlaying) SetVariable("ToggleDash", 0) if 0 >= GetVariable("MoveSpeedLevel") then act(FallPreventionAssist) end SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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, 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, 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 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_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if ExecAttack(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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) if IsNodeActive("RunFrontLight_Rolling_To_Run_CMSG") == TRUE or IsNodeActive("RunFrontLight_Rolling_To_Dash_CMSG") == TRUE then else act(Wait) end act(AllowBuddyWarp) SetEnableAimMode() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 TRUE == IsTranceMode() then if speed == 3 then if ExecItem(QUICKTYPE_DASH, blend_type) == TRUE then return TRUE end elseif speed == 2 then if env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then if ExecItem(QUICKTYPE_DASH, blend_type) == TRUE then return TRUE end elseif ExecItem(QUICKTYPE_RUN, 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 == 3 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" elseif speed == 2 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" elseif c_IsStealth == TRUE then r1 = "W_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if ExecAttack(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, UPPER, FALSE, FALSE, FALSE) == TRUE then return TRUE elseif speed == 3 then if ExecMagic(QUICKTYPE_DASH, blend_type, FALSE) == TRUE then return TRUE end elseif speed == 2 and env(ESD_ENV_DS3ActionDuration, ACTION_ARM_SP_MOVE) > 0 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 else 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 == 3 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" elseif speed == 2 then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" elseif c_IsStealth == TRUE then r1 = "W_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if ExecAttack(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, UPPER, FALSE, FALSE, FALSE) == TRUE then return TRUE elseif 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 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) act(Wait) if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 or env(GetSpEffectID, 701530) == TRUE then elseif 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("MoveSpeedLevelReal") > 1.1 then if ExecAttack("W_AttackRightLightDash", "W_AttackRightHeavyDash", nil, "W_AttackLeftHeavy1", "W_AttackBothDash", "W_AttackBothHeavyDash", FALSE, UPPER, FALSE, FALSE, FALSE) == TRUE then return TRUE end else local guard_attack = TRUE if is_guard_end == TRUE then guard_attack = FALSE end if ExecAttack("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", guard_attack, blend_type, FALSE, FALSE, FALSE) == TRUE then return TRUE end end if 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 is_guard_end == FALSE then if env(ActionDurationAlternate, ACTION_ARM_L1) <= 0 or env(GetSpEffectID, 9621) == TRUE then if env(GetSpEffectID, 701530) == TRUE then if IsNodeActive("ResonanceGuardStart_CMSG") == TRUE then else ExecEventAllBody("W_ResonanceGuardEnd") return TRUE end elseif env(GetSpEffectID, 707010) == TRUE then else ExecEventHalfBlendNoReset(Event_GuardEnd, blend_type) return TRUE end end if env(GetSpEffectID, 701530) == TRUE and env(GetStamina) <= 0 then ExecEventAllBody("W_ResonanceGuardEnd") return TRUE end elseif env(ActionRequest, ACTION_ARM_L1) ~= TRUE and not (env(ActionDuration, ACTION_ARM_L1) > 0) or env(GetSpEffectID, 707010) == TRUE then elseif 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) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 ExecArtsStanceOnCancelTiming(blend_type) == TRUE then ClearAttackQueue() return TRUE end if ExecAttack(r1, r2, l1, l2, b1, b2, guardcondition, blend_type, artsr1, artsr2, FALSE) == TRUE then ClearAttackQueue() return TRUE end if ExecMagic(QUICKTYPE_ATTACK, blend_type, 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 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 if c_SwordArtsID ~= 335 and ExecGuardOnCancelTiming(guardcondition, blend_type) == TRUE then ClearAttackQueue() return TRUE end return FALSE end function ArtsParryCommonFunction() SetAIActionState() if ExecPassiveAction(TRUE, FALL_TYPE_DEFAULT, FALSE, 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 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 ExecMagic(QUICKTYPE_ATTACK, ALLBODY, 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) SetAIActionState() if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, FALSE) == TRUE then return TRUE end if blend_type ~= UPPER and enable_turn == TRUE and ExecQuickTurn(LOWER, turn_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 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, 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() -- Relic Effect: Switching Weapons Adds an Affinity Attack if env(GetSpEffectID, 7035700) == TRUE and env(GetSpEffectID, 7035701) == TRUE -- Trigger and env(GetSpEffectID, 7035718) == FALSE and env(GetSpEffectID, 7035719) == FALSE and env(GetSpEffectID, 7035720) == FALSE and env(GetSpEffectID, 7035721) == FALSE then local rand = math.random(1, 100) -- Apply Magic buff if rand >= 75 then act(AddSpEffect, 7035718) -- Cooldown if RELIC_WEAPONCHANGE_ENCHANT == 0 then act(AddSpEffect, 7035702) -- Right else act(AddSpEffect, 7035704) -- Left end -- Apply Fire buff elseif rand >= 50 then act(AddSpEffect, 7035719) -- Cooldown if RELIC_WEAPONCHANGE_ENCHANT == 0 then act(AddSpEffect, 7035706) -- Right else act(AddSpEffect, 7035708) -- Left end -- Apply Lightning buff elseif rand >= 25 then act(AddSpEffect, 7035720) -- Cooldown if RELIC_WEAPONCHANGE_ENCHANT == 0 then act(AddSpEffect, 7035710) -- Right else act(AddSpEffect, 7035712) -- Left end -- Apply Holy buff else act(AddSpEffect, 7035721) -- Cooldown if RELIC_WEAPONCHANGE_ENCHANT == 0 then act(AddSpEffect, 7035714) -- Right else act(AddSpEffect, 7035716) -- Left end end end if ExecPassiveAction(FALSE, FALL_TYPE_DEFAULT, FALSE, 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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, 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 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 ExecMagic(QUICKTYPE_NORMAL, blend_type, 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, 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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) ExecFookShotModeEnd() 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 ExecNearDeath() == TRUE then return TRUE end if ExecDeath() == TRUE then return TRUE end if ExecTalkDamage() == TRUE then return TRUE end if ExecDamage(FALSE) == TRUE then return TRUE end if ExecBirdAct() == 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 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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 local move_event = Event_Move if MoveStart(LOWER, move_event, FALSE) == TRUE then return end end if lower_state == LOWER_END_TURN then ExecEventHalfBlendNoReset(event, LOWER) return end end end function ArrowHalfBlendCommonFunction(event, hand_left) local blend_type, lower_state = GetHalfBlendInfo() if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(event, lower_state, FALSE) == TRUE then return end else if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetArrowGeneratorTransitionIndex(hand_left) return end if lower_state == LOWER_END_TURN then if ArrowLowerCommonFunction(event, lower_state, FALSE) == TRUE then return end elseif ArrowLowerCommonFunction(event, lower_state, FALSE) == TRUE then return end end end function ArrowAllBodyCommonFunction(hand_left) if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH then return elseif env(IsAnimEnd, 0) == TRUE then SetArrowGeneratorTransitionIndex(hand_left) ExecEventAllBody("W_Idle") return end end function NearDeathCommonFunction() act(SetAllowedThrowDefenseType, 255) SetVariable("IsAutoRevival", 0) local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_NearDeathEnd") return TRUE end -- Die near death is disabled if env(GetSpEffectID, 102130) == TRUE then ExecEventAllBody("W_NearDeathEnd") return TRUE elseif env(GetSpEffectID, 102145) == TRUE then ExecEventAllBody("W_NearDeathEnd") return TRUE else if env(GetSpEffectID, 102121) == TRUE then ExecEventAllBody("W_NearDeathRevival") return TRUE end -- Die when near death timer expires if env(GetNearDeathTime) <= 0 and env(GetSpEffectID, 102120) == FALSE then ExecEventAllBody("W_NearDeathEnd") return TRUE end -- Revive when near death gauge is depleted if env(GetNearDeathHealth) <= 0 and env(GetSpEffectID, 102455) == FALSE then ExecEventAllBody("W_NearDeathRevival") return TRUE end -- Revive upon Immortal March, Solo Auto Revive, Favor of Noklateo, or Wending Grace -- Or Power to Balance the Word if env(GetSpEffectID, 705020) == TRUE or env(GetSpEffectID, 6999505) == TRUE or env(GetSpEffectID, 6999105) == TRUE or env(GetSpEffectID, 540150) == TRUE or env(GetSpEffectID, 8970061) == TRUE then if env(GetSpEffectID, 8970061) == TRUE then SetVariable("IsAutoRevival", 1) end ExecEventAllBody("W_NearDeathRevival") return TRUE end if 0 < GetVariable("MoveSpeedLevel") and env(IsMoveCancelPossible) == TRUE then ExecEventAllBody("W_NearDeathMove") return TRUE end if env(GetSpEffectID, 102110) == TRUE then ExecEventAllBody("W_NearDeathIdle") return TRUE end end end function NearDeathRevivalCommonFunction() if ExecPassiveAction(FALSE, fall_type, FALSE, TRUE) == TRUE then return TRUE end SetVariable("ToggleDash", 0) SetEnableAimMode() 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 if ExecItem(QUICKTYPE_NORMAL, ALLBODY) == 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 ExecMagic(QUICKTYPE_NORMAL, ALLBODY, 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 Idle_onActivate() SetVariable("MoveSpeedLevelReal", 0) ClearAttackQueue() act(Wait) act(RequestThrowAnimInterrupt) act(DisallowAdditiveTurning, TRUE) act(Unknown2080) end function Idle_onUpdate() SetEnableMimicry() if ExecGroundNonCombatAreaEnter(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGroundNonCombatAreaLeave(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if IdleCommonFunction() == TRUE then SetVariable("ArtsTransition", 0) return end end function Idle_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function SprintStop_onActivate() act(Wait) ChangeMoveSpeedIndex(0) end function SprintStop_onUpdate() if StopCommonFunction(TRUE) == TRUE then return end 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 Sprint180_onActivate() act(SetIsTurnAnimInProgress) ChangeMoveSpeedIndex(3) end function Sprint180_onUpdate() if env(GetSpEffectID, 5030) == TRUE then act(SetIsTurnAnimInProgress) act(SetTurnAnimCorrectionRate, 180) end if QuickTurnCommonFunction() == TRUE then return end if env(GetSpEffectID, 102000) == FALSE then ChangeMoveSpeedIndex(0) end end function SprintStart_onActivate() act(SwitchMotion, TRUE) AddStamina(STAMINA_REDUCE_SPRINTSTART) end function SprintStart_onUpdate() act(LockonFixedAngleCancel) act(SwitchMotion, TRUE) SpeedUpdate() if QuickTurnCommonFunction() == TRUE then return end if env(GetSpEffectID, 102030) == TRUE and MoveStart(ALLBODY, Event_Move, FALSE) == TRUE then return TRUE end if ExecStop() == TRUE then return end end function Rolling_onActivate() SetVariable("AddFookShotBlend", 0) SetVariable("AddFookShotBlendSelector", 0) end function Rolling_onUpdate() if GetVariable("RollingVariationIndex") == ROLLING_FOOKSHOT then act(SetMovementScaleMult, 1.5) end -- Implemented a bandaid fix for a strange bug where back dodging once with Duchess resulted in back dodging towards the target local speed_back = FALSE if GetVariable("RollingVariationIndex") == ROLLING_SPEED and GetVariable("RollingDirectionIndex_SelfTrans") == 1 then speed_back = TRUE end if env(GetSpEffectID, 703555) == TRUE and speed_back == FALSE then act(LockonFixedAngleCancel) end if GetVariable("RollingVariationIndex") == ROLLING_CHEATDEATH then act(FallPreventionAssist) end act(DisallowAdditiveTurning, TRUE) if IsDemonSwordMode() == FALSE then SetThrowAtkInvalid() end 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 env(GetHeroID) == HERO_SPEED then 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 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) end function Rolling_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Rolling_Selftrans_onActivate() SetVariable("AddFookShotBlend", 0) SetVariable("AddFookShotBlendSelector", 0) end function Rolling_Selftrans_onUpdate() -- Implemented a bandaid fix for a strange bug where back dodging once with Duchess resulted in back dodging towards the target -- This one's harder to pull off so less of a deal, and occurs in vanilla too local speed_back = FALSE if GetVariable("RollingVariationIndex") == ROLLING_SPEED and GetVariable("RollingDirectionIndex") == 1 then speed_back = TRUE end if env(GetSpEffectID, 703555) == TRUE and speed_back == FALSE then act(LockonFixedAngleCancel) end act(DisallowAdditiveTurning, TRUE) if IsDemonSwordMode() == FALSE then SetThrowAtkInvalid() end 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() 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 end SetRollingTurnCondition(TRUE) end function Rolling_Selftrans_onDeactivate() act(DisallowAdditiveTurning, FALSE) end -- Duchess performing first dodge from another dodge function Rolling_Selftrans2_onUpdate() -- Implemented a bandaid fix for a strange bug where back dodging once with Duchess resulted in back dodging towards the target -- This one's harder to pull off so less of a deal, and occurs in vanilla too local speed_back = FALSE if GetVariable("RollingVariationIndex") == ROLLING_SPEED and GetVariable("RollingDirectionIndex") == 1 then speed_back = TRUE end if env(GetSpEffectID, 703555) == TRUE and speed_back == FALSE then act(LockonFixedAngleCancel) end act(DisallowAdditiveTurning, TRUE) SetThrowAtkInvalid() if env(GetSpEffectID, 100390) == TRUE then ResetDamageCount() end SetEnableAimMode() local r1 = "W_AttackRightLightStep" if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end SetRollingTurnCondition(FALSE) end function Rolling_Selftrans2_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 env(GetHeroID) == HERO_SPEED then 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 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 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") return 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() if IsNodeActive("GroundNonCombatArea_Upper_SM") == TRUE then if env(GetSpEffectID, 100000) == TRUE or env(GetSpEffectID, 100001) == TRUE or env(GetSpEffectID, 100002) == TRUE then SetVariable("PoseAnime_Addtive_LeftLeg", 0) SetVariable("PoseAnime_Addtive_RightLeg", 0) elseif env(GetSpEffectID, 100006) == TRUE or env(GetSpEffectID, 100007) == TRUE then return else SetVariable("PoseAnime_Addtive_LeftLeg", ConvergeValue(1, hkbGetVariable("PoseAnime_Addtive_LeftLeg"), 5, 5)) SetVariable("PoseAnime_Addtive_RightLeg", ConvergeValue(1, hkbGetVariable("PoseAnime_Addtive_RightLeg"), 5, 5)) end end end function Move_onActivate() act(SwitchMotion, TRUE) end function Move_onUpdate() act(SwitchMotion, TRUE) local move_speed = GetVariable("MoveSpeedIndex") 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 elseif move_speed == 0 then npc_turn_speed = 180 else local dir = GetVariable("MoveDirection") if dir == 0 then npc_turn_speed = 90 end end SetTurnSpeed(npc_turn_speed) end if hkbGetVariable("MoveDirection") == 3 or hkbGetVariable("MoveDirection") == 2 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 1 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 0 then act(SetMovementScaleMult, 0.98) end end function MoveNoSync_onActivate() act(SwitchMotion, TRUE) end function MoveNoSync_onUpdate() Move_onUpdate() end function Move_Upper_onActivate() act(Wait) end function Move_Upper_onUpdate() SetEnableMimicry() if ExecGroundNonCombatAreaEnter(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGroundNonCombatAreaLeave(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if MoveCommonFunction(UPPER) == TRUE then SetVariable("ArtsTransition", 0) return 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) end function Guard_Update() BanSprint() end function GuardStart_Upper_onActivate() act(Wait) end function GuardStart_Upper_onUpdate() act(SetCanChangeEquipmentOff) 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 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() act(SetCanChangeEquipmentOff) 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 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 Event_MoveQuick = {"W_MoveQuick", MOVE_DEF0} function GuardEnd_Upper_onUpdate() act(SetCanChangeEquipmentOff) 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) == 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 FallStart_onActivate() SetVariable("JumpAttackForm", 0) act(AddSpEffect, 99201) 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(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if 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(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if 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(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if 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_ALL) ExecFookShotModeEnd() end function Damage_Update() UpdateRightArmAdd() end function Damage_NoThrowDef_Update() if env(GetSpEffectID, 30) == 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 DamageComatoseSleep_onUpdate() act(SetAllowedThrowDefenseType, 255) if env(GetSpEffectID, 102130) == FALSE and DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_DamageComatoseSleepLoop") return TRUE end end function DamageComatoseSleepLoop_onUpdate() act(SetAllowedThrowDefenseType, 255) if env(GetSpEffectID, 102130) == FALSE and DamageCommonFunction(FALSE, ESTEP_NONE, FALL_TYPE_FORCE) == TRUE then return end if env(GetSpEffectID, 25100) == FALSE and env(GetSpEffectID, 25101) == FALSE and env(GetSpEffectID, 25102) == FALSE and env(GetSpEffectID, 25103) == FALSE and env(GetSpEffectID, 25105) == FALSE and env(GetSpEffectID, 25106) == FALSE then ExecEventAllBody("W_DamageComatoseSleepEnd") return TRUE end end function DamageComatoseSleepEnd_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 DamageParasite_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_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardDamageMiddle_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardDamageLarge_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardDamageDemonSword_Start_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end end function GuardDamageDemonSword_End_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(TO_GUARDON, ESTEP_NONE, FALL_TYPE_DEFAULT) == TRUE then return end 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 Death_Activate() ExecFookShotModeEnd() end function DeathIdle_onActivate() act(SetDeathStay, TRUE) end function DeathIdle_onDeactivate() act(SetDeathStay, FALSE) end function NearDeath_Activate() ExecFookShotModeEnd() end function NearDeathStart_onActivate() ResetRightArmAdd() -- Clear Immortal March Revive act(AddSpEffect, 705021) act(AddSpEffect, 7010909) act(AddSpEffect, 42206) -- Cure all statuses act(AddSpEffect, 30101) ISENABLE_NEARDEATHREVIVAL = FALSE end function NearDeathStart_onUpdate() act(SetAllowedThrowDefenseType, 255) SetVariable("IsAutoRevival", 0) local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_NearDeathEnd") return TRUE end if env(GetSpEffectID, 102100) == TRUE and env(GetNearDeathHealth) <= 0 and env(GetSpEffectID, 102455) == FALSE then ISENABLE_NEARDEATHREVIVAL = TRUE end if env(GetEventEzStateFlag, 0) == TRUE and ISENABLE_NEARDEATHREVIVAL == TRUE then ExecEventAllBody("W_NearDeathRevival") return TRUE end if (env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE) and env(GetSpEffectID, 102140) == TRUE then ExecEventAllBody("W_NearDeathEnd") return TRUE end if env(GetSpEffectID, 102115) == TRUE then SetVariable("IndexNearDeathStartToIdle", 0) ExecEventAllBody("W_NearDeathStartToIdle") return TRUE elseif env(GetSpEffectID, 102116) == TRUE then SetVariable("IndexNearDeathStartToIdle", 1) ExecEventAllBody("W_NearDeathStartToIdle") return TRUE end end function NearDeathStartToIdle_onActivate() ResetRightArmAdd() end function NearDeathStartToIdle_onUpdate() NearDeathCommonFunction() end function NearDeathIdle_onActivate() ResetRightArmAdd() end function NearDeathIdle_onUpdate() NearDeathCommonFunction() end function NearDeathRevival_onActivate() SetVariable("IndexNearDeath", 0) SetVariable("ThrowDeathState", 0) ActivateRightArmAdd(START_FRAME_A02) ISENABLE_NEARDEATHREVIVAL = FALSE if env(GetSpEffectID, 7010905) == TRUE then act(AddSpEffect, 7010906) end end function NearDeathRevival_onUpdate() UpdateRightArmAdd() NearDeathRevivalCommonFunction() end function Item_NearDeathRevival_onActivate() SetVariable("IndexNearDeath", 0) SetVariable("ThrowDeathState", 0) ActivateRightArmAdd(START_FRAME_A02) ISENABLE_NEARDEATHREVIVAL = FALSE end function Item_NearDeathRevival_onUpdate() UpdateRightArmAdd() NearDeathRevivalCommonFunction() end function NearDeathEnd_onActivate() SetVariable("IndexNearDeath", 0) SetVariable("ThrowDeathState", 0) ISENABLE_NEARDEATHREVIVAL = FALSE end function NearDeathMove_onUpdate() NearDeathCommonFunction() 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 g_ComboReset = FALSE function AttackRight_Activate() SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_RIGHT) end function AttackRightWhileGuard_Activate() SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_LEFT) end function AttackRightLight1_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_LIGHT1) -- Scholar - Right Hand Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 708200) == TRUE then ExecEventAllBody("W_AttackRightBackStepCancel") return end SPEED_COMBO_NUMBER_RIGHT = 1 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() -- Scholar - Right Hand Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 708200) == TRUE then ExecEventAllBody("W_AttackRightBackStepCancel") return end SPEED_COMBO_NUMBER_RIGHT = 2 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() -- Scholar - Right Hand Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 708200) == TRUE then ExecEventAllBody("W_AttackRightBackStepCancel") return end SPEED_COMBO_NUMBER_RIGHT = 3 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() -- Scholar - Right Hand Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 708200) == TRUE then ExecEventAllBody("W_AttackRightBackStepCancel") return end SPEED_COMBO_NUMBER_RIGHT = 4 if IsEnableNextAttack(4, HAND_RIGHT) == TRUE then local r1 = "W_AttackRightLight5" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if env(GetHeroID) == HERO_ATTACKER and env(GetSpEffectID, 709200) == TRUE then r1 = "W_AttackRightLight2" 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() -- Scholar - Right Hand Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 708200) == TRUE then ExecEventAllBody("W_AttackRightBackStepCancel") return end SPEED_COMBO_NUMBER_RIGHT = 5 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 ExecTravelMagnification(ATTACK_RIGHT_LIGHTSTEP) local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightLightFastStep_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightLightDash_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 ExecTravelMagnification(ATTACK_RIGHT_DASH) 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 ExecTravelMagnification(ATTACK_RIGHT_HEAVYDASH) local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if env(GetSpEffectID, 703530) == TRUE then r1 = "W_AttackRightLightStep" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightHeavyDashCancel_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVYDASH) 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() ExecGuardBuff() 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() SPEED_COMBO_NUMBER_RIGHT = 1 ExecTravelMagnification(ATTACK_RIGHT_HEAVY1START) ExecGuardBuff() 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() SPEED_COMBO_NUMBER_RIGHT = 1 ExecTravelMagnification(ATTACK_RIGHT_HEAVY1END) ExecGuardBuff() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end local hand = HAND_RIGHT local kind = env(GetEquipWeaponCategory, hand) if kind == 60 then r1 = "W_AttackRightLight4" end if AttackCommonFunction(r1, "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end end function AttackRightHeavy1UpStart_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVY1START) 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_AttackRightHeavy1UpEnd") return end end function AttackRightHeavy1UpEnd_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVY1END) 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() ExecGuardBuff() 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 ExecEventAllBody("W_AttackRightSpecial2") return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end 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() ExecGuardBuff() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackRightHeavy2UpStart_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 ExecEventAllBody("W_AttackRightSpecial2") return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackRightHeavy2UpEnd") return end end function AttackRightHeavy2UpEnd_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() ExecTravelMagnification(ATTACK_RIGHT_HEAVYSPECIAL1START) 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 local r1 = "W_AttackRightLightSubStart" local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" l1 = "W_AttackLeftLight1" end local isEnableDualWielding = IsEnableDualWielding() if isEnableDualWielding == INVALID then l1 = "W_AttackLeftLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy2Start", l1, "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() ExecTravelMagnification(ATTACK_RIGHT_HEAVYSPECIAL1END) 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 local r1 = "W_AttackRightLightSubStart" local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" l1 = "W_AttackLeftLight1" end local isEnableDualWielding = IsEnableDualWielding() if isEnableDualWielding == INVALID then l1 = "W_AttackLeftLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy2Start", l1, "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 AttackRightBackStepCancel_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackLeftBackStepCancel_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothBackStepCancel_onUpdate() if AttackCommonFunction("W_AttackRightBackstep", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothBackstep", "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 AttackRightHeavyTypeB1Start_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVYTYPEB1START) 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_AttackBothHeavy2Start", FALSE, TRUE, 1, AttackHeavyTypeB1) == 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_AttackRightHeavyTypeB1End") return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then SetAttackHeavyTypeB1GeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function AttackRightHeavyTypeB1End_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVYTYPEB1END) 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, AttackHeavyTypeB1) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then SetAttackHeavyTypeB1GeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function AttackRightHeavyTypeB2Start_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 ExecEventAllBody("W_AttackRightSpecial2") return end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0, AttackHeavyTypeB1) == 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_AttackRightHeavyTypeB2End") return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then SetAttackHeavyTypeB1GeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function AttackRightHeavyTypeB2End_onUpdate() if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0, AttackHeavyTypeB1) == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE or env(IsAnimEnd, 0) == TRUE then SetAttackHeavyTypeB1GeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function AttackRightBackstep_onUpdate() -- Scholar - Right Hand Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 708200) == TRUE then ExecEventAllBody("W_AttackRightBackStepCancel") return end 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() 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() -- Scholar - Left Hand Feint if IsEnableBackStepCancel(HAND_LEFT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackLeftBackStepCancel") return end ExecTravelMagnification(ATTACK_LEFT_HEAVY1) 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() -- Scholar - Left Hand Feint if IsEnableBackStepCancel(HAND_LEFT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackLeftBackStepCancel") return end 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() -- Scholar - Left Hand Feint if IsEnableBackStepCancel(HAND_LEFT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackLeftBackStepCancel") return end 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() -- Scholar - Left Hand Feint if IsEnableBackStepCancel(HAND_LEFT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackLeftBackStepCancel") return end local l1 = "W_AttackLeftHeavy5" SPEED_COMBO_NUMBER_LEFT = 4 if IsEnableNextAttack(4, HAND_LEFT) == TRUE then if env(GetHeroID) == HERO_ATTACKER and TRUE == env(GetSpEffectID, 709200) then l1 = "W_AttackLeftHeavy2" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, l1, "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end else if env(GetHeroID) == HERO_ATTACKER and TRUE == env(GetSpEffectID, 709200) then l1 = "W_AttackLeftHeavy2" else l1 = "W_AttackLeftHeavy1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", nil, l1, "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then end end end function AttackLeftHeavy5_onUpdate() -- Scholar - Left Hand Feint if IsEnableBackStepCancel(HAND_LEFT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackLeftBackStepCancel") return end 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(SetLeftWeaponAnimOffset, 400000) end function AttackDualLight1_onUpdate() SPEED_COMBO_NUMBER_DUAL = 1 ExecTravelMagnification(ATTACL_DUAL_LIGHT1) local l1 = "W_AttackDualLightSubStart" if g_ComboReset == TRUE then l1 = "W_AttackLeftLight1" end local isEnableDualWielding = IsEnableDualWielding() local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if isEnableDualWielding == INVALID and sp_kind ~= 640 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 2 >= GetDualAttackMaxNumber(HAND_RIGHT) 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 3 >= GetDualAttackMaxNumber(HAND_RIGHT) 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 4 >= GetDualAttackMaxNumber(HAND_RIGHT) 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 5 >= GetDualAttackMaxNumber(HAND_RIGHT) 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 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 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 AttackDualBackStep_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 AttackDualLightSubStart_onUpdate() local l1 = "W_AttackLeftLight2" if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == 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() -- Scholar - 2H Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackBothBackStepCancel") return end SPEED_COMBO_NUMBER_BOTH = 1 ExecTravelMagnification(ATTACK_BOTH_LIGHT1) 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() -- Scholar - 2H Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackBothBackStepCancel") return end SPEED_COMBO_NUMBER_BOTH = 2 if IsEnableNextAttack(2, HAND_RIGHT) == TRUE or IsDemonSwordMode() == 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() -- Scholar - 2H Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackBothBackStepCancel") return end SPEED_COMBO_NUMBER_BOTH = 3 if IsEnableNextAttack(3, HAND_RIGHT) == TRUE or IsDemonSwordMode() == 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() -- Scholar - 2H Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackBothBackStepCancel") return end SPEED_COMBO_NUMBER_BOTH = 4 if IsEnableNextAttack(4, HAND_RIGHT) == TRUE or IsDemonSwordMode() == TRUE then local b1 = "W_AttackBothLight5" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if env(GetHeroID) == HERO_ATTACKER and env(GetSpEffectID, 709200) == TRUE then b1 = "W_AttackBothLight2" end if AttackCommonFunction("W_AttackRightLight5", "W_AttackRightHeavy1Start", "W_AttackBothLeft2", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1SubStart", FALSE, TRUE, 4) == TRUE then return end else local b1 = "W_AttackBothLight1" if env(GetHeroID) == HERO_ATTACKER and env(GetSpEffectID, 709200) == TRUE then b1 = "W_AttackBothLight2" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end end function AttackBothLight5_onUpdate() -- Scholar - 2H Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackBothBackStepCancel") return end 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 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 ExecTravelMagnification(ATTACK_BOTH_HEAVY1START) ExecGuardBuff() 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 local r_kind = env(GetEquipWeaponCategory, HAND_RIGHT) local l_kind = env(GetEquipWeaponCategory, HAND_LEFT) if r_kind == 60 or l_kind == 60 then b1 = "W_AttackBothLight3" 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 ExecTravelMagnification(ATTACK_BOTH_HEAVY1END) ExecGuardBuff() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end local r_kind = env(GetEquipWeaponCategory, HAND_RIGHT) local l_kind = env(GetEquipWeaponCategory, HAND_LEFT) if r_kind == 60 or l_kind == 60 then b1 = "W_AttackBothLight3" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy2Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothHeavy1UpStart_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVY1START) 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_AttackBothHeavy1UpEnd") return end end function AttackBothHeavy1UpEnd_onUpdate() ExecTravelMagnification(ATTACK_BOTH_HEAVY1END) 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() ExecGuardBuff() 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 ExecEventAllBody("W_AttackBothSpecial2") 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_AttackBothLight1", "W_AttackBothHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothHeavy2UpStart_onUpdate() ExecGuardBuff() 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 ExecEventAllBody("W_AttackBothSpecial2") 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_AttackBothHeavy2UpEnd") return end end function AttackBothHeavy2UpEnd_onUpdate() if AttackCommonFunction("W_AttackBothLight1", "W_AttackBothHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 0) == TRUE then return end end function AttackBothHeavySpecial1SubStart_onUpdate() local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", b1, "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() ExecTravelMagnification(ATTACK_BOTH_HEAVYSPECIAL1START) act(SetSpecialInterpolation, 0, FALSE) local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", b1, "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() ExecTravelMagnification(ATTACK_BOTH_HEAVYSPECIAL1END) local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackBothLeft1", "W_AttackLeftHeavy1", b1, "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 ExecTravelMagnification(ATTACK_BOTH_DASH) 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 ExecTravelMagnification(ATTACK_BOTH_HEAVYDASH) local b1 = "W_AttackBothLightSubStart" if g_ComboReset == TRUE then b1 = "W_AttackBothLight1" end if env(GetSpEffectID, 703530) == TRUE then b1 = "W_AttackBothLightStep" end if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end end function AttackBothHeavyDashCancel_onUpdate() ExecTravelMagnification(ATTACK_BOTH_HEAVYDASH) 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 ExecTravelMagnification(ATTACK_BOTH_LIGHTSTEP) 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() -- Scholar - 2H Feint if IsEnableBackStepCancel(HAND_RIGHT) == TRUE and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and TRUE == env(GetSpEffectID, 708200) then ExecEventAllBody("W_AttackBothBackStepCancel") return end SPEED_COMBO_NUMBER_BOTH = 1 ExecTravelMagnification(ATTACK_BOTH_BACKSTEP) 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 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() ExecTravelMagnification(ATTACK_RIGHT_HEAVYCOUNTER) 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() ExecTravelMagnification(ATTACK_BOTH_HEAVYCOUNTER) 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 AttackRightHeavyCounterStart_onUpdate() act(SetSpecialInterpolation, 0, FALSE) ExecTravelMagnification(ATTACK_RIGHT_HEAVYCOUNTER) 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" 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 if 0 >= env(ActionDuration, ACTION_ARM_R2) and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackRightHeavyCounterEnd") return end end function AttackRightHeavyCounterEnd_onUpdate() ExecTravelMagnification(ATTACK_RIGHT_HEAVYCOUNTER) 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 AttackBothHeavyCounterStart_onUpdate() ExecTravelMagnification(ATTACK_BOTH_HEAVYCOUNTER) 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 if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventAllBody("W_AttackBothHeavyCounterEnd") return end end function AttackBothHeavyCounterEnd_onUpdate() ExecTravelMagnification(ATTACK_BOTH_HEAVYCOUNTER) 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) ResetRightArmAdd() end function AttackArrowLeft_Activate() SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) ResetRightArmAdd() end function AttackArrowBoth_Activate() local hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then hand = HAND_LEFT end SetAttackHand(hand) SetGuardHand(hand) ResetRightArmAdd() end function AttackArrowRightStart_Upper_onActivate() SetVariable("IndexCrossbowReload", 0) end function AttackArrowRightStart_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 ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end local is_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW) local is_large_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW) local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) local is_ballista_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) local is_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW) local is_large_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) local is_crossbow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) local is_ballista_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_BALLISTA) g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) if c_Style == HAND_RIGHT_BOTH then if is_large_arrow_right == TRUE or is_ballista_right == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) end elseif is_large_arrow_left == TRUE or is_ballista_left == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) end if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_LEFT_BOTH and is_crossbow_left == TRUE then if env(GetBoltLoadingState, 0) == TRUE then if 0 < env(GetStamina) then SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif c_Style == HAND_RIGHT_BOTH and is_crossbow_right == TRUE then if env(GetBoltLoadingState, 1) == TRUE then if 0 < env(GetStamina) then SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif 0 < env(GetStamina) then ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if env(IsAnimEnd, 1) == TRUE then if 0 < env(ActionDuration, ACTION_ARM_L1) then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end elseif env(GetEventEzStateFlag, 0) == TRUE and env(ActionDuration, ACTION_ARM_L1) == 0 then ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end if ArrowLowerCommonFunction(Event_AttackArrowRightStart, lower_state, FALSE) == TRUE then return end end function AttackArrowRightStartContinue_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 ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(ActionDuration, ACTION_ARM_L1) <= 0 then ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end local is_crossbow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_LEFT_BOTH and is_crossbow_left == TRUE then if env(GetBoltLoadingState, 0) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif c_Style == HAND_RIGHT_BOTH and is_crossbow_right == TRUE then if env(GetBoltLoadingState, 1) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif env(GetStamina) > 0 then ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if env(IsGeneralAnimCancelPossible) == TRUE and ISENABLE_ARROWTPSSHOT == TRUE then if c_Style == HAND_LEFT_BOTH and is_crossbow_left == TRUE then if env(GetBoltLoadingState, 0) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif c_Style == HAND_RIGHT_BOTH and is_crossbow_right == TRUE then if env(GetBoltLoadingState, 1) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif env(GetStamina) > 0 then ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if env(IsAnimEnd, 1) == TRUE then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end end if ArrowLowerCommonFunction(Event_AttackArrowRightStartContinue, lower_state, FALSE) == TRUE then return end end function AttackArrowRightLoop_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 ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) local is_crossbow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_LEFT_BOTH and is_crossbow_left == TRUE then if env(GetBoltLoadingState, 0) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif c_Style == HAND_RIGHT_BOTH and is_crossbow_right == TRUE then if env(GetBoltLoadingState, 1) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif env(GetStamina) > 0 then ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if env(ActionDuration, ACTION_ARM_L1) <= 0 then ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end if ArrowLowerCommonFunction(Event_AttackArrowRightLoop, lower_state, FALSE) == TRUE then return end end function AttackArrowRightReload_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 ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end local is_crossbow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) local is_crossbow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW) local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_LEFT_BOTH and is_crossbow_left == TRUE then if env(GetBoltLoadingState, 0) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 1) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end elseif c_Style == HAND_RIGHT_BOTH and is_crossbow_right == TRUE then if env(GetBoltLoadingState, 1) == TRUE then if env(GetStamina) > 0 then SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end else SetVariable("IndexCrossbowReload", 0) ExecEventHalfBlend(Event_AttackArrowRightReload, blend_type) return end else ExecEventHalfBlend(Event_AttackArrowRightFireMove, blend_type) return end end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_AttackArrowRightLoop, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end end if ArrowLowerCommonFunction(Event_AttackArrowRightReload, lower_state, FALSE) == TRUE then return end end function AttackArrowRightFire_onUpdate() 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_onActivate() ISENABLE_ARROWTPSSHOT = FALSE end function AttackArrowRightFireMove_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 ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(ActionRequest, ACTION_ARM_R1) == TRUE or env(ActionRequest, ACTION_ARM_R2) == TRUE then ISENABLE_ARROWTPSSHOT = TRUE end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_AttackArrowRightStartContinue, blend_type) return else ExecEventHalfBlend(Event_AttackArrowRightEnd, blend_type) return end end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_AttackArrowRightFireMove, lower_state, FALSE) == TRUE then return end end function AttackArrowRightEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArtsStanceCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", blend_type, TURN_TYPE_DEFAULT, FALSE, FALSE, TRUE, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") return end if ArrowLowerCommonFunction(Event_AttackArrowRightEnd, lower_state, FALSE) == TRUE then return end end function AttackArrowLeftFireLight1_Upper_onUpdate() SPEED_COMBO_NUMBER_LEFT = 1 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) == TRUE then return end l1 = Event_AttackArrowLeftFireLight2 r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1SubStart" if ExecAttack(r1, r2, l1, "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowLeftFireLight1, TRUE) end function AttackArrowLeftFireLight2_Upper_onUpdate() SPEED_COMBO_NUMBER_LEFT = 2 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) == TRUE then return end l1 = Event_AttackArrowLeftFireLight3 r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1SubStart" local is_large_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW) local is_large_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) if is_large_arrow_left == TRUE then l1 = Event_AttackArrowLeftFireLight1 end if ExecAttack(r1, r2, l1, "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowLeftFireLight2, TRUE) end function AttackArrowLeftFireLight3_Upper_onUpdate() SPEED_COMBO_NUMBER_LEFT = 3 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) == TRUE then return end l1 = Event_AttackArrowLeftFireLight4 r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1SubStart" if ExecAttack(r1, r2, l1, "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowLeftFireLight3, TRUE) end function AttackArrowLeftFireLight4_Upper_onUpdate() SPEED_COMBO_NUMBER_LEFT = 0 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) == TRUE then return end l1 = Event_AttackArrowLeftFireLight1 r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1SubStart" if ExecAttack(r1, r2, l1, "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowLeftFireLight4, TRUE) end function AttackArrowLeftFireLight5_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 ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end l1 = Event_AttackArrowLeftFireLight1 r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1SubStart" if ExecAttack(r1, r2, l1, "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowLeftFireLight5, TRUE) end function AttackArrowBothFireLight1_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 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) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if g_ComboReset == TRUE then r1 = Event_AttackArrowBothFireLight1 end if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireLight1) end function AttackArrowBothFireLight2_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 2 SPEED_COMBO_NUMBER_BOTH = 2 local blend_type, lower_state = GetHalfBlendInfo() local is_large_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW) local is_large_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) 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) == TRUE then return end r1 = Event_AttackArrowBothFireLight3 r2 = Event_AttackArrowBothFireHeavy1Start if g_ComboReset == TRUE then r1 = Event_AttackArrowBothFireLight1 end if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_RIGHT then if is_large_arrow_right == TRUE then r1 = Event_AttackArrowBothFireLight1 end elseif is_large_arrow_left == TRUE then r1 = Event_AttackArrowBothFireLight1 end if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireLight2) end function AttackArrowBothFireLight3_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 3 SPEED_COMBO_NUMBER_BOTH = 3 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) == TRUE then return end r1 = Event_AttackArrowBothFireLight4 r2 = Event_AttackArrowBothFireHeavy1Start if g_ComboReset == TRUE then r1 = Event_AttackArrowBothFireLight1 end if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_RIGHT then if is_large_arrow_right == TRUE then r1 = Event_AttackArrowBothFireLight1 end elseif is_large_arrow_left == TRUE then r1 = Event_AttackArrowBothFireLight1 end if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireLight3) end function AttackArrowBothFireLight4_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 0 SPEED_COMBO_NUMBER_BOTH = 0 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) == TRUE then return end r1 = Event_AttackArrowBothFireLight1 r2 = Event_AttackArrowBothFireHeavy1Start if g_ComboReset == TRUE then r1 = Event_AttackArrowBothFireLight1 end if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_RIGHT then if is_large_arrow_right == TRUE then r1 = Event_AttackArrowBothFireLight1 end elseif is_large_arrow_left == TRUE then r1 = Event_AttackArrowBothFireLight1 end if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireLight4) end function AttackArrowBothFireLight5_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 ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight1 r2 = Event_AttackArrowBothFireHeavy1Start if g_ComboReset == TRUE then r1 = Event_AttackArrowBothFireLight1 end if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_RIGHT then if is_large_arrow_right == TRUE then r1 = Event_AttackArrowBothFireLight1 end elseif is_large_arrow_left == TRUE then r1 = Event_AttackArrowBothFireLight1 end if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireLight5) end function AttackArrowBothFireHeavy1Start_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 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 env(GetHeroID) == HERO_SHOOTER and env(ActionDuration, ACTION_ARM_R2) > 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackArrowBothFireSpecial1") return end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE, TRUE) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy1CancelEarly, blend_type) return end if env(GetSpEffectID, 102300) == TRUE then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy1Loop, blend_type) return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy1Start) end function AttackArrowBothFireHeavy1Loop_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 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 env(GetHeroID) == HERO_SHOOTER and env(ActionDuration, ACTION_ARM_R2) > 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackArrowBothFireSpecial1") return end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE, TRUE) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy1CancelLate, blend_type) return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy1Loop) end function AttackArrowBothFireHeavy1CancelEarly_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 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) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy2Start b1 = Event_AttackArrowBothFireLight2 b2 = Event_AttackArrowBothFireHeavy2Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", b1, b2, FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy1CancelEarly) end function AttackArrowBothFireHeavy1CancelLate_Upper_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 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) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy2Start b1 = Event_AttackArrowBothFireLight2 b2 = Event_AttackArrowBothFireHeavy2Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", b1, b2, FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy1CancelLate) end function AttackArrowBothFireHeavy2Start_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 env(GetHeroID) == HERO_SHOOTER and env(ActionDuration, ACTION_ARM_R2) > 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackArrowBothFireSpecial2") return end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE, TRUE) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy2CancelEarly, blend_type) return end if env(GetSpEffectID, 102300) == TRUE then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy2Loop, blend_type) return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy2Start) end function AttackArrowBothFireHeavy2Loop_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 env(GetHeroID) == HERO_SHOOTER and env(ActionDuration, ACTION_ARM_R2) > 0 and env(ActionDuration, ACTION_ARM_SP_MOVE) > 0 and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackArrowBothFireSpecial2") return end if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE, TRUE) == TRUE then return end if env(ActionDuration, ACTION_ARM_R2) <= 0 then ExecEventHalfBlend(Event_AttackArrowBothFireHeavy2CancelLate, blend_type) return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy2Loop) end function AttackArrowBothFireHeavy2CancelEarly_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 ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight1 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy2CancelEarly) end function AttackArrowBothFireHeavy2CancelLate_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 ArrowCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight1 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, FALSE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackArrowBothFireHeavy2CancelLate) end function AttackArrowBothFireStep_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, AttackArrow) == TRUE then return end ArrowAllBodyCommonFunction() end function AttackArrowBothFireBackStep_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, AttackArrow) == TRUE then return end ArrowAllBodyCommonFunction() end function AttackArrowBothFireDash_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, AttackArrow) == TRUE then return end ArrowAllBodyCommonFunction() end function AttackArrowBothFireDashHeavy_onUpdate() SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, AttackArrow) == TRUE then return end ArrowAllBodyCommonFunction() end function AttackArrowBothFireSpecial1_onUpdate() if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, AttackArrow) == TRUE then return end ArrowAllBodyCommonFunction() end function AttackArrowBothFireSpecial2_onUpdate() if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT, TRUE) == TRUE then return end r1 = Event_AttackArrowBothFireLight2 r2 = Event_AttackArrowBothFireHeavy1Start if ExecAttack(r1, r2, "W_AttackLeftHeavy1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, ALLBODY, FALSE, FALSE, FALSE) == TRUE then if use_atk_queue == TRUE then SetAttackQueue(r1, r2, l1, l2, b1, b2) end return TRUE end if MoveStartonCancelTiming(Event_Move, AttackArrow) == TRUE then return end ArrowAllBodyCommonFunction() 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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_R1) > 0 or 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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_R1) <= 0 and env(ActionDuration, ACTION_ARM_R2) <= 0 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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_L1) > 0 or 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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_L1) <= 0 and env(ActionDuration, ACTION_ARM_L2) <= 0 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_onActivate() local is_crossbow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) if is_crossbow_left == FALSE then SetVariable("IsBallista", 1) else SetVariable("IsBallista", 0) end end function AttackCrossbowBothLeftStart_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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_L1) > 0 or 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() 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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_L1) <= 0 and env(ActionDuration, ACTION_ARM_L2) <= 0 then ExecEventHalfBlend(Event_AttackCrossbowBothLeftFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothLeftLoop, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothLeftFire_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if CrossbowCommonFunction(blend_type, TRUE) == TRUE then return end ArrowHalfBlendCommonFunction(Event_AttackCrossbowBothLeftFire, TRUE) 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() 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 -- Original code block --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_R1) > 0 or env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_AttackCrossbowBothRightLoop, blend_type) return else ExecEventHalfBlend(fireEvent, blend_type) return end end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothRightLoop, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothRightStartContinue_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 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 == ARROW_SLOT_SMALL 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 if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothRightLoop, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothRightLoop_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 local fireEvent = Event_AttackCrossbowBothRightFire if c_Style == HAND_LEFT_BOTH then fireEvent = Event_AttackCrossbowBothLeftFire end --[[if g_ArrowSlot == ARROW_SLOT_SMALL 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]] -- New implementation if env(ActionDuration, ACTION_ARM_R1) <= 0 and env(ActionDuration, ACTION_ARM_R2) <= 0 then ExecEventHalfBlend(fireEvent, blend_type) return end if HalfBlendLowerCommonFunction(Event_AttackCrossbowBothRightLoop, lower_state, FALSE) == TRUE then return end end function AttackCrossbowBothRightFire_Upper_onUpdate() 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 ArrowHalfBlendCommonFunction(Event_AttackCrossbowBothRightFire) if c_Style == HAND_RIGHT and env(GetEventEzStateFlag, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return TRUE end end function AttackCrossbowBothRightReload_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_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 SwordArts_Activate() local hand = c_SwordArtsHand SetAttackHand(hand) SetGuardHand(hand) ActivateRightArmAdd(START_FRAME_NONE) end function SwordArts_Update() UpdateRightArmAdd() if env(GetSpEffectID, 8910400) == TRUE then act(AddSpEffect, 8910401) end BanSprint() end function Skill_Activate() local hand = c_SwordArtsHand SetAttackHand(hand) SetGuardHand(hand) ActivateRightArmAdd(START_FRAME_ALL) end function Skill_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 c_SwordArtsID ~= 260 and GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowStanceCommonFunction(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 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 c_SwordArtsID == 239 then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy1Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy1Start" end if c_SwordArtsID == 260 then if env(1116, 604205) == FALSE then r1 = "W_StormRuler_AttackLight1" r2 = "W_StormRuler_AttackLight1" b1 = "W_StormRuler_AttackLight1" b2 = "W_StormRuler_AttackLight1" else r1 = "W_StormRuler_AttackHeavy" r2 = "W_StormRuler_AttackHeavy" b1 = "W_StormRuler_AttackHeavy" b2 = "W_StormRuler_AttackHeavy" end end if c_SwordArtsID == 81 then if ArtsStanceCommonFunction("W_AttackRightLight2", r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, TRUE) == TRUE then return end else if ArtsStanceCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, TRUE) == TRUE then return end 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 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 SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) 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 c_SwordArtsID ~= 260 and GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then act(DebugLogOutput, "ArrowStanceRightLoop") if ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowStanceCommonFunction(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 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 c_SwordArtsID == 239 then r1 = "W_AttackRightLight2" r2 = "W_AttackRightHeavy1Start" b1 = "W_AttackBothLight2" b2 = "W_AttackBothHeavy1Start" end if c_SwordArtsID == 260 then if env(GetSpEffectID, 604205) == FALSE then r1 = "W_StormRuler_AttackLight1" r2 = "W_StormRuler_AttackLight1" b1 = "W_StormRuler_AttackLight1" b2 = "W_StormRuler_AttackLight1" else r1 = "W_StormRuler_AttackHeavy" r2 = "W_StormRuler_AttackHeavy" b1 = "W_StormRuler_AttackHeavy" b2 = "W_StormRuler_AttackHeavy" end end if c_SwordArtsID == 81 then if ArtsStanceCommonFunction("W_AttackRightLight2", r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, TRUE) == TRUE then return end else if ArtsStanceCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, blend_type, TURN_TYPE_STANCE, TRUE, TRUE, FALSE, TRUE) == TRUE then return end 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 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 c_SwordArtsID ~= 80 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, TRUE) == TRUE then return 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) 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(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 and ArrowCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArtsStanceCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", blend_type, TURN_TYPE_DEFAULT, FALSE, FALSE, TRUE, TRUE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end if c_SwordArtsID == 260 then if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_DrawStanceRightEnd, lower_state, FALSE) == TRUE then return end elseif GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then ArrowHalfBlendCommonFunction(Event_DrawStanceRightEnd) else 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 end function DrawStanceRightAttackLight_onUpdate() if GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) == TRUE then if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetSpEffectID, 100280) == TRUE and (g_ArrowSlot == ARROW_SLOT_SMALL and env(ActionDuration, ACTION_ARM_R1) <= 0 or g_ArrowSlot == ARROW_SLOT_LARGE 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 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 GetEquipType(c_SwordArtsHand, WEAPON_CATEGORY_LARGE_ARROW) == FALSE and c_SwordArtsID ~= 105 and c_SwordArtsID ~= 108 and c_SwordArtsID ~= 169 and MoveStart(LOWER, Event_Move, FALSE) == TRUE and c_SwordArtsID ~= 80 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 c_SwordArtsID == 318 then 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 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 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 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 StormRuler_AttackHeavy_onUpdate() act(SetCanChangeEquipmentOff) local r1 = "W_StormRuler_AttackLight1" local r2 = "W_StormRuler_AttackLight1" local b1 = "W_StormRuler_AttackLight1" local b2 = "W_StormRuler_AttackLight1" if c_SwordArtsID ~= 38 then if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end else r2 = "W_DrawStanceRightAttackHeavy" b2 = "W_DrawStanceRightAttackHeavy" ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function StormRuler_AttackLight1_onUpdate() act(SetCanChangeEquipmentOff) local r1 = "W_StormRuler_AttackLight2" local r2 = "W_StormRuler_AttackLight2" local b1 = "W_StormRuler_AttackLight2" local b2 = "W_StormRuler_AttackLight2" if c_SwordArtsID ~= 38 then if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end else r2 = "W_DrawStanceRightAttackHeavy" b2 = "W_DrawStanceRightAttackHeavy" ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function StormRuler_AttackLight2_onUpdate() act(SetCanChangeEquipmentOff) local r1 = "W_StormRuler_AttackLight3" local r2 = "W_StormRuler_AttackLight3" local b1 = "W_StormRuler_AttackLight3" local b2 = "W_StormRuler_AttackLight3" if c_SwordArtsID ~= 38 then if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end else r2 = "W_DrawStanceRightAttackHeavy" b2 = "W_DrawStanceRightAttackHeavy" ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function StormRuler_AttackLight3_onUpdate() act(SetCanChangeEquipmentOff) local r1 = "W_StormRuler_AttackLight2" local r2 = "W_StormRuler_AttackLight2" local b1 = "W_StormRuler_AttackLight2" local b2 = "W_StormRuler_AttackLight2" if c_SwordArtsID ~= 38 then if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) == TRUE then return end else r2 = "W_DrawStanceRightAttackHeavy" b2 = "W_DrawStanceRightAttackHeavy" ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, FALSE, FALSE, TRUE, FALSE, ALLBODY) end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") 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 local r1 = "W_AttackRightLight1" local b1 = "W_AttackBothLight1" local r2 = "W_AttackRightHeavy1Start" local b2 = "W_AttackBothHeavy1Start" if c_SwordArtsID == 38 then if env(GetSpEffectID, 100002) == TRUE then L2 = "W_SwordArtsOneShotComboEnd_2" end 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 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 == 262 or c_SwordArtsID == 41 then r1 = "W_AttackRightLight2" b1 = "W_AttackBothLight2" end if c_SwordArtsID == 157 or c_SwordArtsID == 113 then r1 = "W_AttackRightLightStep" b1 = "W_AttackBothLightStep" end if (c_SwordArtsID == 115 or c_SwordArtsID == 116 or c_SwordArtsID == 193 or c_SwordArtsID == 36) 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 arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) 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("SwordArtsChargeCategory", arts_idx) ExecEventAllBody("W_SwordArtsChargeCancelEarly") return elseif env(GetSpEffectID, 100286) == TRUE then ExecEventAllBody("W_SwordArtsChargeCancelLate") return 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 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 ExecEventAllBody("W_SwordArtsChargeCancelEarly") 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 env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventHalfBlend(Event_SwordArtsHalfLoopLoop, blend_type) 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" b2 = "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 ExecGuardBuff() if env(ActionDuration, ACTION_ARM_L2) <= 0 then local arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) 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 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 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 ExecGuardBuff() local blend_type, lower_state = GetHalfBlendInfo() local arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) 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_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 ExecEventHalfBlend(Event_SwordArtsHalfLeftLoopLoop, blend_type) 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 ExecGuardBuff() 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 ExecGuardBuff() if env(ActionDuration, ACTION_ARM_L2) <= 0 then local arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) 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 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 ExecGuardBuff() 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 SwordArtsRolling_onUpdate() SetThrowAtkInvalid() 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 c_SwordArtsID == 28 then if env(GetFP) >= 17 then r1 = "W_SwordArtsOneShotComboEnd_2" b1 = "W_SwordArtsOneShotComboEnd_2" r2 = "W_SwordArtsOneShotComboEnd" b2 = "W_SwordArtsOneShotComboEnd" else r1 = "W_AttackRightLight1" b1 = "W_AttackBothLight2" end 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() SetThrowAtkInvalid() SetEnableAimMode() local r1 = "W_AttackRightLightStep" local b1 = "W_AttackBothLightStep" if GetVariable("SwordArtsRollingDirection") ~= 0 then r1 = "W_AttackRightBackstep" b1 = "W_AttackBothBackstep" end if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetArtsGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return end end function SwordArtsLoopLoop_onUpdate() if c_SwordArtsID == 115 or c_SwordArtsID == 116 or c_SwordArtsID == 193 or c_SwordArtsID == 36 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 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(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 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() ExecGuardBuff() 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() ExecGuardBuff() 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 SwordArtsLeftLoopLoop_onUpdate() ExecGuardBuff() 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() ExecGuardBuff() 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() ExecGuardBuff() 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() ExecGuardBuff() 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 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 == 198 or c_SwordArtsID == 262 then r1 = "W_AttackRightLight2" b1 = "W_AttackBothLight2" end if ArtsCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, TRUE, TRUE, FALSE, ALLBODY) == TRUE then 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 SwordArtsStandDodge_onUpdate() if ExecDamage(FALSE, FALSE) == TRUE then return TRUE end if ExecBirdAct() == 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 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 arts_cat = 0 local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == 45 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 local is_arrow = GetEquipType(arrowHand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW) local is_large_arrow = GetEquipType(arrowHand, WEAPON_CATEGORY_LARGE_ARROW) if (request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2) and (checkHold == FALSE or env(ActionDuration, ACTION_ARM_L2) > 0) then if is_large_arrow == TRUE then g_ArrowSlot = ARROW_SLOT_LARGE act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end if env(GetStamina) > 0 then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) SetSwordArtsWepCategory_DrawStanceRightAttackLight() ExecEventAllBody("W_DrawStanceRightAttackLight") return TRUE end end return FALSE end function SwordArtsArrowStanceLoop_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 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() 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() 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 == ARROW_SLOT_SMALL and 0 >= env(ActionDuration, ACTION_ARM_R1) or g_ArrowSlot == ARROW_SLOT_LARGE 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() if ArrowCommonFunction(ALLBODY, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(GetSpEffectID, 100280) == TRUE and (g_ArrowSlot == ARROW_SLOT_SMALL and env(ActionDuration, ACTION_ARM_R1) <= 0 or g_ArrowSlot == ARROW_SLOT_LARGE 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() 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() 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 FookShotFire_onActivate() SetAttackHand(HAND_LEFT) SpeedUpdate() SetVariable("BlendMoveVariable", 1) end function FookShotFire_onUpdate() SetVariable("AddFookShotBlend", 0) SetVariable("AddFookShotBlendSelector", 0) SpeedUpdate2() if GetVariable("MoveSpeedIndex") >= 2 then act(LockonFixedAngleCancel) end local moveblendlevel = GetVariable("TimeActEditor_07") if 0 < GetVariable("MoveSpeedLevel") then SetVariable("BlendMoveVariable", moveblendlevel) else SetVariable("BlendMoveVariable", 0) end local fookshot_hit_type = env(GetFookshotHitType) if fookshot_hit_type == 21 then ExecEventAllBody("W_FookShotPull") elseif fookshot_hit_type == 20 or fookshot_hit_type == 11 or fookshot_hit_type == 1 then ExecEventAllBody("W_FookShotMove") end local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy2Start" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy2Start" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1Start" b1 = "W_AttackBothLight1" b2 = "W_AttackBothHeavy1Start" end if AttackCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function FookShotMove_onUpdate() SetVariable("AddFookShotBlend", 0) SetVariable("AddFookShotBlendSelector", 0) local moveblendlevel = GetVariable("TimeActEditor_07") if 0 < GetVariable("MoveSpeedLevel") then SetVariable("BlendMoveVariable", moveblendlevel) else SetVariable("BlendMoveVariable", 0) end if env(GetSpEffectID, 700530) == TRUE and env(IsFookshotBreak) == TRUE then ExecEventAllBody("W_FookShotMoveBreak") return end local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy1Start" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy1Start" local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local is_large_sword = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SWORD) if env(GetSpEffectID, 700510) == TRUE then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" if env(GetSpEffectID, 7020000) == TRUE and is_large_sword == TRUE then SetVariable("FookShotAdditionalAttack", 0) r1 = "W_FookShotAdditionalAttack" b1 = "W_FookShotAdditionalAttack" end end if AttackCommonFunction(r1, r2, l1, l2, b1, b2, FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function FookShotMoveBreak_onUpdate() local moveblendlevel = GetVariable("TimeActEditor_07") if GetVariable("MoveSpeedLevel") > 0 then SetVariable("BlendMoveVariable", moveblendlevel) else SetVariable("BlendMoveVariable", 0) end local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy1Start" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy1Start" local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local is_large_sword = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SWORD) if env(GetSpEffectID, 700510) == TRUE then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" if env(GetSpEffectID, 7020000) == TRUE and is_large_sword == TRUE then SetVariable("FookShotAdditionalAttack", 0) r1 = "W_FookShotAdditionalAttack" b1 = "W_FookShotAdditionalAttack" end end if AttackCommonFunction(r1, r2, l1, l2, b1, b2, FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function FookShotPull_onUpdate() local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy1Start" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy1Start" local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local is_large_sword = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SWORD) if env(GetSpEffectID, 700510) == TRUE then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" if env(GetSpEffectID, 7020000) == TRUE and is_large_sword == TRUE then SetVariable("FookShotAdditionalAttack", 1) r1 = "W_FookShotAdditionalAttack" b1 = "W_FookShotAdditionalAttack" end end if AttackCommonFunction(r1, r2, l1, l2, b1, b2, FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function FookShotAdditionalAttack_onUpdate() local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy2Start" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy2Start" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" r2 = "W_AttackRightHeavy1Start" b1 = "W_AttackBothLight1" b2 = "W_AttackBothHeavy1Start" end if AttackCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, b2, FALSE, TRUE, 1) == TRUE then return end end function AirFookShotFire_onActivate() SetAttackHand(HAND_LEFT) end function AirFookShotFire_onUpdate() SetVariable("AddFookShotBlend", 0) SetVariable("AddFookShotBlendSelector", 0) SetVariable("AirFookShotMove", 0) if GetVariable("MoveSpeedIndex") >= 2 then act(LockonFixedAngleCancel) end local fookshot_hit_type = env(GetFookshotHitType) if fookshot_hit_type == 21 then ExecEventAllBody("W_AirFookShotPull") elseif fookshot_hit_type == 20 then ExecEventAllBody("W_AirFookShotMove") elseif fookshot_hit_type == 11 then ExecEventAllBody("W_AirFookShotMove") elseif fookshot_hit_type == 1 then ExecEventAllBody("W_AirFookShotMove") end local r1 = "W_AttackRightLight1" local r2 = "W_AttackRightHeavy1Start" if FookShotCommonFunction(r1, r2, "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight2", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function AirFookShotMove_onUpdate() if GetVariable("MoveSpeedIndex") >= 2 then act(LockonFixedAngleCancel) end if env(GetSpEffectID, 700530) == TRUE and env(IsFookshotBreak) == TRUE then ExecEventAllBody("W_FookShotMoveBreak") return end if env(IsTruelyLanding) == TRUE then SetVariable("AirFookShotMove", 1) end local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy2Start" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy1Start" local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local is_large_sword = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SWORD) if env(GetSpEffectID, 700510) == TRUE then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" if env(GetSpEffectID, 7020000) == TRUE and is_large_sword == TRUE then SetVariable("FookShotAdditionalAttack", 0) r1 = "W_FookShotAdditionalAttack" b1 = "W_FookShotAdditionalAttack" end end if FookShotCommonFunction(r1, r2, l1, l2, b1, b2, FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function AirFookShotPull_onUpdate() local r1 = "W_AttackRightLight2" local r2 = "W_AttackRightHeavy2Start" local l1 = "W_AttackLeftLight1" local l2 = "W_AttackLeftHeavy1" local b1 = "W_AttackBothLight2" local b2 = "W_AttackBothHeavy1Start" local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end local is_large_sword = GetEquipType(attackHand, WEAPON_CATEGORY_LARGE_SWORD) if env(GetSpEffectID, 700510) == TRUE then r1 = "W_AttackRightLightDash" r2 = "W_AttackRightHeavyDash" b1 = "W_AttackBothDash" b2 = "W_AttackBothHeavyDash" if env(GetSpEffectID, 7020000) == TRUE and is_large_sword == TRUE then SetVariable("FookShotAdditionalAttack", 1) r1 = "W_FookShotAdditionalAttack" b1 = "W_FookShotAdditionalAttack" end end if FookShotCommonFunction(r1, r2, l1, l2, b1, b2, FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function WindAttackStart_onUpdate() act(SetSpecialInterpolation, 0, FALSE) 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 if 0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) and env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_WindAttackCancelEarly") return end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function WindAttackCancelEarly_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function HurtDaggerAttack_onUpdate() act(LockonFixedAngleCancel) act(SetSpecialInterpolation, 0, FALSE) act(SetMovementScaleMult, 1.5) if env(IsHitWall) == TRUE and GetVariable("HurtDaggerIndex") == 0 then SetVariable("HurtDaggerIndex", 1) SetVariable("HurtDaggerIndex00", 1) act(AddSpEffect, 5032) end if GetVariable("HurtDaggerIndex") == 1 and env(GetSpEffectID, 5032) == TRUE then act(SetMovementScaleMult, 0.2) end local r1 = "W_AttackRightBackstep" local b1 = "W_AttackBothBackstep" if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function AirHurtDaggerAttack_onUpdate() act(LockonFixedAngleCancel) act(SetSpecialInterpolation, 0, FALSE) act(SetMovementScaleMult, 1.5) if env(IsHitWall) == TRUE and GetVariable("HurtDaggerIndex") == 0 then SetVariable("HurtDaggerIndex", 1) SetVariable("HurtDaggerIndex00", 1) act(AddSpEffect, 5032) end if GetVariable("HurtDaggerIndex") == 1 and env(GetSpEffectID, 5032) == TRUE then act(SetMovementScaleMult, 0.2) end local r1 = "W_AttackRightBackstep" local b1 = "W_AttackBothBackstep" if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_LEFT) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function SmashAttackStanceStart_onActivate() act(ResetInputQueue) end function SmashAttackStanceStart_onUpdate() act(SetSpecialInterpolation, 0, FALSE) if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if env(GetSpEffectID, 704011) == TRUE then act(AddSpEffect, 704010) POWER_DAMAGE_COUNTER = 0 SetVariable("SmashAttackSelector", 0) ExecEventAllBody("W_SmashAttack2") else SetVariable("SmashAttackSelector", 0) ExecEventAllBody("W_SmashAttack1") end end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_R2) and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end local r1 = "W_AttackRightLight1" if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end end function SmashAttack1_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_AttackRightLight2" if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function SmashAttack2_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_AttackRightLight2" if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function NecromanceModeStart_Upper_onActivate() act(ResetInputQueue) end function NecromanceModeStart_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 SummonNecromanceCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventHalfBlend(Event_NecromanceModeLoop, blend_type) return end if ArrowLowerCommonFunction(Event_NecromanceModeStart, lower_state, FALSE) == TRUE then return end end function NecromanceModeLoop_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 ExecGroundNonCombatAreaEnter(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGroundNonCombatAreaLeave(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if SummonNecromanceCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowLowerCommonFunction(Event_NecromanceModeLoop, lower_state, FALSE) == TRUE then return end end function NecromanceModeFinish_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_NecromanceModeFinish, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function NecromanceSummon1_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 SummonNecromanceCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if GetVariable("IsEnableSummonAct") == 0 then ExecEventHalfBlend(Event_NecromanceModeFinish, blend_type) return else ExecEventHalfBlend(Event_NecromanceModeLoop, blend_type) return end end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_NecromanceSummon1, lower_state, FALSE) == TRUE then return end end function NecromanceSummon2_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 SummonNecromanceCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if GetVariable("IsEnableSummonAct") == 0 then ExecEventHalfBlend(Event_NecromanceModeFinish, blend_type) return else ExecEventHalfBlend(Event_NecromanceModeLoop, blend_type) return end end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_NecromanceSummon2, lower_state, FALSE) == TRUE then return end end function NecromanceSummon3_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 SummonNecromanceCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if GetVariable("IsEnableSummonAct") == 0 then ExecEventHalfBlend(Event_NecromanceModeFinish, blend_type) return else ExecEventHalfBlend(Event_NecromanceModeLoop, blend_type) return end end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_NecromanceSummon3, lower_state, FALSE) == TRUE then return end end function NecromanceSummonReturn_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 SummonNecromanceCommonFunction(blend_type, TRUE, TURN_TYPE_DEFAULT) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if GetVariable("IsEnableSummonAct") == 0 then ExecEventHalfBlend(Event_NecromanceModeFinish, blend_type) return else ExecEventHalfBlend(Event_NecromanceModeLoop, blend_type) return end end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if ArrowLowerCommonFunction(Event_NecromanceSummonReturn, lower_state, FALSE) == TRUE then return end end function ElementalAbsorptionStart_Upper_onActivate() act(ResetInputQueue) end function ElementalAbsorptionStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(ActionDurationAlternate, ACTION_ARM_L2) <= 0 and env(ActionDuration, ACTION_ARM_SKILL) <= 0 and env(GetSpEffectID, 100285) == TRUE then ExecEventHalfBlend(Event_ElementalAbsorptionFinish, blend_type) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_ElementalAbsorptionStart, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function ElementalAbsorptionFinish_Upper_onActivate() MAGIC_ELMENTAL_NUMBER = MAGIC_ELMENTAL_NUMBER + 1 end function ElementalAbsorptionFinish_Upper_onUpdate() ExecElementalAbsorption_TerraMagicus() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_ElementalAbsorptionFinish, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function ElementalAbsorption2Start_Upper_onActivate() act(ResetInputQueue) end function ElementalAbsorption2Start_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(ActionDurationAlternate, ACTION_ARM_L2) <= 0 and env(ActionDuration, ACTION_ARM_SKILL) <= 0 and env(GetSpEffectID, 100285) == TRUE then ExecEventHalfBlend(Event_ElementalAbsorption2Finish, blend_type) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_ElementalAbsorption2Start, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function ElementalAbsorption2Finish_Upper_onActivate() MAGIC_ELMENTAL_NUMBER = MAGIC_ELMENTAL_NUMBER + 1 end function ElementalAbsorption2Finish_Upper_onUpdate() ExecElementalAbsorption_TerraMagicus() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_ElementalAbsorption2Finish, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function ElementalAbsorption3Start_Upper_onActivate() act(ResetInputQueue) end function ElementalAbsorption3Start_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if env(ActionDurationAlternate, ACTION_ARM_L2) <= 0 and env(ActionDuration, ACTION_ARM_SKILL) <= 0 and env(GetSpEffectID, 100285) == TRUE then ExecEventHalfBlend(Event_ElementalAbsorption3Finish, blend_type) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_ElementalAbsorption3Start, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function ElementalAbsorption3Finish_Upper_onActivate() MAGIC_ELMENTAL_NUMBER = MAGIC_ELMENTAL_NUMBER + 1 end function ElementalAbsorption3Finish_Upper_onUpdate() ExecElementalAbsorption_TerraMagicus() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_ElementalAbsorption3Finish, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function DemonSwordArts_onUpdate() if GetVariable("IndexDemonSwordArts") == 0 then act(SetMovementScaleMult, 1.7) end 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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function DemonSwordStanceStart_Upper_onActivate() act(ResetInputQueue) ISENABLE_DEMONSWORDSTANCE_TO_SPRINTSTART = FALSE end function DemonSwordStanceStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if ArtsStanceCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", blend_type, TURN_TYPE_DEFAULT, FALSE, FALSE, FALSE, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if lower_state == LOWER_END_TURN then ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_DemonSwordStanceStart, lower_state, FALSE) == TRUE then return end end function DemonSwordStanceEnd_Upper_onActivate() SetVariable("AddDemonSwordModeBlend", 0) end function DemonSwordStanceEnd_Upper_onUpdate() ExecGuardBuff() local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if ArtsStanceCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", blend_type, TURN_TYPE_DEFAULT, FALSE, FALSE, TRUE, TRUE) == TRUE then return end if ISENABLE_DEMONSWORDSTANCE_TO_SPRINTSTART == TRUE and env(GetEventEzStateFlag, 0) == TRUE and 0 < GetVariable("MoveSpeedLevel") then ISENABLE_SPRINTSTOP = FALSE ExecEventAllBody("W_SprintStart") return TRUE end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_DemonSwordStanceEnd, lower_state, FALSE) == TRUE then return end end function PhotoShootStart_Upper_onActivate() act(ResetInputQueue) end function PhotoShootStart_Upper_onUpdate() act(LockonFixedAngleCancel) 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 PhotoShootCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(301, 0) == TRUE then ExecEventHalfBlend(Event_PhotoShootLoop, blend_type) return end if ArrowLowerCommonFunction(Event_PhotoShootStart, lower_state, FALSE) == TRUE then return end end function PhotoShootLoop_Upper_onUpdate() act(LockonFixedAngleCancel) 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 ExecGroundNonCombatAreaEnter(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if ExecGroundNonCombatAreaLeave(HAND_RIGHT, FALSE, ALLBODY) == TRUE then return TRUE end if PhotoShootCommonFunction(blend_type, FALSE, TURN_TYPE_STANCE) == TRUE then return end if ArrowLowerCommonFunction(Event_PhotoShootLoop, lower_state, FALSE) == TRUE then return end end function PhotoShootFinish_Upper_onUpdate() act(LockonFixedAngleCancel) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return end if lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_PhotoShootFinish, lower_state, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") return end end function PhotoShootAct_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 MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return elseif HalfBlendUpperCommonFunction(lower_state) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) return elseif lower_state == LOWER_END_TURN then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_PhotoShootFinish, lower_state, FALSE) == TRUE then return end if env(ESD_ENV_IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_LEFT) ExecEventAllBody("W_Idle") end end function TranceMode_Enhance_Start_onUpdate() act(SetSpecialInterpolation, 0, FALSE) 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 if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function TranceModeEnd_onUpdate() act(SetSpecialInterpolation, 0, FALSE) 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 if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function TranceModeCounter_onActivate() act(ResetInputQueue) end function TranceModeCounter_onUpdate() act(SetSpecialInterpolation, 0, FALSE) 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 if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function AirUltCommonFunction(act_type) act(SetSpecialInterpolation, 0, FALSE) act(AIJumpState) SetAIActionState() act(DisallowAdditiveTurning, TRUE) if Act_Jump() == TRUE then return end if act_type == ULT_DRAGOONJUMP and env(GetSpEffectID, 701505) == FALSE then ExecEventAllBody("W_FallDeath") return TRUE end if env(IsHamariFallDeath, 12) == TRUE or damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_FallDeath") return TRUE end if env(GetSpEffectID, 98) == TRUE and env(GetSpEffectID, 140) == FALSE and env(IsTruelyLanding) == TRUE then if act_type == ULT_PILEBUNKER then if env(GetSpEffectID, 102060) == TRUE then ExecEventNoReset("W_AirPileBunkerLand") return else ExecEventAllBody("W_Land") return end elseif act_type == ULT_DRAGOONJUMP then ExecEventNoReset("W_DragoonJumpLand") return elseif act_type == ULT_ALLHIDE then if env(GetSpEffectID, 102060) == TRUE then ExecEventNoReset("W_AirAllHideLand") return else ExecEventNoReset("W_Land") return end else ExecAttackerUltCounterReset() ExecEventAllBody("W_Land") return end end if env(GetSpEffectID, 145) == FALSE then if act_type == ULT_PILEBUNKER then ExecEventNoReset("W_FallLoop") return elseif act_type == ULT_DRAGOONJUMP then ExecEventNoReset("W_AirDragoonJumpLoop") return elseif act_type == ULT_ALLHIDE then ExecEventAllBody("W_FallLoop") return elseif act_type == ULT_BLINKSTAKE then ExecEventAllBody("W_FallLoop") return end end if GetVariable("AddFookShotBlend") == 1 then elseif ExecAirUlt() == TRUE then end return FALSE end function PileBunkerStart_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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if 0 >= env(ActionDurationAlternate, ACTION_ARM_R2) and 0 >= env(ActionDuration, ACTION_ARM_ULTRA) and env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_PileBunkerCancelEarly") return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function PileBunkerCancelEarly_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function AirPileBunkerStart_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function AirPileBunkerStart_onUpdate() if AirUltCommonFunction(ULT_PILEBUNKER) == TRUE then return end end function AirPileBunkerLand_onActivate() act(ResetInputQueue) SetAIActionState() end function AirPileBunkerLand_onUpdate() SetAIActionState() 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, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function AirPileBunkerLand_onDeactivate() SetVariable("JumpAttackForm", 0) SetVariable("SwingPose", 0) end function DragoonJumpStart_onUpdate() act(SetSpecialInterpolation, 0, FALSE) local moveblendlevel = GetVariable("TimeActEditor_07") if 0 < GetVariable("MoveSpeedLevel") then SetVariable("BlendMoveVariable", moveblendlevel) else SetVariable("BlendMoveVariable", 0) end if IsEnableSpecialAttack(HAND_RIGHT) == TRUE and 0 < env(ActionDuration, ACTION_ARM_R2) and 0 < env(ActionDuration, ACTION_ARM_SP_MOVE) and env(GetSpEffectID, 100290) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") return end 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 if 0 >= env(ActionDurationAlternate, ACTION_ARM_R2) and 0 >= env(ActionDuration, ACTION_ARM_ULTRA) and env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_DragoonJumpCancelEarly") return end if env(GetSpEffectID, 701500) == TRUE and env(IsTruelyLanding) == TRUE then ExecEventAllBody("W_DragoonJumpLand") return TRUE end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function DragoonJumpCancelEarly_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end if env(GetSpEffectID, 701500) == TRUE and env(IsTruelyLanding) == TRUE then ExecEventAllBody("W_DragoonJumpLand") return TRUE end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function DragoonJumpLand_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 1) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then if (env(ActionDurationAlternate, ACTION_ARM_R2) > 0 or env(ActionDuration, ACTION_ARM_ULTRA) > 0) and env(GetUltimateChargePercent) > 0 then ExecEventAllBody("W_DragoonJumpLandLoop") return else ExecEventAllBody("W_DragoonJumpLandEnd") return end end end function DragoonJumpLandLoop_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1) == TRUE then return end if env(ActionDurationAlternate, ACTION_ARM_R2) <= 0 and env(ActionDuration, ACTION_ARM_ULTRA) <= 0 or env(GetUltimateChargePercent) <= 0 then ExecEventAllBody("W_DragoonJumpLandEnd") return end end function DragoonJumpLandEnd_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 ExecEventAllBody("W_AttackRightSpecial1") return end 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, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function AirDragoonJumpStart_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function AirDragoonJumpStart_onUpdate() if AirUltCommonFunction(ULT_DRAGOONJUMP) == TRUE then return end end function AirDragoonJumpLoop_onActivate() SetAIActionState() end function AirDragoonJumpLoop_onUpdate() if AirUltCommonFunction(ULT_DRAGOONJUMP) == TRUE then return end end function AirDragoonJumpLoop_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function LongBowSnipeStart_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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if 0 >= env(ActionDurationAlternate, ACTION_ARM_R2) and 0 >= env(ActionDuration, ACTION_ARM_ULTRA) and env(GetSpEffectID, 100285) == TRUE then ExecEventAllBody("W_LongBowSnipeCancelEarly") return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function LongBowSnipeCancelEarly_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy2Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function AllHideStart_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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function AirAllHideStart_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function AirAllHideStart_onUpdate() if AirUltCommonFunction(ULT_ALLHIDE) == TRUE then return end end function AirAllHideLand_onActivate() act(ResetInputQueue) SetAIActionState() end function AirAllHideLand_onUpdate() SetAIActionState() 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, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function AirAllHideLand_onDeactivate() SetVariable("JumpAttackForm", 0) SetVariable("SwingPose", 0) end function RockWallAttackStart_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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function LivingDeadStart_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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function BloodMagicStart_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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function DemonBeastStart_onUpdate() act(SetSpecialInterpolation, 0, FALSE) if AttackCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_DemonBeastIdle") return end end function DemonBeastIdle_onUpdate() act(SetSpecialInterpolation, 0, FALSE) 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 end function JointChainStart_onUpdate() env(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_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function BlinkStakeStart_onUpdate() act(SetSpecialInterpolation, 0, FALSE) SetVariable("AddBlinkStake_Up", 0) SetVariable("AddBlinkStake_Down", 0) if env(IsBlinkStakeCollide) == TRUE then ExecEventAllBody("W_BlinkStakeFinish") return elseif env(GetSpEffectID, 709100) == TRUE and env(GetBlinkStakeDistance) < 150 then ExecEventAllBody("W_BlinkStakeFinish") return elseif TRUE == AirUltCommonFunction(ULT_BLINKSTAKE) then return elseif env(ESD_ENV_IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") end end function AirBlinkStakeStart_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function AirBlinkStakeStart_onUpdate() SetVariable("AddBlinkStake_Up", 0) SetVariable("AddBlinkStake_Down", 0) if env(IsBlinkStakeCollide) == TRUE then ExecEventAllBody("W_BlinkStakeFinish") return elseif env(GetSpEffectID, 709100) == TRUE and env(GetBlinkStakeDistance) < 150 then ExecEventAllBody("W_BlinkStakeFinish") return elseif TRUE == AirUltCommonFunction(ULT_BLINKSTAKE) then end end function BlinkStakeCancelEarly_onUpdate() local r1 = "W_AttackRightLightSubStart" if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" end if AttackCommonFunction(r1, "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", FALSE, TRUE, 1, SET_SKILL_HAND_BOTH) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then SetSkillGeneratorTransitionIndex(SET_SKILL_HAND_BOTH) ExecEventAllBody("W_Idle") return end end function BlinkStakeFinish_onUpdate() env(GetBlinkStakeUnknown) if AirUltCommonFunction(ULT_BLINKSTAKE) == TRUE then end end function ResonanceGuardStart_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GuardCommonFunction(FALSE, blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_ResonanceGuardOn") return end end function ResonanceGuardStart_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function ResonanceGuardOn_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if GuardCommonFunction(FALSE, blend_type) == TRUE then return end end function ResonanceGuardOn_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function ResonanceGuardEnd_onUpdate() local r1 = "W_AttackRightLight1" 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 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 GroundNonCombatAreaEnterStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if HandChangeCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_GroundNonCombatAreaEnterEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_GroundNonCombatAreaEnterStart, lower_state, FALSE) == TRUE then return end end function GroundNonCombatAreaEnterEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) 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_GroundNonCombatAreaEnterEnd, lower_state, FALSE) == TRUE then return end return end function GroundNonCombatAreaLeaveStart_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_GroundNonCombatAreaLeaveEnd, blend_type) return end if HalfBlendLowerCommonFunction(Event_GroundNonCombatAreaLeaveStart, lower_state, FALSE) == TRUE then return end end function GroundNonCombatAreaLeaveEnd_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() local blend_type, lower_state = GetHalfBlendInfo() local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) 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_GroundNonCombatAreaLeaveEnd, lower_state, FALSE) == TRUE then return end end function GroundNonCombatAreaEnterStart_Left_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if HandChangeCommonFunction(blend_type) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_GroundNonCombatAreaEnterEnd_Left, blend_type) return end if HalfBlendLowerCommonFunction(Event_GroundNonCombatAreaEnterStart_Left, lower_state, FALSE) == TRUE then return end end function GroundNonCombatAreaEnterEnd_Left_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_GroundNonCombatAreaEnterEnd_Left, lower_state, FALSE) == TRUE then return end end function GroundNonCombatAreaLeaveStart_Left_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if env(IsAnimEnd, 1) == TRUE then ExecEventHalfBlendNoReset(Event_GroundNonCombatAreaLeaveEnd_Left, blend_type) return end if HalfBlendLowerCommonFunction(Event_GroundNonCombatAreaLeaveStart_Left, lower_state, FALSE) == TRUE then return end end function GroundNonCombatAreaLeaveEnd_Left_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() 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_GroundNonCombatAreaLeaveEnd_Left, lower_state, FALSE) == TRUE then return end end function BirdAct_Activate() ExecFookShotModeEnd() end function BirdAct_MoveStart_onActivate() SetVariable("JumpAttackForm", 0) BirdActFallLoop_DeathTime = 0 SetVariable("BirdActSpeed", 1) end function BirdAct_MoveStart_onUpdate() if env(GetSpEffectID, 99230) == TRUE then SetVariable("BirdActSpeed", ConvergeValue(1.3, GetVariable("BirdActSpeed"), 0.5, 0.5)) else SetVariable("BirdActSpeed", ConvergeValue(1, GetVariable("BirdActSpeed"), 0.5, 0.5)) end act(SetMovementScaleMult, GetVariable("BirdActSpeed")) if BirdActCommonFunction(MOVE_BIRDACT, TRUE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_BirdAct_MoveLoop") return end end function BirdAct_MoveLoop_onActivate() BIRDMOVERISE_COUNT = 0 end function BirdAct_MoveLoop_onUpdate() if env(GetSpEffectID, 99230) == TRUE then SetVariable("BirdActSpeed", ConvergeValue(1.3, GetVariable("BirdActSpeed"), 0.5, 0.5)) else SetVariable("BirdActSpeed", ConvergeValue(1, GetVariable("BirdActSpeed"), 0.5, 0.5)) end act(SetMovementScaleMult, GetVariable("BirdActSpeed")) if BirdActCommonFunction(MOVE_BIRDACT, FALSE) == TRUE then return end if env(GetSpEffectID, 99230) == FALSE then if env(ActionDuration, ACTION_ARM_ACTION) > 500 then ExecEventAllBody("W_BirdAct_FallStart") return end if env(GetBirdPathEscapeTime) >= 10 then act(AddSpEffect, 102615) end if env(GetBirdPathEscapeTime) >= 2000 then ExecEventAllBody("W_BirdAct_FallStart") return end if env(ActionDuration, ACTION_ARM_L3) > 0 then ExecEventAllBody("W_BirdAct_SeparationFallStart") return end end if env(GetBirdEventID) == 2 then ExecEventAllBody("W_BirdAct_SeparationFallStart") return end end function BirdAct_FallStart_onUpdate() if BirdActCommonFunction(MOVE_BIRDACT, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_BirdAct_FallLoop") return end end function BirdAct_FallLoop_onUpdate() local dT = env(ObtainedDT) / 1000 BirdActFallLoop_DeathTime = BirdActFallLoop_DeathTime + dT if BirdActFallLoop_DeathTime > 100 then ExecEventAllBody("W_BirdAct_SeparationFallStart") return end if BirdActCommonFunction(MOVE_BIRDACT, FALSE) == TRUE then return end if env(ActionDuration, ACTION_ARM_L3) > 0 then ExecEventAllBody("W_BirdAct_SeparationFallStart") return end SpeedUpdate() local birdmoveindex = GetVariable("MoveSpeedIndex") local birdmovelevel = GetVariable("MoveSpeedLevel") local angle = math.abs(hkbGetVariable("TurnAngle")) local bird_control = GetVariable("BirdDepartureFall_Control_Down") if GetVariable("MoveSpeedIndex") >= 1 and angle < 30 then if bird_control < 1 then SetVariable("BirdDepartureFall_Control_Down", bird_control + 0.004999999888241291) end elseif bird_control > 0 then SetVariable("BirdDepartureFall_Control_Down", bird_control - 0.00800000037997961) end if env(GetSpEffectID, 99230) == TRUE then ExecEventAllBody("W_BirdAct_Rise") return end end function BirdAct_FallEnd_onUpdate() SetVariable("MoveSpeedIndex", 3) if JumpLandCommonFunction() == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function BirdAct_Rise_onUpdate() BirdActFallLoop_DeathTime = 0 if BirdActCommonFunction(MOVE_BIRDACT, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_BirdAct_FallLoop") return end end function BirdAct_SeparationFallStart_onUpdate() if BirdActCommonFunction(MOVE_SEPARATION, FALSE) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_BirdAct_SeparationFallLoop") return end end function BirdAct_SeparationFallLoop_onActivate() BirdActFallLoop_DeathTime = 0 end function BirdAct_SeparationFallLoop_onUpdate() local dT = env(ObtainedDT) / 1000 BirdActFallLoop_DeathTime = BirdActFallLoop_DeathTime + dT if BirdActFallLoop_DeathTime > 15 then ExecEvent("W_FallDeath") return end if BirdActCommonFunction(MOVE_SEPARATION, FALSE) == TRUE then return end end function Departure_MoveStart_onActivate() SetVariable("JumpAttackForm", 0) BirdActFallLoop_DeathTime = 0 end function Departure_MoveStart_onUpdate() if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Departure_MoveLoop") return end if BirdActCommonFunction(MOVE_DEPARTURE, TRUE) == TRUE then return end end function Departure_MoveLoop_onActivate() BIRDMOVERISE_COUNT = 0 end function Departure_MoveLoop_onUpdate() if env(GetBirdEventID) == 2 then ExecEventAllBody("W_BirdAct_SeparationFallStart") return end if BirdActCommonFunction(MOVE_DEPARTURE, FALSE) == TRUE then return end end function Departure_FallStart_onActivate() SetVariable("BirdDepartureFall_Control_Down", 0) end function Departure_FallStart_onUpdate() if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Departure_FallLoop") return end if BirdActCommonFunction(MOVE_DEPARTURE, FALSE) == TRUE then return end end function Departure_FallLoop_onUpdate() local dT = env(ObtainedDT) / 1000 BirdActFallLoop_DeathTime = BirdActFallLoop_DeathTime + dT if BirdActFallLoop_DeathTime > 100 then ExecEvent("W_BirdAct_SeparationFallStart") return end if BirdActCommonFunction(MOVE_DEPARTURE, FALSE) == TRUE then return end end function Departure_FallEnd_onActivate() SetVariable("MoveSpeedIndex", 3) end function Departure_FallEnd_onUpdate() SetVariable("MoveSpeedIndex", 3) if JumpLandCommonFunction() == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function Item_Upper_Activate() ActivateRightArmAdd(START_FRAME_NONE) end function Item_Upper_Update() UpdateRightArmAdd() BanSprint() 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() if QuickItemCommonFunction(g_r1, g_r2, g_l1, g_l2, g_b1, g_b2, ALLBODY, QUICKTYPE_NORMAL) == TRUE then return end end function QuickItemEnchantAttackRight_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 QuickItemEnchantAttackLeft_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 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_onActivate() ENHANCED_RESISTANCE = 0 end function ItemRecover_Upper_onUpdate() ExecEnhancedResistance() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type, TRUE) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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, FALSE) == 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, FALSE) == 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) == 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) == 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) == 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) == 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) == 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) == 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, FALSE) == TRUE then return end local isEnd = env(IsAnimEnd, 1) if env(GetEventEzStateFlag, 0) == TRUE or isEnd == TRUE then local item_type = env(GetItemAnimType) if env(GetSpEffectID, 49753) == TRUE or env(GetSpEffectID, 49754) == TRUE or env(GetSpEffectID, 49755) == TRUE then ExecEventHalfBlendNoReset(Event_ItemDrinking, blend_type) return elseif 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) == 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() ExecChangeFlask() if ItemCommonFunction(blend_type, FALSE) == 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) == 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, FALSE) == 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) == 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, FALSE) == 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, FALSE) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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) == 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 ItemExpansionUse_Upper_onActivate() ENHANCED_RESISTANCE = 0 end function ItemExpansionUse_Upper_onUpdate() ExecEnhancedResistance() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemExpansionUse, 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) == 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 ItemOneShot_Upper_onUpdate() if GetVariable("IndexItemUseAnim") == 52 then SetEnableMimicry() end local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type, TRUE) == 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) == 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) == 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) == TRUE then return end if GetLocomotionState() == PLAYER_STATE_MOVE and GetVariable("MoveSpeedIndex") >= 1 and GetVariable("ItemDashSpeedIndex") == 0 then act(DebugLogOutput, "SummonHorse ChangeSpeedIndex") IsSummonDash = TRUE SetVariable("ItemDashSpeedIndex", 1) end if env(IsSummoningRide) == TRUE then act(DebugLogOutput, "SummonHorse SummonRequest true") if env(IsNewRidingTest) == TRUE and IsSummonDash == TRUE then act(DebugLogOutput, "SummonHorse RideOnDash") SetVariable("RideOnSummonTest", 2) FireRideEvent("W_RideOn", "W_RideOnDash", FALSE) elseif env(IsNewRidingTest) == TRUE then act(DebugLogOutput, "SummonHorse RideOn") SetVariable("RideOnSummonTest", 1) FireRideEvent("W_RideOn", "W_RideOn", FALSE) else SetVariable("RideOnSummonTest", 0) ExecEventAllBody("W_RideAdjustFromCalling") end return elseif env(GetEventEzStateFlag, 0) == TRUE then if GetVariable("MoveSpeedLevel") >= 0.9 then else IsSummonDash = FALSE end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Idle") end act(Mounting) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if HalfBlendLowerCommonFunction(Event_ItemDash, lower_state, FALSE, TRUE) == TRUE then return end end function ItemInvalid_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if ItemCommonFunction(blend_type, TRUE) == 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 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() BanSprint() 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() BanSprint() end function MagicLaunchRight_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() 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 ExecEventHalfBlend(Event_MagicFireRight, blend_type) return 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if 0 >= env(ActionDuration, ACTION_ARM_R1) or env(IsMagicUseable, wep_hand, 1) == FALSE or 0 >= env(GetStamina) then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) elseif env(GetSpEffectID, 100612) == TRUE then ExecEventHalfBlend(Event_MagicFireRight2, blend_type) else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) end return end elseif magicslot == MAGIC_SLOT_SECOND then if 0 >= env(ActionDuration, ACTION_ARM_R2) or env(IsMagicUseable, wep_hand, 1) == FALSE or 0 >= env(GetStamina) then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) elseif env(GetSpEffectID, 100612) == TRUE then ExecEventHalfBlend(Event_MagicFireRight2, blend_type) else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) end return end elseif magicslot == MAGIC_SLOT_CREATE and (0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) or env(GetSpEffectID, 9621) == TRUE) 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 magic_index == MAGIC_REQUEST_CREATEMAGIC_THUNDER_HOLY and env(GetSpEffectID, 1801501) == TRUE then act(AddSpEffect, 1801500) SetVariable("AddAutoParryBlend", 1) 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_R1) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_R2) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100610) == TRUE and env(ActionDurationAlternate, ACTION_ARM_L2) <= 0 and env(ActionDuration, ACTION_ARM_SKILL) <= 0 then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100611) == TRUE and (env(ActionDuration, ACTION_ARM_R1) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100611) == TRUE and (env(ActionDuration, ACTION_ARM_R2) <= 0 or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100611) == TRUE and env(ActionDurationAlternate, ACTION_ARM_L2) <= 0 and env(ActionDuration, ACTION_ARM_SKILL) <= 0 then ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end if CheckIfHoldMagic() == TRUE and (env(IsAnimEndBySkillCancel) == TRUE or env(IsAnimEnd, 1) == TRUE) then if magicslot == MAGIC_SLOT_FIRST then if env(ActionDuration, ACTION_ARM_R1) > 0 then ExecEventHalfBlend(Event_MagicLoopRight, blend_type) return else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(ActionDuration, ACTION_ARM_R2) > 0 then ExecEventHalfBlend(Event_MagicLoopRight, blend_type) return else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE then -- Vanilla fix - used wrong env check for L2, resulted in not being able to actually hold L2 for Magic Blade cocktail if env(ActionDurationAlternate, ACTION_ARM_L2) > 0 or env(ActionDuration, ACTION_ARM_SKILL) > 0 then ExecEventHalfBlend(Event_MagicLoopRight, blend_type) return else ExecEventHalfBlend(Event_MagicFireRightCancel, blend_type) return end 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() 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 ExecEventHalfBlend(Event_MagicFireLeft, blend_type) 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if 0 >= env(ActionDuration, ACTION_ARM_L1) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or 0 >= env(GetStamina) then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) elseif env(GetSpEffectID, 100612) == TRUE then ExecEventHalfBlend(Event_MagicFireLeft2, blend_type) else ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) end return end elseif magicslot == MAGIC_SLOT_SECOND and (0 >= env(ActionDuration, ACTION_ARM_L2) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or 0 >= env(GetStamina)) then local magic_index = env(GetMagicAnimType) if magic_index == MAGIC_REQUEST_EX_LARGE_ARROW then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) elseif env(GetSpEffectID, 100612) == TRUE then ExecEventHalfBlend(Event_MagicFireLeft2, blend_type) else ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) end return 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_R1) or env(IsMagicUseable, wep_hand, 1) == FALSE or mp_condition >= env(GetFP)) then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_R2) or env(IsMagicUseable, wep_hand, 1) == FALSE or mp_condition >= env(GetFP)) then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100610) == TRUE and 0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) then ExecEventHalfBlend(Event_MagicFireRightCancel2, blend_type) 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 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_R1) or env(IsMagicUseable, wep_hand, 1) == FALSE or mp_condition >= env(GetFP)) then ExecEventHalfBlend(Event_MagicFireRightCancel3, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_R2) or env(IsMagicUseable, wep_hand, 1) == FALSE or mp_condition >= env(GetFP)) then ExecEventHalfBlend(Event_MagicFireRightCancel3, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100610) == TRUE and 0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) then ExecEventHalfBlend(Event_MagicFireRightCancel3, blend_type) 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_MagicFireRight3, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_L1) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND and env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_L2) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100611) == TRUE and (env(ActionDuration, ACTION_ARM_L1) <= 0 or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND and env(GetSpEffectID, 100611) == TRUE and (env(ActionDuration, ACTION_ARM_L2) <= 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 magicslot == MAGIC_SLOT_FIRST then if env(ActionDuration, ACTION_ARM_L1) > 0 then ExecEventHalfBlend(Event_MagicLoopLeft, blend_type) return else ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(ActionDuration, ACTION_ARM_L2) > 0 then ExecEventHalfBlend(Event_MagicLoopLeft, blend_type) return else ExecEventHalfBlend(Event_MagicFireLeftCancel, blend_type) return end 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_L1) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or env(GetFP) <= mp_condition) then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_L2) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or env(GetFP) <= mp_condition) then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100610) == TRUE and 0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) then ExecEventHalfBlend(Event_MagicFireLeftCancel2, blend_type) 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 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 SetMagicGeneratorTransitionIndex() ExecEventHalfBlendNoReset(Event_Move, UPPER) return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then SetMagicGeneratorTransitionIndex() return end if HalfBlendLowerCommonFunction(Event_MagicFireLeftCancel3, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() return end end function MagicFireLeft3_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_NORMAL, FALSE) == TRUE then return end local magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_L1) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or env(GetFP) <= mp_condition) then ExecEventHalfBlend(Event_MagicFireLeftCancel3, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_L2) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE or env(GetFP) <= mp_condition) then ExecEventHalfBlend(Event_MagicFireLeftCancel3, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100610) == TRUE and 0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) then ExecEventHalfBlend(Event_MagicFireLeftCancel3, blend_type) 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_MagicFireLeftCancel3, lower_state, FALSE) == TRUE then SetMagicGeneratorTransitionIndex() 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_R1) or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireRightJumpCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_R2) or env(IsMagicUseable, wep_hand, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireRightJumpCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_CREATE and env(GetSpEffectID, 100610) == TRUE and 0 >= env(ActionDurationAlternate, ACTION_ARM_L2) and 0 >= env(ActionDuration, ACTION_ARM_SKILL) 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 magicslot = GetVariable("IndexMagicSlot") if magicslot == MAGIC_SLOT_FIRST then if env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_L1) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireLeftJumpCancel, blend_type) return end elseif magicslot == MAGIC_SLOT_SECOND and env(GetSpEffectID, 100610) == TRUE and (0 >= env(ActionDuration, ACTION_ARM_L2) or env(IsMagicUseable, HAND_LEFT, 1) == FALSE) then ExecEventHalfBlend(Event_MagicFireLeftJumpCancel, 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 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 MagicPointRecoveryLaunch_Upper_onUpdate() local blend_type, lower_state = GetHalfBlendInfo() if MagicCommonFunction(ALLBODY, QUICKTYPE_ATTACK, 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 ExecEventHalfBlend(Event_MagicPointRecoveryFire, blend_type) return end if HalfBlendLowerCommonFunction(Event_MagicPointRecoveryLaunch, lower_state, FALSE) == TRUE then return end end function MagicPointRecoveryFire_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_MagicPointRecoveryFire, 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() local is_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW) local gen_hand = FALSE if is_arrow_right == TRUE then gen_hand = SET_SKILL_HAND_ARROW end if ThrowCommonFunction(FALSE, gen_hand) == TRUE then act(RequestThrowAnimInterrupt) return end if env(IsAnimEnd, 1) == TRUE then if gen_hand == SET_SKILL_HAND_ARROW then SetArrowGeneratorTransitionIndex(hand_left) end ExecEventAllBody("W_Idle") end end function ThrowDef_onActivate() Replanning() end function ThrowDef_onUpdate() SetThrowDefBlendWeight() if env(IsThrowSelfDeath) == TRUE and env(GetHP) <= 0 then ExecEvent("ThrowDeath") return end if env(GetEventEzStateFlag, 0) == TRUE and env(GetHP) <= 0 then ExecEvent("ThrowDeath") return end if env(IsThrowSuccess) == TRUE then ExecEvent("W_ThrowEscape") return end if ThrowCommonFunction(ESTEP_DOWN, FALSE) == 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 ThrowDeath_onUpdate() if IsDirectDeath() == TRUE then elseif env(GetSpEffectID, 102115) == TRUE then SetVariable("IndexNearDeath", 11) if GetVariable("ThrowDeathState") == 0 then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 0) ExecEventAllBody("W_NearDeathStart") return TRUE elseif GetVariable("ThrowDeathState") == 1 then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 1) ExecEventAllBody("W_NearDeathStart") return TRUE end elseif env(GetSpEffectID, 102116) == TRUE then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 1) if GetVariable("ThrowDeathState") == 0 then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 0) ExecEventAllBody("W_NearDeathStart") return TRUE elseif GetVariable("ThrowDeathState") == 1 then SetVariable("IndexNearDeath", 11) SetVariable("ThrowDeathState", 1) ExecEventAllBody("W_NearDeathStart") return TRUE end end end function ThrowDeathIdle_onActivate() act(SetThrowState, THROW_TYPE_INVALID) end function ThrowDeathIdle_onUpdate() if env(GetHP) > 0 and env(GetSpEffectID, 49280) == TRUE then ExecEventAllBody("W_Event60506") return TRUE end end local blendtimemax = 0 local blendtime = 0 local EVENT_BLEND_RATE = 1000 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 Event60491_onActivate() ResetEventState() end function Event60491_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60492_onActivate() ResetEventState() end function Event60492_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 Event60506_onActivate() ResetEventState() end function Event60506_onUpdate() if EventCommonFunction() == TRUE then return end end function Event60507_onActivate() ResetEventState() end function Event60507_onUpdate() if EventCommonFunction() == TRUE then return end 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() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then return end end function Event60811_onActivate() ResetEventState() end function Event60811_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then return end end function Event60900_onActivate() ResetEventState() end function Event60900_onUpdate() act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end function Event60900_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60910_onActivate() ResetEventState() ResetRightArmAdd() act(AddSpEffect, 705021) act(AddSpEffect, 7010909) act(AddSpEffect, 42206) act(AddSpEffect, 30101) end function Event60910_onUpdate() act(SetAllowedThrowDefenseType, 255) local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATH_FALLING then ExecEventAllBody("W_NearDeathEnd") return TRUE end if (env(IsAnimEnd, 1) == TRUE or env(GetEventEzStateFlag, 0) == TRUE) and env(GetSpEffectID, 102140) == TRUE then ExecEventAllBody("W_NearDeathEnd") return TRUE end if env(GetSpEffectID, 102115) == TRUE then SetVariable("IndexNearDeathStartToIdle", 0) ExecEventAllBody("W_NearDeathStartToIdle") return TRUE elseif env(GetSpEffectID, 102116) == TRUE then SetVariable("IndexNearDeathStartToIdle", 1) ExecEventAllBody("W_NearDeathStartToIdle") return TRUE end if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_NearDeathIdle") return end end function Event60910_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event60920_onActivate() ResetEventState() end function Event60920_onUpdate() if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_FallDeathLoop") return TRUE end end function Event60920_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event61000_onActivate() ResetEventState() end function Event61000_onUpdate() if EventCommonFunction() == TRUE then return end end function Event61001_onActivate() ResetEventState() end function Event61001_onUpdate() if EventCommonFunction() == TRUE then return end end function Event61010_onActivate() ResetEventState() end function Event61010_onUpdate() if EventCommonFunction() == TRUE then return end end function Event61020_onActivate() ResetEventState() SetVariable("WeaponBehaviorRight", 0) end function Event61020_onUpdate() SetVariable("WeaponBehaviorRight", 0) if EventCommonFunction() == TRUE then return end end function Event61030_onActivate() ResetEventState() end function Event61030_onUpdate() act(SetAllowedThrowDefenseType, 255) end function Event61040_onActivate() ResetEventState() end function Event61040_onUpdate() if EventCommonFunction() == TRUE then return end end function Event61050_onActivate() ResetEventState() end function Event61050_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() NearDeathCommonFunction() if env(IsAnimEnd, 1) == TRUE then ExecEvent("W_NearDeathIdle") return end if env(GetSpEffectID, 102115) == TRUE then SetVariable("IndexNearDeathStartToIdle", 0) ExecEventAllBody("W_NearDeathStartToIdle") return TRUE elseif env(GetSpEffectID, 102116) == TRUE then SetVariable("IndexNearDeathStartToIdle", 1) ExecEventAllBody("W_NearDeathStartToIdle") return TRUE 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 Event63500_onActivate() ResetEventState() end function Event63500_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63510_onActivate() ResetEventState() end function Event63510_onUpdate() if EventCommonFunction() == TRUE then return end end function Event63520_onActivate() ResetEventState() end function Event63520_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 Event66100_onActivate() ResetEventState() end function Event66100_onUpdate() if EventCommonFunction() == TRUE then return end end function Event66200_onActivate() ResetEventState() end function Event66200_onUpdate() if EventCommonFunction() == TRUE then return end end function Event66210_onActivate() ResetEventState() end function Event66210_onUpdate() if EventCommonFunction() == TRUE then return end end function Event66300_onActivate() ResetEventState() end function Event66300_onUpdate() SetVariable("AddDemonSwordModeBlend", 1) local blend_type, lower_state = GetHalfBlendInfo() if lower_state == LOWER_IDLE then act(LockonSystemUnableToTurnAngle, 45, 45) end if ArtsStanceCommonFunction("W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", blend_type, TURN_TYPE_DEFAULT, FALSE, FALSE, TRUE, TRUE) == TRUE then return end if HalfBlendUpperCommonFunction(lower_state) == TRUE then return end if lower_state == LOWER_END_TURN then ExecEventAllBody("W_Idle") elseif HalfBlendLowerCommonFunction(Event_DemonSwordStanceStart, lower_state, FALSE) == 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 Event69100_onActivate() ResetEventState() end function Event69100_onUpdate() if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_BirdAct_MoveLoop") return else act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end end function Event69100_onDeactivate() act(SetIsEventActionPossible, FALSE) end function Event69105_onActivate() ResetEventState() end function Event69105_onUpdate() if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE or env(GetSpEffectID, 102600) == TRUE then ExecEventAllBody("W_BirdActMoveRiseLoop") return else act(SetIsEventActionPossible, TRUE) if EventCommonFunction() == TRUE then act(SetIsEventActionPossible, FALSE) return end end end function Event69105_onDeactivate() act(SetIsEventActionPossible, FALSE) 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 env(GetSpEffectID, 46329) == FALSE then ExecEventAllBody("W_Event6002") Replanning() return 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 LadderFunction(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 AddDamageSmashAttackStance_Default_onUpdate() SetVariable("AddDamageSmashAttackStance_Blend", 0) end function AddNonCombatAreaEnter_onActivate() SetVariable("WeaponBehaviorRight", 0) end function AddNonCombatAreaEnter_onUpdate() SetVariable("WeaponBehaviorRight", 0) SetVariable("AddNonCombatAreaEnterBlend", 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 env(ActionDuration, ACTION_ARM_ACTION) <= 0 and env(ActionDuration, ACTION_ARM_L3) <= 0 then ISENABLE_SPRINTSTART = TRUE ISENABLE_SPRINTSTOP = TRUE end 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 if env(GetHeroID) == HERO_BALANCE then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_TANK then SetVariable("MoveTypeIndex", 1) elseif env(GetHeroID) == HERO_SHOOTER then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_SPEED then SetVariable("MoveTypeIndex", 0) SetVariable("MoveTypeLady", 1) elseif env(GetHeroID) == HERO_POWER then SetVariable("MoveTypeIndex", 1) elseif env(GetHeroID) == HERO_NECROMANCER then SetVariable("MoveTypeIndex", 2) elseif env(GetHeroID) == HERO_MAGIC then SetVariable("MoveTypeIndex", 2) elseif env(GetHeroID) == HERO_TECHNICAL then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_BUFFER then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_ATTACKER then if env(GetSpEffectID, 709000) == TRUE or env(GetSpEffectID, 709010) == TRUE then SetVariable("IsTrance", 1) elseif env(GetSpEffectID, 709001) == TRUE or env(GetSpEffectID, 709011) == TRUE then SetVariable("IsTrance", 0) end SetVariable("MoveTypeIndex", 2) end if env(GetHeroID) == HERO_SPEED then SetVariable("MoveTypeLady", 1) else SetVariable("MoveTypeLady", 0) 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 ChangeMoveSpeedIndex(0) elseif g_IsMimicry == TRUE then if stick_level > 1.1 then ResetMimicry() else ChangeMoveSpeedIndex(0) end elseif env(GetSpEffectID, 701530) == TRUE then ChangeMoveSpeedIndex(0) elseif env(GetSpEffectID, 100220) == TRUE then ChangeMoveSpeedIndex(2) elseif env(GetSpEffectID, 102000) == TRUE or GetVariable("MoveSpeedIndex") == 3 then if ISENABLE_SPRINTSTOP == TRUE and env(ActionDuration, ACTION_ARM_L3) > 0 then ISENABLE_SPRINTSTART = FALSE ChangeMoveSpeedIndex(2) elseif env(GetSpEffectID, 100010) == TRUE and IsDemonSwordMode() == FALSE then ChangeMoveSpeedIndex(3) else if IsNodeActive("FookShotFire_Walk_Upper_CMSG") == FALSE then act(LockonFixedAngleCancel) end ChangeMoveSpeedIndex(3) end if env(GetStateChangeType, CONDITION_TYPE_NIGHT) == TRUE then act(SetStaminaRecoveryDisabled) if env(GetSpEffectID, 100020) == TRUE then ISENABLE_SPRINTSTART = FALSE ChangeMoveSpeedIndex(2) end end else local runLevel = 0.6 if GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("MoveSpeedIndex") >= 1 then runLevel = 0.4 end local specialeffect_heavy = 0 if SetSlowFeet() == TRUE then specialeffect_heavy = 1 end if ISENABLE_SPRINTSTART == TRUE and env(ActionDuration, ACTION_ARM_L3) > 0 and specialeffect_heavy == 0 and env(GetStamina) >= 0 and env(GetSpEffectID, 102610) == FALSE and env(GetSpEffectID, 102001) == FALSE then ExecSprintStart() elseif stick_level > 1.1 then if IsNodeActive("FookShotFire_Walk_Upper_CMSG") == FALSE then act(LockonFixedAngleCancel) end ChangeMoveSpeedIndex(2) elseif runLevel < stick_level then if env(GetHeroID) == HERO_ATTACKER and (env(GetSpEffectID, 709000) == TRUE or env(GetSpEffectID, 709010) == TRUE) and (env(GetSpEffectID, 5030) == TRUE or env(GetSpEffectID, 100002) == TRUE) then act(LockonFixedAngleCancel) ChangeMoveSpeedIndex(2) else ChangeMoveSpeedIndex(1) if env(GetSpEffectID, 100002) == FALSE and (GetVariable("IsEnableToggleDashTest") >= 2 or env(GetSpEffectID, 100301) == FALSE) then SetVariable("ToggleDash", 0) end end 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(GetStateChangeType, CONDITION_TYPE_NIGHT) == TRUE and stick_level > 1.1 then act(SetStaminaRecoveryDisabled) end end function SpeedUpdate2() local stick_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local is_aim = env(IsPrecisionShoot) local is_lockon = GetVariable("IsLockon") if env(ActionDuration, ACTION_ARM_ACTION) <= 0 and env(ActionDuration, ACTION_ARM_L3) <= 0 then ISENABLE_SPRINTSTART = TRUE ISENABLE_SPRINTSTOP = TRUE end 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 if env(GetHeroID) == HERO_BALANCE then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_TANK then SetVariable("MoveTypeIndex", 1) elseif env(GetHeroID) == HERO_SHOOTER then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_SPEED then SetVariable("MoveTypeIndex", 0) elseif env(GetHeroID) == HERO_POWER then SetVariable("MoveTypeIndex", 1) elseif env(GetHeroID) == HERO_NECROMANCER then SetVariable("MoveTypeIndex", 2) elseif env(GetHeroID) == HERO_MAGIC then SetVariable("MoveTypeIndex", 2) elseif env(GetHeroID) == HERO_TECHNICAL then SetVariable("MoveTypeIndex", 0) end if env(GetHeroID) == HERO_SPEED then SetVariable("MoveTypeLady", 1) else SetVariable("MoveTypeLady", 0) 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 ChangeMoveSpeedIndex(0) elseif g_IsMimicry == TRUE then if stick_level > 1.1 then ResetMimicry() else ChangeMoveSpeedIndex(0) end elseif env(GetSpEffectID, 4101) == TRUE then if stick_level > 1.1 then ChangeMoveSpeedIndex(1) end elseif SetSlowFeet() == TRUE then if stick_level > 1.1 then ChangeMoveSpeedIndex(1) end elseif env(GetSpEffectID, 100220) == TRUE then ChangeMoveSpeedIndex(2) elseif env(GetSpEffectID, 102000) == TRUE or GetVariable("MoveSpeedIndex") == 3 then else local runLevel = 0.6 if GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("MoveSpeedIndex") >= 1 then runLevel = 0.4 end local specialeffect_heavy = 0 if SetSlowFeet() == TRUE then specialeffect_heavy = 1 end if stick_level > 1.1 then if env(GetSpEffectID, 102001) == FALSE and ISENABLE_SPRINTSTART == TRUE and env(ActionDuration, ACTION_ARM_L3) > 0 and specialeffect_heavy == 0 and env(GetStamina) >= 0 and env(GetSpEffectID, 102610) == FALSE then ExecSprintStart() else ChangeMoveSpeedIndex(2) end 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 else ChangeMoveSpeedIndex(0) if env(GetSpEffectID, 100002) == FALSE and (GetVariable("IsEnableToggleDashTest") >= 2 or env(GetSpEffectID, 100301) == FALSE) then SetVariable("ToggleDash", 0) end end end end function SprintUpdate() local stick_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local is_aim = env(IsPrecisionShoot) if stick_level == 0 and GetVariable("MoveSpeedIndex") == 3 then ChangeMoveSpeedIndex(0) end end function GetMoveSpeed(stick_level) local speed = GetVariable("MoveSpeedLevelReal") local inc_val = ACCELERATION_WALK_SPEED_UP local dec_val = ACCELERATION_SPEED_DOWN if stick_level == 2 then inc_val = ACCELERATION_DASH_SPEED_UP dec_val = ACCELERATION_DASH_SPEED_DOWN end local ret = ConvergeValue(stick_level, speed, inc_val, dec_val) return ret end function StealthTransitionIndexUpdate() local move_speed_level = GetVariable("MoveSpeedLevel") local MoveIndex = GetVariable("MoveSpeedIndex") if MoveIndex == 2 then SetVariable("StealthTransitionIndex", 3) elseif MoveIndex == 1 then SetVariable("StealthTransitionIndex", 2) elseif move_speed_level > 0 then SetVariable("StealthTransitionIndex", 1) else SetVariable("StealthTransitionIndex", 0) end end function SetThrowDefBlendWeight() if env(DoesAnimExist, GetVariable("ThrowID") + 4) == FALSE then return end local regist_num = env(GetThrowDefenseCount) local dT = GetDeltaTime() local blend_weight = GetVariable("ThrowHoldBlendWeight") local is_holding = GetVariable("ThrowHolding") local no_regist_time = GetVariable("ThrowNoRegistTime") if regist_num > 0 then is_holding = true end if is_holding == true then if regist_num <= 0 then no_regist_time = no_regist_time + dT end if no_regist_time > 0.7 then is_holding = false else blend_weight = blend_weight + 2 * dT if blend_weight > 0.99 then blend_weight = 0.99 end SetVariable("IsEnableTAEThrowHold", true) end else no_regist_time = 0 blend_weight = blend_weight - 4 * dT if blend_weight < 0.01 then blend_weight = 0.01 SetVariable("IsEnableTAEThrowHold", false) else SetVariable("IsEnableTAEThrowHold", true) end end SetVariable("ThrowHoldBlendWeight", blend_weight) SetVariable("ThrowHolding", is_holding) SetVariable("ThrowNoRegistTime", no_regist_time) end function SetNpcTurnSpeed(turn_speed) if env(IsCOMPlayer) == TRUE and turn_speed >= 0 then act(SetTurnSpeed, turn_speed) end end function GetDeltaTime() return env(ObtainedDT) / 1000 end function GetConstVariable() c_HasActionRequest = CheckActionRequest() c_RollingAngle = env(GetRollAngle) * 0.01 c_ArtsRollingAngle = env(GetSwordArtsRollAngle) * 0.01 local art_id, art_hand = GetSwordArtInfo() c_SwordArtsHand = art_hand c_SwordArtsID = art_id c_IsEnableSwordArts = IsEnableSwordArts() c_Style = env(GetWeaponSwitchState) c_IsStealth = env(GetSpEffectID, 8001) -- New const variables c_MainHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then c_MainHand = HAND_LEFT end c_GuardHand = HAND_LEFT if c_Style == HAND_RIGHT_BOTH then c_GuardHand = HAND_RIGHT end 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 function Update() if IsDemonSwordMode() == TRUE then BanSprint() end if env(GetSpEffectID, 100067) == TRUE then act(SetIsPreciseShootingPossible) end ExecChangeDejavuBlend() ExecDejavu() ExecChangeTranceBlend() ExecTrance() ExecTranceEnd() SetLadyComobo() DS3Dual() -- Favor of the Great Hollow ExecUltCharge() -- Recluse's Lightning Auto-Parry Magic Cocktail if env(GetHeroID) == HERO_MAGIC and GetVariable("AddAutoParryBlend") == 1 and env(GetSpEffectID, 1801500) == FALSE then SetVariable("AddAutoParryBlend", 0) end -- Executor - Change blend used to switch hand sword is in if GetVariable("AddDemonSwordModeBlend") == 1 then if env(GetSpEffectID, 707065) == TRUE and GetVariable("AddDemonSwordModeBlendSelector") == 0 then SetVariable("AddDemonSwordModeBlendSelector", 1) elseif env(GetSpEffectID, 707065) == FALSE and GetVariable("AddDemonSwordModeBlendSelector") == 1 then SetVariable("AddDemonSwordModeBlendSelector", 0) end end if env(GetHeroID) == HERO_MAGIC and env(GetMagicCocktailAffinityCount) == 3 and env(GetSpEffectID, 603060) == FALSE then act(AddSpEffect, 603060) end if env(GetSpiritspringJumpHeight) > 0 then act(AddSpEffect, 604100) end if env(GetSpEffectID, 104900) == TRUE then act(LockonFixedAngleCancel) end -- Cure all status effects if env(GetSpEffectID, 30101) == TRUE then act(AddSpEffect, 30102) act(AddSpEffect, 30103) act(AddSpEffect, 30104) act(AddSpEffect, 30105) act(AddSpEffect, 30106) act(AddSpEffect, 30107) act(AddSpEffect, 30108) end if env(GetSpEffectID, 100068) == TRUE then -- Harald CGS cut to recovery ExecEventAllBody("W_SwordArtsOneShotShieldBoth") end if GetVariable("TimeActEditor_07") == 1 then SetVariable("AddFookShotBlendSelector", 1) end -- Effect from Gnoster Raid buff 'Integrated Intelligence' ExecRuneBonus() ExecBirdAct() GetConstVariable() SetStyleSpecialEffect() act(SwitchMotion, FALSE) if env(ActionDuration, ACTION_ARM_ACTION) > 0 then SetThrowAtkInvalid() end SetVariable("EyeBlinkBlend", 1 - g_TimeActEditor_11) act(LockonSystemUnableToTurnAngle, 0, 0) if env(IsOnMount) == TRUE then act(LockonFixedAngleCancel) if env(GetSpiritspringJumpHeight) > 0 or env(GetSpEffectID, 183) == TRUE then act(AddSpEffect, 185) end end SetVariable("LocomotionState", GetLocomotionState()) SetMoveType() ChangeWaistTwist(-10, 0, -20, 0) if IsLowerQuickTurn() == TRUE then SetVariable("LookAtTwist30_OnGain", 1) else SetVariable("LookAtTwist30_OnGain", 0.1) end GreyOutSwordArtFE() SetArtCancelType() if GetVariable("IsKeepAttackQueue") == false then ClearAttackQueue() end if c_Style == HAND_LEFT_BOTH then SetVariable("IndexHandBothStyle", 1) else SetVariable("IndexHandBothStyle", 0) end GetTimeActEditorVariable() 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 ISENABLE_WALLJUMP == FALSE and env(IsLanding) == TRUE then ISENABLE_WALLJUMP = TRUE end local index_hero = env(GetHeroID) SetVariable("IndexHero", index_hero) SetVariable("UniqueIdleBlend_Upperbody_ChangeIndex", 1) -- Handle Surge Sprint Auto Toggle Off if GetVariable("MoveSpeedIndex") == 3 then -- Perform a Jump Attack if IsNodeActive("NewJump LayerGenerator") == TRUE and GetVariable("JumpAttackForm") ~= 0 then SetVariable("MoveSpeedIndex", 0) end -- Stop moving during HandChange/WeaponChange if (IsNodeActive("HandChange_Upper_SM") == TRUE or IsNodeActive("WeaponChange_Upper_SM") == TRUE) and GetVariable("MoveSpeedLevel") == 0 then SetVariable("MoveSpeedIndex", 0) end -- List of Surge Sprint compatible states if IsNodeActive("NewJump LayerGenerator") == FALSE and IsNodeActive("Fall_SM") == FALSE and IsNodeActive("Move_Upper Selector") == FALSE and IsNodeActive("HandChange_Upper_SM") == FALSE and IsNodeActive("WeaponChange_Upper_SM") == FALSE and IsNodeActive("Sprint180_CMSG") == FALSE and IsNodeActive("Rolling_To_Sprint_Light_CMSG") == FALSE and IsNodeActive("FookShotFire_CMSG00") == FALSE and IsNodeActive("FookShotMove_CMSG") == FALSE and IsNodeActive("FookShotMoveBreak_CMSG") == FALSE and IsNodeActive("DragoonJumpStart_CMSG") == FALSE and IsNodeActive("Departure_FallEnd_CMSG") == FALSE and IsNodeActive("BirdAct_FallEnd_CMSG") == FALSE then SetVariable("MoveSpeedIndex", 0) end end 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 g_FrameCount = g_FrameCount + 1 Modpage() Discord() Patreon() Kofi() end function ContainDs3Dual(sp_kind) -- Check if it's a dual wielded ds3 weapon such as sellsword twinblades local DualWep = { 640, 647, 637, 639 } if Contains(DualWep, sp_kind) == TRUE then return TRUE end return FALSE end function DS3Dual() -- Allows dual wielded ds3 weapons to be used with weapons of the same type. TAE: 100065 = 2295 for one handed 100066 = 2296 for two handed local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if ContainDs3Dual(sp_kind) == TRUE then if c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH then act(AddSpEffect, 100065) act(ClearSpEffect, 100066) elseif c_Style == HAND_RIGHT_BOTH then act(AddSpEffect, 100066) act(ClearSpEffect, 100065) elseif c_Style == HAND_LEFT_BOTH then act(AddSpEffect, 100066) act(ClearSpEffect, 100065) end else act(ClearSpEffect, 100065) act(ClearSpEffect, 100066) end end heroFootOffsetTables = { -- Wylder [HERO_BALANCE] = { hkVector4.new(-0.029837800189852715, 0.0026084301061928272, 0.0031328098848462105, 0), hkQuaternion.new(3.537859925017983E-07, 0, 6.53787992632715E-07, 1), hkVector4.new(0.14140300452709198, 0.00343983992934227, 0.016963999718427658, 0), hkQuaternion.new(-0.016669899225234985, 0.20554399490356445, -0.009822160005569458, 0.978456974029541) }, -- Guardian [HERO_TANK] = { hkVector4.new(-0.027215100824832916, 0.005970839876681566, 0.037929099053144455, 0), hkQuaternion.new(-0.04239889979362488, -0.07309190183877945, 0.00019104100647382438, 0.9964240193367004), hkVector4.new(0.1320199966430664, 0.007690909784287214, 0.07055039703845978, 0), hkQuaternion.new(-0.0422758013010025, 0.24880200624465942, 0.010026199743151665, 0.9675790071487427) }, -- Ironeye [HERO_SHOOTER] = { hkVector4.new(-0.061542101204395294, 0.002855780068784952, 0.11534000188112259, 0), hkQuaternion.new(-0.006716299802064896, -0.006285639945417643, -0.01002930011600256, 0.9999070167541504), hkVector4.new(0.08255569636821747, 0.0020317400339990854, -0.08100569993257523, 0), hkQuaternion.new(0.0012848000042140484, -0.13232800364494324, 0.017779000103473663, 0.9910460114479065) }, -- Duchess [HERO_SPEED] = { hkVector4.new(-0.1130400002002716, 0.0039494698867201805, 0.019797800108790398, 0), hkQuaternion.new(-0.021739499643445015, 0.11296600103378296, -0.00495699979364872, 0.993349015712738), hkVector4.new(0.2304919958114624, 0.012231799773871899, 0.04108110070228577, 0), hkQuaternion.new(-0.06475979834794998, 0.06905680149793625, 0.004534970037639141, 0.99549800157547) }, -- Raider [HERO_POWER] = { hkVector4.new(0.034283701330423355, 0.00023359799524769187, 0.06506600230932236, 0), hkQuaternion.new(-2.5148199256364023E-06, -0.04408159852027893, -2.854329977708403E-06, 0.9990280270576477), hkVector4.new(0.003081680042669177, 0.00023990099725779146, -0.023486200720071793, 0), hkQuaternion.new(-3.275499921073788E-06, 0.010891900397837162, -3.6277199342293898E-06, 0.9999409914016724) }, -- Revenant [HERO_NECROMANCER] = { hkVector4.new(-0.17718400061130524, 0.009341370314359665, 0.09603279829025269, 0), hkQuaternion.new(-0.032704100012779236, 0.0297084990888834, -0.03663109987974167, 0.9983519911766052), hkVector4.new(0.21090899407863617, 0.014778399839997292, -0.03690379858016968, 0), hkQuaternion.new(-0.029983000829815865, -0.03943770006299019, 0.03369240090250969, 0.9982039928436279) }, -- Recluse [HERO_MAGIC] = { hkVector4.new(-0.18238000571727753, -0.00011849399743368849, 0.07893739640712738, 0), hkQuaternion.new(0.0009554679854772985, 0.07557240128517151, -0.05242900177836418, 0.995760977268219), hkVector4.new(0.24793699383735657, 0.012888199649751186, -0.009000290185213089, 0), hkQuaternion.new(-0.036021798849105835, 0.1662759929895401, 0.0345769003033638, 0.9848139882087708) }, -- Executor [HERO_TECHNICAL] = { hkVector4.new(-0.036492299288511276, -3.628430022217799E-06, 0.08864530175924301, 0), hkQuaternion.new(-6.655079778283834E-05, -0.10118000209331512, 0.0003778169921133667, 0.9948679804801941), hkVector4.new(0.03545650094747543, 0.005778490100055933, -0.06667689979076385, 0), hkQuaternion.new(-0.01346690021455288, -0.10250599682331085, 0.019817300140857697, 0.9944440126419067) }, -- Scholar [HERO_BUFFER] = { hkVector4.new(-0.16602900624275208, 0.007031199987977743, 0.08813170343637466, 0), hkQuaternion.new(-0.022834600880742073, -0.002094249939545989, -0.04878079891204834, 0.9948679804801941), hkVector4.new(0.24652299284934998, 0.010634399950504303, -0.041634898632764816, 0), hkQuaternion.new(-0.020982999354600906, 0.10659600049257278, 0.0392192006111145, 0.9933069944381714) }, -- Undertaker [HERO_ATTACKER] = { hkVector4.new(-0.1735980063676834, 0.0025943599175661802, 0.11918800324201584, 0), hkQuaternion.new(-0.006727240048348904, -0.0003420859866309911, -0.054895199835300446, 0.9984689950942993), hkVector4.new(0.23900799453258514, 0.01334839966148138, -0.007566169835627079, 0), hkQuaternion.new(-0.028063099831342697, 0.09858319908380508, 0.055840298533439636, 0.9931640028953552) } } function CopyLocalMatrix(source, dest) local sourceMatrix = hkbGetBoneLocalSpace(source) hkbSetBoneLocalSpace(dest, sourceMatrix) end function CopyModelMatrix_OffsetModelSpace(source, dest, offsetPos, offsetRot, offsetRate) local sourceMatrix = hkbGetBoneModelSpace(source) local sourcePosition = sourceMatrix:getTranslation() sourcePosition = sourcePosition + offsetPos * offsetRate sourceMatrix:setTranslation(sourcePosition) local sourceRotation = sourceMatrix:getRotation() local offsetRotation = hkQuaternion.new() local resultRotation = hkQuaternion.new() offsetRotation:setSlerp(hkQuaternion.new(0, 0, 0, 1), offsetRot, offsetRate) resultRotation:setMul(offsetRotation, sourceRotation) sourceMatrix:setRotation(resultRotation) hkbSetBoneModelSpace(dest, sourceMatrix) end function CalculateFootTarget2_OffsetModelSpace(source, YaxisOffset, dest, offsetPos, offsetRate) local sourceMatrix = hkbGetBoneModelSpace(dest) local sourcePosition = hkbGetBoneModelSpace(source):getTranslation() sourcePosition[1] = sourcePosition[1] + YaxisOffset sourcePosition = sourcePosition + offsetPos * offsetRate sourceMatrix:setTranslation(sourcePosition) hkbSetBoneModelSpace(dest, sourceMatrix) end function Master_Layer_onGenerate() local offset = 0.8659999966621399 local heroId = env(GetHeroID) if heroId > 0 and heroId <= #heroFootOffsetTables then local offsetRateL = GetVariable("PoseAnime_Addtive_LeftLeg") local offsetRateR = GetVariable("PoseAnime_Addtive_RightLeg") CalculateFootTarget2_OffsetModelSpace("L_Foot", offset, "L_Foot_Target2", heroFootOffsetTables[heroId][1], offsetRateL) CopyModelMatrix_OffsetModelSpace("L_Foot", "L_Foot_Target", heroFootOffsetTables[heroId][1], heroFootOffsetTables[heroId][2], offsetRateL) CalculateFootTarget2_OffsetModelSpace("R_Foot", offset, "R_Foot_Target2", heroFootOffsetTables[heroId][3], offsetRateR) CopyModelMatrix_OffsetModelSpace("R_Foot", "R_Foot_Target", heroFootOffsetTables[heroId][3], heroFootOffsetTables[heroId][4], offsetRateR) else CalculateFootTarget2_OffsetModelSpace("L_Foot", offset, "L_Foot_Target2", hkVector4.new(0, 0, 0, 0), 0) CopyModelMatrix_OffsetModelSpace("L_Foot", "L_Foot_Target", hkVector4.new(0, 0, 0, 0), hkQuaternion.new(0, 0, 0, 1), 0) CalculateFootTarget2_OffsetModelSpace("R_Foot", offset, "R_Foot_Target2", hkVector4.new(0, 0, 0, 0), 0) CopyModelMatrix_OffsetModelSpace("R_Foot", "R_Foot_Target", hkVector4.new(0, 0, 0, 0), hkQuaternion.new(0, 0, 0, 1), 0) end end function ModifiersLayer_onGenerate() CopyLocalMatrix("Neck", "Collar") end 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 function Ride_Activate() end function Ride_Update() if IsEnableFeedAddBlend == TRUE then Ride_Feed_Rate = 1 act(SetMountHavokVariable, "Ride_Feed_AddBlend", 1) else Ride_Feed_Rate = ConvergeValue(0, Ride_Feed_Rate, 4, 4) act(SetMountHavokVariable, "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 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 GetVariable("MoveSpeedLevel") >= 0.9 and rideOffAnyway ~= TRUE then event = "W_Jump_RideOff" if GetVariable("MoveSpeedLevel") >= 1.5 or 1 <= GetVariable("ToggleDash") then event_under = "W_RideOffGallop" SetVariable("RideOff_Jump_Speed", 1) else event_under = "W_RideOffDash" SetVariable("RideOff_Jump_Speed", 0) end local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if style == HAND_RIGHT then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 0) end elseif style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end elseif style == HAND_LEFT_BOTH then local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW) == TRUE then SetVariable("JumpAttack_HandCondition", 3) elseif ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttack_HandCondition", 5) else SetVariable("JumpAttack_HandCondition", 1) end end SetVariable("JumpAttackForm", 0) SetVariable("JumpUseMotion_Bool", false) SetVariable("JumpMotion_Override", 0.01) SetVariable("JumpAttack_Land", 0) SetVariable("SwingPose", 0) SetVariable("IsEnableDirectionJumpTAE", true) SetVariable("ToggleDash", 0) 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) act(AddSpEffect, 181) 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, STATUS_EFFECT_DEATH) == TRUE then SetVariable("IndexRideDeath", RIDE_DEATH_TYPE_STONE) FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return TRUE elseif env(GetHP) <= 0 then if env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE or env(GetSpecialAttribute) == DAMAGE_ELEMENT_MADNESS 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(SetKnockbackFlag, DAMAGE_FLAG_SMALL) ExecEventAllBody("W_RideRepelledSmall") return TRUE else act(SetKnockbackFlag, 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(SetMountHavokVariable, "Ride_SA_Add_Blend", 1) return FALSE elseif damage_type == DAMAGE_TYPE_GUARDBREAK then act(SetKnockbackFlag, 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, STATUS_EFFECT_SLEEP) == TRUE then FireRideEvent("W_RideDamage_Fall", "W_RideRun_End", FALSE) return TRUE end if env(GetDamageSpecialAttribute, STATUS_EFFECT_MADNESS) == TRUE then FireRideEvent("W_RideDamageMad", "W_RideRun_End", FALSE) Replanning() return TRUE end if (env(GetSpecialAttribute) == 5 or env(GetMountSpecialAttribute) == 5) and GetVariable("MoveSpeedLevel") > 1.5 then SetVariable("DamageDirection", 2) act(SetMountHavokVariable, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 1) act(SetMountHavokVariable, "RideDamageDefaultState", 1) act(SetMountDamageFlag, 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(SetMountHavokVariable, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 1) act(SetMountHavokVariable, "RideDamageDefaultState", 1) act(SetMountDamageFlag, DAMAGE_FLAG_MIDDLE) Replanning() FireRideEvent("W_RideDamageMiddle", "W_Ride_DamageMiddle", FALSE) return TRUE end if env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOODLOSS) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_FROSTBITE) == 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(SetMountHavokVariable, "BlendRideDamageFire", 0) SetVariable("Ride_SA_Add_Blend", 0) act(SetMountHavokVariable, "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(SetMountHavokVariable, "DamageDirection", 2) act(SetMountDamageFlag, DAMAGE_FLAG_WEAK) FireRideEvent("W_RideDamageWeakTop", "W_Ride_DamageWeakTop", FALSE) Replanning() return TRUE elseif env(GetMountIsWeakPoint) == TRUE then SetVariable("DamageDirection", 2) act(SetMountHavokVariable, "DamageDirection", 2) act(SetMountDamageFlag, 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(SetMountHavokVariable, "DamageDirection", damage_angle_real) act(SetMountDamageFlag, 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(SetMountHavokVariable, "BlendRideDamageFire", 1) act(SetMountHavokVariable, "IndexFireRideDamageVariation", 0) FireRideEvent("W_RideFireMiddleDamageBlend_Add", "W_Ride_FireMiddleDamageBlend_Add", FALSE) end SetVariable("DamageDirection", 2) act(SetMountHavokVariable, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 2) act(SetMountHavokVariable, "RideDamageDefaultState", 2) act(SetMountDamageFlag, 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(SetMountHavokVariable, "BlendRideDamageFire", 1) act(SetMountHavokVariable, "IndexFireRideDamageVariation", 0) FireRideEvent("W_RideFireMiddleDamageBlend_Add", "W_Ride_FireMiddleDamageBlend_Add", FALSE) end SetVariable("DamageDirection", 2) act(SetMountHavokVariable, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 1) act(SetMountHavokVariable, "RideDamageDefaultState", 1) act(SetMountDamageFlag, 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(SetMountHavokVariable, "BlendRideDamageFire", 1) act(SetMountHavokVariable, "IndexFireRideDamageVariation", 0) FireRideEvent("W_RideFireSmallDamageBlend_Add", "W_Ride_FireSmallDamageBlend_Add", FALSE) end SetVariable("DamageDirection", 2) act(SetMountHavokVariable, "DamageDirection", 2) SetVariable("RideDamageDefaultState", 0) act(SetMountHavokVariable, "RideDamageDefaultState", 0) act(SetMountDamageFlag, 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(SetMountHavokVariable, "IndexRide_SA_Add_Random", index) act(SetMountDamageFlag, DAMAGE_FLAG_MINIMUM) FireRideEvent("W_Ride_SA_Add", "W_Ride_SA_Add", FALSE) SetVariable("Ride_SA_Add_Blend", 1) act(SetMountHavokVariable, "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, ACTION_ARM_JUMP) == 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 act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) if GetVariable("MoveSpeedLevel") >= 1.5 then FireRideEvent("W_RideJump2_D", "W_RideJump2_D", FALSE) elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideJump2_F", "W_RideJump2_F", FALSE) else FireRideEvent("W_RideJump2_N", "W_RideJump2_N", FALSE) end end RIDE_ISENABLE_DOUBLEJUMP = FALSE return TRUE end return FALSE end function RideRequestFunction(ride_move_type, enable_turn, lower_only) if env(IsOnMount) == FALSE then act(Dismount) ExecEventAllBody("W_Idle") return TRUE end if enable_turn == TRUE then if GetVariable("MoveSpeedLevel") >= 0.9 then SetVariable("Int16Variable01", 1) else SetVariable("Int16Variable01", 0) end local turn_angle = GetVariable("TurnAngle") if math.abs(turn_angle) >= 135 and PROTO4 == 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 if env(GetSpEffectID, 100020) == TRUE and move_speed_level > 1 then move_speed_level = 1 end if math.abs(move_angle) <= 45 then if move_speed_level > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6 then next_ride_move_type = RIDE_MOVE_TYPE_DASH elseif move_speed_level > 0 then next_ride_move_type = RIDE_MOVE_TYPE_WALK else next_ride_move_type = RIDE_MOVE_TYPE_IDLE end end if ride_move_type ~= next_ride_move_type or env(GetMountSpEffectID, 101008) == TRUE then if next_ride_move_type == RIDE_MOVE_TYPE_IDLE then SetVariable("ToggleDash", 0) 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) if env(ActionDuration, ACTION_ARM_ACTION) > 0 then return FALSE end if env(GetStamina) < 0 then ResetRequest() return FALSE end if env(ActionRequest, ACTION_ARM_R1) == TRUE and is_staff == FALSE or env(ActionRequest, ACTION_ARM_R2) == 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 = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) if env(IsOutOfAmmo, attackHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ExecEventAllBody("W_RideAttackArrowStart") return TRUE end ExecEventAllBody(r1) elseif env(ActionRequest, ACTION_ARM_R2) == 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 = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) 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, ACTION_ARM_L1) == TRUE or env(ActionRequest, ACTION_ARM_L2) == 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, ACTION_ARM_L2) == 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 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(SetMountHavokVariable, "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(SetMountHavokVariable, "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 if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_R1) <= 0 and env(ActionDuration, ACTION_ARM_L1) <= 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, ACTION_ARM_R1) > 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 if env(ActionDuration, ACTION_ARM_R1) <= 0 and env(ActionDuration, ACTION_ARM_L1) <= 0 and env(ActionDuration, ACTION_ARM_L1) <= 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 if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_R1) <= 0 and env(ActionDuration, ACTION_ARM_L1) <= 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 if env(GetSpEffectID, 100610) == TRUE and (env(ActionDuration, ACTION_ARM_R1) <= 0 and env(ActionDuration, ACTION_ARM_L1) <= 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 if env(IsAnimEnd, 1) == TRUE then ExecEventNoReset("W_RideIdle") end end function RideItemOneShot_onDeactivate() IsEnableFeedAddBlend = FALSE 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(SetMountHavokVariable, "AddBlend02", 0) Ride_HeadDown_Rate = 0 act(SetAllowedThrowDefenseType, 255) SetAIActionState() SetVariable("Int16Variable01", 0) local lower_only = TRUE if env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE elseif env(GetEventEzStateFlag, 0) ~= TRUE then return end local move_speed_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local next_ride_move_type = RIDE_MOVE_TYPE_IDLE if math.abs(move_angle) <= 45 then if move_speed_level > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6 then next_ride_move_type = RIDE_MOVE_TYPE_DASH elseif move_speed_level > 0 then next_ride_move_type = RIDE_MOVE_TYPE_WALK else next_ride_move_type = RIDE_MOVE_TYPE_IDLE end end if next_ride_move_type == RIDE_MOVE_TYPE_IDLE then if lower_only == FALSE then FireRideEvent("W_RideIdle", "W_RideIdle", lower_only) end elseif next_ride_move_type == RIDE_MOVE_TYPE_WALK then FireRideEvent("W_RideWalk", "W_RideWalk", lower_only) elseif next_ride_move_type == RIDE_MOVE_TYPE_DASH then FireRideEvent("W_RideDash", "W_RideDash", lower_only) else FireRideEvent("W_RideGallop", "W_RideGallop", lower_only) end end function RideOnDash_onUpdate() act(SetAllowedThrowDefenseType, 255) SetAIActionState() SetVariable("Int16Variable01", 0) local lower_only = TRUE if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then lower_only = FALSE elseif env(GetEventEzStateFlag, 0) ~= TRUE then return end local move_speed_level = GetVariable("MoveSpeedLevel") local move_angle = GetVariable("MoveAngle") local next_ride_move_type = RIDE_MOVE_TYPE_IDLE if math.abs(move_angle) <= 45 then if move_speed_level > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then next_ride_move_type = RIDE_MOVE_TYPE_GALLOP elseif move_speed_level > 0.6 then next_ride_move_type = RIDE_MOVE_TYPE_DASH elseif move_speed_level > 0 then next_ride_move_type = RIDE_MOVE_TYPE_WALK else next_ride_move_type = RIDE_MOVE_TYPE_IDLE end end if next_ride_move_type == RIDE_MOVE_TYPE_IDLE then if lower_only == FALSE then FireRideEvent("W_RideIdle", "W_RideIdle", lower_only) end elseif next_ride_move_type == RIDE_MOVE_TYPE_WALK then FireRideEvent("W_RideWalk", "W_RideWalk", lower_only) elseif next_ride_move_type == RIDE_MOVE_TYPE_DASH then FireRideEvent("W_RideDash", "W_RideDash", lower_only) else FireRideEvent("W_RideGallop", "W_RideGallop", lower_only) end end function RideOff_onUpdate() act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLight1", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLight1", "W_AttackBothHeavy1Start", QUICKTYPE_NORMAL) == TRUE then act(Dismount) return end if env(MovementRequest) == TRUE or env(IsAnimEnd, 0) == TRUE then act(Dismount) ExecEventAllBody("W_Idle") return TRUE end end function RideIdle_onActivate() act(Wait) end function RideIdle_onUpdate() act(Wait) SetVariable("Int16Variable01", 0) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_IDLE, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then SetVariable("ToggleDash", 0) end end function RideWalk_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_WALK, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then SetVariable("ToggleDash", 0) end end function RideWalk_End_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) end if RideRequestFunction(RIDE_MOVE_TYPE_IDLE, TRUE, FALSE) == TRUE then return end end function RideDash_onUpdate() act(Wait) SetEnableAimMode() if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if RideRequestFunction(RIDE_MOVE_TYPE_DASH, TRUE, FALSE) == TRUE then return end if GetVariable("IsEnableToggleDashTest") >= 1 then SetVariable("ToggleDash", 0) end end 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 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 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 act(ChangeStamina, -1) 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 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(SetMountHavokVariable, "BlendRidden_SA_Add", 0) end function RideFireDamageBlend_Default_onUpdate() SetVariable("BlendRideDamageFire", 0) act(SetMountHavokVariable, "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 RideDamageMad_onUpdate() act(SetAllowedThrowDefenseType, 0) act(SetAllowedThrowAttackType, 1) SetAIActionState() SetVariable("Int16Variable01", 0) if env(GetSpecialAttribute) == DAMAGE_ELEMENT_MADNESS 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 RideDeath_Idle_onActivate() act(SetDeathStay, TRUE) end function RideDeath_Idle_onDeactivate() act(SetDeathStay, FALSE) end function RideAttackCommonFunction(r1, r2, l1, l2) if RideCommonFunction(r1, r2, l1, l2) == TRUE then return TRUE end if c_Style == HAND_LEFT_BOTH then SetAttackHand(HAND_LEFT) SetGuardHand(HAND_LEFT) else SetAttackHand(HAND_RIGHT) SetGuardHand(HAND_RIGHT) end return FALSE end Ride_HighJump_Height = 0 Ride_HeadDown_Rate = 0 Ride_Feed_Rate = 0 IsEnableFeedAddBlend = FALSE function RideCommonFunction(r1, r2, l1, l2) Ride_HeadDown_Rate = EaseInOutVal(g_TimeActEditor_07, Ride_HeadDown_Rate, 0.8, 1.5, "EaseInOutStartVal1", "EaseInOutTargetVal1", "EaseInOutTimer1") act(SetMountHavokVariable, "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, ACTION_ARM_JUMP) == 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) if highJumpHeight > 0 then act(DebugLogOutput, "RideJumpHigh Height=" .. highJumpHeight .. "cm") Ride_HighJump_Height = highJumpHeight + 700 FireRideEvent("W_RideJumpHigh", "W_RideJumpHigh", FALSE) return TRUE end act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) if 1.5 <= GetVariable("MoveSpeedLevel") then FireRideEvent("W_RideJump_D", "W_RideJump_D", FALSE) elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideJump_F", "W_RideJump_F", FALSE) else FireRideEvent("W_RideJump_N", "W_RideJump_N", FALSE) end return TRUE end end if ExecRideHandChange(HAND_RIGHT, FALSE) == TRUE then return TRUE end if ExecRideMagic() == TRUE then return TRUE end if ExecRideAttack(r1, r2, l1, l2) == TRUE then return TRUE end if ExecRideItem() == TRUE then return TRUE end if ExecRideGesture() == TRUE then return TRUE end return FALSE end RideDashAccelerateTest = 0 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 act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) 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 if evasionRequest == TRUE then act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) 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 act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) 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 act(ChangeStamina, STAMINA_REDUCE_RIDE_DASH) 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 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, ACTION_ARM_JUMP) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) 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 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, ACTION_ARM_JUMP) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) 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 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, ACTION_ARM_JUMP) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) 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 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, ACTION_ARM_JUMP) == TRUE and (env(GetGeneralTAEFlag, TAE_FLAG_CHARGING) == 1 or env(GetSpEffectID, 100280) == TRUE) and isShield == FALSE then local jumpEvent = "W_RideJump_N" if GetVariable("MoveSpeedLevel") >= 1.5 then jumpEvent = "W_RideJump_D" elseif GetVariable("MoveSpeedLevel") >= 0.6 then jumpEvent = "W_RideJump_F" end act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) 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 == ARROW_SLOT_SMALL 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 == ARROW_SLOT_SMALL 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 == ARROW_SLOT_SMALL 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, ACTION_ARM_R1) == TRUE and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ExecEventAllBody("W_RideAttackArrowStartContinue") return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE and env(ActionDuration, 1) > 0 and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) 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, ACTION_ARM_R1) == TRUE and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) if env(IsOutOfAmmo, arrowHand) == TRUE then ExecEventAllBody("W_RideNoArrow") return TRUE end ExecEventAllBody("W_RideAttackArrowStartContinue") return TRUE elseif env(ActionRequest, ACTION_ARM_R2) == TRUE and env(ActionDuration, 1) > 0 and is_crossbow == FALSE then act(ResetInputQueue) g_ArrowSlot = ARROW_SLOT_SMALL act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) 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 RideJumpLoop_IsSecond = FALSE DISABLEJUMP_FALLDIST = 20 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, ACTION_ARM_JUMP) == TRUE and env(GetSpEffectID, 100902) == TRUE and RIDE_ISENABLE_DOUBLEJUMP == TRUE then if env(GetStamina) <= 0 or height > DISABLEJUMP_FALLDIST then ResetRequest() else act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) if GetVariable("MoveSpeedLevel") >= 1.5 then FireRideEvent("W_RideJump2_D", "W_RideJump2_D", FALSE) elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideJump2_F", "W_RideJump2_F", FALSE) else FireRideEvent("W_RideJump2_N", "W_RideJump2_N", FALSE) end RIDE_ISENABLE_DOUBLEJUMP = FALSE return TRUE end end if env(IsMountTrulyLanding) == TRUE and env(GetMountSpEffectID, 98) == TRUE and env(GetMountSpEffectID, 140) == FALSE then if GetVariable("MoveSpeedLevel") > 1.5 then FireRideEvent("W_RideJump_Land_To_Gallop", "W_RideJump_Land_To_Gallop", lower_only) return TRUE elseif GetVariable("MoveSpeedLevel") > 0.6 then FireRideEvent("W_RideJump_Land_To_Dash", "W_RideJump_Land_To_Dash", lower_only) return TRUE end local landEvent = "W_RideJump_Land_N" if jump_type == 3 then landEvent = "W_RideJump_Land_D" elseif jump_type == 2 then landEvent = "W_RideJump_Land_F" end act(DebugLogOutput, landEvent) FireRideEvent(landEvent, landEvent, lower_only) return TRUE end local enable_jumpAttack = TRUE local attackHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then attackHand = HAND_LEFT end if GetEquipType(attackHand, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_CROSSBOW) == TRUE then enable_jumpAttack = FALSE end local is_staff = GetEquipType(attackHand, WEAPON_CATEGORY_STAFF) if enable_jumpAttack == TRUE then if env(ActionRequest, ACTION_ARM_R1) == TRUE and is_staff == FALSE or env(ActionRequest, ACTION_ARM_R2) == TRUE and is_staff == TRUE then SetVariable("RideJumpAttack_Land", 0) SetVariable("IndexRideJumpType", jump_type) ExecEventAllBody("W_RideAttack_Jump_R") RideJumpLoop_IsSecond = isSecond return TRUE elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and is_staff == FALSE or env(ActionRequest, ACTION_ARM_L2) == TRUE and is_staff == TRUE then SetVariable("RideJumpAttack_Land", 0) SetVariable("IndexRideJumpType", jump_type) ExecEventAllBody("W_RideAttack_Jump_L") RideJumpLoop_IsSecond = isSecond return TRUE end end if env(IsAnimEnd, 0) == TRUE and lower_only == FALSE then SetVariable("IndexRideJumpType", jump_type) if isHighJump == TRUE then ExecEventNoReset("W_RideJumpHigh_FallLoop") elseif isSecond == TRUE then ExecEventNoReset("W_RideJump2_Loop") else ExecEventNoReset("W_RideJump_Loop") end return TRUE end return FALSE end function RideJump_N_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_N_onUpdate() if RideJumpCommonFunction(0, FALSE, FALSE, FALSE) == TRUE then return end end function RideJump_F_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_F_onUpdate() if RideJumpCommonFunction(2, FALSE, FALSE, FALSE) == TRUE then return end end function RideJump_D_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_D_onUpdate() if RideJumpCommonFunction(3, FALSE, FALSE, FALSE) == TRUE then return end end function RideJump_Loop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_Loop_onUpdate() if env(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(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) ExecFookShotModeEnd() if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then hkbFireEvent("W_RideJumpHigh_FallLoop") return TRUE end end function RideJumpHighLoop_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end rideJumpHighLoop_StopTime = 0 lastFallHeight = 0 rideJumpHighLoop_IsStop = FALSE 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, ACTION_ARM_JUMP) == 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() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if 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 style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) 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, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) g_ArrowSlot = ARROW_SLOT_SMALL elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) g_ArrowSlot = ARROW_SLOT_SMALL end end if ExecJumpMagic(0) == TRUE then elseif ExecFallItem() == TRUE then return TRUE elseif env(GetEquipWeaponCategory, equip_arm_no) == WEAPON_CATEGORY_STAFF and env(ActionRequest, ACTION_ARM_R1) == 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 if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 3) hkbFireEvent("W_JumpAttack_Start_Falling") return else SetVariable("JumpAttackForm", 3) SetVariable("JumpAttackFormRequest", 2) hkbFireEvent("W_JumpAttack_Start_Falling") return end 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 ExecWallJump() == TRUE then return end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE then SetVariable("LandIndex", landIndex) local JumpMoveLevel = 0 if GetVariable("JumpAttackForm") == 0 then if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end end if SetSlowFeet() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 3 then ExecEventNoReset("W_Jump_Land_To_Sprint") return elseif JumpMoveLevel >= 1 and landIndex == LAND_HEAVY then ExecEvasion(FALSE, ESTEP_LAND, FALSE) return TRUE elseif 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 JUMPN == 1 then ExecEventNoReset("W_Jump_Land_N") elseif JUMPF == 1 then ExecEventNoReset("W_Jump_Land_F") elseif JUMPD == 1 then ExecEventNoReset("W_Jump_Land_D") elseif JUMPS == 1 then ExecEventNoReset("W_Jump_Land_S") else ExecEventNoReset("W_Jump_Land_N") end return end end function RideJump_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideJump_onUpdate() SetAIActionState() SetVariable("ToggleDash", 0) 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 0 < GetVariable("MoveSpeedLevel") 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 RideAttack_Jump_R_onActivate() SetAIActionState() act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) end function RideAttack_Jump_R_onUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) SetVariable("Int16Variable01", 1) 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 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) 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 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() PROTO4 = 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() PROTO4 = 0 end function RideTurn_Right180_onUpdate() PROTO4 = 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() PROTO4 = 0 end function RideTurn_Left90_onUpdate() PROTO4 = 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() PROTO4 = 0 end function RideTurn_Right90_onUpdate() PROTO4 = 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() PROTO4 = 0 end function RideFall_Start_onUpdate() if RideFallCommonFunction() == TRUE then return end if env(IsMountInFallLoop) == TRUE then local height = env(GetMountFallHeight) if IsLandDead(height / 100) == TRUE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if height < 900 and height >= 200 then if GetVariable("MoveSpeedLevel") > 1.5 then FireRideEvent("W_RideJump_Land_To_Gallop", "W_RideJump_Land_To_Gallop", lower_only) return elseif GetVariable("MoveSpeedLevel") > 0.6 then FireRideEvent("W_RideJump_Land_To_Dash", "W_RideJump_Land_To_Dash", lower_only) return else FireRideEvent("W_RideFall_Land", "W_RideFall_Land", FALSE) return end elseif height >= 200 then FireRideEvent("W_RideFall_Land", "W_RideFall_Land", FALSE) return elseif GetVariable("MoveSpeedLevel") > 1.5 or GetVariable("IsEnableToggleDashTest") >= 1 and GetVariable("ToggleDash") == 1 and GetVariable("MoveSpeedLevel") >= 0.9 then FireRideEvent("W_RideGallop", "W_RideGallop", FALSE) return elseif GetVariable("MoveSpeedLevel") >= 0.6 then FireRideEvent("W_RideDash", "W_RideDash", FALSE) return elseif GetVariable("MoveSpeedLevel") > 0 then FireRideEvent("W_RideWalk", "W_RideWalk", FALSE) return else FireRideEvent("W_RideIdle", "W_RideIdle", FALSE) return end end if env(IsAnimEnd, 0) == TRUE then FireRideEvent("W_RideFall_Loop", "W_RideFall_Loop", FALSE) return end end function RideFall_Loop_onUpdate() if RideFallCommonFunction() == TRUE then return end if env(GetSpiritspringJumpHeight) > 0 or env(GetSpEffectID, 183) == TRUE then act(AddSpEffect, 186) end if env(IsHamariFallDeath, 12) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if env(IsMountInFallLoop) == TRUE then local height = env(GetMountFallHeight) if IsLandDead(height / 100) == TRUE and env(GetSpEffectID, 185) == FALSE then FireRideEvent("W_RideDeath", "W_RideDeath", FALSE) return end if height < 900 then if GetVariable("MoveSpeedLevel") > 1.5 then FireRideEvent("W_RideJump_Land_To_Gallop", "W_RideJump_Land_To_Gallop", lower_only) return elseif GetVariable("MoveSpeedLevel") > 0.6 then FireRideEvent("W_RideJump_Land_To_Dash", "W_RideJump_Land_To_Dash", lower_only) return end end FireRideEvent("W_RideFall_Land", "W_RideFall_Land", FALSE) return end end function RideFall_Land_onUpdate() if RideFallCommonFunction() == TRUE then return end if RideCommonFunction("W_RideAttack_R_Top", "W_RideAttack_R_Hard1_Start", "W_RideAttack_L_Top", "W_RideAttack_L_Hard1_Start") == TRUE then return end if env(IsMoveCancelPossible) == TRUE or env(IsAnimEnd, 0) == TRUE then local moveType = RIDE_MOVE_TYPE_IDLE if env(IsAnimEnd, 0) == TRUE then moveType = RIDE_MOVE_TYPE_OTHER end if RideRequestFunction(moveType, TRUE, FALSE) == TRUE then return end end end Jump_InitWeaponRef = FALSE Jump_LeftWeaponRef = FALSE 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(SetLeftWeaponAnimOffset, 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 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_ROT) then SetVariable("IndexDeath", DEATH_TYPE_POISON) if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end 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 if IsDirectDeath() == TRUE then ExecEventAllBody("W_DeathStart") else ExecEventAllBody("W_NearDeathStart") end return TRUE end if ExecDamage(FALSE, FALSE) == TRUE then return TRUE end if ExecBirdAct() == TRUE then return TRUE end if ExecFookShot() == 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 local is_large_arrow_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_LARGE_ARROW) local is_large_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_ARROW) 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 end elseif c_Style == HAND_RIGHT 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 end if is_both_large_arrow == FALSE and is_both_ballista == FALSE then return FALSE end if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_RIGHT then if is_large_arrow_right == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end elseif is_large_arrow_left == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) else act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) end ExecEventHalfBlend(fireEvent, ALLBODY) return TRUE 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) elseif GetVariable("JumpAttackFormRequest") == 3 then SetVariable("JumpAttackForm", 6) 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) elseif GetVariable("JumpAttackFormRequest") == 3 then SetVariable("JumpAttackForm", 6) 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) elseif GetVariable("JumpAttackFormRequest") == 3 then SetVariable("JumpAttackForm", 6) 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) local rightKind = env(GetEquipWeaponCategory, HAND_RIGHT) local leftKind = env(GetEquipWeaponCategory, HAND_LEFT) local rightSpecialKind = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) local leftSpecialKind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) SprintUpdate() SetVariable("LandToMoveIndex", 0) act(AIJumpState) if GetVariable("JumpAttackForm") == 0 then act(NotifyAIOfBehaviourState, IDX_AINOTE_STATETYPE, IDX_AINOTE_STATETYPE_JUMP_NONATTACK) 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 if Act_Jump() == TRUE then return TRUE end if env(GetSpEffectID, 145) == FALSE and GetVariable("JumpAttack_Land") == 0 then if IsNodeActive("SuperJump Selector") == TRUE then hkbFireEvent("W_SuperJumpLoop") return TRUE else hkbFireEvent("W_Jump_Loop") return TRUE end 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 is_arrow == TRUE then if env(ActionRequest, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) g_ArrowSlot = ARROW_SLOT_SMALL elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) g_ArrowSlot = ARROW_SLOT_SMALL end end local is_staff = GetEquipType(equip_arm_no, WEAPON_CATEGORY_STAFF) if GetVariable("AddFookShotBlend") == 1 then elseif ExecAirUlt() == TRUE then elseif ExecJumpMagic(jump_type) == TRUE then return TRUE elseif ExecJumpItem(jump_type) == TRUE then elseif is_arrow == TRUE and (c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH) and env(IsOutOfAmmo, arrowHand) == TRUE then elseif GetEquipType(arrowHand, WEAPON_CATEGORY_CROSSBOW) == TRUE and (env(GetBoltLoadingState, arrowHand) == FALSE or env(IsOutOfAmmo, arrowHand) == TRUE) then 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 if ContainDs3Dual(sp_kind) == TRUE then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttackForm", 6) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE else ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 2) SetVariable("JumpAttackForm", 3) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttackForm", 6) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_LEFT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttackFormRequest", 2) SetVariable("JumpAttackForm", 6) SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end 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 if ContainDs3Dual(sp_kind) == TRUE then SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("JumpAttackFormRequest", 3) 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 else SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("JumpAttackFormRequest", 2) if jump_type == 0 then ExecEventNoReset("W_JumpAttack_Start_Falling_D") elseif jump_type == 1 then ExecEventNoReset("W_JumpAttack_Start_Falling_D") elseif jump_type == 2 then ExecEventNoReset("W_JumpAttack_Start_Falling_D") end end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("JumpAttackFormRequest", 3) 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 end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_LEFT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetInterruptType(INTERRUPT_FINDATTACK) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() SetVariable("JumpAttackFormRequest", 3) 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 end end end if ISENABLE_WALLJUMP == TRUE and env(IsHitWall) == TRUE and env(GetSpEffectID, 102200) == TRUE and GetVariable("JumpAttackForm") == 0 then local stickAngle = hkbGetVariable("TurnAngle") SetWeightIndex() if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_HEAVY then ResetRequest() elseif GetVariable("MoveSpeedLevel") >= 0.6 and stickAngle > -50 and stickAngle < 50 then local walljumpcastcheck = env(GetWallJumpCast) if env(GetSpEffectID, 5020) == TRUE then if walljumpcastcheck == 3 then hkbFireEvent("W_Climb_High_Start") ISENABLE_WALLJUMP = FALSE return end elseif env(GetSpEffectID, 5021) == TRUE then if walljumpcastcheck == 3 then hkbFireEvent("W_Climb_High_Start") ISENABLE_WALLJUMP = FALSE return elseif walljumpcastcheck == 1 then act(Unknown4010) hkbFireEvent("W_WallJumpCancelEarly") ISENABLE_WALLJUMP = FALSE return end elseif walljumpcastcheck == 3 then act(WallClimbReposition) hkbFireEvent("W_Climb_High_Start") ISENABLE_WALLJUMP = FALSE return elseif walljumpcastcheck == 2 then act(WallClimbReposition) hkbFireEvent("W_Climb_Middle_Start") ISENABLE_WALLJUMP = FALSE return elseif walljumpcastcheck == 1 then act(WallClimbReposition) hkbFireEvent("W_Climb_Low_Start") ISENABLE_WALLJUMP = FALSE return end end end if ExecWallJump() == TRUE then return end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE and env(GetSpEffectID, 140) == FALSE and env(IsAIJumping) == FALSE and env(GetSpEffectID, 704050) == FALSE then local landIndex = GetLandIndex(height, FALSE) local landIndex2 = GetLandIndex2(height, FALSE) SetVariable("LandIndex", landIndex) SetVariable("LandIndex2", landIndex2) if GetVariable("JumpAttackForm") == 0 then local JumpMoveLevel = 0 if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end if JUMPS == 1 and GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 3 end if SetSlowFeet() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 3 then hkbFireEvent("W_Jump_Land_To_Sprint") elseif JumpMoveLevel >= 1 and landIndex == LAND_HEAVY then ExecEvasion(FALSE, ESTEP_LAND, FALSE) return TRUE elseif 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") elseif jump_type == 3 then ExecEventNoReset("W_Jump_Land_S") end return TRUE else ExecEventAllBody("W_Jump_Attack_Land_F") return TRUE end 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") elseif jump_type == 3 then ExecEventNoReset("W_Jump_Land_S") 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 if env(ActionRequest, ACTION_ARM_MAGIC_R) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_L) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_R_HEAVY) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_L_HEAVY) == FALSE then return FALSE end if env(GetStamina) <= 0 then ResetRequest() return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() return FALSE end if env(IsMagicUseMenuOpened) == TRUE then return FALSE end local style = c_Style local magic_hand = HAND_RIGHT local wep_hand = HAND_RIGHT local delayActRequestNo = -1 local is_samagic = FALSE local magic_req = MAGIC_RIGHT_FIRST_SLOT 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 magic_req = MAGIC_LEFT_FIRST_SLOT 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 magic_req = MAGIC_LEFT_FIRST_SLOT act(DebugLogOutput, "MagicLeft") elseif env(ActionRequest, ACTION_ARM_MAGIC_R_HEAVY) == 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 magic_req = MAGIC_LEFT_SECOND_SLOT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_RIGHT magic_req = MAGIC_RIGHT_SECOND_SLOT end elseif env(ActionRequest, ACTION_ARM_MAGIC_L_HEAVY) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_L if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then ResetRequest() return FALSE end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT magic_req = MAGIC_LEFT_SECOND_SLOT act(DebugLogOutput, "MagicLeft") else return FALSE end act(DecideMagicUse, magic_req) act(NotifyAIMagicCast) if magic_req == MAGIC_RIGHT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_LEFT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_RIGHT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) elseif magic_req == MAGIC_LEFT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) else SetVariable("IndexMagicSlot", MAGIC_SLOT_CREATE) end 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_R_HEAVY) == FALSE and env(ActionRequest, ACTION_ARM_MAGIC_L_HEAVY) == FALSE then return FALSE end if env(GetStamina) <= 0 then ResetRequest() return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() return FALSE end if env(IsMagicUseMenuOpened) == TRUE then return FALSE end local style = c_Style local magic_hand = HAND_RIGHT local wep_hand = HAND_RIGHT local delayActRequestNo = -1 local is_samagic = FALSE local magic_req = MAGIC_RIGHT_FIRST_SLOT 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 magic_req = MAGIC_LEFT_FIRST_SLOT 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 magic_req = MAGIC_LEFT_FIRST_SLOT act(DebugLogOutput, "MagicLeft") elseif env(ActionRequest, ACTION_ARM_MAGIC_R_HEAVY) == 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 magic_req = MAGIC_LEFT_SECOND_SLOT else if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_RIGHT magic_req = MAGIC_RIGHT_SECOND_SLOT end elseif env(ActionRequest, ACTION_ARM_MAGIC_L_HEAVY) == TRUE then delayActRequestNo = ACTION_ARM_MAGIC_L if style == HAND_RIGHT_BOTH or style == HAND_LEFT_BOTH then ResetRequest() return FALSE end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) == FALSE then return FALSE end wep_hand = HAND_LEFT magic_hand = HAND_LEFT magic_req = MAGIC_LEFT_SECOND_SLOT act(DebugLogOutput, "MagicLeft") else return FALSE end act(DecideMagicUse, magic_req) act(NotifyAIMagicCast) if magic_req == MAGIC_RIGHT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_LEFT_FIRST_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_FIRST) elseif magic_req == MAGIC_RIGHT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) elseif magic_req == MAGIC_LEFT_SECOND_SLOT then SetVariable("IndexMagicSlot", MAGIC_SLOT_SECOND) else SetVariable("IndexMagicSlot", MAGIC_SLOT_CREATE) end 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 ExecJumpItem(jump_type) if c_HasActionRequest == FALSE then return FALSE end if env(GetSpEffectID, 102510) == TRUE then return FALSE end if env(ActionRequest, ACTION_ARM_USE_ITEM) == FALSE then return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() 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 style = c_Style if IsJumpItem() == FALSE then ResetRequest() return FALSE end if item_type ~= ITEM_DRINK and IsDemonSwordMode() == TRUE then return FALSE end if env(GetSpEffectID, 140) == TRUE and GetVariable("JumpAttackForm") == 0 then if env(GetStamina) <= 0 then return FALSE end ExecEventSync("Event_JumpNormalAttack_Add") SetVariable("JumpAttack_HandCondition", 4) SetVariable("JumpAttackForm", 5) elseif env(GetSpEffectID, 140) == FALSE and GetVariable("JumpAttack_Land") == 0 and GetVariable("JumpAttackForm") == 0 then SetVariable("JumpAttack_Land", 0) SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttack_HandCondition", 4) SetVariable("JumpAttackForm", 5) 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 end act(SetIsItemAnimationPlaying) act(SetNpcAIAttackRequestIDAfterBlend, env(GetNpcAIAttackRequestID)) SetAIActionState() return TRUE end function ExecFallItem() if c_HasActionRequest == FALSE then return FALSE end if env(ActionRequest, ACTION_ARM_USE_ITEM) == FALSE then return FALSE end if GetVariable("JumpAttackForm") >= 1 or IS_ATTACKED_JUMPMAGIC == TRUE then ResetRequest() 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 style = c_Style if IsJumpItem() == FALSE then ResetRequest() return FALSE end if item_type == ITEM_THROW_KNIFE then if env(GetStamina) <= 0 then return FALSE end SetVariable("JumpAttack_HandCondition", 4) SetVariable("JumpAttackForm", 5) elseif item_type == ITEM_THROW_BOTTLE then if env(GetStamina) <= 0 then return FALSE end SetVariable("JumpAttack_HandCondition", 4) SetVariable("JumpAttackForm", 5) elseif item_type == ITEM_QUICK_THROW_KNIFE then if env(GetStamina) <= 0 then return FALSE end SetVariable("JumpAttack_HandCondition", 4) SetVariable("JumpAttackForm", 5) elseif item_type == 58 then if env(GetStamina) <= 0 then return FALSE end SetVariable("JumpAttack_HandCondition", 4) SetVariable("JumpAttackForm", 5) end SetVariable("JumpAttackFormRequest", 3) SetVariable("JumpAttack_Land", 0) ExecEventNoReset("W_JumpAttack_Start_Falling") return TRUE end function IsJumpItem() local item_type = env(GetItemAnimType) if item_type == ITEM_THROW_KNIFE or item_type == ITEM_THROW_BOTTLE or item_type == ITEM_QUICK_THROW_KNIFE or item_type == 42 or item_type == 58 then return TRUE end return FALSE end function ExecWallJump() local height = env(GetFallHeight) / 100 SetWeightIndex() if env(ActionRequest, ACTION_ARM_JUMP) == TRUE and ISENABLE_WALLJUMP == TRUE and env(IsHitWall) == TRUE and GetVariable("JumpAttackForm") == 0 then if env(GetStamina) <= 0 or height > DISABLEJUMP_FALLDIST then ResetRequest() elseif GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_HEAVY then ResetRequest() else act(ChangeStamina, STAMINA_REDUCE_RIDE_JUMP) local wallAngle = hkbGetVariable("ContactWallAngle") if wallAngle > -45 and wallAngle < 45 then SetVariable("Selector_WallContactType", 0) elseif wallAngle > 135 or wallAngle < -135 then SetVariable("Selector_WallContactType", 1) elseif wallAngle > -135 and wallAngle < -45 then SetVariable("Selector_WallContactType", 2) else SetVariable("Selector_WallContactType", 3) end ExecEventAllBody("W_WallJumpReady") end ISENABLE_WALLJUMP = FALSE 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() JUMPN = 1 JUMPF = 0 JUMPD = 0 JUMPS = 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() JUMPN = 0 JUMPF = 1 JUMPD = 0 JUMPS = 0 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) if JumpCommonFunction(1) == TRUE then return end end function Jump_F_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_D_onActivate() act(AIJumpState) SetAIActionState() end function Jump_D_onUpdate() SetAIActionState() JUMPN = 0 JUMPF = 0 JUMPD = 1 JUMPS = 0 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_S_onActivate() act(AIJumpState) SetAIActionState() end function Jump_S_onUpdate() SetAIActionState() JUMPN = 0 JUMPF = 0 JUMPD = 0 JUMPS = 1 if GetVariable("JumpAttackForm") == 0 then act(LockonFixedAngleCancel) end if JumpCommonFunction(3) == TRUE then return end end function Jump_S_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Power_JumpHardAttack_onActivate() act(AIJumpState) SetAIActionState() end function Power_JumpHardAttack_onUpdate() SetAIActionState() JUMPN = 1 JUMPF = 0 JUMPD = 0 JUMPS = 0 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) if JumpCommonFunction(1) == TRUE then return end end function Power_JumpHardAttack_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Power_JumpHardAttackCancel_onActivate() act(AIJumpState) SetAIActionState() end function Power_JumpHardAttackCancel_onUpdate() SetAIActionState() JUMPN = 1 JUMPF = 0 JUMPD = 0 JUMPS = 0 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) if JumpCommonFunction(1) == TRUE then return end end function Power_JumpHardAttackCancel_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_FookShot_onActivate() act(AIJumpState) SetAIActionState() end function Jump_FookShot_onUpdate() SetAIActionState() JUMPN = 0 JUMPF = 0 JUMPD = 0 JUMPS = 1 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) if JumpCommonFunction(1) == TRUE then return end end function Jump_FookShot_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Jump_RideOff_onActivate() act(AIJumpState) SetAIActionState() end function Jump_RideOff_onUpdate() SetAIActionState() JUMPN = 0 JUMPF = 0 JUMPD = 1 JUMPS = 0 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() SprintUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if env(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if 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, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) g_ArrowSlot = ARROW_SLOT_SMALL elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) g_ArrowSlot = ARROW_SLOT_SMALL end end local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if GetVariable("AddFookShotBlend") == 1 then elseif ExecAirUlt() == TRUE then elseif ExecJumpMagic(0) == TRUE then elseif ExecFallItem() == TRUE then return TRUE elseif env(GetEquipWeaponCategory, equip_arm_no) == WEAPON_CATEGORY_STAFF and env(ActionRequest, ACTION_ARM_R1) == 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 if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 3) hkbFireEvent("W_JumpAttack_Start_Falling") return else SetVariable("JumpAttackForm", 3) SetVariable("JumpAttackFormRequest", 2) hkbFireEvent("W_JumpAttack_Start_Falling") return end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 3) hkbFireEvent("W_JumpAttack_Start_Falling") return end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_LEFT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 2) hkbFireEvent("W_JumpAttack_Start_Falling") return end end if 1 <= GetVariable("JumpAttackForm") then act(ResetInputQueue) end local landIndex = GetLandIndex(height, FALSE) local landIndex2 = GetLandIndex2(height, TRUE) 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 ExecWallJump() == TRUE then return end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE then SetVariable("LandIndex", landIndex) SetVariable("LandIndex2", landIndex2) local JumpMoveLevel = 0 if GetVariable("JumpAttackForm") == 0 then if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end if JUMPS == 1 and GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 3 end end if SetSlowFeet() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 3 then ExecEventNoReset("W_Jump_Land_To_Sprint") return elseif JumpMoveLevel >= 1 and landIndex == LAND_HEAVY then ExecEvasion(FALSE, ESTEP_LAND, FALSE) return TRUE elseif 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 JUMPN == 1 then ExecEventNoReset("W_Jump_Land_N") elseif JUMPF == 1 then ExecEventNoReset("W_Jump_Land_F") elseif JUMPD == 1 then ExecEventNoReset("W_Jump_Land_D") elseif JUMPS == 1 then ExecEventNoReset("W_Jump_Land_S") else ExecEventNoReset("W_Jump_Land_N") end return end end function Jump_Loop_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function Power_JumpHardAttack_Loop_onActivate() SetAIActionState() end function Power_JumpHardAttack_Loop_onUpdate() SprintUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if env(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if 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 if 1 <= GetVariable("JumpAttackForm") then act(ResetInputQueue) end local landIndex = GetLandIndex(height, FALSE) if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE then SetVariable("LandIndex", landIndex) if landIndex > 0 then ResetRequest() end ExecEventNoReset("W_Power_JumpHardAttack_Land") return end end function Power_JumpHardAttack_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() SprintUpdate() local is_arrow_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) if IsNodeActive("LandHeavyToMove_CMSG") == TRUE then 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 else if GetVariable("LandToMoveIndex") == 0 and GetVariable("MoveSpeedLevel") > 0 then SetVariable("LandToMoveIndex", 1) end 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 local r1 = "W_AttackRightLightSubStart" local b1 = "W_AttackBothLightSubStart" local l1 = "W_AttackLeftLight1" if GetVariable("JumpAttackForm") == 3 then l1 = "W_AttackLeftLight2" r1 = "W_AttackRightLight1" b1 = "W_AttackBothLight1" end if g_ComboReset == TRUE then r1 = "W_AttackRightLight1" b1 = "W_AttackBothLight1" end if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH or is_arrow_right == FALSE then if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return TRUE end elseif EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "W_AttackRightHeavy1Start", l1, "W_AttackLeftHeavy1", b1, "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING, AttackArrow) == 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 end if c_Style == HAND_LEFT_BOTH or c_Style == HAND_RIGHT_BOTH or is_arrow_right == FALSE then if env(IsAnimEnd, 0) == TRUE then ExecEventAllBody("W_Idle") return TRUE end elseif env(IsAnimEnd, 0) == TRUE then SetArrowGeneratorTransitionIndex() ExecEventAllBody("W_Idle") return TRUE end return FALSE end function Jump_Land_N_onUpdate() if GetVariable("JumpAttackForm") == 1 or GetVariable("JumpAttackForm") == 2 then SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 elseif GetVariable("JumpAttackForm") == 3 then SPEED_COMBO_NUMBER_DUAL = 1 end if JumpLandCommonFunction() == TRUE then return end end function Jump_Land_N_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Jump_Land_F_onUpdate() if GetVariable("JumpAttackForm") == 1 or GetVariable("JumpAttackForm") == 2 then SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 elseif GetVariable("JumpAttackForm") == 3 then SPEED_COMBO_NUMBER_DUAL = 1 end if JumpLandCommonFunction() == TRUE then return end end function Jump_Land_D_onUpdate() if GetVariable("JumpAttackForm") == 1 or GetVariable("JumpAttackForm") == 2 then SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 elseif GetVariable("JumpAttackForm") == 3 then SPEED_COMBO_NUMBER_DUAL = 1 end if JumpLandCommonFunction() == TRUE then return end end function Jump_Land_S_onUpdate() if GetVariable("JumpAttackForm") == 1 or GetVariable("JumpAttackForm") == 2 then SPEED_COMBO_NUMBER_RIGHT = 1 SPEED_COMBO_NUMBER_BOTH = 1 elseif GetVariable("JumpAttackForm") == 3 then SPEED_COMBO_NUMBER_DUAL = 1 end 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 Power_JumpHardAttack_Land_onUpdate() if JumpLandCommonFunction() == TRUE then return end end function Power_JumpHardAttack_Land_onDeactivate() SetVariable("JumpAttack_Land", 0) 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_AttackBothLightDash", "W_AttackBothHeavyDash", QUICKTYPE_NORMAL) == TRUE then return end end function Jump_Land_To_Sprint_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_AttackBothLightDash", "W_AttackBothHeavyDash", QUICKTYPE_NORMAL) == TRUE then return end end function Rolling_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 Rolling_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_AttackBothLightDash", "W_AttackBothHeavyDash", QUICKTYPE_NORMAL) == TRUE then return end end function Rolling_To_Sprint_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_AttackBothLightDash", "W_AttackBothHeavyDash", QUICKTYPE_NORMAL) == TRUE then return end end function JumpDamage_Start_onActivate() act(ResetInputQueue) end function JumpDamage_Start_onUpdate() JUMPN = 1 JUMPF = 0 JUMPD = 0 JUMPS = 0 act(DenyEventAnimPlaybackRequest) local height = env(GetFallHeight) / 100 local damage_type = env(GetReceivedDamageType) if env(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if env(IsHamariFallDeath, 12) == TRUE or damage_type == DAMAGE_TYPE_DEATH_FALLING or height >= 60 then ExecEventAllBody("W_FallDeath") return TRUE 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 WallJumpReady_onActivate() act(AIJumpState) SetAIActionState() end function WallJumpReady_onUpdate() SetAIActionState() JUMPN = 0 JUMPF = 1 JUMPD = 0 JUMPS = 0 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) if env(GetSpEffectID, 102210) == TRUE then if hkbGetVariable("MoveSpeedLevel") == 0 then SetVariable("Selector_WallJumpType", 0) else local wallAngle = hkbGetVariable("ContactWallAngle") if wallAngle > -45 and wallAngle < 45 then SetVariable("Selector_WallContactType", 0) elseif wallAngle > 135 or wallAngle < -135 then SetVariable("Selector_WallContactType", 1) elseif wallAngle > -135 and wallAngle < -45 then SetVariable("Selector_WallContactType", 2) else SetVariable("Selector_WallContactType", 3) end local stickAngle = hkbGetVariable("TurnAngle") if GetVariable("IsLockon") == true then local jumpangle = GetVariable("MoveAngle") if jumpangle > -45 and jumpangle < 45 then SetVariable("Selector_WallJumpType", 1) elseif jumpangle >= 45 and jumpangle <= 135 then SetVariable("Selector_WallJumpType", 4) elseif jumpangle >= -135 and jumpangle <= -45 then SetVariable("Selector_WallJumpType", 3) else SetVariable("Selector_WallJumpType", 2) end act(LockonFixedAngleCancel) elseif stickAngle > -45 and stickAngle < 45 then SetVariable("Selector_WallJumpType", 1) elseif stickAngle > 135 or stickAngle < -135 then SetVariable("Selector_WallJumpType", 2) elseif stickAngle > -135 and stickAngle < -45 then SetVariable("Selector_WallJumpType", 3) else SetVariable("Selector_WallJumpType", 4) end end ExecEventAllBody("W_WallJumpStart") end if JumpCommonFunction(1) == TRUE then return end end function WallJumpReady_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function WallJumpStart_onActivate() act(AIJumpState) SetAIActionState() local stickAngle = hkbGetVariable("TurnAngle") end function WallJumpStart_onUpdate() act(LockonFixedAngleCancel) SetAIActionState() JUMPN = 0 JUMPF = 1 JUMPD = 0 JUMPS = 0 local rolling_angle = GetVariable("JumpAngle") local addratio = 0.4 local endratio = 1 endratio = 1 + addratio * math.abs(math.sin(math.rad(2 * rolling_angle))) endratio = math.abs(endratio) act(SetMovementScaleMult, endratio) local walljumpcastcheck = env(GetWallJumpCast) local stickAngle = hkbGetVariable("TurnAngle") SetWeightIndex() if GetVariable("JumpAttackForm") == 0 then if GetVariable("EvasionWeightIndex") == EVASION_WEIGHT_INDEX_HEAVY then ResetRequest() elseif GetVariable("MoveSpeedLevel") >= 0.6 and stickAngle > -50 and stickAngle < 50 then local walljumpcastcheck = env(GetWallJumpCast) if env(GetSpEffectID, 5020) == TRUE then if walljumpcastcheck == 3 then hkbFireEvent("W_Climb_High_Start") ISENABLE_WALLJUMP = FALSE return end elseif env(GetSpEffectID, 5021) == TRUE then if walljumpcastcheck == 3 then hkbFireEvent("W_Climb_High_Start") ISENABLE_WALLJUMP = FALSE return elseif walljumpcastcheck == 1 then act(Unknown4010) hkbFireEvent("W_WallJumpCancelEarly") ISENABLE_WALLJUMP = FALSE return end elseif walljumpcastcheck == 3 and env(GetSpEffectID, 5031) == TRUE then act(WallClimbReposition) hkbFireEvent("W_Climb_High_Start") ISENABLE_WALLJUMP = FALSE return elseif walljumpcastcheck == 2 and env(GetSpEffectID, 5031) == TRUE then act(WallClimbReposition) hkbFireEvent("W_Climb_Middle_Start") ISENABLE_WALLJUMP = FALSE return elseif walljumpcastcheck == 1 and env(GetSpEffectID, 5030) == TRUE then act(WallClimbReposition) hkbFireEvent("W_Climb_Low_Start") ISENABLE_WALLJUMP = FALSE return end end end if JumpCommonFunction(1) == TRUE then return end end function WallJumpStart_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function WallJumpCancelEarly_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function WallJumpCancelEarly_onDeactivate() SetVariable("JumpAttack_Land", 0) end function WallJumpCancelLate_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end if env(GetEventEzStateFlag, 0) == TRUE then ExecEventAllBody("W_Idle") return end end function WallJumpCancelLate_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Climb_High_Start_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end if env(IsWallClimbComplete) == TRUE then ExecEventAllBody("W_Climb_High_End") return end end function Climb_High_Start_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Climb_High_End_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end end function Climb_High_End_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Climb_Middle_Start_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end if env(IsWallClimbComplete) == TRUE then ExecEventAllBody("W_Climb_Middle_End") return end end function Climb_Middle_Start_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Climb_Middle_End_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end end function Climb_Middle_End_onDeactivate() SetVariable("JumpAttack_Land", 0) end function Climb_Low_Start_onUpdate() act(FallPreventionAssist) if JumpLandCommonFunction() == TRUE then return end if env(IsWallClimbComplete) == TRUE then ExecEventAllBody("W_Idle") return end end function Climb_Low_Start_onDeactivate() SetVariable("JumpAttack_Land", 0) end function SuperJump_onActivate() act(ResetInputQueue) act(AIJumpState) SetAIActionState() end function SuperJump_onUpdate() JUMPN = 0 JUMPF = 1 JUMPD = 0 JUMPS = 0 if JumpCommonFunction(0) == TRUE then return end end function SuperJumpLoop_onActivate() SetAIActionState() end function SuperJumpLoop_onUpdate() SprintUpdate() SetAIActionState() act(DisallowAdditiveTurning, TRUE) if env(IsHamariFallDeath, 3) == TRUE then act(Unknown2090) end if 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, ACTION_ARM_R1) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_SMALL) g_ArrowSlot = ARROW_SLOT_SMALL elseif env(ActionRequest, ACTION_ARM_R2) == TRUE then act(ChooseBowAndArrowSlot, ARROW_SLOT_LARGE) g_ArrowSlot = ARROW_SLOT_SMALL end end local style = c_Style local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if GetVariable("AddFookShotBlend") == 1 then elseif ExecAirUlt() == TRUE then elseif ExecJumpMagic(0) == TRUE then elseif ExecFallItem() == TRUE then return TRUE elseif env(GetEquipWeaponCategory, equip_arm_no) == WEAPON_CATEGORY_STAFF and env(ActionRequest, ACTION_ARM_R1) == 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 if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 3) hkbFireEvent("W_JumpAttack_Start_Falling") return else SetVariable("JumpAttackForm", 3) SetVariable("JumpAttackFormRequest", 2) hkbFireEvent("W_JumpAttack_Start_Falling") return end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_RIGHT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 3) hkbFireEvent("W_JumpAttack_Start_Falling") return end elseif env(ActionRequest, ACTION_ARM_L1) == TRUE and c_Style == HAND_LEFT_BOTH then if ContainDs3Dual(sp_kind) == TRUE then SetVariable("JumpAttackForm", 6) SetVariable("JumpAttackFormRequest", 2) hkbFireEvent("W_JumpAttack_Start_Falling") return end end if 1 <= GetVariable("JumpAttackForm") then act(ResetInputQueue) end local landIndex = GetLandIndex(height, FALSE) local landIndex2 = GetLandIndex2(height, TRUE) 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 ExecWallJump() == TRUE then return end if env(GetSpEffectID, 98) == TRUE and env(IsTruelyLanding) == TRUE then SetVariable("LandIndex", landIndex) SetVariable("LandIndex2", landIndex2) local JumpMoveLevel = 0 if GetVariable("JumpAttackForm") == 0 then if GetVariable("MoveSpeedLevel") > 1.1 then JumpMoveLevel = 2 elseif GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 1 end if JUMPS == 1 and GetVariable("MoveSpeedLevel") > 0.6 then JumpMoveLevel = 3 end end if SetSlowFeet() == TRUE then JumpMoveLevel = 0 end if JumpMoveLevel == 3 then ExecEventNoReset("W_Jump_Land_To_Sprint") return elseif JumpMoveLevel >= 1 and landIndex == LAND_HEAVY then ExecEvasion(FALSE, ESTEP_LAND, FALSE) return TRUE elseif 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 JUMPN == 1 then ExecEventNoReset("W_Jump_Land_N") elseif JUMPF == 1 then ExecEventNoReset("W_Jump_Land_F") elseif JUMPD == 1 then ExecEventNoReset("W_Jump_Land_D") elseif JUMPS == 1 then ExecEventNoReset("W_Jump_Land_S") else ExecEventNoReset("W_Jump_Land_N") end return end end function SuperJumpLoop_onDeactivate() act(DisallowAdditiveTurning, FALSE) end function ThrowCounter_onUpdate() if GetVariable("RollingVariationIndex") == ROLLING_FOOKSHOT then act(SetMovementScaleMult, 1.5) end if env(GetSpEffectID, 703555) == TRUE then act(LockonFixedAngleCancel) end act(DisallowAdditiveTurning, TRUE) SetThrowAtkInvalid() if env(GetSpEffectID, 100390) == TRUE then ResetDamageCount() end SetEnableAimMode() local r1 = "W_AttackRightLightStep" if EvasionCommonFunction(FALL_TYPE_DEFAULT, r1, "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 ThrowCounter_onDeactivate() act(DisallowAdditiveTurning, FALSE) 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, 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 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 ExecMagic(quick_type, ALLBODY, 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 == ARROW_SLOT_SMALL 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 == ARROW_SLOT_SMALL 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 == ARROW_SLOT_SMALL 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_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "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_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end end function Stealth_Idle_onUpdate() act(Wait) act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetEnableAimMode() SetStealthState(STEALTH_IDLE) if IdleCommonFunction() == TRUE then return end if ExecArtsStance(ALLBODY) == TRUE then return end if ExecGuard(Event_GuardStart, ALLBODY) == TRUE then return end end function Stealth_Move_onActivate() act(SwitchMotion, TRUE) end function Stealth_Move_onUpdate() act(SwitchMotion, TRUE) local move_speed = GetVariable("MoveSpeedIndex") if move_speed == 2 then SetThrowAtkInvalid() end if g_TimeActEditor_08 >= 1 then act(Set4DirectionMovementThreshold, GetVariable("MagicRightWalkAngle_FrontLeft"), GetVariable("MagicRightWalkAngle_FrontRight"), GetVariable("MagicRightWalkAngle_BackLeft"), GetVariable("MagicRightWalkAngle_BackRight")) elseif 1 <= g_TimeActEditor_09 then act(Set4DirectionMovementThreshold, GetVariable("MagicLeftWalkAngle_FrontLeft"), GetVariable("MagicLeftWalkAngle_FrontRight"), GetVariable("MagicLeftWalkAngle_BackLeft"), GetVariable("MagicLeftWalkAngle_BackRight")) elseif hkbGetVariable("MoveType") < 0.5 then act(Set4DirectionMovementThreshold, 60, 45, 60, 60) elseif hkbGetVariable("StanceMoveType") == 0 then act(Set4DirectionMovementThreshold, 70, 40, 60, 20) else act(Set4DirectionMovementThreshold, 40, 70, 60, 20) end SpeedUpdate() if env(IsCOMPlayer) == TRUE then local npc_turn_speed = 240 if move_speed == 2 then npc_turn_speed = 180 else local dir = GetVariable("MoveDirection") if dir == 0 then npc_turn_speed = 90 end end SetTurnSpeed(npc_turn_speed) end if hkbGetVariable("MoveDirection") == 3 or hkbGetVariable("MoveDirection") == 2 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 1 then act(SetMovementScaleMult, 0.96) elseif hkbGetVariable("MoveDirection") == 0 then act(SetMovementScaleMult, 0.98) end end function Stealth_Move_Upper_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() if MoveCommonFunction(UPPER) == TRUE then return end end function StealthStopCommonFunction(is_dash_stop) act(Wait) act(SwitchMotion, TRUE) act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetEnableAimMode() SetStealthState(STEALTH_STOP) if StopCommonFunction(is_dash_stop) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then ExecEventAllBody("W_Stealth_Idle") return TRUE end return FALSE end function StealthDashStop_onUpdate() if StealthStopCommonFunction(TRUE) == TRUE then return end end function StealthRunStopFront_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function StealthRunStopBack_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function StealthRunStopLeft_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function StealthRunStopRight_onUpdate() if StealthStopCommonFunction(FALSE) == TRUE then return end end function Stealth_Rolling_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() SetStealthState(STEALTH_ROLLING) if env(IsAnimEnd, 1) == TRUE then hkbFireEvent("W_Stealth_Idle") return end if env(IsMoveCancelPossible) == TRUE and MoveStart(ALLBODY, Event_Stealth_Move, FALSE) == TRUE then return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end SetRollingTurnCondition(FALSE) end function Stealth_RollingSelftrans_onUpdate() act(SetAllowedThrowAttackType, THROW_STATE_STEALTH) SetWeightIndex() SetStealthState(STEALTH_ROLLING_SELFTRANS) if env(IsAnimEnd, 1) == TRUE and MoveStart(ALLBODY, Event_Stealth_Move, FALSE) == TRUE then return end if env(IsMoveCancelPossible) == TRUE and GetVariable("MoveSpeedLevel") <= 0 then MoveStart(ALLBODY, Event_Stealth_Move, FALSE) return end if EvasionCommonFunction(FALL_TYPE_DEFAULT, "W_AttackRightLightStep", "W_AttackRightHeavy1Start", "W_AttackLeftLight1", "W_AttackLeftHeavy1", "W_AttackBothLightStep", "W_AttackBothHeavy1Start", QUICKTYPE_ROLLING) == TRUE then return end SetRollingTurnCondition(TRUE) end function AddBlendSpeak_onUpdate() if env(IsAnimEnd, 2) == TRUE then SetVariable("AddBlendSpeakIndex", math.random(0, 2)) act(DebugLogOutput, "AddBlendSpeak_end") ExecEventAllBody("W_AddBlendSpeak") end end ------------------------------------------ -- 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}, [285] = {SWORD_ART_DIFF_CAT_DEFAULT}, [45] = {SWORD_ART_DIFF_CAT_DEFAULT}, [46] = {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}, [2] = {SWORD_ART_DIFF_CAT_DEFAULT}, [3] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM, WEAPON_CATEGORY_TWINBLADE}, [4] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [5] = {SWORD_ART_DIFF_CAT_DEFAULT}, [6] = {SWORD_ART_DIFF_CAT_DEFAULT}, [33] = {SWORD_ART_DIFF_CAT_DEFAULT}, [41] = {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}, [9] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [10] = {SWORD_ART_DIFF_CAT_DEFAULT}, [11] = {SWORD_ART_DIFF_CAT_DEFAULT}, [38] = {SWORD_ART_DIFF_CAT_DEFAULT}, [39] = {SWORD_ART_DIFF_CAT_DEFAULT}, [40] = {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}, [43] = {SWORD_ART_DIFF_CAT_DEFAULT}, [42] = {SWORD_ART_DIFF_CAT_DEFAULT}, [47] = {SWORD_ART_DIFF_CAT_DEFAULT}, [48] = {SWORD_ART_DIFF_CAT_DEFAULT}, [49] = {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}, [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}, [25] = {SWORD_ART_DIFF_CAT_DEFAULT}, [26] = {SWORD_ART_DIFF_CAT_DEFAULT}, [27] = {SWORD_ART_DIFF_CAT_DEFAULT}, [28] = {SWORD_ART_DIFF_CAT_DEFAULT}, [29] = {SWORD_ART_DIFF_CAT_DEFAULT}, [30] = {SWORD_ART_DIFF_CAT_DEFAULT}, [31] = {SWORD_ART_DIFF_CAT_DEFAULT}, [32] = {SWORD_ART_DIFF_CAT_DEFAULT}, [34] = {SWORD_ART_DIFF_CAT_DEFAULT}, [35] = {SWORD_ART_DIFF_CAT_DEFAULT}, [50] = {SWORD_ART_DIFF_CAT_DEFAULT}, [51] = {SWORD_ART_DIFF_CAT_DEFAULT}, [52] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_TWINBLADE}, [53] = {SWORD_ART_DIFF_CAT_DEFAULT}, [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}, [59] = {SWORD_ART_DIFF_CAT_DEFAULT}, [61] = {SWORD_ART_DIFF_CAT_DEFAULT}, [62] = {SWORD_ART_DIFF_CAT_DEFAULT}, [63] = {SWORD_ART_DIFF_CAT_DEFAULT}, [64] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_FIST}, [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}, [73] = {SWORD_ART_DIFF_CAT_DEFAULT}, [74] = {SWORD_ART_DIFF_CAT_DEFAULT}, [75] = {SWORD_ART_DIFF_CAT_DEFAULT}, [76] = {SWORD_ART_DIFF_CAT_DEFAULT}, [82] = {SWORD_ART_DIFF_CAT_DEFAULT}, [90] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_SMALL_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}, [92] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_SHORT_SWORD, WEAPON_CATEGORY_CURVEDSWORD, WEAPON_CATEGORY_SMALL_SHIELD}, [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}, [99] = {SWORD_ART_DIFF_CAT_DEFAULT}, [100] = {SWORD_ART_DIFF_CAT_DEFAULT}, [101] = {SWORD_ART_DIFF_CAT_DEFAULT}, [337] = {SWORD_ART_DIFF_CAT_DEFAULT}, [102] = {SWORD_ART_DIFF_CAT_DEFAULT}, [103] = {SWORD_ART_DIFF_CAT_DEFAULT}, [108] = {SWORD_ART_DIFF_CAT_DEFAULT}, [105] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_LARGE_ARROW}, [80] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_LARGE_ARROW}, [81] = {SWORD_ART_DIFF_CAT_DEFAULT}, [106] = {SWORD_ART_DIFF_CAT_DEFAULT}, [110] = {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}, [115] = {SWORD_ART_DIFF_CAT_DEFAULT}, [116] = {SWORD_ART_DIFF_CAT_DEFAULT}, [36] = {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}, [134] = {SWORD_ART_DIFF_CAT_DEFAULT}, [135] = {SWORD_ART_DIFF_CAT_DEFAULT}, [136] = {SWORD_ART_DIFF_CAT_DEFAULT}, [137] = {SWORD_ART_DIFF_CAT_DEFAULT}, [140] = {SWORD_ART_DIFF_CAT_DEFAULT}, [141] = {SWORD_ART_DIFF_CAT_DEFAULT}, [142] = {SWORD_ART_DIFF_CAT_DEFAULT}, [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}, [151] = {SWORD_ART_DIFF_CAT_DEFAULT}, [44] = {SWORD_ART_DIFF_CAT_DEFAULT}, [152] = {SWORD_ART_DIFF_CAT_DEFAULT}, [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}, [257] = {SWORD_ART_DIFF_CAT_DEFAULT, WEAPON_CATEGORY_TWINBLADE}, [258] = {SWORD_ART_DIFF_CAT_DEFAULT}, [264] = {SWORD_ART_DIFF_CAT_DEFAULT}, [276] = {SWORD_ART_DIFF_CAT_DEFAULT}, [278] = {SWORD_ART_DIFF_CAT_DEFAULT}, [279] = {SWORD_ART_DIFF_CAT_DEFAULT}, [262] = {SWORD_ART_DIFF_CAT_DEFAULT}, [270] = {SWORD_ART_DIFF_CAT_DEFAULT}, [313] = {SWORD_ART_DIFF_CAT_DEFAULT}, [281] = {SWORD_ART_DIFF_CAT_DEFAULT, 57}, [284] = {SWORD_ART_DIFF_CAT_DEFAULT, SWORD_ART_DIFF_CAT_LARGE_WEAPON, SWORD_ART_DIFF_CAT_POLEARM}, [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 170 <= artID and artID ~= 196 then return 0 end if artID == 169 then return WEAPON_CATEGORY_LARGE_ARROW end local wep_cat0 = wepCat local wep_cat1 = wep_cat0 if wep_cat1 == WEAPON_CATEGORY_CLAW then wep_cat1 = WEAPON_CATEGORY_FIST end local idle_cat0 = idleCat if idle_cat0 >= 10 then idle_cat0 = idle_cat0 - 10 end if wepCat == WEAPON_CATEGORY_LARGE_RAPIER then idle_cat0 = 0 end 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 = 4 elseif idle_cat0 == 3 and wepCat == WEAPON_CATEGORY_SMALL_SHIELD then shield_cat = 5 elseif idle_cat0 == 2 and wepCat == WEAPON_CATEGORY_LARGE_SHIELD then shield_cat = 8 elseif idle_cat0 == 3 and wepCat == WEAPON_CATEGORY_LARGE_SHIELD then shield_cat = 9 end if shield_cat ~= -1 then for art_cat = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][art_cat] == shield_cat then act(DebugLogOutput, "GetSwordArtsDiffCategory shield_cat:" .. shield_cat) return shield_cat end end end end for i = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][i] == wep_cat0 then act(DebugLogOutput, "GetSwordArtsDiffCategory wepCat0:" .. wep_cat0) return wep_cat0 end end for i = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][i] == wep_cat1 then act(DebugLogOutput, "GetSwordArtsDiffCategory wepCat1:" .. wep_cat1) return wep_cat1 end end if artID >= 90 and artID <= 99 and (c_SwordArtsHand ~= HAND_LEFT or c_Style == HAND_LEFT_BOTH) then return 0 end for i = 1, #SwordArtsCategory[artID], 1 do if SwordArtsCategory[artID][i] == idle_cat0 then act(DebugLogOutput, "GetSwordArtsDiffCategory idle_cat0:" .. idle_cat0) return idle_cat0 end end return 0 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}, [281] = {TRUE, FALSE, TRUE}, [285] = {TRUE, FALSE, TRUE}, [284] = {TRUE, FALSE, TRUE}, [366] = {TRUE, FALSE, TRUE}, [317] = {TRUE, FALSE, TRUE}, [319] = {FALSE, FALSE, TRUE}, [257] = {FALSE, FALSE, TRUE}, [320] = {TRUE, FALSE, TRUE}, [1] = {TRUE, FALSE, TRUE}, [2] = {TRUE, FALSE, TRUE}, [3] = {TRUE, FALSE, TRUE}, [5] = {TRUE, FALSE, TRUE}, [6] = {TRUE, FALSE, TRUE}, [81] = {TRUE, FALSE, TRUE}, [33] = {FALSE, FALSE, TRUE}, [41] = {TRUE, FALSE, TRUE}, [46] = {FALSE, FALSE, FALSE}, [35] = {TRUE, FALSE, TRUE}, [7] = {TRUE, FALSE, TRUE}, [8] = {FALSE, FALSE, TRUE}, [9] = {FALSE, FALSE, TRUE}, [10] = {TRUE, FALSE, TRUE}, [11] = {TRUE, FALSE, TRUE}, [45] = {TRUE, FALSE, TRUE}, [12] = {TRUE, FALSE, TRUE}, [13] = {TRUE, FALSE, TRUE}, [14] = {TRUE, FALSE, TRUE}, [15] = {TRUE, FALSE, TRUE}, [43] = {TRUE, FALSE, TRUE}, [42] = {TRUE, FALSE, TRUE}, [47] = {TRUE, FALSE, TRUE}, [48] = {TRUE, FALSE, TRUE}, [49] = {FALSE, FALSE, TRUE}, [16] = {TRUE, FALSE, TRUE}, [17] = {FALSE, FALSE, FALSE}, [18] = {TRUE, FALSE, TRUE}, [19] = {TRUE, FALSE, TRUE}, [20] = {TRUE, FALSE, TRUE}, [22] = {TRUE, FALSE, TRUE}, [23] = {TRUE, FALSE, TRUE}, [24] = {FALSE, FALSE, TRUE}, [25] = {TRUE, FALSE, TRUE}, [26] = {TRUE, FALSE, TRUE}, [29] = {FALSE, FALSE, TRUE}, [30] = {FALSE, FALSE, TRUE}, [31] = {FALSE, FALSE, TRUE}, [32] = {FALSE, FALSE, TRUE}, [34] = {FALSE, FALSE, TRUE}, [50] = {FALSE, FALSE, TRUE}, [51] = {TRUE, FALSE, TRUE}, [52] = {TRUE, FALSE, TRUE}, [53] = {FALSE, FALSE, TRUE}, [54] = {TRUE, FALSE, TRUE}, [55] = {TRUE, FALSE, FALSE}, [56] = {TRUE, FALSE, TRUE}, [57] = {TRUE, FALSE, TRUE}, [58] = {TRUE, FALSE, TRUE}, [59] = {TRUE, FALSE, TRUE}, [61] = {TRUE, FALSE, TRUE}, [62] = {TRUE, FALSE, FALSE}, [63] = {TRUE, FALSE, TRUE}, [64] = {FALSE, FALSE, TRUE}, [65] = {TRUE, FALSE, TRUE}, [66] = {TRUE, FALSE, TRUE}, [67] = {TRUE, FALSE, TRUE}, [68] = {TRUE, FALSE, TRUE}, [69] = {TRUE, FALSE, TRUE}, [70] = {TRUE, FALSE, TRUE}, [71] = {TRUE, FALSE, TRUE}, [72] = {TRUE, FALSE, TRUE}, [73] = {TRUE, FALSE, TRUE}, [74] = {FALSE, FALSE, TRUE}, [75] = {TRUE, FALSE, TRUE}, [76] = {TRUE, FALSE, TRUE}, [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}, [337] = {FALSE, FALSE, FALSE}, [102] = {FALSE, FALSE, FALSE}, [103] = {FALSE, FALSE, FALSE}, [105] = {FALSE, FALSE, FALSE}, [80] = {FALSE, FALSE, FALSE}, [106] = {FALSE, FALSE, FALSE}, [108] = {FALSE, FALSE, FALSE}, [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}, [36] = {FALSE, FALSE, TRUE}, [117] = {TRUE, FALSE, TRUE}, [118] = {TRUE, FALSE, TRUE}, [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] = {TRUE, FALSE, TRUE}, [150] = {TRUE, FALSE, TRUE}, [44] = {TRUE, 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] = {TRUE, FALSE, TRUE}, [168] = {TRUE, FALSE, TRUE}, [169] = {FALSE, FALSE, FALSE}, [170] = {TRUE, FALSE, TRUE}, [171] = {FALSE, FALSE, TRUE}, [172] = {TRUE, FALSE, FALSE}, [82] = {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}, [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] = {TRUE, FALSE, TRUE}, [234] = {TRUE, FALSE, TRUE}, [235] = {TRUE, FALSE, TRUE}, [236] = {TRUE, FALSE, TRUE}, [237] = {TRUE, FALSE, TRUE}, [238] = {TRUE, FALSE, TRUE}, [239] = {TRUE, FALSE, TRUE}, [240] = {TRUE, FALSE, TRUE}, [241] = {TRUE, FALSE, TRUE}, [242] = {TRUE, FALSE, TRUE}, [243] = {TRUE, 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}, [256] = {TRUE, FALSE, TRUE}, [258] = {TRUE, FALSE, FALSE}, [264] = {FALSE, FALSE, TRUE}, [260] = {TRUE, FALSE, TRUE}, [261] = {FALSE, FALSE, TRUE}, [262] = {TRUE, FALSE, TRUE}, [270] = {FALSE, FALSE, TRUE}, [276] = {FALSE, FALSE, TRUE}, [278] = {TRUE, FALSE, TRUE}, [279] = {FALSE, FALSE, TRUE}, [310] = {FALSE, FALSE, TRUE}, [311] = {FALSE, FALSE, TRUE}, [318] = {TRUE, FALSE, TRUE}, [325] = {FALSE, FALSE, TRUE}, [361] = {TRUE, FALSE, TRUE}, [365] = {FALSE, FALSE, TRUE}, [353] = {FALSE, FALSE, TRUE}, [336] = {TRUE, FALSE, TRUE}, [336] = {FALSE, FALSE, FALSE}, [323] = {FALSE, FALSE, TRUE}, [351] = {TRUE, FALSE, TRUE}, [313] = {TRUE, FALSE, TRUE}, [27] = {TRUE, FALSE, TRUE}, [28] = {TRUE, FALSE, TRUE}, [327] = {TRUE, FALSE, TRUE}, [328] = {FALSE, FALSE, TRUE}, [38] = {FALSE, FALSE, FALSE}, [335] = {TRUE, FALSE, TRUE}, [39] = {FALSE, FALSE, TRUE}, [40] = {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() local retval = FALSE if c_Style == HAND_RIGHT then if c_SwordArtsHand == HAND_RIGHT then retval = SwordArtPutOppositeWeapon[c_SwordArtsID][1] else retval = SwordArtPutOppositeWeapon[c_SwordArtsID][2] end else retval = SwordArtPutOppositeWeapon[c_SwordArtsID][3] end return retval end -- Table storing information about spells. -- Concerns playing a "weapon retrieval" animation after -- the spell was executed. -- -- Table key: Magic ID (TAE ID minus 400) -- Value 1: Right hand, magic cast from right hand -- Value 2: Right hand, magic cast from left hand -- Value 3: Left hand -- -- TRUE: Weapon was sheathed during animation, play retrieval animation. -- FALSE: Weapon was used to perform the magic, no retrieval animation. MagicPutOppositeWeapon = { [0] = {TRUE, TRUE, TRUE}, [1] = {FALSE, FALSE, TRUE}, [2] = {FALSE, FALSE, TRUE}, [3] = {FALSE, FALSE, TRUE}, [4] = {FALSE, FALSE, TRUE}, [5] = {TRUE, TRUE, TRUE}, [6] = {TRUE, TRUE, TRUE}, [7] = {TRUE, TRUE, TRUE}, [8] = {FALSE, FALSE, TRUE}, [9] = {FALSE, FALSE, TRUE}, [10] = {FALSE, FALSE, TRUE}, [11] = {FALSE, FALSE, TRUE}, [12] = {FALSE, FALSE, TRUE}, [13] = {FALSE, FALSE, TRUE}, [14] = {TRUE, TRUE, TRUE}, [15] = {TRUE, TRUE, TRUE}, [16] = {FALSE, FALSE, TRUE}, [17] = {FALSE, FALSE, TRUE}, [18] = {FALSE, FALSE, TRUE}, [19] = {FALSE, FALSE, TRUE}, [20] = {FALSE, FALSE, TRUE}, [21] = {FALSE, FALSE, TRUE}, [22] = {TRUE, TRUE, TRUE}, [23] = {FALSE, FALSE, TRUE}, [24] = {TRUE, TRUE, TRUE}, [25] = {FALSE, FALSE, TRUE}, [26] = {FALSE, FALSE, TRUE}, [27] = {FALSE, FALSE, TRUE}, [28] = {FALSE, FALSE, TRUE}, [29] = {FALSE, FALSE, TRUE}, [30] = {FALSE, FALSE, TRUE}, [31] = {FALSE, FALSE, TRUE}, [32] = {FALSE, FALSE, TRUE}, [33] = {FALSE, FALSE, TRUE}, [34] = {FALSE, FALSE, TRUE}, [35] = {FALSE, FALSE, TRUE}, [36] = {FALSE, FALSE, TRUE}, [37] = {FALSE, FALSE, TRUE}, [38] = {FALSE, FALSE, TRUE}, [39] = {FALSE, FALSE, TRUE}, [40] = {FALSE, FALSE, TRUE}, [41] = {FALSE, FALSE, TRUE}, [42] = {FALSE, FALSE, TRUE}, [43] = {FALSE, FALSE, TRUE}, [44] = {FALSE, FALSE, TRUE}, [45] = {FALSE, FALSE, TRUE}, [46] = {FALSE, FALSE, TRUE}, [47] = {FALSE, FALSE, TRUE}, [48] = {TRUE, TRUE, TRUE}, [49] = {FALSE, FALSE, TRUE}, [50] = {TRUE, TRUE, TRUE}, [51] = {TRUE, TRUE, TRUE}, [52] = {FALSE, FALSE, TRUE}, [53] = {FALSE, FALSE, TRUE}, [54] = {TRUE, TRUE, TRUE}, [55] = {TRUE, TRUE, TRUE}, [56] = {TRUE, TRUE, TRUE}, [57] = {TRUE, TRUE, TRUE}, [58] = {TRUE, TRUE, TRUE}, [59] = {FALSE, FALSE, TRUE}, [60] = {TRUE, TRUE, TRUE}, [61] = {FALSE, FALSE, TRUE}, [62] = {FALSE, FALSE, TRUE}, [63] = {FALSE, FALSE, TRUE}, [64] = {FALSE, FALSE, TRUE}, [65] = {FALSE, FALSE, TRUE}, [66] = {FALSE, FALSE, TRUE}, [67] = {TRUE, TRUE, TRUE}, [68] = {FALSE, FALSE, TRUE}, [69] = {FALSE, FALSE, TRUE}, [70] = {FALSE, FALSE, TRUE}, [71] = {TRUE, TRUE, TRUE}, [72] = {FALSE, FALSE, TRUE}, [73] = {FALSE, FALSE, TRUE}, [74] = {TRUE, TRUE, TRUE}, [75] = {FALSE, FALSE, TRUE}, [76] = {FALSE, FALSE, TRUE}, [77] = {FALSE, FALSE, TRUE}, [78] = {FALSE, FALSE, TRUE}, [79] = {FALSE, FALSE, TRUE}, [80] = {FALSE, FALSE, TRUE}, [81] = {TRUE, TRUE, TRUE}, [82] = {TRUE, TRUE, TRUE}, [83] = {FALSE, FALSE, TRUE}, [84] = {FALSE, FALSE, TRUE}, [85] = {FALSE, FALSE, TRUE}, [86] = {TRUE, TRUE, TRUE}, [87] = {TRUE, TRUE, TRUE}, [88] = {TRUE, TRUE, TRUE}, [89] = {TRUE, TRUE, TRUE}, [90] = {TRUE, TRUE, TRUE}, [91] = {TRUE, TRUE, TRUE}, [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, TRUE}, [100] = {FALSE, FALSE, TRUE}, [101] = {FALSE, FALSE, TRUE}, [102] = {TRUE, TRUE, TRUE}, [103] = {FALSE, FALSE, TRUE}, [104] = {FALSE, FALSE, TRUE}, [105] = {TRUE, TRUE, TRUE}, [106] = {FALSE, FALSE, TRUE}, [107] = {FALSE, FALSE, TRUE}, [108] = {FALSE, FALSE, TRUE}, [109] = {FALSE, FALSE, TRUE}, [110] = {FALSE, FALSE, TRUE}, [111] = {FALSE, FALSE, TRUE}, [112] = {FALSE, FALSE, TRUE}, [113] = {FALSE, FALSE, TRUE}, [114] = {FALSE, FALSE, TRUE}, [115] = {TRUE, TRUE, TRUE}, [116] = {TRUE, TRUE, TRUE}, [117] = {FALSE, FALSE, TRUE}, [118] = {FALSE, FALSE, TRUE}, [119] = {FALSE, FALSE, TRUE}, [120] = {TRUE, TRUE, TRUE}, [121] = {TRUE, TRUE, TRUE}, [122] = {TRUE, TRUE, TRUE}, [123] = {TRUE, TRUE, TRUE}, [124] = {FALSE, FALSE, TRUE}, [125] = {FALSE, FALSE, TRUE}, [126] = {FALSE, FALSE, TRUE}, [127] = {FALSE, FALSE, TRUE}, [128] = {FALSE, FALSE, TRUE}, [129] = {FALSE, FALSE, TRUE}, [130] = {FALSE, FALSE, TRUE}, [131] = {FALSE, FALSE, TRUE}, [132] = {FALSE, FALSE, TRUE}, [133] = {FALSE, FALSE, TRUE}, [134] = {FALSE, FALSE, TRUE}, [135] = {FALSE, FALSE, TRUE}, [136] = {FALSE, FALSE, TRUE}, [137] = {FALSE, FALSE, TRUE}, [138] = {FALSE, FALSE, TRUE}, [139] = {FALSE, FALSE, TRUE}, [140] = {FALSE, FALSE, TRUE}, [141] = {FALSE, FALSE, TRUE}, [142] = {FALSE, FALSE, TRUE}, [143] = {FALSE, FALSE, TRUE}, [144] = {FALSE, FALSE, TRUE}, [145] = {FALSE, FALSE, TRUE}, [146] = {FALSE, FALSE, TRUE}, [147] = {FALSE, FALSE, TRUE}, [148] = {FALSE, FALSE, TRUE}, [149] = {FALSE, FALSE, TRUE}, [150] = {FALSE, FALSE, TRUE} } -- Decides whether to perform a "retrieve weapon" animation after finishing a magic spell. -- See the above table for reference. function GetMagicPutOppositeWeapon() local retval = FALSE local sp_kind_L = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) local sp_kind_R = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) if sp_kind_L == 999 then sp_kind_L = 522 end if sp_kind_R == 999 then sp_kind_R = 522 end if c_Style == HAND_RIGHT then if g_Magichand == HAND_RIGHT then retval = MagicPutOppositeWeapon[g_MagicIndex][1] if sp_kind_L == 522 then retval = FALSE end else retval = MagicPutOppositeWeapon[g_MagicIndex][2] if sp_kind_R == 522 then retval = FALSE end end else retval = MagicPutOppositeWeapon[g_MagicIndex][3] end return retval 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 function IsWeaponCatalyst(sp_kind) local weaponCatalystSpKinds = { 293, -- Carian Sorcery Sword } if Contains(weaponCatalystSpKinds, sp_kind) == TRUE then return TRUE end return FALSE end ------------------------ -- Core: Global Variables ------------------------ JUMPN = 0 JUMPF = 0 JUMPD = 0 JUMPS = 0 PROTO1 = 0 PROTO2 = 0 PROTO3 = 0 PROTO4 = 0 PROTO5 = 0 START_COUNT = 0 ISENABLE_NEARDEATHREVIVAL = FALSE ISENABLE_WALLJUMP = TRUE ISENABLE_SPRINTSTART = TRUE ISENABLE_TRANCESTART = TRUE ISENABLE_TRANCESTOP = FALSE ISENABLE_DEMONSWORDSTANCE_TO_SPRINTSTART = FALSE ISENABLE_ARROWTPSSHOT = FALSE BIRDMOVERISE_COUNT = 0 BIRDMOVE_Y_COUNT = 0 MAGIC_SLOT = 0 WEAPON_BEHAVIOR_RIGHT = 1 WEAPON_BEHAVIOR_LEFT = 1 FOOKSHOT_ANGLE = 0 FOOKSHOT_TARGET_DIST = 0 FOOKSHOT_KNOCKBACK_RATE = 1 SPEED_COMBO_NUMBER_RIGHT = 0 SPEED_COMBO_NUMBER_LEFT = 0 SPEED_COMBO_NUMBER_BOTH = 0 SPEED_COMBO_NUMBER_DUAL = 0 MAGIC_ELMENTAL_NUMBER = 0 POWER_DAMAGE_COUNTER = 0 ATTACKER_ULT_COUNTER = 0 ESTUS_COUNTER = 1 ENHANCED_RESISTANCE = 0 RELIC_WEAPONCHANGE_ENCHANT = 0 RUNE_BONUS = 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_ROT = 21 DAMAGE_ELEMENT_BLOODLOSS = 22 DAMAGE_ELEMENT_FROSTBITE = 23 DAMAGE_ELEMENT_SLEEP = 24 DAMAGE_ELEMENT_MADNESS = 25 DAMAGE_ELEMENT_DEATH = 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 STATUS_EFFECT_POISON = 0 STATUS_EFFECT_ROT = 1 STATUS_EFFECT_BLOODLOSS = 2 STATUS_EFFECT_DEATH = 3 STATUS_EFFECT_FROSTBITE = 4 STATUS_EFFECT_SLEEP = 5 STATUS_EFFECT_MADNESS = 6 -- Reassign name for better reading ACTION_ARM_JUMP = ACTION_ARM_CHANGE_STYLE -- Enums for easier reading of MagicSlot stuff MAGIC_SLOT_FIRST = 0 MAGIC_SLOT_SECOND = 1 MAGIC_SLOT_CREATE = 2 -- Enums for bow/crossbow stuff ARROW_SLOT_SMALL = 0 ARROW_SLOT_LARGE = 1 -- Enums for weapon referencing, which supports all weapon slots WEAPON_REF_LEFT = 0 WEAPON_REF_RIGHT = 1 WEAPON_REF_SKILL = 2 WEAPON_REF_ULTRA = 3 WEAPON_REF_EXTRA = 4 WEAPON_REF_BIRD = 5 -- Enums for Revenant's Summons SUMMON_HELEN = 0 SUMMON_FREDERICK = 1 SUMMON_SEBASTIAN = 2 -- Enums for Rolling variations ROLLING_DEFAULT = 0 ROLLING_TANK = 1 ROLLING_SPEED = 2 ROLLING_FOOKSHOT = 3 ROLLING_MAGIC = 4 ROLLING_UNK = 5 ROLLING_HIGHGUARD = 6 ROLLING_CHEATDEATH = 7 ROLLING_CREATEMAGIC_THUNDER = 8 ROLLING_DEMONSWORD = 9 ROLLING_BUFFER = 10 ROLLING_TRANCE = 11 ROLLING_TRANCE_ENHANCE = 12 HERO_WYLDER = HERO_BALANCE HERO_GUARDIAN = HERO_TANK HERO_IRONEYE = HERO_SHOOTER HERO_DUCHESS = HERO_SPEED HERO_RAIDER = HERO_POWER HERO_REVENANT = HERO_NECROMANCER HERO_RECLUSE = HERO_MAGIC HERO_EXECUTOR = HERO_TECHNICAL HERO_SCHOLAR = HERO_BUFFER HERO_UNDERTAKER = HERO_ATTACKER -- Enums for more TravelMags ATTACK_RIGHT_CHAIN_FINISH = 99 ATTACK_LEFT_LIGHTSTEP = 110 ATTACK_LEFT_BACKSTEP = 120 ATTACK_LEFT_DASH = 130 ATTACK_LEFT_CHAIN_FINISH = 199 ATTACK_BOTH_CHAIN_FINISH = 299 ATTACK_DUAL_LIGHTSTEP = 310 ATTACK_DUAL_BACKSTEP = 320 ATTACK_DUAL_DASH = 330 ATTACK_DUAL_CHAIN_FINISH = 399 ATTACK_ARTS_ONESHOT = 400 ATTACK_ARTS_COMBO1 = 410 ATTACK_ARTS_COMBO2 = 420 ATTACK_ARTS_ONESHOT_LONG = 450 ATTACK_ARTS_COMBO1_LONG = 460 ATTACK_ARTS_COMBO2_LONG = 470 ATTACK_MAGIC_FIRE = 500 ATTACK_MAGIC_LIGHTSTEP = 510 ATTACK_MAGIC_BACKSTEP = 520 ATTACK_MAGIC_DASH = 530 ATTACK_MAGIC_FIRE_LONG = 550 g_IsMimicry = 0 g_EnableMimicry = 0 IS_ATTACKED_JUMPMAGIC = FALSE ------------------------ -- 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 GetReceivedDamageDirectionAlt = 223 -- appears in c9997 hks, unsure of difference 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 IsVersusDragonDamage = 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: