function isGraceborneWeapon(hand) if env(GetEquipWeaponCategory, hand) == 65 then return TRUE end if env(GetEquipWeaponCategory, hand) == 64 then return TRUE end return FALSE end function GraceborneGetAttackRequest(is_guard) local style = c_Style local is_both = FALSE local is_both_right = FALSE if style >= HAND_LEFT_BOTH then is_both = TRUE end if style == HAND_RIGHT_BOTH then is_both_right = TRUE end local hand = HAND_RIGHT if style == HAND_LEFT_BOTH then hand = HAND_LEFT end --graceborne weapon check -- if isGraceborneWeapon(hand) == FALSE then -- return ATTACK_REQUEST_INVALID -- end --end graceborne weapon check local is_arrow = GetEquipType(hand, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW) local is_crossbow = GetEquipType(hand, WEAPON_CATEGORY_CROSSBOW, 65) local is_ballista = GetEquipType(hand, WEAPON_CATEGORY_BALLISTA) local is_staff = GetEquipType(hand, WEAPON_CATEGORY_STAFF) local request_r1 = env(ActionRequest, ACTION_ARM_R1) local request_r2 = env(ActionRequest, ACTION_ARM_R2) local request_l1 = env(ActionRequest, ACTION_ARM_L1) local request_l2 = env(ActionRequest, ACTION_ARM_L2) if env(ActionDuration, ACTION_ARM_ACTION) > 0 then request_r1 = FALSE request_r2 = FALSE request_l1 = FALSE request_l2 = FALSE end -- R2 if request_r1 == TRUE and is_staff == FALSE or request_r2 == TRUE and is_staff == TRUE then if is_both == TRUE then if is_arrow == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) if style == HAND_LEFT_BOTH then return ATTACK_REQUEST_ARROW_FIRE_LEFT else return ATTACK_REQUEST_ARROW_FIRE_RIGHT end elseif is_crossbow == TRUE or is_ballista == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW else return ATTACK_REQUEST_BOTH_LIGHT end elseif is_guard == TRUE then local is_spear = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SPEAR) local is_rapier = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_RAPIER) local is_large_spear = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_SPEAR) local is_large_rapier = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_LARGE_RAPIER) -- Shield Poke if is_spear == TRUE or is_rapier == TRUE or is_large_spear == TRUE or is_large_rapier == TRUE then if env(ActionDuration, ACTION_ARM_L1) > 0 then return ATTACK_REQUEST_ATTACK_WHILE_GUARD else return ATTACK_REQUEST_RIGHT_LIGHT end else if is_arrow == TRUE or is_ballista == TRUE then return ATTACK_REQUEST_ARROW_BOTH_RIGHT end if is_crossbow == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_RIGHT_CROSSBOW end return ATTACK_REQUEST_RIGHT_LIGHT end else if is_arrow == TRUE or is_ballista == TRUE then return ATTACK_REQUEST_ARROW_BOTH_RIGHT end if is_crossbow == TRUE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_RIGHT_CROSSBOW end return ATTACK_REQUEST_RIGHT_LIGHT end end -- R2 if request_r2 == TRUE then -- Bow / Greatbow if is_arrow == TRUE then if is_both == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) if style == HAND_LEFT_BOTH then return ATTACK_REQUEST_ARROW_FIRE_LEFT2 else return ATTACK_REQUEST_ARROW_FIRE_RIGHT2 end else return ATTACK_REQUEST_ARROW_BOTH_RIGHT end -- Crossbow elseif is_crossbow == TRUE then if is_both == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 else g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_RIGHT_CROSSBOW2 end -- Ballista elseif is_ballista == TRUE then if is_both == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 else return ATTACK_REQUEST_ARROW_BOTH_RIGHT end -- 2H Heavy else local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if sp_kind == 293 then return ATTACK_REQUEST_INVALID end if is_both == TRUE then return ATTACK_REQUEST_BOTH_HEAVY -- R1 Heavy else return ATTACK_REQUEST_RIGHT_HEAVY end end end -- L1 if request_l1 == TRUE then if env(IsPrecisionShoot) == TRUE then return ATTACK_REQUEST_INVALID end local is_shield_left = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_TORCH) local is_shield_right = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_SHIELD, WEAPON_CATEGORY_MIDDLE_SHIELD, WEAPON_CATEGORY_LARGE_SHIELD, WEAPON_CATEGORY_TORCH) local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, hand) if is_both == TRUE and sp_kind == 249 then return ATTACK_REQUEST_BOTH_LEFT end if is_shield_left == TRUE then return ATTACK_REQUEST_INVALID end if is_shield_right == TRUE and is_both_right == TRUE then return ATTACK_REQUEST_INVALID end is_arrow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) is_crossbow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW, 65) if is_arrow == TRUE then if is_both == FALSE then return ATTACK_REQUEST_ARROW_BOTH_LEFT else return ATTACK_REQUEST_INVALID end elseif is_crossbow == TRUE then if is_both == FALSE then g_ArrowSlot = 0 act(ChooseBowAndArrowSlot, 0) return ATTACK_REQUEST_LEFT_CROSSBOW else return ATTACK_REQUEST_INVALID end end is_staff = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_STAFF) if is_staff == TRUE then return ATTACK_REQUEST_INVALID end is_arrow = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, 65, WEAPON_CATEGORY_BALLISTA) if is_arrow == TRUE and is_both == TRUE then return ATTACK_REQUEST_INVALID end is_crossbow = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_CROSSBOW, 65) if is_crossbow == TRUE and is_both == TRUE then return ATTACK_REQUEST_INVALID end local isEnableDualWielding = IsEnableDualWielding() if isEnableDualWielding == HAND_RIGHT then return ATTACK_REQUEST_DUAL_RIGHT elseif isEnableDualWielding == HAND_LEFT then return ATTACK_REQUEST_DUAL_LEFT end if IsWeaponCanGuard() == TRUE then return ATTACK_REQUEST_INVALID end return ATTACK_REQUEST_LEFT_HEAVY end -- L2 if request_l2 == TRUE then act(DebugLogOutput, "action request ACTION_ARM_L2") if is_both == FALSE then is_arrow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) is_crossbow = GetEquipType(HAND_LEFT, WEAPON_CATEGORY_CROSSBOW, 65) if is_arrow == TRUE then return ATTACK_REQUEST_ARROW_BOTH_LEFT elseif is_crossbow == TRUE then g_ArrowSlot = 1 act(ChooseBowAndArrowSlot, 1) return ATTACK_REQUEST_LEFT_CROSSBOW2 end local sp_kind = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) if sp_kind == 293 then return ATTACK_REQUEST_INVALID end end if c_SwordArtsID == 399 then if is_both == FALSE then return ATTACK_REQUEST_LEFT_HEAVY else return ATTACK_REQUEST_BOTH_LIGHT end end --graceborne only 2H AoW local trick2HandArts_list = {29, 31, 32, 34, 37, 38, 40, 42, 43, 44, 60, 64, 78, 80, 84, 85, 86, 94, 311} if Contains(trick2HandArts_list, c_SwordArtsID) == TRUE and style < HAND_LEFT_BOTH then return ATTACK_REQUEST_INVALID end --end graceborne only 2H AoW if c_IsEnableSwordArts == TRUE then local swordartrequest = GetSwordArtsRequestNew() local is_arrowright = GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_BALLISTA) if swordartrequest == SWORDARTS_REQUEST_RIGHT_STANCE and is_arrowright == TRUE then if style ~= HAND_RIGHT_BOTH then return ATTACK_REQUEST_ARROW_BOTH_RIGHT else return swordartrequest end else return swordartrequest end elseif is_both == TRUE then if GetEquipType(hand, WEAPON_CATEGORY_STAFF) == TRUE then return ATTACK_REQUEST_BOTH_LIGHT else return ATTACK_REQUEST_BOTH_HEAVY end else return ATTACK_REQUEST_LEFT_HEAVY end end return ATTACK_REQUEST_INVALID end function isGraceBorneWeaponWithBullets() if env(GetEquipWeaponCategory, HAND_LEFT) ~= 65 then return FALSE elseif env(GetEventFlag, 61200) == 1 then return FALSE end return TRUE end function GraceborneExecAttack(r1, r2, l1, l2, b1, b2, is_guard, blend_type, artsr1, artsr2, is_stealth_rolling) if (env(1116, 8000980) == TRUE) then ExecEventHalfBlend(Event_AttackCrossbowBothRightReload, blend_type) -- 37130 - Sheathe Halfblend end local cur_stamina = env(GetStamina) if cur_stamina <= 0 and GetVariable("StaminaComboResetTest") == 1 then g_ComboReset = TRUE end local request = GraceborneGetAttackRequest(is_guard) if request == ATTACK_REQUEST_INVALID then return FALSE end act(DebugLogOutput, "ExecAttack request=" .. request) local style = c_Style local swordartpoint_hand = HAND_RIGHT local atk_hand = HAND_RIGHT local guard_hand = HAND_RIGHT local is_find_atk = TRUE if cur_stamina <= 0 then ResetRequest() return FALSE end local is_Dual = FALSE g_ComboReset = FALSE if c_Style == HAND_LEFT_BOTH then swordartpoint_hand = HAND_LEFT end act(SetDamageMotionBlendRatio, 0) if env(IsSpecialTransitionPossible) == TRUE then r1 = "W_AttackRightLight1" l1 = "W_AttackLeftLight1" b1 = "W_AttackBothLight1" -- 132 "[HKS] Recovery Window: Heavy Attack" -- Applied in TAE if env(GetSpEffectID, 132) == FALSE then r2 = "W_AttackRightHeavy1Start" l2 = "W_AttackLeftHeavy1" b2 = "W_AttackBothHeavy1Start" end end -- Clever's animation jumping START -- Noctis' SpEffects 80009XX if (env(1116, 8000904) == TRUE) then r2 = "W_AttackDualLight1" -- 34000 - 1H Backstep R2 end if (env(1116, 8000905) == TRUE) then b2 = "W_AttackDualLight2" -- 34010 - 2H Backstep R2 end if (env(1116, 8000906) == TRUE) then r1 = "W_AttackDualLight3" -- 34020 - 1H Side DL R1 end if (env(1116, 8000907) == TRUE) then r1 = "W_AttackDualLight4" -- 34030 - 1H Side DR R1 end if (env(1116, 8000908) == TRUE) then b1 = "W_AttackDualLight5" -- 34040 - 2H Side DL R1 end if (env(1116, 8000909) == TRUE) then b1 = "W_AttackDualLight6" -- 34050 - 2H Side DR R1 end if (env(1116, 8000910) == TRUE) then r1 = "W_AttackRightLight2" -- 30010 - 1H R1 2 Chain Reset end if (env(1116, 8000911) == TRUE) then b1 = "W_AttackBothLight2" -- 32010 - 2H R1 2 Chain Reset end if (env(1116, 8000912) == TRUE) then r1 = "W_AttackRightLight4" -- 30030 - 1H 4th R1 end if (env(1116, 8000913) == TRUE) then b1 = "W_AttackBothLight4" -- 32030 - 2H 4th R1 end if (env(1116, 8000914) == TRUE) then r2 = "W_AttackDualDash" -- 34200 - 1H Dodge R2 end if (env(1116, 8000915) == TRUE) then b2 = "W_AttackDualRolling" -- 34300 - 2H Dodge R2 end if (env(1116, 8000916) == TRUE) then r1 = "W_AttackRightHeavySpecial1Start" -- 30600 - 1h Extra R1 Attack end if (env(1116, 8000917) == TRUE) then r2 = "W_AttackRightHeavySpecial1End" -- 30605 - 1H Extra R2 Attack end if (env(1116, 8000918) == TRUE) then b1 = "W_AttackBothHeavySpecial1Start" -- 32600 - 2h Extra R1 Attack end if (env(1116, 8000919) == TRUE) then b2 = "W_AttackBothHeavySpecial1End" -- 32605 - 2h Extra R2 Attack end if (env(1116, 8000920) == TRUE) then r1 = "W_AttackRightLight3" -- 30020 - 1H R1 3 Chain Reset end if (env(1116, 8000921) == TRUE) then b1 = "W_AttackBothLight3" -- 32020 - 2H R1 3 Chain Reset end if (env(1116, 8000922) == TRUE) then r1 = "W_AttackRightHeavySpecial2Start" -- 30610 - 1H Extra R1 Attack 2 end if (env(1116, 8000923) == TRUE) then r2 = "W_AttackRightHeavySpecial2End" -- 30615 - 1H Extra R2 Attack 2 end if (env(1116, 8000924) == TRUE) then b1 = "W_AttackBothHeavySpecial2Start" -- 32610 - 2H Extra R1 Attack 2 end if (env(1116, 8000925) == TRUE) then b2 = "W_AttackBothHeavySpecial2End" -- 32615 - 2H Extra R2 Attack 2 end if (env(1116, 8000926) == TRUE) then r1 = "W_AttackRightLight5" -- 30040 - 1H R1 5 Chain Reset end if (env(1116, 8000927) == TRUE) then b1 = "W_AttackBothLight5" -- 32040 - 2H R1 5 Chain Reset end if (env(1116, 8000928) == TRUE) then r1 = "W_AttackRightLight6" -- 30050 - 1H R1 6 Chain Reset end if (env(1116, 8000929) == TRUE) then b1 = "W_AttackBothLight6" -- 32050 - 2H R1 6 Chain Reset end if (env(1116, 8000930) == TRUE) then b2 = "W_AttackBothHeavy2Start" -- 32510 - 2H Charged R2 end if (env(1116, 8000931) == TRUE) then b2 = "W_AttackBothHeavy1End" -- 32505 - 2H R2 1 end if (env(1116, 8000932) == TRUE) then l2 = "W_AttackRightHeavySpecial1Start" -- 30620 - 1H AOW 4 end if (env(1116, 8000933) == TRUE) then l2 = "W_AttackBothHeavySpecial1Start" -- 32620 - 2H AOW 4 end -- Clever's animation jumping END -- 133 "[HKS] Switch Heavy to Heavy Sub" -- Applied in TAE if env(GetSpEffectID, 133) == TRUE then if r2 == "W_AttackRightHeavy1Start" then r2 = "W_AttackRightHeavy1SubStart" end if b2 == "W_AttackBothHeavy1Start" then b2 = "W_AttackBothHeavy1SubStart" end -- 134 "[HKS] Switch Heavy Sub to Heavy" -- Applied in TAE elseif env(GetSpEffectID, 134) == TRUE then if r2 == "W_AttackRightHeavy1SubStart" then r2 = "W_AttackRightHeavy1Start" end if b2 == "W_AttackBothHeavy1SubStart" then b2 = "W_AttackBothHeavy1Start" end end local isAfterAdditiveJustGuard = FALSE if IsNodeActive("Guard_Upper LayerGenerator") == TRUE and env(GetSpEffectID, 102020) == TRUE then isAfterAdditiveJustGuard = TRUE end -- 173 "[HKS] Guard Counter: End" -- 174 "[HKS] Guard Counter: Window" if env(GetSpEffectID, 173) == TRUE or env(GetSpEffectID, 174) == TRUE or isAfterAdditiveJustGuard == TRUE then if c_Style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT guard_hand = HAND_RIGHT elseif c_Style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT guard_hand = HAND_LEFT end -- Guard Counter Window -- If the player is holding a valid weapon, and has pressed R2, play Guard Counter anim if GetEquipType(atk_hand, WEAPON_CATEGORY_STAFF, WEAPON_CATEGORY_SMALL_ARROW, WEAPON_CATEGORY_ARROW, WEAPON_CATEGORY_LARGE_ARROW, WEAPON_CATEGORY_CROSSBOW, WEAPON_CATEGORY_BALLISTA) == FALSE and env(ActionRequest, ACTION_ARM_R2) == TRUE then if c_Style == HAND_RIGHT_BOTH or c_Style == HAND_LEFT_BOTH then ExecEventAllBody("W_AttackBothHeavyCounter") else ExecEventAllBody("W_AttackRightHeavyCounter") end return TRUE end -- Otherwise, if in Guard Counter Window, mulch the request if env(GetSpEffectID, 174) == TRUE then return FALSE end end -- 100630 "[HKS] Throw related" if env(GetSpEffectID, 100630) == TRUE and ExecFallAttack() == TRUE then return TRUE end if request == ATTACK_REQUEST_RIGHT_LIGHT then if artsr1 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE, r1) if r1 == "W_DrawStanceRightAttackLight" then SetSwordArtsWepCategory_DrawStanceRightAttackLight() end end if c_SwordArtsID == 318 then if r1 == "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) elseif r1 == "W_SwordArtsOneShotComboEnd_2" then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE) local val = GetVariable("IsEnoughArtPointsR1") SetVariable("IsEnoughArtPointsR2", val) end end --- 135 "[HKS] Light Sub Start Type 0" --- 136 "[HKS] Light Sub Start Type 1" --- 137 "[HKS] Light Sub Start Type 2" --- 138 "[HKS] Light Sub Start Type 3" if r1 == "W_AttackRightLightSubStart" then if env(GetSpEffectID, 135) == TRUE then SetVariable("AttackLightSubStartType", 0) elseif env(GetSpEffectID, 136) == TRUE then SetVariable("AttackLightSubStartType", 1) elseif env(GetSpEffectID, 137) == TRUE then SetVariable("AttackLightSubStartType", 2) elseif env(GetSpEffectID, 138) == TRUE then SetVariable("AttackLightSubStartType", 3) else r1 = "W_AttackRightLight2" end end if r1 == "W_AttackRightLightStealth" and IsUseStealthAttack(FALSE) == FALSE then r1 = "W_AttackRightLightStep" end if GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_STAFF) == TRUE and r1 ~= "W_AttackRightLight2" and r1 ~= "W_AttackRightLight3" then r1 = "W_AttackRightLight1" end if env(GetSpEffectID, 19903) == TRUE then r1 = "W_AttackRightLight3" elseif env(GetSpEffectID, 19904) == TRUE then r1 = "W_AttackRightLight4" end if env(GetSpEffectID, 19915) == TRUE then r1 = "W_AttackRightLight2" end ExecEventAllBody(r1) elseif request == ATTACK_REQUEST_RIGHT_HEAVY then if (c_SwordArtsID == 313 or c_SwordArtsID == 273) and (r2 == "W_SwordArtsOneShotComboEnd" or r2 == "W_SwordArtsOneShotComboEnd_2") then artsr2 = TRUE end if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, r2) end local IsEnableSpecialAttack = FALSE -- Barbaric Roar: Heavy Special if env(GetSpEffectID, 1681) == TRUE or env(GetSpEffectID, 1686) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- War Cry: Heavy Special if env(GetSpEffectID, 1811) == TRUE or env(GetSpEffectID, 1816) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end -- Unknown: Heavy Special if env(GetSpEffectID, 1716) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown: Heavy Special if env(GetSpEffectID, 1721) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown (DLC): Heavy Special if env(GetSpEffectID, 102101) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if IsEnableSpecialAttack == TRUE then if r2 == "W_AttackRightHeavy1Start" then r2 = "W_AttackRightHeavySpecial1Start" elseif r2 == "W_AttackRightHeavy1SubStart" then r2 = "W_AttackRightHeavySpecial1SubStart" elseif r2 == "W_AttackRightHeavy2Start" then r2 = "W_AttackRightHeavySpecial2Start" end end if env(GetSpEffectID, 1681) == FALSE and env(GetSpEffectID, 1686) == FALSE and env(GetSpEffectID, 1811) == FALSE and env(GetSpEffectID, 1816) == FALSE and env(GetSpEffectID, 19912) == TRUE then r2 = "W_AttackRightHeavy2Start" end ExecEventAllBody(r2) elseif request == ATTACK_REQUEST_LEFT_LIGHT then atk_hand = HAND_LEFT guard_hand = HAND_LEFT ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_LEFT_HEAVY then atk_hand = HAND_LEFT guard_hand = HAND_LEFT ExecEventAllBody(l2) elseif request == ATTACK_REQUEST_BOTH_LIGHT then if c_SwordArtsID == 318 and r1 == "W_SwordArtsOneShotComboEnd_MesmerSowrdArts" then artsr1 = TRUE end if artsr1 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R1, TRUE, b1) if b1 == "W_DrawStanceRightAttackLight" then SetSwordArtsWepCategory_DrawStanceRightAttackLight() end end --- 135 "[HKS] Light Sub Start Type 0" --- 136 "[HKS] Light Sub Start Type 1" --- 137 "[HKS] Light Sub Start Type 2" --- 138 "[HKS] Light Sub Start Type 3" if b1 == "W_AttackBothLightSubStart" then if env(GetSpEffectID, 135) == TRUE then SetVariable("AttackLightSubStartType", 0) elseif env(GetSpEffectID, 136) == TRUE then SetVariable("AttackLightSubStartType", 1) elseif env(GetSpEffectID, 137) == TRUE then SetVariable("AttackLightSubStartType", 2) elseif env(GetSpEffectID, 138) == TRUE then SetVariable("AttackLightSubStartType", 3) else b1 = "W_AttackBothLight2" end end if b1 == "W_AttackBothLightStealth" and IsUseStealthAttack(FALSE) == FALSE then b1 = "W_AttackBothLightStep" end local staff_hand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then staff_hand = HAND_LEFT end if GetEquipType(staff_hand, WEAPON_CATEGORY_STAFF) == TRUE and b1 ~= "W_AttackBothLight2" and b1 ~= "W_AttackBothLight3" then b1 = "W_AttackBothLight1" end if env(GetSpEffectID, 19903) == TRUE then b1 = "W_AttackBothLight3" elseif env(GetSpEffectID, 19904) == TRUE then b1 = "W_AttackBothLight4" end if env(GetSpEffectID, 19915) == TRUE then b1 = "W_AttackBothLight2" end if style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT end if env(GetEquipWeaponCategory, atk_hand) == WEAPON_CATEGORY_DUELING_SHIELD then guard_hand = atk_hand if is_guard == TRUE and env(ActionDuration, ACTION_ARM_L1) > 0 then b1 = "W_AttackBothLightGuard" end end ExecEventAllBody(b1) elseif request == ATTACK_REQUEST_BOTH_LEFT then if l1 ~= "W_AttackBothLeftSpecial2" and l1 ~= "W_AttackBothLeftSpecial3" and l1 ~= "W_AttackBothLeftSpecial4" and l1 ~= "W_AttackBothLeftSpecial5" then l1 = "W_AttackBothLeftSpecial1" end ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_BOTH_HEAVY then if artsr2 == TRUE then SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, b2) end local IsEnableSpecialAttack = FALSE -- Barbaric Roar: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1681) == TRUE or env(GetSpEffectID, 1686) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and (env(GetSpEffectID, 1683) == TRUE or env(GetSpEffectID, 1688) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- War Cry: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1811) == TRUE or env(GetSpEffectID, 1816) == TRUE or env(GetSpEffectID, 1861) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end elseif c_Style == HAND_LEFT_BOTH and (env(GetSpEffectID, 1813) == TRUE or env(GetSpEffectID, 1818) == TRUE or env(GetSpEffectID, 1863) == TRUE) then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 1) end -- Unknown: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1716) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 1718) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end -- Unknown: Heavy Special if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 1721) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 1723) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if c_Style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 102101) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end elseif c_Style == HAND_LEFT_BOTH and env(GetSpEffectID, 102106) == TRUE then IsEnableSpecialAttack = TRUE SetVariable("AttackRightHeavySpecialType", 0) end if IsEnableSpecialAttack == TRUE then if b2 == "W_AttackBothHeavy1Start" then b2 = "W_AttackBothHeavySpecial1Start" elseif b2 == "W_AttackBothHeavy1SubStart" then b2 = "W_AttackBothHeavySpecial1SubStart" elseif b2 == "W_AttackBothHeavy2Start" then b2 = "W_AttackBothHeavySpecial2Start" end end if env(GetSpEffectID, 1681) == FALSE and env(GetSpEffectID, 1686) == FALSE and env(GetSpEffectID, 1811) == FALSE and env(GetSpEffectID, 1816) == FALSE and env(GetSpEffectID, 19912) == TRUE then b2 = "W_AttackBothHeavy2Start" end if style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT end if env(GetEquipWeaponCategory, atk_hand) == WEAPON_CATEGORY_DUELING_SHIELD then guard_hand = atk_hand end ExecEventAllBody(b2) elseif request == ATTACK_REQUEST_DUAL_RIGHT then if r1 == "W_AttackRightLightDash" then l1 = "W_AttackDualDash" elseif r1 == "W_AttackRightLightStep" then l1 = "W_AttackDualRolling" elseif r1 == "W_AttackRightBackstep" then l1 = "W_AttackDualBackStep" elseif r1 == "W_AttackRightLightStealth" then if IsUseStealthAttack(TRUE) == FALSE then l1 = "W_AttackDualRolling" else l1 = "W_AttackDualStealth" end elseif l1 == "W_AttackLeftLight1" then l1 = "W_AttackDualLight1" elseif l1 == "W_AttackLeftLight2" then l1 = "W_AttackDualLight2" elseif l1 == "W_AttackLeftLight3" then l1 = "W_AttackDualLight3" elseif l1 == "W_AttackLeftLight4" then l1 = "W_AttackDualLight4" elseif l1 == "W_AttackLeftLight5" then l1 = "W_AttackDualLight5" elseif l1 == "W_AttackLeftLight6" then l1 = "W_AttackDualLight6" elseif l1 == "W_AttackDualLightSubStart" then l1 = "W_AttackDualLightSubStart" else l1 = "W_AttackDualLight1" end if env(GetSpEffectID, 19903) == TRUE then l1 = "W_AttackDualLight3" elseif env(GetSpEffectID, 19904) == TRUE then l1 = "W_AttackDualLight4" end if l1 == "W_AttackDualLightSubStart" then if env(GetSpEffectID, 135) == TRUE then SetVariable("AttackLightSubStartType", 0) else l1 = "W_AttackDualLight2" end end is_Dual = TRUE ExecEventAllBody(l1) elseif request == ATTACK_REQUEST_ARROW_BOTH_RIGHT then if c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH and ExecHandChange(HAND_RIGHT, TRUE, blend_type) == TRUE then return TRUE end return FALSE elseif request == ATTACK_REQUEST_ARROW_BOTH_LEFT then if c_Style ~= HAND_RIGHT_BOTH and c_Style ~= HAND_LEFT_BOTH and ExecHandChange(HAND_LEFT, TRUE, blend_type) == TRUE then return TRUE end return FALSE elseif request == ATTACK_REQUEST_LEFT_REVERSAL then ExecEventAllBody("W_AttackLeftReversal") elseif request == SWORDARTS_REQUEST_LEFT_NORMAL then SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) atk_hand = HAND_LEFT guard_hand = HAND_LEFT if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD then arts_idx = 3 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD then arts_idx = 4 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD then arts_idx = 5 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 10 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 11 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) -- Torch Attack if c_SwordArtsID == 17 then SetVariable("SwordArtsOneShotComboCategory", 0) end if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldLeft, blend_type) else ExecEventAllBody("W_SwordArtsOneShotShieldLeft") end elseif request == SWORDARTS_REQUEST_BOTH_NORMAL then SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) if IsHalfBlendArts(c_SwordArtsID) == TRUE and c_SwordArtsID ~= 334 and c_SwordArtsID ~= 354 and c_SwordArtsID ~= 355 then if c_SwordArtsHand == HAND_LEFT then local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_SMALL_SHIELD then arts_idx = 3 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_SMALL_SHIELD then arts_idx = 4 elseif arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON_LARGE_SHIELD then arts_idx = 5 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM_LARGE_SHIELD then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 10 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 11 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldLeft, blend_type) else local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD or arts_cat == WEAPON_CATEGORY_THROW_DAGGER then arts_idx = 3 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then arts_idx = 4 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 5 elseif arts_cat == WEAPON_CATEGORY_FIST or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_PERFUME_BOTTLE or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 10 end SetVariable("SwordArtsOneShotCategory", arts_idx) ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) end else local arts_idx = 0 if arts_cat == WEAPON_CATEGORY_SHORT_SWORD then arts_idx = 1 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 3 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 4 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 5 end SetVariable("SwordArtsOneShotShieldCategory", arts_idx) if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotShieldBoth, blend_type) else ExecEventAllBody("W_SwordArtsOneShotShieldBoth") end end elseif request == SWORDARTS_REQUEST_RIGHT_NORMAL then SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local idle_cat = env(GetStayAnimCategory) local wep_cat = env(GetEquipWeaponCategory, c_SwordArtsHand) local arts_cat = GetSwordArtsDiffCategory(c_SwordArtsID, idle_cat, wep_cat) local arts_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON or arts_cat == WEAPON_CATEGORY_LARGE_KATANA then arts_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then arts_idx = 2 elseif arts_cat == WEAPON_CATEGORY_SHORT_SWORD or arts_cat == WEAPON_CATEGORY_THROW_DAGGER then arts_idx = 3 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then arts_idx = 4 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD then arts_idx = 5 elseif arts_cat == WEAPON_CATEGORY_FIST or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_PERFUME_BOTTLE or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then arts_idx = 6 elseif arts_cat == WEAPON_CATEGORY_LARGE_SHIELD then arts_idx = 7 elseif arts_cat == WEAPON_CATEGORY_SMALL_SHIELD then arts_idx = 8 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then arts_idx = 9 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then arts_idx = 10 elseif c_SwordArtsID == 328 and env(GetSpEffectID, 19875) == TRUE and GetVariable("IsEnoughArtPointsL2") == 0 then arts_idx = 12 elseif c_SwordArtsID == 328 and env(GetSpEffectID, 19874) == TRUE and GetVariable("IsEnoughArtPointsL2") == 0 then arts_idx = 11 end SetVariable("SwordArtsOneShotCategory", arts_idx) local combo_idx = 0 if arts_cat == SWORD_ART_DIFF_CAT_LARGE_WEAPON then combo_idx = 1 elseif arts_cat == SWORD_ART_DIFF_CAT_POLEARM then combo_idx = 2 elseif arts_cat == WEAPON_CATEGORY_TWINBLADE then combo_idx = 3 elseif arts_cat == WEAPON_CATEGORY_CURVEDSWORD or arts_cat == WEAPON_CATEGORY_MARTIAL_ARTS or arts_cat == WEAPON_CATEGORY_BEAST_CLAW then combo_idx = 4 elseif arts_cat == WEAPON_CATEGORY_BACKHAND_SWORD then combo_idx = 5 elseif arts_cat == WEAPON_CATEGORY_DUELING_SHIELD then combo_idx = 6 end SetVariable("SwordArtsOneShotComboCategory", combo_idx) SetVariable("SwordArtsSubCategory", 0) if c_SwordArtsID == 261 then if env(GetSpEffectID, 102355) == TRUE then SetVariable("SwordArtsSubCategory", 0) ExecEventAllBody("W_SwordArtsOneShot_Sub") elseif env(GetSpEffectID, 102356) == TRUE then SetVariable("SwordArtsSubCategory", 1) ExecEventAllBody("W_SwordArtsOneShot_Sub") else ExecEventAllBody("W_SwordArtsOneShot") end elseif IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShot, blend_type) else ExecEventAllBody("W_SwordArtsOneShot") end elseif request == SWORDARTS_REQUEST_RIGHT_STEP then act(DebugLogOutput, "SwordArtsRolling request" .. request) if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end local rollingAngle = c_ArtsRollingAngle if GetVariable("MoveSpeedLevel") > 0.20000000298023224 then rollingAngle = GetVariable("MoveAngle") end local turn_target_angle = 0 local rollingDirection = 0 local turn_angle_real = 200 local is_self_trans = FALSE local is_self_trans_2 = FALSE local arts_id = c_SwordArtsID if IsNodeActive("SwordArtsRolling Selector MP") == TRUE or IsNodeActive("SwordArtsRolling Selector MP_SelfTrans2") == TRUE then is_self_trans = TRUE elseif (arts_id == 155 or arts_id == 156) and (IsNodeActive("SwordArtsRolling Selector MP_SelfTrans") == TRUE or env(GetSpEffectID, 100710) == TRUE) then is_self_trans_2 = TRUE end if GetVariable("IsLockon") == false and env(IsPrecisionShoot) == FALSE and env(IsCOMPlayer) == FALSE or env(GetSpEffectID, 100002) == TRUE then rollingDirection = 0 else if rollingAngle <= GetVariable("RollingAngleThresholdRightFrontTest") and rollingAngle >= GetVariable("RollingAngleThresholdLeftFrontTest") then rollingDirection = 0 turn_target_angle = rollingAngle elseif rollingAngle > GetVariable("RollingAngleThresholdRightFrontTest") and rollingAngle < GetVariable("RollingAngleThresholdRightBackTest") then rollingDirection = 3 turn_target_angle = rollingAngle - 90 elseif rollingAngle < GetVariable("RollingAngleThresholdLeftFrontTest") and rollingAngle > GetVariable("RollingAngleThresholdLeftBackTest") then rollingDirection = 2 turn_target_angle = rollingAngle + 90 else rollingDirection = 1 turn_target_angle = rollingAngle - 180 end if arts_id == 276 then if rollingAngle <= 0 and rollingAngle >= -180 then rollingDirection = 2 turn_target_angle = rollingAngle + 90 elseif rollingAngle > 0 and rollingAngle < 180 then rollingDirection = 3 turn_target_angle = rollingAngle - 90 else rollingDirection = 2 turn_target_angle = rollingAngle + 90 end end if arts_id == 313 then if GetVariable("MoveSpeedLevel") < 0.20000000298023224 then rollingDirection = 0 turn_target_angle = rollingAngle elseif rollingAngle <= 0 and rollingAngle >= -120 then rollingDirection = 2 turn_target_angle = rollingAngle + 90 elseif rollingAngle > 0 and rollingAngle < 120 then rollingDirection = 3 turn_target_angle = rollingAngle - 90 else rollingDirection = 1 turn_target_angle = rollingAngle - 180 end end turn_angle_real = math.abs(GetVariable("TurnAngle") - rollingAngle) if turn_angle_real > 180 then turn_angle_real = 360 - turn_angle_real end if arts_id ~= 276 then if GetVariable("IsLockon") == true then act(TurnToLockonTargetImmediately, turn_target_angle) else act(Unknown2029, turn_target_angle) end end end if is_self_trans == TRUE then if arts_id == 155 or arts_id == 156 then SetVariable("SwordArtsRollingArtsCategory", 0) else SetVariable("SwordArtsRollingArtsCategory", 1) end SetVariable("SwordArtsRollingDirection_SelfTrans", rollingDirection) SetVariable("RollingAngleRealSelftrans", rollingAngle) elseif is_self_trans_2 == TRUE then SetVariable("SwordArtsRollingDirection_SelfTrans2", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) else SetVariable("SwordArtsRollingDirection", rollingDirection) SetVariable("RollingAngleReal", rollingAngle) end SetVariable("TurnAngleReal", turn_angle_real) SetSwordArtsPointInfo(ACTION_ARM_L2, TRUE) if env(GetSpEffectID, 102360) == FALSE then if GetVariable("IsEnoughArtPointsL2") == 1 then AddStamina(STAMINA_REDUCE_ARTS_QUICKSTEP * STAMINA_CONSUMERATE_LOWSTATUS) else AddStamina(STAMINA_REDUCE_ARTS_QUICKSTEP) end end local arts_idx = 0 if arts_id == 155 or arts_id == 156 then SetWeightIndex() if GetVariable("EvasionWeightIndex") == MOVE_WEIGHT_LIGHT then arts_idx = 1 end end SetVariable("SwordArtsRollingWeightCategory", arts_idx) act(AddSpEffect, 100710) if is_self_trans == TRUE then ExecEventAllBody("W_SwordArtsRolling_SelfTrans") elseif is_self_trans_2 == TRUE then ExecEventAllBody("W_SwordArtsRolling_SelfTrans2") elseif (arts_id == 276 or arts_id == 313) and GetVariable("IsLockon") == true and env(GetSpEffectID, 100002) == TRUE then ExecEventAllBody("W_SwordArtsRolling_Sub") else ExecEventAllBody("W_SwordArtsRolling") end elseif request == SWORDARTS_REQUEST_RIGHT_COMBO_1 then if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE) if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotCombo1, blend_type) else ExecEventAllBody("W_SwordArtsOneShotComboEnd") end elseif request == SWORDARTS_REQUEST_RIGHT_COMBO_2 then if IsAttackSwordArts(c_SwordArtsID) == FALSE then is_find_atk = FALSE end SetSwordArtsPointInfo(ACTION_ARM_R2, TRUE, "W_SwordArtsOneShotComboEnd_2") if IsHalfBlendArts(c_SwordArtsID) == TRUE then ExecEventHalfBlend(Event_SwordArtsHalfOneShotCombo2, blend_type) else ExecEventAllBody("W_SwordArtsOneShotComboEnd_2") end elseif request == ATTACK_REQUEST_ARROW_FIRE_RIGHT or request == ATTACK_REQUEST_ARROW_FIRE_RIGHT2 then is_find_atk = FALSE if env(IsOutOfAmmo, 1) == TRUE then ExecEventAllBody("W_NoArrow") elseif env(GetEquipWeaponCategory, HAND_RIGHT) == WEAPON_CATEGORY_LARGE_ARROW then ExecEventHalfBlend(Event_AttackArrowRightStart, ALLBODY) elseif GetEquipType(HAND_RIGHT, WEAPON_CATEGORY_SMALL_ARROW) == TRUE and (c_IsStealth == FALSE and r1 == "W_AttackRightLightStep" or is_stealth_rolling == TRUE or r1 == "W_AttackRightLightDash" or r1 == "W_AttackRightBackstep") then ExecEventAllBody("W_AttackArrowRightFireStep") elseif c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackArrowStart, ALLBODY) else ExecEventHalfBlend(Event_AttackArrowRightStart, blend_type) end elseif request == ATTACK_REQUEST_ARROW_FIRE_LEFT or request == ATTACK_REQUEST_ARROW_FIRE_LEFT2 then is_find_atk = FALSE if env(IsOutOfAmmo, 0) == TRUE then ExecEventAllBody("W_NoArrow") elseif env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_LARGE_ARROW then ExecEventHalfBlend(Event_AttackArrowLeftStart, ALLBODY) elseif GetEquipType(HAND_LEFT, WEAPON_CATEGORY_SMALL_ARROW) == TRUE and (c_IsStealth == FALSE and r1 == "W_AttackRightLightStep" or is_stealth_rolling == TRUE or r1 == "W_AttackRightLightDash" or r1 == "W_AttackRightBackstep") then ExecEventAllBody("W_AttackArrowLeftFireStep") elseif c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackArrowStart, ALLBODY) else ExecEventHalfBlend(Event_AttackArrowLeftStart, blend_type) end elseif request == ATTACK_REQUEST_RIGHT_CROSSBOW or request == ATTACK_REQUEST_RIGHT_CROSSBOW2 then is_find_atk = FALSE if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end local crossbowHand = HAND_RIGHT if c_Style == HAND_LEFT_BOTH then crossbowHand = HAND_LEFT end if env(IsOutOfAmmo, 1) == TRUE then if c_IsStealth == TRUE and GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowRightEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) end elseif env(GetBoltLoadingState, 1) == FALSE and GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then if c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackCrossbowRightReload, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowRightReload, blend_type) end elseif c_IsStealth == TRUE and GetEquipType(crossbowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowRightStart, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowRightStart, blend_type) end elseif request == ATTACK_REQUEST_LEFT_CROSSBOW or request == ATTACK_REQUEST_LEFT_CROSSBOW2 then is_find_atk = FALSE atk_hand = HAND_LEFT guard_hand = HAND_LEFT if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end if env(IsOutOfAmmo, 0) == TRUE and isGraceBorneWeaponWithBullets() == FALSE then --graceborne if c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowLeftEmpty, blend_type) end elseif env(GetBoltLoadingState, 0) == FALSE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then if c_IsStealth == TRUE then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftReload, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowLeftReload, blend_type) end elseif c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowLeftStart, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowLeftStart, blend_type) end elseif request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW or request == ATTACK_REQUEST_BOTHRIGHT_CROSSBOW2 then is_find_atk = FALSE if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end local arrowHand = 0 if c_Style == HAND_RIGHT_BOTH then arrowHand = 1 end if env(IsOutOfAmmo, arrowHand) == TRUE then if c_IsStealth == TRUE and GetEquipType(arrowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothRightEmpty, blend_type) end elseif env(GetBoltLoadingState, arrowHand) == FALSE and GetEquipType(arrowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then local reloadEvent = Event_AttackCrossbowBothRightReload if c_IsStealth == TRUE then if c_Style == HAND_LEFT_BOTH then reloadEvent = Event_StealthAttackCrossbowBothLeftReload else reloadEvent = Event_StealthAttackCrossbowBothRightReload end elseif c_Style == HAND_LEFT_BOTH then reloadEvent = Event_AttackCrossbowBothLeftReload else reloadEvent = Event_AttackCrossbowBothRightReload end ExecEventHalfBlend(reloadEvent, blend_type) elseif c_IsStealth == TRUE and GetEquipType(arrowHand, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowBothRightStart, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothRightStart, blend_type) end elseif request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW or request == ATTACK_REQUEST_BOTHLEFT_CROSSBOW2 then is_find_atk = FALSE if blend_type == ALLBODY then local move_event = Event_Move if c_IsStealth == TRUE then move_event = Event_Stealth_Move end if MoveStart(LOWER, move_event, FALSE) == TRUE then blend_type = UPPER end end if env(IsOutOfAmmo, 0) == TRUE then if c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftEmpty, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothLeftEmpty, blend_type) end elseif env(GetBoltLoadingState, 0) == FALSE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then if c_IsStealth == TRUE then ExecEventHalfBlend(Event_AttackCrossbowBothLeftReload, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothLeftReload, blend_type) end elseif c_IsStealth == TRUE and GetEquipType(HAND_LEFT, WEAPON_CATEGORY_BALLISTA) == FALSE then ExecEventHalfBlend(Event_StealthAttackCrossbowBothLeftStart, blend_type) else ExecEventHalfBlend(Event_AttackCrossbowBothLeftStart, blend_type) end elseif request == ATTACK_REQUEST_ATTACK_WHILE_GUARD then guard_hand = HAND_LEFT local index = env(GetGuardMotionCategory, HAND_LEFT) if env(GetEquipWeaponCategory, HAND_LEFT) == WEAPON_CATEGORY_DUELING_SHIELD then index = 3 end if GetEquipType(HAND_LEFT, WEAPON_CATEGORY_TORCH) == TRUE then index = 2 SetVariable("IsAttackWhileTorchGuard", TRUE) else SetVariable("IsAttackWhileTorchGuard", FALSE) end SetVariable("IndexAttackWhileGuard", index) ExecEventAllBody("W_AttackRightWhileGuard") else return FALSE end if is_find_atk == TRUE then SetInterruptType(INTERRUPT_FINDATTACK) end if style == HAND_RIGHT_BOTH then atk_hand = HAND_RIGHT elseif style == HAND_LEFT_BOTH then atk_hand = HAND_LEFT end SetAttackHand(atk_hand) SetGuardHand(guard_hand) if is_Dual == TRUE then act(SetThrowPossibilityState_Defender, 400000) end act(Unknown2025, env(Unknown404)) SetAIActionState() return TRUE end function GraceborneExecHandChange(hand, is_force, blend_type, no_reset) if is_force == FALSE then if env(IsCOMPlayer) ~= TRUE then return FALSE end if c_HasActionRequest == FALSE or env(IsPrecisionShoot) == TRUE then return FALSE end if env(ActionRequest, ACTION_ARM_CHANGE_STYLE_R) == TRUE and env(ActionDuration, ACTION_ARM_R1) < 100 then elseif env(ActionRequest, ACTION_ARM_CHANGE_STYLE_L) == TRUE and env(ActionDuration, ACTION_ARM_L1) < 100 then hand = HAND_LEFT else return FALSE end end --graceborne weapon check -- if isGraceborneWeapon(hand) == FALSE then -- return FALSE -- end --end graceborne weapon check local style = c_Style -- Clever's Trick Weapon function START -- Current TAE List local trickWeapon_list = {075, 076, 077, 080, 083, 084, 085, 086, 087, 088, 089, 084, 627, 628, 629, 631, 632, 634, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 660, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 688, 689, 691, 694, 721, 728, 729, 911, 999} local right_hand_tae = env(GetEquipWeaponSpecialCategoryNumber, hand) if Contains(trickWeapon_list, right_hand_tae) == TRUE then if style == HAND_RIGHT and style ~= HAND_RIGHT_BOTH then if env(GetSpEffectID, 8000900) == TRUE then ExecEventAllBody("W_AttackRightSpecial1") -- 030950 return TRUE elseif env(GetSpEffectID, 8000901) == TRUE then ExecEventAllBody("W_AttackRightSpecial2") -- 030955 return TRUE else ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) -- 037040 return TRUE end elseif style == HAND_RIGHT_BOTH then if env(GetSpEffectID, 8000902) == TRUE then ExecEventAllBody("W_AttackBothSpecial1") -- 032950 return TRUE elseif env(GetSpEffectID, 8000903) == TRUE then ExecEventAllBody("W_AttackBothSpecial2") -- 032955 return TRUE else ExecEventHalfBlend(Event_AttackCrossbowRightReload, blend_type) -- 037030 return TRUE end end end -- Holy shit that was a lot END if IsTrickWeapon() == TRUE then -- Trick Weapons // Check if the weapon is Trick if style == HAND_RIGHT and style ~= HAND_RIGHT_BOTH then if 1.5 < GetVariable("MoveSpeedLevel") then -- If running ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) return TRUE else -- If not running ExecEventHalfBlend(Event_AttackCrossbowRightEmpty, blend_type) return TRUE end elseif style == HAND_RIGHT_BOTH then if 1.5 < GetVariable("MoveSpeedLevel") then ExecEventHalfBlend(Event_AttackCrossbowRightReload, blend_type) return TRUE else ExecEventHalfBlend(Event_AttackCrossbowRightReload, blend_type) return TRUE end end end -- this is for weapons in the left hand, had to script it differently for weird cursed reasons if env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) == 266 and style ~= HAND_LEFT_BOTH then ExecEventHalfBlend(Event_AttackCrossbowLeftEmpty, blend_type) return TRUE end if env(GetEquipWeaponSpecialCategoryNumber, hand) == 266 and c_Style == HAND_LEFT_BOTH then ExecEventHalfBlend(Event_AttackCrossbowLeftReload, blend_type) return TRUE end -- Clever's Trick Weapon functionality END 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(Unknown2025, env(Unknown404)) SetAIActionState() return TRUE end