REGISTER_GOAL(GOAL_Attendant_of_laughtrecA6490_Battle, "Attendant_of_laughtrecA6490Battle") local NormalR_min = 0 local NormalR_max = 2.8 local LargeR_min = 0 local LargeR_max = 2.2 local Backstep_Atk_min = 3 local Backstep_Atk_max = 6 local Rolling_Atk_min = 4.5 local Rolling_Atk_max = 5.5 local PushR_min = 0 local PushR_max = 1 local Guard_NormalR_min = 0 local Guard_NormalR_max = 2.3 REGISTER_GOAL_NO_UPDATE(GOAL_Attendant_of_laughtrecA6490_Battle, 1) function Attendant_of_laughtrecA6490Battle_Activate(ai, goal) local actPerArr = {} local actFuncArr = {} local defFuncParamTbl = {} Common_Clear_Param(actPerArr, actFuncArr, defFuncParamTbl) local fate = ai:GetRandam_Int(1, 100) local fate2 = ai:GetRandam_Int(1, 100) local BothHandOff = ai:GetRandam_Int(1, 100) local targetDist = ai:GetDist(TARGET_ENE_0) local RYOUTE_odds = 1 local KATATE_odds = 1 local GuardTaiou = 0 if ai:IsTargetGuard(TARGET_ENE_0) == true then GuardTaiou = 1 end if 4.5 <= targetDist then actPerArr[1] = 5 actPerArr[2] = 5 actPerArr[5] = 40 actPerArr[7] = 40 actPerArr[19] = 10 * GuardTaiou actPerArr[20] = 10 elseif 3 <= targetDist then actPerArr[1] = 15 actPerArr[2] = 15 actPerArr[5] = 40 actPerArr[19] = 50 * GuardTaiou actPerArr[20] = 30 elseif 1 <= targetDist then actPerArr[1] = 25 actPerArr[2] = 30 actPerArr[17] = 15 * GuardTaiou actPerArr[19] = 100 * GuardTaiou actPerArr[20] = 30 else actPerArr[1] = 20 actPerArr[2] = 20 actPerArr[17] = 30 * GuardTaiou actPerArr[19] = 100 * GuardTaiou actPerArr[20] = 30 end actFuncArr[1] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act01) actFuncArr[2] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act02) actFuncArr[5] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act05) actFuncArr[7] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act07) actFuncArr[17] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act17) actFuncArr[19] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act19) actFuncArr[20] = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_Act20) local atkAfterFunc = REGIST_FUNC(ai, goal, Attendant_of_laughtrecA6490_ActAfter_AdjustSpace, atkAfterOddsTbl) Common_Battle_Activate(ai, goal, actPerArr, actFuncArr, atkAfterFunc, defFuncParamTbl) return end NormalR_min = Guard_NormalR_max function Attendant_of_laughtrecA6490_Act01(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) NPC_KATATE_Switch(ai, goal) CommonNPC_ChangeWepR1(ai, goal) local AppDist = Guard_NormalR_max local DashDist = Guard_NormalR_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) if fate <= 30 then goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 1.5, 90) goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 0, -1) elseif fate <= 60 then goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 1.5, 90) goal:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 0, -1) goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 0, -1) else goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 1.5, 90) goal:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 0, -1) goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_Middle, 1.5, 90) end GetWellSpace_Odds = 100 return GetWellSpace_Odds end NormalR_min = LargeR_max function Attendant_of_laughtrecA6490_Act02(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) NPC_KATATE_Switch(ai, goal) CommonNPC_ChangeWepR1(ai, goal) local AppDist = LargeR_max local DashDist = LargeR_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) if fate <= 30 then goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_Middle, 1.5, 90) GetWellSpace_Odds = 100 else goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_Middle, 1.5, 90) goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_Middle, 0, -1) GetWellSpace_Odds = 100 end GetWellSpace_Odds = 100 return GetWellSpace_Odds end NormalR_min = Backstep_Atk_max function Attendant_of_laughtrecA6490_Act05(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) NPC_KATATE_Switch(ai, goal) CommonNPC_ChangeWepR1(ai, goal) local AppDist = Backstep_Atk_max local DashDist = Backstep_Atk_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_BackstepB, TARGET_ENE_0, 20, 1.5, 90) goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_None, 0, -1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end NormalR_min = Rolling_Atk_max function Attendant_of_laughtrecA6490_Act07(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) NPC_KATATE_Switch(ai, goal) CommonNPC_ChangeWepR1(ai, goal) local AppDist = Rolling_Atk_max local DashDist = Rolling_Atk_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_StepF, TARGET_ENE_0, 3, 1.5, 90) goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_None, 0, -1) GetWellSpace_Odds = 100 return GetWellSpace_Odds end NormalR_min = PushR_max function Attendant_of_laughtrecA6490_Act17(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) local AppDist = PushR_max local DashDist = PushR_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_PushR, TARGET_ENE_0, DIST_Middle, 1.5, 90) GetWellSpace_Odds = 100 return GetWellSpace_Odds end NormalR_min = Guard_NormalR_max function Attendant_of_laughtrecA6490_Act19(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) CommonNPC_ChangeWepR1(ai, goal) local AppDist = Guard_NormalR_max local DashDist = Guard_NormalR_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) goal:AddSubGoal(GOAL_COMMON_TurnAround, 3, TARGET_ENE_0, AI_DIR_TYPE_B, 10, false, true, 4) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_NormalR, TARGET_ENE_0, DIST_Middle, 1.5, 90) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function Attendant_of_laughtrecA6490_Act20(ai, goal, paramTbl) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) if 3 <= targetDist then goal:AddSubGoal(GOAL_COMMON_ApproachTarget, 5, TARGET_ENE_0, ai:GetRandam_Float(2, 2.5), TARGET_SELF, true, 4) else goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 5, TARGET_ENE_0, ai:GetRandam_Float(1.5, 2), TARGET_ENE_0, true, 4) end goal:AddSubGoal(GOAL_COMMON_SidewayMove, ai:GetRandam_Float(3, 4), TARGET_ENE_0, ai:GetRandam_Int(0, 1), ai:GetRandam_Float(30, 50), true, true, 4) goal:AddSubGoal(GOAL_COMMON_SidewayMove, ai:GetRandam_Float(3, 4), TARGET_ENE_0, ai:GetRandam_Int(0, 1), ai:GetRandam_Float(30, 50), true, true, 4) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function Attendant_of_laughtrecA6490_ActAfter_AdjustSpace(ai, goal, paramTbl) local fate = ai:GetRandam_Int(1, 100) local fate2 = ai:GetRandam_Int(1, 100) if fate <= 80 then if fate2 <= 70 then goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 3, TARGET_ENE_0, ai:GetRandam_Float(2.5, 3.5), TARGET_ENE_0, true, 4) else goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 6, TARGET_ENE_0, ai:GetRandam_Float(1.5, 3), TARGET_ENE_0, true, 4) goal:AddSubGoal(GOAL_COMMON_SidewayMove, 3, TARGET_ENE_0, ai:GetRandam_Int(0, 1), ai:GetRandam_Int(30, 45), true, true, 4) end end return end function Attendant_of_laughtrecA6490Battle_Update(ai, goal) return GOAL_RESULT_Continue end function Attendant_of_laughtrecA6490Battle_Terminate(ai, goal) return end NormalR_min = LargeR_max function Attendant_of_laughtrecA6490Battle_Interupt(ai, goal) local targetDist = ai:GetDist(TARGET_ENE_0) local fate = ai:GetRandam_Int(1, 100) local fate2 = ai:GetRandam_Int(1, 100) local fate3 = ai:GetRandam_Int(1, 100) if ai:IsInterupt(INTERUPT_FindAttack) then local FindATKDist = 3 local FindATKPer = 40 local MoveDist = 3 if targetDist <= FindATKDist and fate <= FindATKPer then goal:ClearSubGoal() if fate <= 50 then goal:AddSubGoal(GOAL_COMMON_LeaveTarget, ai:GetRandam_Int(3, 5), TARGET_ENE_0, combRunDist, TARGET_ENE_0, true, 4) else goal:AddSubGoal(GOAL_COMMON_SidewayMove, ai:GetRandam_Float(3, 4), TARGET_ENE_0, ai:GetRandam_Int(0, 1), ai:GetRandam_Float(30, 50), true, true, 4) end return true end end if ai:IsInterupt(INTERUPT_SuccessGuard) then local Suc_GuardDist = 3 local Suc_GuardPer = 80 if targetDist <= Suc_GuardDist and fate <= Suc_GuardPer then goal:ClearSubGoal() goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_None, 0, -1) return true end end if ai:IsInterupt(INTERUPT_Damaged) then local combRunDist = 3 local combRunPer = 50 if targetDist < combRunDist and fate <= combRunPer then goal:ClearSubGoal() if fate <= 50 then goal:AddSubGoal(GOAL_COMMON_LeaveTarget, ai:GetRandam_Int(3, 5), TARGET_ENE_0, combRunDist, TARGET_ENE_0, true, 4) else goal:AddSubGoal(GOAL_COMMON_SidewayMove, ai:GetRandam_Float(3, 4), TARGET_ENE_0, ai:GetRandam_Int(0, 1), ai:GetRandam_Float(30, 50), true, true, 4) end return true end end if ai:IsInterupt(INTERUPT_GuardBreak) then local distGuardBreak_Act = 2 local oddsGuardBreak_Act = 60 if targetDist <= distGuardBreak_Act and fate <= oddsGuardBreak_Act then goal:ClearSubGoal() CommonNPC_ChangeWepR1(ai, goal) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_Middle, 1.5, 90) return true end end if ai:IsInterupt(INTERUPT_ReboundByOpponentGuard) then goal:ClearSubGoal() ai:Replaning() goal:AddSubGoal(GOAL_COMMON_Wait, 0.1, TARGET_ENE_0) return true elseif ai:IsInterupt(INTERUPT_Shoot) then local shootIntPer = 75 if fate <= shootIntPer then if fate <= 50 then goal:AddSubGoal(GOAL_COMMON_SidewayMove, ai:GetRandam_Float(3, 4), TARGET_ENE_0, ai:GetRandam_Int(0, 1), ai:GetRandam_Float(30, 50), true, true, 4) else local AppDist = LargeR_max local DashDist = LargeR_max + 5 local Odds_Guard = 100 NPC_Approach_Act(ai, goal, AppDist, DashDist, Odds_Guard) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, NPC_ATK_LargeR, TARGET_ENE_0, DIST_Middle, 1.5, 90) end return true else return true end else return false end end return