RegisterTableGoal(GOAL_RockLizard_322000_Battle, "GOAL_RockLizard_322000_Battle") Goal.Initialize = function (self, ai, goal, battleActivatedCount) end Goal.Activate = function (self, ai, goal) Init_Pseudo_Global(ai, goal) ai:SetStringIndexedNumber("Dist_SideStep", 0) ai:SetStringIndexedNumber("Dist_BackStep", 0) local probabilities = {} local acts = {} local paramTbls = {} Common_Clear_Param(probabilities, acts, paramTbls) local distance = ai:GetDist(TARGET_ENE_0) local random = ai:GetRandam_Int(1, 100) local f2_local5 = ai:GetExcelParam(AI_EXCEL_THINK_PARAM_TYPE__thinkAttr_doAdmirer) local f2_local6 = 1 if SpaceCheck(ai, goal, 0, 2.5) == false then f2_local6 = 0 end local f2_local7 = ai:GetEventRequest() if ai:IsInsideTarget(TARGET_ENE_0, AI_DIR_TYPE_B, 240) then probabilities[10] = 100 elseif not ai:HasSpecialEffectId(TARGET_SELF, 5020) and ai:GetNpcThinkParamID() == 32200001 then probabilities[3] = 100 elseif distance >= 6 then probabilities[1] = 30 probabilities[2] = 10 probabilities[3] = 60 * f2_local6 elseif distance >= 2 then probabilities[1] = 20 probabilities[2] = 45 probabilities[3] = 35 * f2_local6 else probabilities[1] = 60 probabilities[2] = 30 probabilities[3] = 10 * f2_local6 end if ai:GetNpcThinkParamID() == 32200002 then probabilities[3] = 0 end acts[1] = REGIST_FUNC(ai, goal, RockLizard322000_Act01) acts[2] = REGIST_FUNC(ai, goal, RockLizard322000_Act02) acts[3] = REGIST_FUNC(ai, goal, RockLizard322000_Act03) acts[9] = REGIST_FUNC(ai, goal, RockLizard322000_Act09) acts[10] = REGIST_FUNC(ai, goal, RockLizard322000_Act10) local actAfter = REGIST_FUNC(ai, goal, RockLizard322000_ActAfter_AdjustSpace) Common_Battle_Activate(ai, goal, probabilities, acts, actAfter, paramTbls) end function RockLizard322000_Act01(ai, goal, paramTbl) local stopDist = 2.5 - ai:GetMapHitRadius(TARGET_SELF) local canRunDist = 2.5 - ai:GetMapHitRadius(TARGET_SELF) local forceRunMinDist = 999 local runProb = 0 local guardProb = 0 local walkLife = 5 local runLife = 5 Approach_Act_Flex(ai, goal, stopDist, canRunDist, forceRunMinDist, runProb, guardProb, walkLife, runLife) local animationId = 3002 local successDistance = 999 local turnTime = 0 local turnFaceAngle = 0 goal:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, animationId, TARGET_ENE_0, successDistance, turnTime, turnFaceAngle, 0, 0) GetWellSpace_Odds = 100 return GetWellSpace_Odds end function RockLizard322000_Act02(ai, goal, paramTbl) local stopDist = 4.3 - ai:GetMapHitRadius(TARGET_SELF) local canRunDist = 4.3 - ai:GetMapHitRadius(TARGET_SELF) local forceRunMinDist = 999 local runProb = 0 local guardProb = 0 local walkLife = 5 local runLife = 5 Approach_Act_Flex(ai, goal, stopDist, canRunDist, forceRunMinDist, runProb, guardProb, walkLife, runLife) local animationId = 3003 local successDistance = 999 local turnTime = 0 local turnFaceAngle = 0 goal:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, animationId, TARGET_ENE_0, successDistance, turnTime, turnFaceAngle, 0, 0) GetWellSpace_Odds = 100 return GetWellSpace_Odds end function RockLizard322000_Act03(ai, goal, paramTbl) local successDistance = 999 local turnTime = 0 local turnFaceAngle = 0 local random = ai:GetRandam_Int(2, 4) local random2 = ai:GetRandam_Int(1, 100) ai:AddObserveSpecialEffectAttribute(TARGET_SELF, 5025) ai:AddObserveSpecialEffectAttribute(TARGET_SELF, 5026) goal:AddSubGoal(GOAL_COMMON_ComboAttackTunableSpin, 10, 3004, TARGET_ENE_0, successDistance, turnTime, turnFaceAngle, 0, 0) GetWellSpace_Odds = 100 return GetWellSpace_Odds end function RockLizard322000_Act09(ai, goal, paramTbl) goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 6, TARGET_ENE_0, 100, TARGET_SELF, false, -1):SetFailedEndOption(AI_GOAL_FAILED_END_OPT__PARENT_NEXT_SUB_GOAL) local animationId = 3000 local successDistance = 999 - ai:GetMapHitRadius(TARGET_SELF) local turnTime = -1 local turnFaceAngle = 0 goal:AddSubGoal(GOAL_COMMON_AttackTunableSpin, 10, animationId, TARGET_SELF, successDistance, turnTime, turnFaceAngle, 0, 0) end function RockLizard322000_Act10(ai, goal, paramTbl) goal:AddSubGoal(GOAL_COMMON_Turn, 3, TARGET_ENE_0, ai:GetRandam_Int(30, 45)) GetWellSpace_Odds = 0 return GetWellSpace_Odds end function RockLizard322000_ActAfter_AdjustSpace(ai, goal, paramTbl) end Goal.Update = function (self, ai, goal) return Update_Default_NoSubGoal(self, ai, goal) end Goal.Terminate = function (self, ai, goal) end Goal.Interrupt = function (self, ai, goal) local distance = ai:GetDist(TARGET_ENE_0) local random = ai:GetRandam_Int(1, 100) local f11_local2 = 2.5 if ai:IsInterupt(INTERUPT_ActivateSpecialEffect) then goal:ClearSubGoal() if ai:GetSpecialEffectActivateInterruptType(0) == 5025 then if SpaceCheck(ai, goal, 0, 4) == false then return true elseif distance <= f11_local2 and random <= 60 then return true elseif random <= 10 then return true else goal:AddSubGoal(GOAL_COMMON_ComboRepeat, 10, 3005, TARGET_ENE_0, 999, 0, 0) end return true end end if ai:IsInterupt(INTERUPT_ActivateSpecialEffect) then goal:ClearSubGoal() if ai:GetSpecialEffectActivateInterruptType(0) == 5026 then if SpaceCheck(ai, goal, 0, 4) == false then goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3006, TARGET_ENE_0, 999, 0, 0) elseif distance <= f11_local2 and random <= 60 then goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3006, TARGET_ENE_0, 999, 0, 0) elseif random <= 20 then goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3006, TARGET_ENE_0, 999, 0, 0) else goal:AddSubGoal(GOAL_COMMON_ComboFinal, 10, 3005, TARGET_ENE_0, 999, 0, 0) end return true end end end Goal.Update = function (self, ai, goal) return Update_Default_NoSubGoal(self, ai, goal) end