------------------------------------------ -- Fixed decompiled c9997.hks for ELDEN RING -- HKS file shared across all enemies -- Refined from decompiles by Vawser -- Curated at: https://github.com/ividyon/EldenRingHKS ------------------------------------------ -- Version 4 for ER version 1.15.1 ------------------------------------------ -- Changelog: -- 2023-02-14 - Vawser: Cleaned up and added. -- 2024-06-28 - Exelot: Recreated to update to ER v1.12.1 [DLC Initial Release] -- 2024-07-30 - Exelot: Updated to ER v1.13 -- 2024-10-03 - Exelot: Named almost all remaining acts and envs thanks to a list provided by ElaDiDu. Some of the existing ones have been renamed. ------------------------------------------ -- Core: Functions ------------------------------------------ function IncNum(num) local str = nil if num < 10 then str = "Debug0" else str = "Debug" end local vec = GetVariable(str .. num) vec[0] = vec[0] + 1 vec[1] = g_FrameCount SetVariable(str .. num, vec) end function DebugPrint(pos, val) local str = nil if pos < 10 then str = "Debug0" else str = "Debug" end vector = GetVariable(str .. pos) vector[0] = val vector[1] = g_FrameCount SetVariable(str .. pos, vector) end function Fire(event) hkbFireEvent(event) end function IsExistAnime(id) return env(DoesAnimExist, id) end function Replanning() act(DoAIReplanningAtCancelTiming) end function SetVariable(name, val) act(SetHavokVariable, name, val) end function GetVariable(name) return hkbGetVariable(name) end function SetIdleType(idle_type) if idle_type == AI_STATE_DEFAULT then if IsExistAnime(ANIME_ID_IDLE_DEFAULT) == TRUE then SetVariable("IndexAiState", AI_STATE_DEFAULT) else SetVariable("IndexAiState", AI_STATE_BATTLE) end else SetVariable("IndexAiState", AI_STATE_BATTLE) end end function CallActionState(action_type) act(SetAIAttackState, action_type) end function IsNodeActive(...) local buff = {...} for i = 1, #buff, 1 do if hkbIsNodeActive(buff[i]) then return TRUE end end return FALSE end function SoulDropUp() if IS_INITIALIZED_SOUL_DROP_UP == TRUE then return end if env(GetSpEffectID, 5250) == TRUE or env(GetSpEffectID, 5255) == TRUE then IS_INITIALIZED_SOUL_DROP_UP = TRUE return end local feversoul = math.random(1000) local feverchance = 0 if env(GetSpEffectID, 5269) == TRUE then feverchance = 1000 elseif env(GetSpEffectID, 5268) == TRUE then feverchance = 500 elseif env(GetSpEffectID, 5267) == TRUE then feverchance = 300 elseif env(GetSpEffectID, 5266) == TRUE then feverchance = 100 elseif env(GetSpEffectID, 5265) == TRUE then feverchance = 50 elseif env(GetSpEffectID, 5264) == TRUE then feverchance = 30 elseif env(GetSpEffectID, 5263) == TRUE then feverchance = 20 elseif env(GetSpEffectID, 5262) == TRUE then feverchance = 10 elseif env(GetSpEffectID, 5261) == TRUE then feverchance = 5 end if feverchance > 0 and feversoul <= feverchance then if env(GetSpEffectID, 5271) == TRUE then act(AddSpEffect, 5251) elseif env(GetSpEffectID, 5272) == TRUE then act(AddSpEffect, 5252) elseif env(GetSpEffectID, 5273) == TRUE then act(AddSpEffect, 5253) else act(AddSpEffect, 5250) end else act(AddSpEffect, 5255) end IS_INITIALIZED_SOUL_DROP_UP = TRUE end function GolemConfusion() if IS_INITIALIZED_CONFUSION == FALSE then if env(GetSpEffectID, SP_EFFECT_CONFUSION_BORDER_A) == TRUE then BORDER_CONFUSION = 10 CAN_CONFUSION = TRUE elseif env(GetSpEffectID, SP_EFFECT_CONFUSION_BORDER_B) == TRUE then BORDER_CONFUSION = 20 CAN_CONFUSION = TRUE elseif env(GetSpEffectID, SP_EFFECT_CONFUSION_BORDER_C) == TRUE then BORDER_CONFUSION = 30 CAN_CONFUSION = TRUE end IS_INITIALIZED_CONFUSION = TRUE end if CAN_CONFUSION == TRUE then local dT = GetDeltaTime() local IsConfused = env(GetSpEffectType, SP_EFFECT_TYPE_GOLEM_CONFUSION) if POINT_CONFUSION > 0 and IsConfused == FALSE then POINT_CONFUSION = POINT_CONFUSION - dT elseif POINT_CONFUSION >= BORDER_CONFUSION and IsConfused == TRUE then POINT_CONFUSION = 0 end if env(GetBehaviorID, BEH_IDENTIFIER_GOLEM_CONFUSION) == TRUE and IsConfused == FALSE then act(AddSpEffect, SP_EFFECT_CONFUSION_SIGN) if env(GetSpEffectID, SP_EFFECT_CONFUSION_POINT_A) == TRUE then POINT_CONFUSION = POINT_CONFUSION + 6 elseif env(GetSpEffectID, SP_EFFECT_CONFUSION_POINT_B) == TRUE then POINT_CONFUSION = POINT_CONFUSION + 13 elseif env(GetSpEffectID, SP_EFFECT_CONFUSION_POINT_C) == TRUE then POINT_CONFUSION = POINT_CONFUSION + 26 end end end end function ParryResist() if IS_INITIALIZED_PARRY_RESIST == FALSE then if env(GetSpEffectID, 6030) == TRUE then BORDER_PARRY_RESIST = 1 CAN_PARRY_RESIST = TRUE elseif env(GetSpEffectID, 6031) == TRUE then BORDER_PARRY_RESIST = 2 CAN_PARRY_RESIST = TRUE elseif env(GetSpEffectID, 6032) == TRUE then BORDER_PARRY_RESIST = 3 CAN_PARRY_RESIST = TRUE end IS_INITIALIZED_PARRY_RESIST = TRUE end if CAN_PARRY_RESIST == TRUE then local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_PARRY or damage_type >= DAMAGE_TYPE_PARRY_ENEMY1 and damage_type <= DAMAGE_TYPE_PARRY_ENEMY3 then if env(GetSpEffectID, 6043) == TRUE then POINT_PARRY_RESIST = 4 elseif env(GetSpEffectID, 6042) == TRUE then POINT_PARRY_RESIST = 3 act(AddSpEffect, 6043) elseif env(GetSpEffectID, 6041) == TRUE then POINT_PARRY_RESIST = 2 act(AddSpEffect, 6042) elseif env(GetSpEffectID, 6040) == TRUE then POINT_PARRY_RESIST = 1 act(AddSpEffect, 6041) else POINT_PARRY_RESIST = 1 act(AddSpEffect, 6041) end end end end function ExecTurn(is_on_cancel) if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end local turn_angle = GetVariable("TurnAngle") if math.abs(turn_angle) <= 0 then return FALSE end local is_emergency_turn = env(IsEmergencyQuickTurnActivated) if math.abs(turn_angle) < 45 and is_emergency_turn == FALSE then return FALSE end if env(GetSpEffectID, 5841) == TRUE or env(GetSpEffectID, 5843) == TRUE then return FALSE end if env(GetSpEffectID, 5840) == TRUE and math.abs(turn_angle) < 135 then return FALSE end local dir = INVALID local correction_factor = 0 local fly_route_state = env(GetFlyRouteState) if fly_route_state ~= AI_FLY_ROUTE_STATE_NOT_USE_FLY_ROUTE and fly_route_state ~= AI_FLY_ROUTE_STATE_ON_GROUND and fly_route_state ~= AI_FLY_ROUTE_STATE_ON_GROUND_TAKEOFF_REQUESTED then if math.abs(turn_angle) < 45 then return FALSE else if turn_angle < 0 then dir = INDEX_TURN_DIRECTION_LEFT180 else dir = INDEX_TURN_DIRECTION_RIGHT180 end correction_factor = 180 end elseif math.abs(turn_angle) < 67.5 then IncNum(1) if turn_angle < 0 then if env(GetSpEffectID, SP_EFFECT_IGNORE_TURN45) == TRUE then dir = INDEX_TURN_DIRECTION_LEFT90 correction_factor = 90 else dir = INDEX_TURN_DIRECTION_LEFT45 correction_factor = 45 end elseif env(GetSpEffectID, SP_EFFECT_IGNORE_TURN45) == TRUE then dir = INDEX_TURN_DIRECTION_RIGHT90 correction_factor = 90 else dir = INDEX_TURN_DIRECTION_RIGHT45 correction_factor = 45 end elseif math.abs(turn_angle) < 135 then if turn_angle < 0 then dir = INDEX_TURN_DIRECTION_LEFT90 else dir = INDEX_TURN_DIRECTION_RIGHT90 end correction_factor = 90 else if turn_angle < 0 then dir = INDEX_TURN_DIRECTION_LEFT180 else dir = INDEX_TURN_DIRECTION_RIGHT180 end correction_factor = 180 end local buff = {} local ai_rec = env(GetAITargetAwareState) local action_type = env(GetAIActionType) if action_type == ACTION_TYPE_GUARD then buff[1] = INDEX_TURN_GUARD buff[2] = INDEX_TURN_BATTLE buff[3] = INDEX_TURN_DEFAULT elseif action_type == ACTION_TYPE_PARRY then buff[1] = INDEX_TURN_PARRY buff[2] = INDEX_TURN_BATTLE buff[3] = INDEX_TURN_DEFAULT elseif ai_rec > AI_RECOGNITION_NONE then buff[1] = INDEX_TURN_BATTLE buff[2] = INDEX_TURN_DEFAULT buff[3] = INDEX_TURN_GUARD else buff[1] = INDEX_TURN_DEFAULT buff[2] = INDEX_TURN_BATTLE buff[3] = INDEX_TURN_GUARD end local turn_index = INVALID for i = 1, #buff, 1 do local anim = ANIME_ID_TURN + buff[i] * 10 + dir if IsExistAnime(anim) == TRUE then turn_index = buff[i] break elseif dir == INDEX_TURN_DIRECTION_LEFT45 then anim = ANIME_ID_TURN + buff[i] * 10 + INDEX_TURN_DIRECTION_LEFT90 if IsExistAnime(anim) == TRUE then turn_index = buff[i] dir = INDEX_TURN_DIRECTION_LEFT90 correction_factor = 90 break end elseif dir == INDEX_TURN_DIRECTION_RIGHT45 then anim = ANIME_ID_TURN + buff[i] * 10 + INDEX_TURN_DIRECTION_RIGHT90 if IsExistAnime(anim) == TRUE then turn_index = buff[i] dir = INDEX_TURN_DIRECTION_RIGHT90 correction_factor = 90 break end end end if turn_index >= 0 then act(SetTurnAnimCorrectionRate, correction_factor) act(SetIsTurnAnimInProgress) local event = "W_Turn" local ai_state = AI_STATE_BATTLE if turn_index == INDEX_TURN_BATTLE then event = event .. "Battle" elseif turn_index == INDEX_TURN_GUARD then event = event .. "Guard" elseif turn_index == INDEX_TURN_PARRY then event = event .. "Parry" else event = event .. "Default" ai_state = AI_STATE_DEFAULT end SetIdleType(ai_state) if dir == INDEX_TURN_DIRECTION_LEFT90 then event = event .. "_Left90" elseif dir == INDEX_TURN_DIRECTION_RIGHT90 then event = event .. "_Right90" elseif dir == INDEX_TURN_DIRECTION_LEFT180 then event = event .. "_Left180" elseif dir == INDEX_TURN_DIRECTION_RIGHT180 then event = event .. "_Right180" elseif dir == INDEX_TURN_DIRECTION_LEFT45 then event = event .. "_Left45" elseif dir == INDEX_TURN_DIRECTION_RIGHT45 then event = event .. "_Right45" end Fire(event) return TRUE end return FALSE end function ExecAIAction(style) local action_type = env(GetAIActionType) if action_type <= 0 then if style == STYLE_DEFAULT then return FALSE else if style == STYLE_GUARD then Fire("W_GuardEnd") elseif style == STYLE_PARRY then Fire("W_ParryEnd") end return TRUE end end if ExecArtEnd(action_type, style) == TRUE then return TRUE end if ExecGuardEnd(action_type, style) == TRUE then return TRUE end if ExecAIStep(action_type) == TRUE then return TRUE end if ExecAIAttack(action_type, style) == TRUE then return TRUE end if ExecRide() == TRUE then return TRUE end if ExecAIGuard(action_type, style) == TRUE then return TRUE end if ExecAIParry(action_type, style) == TRUE then return TRUE end return FALSE end function ExecAICancelAction(style) local action_type_atk = INVALID local action_type = INVALID local action_type_combo = env(GetAIChainActionType) local action_type_cancel = env(GetAIAtkCancelType) local action_type_step = env(GetAIChainStepType) if action_type_combo > 0 then action_type_atk = action_type_combo action_type = action_type_combo elseif action_type_cancel > 0 then action_type_atk = action_type_cancel action_type = action_type_cancel elseif action_type_step > 0 then action_type = action_type_step else return FALSE end if ExecArtEnd(action_type, style) == TRUE then return TRUE end if ExecGuardEnd(action_type, style) == TRUE then return TRUE end if ExecAIStep(action_type_step) == TRUE then return TRUE end if ExecAIAttack(action_type_atk, style) == TRUE then return TRUE end if ExecRide() == TRUE then return TRUE end if ExecAIGuard(action_type_atk, style) == TRUE then return TRUE end if ExecAIParry(action_type_atk, style) == TRUE then return TRUE end return FALSE end function ExecArtEnd(action_type, style) if env(GetSpEffectID, SP_EFFECT_ART_STANCE) == FALSE then return FALSE end if action_type == ACTION_TYPE_PARRY then return FALSE end if action_type >= ANIME_ID_ART_STANCE_BEGIN and action_type <= ANIME_ID_ART_STANCE_END then return FALSE end if style == STYLE_GUARD then if action_type ~= ACTION_TYPE_GUARD then Fire("W_GuardEnd") return TRUE end elseif style == STYLE_PARRY and action_type ~= ACTION_TYPE_PARRY then Fire("W_ParryEnd") return TRUE end return FALSE end function ExecGuardEnd(action_type, style) if env(GetSpEffectID, 5825) == FALSE then return FALSE end if action_type == ACTION_TYPE_GUARD then return FALSE end if action_type >= ANIME_ID_GUARD_ATTACK_BEGIN and action_type <= ANIME_ID_GUARD_ATTACK_END then return FALSE end if style == STYLE_GUARD then Fire("W_GuardEnd") return TRUE end return FALSE end function ExecAIGuard(action_type, style) if action_type ~= ACTION_TYPE_GUARD then return FALSE end if style == STYLE_GUARD then return FALSE elseif style == STYLE_PARRY then Fire("W_ParryEnd") return TRUE end if env(GetSpEffectID, 5822) == TRUE then return FALSE end local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level > 0 then local i = GetMoveDir(move_speed_level) local anim_id = move_table_guard[i][1] if IsExistAnime(anim_id) == FALSE then return FALSE end end Fire("W_GuardStart") return TRUE end function ExecAIParry(action_type, style) if action_type ~= ACTION_TYPE_PARRY then return FALSE end if style == STYLE_PARRY then return FALSE elseif style == STYLE_GUARD then Fire("W_GuardEnd") return TRUE end if env(GetSpEffectID, 5821) == TRUE then return FALSE end local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level > 0 then local i = GetMoveDir(move_speed_level) local anim_id = move_table_parry[i][1] if IsExistAnime(anim_id) == FALSE then return FALSE end end Fire("W_ParryStart") return TRUE end function ExecAIAttack(action_type, style) if action_type == ANIME_ID_SLEEP_START and IsExistAnime(ANIME_ID_SLEEP_START) == TRUE and IsExistAnime(ANIME_ID_SLEEP_LOOP) == TRUE and IsExistAnime(ANIME_ID_SLEEP_END) == TRUE then Fire("W_Sleep_Start") return TRUE end if action_type == ANIME_ID_SLEEP_END and IsExistAnime(ANIME_ID_SLEEP_END) == TRUE then Fire("W_Sleep_End") return TRUE end if action_type == ANIME_ID_SLEEP_COLLECT_END and IsExistAnime(ANIME_ID_SLEEP_COLLECT_END) == TRUE then Fire("W_SleepCollect_End") return TRUE end if action_type == ANIME_ID_HEATUP then ExecAttack(action_type) return TRUE end if action_type == ANIME_ID_MODE_CHANGE then ExecAttack(action_type) return TRUE end if action_type == ANIME_ID_LOSE_TARGET then ExecAttack(action_type) return TRUE end if action_type >= ANIME_ID_ATTACK_BEGIN and action_type <= ANIME_ID_ATTACK_END then ExecAttack(action_type) return TRUE end if action_type >= ANIME_ID_GUARD_ATTACK_BEGIN and action_type <= ANIME_ID_GUARD_ATTACK_END then if style ~= STYLE_GUARD and env(GetSpEffectID, 5822) == FALSE then Fire("W_GuardStart") return TRUE else ExecAttack(action_type) return TRUE end end if action_type == ANIME_ID_THROW_ERROR_ATTACK then ExecAttack(action_type) return TRUE end if action_type >= ANIME_ID_ART_STANCE_BEGIN and action_type <= ANIME_ID_ART_STANCE_END then if env(GetSpEffectID, SP_EFFECT_ART_STANCE) == FALSE and env(GetSpEffectID, 5821) == FALSE then Fire("W_ParryStart") return TRUE else ExecAttack(action_type) return TRUE end end if action_type >= ANIME_ID_GOAL_ACTION_BEGIN and action_type <= ANIME_ID_GOAL_ACTION_END then ExecGoalAction(action_type) return TRUE end if action_type == ANIME_ID_PARRY_ATTACK then ExecAttack(action_type) return TRUE end if action_type == ANIME_ID_BRING_EST then ExecAttack(action_type) return TRUE end if action_type >= ANIME_ID_EVENT_BEGIN and action_type <= ANIME_ID_EVENT_END then ExecEventAction(action_type) return TRUE end if action_type == ANIME_ID_BUDDY_DISAPPEAR then Fire("W_BuddyDisappear") return TRUE end if action_type >= ANIME_ID_IDLE_TO_IDLE_UNIQUE_BEGIN and action_type <= ANIME_ID_IDLE_TO_IDLE_UNIQUE_END and IsExistAnime(action_type) == TRUE then ExecTransToIdleUnique(action_type) return TRUE end return FALSE end function ExecAIStep(action_type) if ANIME_ID_STEP_BEGIN <= action_type and action_type <= ANIME_ID_STEP_END or action_type >= ANIME_ID_STEP2_BEGIN and action_type <= ANIME_ID_STEP2_END or action_type >= ANIME_ID_STEP3_BEGIN and action_type <= ANIME_ID_STEP3_END then ExecStep(action_type) return TRUE end return FALSE end function ExecAttack(action_number) Fire("W_Attack" .. action_number) end function ExecEventAction(action_number) Fire("W_Event" .. action_number) CallActionState(action_number) end function ExecGoalAction(action_number) Fire("W_GoalAction" .. action_number) end function ExecStep(action_number) Fire("W_Step" .. action_number) end function ExecLand(fall_type) if env(IsLanding) == FALSE then if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH and env(HasReceivedAnyDamage) == FALSE then Fire("W_DeathStartDefault") return TRUE end if env(IsHamariFallDeath, 12) == TRUE then if env(GetSpEffectType, 143) == TRUE then act(AddSpEffect, 5155) end Fire("W_DeathStartDefault") return TRUE end if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if fall_type ~= FALL_LADDER_DEATH and ExecDeath() == TRUE then return TRUE end if env(HasReceivedAnyDamage) == TRUE and ExecNoSyncAddDamage(DAMAGE_LEVEL_NONE, TRUE) == TRUE then return TRUE end return FALSE end if IsDead() == TRUE then if fall_type == FALL_UPWARD then anim_id = ANIME_ID_DEATH_LAND_UPWARD event = "W_DeathStartLandUpward" elseif fall_type == FALL_DOWNWARD then anim_id = ANIME_ID_DEATH_LAND_DOWNWARD event = "W_DeathStartLandDownward" if IsExistAnime(anim_id) == FALSE then anim_id = ANIME_ID_DEATH_LAND_DEFAULT event = "W_DeathStartLandDefault" end elseif fall_type == FALL_LADDER_DEATH then anim_id = ANIME_ID_DEATH_START_LADDER event = "W_DeathStartLadder" elseif fall_type == FALL_LADDER then anim_id = ANIME_ID_DEATH_START_LADDER event = "W_DeathStartLadder" else anim_id = ANIME_ID_DEATH_LAND_DEFAULT event = "W_DeathStartLandDefault" if IsExistAnime(anim_id) == FALSE then anim_id = ANIME_ID_DEATH_LAND_DOWNWARD event = "W_DeathStartLandDownward" end end if env(GetSpEffectID, 12605) == TRUE then anim_id = 20030 event = "W_Event20030" elseif env(GetSpEffectID, 12640) == TRUE then anim_id = 20020 event = "W_Event20020" end if IsExistAnime(anim_id) == FALSE then local num = GetExistAnimeNum(ANIME_ID_DEATH_VARIATION, 2, 10) + 1 local index = math.random(0, num - 1) SetVariable("IndexDeathVariation", index) event = "W_DeathStartDefault" end Fire(event) return TRUE end if env(CheckForEventAnimPlaybackRequest) == TRUE then return TRUE end if fall_type == FALL_LADDER then Replanning() Fire("W_LadderFallLand") return TRUE elseif fall_type == FALL_DEFAULT then local height = env(GetFallHeight) / 100 if height > HEIGHT_TRANS_TO_HEAVY_LAND then if IsExistAnime(ANIME_ID_LAND_HEAVY) == TRUE then Fire("W_LandHeavy") else Fire("W_LandDefault") end Replanning() return TRUE else Replanning() Fire("W_LandDefault") return TRUE end elseif fall_type == FALL_UPWARD then Replanning() Fire("W_LandUpward") return TRUE elseif fall_type == FALL_DOWNWARD then Replanning() Fire("W_LandDownward") return TRUE else Fire("W_LandDefault") return TRUE end return FALSE end function ExecIdleUnique() local anim_id = env(GetSpecialStayAnimID) if anim_id > 0 then Fire("W_IdleUnique" .. anim_id) return TRUE end return FALSE end function ExecTransToBattleFromIdleUnique(id) local ai_state = env(GetAITargetAwareState) local action_type = env(GetAIActionType) local move_speed_level = GetVariable("MoveSpeedLevel") if ai_state ~= AI_RECOGNITION_NONE or action_type ~= -1 or move_speed_level > 0 or env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE then local param_idle_unique = id local offset = param_idle_unique % 100 local anim_id = ANIME_ID_IDLE_UNIQUE_TO_IDLE + offset if ai_state == AI_RECOGNITION_NONE then SetIdleType(AI_STATE_DEFAULT) else SetIdleType(AI_STATE_BATTLE) end if IsExistAnime(anim_id) == TRUE then Fire("W_IdleUniqueToIdle" .. anim_id) else Fire("W_Idle") end return TRUE end return FALSE end function ExecTransToIdleUnique(action_number) Fire("W_IdleToIdleUnique" .. action_number) end function ExecFallStart(judge_fall_type) if env(IsFalling) == FALSE then return FALSE end if judge_fall_type == JUDGE_FALL_TYPE_UPWARD then if IsExistAnime(ANIME_ID_FALLING_UPWARD) == TRUE then Fire("W_FallingUpward") return TRUE end elseif judge_fall_type == JUDGE_FALL_TYPE_DOWNWARD then if IsExistAnime(ANIME_ID_FALLING_DOWNWARD) == TRUE then Fire("W_FallingDownward") return TRUE end elseif judge_fall_type == JUDGE_FALL_TYPE_DIRECTION then local damage_direction = env(GetReceivedDamageDirection) if damage_direction >= DIRECTION_LEFT and damage_direction <= DIRECTION_FORWARD then if IsExistAnime(ANIME_ID_FALLING_UPWARD) == TRUE then Fire("W_FallingUpward") return TRUE end elseif damage_direction == DIRECTION_BACK and IsExistAnime(ANIME_ID_FALLING_DOWNWARD) == TRUE then Fire("W_FallingDownward") return TRUE end end Fire("W_FallingDefault") return TRUE end function ExecAIStateChange(is_on_cancel) local cur_ai_state = env(GetAITargetAwareState) local pre_ai_state = env(GetAITargetAwareStatePreviousFrame) if cur_ai_state > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE elseif IsExistAnime(ANIME_ID_IDLE_DEFAULT) == TRUE then cur_ai_state = AI_STATE_DEFAULT else cur_ai_state = AI_STATE_BATTLE end if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end if cur_ai_state == GetVariable("IndexAiState") then return FALSE end SetIdleType(cur_ai_state) if cur_ai_state == AI_STATE_DEFAULT then if env(GetSpEffectID, 5815) == TRUE then return FALSE end if IsExistAnime(ANIME_ID_TRANS_BATTLE_DEFAULT) == TRUE then Fire("W_TransToDefaultFromBattle") return TRUE end else if env(GetSpEffectID, 5815) == TRUE then return FALSE end if IsExistAnime(ANIME_ID_TRANS_DEFAULT_BATTLE) == TRUE then Fire("W_TransToBattleFromDefault") return TRUE end end return FALSE end function ExecTransToDefaultFromBattle(is_on_cancel, is_check_AIStateChange) local cur_ai_state = env(GetAITargetAwareState) if cur_ai_state > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE elseif IsExistAnime(ANIME_ID_IDLE_DEFAULT) == TRUE then cur_ai_state = AI_STATE_DEFAULT else cur_ai_state = AI_STATE_BATTLE end if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end if is_check_AIStateChange == TRUE and cur_ai_state == GetVariable("IndexAiState") then return FALSE end SetIdleType(cur_ai_state) if cur_ai_state == AI_STATE_DEFAULT then if env(GetSpEffectID, 5815) == TRUE then return FALSE end if env(GetSpEffectID, 5816) == TRUE then return FALSE end if IsExistAnime(ANIME_ID_TRANS_BATTLE_DEFAULT) == TRUE then Fire("W_TransToDefaultFromBattle") return TRUE end end return FALSE end function ExecTransToBattleFromDefault(is_on_cancel, is_check_AIStateChange) local cur_ai_state = env(GetAITargetAwareState) if cur_ai_state > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE elseif IsExistAnime(ANIME_ID_IDLE_DEFAULT) == TRUE then cur_ai_state = AI_STATE_DEFAULT else cur_ai_state = AI_STATE_BATTLE end if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end if is_check_AIStateChange == TRUE and cur_ai_state == GetVariable("IndexAiState") then return FALSE end SetIdleType(cur_ai_state) if cur_ai_state == AI_STATE_BATTLE then if env(GetSpEffectID, 5815) == TRUE then return FALSE end if IsExistAnime(ANIME_ID_TRANS_DEFAULT_BATTLE) == TRUE then Fire("W_TransToBattleFromDefault") return TRUE end end return FALSE end function IsDead() local hp = env(GetHP) local height = env(GetFallHeight) / 100 if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH or hp <= 0 then return TRUE end if env(IsLanding) == TRUE and height > HEIGHT_FORCE_DEATH and env(GetStateChangeType, SP_EFFECT_TYPE_CAT_LANDING) == FALSE then return TRUE end if env(GetSpEffectID, 5723) == TRUE and env(GetSpEffectID, 5835) == TRUE then return TRUE end if env(GetSpEffectID, 12510) == TRUE and env(HasReceivedAnyDamage) == TRUE and env(GetSpEffectID, 14717) == FALSE then return TRUE end if hp <= 1 and env(GetSpEffectID, 12510) == FALSE and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE then return TRUE end if env(GetSpEffectID, 5730) == TRUE and env(GetSpEffectID, 5863) == TRUE then return TRUE end if env(GetSpEffectID, 10592) == TRUE and env(HasReceivedAnyDamage) == TRUE and env(GetSpEffectID, 14717) == FALSE then return TRUE end if hp <= 1 and env(GetSpEffectID, 10592) == FALSE and env(GetSpEffectID, SP_EFFECT_NEW_SKELETON_NO_DEAD) == TRUE then return TRUE end if hp <= 1 and env(GetSpEffectID, SP_EFFECT_SKELETON_NO_DEAD) == TRUE then return TRUE end if hp <= 1 and env(GetSpEffectID, 14057) == FALSE and env(GetSpEffectID, SP_EFFECT_BALLOON_DOLL_NO_DEAD) == TRUE then return TRUE end if env(GetSpEffectID, 16566) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then return TRUE end if env(GetSpEffectID, 15111) == TRUE and (env(GetSpEffectType, SP_EFFECT_TYPE_POISON) == TRUE or env(GetSpEffectType, SP_EFFECT_TYPE_PLAGUE) == TRUE) then return TRUE end if env(GetSpEffectID, 15153) == TRUE and (env(GetSpEffectType, SP_EFFECT_TYPE_POISON) == TRUE or env(GetSpEffectType, SP_EFFECT_TYPE_PLAGUE) == TRUE) then return TRUE end if env(GetSpEffectID, 15160) == TRUE and (env(GetSpEffectType, SP_EFFECT_TYPE_PLAGUE) == TRUE or env(GetSpEffectType, SP_EFFECT_TYPE_POISON) == TRUE) then return TRUE end if env(GetSpEffectID, 12660) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then return TRUE end if env(GetSpEffectID, 14962) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then return TRUE end if env(GetSpEffectID, 16159) == TRUE then return TRUE end if env(GetSpEffectID, 16153) == TRUE then return TRUE end return FALSE end function ExecDeath() if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATHIDLE then SetVariable("IndexDeathIdleVariation", 0) Fire("W_DeathIdleDefault") return TRUE end if IsDead() == FALSE then return FALSE end local death_type = GetDeathType() local anim_id = -1 local event = "W_DeathStartDefault" if death_type == DEATH_TYPE_WEAK then anim_id = ANIME_ID_DEATH_WEAK event = "W_DeathStartWeak" elseif death_type == DEATH_TYPE_BLAST then anim_id = ANIME_ID_DEATH_BLAST event = "W_DeathStartBlast" elseif death_type == DEATH_TYPE_FIRE then anim_id = ANIME_ID_DEATH_FIRE event = "W_DeathStartFire" elseif death_type == DEATH_TYPE_UPPER then anim_id = ANIME_ID_DEATH_UPPER event = "W_DeathStartUpper" elseif death_type == DEATH_TYPE_FLING then anim_id = ANIME_ID_DEATH_FLING event = "W_DeathStartFling" elseif death_type == DEATH_TYPE_SLEEP then anim_id = ANIME_ID_DEATH_START_SLEEP event = "W_DeathStartSleep" elseif death_type == DEATH_TYPE_SLEEP_COLLECT then anim_id = ANIME_ID_DEATH_START_SLEEP_COLLECT event = "W_DeathStartSleepCollect" end if anim_id >= 0 and IsExistAnime(anim_id) == FALSE then event = "W_DeathStartDefault" death_type = DEATH_TYPE_DEFAULT end if env(GetSpEffectID, 19710) == FALSE then if death_type == DEATH_TYPE_DEFAULT then local num = GetExistAnimeNum(ANIME_ID_DEATH_VARIATION, 2, 10) + 1 local index = math.random(0, num - 1) SetVariable("IndexDeathVariation", index) elseif death_type == DEATH_TYPE_FIRE then local index = GetRandomIndex(ANIME_ID_DEATH_FIRE, 2, 10) SetVariable("IndexDeathVariation", index) end end if env(GetSpEffectID, 14397) == TRUE then event = "W_Event20000" elseif env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 18680) == TRUE then event = "W_Event20009" elseif env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 18681) == TRUE then event = "W_Event20011" elseif env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 18682) == TRUE then event = "W_Event20012" elseif env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 9796) == TRUE then event = "W_Event20018" elseif env(GetSpEffectID, 18681) == TRUE or env(GetSpEffectID, 18682) == TRUE then event = "W_Event20050" elseif env(GetSpEffectID, 6071) == TRUE then event = "W_Event20017" elseif env(GetSpEffectID, 6081) == TRUE then event = "W_Event20020" elseif env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 10505) == TRUE then event = "W_Event20010" elseif env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 17058) == TRUE then event = "W_Event20010" elseif env(GetSpEffectID, 12510) == TRUE then event = "W_Event20002" elseif env(GetSpEffectID, 5835) == TRUE then event = "W_Event20004" elseif env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE and FLAG_HOLY_DAMAGE == TRUE and (death_type == DEATH_TYPE_DEFAULT or death_type == DEATH_TYPE_FIRE or death_type == DEATH_TYPE_WEAK or death_type == DEATH_TYPE_BLAST or death_type == DEATH_TYPE_FLING or death_type == DEATH_TYPE_UPPER or death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP or death_type == DEATH_TYPE_RIDE_FIRE_ONLY_TOP or death_type == DEATH_TYPE_RIDE_WEAK_ONLY_TOP or death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER or death_type == DEATH_TYPE_SLEEP or death_type == DEATH_TYPE_SLEEP_COLLECT) then event = "W_Event20015" elseif env(GetSpEffectID, 10592) == TRUE then event = "W_Event20002" elseif env(GetSpEffectID, 5863) == TRUE then event = "W_Event20004" elseif env(GetSpEffectID, SP_EFFECT_NEW_SKELETON_NO_DEAD) == TRUE and FLAG_HOLY_DAMAGE == TRUE and (death_type == DEATH_TYPE_DEFAULT or death_type == DEATH_TYPE_FIRE or death_type == DEATH_TYPE_WEAK or death_type == DEATH_TYPE_BLAST or death_type == DEATH_TYPE_FLING or death_type == DEATH_TYPE_UPPER or death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP or death_type == DEATH_TYPE_RIDE_FIRE_ONLY_TOP or death_type == DEATH_TYPE_RIDE_WEAK_ONLY_TOP or death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER or death_type == DEATH_TYPE_SLEEP) then event = "W_Event20015" elseif env(GetSpEffectID, 17102) == TRUE or env(GetSpEffectID, 17103) == TRUE or env(GetSpEffectID, 17117) == TRUE or env(GetSpEffectID, 17118) == TRUE then event = "W_Event20024" elseif env(GetSpEffectID, 15010) == TRUE and FLAG_HOLY_DAMAGE == TRUE then event = "W_Event20015" elseif env(GetSpEffectID, 12605) == TRUE and env(GetDamageLevel) == DAMAGE_LEVEL_FLING then event = "W_Event20033" elseif env(GetSpEffectID, 12605) == TRUE and env(GetDamageLevel) == DAMAGE_LEVEL_UPPER then event = "W_Event20034" elseif env(GetSpEffectID, 12605) == TRUE and (env(GetDamageLevel) == DAMAGE_LEVEL_LARGE_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_SMALL_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_EX_BLAST or env(GetDamageLevel) == DAMAGE_LEVEL_BREATH) then event = "W_Event20032" elseif env(GetSpEffectID, 12605) == TRUE then event = "W_Event20031" elseif env(GetSpEffectID, 12640) == TRUE and env(GetDamageLevel) == DAMAGE_LEVEL_FLING then event = "W_Event20023" elseif env(GetSpEffectID, 12640) == TRUE and env(GetDamageLevel) == DAMAGE_LEVEL_UPPER then event = "W_Event20024" elseif env(GetSpEffectID, 12640) == TRUE and (env(GetDamageLevel) == DAMAGE_LEVEL_LARGE_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_SMALL_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_EX_BLAST or env(GetDamageLevel) == DAMAGE_LEVEL_BREATH) then event = "W_Event20022" elseif env(GetSpEffectID, 12640) == TRUE then event = "W_Event20021" elseif env(GetSpEffectID, 12013) == TRUE and env(GetSpEffectID, 12014) == TRUE then event = "W_Event20010" elseif env(GetSpEffectID, 15359) == TRUE and (env(GetSpEffectID, 15352) == TRUE or env(GetSpEffectID, 15353) == TRUE) and env(GetIsWeakPoint) == TRUE then event = "W_Event20009" elseif env(GetSpEffectID, 15359) == TRUE and (env(GetSpEffectID, 15352) == TRUE or env(GetSpEffectID, 15353) == TRUE) then event = "W_Event20002" elseif env(GetSpEffectID, 15359) == TRUE then event = "W_Event20005" elseif env(GetSpEffectID, 15366) == TRUE then event = "W_Event20015" elseif env(GetSpEffectID, 15367) == TRUE then event = "W_Event20017" elseif env(GetSpEffectID, 15368) == TRUE then event = "W_Event20019" elseif env(GetSpEffectID, 15360) == TRUE then event = "W_Event20003" elseif env(GetSpEffectID, 10105) == TRUE then event = "W_Event20006" elseif env(GetSpEffectID, 14904) == TRUE then event = "W_Event20021" elseif env(GetSpEffectID, 16566) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE and (env(GetDamageLevel) == DAMAGE_LEVEL_NONE or env(GetDamageLevel) == DAMAGE_LEVEL_SMALL or env(GetDamageLevel) == DAMAGE_LEVEL_MIDDLE or env(GetDamageLevel) == DAMAGE_LEVEL_LARGE or env(GetDamageLevel) == DAMAGE_LEVEL_PUSH or env(GetDamageLevel) == DAMAGE_LEVEL_MINIMUM) then event = "W_Event20020" elseif env(GetSpEffectID, 16566) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE and (env(GetDamageLevel) == DAMAGE_LEVEL_LARGE_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_FLING or env(GetDamageLevel) == DAMAGE_LEVEL_SMALL_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_UPPER or env(GetDamageLevel) == DAMAGE_LEVEL_EX_BLAST or env(GetDamageLevel) == DAMAGE_LEVEL_BREATH) then event = "W_Event20021" elseif env(GetSpEffectID, 15111) == TRUE and (env(GetSpEffectType, SP_EFFECT_TYPE_POISON) == TRUE or env(GetSpEffectType, SP_EFFECT_TYPE_PLAGUE) == TRUE) then event = "W_Event20020" elseif env(GetSpEffectID, 15112) == TRUE then event = "W_Event20021" elseif env(GetSpEffectID, 15153) == TRUE and (env(GetSpEffectType, SP_EFFECT_TYPE_POISON) == TRUE or env(GetSpEffectType, SP_EFFECT_TYPE_PLAGUE) == TRUE) then event = "W_Event20020" elseif env(GetSpEffectID, 15154) == TRUE then event = "W_Event20021" elseif env(GetSpEffectID, 15160) == TRUE and (env(GetSpEffectType, SP_EFFECT_TYPE_PLAGUE) == TRUE or env(GetSpEffectType, SP_EFFECT_TYPE_POISON) == TRUE) then event = "W_Event20020" elseif env(GetSpEffectID, 10248) == TRUE then event = "W_Event20007" elseif env(GetSpEffectID, 15400) == TRUE then event = "W_Event20001" elseif env(GetSpEffectID, 15443) == TRUE then event = "W_Event20004" elseif env(GetSpEffectID, 12660) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then event = "W_Event20000" elseif env(GetSpEffectID, 14962) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then event = "W_Event20010" elseif env(GetSpEffectID, 16159) == TRUE then event = "W_Event30010" elseif env(GetSpEffectID, 16153) == TRUE then event = "W_Event20021" elseif env(GetSpEffectID, 12173) == TRUE then event = "W_Event20001" elseif env(GetSpEffectID, 12174) == TRUE then event = "W_Event20000" elseif env(GetSpEffectID, 12156) == TRUE then event = "W_Event20030" elseif env(GetSpEffectID, 15340) == TRUE and FLAG_HOLY_DAMAGE == TRUE then event = "W_Event20015" elseif env(GetSpEffectID, 11423) == TRUE then event = "W_Event20020" elseif env(GetSpEffectID, 11463) == TRUE then event = "W_Event20020" elseif env(GetSpEffectID, 11462) == TRUE then event = "W_Event20021" elseif env(GetSpEffectID, 15553) == TRUE then event = "W_Event20020" elseif env(GetSpEffectID, 11435) == TRUE then event = "W_Event20019" elseif env(GetSpEffectID, 19611) == TRUE then event = "W_Event20000" elseif env(GetSpEffectID, 19612) == TRUE then event = "W_Event20002" elseif env(GetSpEffectID, 19600) == TRUE then event = "W_Event20012" elseif env(GetSpEffectID, 19650) == TRUE then event = "W_Event20000" elseif env(GetSpEffectID, 19660) == TRUE then event = "W_Event20002" elseif env(GetSpEffectID, 9779) == TRUE and env(GetSpEffectID, 9775) == TRUE then event = "W_Event20004" elseif env(GetSpEffectID, 9779) == TRUE and env(GetSpEffectID, 9776) == TRUE then event = "W_Event20012" elseif env(GetSpEffectID, 19618) == TRUE then event = "W_Event20012" elseif env(GetSpEffectID, 19619) == TRUE then event = "W_Event20013" end Fire(event) return TRUE end function ExecTransToDeathIdle(death_type) if env(GetSpEffectID, SP_EFFECT_BUDDY_DELETE) == TRUE then Fire("W_DeathIdleDefault") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_TMP_DEATH) == TRUE and env(GetStateChangeType, SP_EFFECT_TYPE_HOLY) == FALSE and FLAG_HOLY_DAMAGE == FALSE then Fire("W_Event30000") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_TMP_DEATH_DOWNWARD) == TRUE and env(GetStateChangeType, SP_EFFECT_TYPE_HOLY) == FALSE and FLAG_HOLY_DAMAGE == FALSE then Fire("W_Event30008") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, SP_EFFECT_NEW_SKELETON_TMP_DEATH) == TRUE and env(GetStateChangeType, SP_EFFECT_TYPE_HOLY) == FALSE and FLAG_HOLY_DAMAGE == FALSE then Fire("W_Event30000") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, SP_EFFECT_NEW_SKELETON_TMP_DEATH_DOWNWARD) == TRUE and env(GetStateChangeType, SP_EFFECT_TYPE_HOLY) == FALSE and FLAG_HOLY_DAMAGE == FALSE then Fire("W_Event30008") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, SP_EFFECT_BALLOON_DOLL_TMP_DEATH) == TRUE then Fire("W_Event30005") return TRUE end if env(GetHP) > 0 and env(GetSpEffectID, SP_EFFECT_BALLOON_DOLL_TMP_DEATH_DOWNWARD) == TRUE then Fire("W_Event30004") return TRUE end if env(IsAnimEnd, 1) == FALSE then return FALSE end local event = "W_DeathIdleDefault" local anim_id = -1 local index = -1 if death_type == DEATH_TYPE_FIRE then index = GetVariable("IndexDeathVariation") anim_id = ANIME_ID_DEATH_FIRE + index * 10 + 1 event = "W_DeathIdleFire" elseif death_type == DEATH_TYPE_WEAK then anim_id = ANIME_ID_DEATH_WEAK + 1 event = "W_DeathIdleWeak" elseif death_type == DEATH_TYPE_BLAST then anim_id = ANIME_ID_DEATH_BLAST + 1 event = "W_DeathIdleBlast" elseif death_type == DEATH_TYPE_FLING then anim_id = ANIME_ID_DEATH_FLING + 1 event = "W_DeathIdleFling" elseif death_type == DEATH_TYPE_UPPER then anim_id = ANIME_ID_DEATH_UPPER + 1 event = "W_DeathIdleUpper" elseif death_type == DEATH_TYPE_LAND_DEFAULT then anim_id = ANIME_ID_DEATH_LAND_DEFAULT + 1 event = "W_DeathIdleLandDefault" elseif death_type == DEATH_TYPE_LAND_UPWARD then anim_id = ANIME_ID_DEATH_LAND_UPWARD + 1 event = "W_DeathIdleLandUpward" elseif death_type == DEATH_TYPE_LAND_DOWNWARD then anim_id = ANIME_ID_DEATH_LAND_DOWNWARD + 1 event = "W_DeathIdleLandDownward" elseif death_type == DEATH_TYPE_LADDER then anim_id = ANIME_ID_DEATH_START_LADDER + 1 event = "W_DeathIdleLadder" elseif death_type == DEATH_TYPE_SLEEP then anim_id = ANIME_ID_DEATH_START_SLEEP + 1 event = "W_DeathIdleSleep" elseif death_type == DEATH_TYPE_SLEEP_COLLECT then anim_id = ANIME_ID_DEATH_START_SLEEP_COLLECT + 1 event = "W_DeathIdleSleepCollect" elseif death_type == DEATH_TYPE_RIDE_WEAK_ONLY_TOP then anim_id = ANIME_ID_RIDE_DEATH_WEAK + 1 event = "W_Ride_Enemy_WeakDeathOnlyTopIdle" elseif death_type == DEATH_TYPE_RIDE_LAND_ONLY_TOP then anim_id = ANIME_ID_RIDE_DEATH_LAND_TOP + 1 event = "W_Ride_Enemy_DeathLandDefaultOnlyTopIdle" elseif death_type == DEATH_TYPE_RIDE_LAND_ONLY_UNDER then anim_id = ANIME_ID_RIDE_DEATH_LAND_UNDER + 1 event = "W_Ridden_Enemy_DeathLandDefaultOnlyUnderIdle" elseif death_type == DEATH_TYPE_RIDE_FIRE_ONLY_TOP then anim_id = ANIME_ID_RIDE_DEATH_FIRE + 1 event = "W_Ride_Enemy_FireDeathOnlyTopIdle" elseif death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP then anim_id = ANIME_ID_RIDE_DEATH_DEFAULT_TOP + 1 event = "W_Ride_Enemy_DeathOnlyTopIdle" elseif death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER then anim_id = ANIME_ID_RIDE_DEATH_DEFAULT_UNDER + 1 event = "W_Ridden_Enemy_DeathOnlyUnderIdle" elseif death_type == DEATH_TYPE_THROW_DEF then local throw_id = GetVariable("ThrowID") anim_id = ANIME_ID_DEATH_THROW_PARRY + 1 if throw_id == ANIME_ID_THROW_DEF_BACKSTAB then anim_id = ANIME_ID_DEATH_THROW_BACKSTAB + 1 elseif throw_id == ANIME_ID_THROW_DEF_STEALTH then anim_id = ANIME_ID_DEATH_THROW_STEALTH + 1 elseif throw_id == ANIME_ID_THROW_DEF_FALLHORSE then anim_id = ANIME_ID_DEATH_THROW_FALLHORSE + 1 elseif throw_id == ANIME_ID_THROW_DEF_FALL then anim_id = ANIME_ID_DEATH_THROW_FALL + 1 elseif throw_id == ANIME_ID_THROW_DEF_SLEEP then anim_id = ANIME_ID_DEATH_THROW_SLEEP + 1 elseif throw_id == ANIME_ID_THROW_DEF_TRUNK_FRONT then anim_id = ANIME_ID_DEATH_THROW_TRUNK_FRONT + 1 elseif throw_id == ANIME_ID_THROW_DEF_TRUNK_BACK then anim_id = ANIME_ID_DEATH_THROW_TRUNK_BACK + 1 end event = "W_ThrowDefDeathIdle" elseif death_type == DEATH_TYPE_DEFAULT then index = GetVariable("IndexDeathVariation") if index > 0 then anim_id = ANIME_ID_DEATH_VARIATION + 10 * (index - 1) + 1 end end if anim_id >= 0 then if IsExistAnime(anim_id) == FALSE then event = "W_DeathIdleDefault" SetVariable("IndexDeathIdleVariation", 0) elseif index >= 0 then SetVariable("IndexDeathIdleVariation", index) end end Fire(event) return TRUE end function ExecSpEffectEventAction() local anim_id = env(GetSpEffectEventAnimID) if anim_id >= 0 then Fire("W_Event" .. anim_id) return TRUE end return FALSE end function ExecTalkTransition(anim_id) local talk_ref_Id = env(GetTalkID_3001) if talk_ref_Id == TALK_BEH_IDENTIFIER__NOT_TALKING then talk_ref_Id = env(GetTalkID_3002) end if talk_ref_Id == TALK_BEH_IDENTIFIER__NOT_TALKING or talk_ref_Id ~= GetVariable("TalkPlayPrevID") then SetVariable("IsDoneTalkPlayOneshot", false) end SetVariable("TalkPlayPrevID", talk_ref_Id) if ExecTalkTransitionIndividual(anim_id, talk_ref_Id) == TRUE then local cur_ai_state = AI_STATE_DEFAULT if env(GetAITargetAwareState) > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE end SetIdleType(cur_ai_state) return TRUE end return FALSE end function IsSpDamageAllowed() if env(GetSpEffectID, SP_EFFECT_IGNORE_SPECIAL_DAMAGE) == TRUE then return FALSE elseif env(GetSpEffectID, SP_EFFECT_IGNORE_SPECIAL_DAMAGE + 1) == TRUE then return FALSE elseif env(GetSpEffectID, SP_EFFECT_IGNORE_SPECIAL_DAMAGE + 2) == TRUE then return FALSE end return TRUE end function CheckSpDamageRand() local damage_elem = env(GetSpecialAttribute) if damage_elem == DAMAGE_ELEMENT_FIRE then if env(GetSpEffectID, 5721) == TRUE then return TRUE end if env(GetSpEffectID, SP_EFFECT_MAGGOT_MAN) == TRUE or env(GetSpEffectID, SP_EFFECT_CRUCIFY_GHOST_A) == TRUE or env(GetSpEffectID, SP_EFFECT_CRUCIFY_GHOST_B) == TRUE or env(GetSpEffectID, SP_EFFECT_GHOST_DOG) == TRUE or env(GetSpEffectID, SP_EFFECT_GUNDA_GHOST) == TRUE then return TRUE end end local damage_part = env(GetPartGroup) if damage_part == 1 then if env(GetSpEffectID, SP_EFFECT_COBRA_ASSASSIN) == TRUE or env(GetSpEffectID, SP_EFFECT_SANDWORM) == TRUE or env(GetSpEffectID, SP_EFFECT_MOTHER_DORAGON) == TRUE then return TRUE elseif env(GetSpEffectID, SP_EFFECT_FULL_ARMOR_BEAST) == TRUE and damage_elem == DAMAGE_ELEMENT_FIRE then return TRUE end elseif damage_part == 7 and env(GetSpEffectID, SP_EFFECT_TINDALOS_SP_DAMAGE) == TRUE then return TRUE end return FALSE end function ExecSpDamage() if CheckSpDamageRand() == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) local index = GetRandomIndex(ANIME_ID_SPECIAL_DAMAGE_RANDOM, 3, 1) SetVariable("IndexDamageRandom", index) Fire("W_DamageSpecial") return TRUE end if env(GetSpEffectID, SP_EFFECT_GARGOYLE_AT_CASTLE) == TRUE then local damage_direction = env(GetReceivedDamageDirection) if damage_direction == DIRECTION_BACK and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20010") return TRUE end end if env(GetSpEffectID, SP_EFFECT_SKELETON_KNIGHT) == TRUE and env(GetPhysicalAttribute) == 2 then local damage_level = env(GetDamageLevel) if (damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_LARGE or damage_level == DAMAGE_LEVEL_SMALL_BLOW or damage_level == DAMAGE_LEVEL_LARGE_BLOW) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) local dir = env(GetReceivedDamageDirection) local event = "W_Event20010" if dir == DIRECTION_BACK then event = "W_Event20011" elseif dir == DIRECTION_LEFT then event = "W_Event20012" elseif dir == DIRECTION_RIGHT then event = "W_Event20013" end Fire(event) return TRUE end end if CAN_CONFUSION == TRUE and env(GetBehaviorID, BEH_IDENTIFIER_GOLEM_CONFUSION) == TRUE and POINT_CONFUSION > BORDER_CONFUSION and env(GetSpEffectType, SP_EFFECT_TYPE_GOLEM_CONFUSION) == FALSE and IsSpDamageAllowed() == TRUE then if env(GetSpEffectID, 12156) == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20031") act(AddSpEffect, SP_EFFECT_CONFUSION) return TRUE else Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSpecial") act(AddSpEffect, SP_EFFECT_CONFUSION) return TRUE end end if env(GetBehaviorID, BEH_IDENTIFIER_MARIQUES_PARRY) == TRUE and env(GetSpEffectID, 15280) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20004") return TRUE end if env(GetBehaviorID, BEH_IDENTIFIER_MARIQUES_PARRY) == TRUE and env(GetSpEffectID, 15281) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20005") return TRUE end if env(GetSpEffectID, 16247) == TRUE and env(GetSpEffectID, 16249) == FALSE and env(GetSpEffectID, 16200) == FALSE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event3024") return TRUE end if env(GetSpEffectID, 16248) == TRUE and env(GetBehaviorID, BEH_IDENTIFIER_TRAUMA_MORGOTT) == TRUE and env(GetSpEffectID, 6090) == FALSE and env(GetSpEffectID, 6091) == FALSE and env(GetSpEffectID, 6092) == FALSE and env(GetSpEffectID, 6096) == FALSE and env(GetSpEffectID, 6097) == TRUE and IsSpDamageAllowed() == TRUE then if env(GetSpEffectID, 6095) == TRUE then act(AddSpEffect, 6096) act(AddSpEffect, 6091) else act(AddSpEffect, 6095) end Replanning() Fire("W_Event20010") return TRUE end if env(GetSpEffectID, 13703) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) local dir = env(GetReceivedDamageDirection) local event = "W_Event20000" if dir == DIRECTION_BACK then event = "W_Event20001" elseif dir == DIRECTION_LEFT then event = "W_Event20002" elseif dir == DIRECTION_RIGHT then event = "W_Event20003" end Fire(event) return TRUE end if env(GetSpEffectID, 5730) == TRUE or env(GetSpEffectID, 5723) == TRUE then if env(GetSpEffectID, 5865) == TRUE or env(GetSpEffectID, 5836) == TRUE then if IsSpDamageAllowed() == TRUE then act(TurnTowardAttacker, 0) Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSmallBlow") return TRUE end elseif (env(GetSpEffectID, 5866) == TRUE or env(GetSpEffectID, 5837) == TRUE) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSpecial") return TRUE end end if (env(GetSpEffectID, 17102) == TRUE or env(GetSpEffectID, 17103) == TRUE or env(GetSpEffectID, 17117) == TRUE or env(GetSpEffectID, 17118) == TRUE) and IsSpDamageAllowed() == TRUE then if env(GetPartGroup) == 1 or env(GetPartGroup) == 2 then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20019") return TRUE else Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20023") return TRUE end end if env(GetSpEffectID, 5720) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSpecial") return TRUE end if env(GetSpEffectID, 5728) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSpecial") return TRUE end if env(GetSpEffectID, 15359) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20007") return TRUE end if env(GetSpEffectID, 15366) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20014") return TRUE end if env(GetSpEffectID, 15367) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20016") return TRUE end if env(GetSpEffectID, 15368) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20018") return TRUE end if env(GetSpEffectID, 5731) == TRUE and env(GetBehaviorID, BEH_IDENTIFIER_INSECT) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSpecial") return TRUE end if env(GetSpEffectID, 14908) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20020") return TRUE end if env(GetSpEffectID, 5724) == TRUE and IsSpDamageAllowed() == TRUE then local damage_elem = env(GetSpecialAttribute) if damage_elem == DAMAGE_ELEMENT_FIRE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) local index = 0 SetVariable("IndexDamageRandom", index) Fire("W_DamageSpecial") return TRUE end end if env(GetSpEffectID, 5725) == TRUE and IsSpDamageAllowed() == TRUE then local damage_elem = env(GetSpecialAttribute) if damage_elem == DAMAGE_ELEMENT_FIRE and env(GetSpEffectID, 5726) == FALSE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) local index = 1 SetVariable("IndexDamageRandom", index) Fire("W_DamageSpecial") return TRUE end end if env(GetSpEffectID, 14856) == TRUE and env(GetPartGroup) == 1 and env(GetPoise) > 0 and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20000") return TRUE end if env(GetSpEffectID, 5729) == TRUE and (env(GetDamageLevel) == DAMAGE_LEVEL_SMALL_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_EX_BLAST or env(GetDamageLevel) == DAMAGE_LEVEL_BREATH or env(GetDamageLevel) == DAMAGE_LEVEL_LARGE_BLOW) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE_BLOW) local dir = env(GetReceivedDamageDirection) local event = "W_Event20010" if dir == DIRECTION_BACK then event = "W_Event20011" elseif dir == DIRECTION_LEFT then event = "W_Event20012" elseif dir == DIRECTION_RIGHT then event = "W_Event20013" end Fire(event) return TRUE end if env(GetSpEffectID, 16486) == TRUE and (env(GetPartGroup) == 1 or env(GetPartGroup) == 31) and (env(GetDamageLevel) == DAMAGE_LEVEL_MIDDLE or env(GetDamageLevel) == DAMAGE_LEVEL_LARGE or env(GetDamageLevel) == DAMAGE_LEVEL_LARGE_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_FLING or env(GetDamageLevel) == DAMAGE_LEVEL_SMALL_BLOW or env(GetDamageLevel) == DAMAGE_LEVEL_UPPER or env(GetDamageLevel) == DAMAGE_LEVEL_EX_BLAST or env(GetDamageLevel) == DAMAGE_LEVEL_BREATH) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20007") return TRUE end if (env(GetSpEffectID, 11900) == TRUE or env(GetSpEffectID, 11901) == TRUE or env(GetSpEffectID, 11902) == TRUE) and env(GetSpEffectID, 11951) == TRUE and (env(GetSpEffectID, 1750) == TRUE or env(GetSpEffectID, 1751) == TRUE) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20006") return TRUE end if (env(GetSpEffectID, 11900) == TRUE or env(GetSpEffectID, 11901) == TRUE or env(GetSpEffectID, 11902) == TRUE) and env(GetSpEffectID, 11951) == FALSE and env(GetSpEffectID, 11952) == FALSE and env(GetSpEffectID, 11953) == FALSE and (env(GetSpEffectID, 1750) == TRUE or env(GetSpEffectID, 1751) == TRUE) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20005") return TRUE end if GetHpRatio() < 0.6000000238418579 and env(GetSpEffectID, 14780) == TRUE and env(GetSpEffectID, 14782) == FALSE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20010") return TRUE end if GetHpRatio() < 0.15 and env(GetSpEffectID, 16256) == TRUE and env(GetSpEffectID, 16241) == FALSE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20009") return TRUE end if env(GetSpEffectID, 12750) == TRUE and env(GetSpEffectID, 12752) == FALSE and (env(GetPartGroup) == 8 or env(GetPartGroup) == 9) and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20010") return TRUE end if env(GetSpEffectID, 10680) == TRUE and env(GetBehaviorID, BEH_IDENTIFIER_TRAUMA_GREATER_DEMON) == TRUE and env(GetSpEffectID, 6090) == FALSE and env(GetSpEffectID, 6091) == FALSE and env(GetSpEffectID, 6092) == FALSE and env(GetSpEffectID, 6096) == FALSE and env(GetSpEffectID, 6097) == TRUE and IsSpDamageAllowed() == TRUE then if env(GetSpEffectID, 6095) == TRUE then act(AddSpEffect, 6096) act(AddSpEffect, 6091) else act(AddSpEffect, 6095) end Replanning() Fire("W_Event20021") return TRUE end if env(GetSpEffectID, 15320) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_DamageSpecial") return TRUE end if env(GetSpEffectID, 19600) == TRUE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) act(TurnTowardAttacker, 0) Fire("W_Event20010") return TRUE end if env(GetSpEffectID, 19620) == TRUE and env(GetSpEffectID, 19623) == TRUE and env(GetSpEffectID, 19628) == TRUE then if GetHpRatio() <= 0.8500000238418579 and env(GetSpEffectID, 19624) == FALSE then if IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20006") return TRUE end elseif GetHpRatio() <= 0.550000011920929 and env(GetSpEffectID, 19625) == FALSE then if IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20006") return TRUE end elseif GetHpRatio() <= 0.30000001192092896 and env(GetSpEffectID, 19626) == FALSE and IsSpDamageAllowed() == TRUE then Replanning() act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Fire("W_Event20009") return TRUE end end return FALSE end function ExecNoSyncAddDamage(damage_level, is_damaged) if ExecNoSyncAddSpecialDamage(damage_level, is_damaged) == TRUE then return TRUE elseif damage_level == DAMAGE_LEVEL_NONE and is_damaged == TRUE then if env(IsPartDamageAdditiveBlendInvalid) == TRUE then return TRUE end if env(GetBehaviorID, BEH_IDENTIFIER_NO_ADD_BLEND) == TRUE then return FALSE end if IsExistAnime(ANIME_ID_NO_ADD) == FALSE then return TRUE end local damage_part = env(GetPartGroup) if IsExistAnime(ANIME_ID_PART_WEAK_DAMAGE) == TRUE and damage_part == 31 then SetVariable("BlendWeakPart", 1) Fire("W_WeakPartBlend_Add") return TRUE end if damage_part > 0 then local anim_id = 0 if damage_part > 8 then anim_id = ANIME_ID_PART9_DAMAGE + damage_part - 9 else anim_id = ANIME_ID_PART1_DAMAGE + (damage_part - 1) * 10 end if IsExistAnime(anim_id) == TRUE then SetVariable("BlendPart" .. damage_part, 1) Fire("W_PartBlend_Add" .. damage_part) return TRUE end end if IsExistAnime(ANIME_ID_ADD_BLEND_FRONT) == TRUE then if env(GetSpEffectID, 19690) == TRUE then return TRUE end local damage_direction = env(GetReceivedDamageDirection) local offsetanim = GetDamageDirectionOffset(damage_direction) local str = "W_SABlend_Add_Front" if damage_direction == DIRECTION_FORWARD then elseif damage_direction == DIRECTION_LEFT then str = "W_SABlend_Add_Left" elseif damage_direction == DIRECTION_RIGHT then str = "W_SABlend_Add_Right" elseif damage_direction == DIRECTION_BACK then str = "W_SABlend_Add_Back" end if IsExistAnime(ANIME_ID_ADD_BLEND_FRONT + offsetanim) == TRUE then SetVariable("BlendSA", 1) Fire(str) else SetVariable("BlendSA", 1) Fire("W_SABlend_Add_Front") end return TRUE end return TRUE end return FALSE end function ExecNoSyncAddSpecialDamage(damage_level, is_damaged) if damage_level == DAMAGE_LEVEL_NONE and is_damaged == TRUE then if env(IsPartDamageAdditiveBlendInvalid) == TRUE then return TRUE end if IsExistAnime(ANIME_ID_NO_ADD) == FALSE then return TRUE end local damage_part = env(GetPartGroup) if env(GetSpEffectID, 14308) == TRUE and damage_part == 31 then SetVariable("BlendPart16", 1) Fire("W_PartBlend_Add16") return TRUE end if env(GetSpEffectID, 10130) == TRUE then if damage_part == 31 then SetVariable("BlendPart8", 1) Fire("W_PartBlend_Add8") return TRUE end if damage_part == 2 then SetVariable("BlendPart9", 1) Fire("W_PartBlend_Add9") return TRUE end if damage_part == 3 then SetVariable("BlendPart10", 1) Fire("W_PartBlend_Add10") return TRUE end if damage_part == 4 then SetVariable("BlendPart11", 1) Fire("W_PartBlend_Add11") return TRUE end if damage_part == 5 then SetVariable("BlendPart12", 1) Fire("W_PartBlend_Add12") return TRUE end if damage_part == 6 then SetVariable("BlendPart13", 1) Fire("W_PartBlend_Add13") return TRUE end end elseif is_damaged == TRUE then if env(IsPartDamageAdditiveBlendInvalid) == TRUE then return TRUE end if IsExistAnime(ANIME_ID_NO_ADD) == FALSE then return TRUE end local damage_part = env(GetPartGroup) if damage_part > 0 then if env(GetSpEffectID, 5960) == TRUE and damage_part == 1 then SetVariable("BlendPart1", 1) Fire("W_PartBlend_Add1") return TRUE end if env(GetSpEffectID, 5961) == TRUE and damage_part == 2 then SetVariable("BlendPart2", 1) Fire("W_PartBlend_Add2") return TRUE end if env(GetSpEffectID, 5962) == TRUE and damage_part == 3 then SetVariable("BlendPart3", 1) Fire("W_PartBlend_Add3") return TRUE end if env(GetSpEffectID, 5963) == TRUE and damage_part == 4 then SetVariable("BlendPart4", 1) Fire("W_PartBlend_Add4") return TRUE end if env(GetSpEffectID, 5964) == TRUE and damage_part == 5 then SetVariable("BlendPart5", 1) Fire("W_PartBlend_Add5") return TRUE end if env(GetSpEffectID, 5965) == TRUE and damage_part == 6 then SetVariable("BlendPart6", 1) Fire("W_PartBlend_Add6") return TRUE end if env(GetSpEffectID, 5966) == TRUE and damage_part == 7 then SetVariable("BlendPart7", 1) Fire("W_PartBlend_Add7") return TRUE end if env(GetSpEffectID, 5967) == TRUE and damage_part == 8 then SetVariable("BlendPart8", 1) Fire("W_PartBlend_Add8") return TRUE end if env(GetSpEffectID, 5968) == TRUE and damage_part == 9 then SetVariable("BlendPart9", 1) Fire("W_PartBlend_Add9") return TRUE end if env(GetSpEffectID, 5969) == TRUE and damage_part == 10 then SetVariable("BlendPart10", 1) Fire("W_PartBlend_Add10") return TRUE end if env(GetSpEffectID, 5970) == TRUE and damage_part == 11 then SetVariable("BlendPart11", 1) Fire("W_PartBlend_Add11") return TRUE end if env(GetSpEffectID, 5971) == TRUE and damage_part == 12 then SetVariable("BlendPart12", 1) Fire("W_PartBlend_Add12") return TRUE end if env(GetSpEffectID, 5972) == TRUE and damage_part == 13 then SetVariable("BlendPart13", 1) Fire("W_PartBlend_Add13") return TRUE end if env(GetSpEffectID, 5973) == TRUE and damage_part == 14 then SetVariable("BlendPart14", 1) Fire("W_PartBlend_Add14") return TRUE end if env(GetSpEffectID, 5974) == TRUE and damage_part == 15 then SetVariable("BlendPart15", 1) Fire("W_PartBlend_Add15") return TRUE end if env(GetSpEffectID, 5975) == TRUE and damage_part == 16 then SetVariable("BlendPart16", 1) Fire("W_PartBlend_Add16") return TRUE end end end return FALSE end function ExecNoSyncAddGuardDamage(damage_level, is_damaged) if is_damaged == FALSE and damage_level == DAMAGE_LEVEL_NONE then return FALSE end if env(IsPartDamageAdditiveBlendInvalid) == TRUE then return FALSE end if env(GetBehaviorID, BEH_IDENTIFIER_NO_ADD_BLEND) == TRUE then return FALSE end if IsExistAnime(ANIME_ID_NO_ADD) == FALSE then return FALSE end if IsExistAnime(ANIME_ID_BLEND_DAMAGE_GUARD) == TRUE then SetVariable("BlendGuard", 1) Fire("W_GuardBlend_Add") return TRUE end return FALSE end function ExecSaBreakDamage(damage_level, is_damaged) if env(HasBrokenSA) == TRUE and env(GetSpEffectID, 13070) == TRUE and env(GetSpEffectID, 5401) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 0) Replanning() Fire("W_SABreak") return TRUE elseif env(GetSpEffectType, 398) == TRUE and env(GetSpEffectType, 399) == TRUE and env(GetSpEffectID, 13070) == TRUE and env(GetSpEffectID, 5401) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 180) Replanning() Fire("W_SABreak") return TRUE elseif env(HasBrokenSA) == TRUE and (env(GetSpEffectID, 17102) == TRUE or env(GetSpEffectID, 17103) == TRUE) then Replanning() Fire("W_Event20019") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 5401) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 0) Replanning() Fire("W_SABreak") return TRUE elseif env(GetSpEffectType, 398) == TRUE and env(GetSpEffectType, 399) == TRUE and env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 5401) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 180) Replanning() Fire("W_SABreak") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 5404) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 0) Replanning() Fire("W_SABreak") return TRUE elseif env(GetSpEffectType, 398) == TRUE and env(GetSpEffectType, 399) == TRUE and env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 5404) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 180) Replanning() Fire("W_SABreak") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 10900) == TRUE and (env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 5402) == TRUE) then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 0) Replanning() Fire("W_SABreak") return TRUE elseif env(GetSpEffectType, 398) == TRUE and env(GetSpEffectType, 399) == TRUE and env(GetSpEffectID, 10900) == TRUE and (env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 5402) == TRUE) then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 180) Replanning() Fire("W_SABreak") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 15356) == TRUE and env(GetSpEffectID, 5402) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 0) Replanning() Fire("W_SABreak") return TRUE elseif env(GetSpEffectType, 398) == TRUE and env(GetSpEffectType, 399) == TRUE and env(GetSpEffectID, 15356) == TRUE and env(GetSpEffectID, 5402) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 180) Replanning() Fire("W_Event20023") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 15400) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20002") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 12172) == TRUE then local damage_direction = env(GetReceivedDamageDirection) local damage_part = env(GetPartGroup) if env(GetSpEffectID, 12156) == TRUE then if damage_part == 2 or damage_part == 6 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20008") return TRUE elseif damage_part == 3 or damage_part == 7 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20011") return TRUE elseif damage_part == 4 or damage_part == 8 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20009") return TRUE elseif damage_part == 5 or damage_part == 9 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20010") return TRUE elseif damage_direction == DIRECTION_LEFT then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20009") return TRUE elseif damage_direction == DIRECTION_RIGHT then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20010") return TRUE elseif damage_direction == DIRECTION_BACK then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20010") return TRUE elseif damage_direction == DIRECTION_FORWARD then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20011") return TRUE end elseif damage_part == 2 or damage_part == 4 or damage_part == 6 or damage_part == 8 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20007") return TRUE elseif damage_part == 3 or damage_part == 5 or damage_part == 7 or damage_part == 9 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20006") return TRUE elseif damage_direction == DIRECTION_LEFT then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20007") return TRUE elseif damage_direction == DIRECTION_RIGHT then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20006") return TRUE else act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20006") return TRUE end elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 19610) == TRUE and env(GetSpEffectID, 19611) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20001") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 19610) == TRUE and env(GetSpEffectID, 19612) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20003") return TRUE elseif env(HasBrokenSA) == TRUE and env(GetSpEffectID, 19620) == TRUE then local damage_direction = env(GetReceivedDamageDirection) local damage_part = env(GetPartGroup) if damage_part == 3 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20000") return TRUE elseif damage_part == 4 then act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_Event20001") return TRUE end elseif env(GetSpEffectType, 398) == TRUE and env(GetSpEffectType, 399) == TRUE and (env(GetSpEffectID, 11456) == TRUE or env(GetSpEffectID, 11457) == TRUE or env(GetSpEffectID, 11458) == TRUE) then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) act(TurnTowardAttacker, 180) Replanning() Fire("W_Event20002") return TRUE elseif IsExistAnime(ANIME_ID_SA_BREAK) == TRUE and env(HasBrokenSA) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_SABreak") return TRUE end return FALSE end function ExecGuardBlock(damage_type, ignore_guard_block) if damage_type == DAMAGE_TYPE_GUARD and env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == FALSE and env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == FALSE then local guard_damage = env(GetGuardLevelAction) if ignore_guard_block == TRUE then guard_damage = GUARD_LEVEL_SMALL end if guard_damage == GUARD_LEVEL_SMALL then act(SetDamageAnimType, DAMAGE_FLAG_GUARD_SMALL) if GetStaminaRatio() < 0.4000000059604645 and IsExistAnime(ANIME_ID_GUARD_DAMAGE_SMALL_LOW) == TRUE then Fire("W_GuardDamageSmallLowStamina") return TRUE end Fire("W_GuardDamageSmall") return TRUE elseif guard_damage == GUARD_LEVEL_LARGE then act(SetDamageAnimType, DAMAGE_FLAG_GUARD_LARGE) if GetStaminaRatio() < 0.4000000059604645 and IsExistAnime(ANIME_ID_GUARD_DAMAGE_LARGE_LOW) == TRUE then Fire("W_GuardDamageLargeLowStamina") return TRUE end Fire("W_GuardDamageLarge") return TRUE elseif guard_damage == GUARD_LEVEL_EXLARGE then act(SetDamageAnimType, DAMAGE_FLAG_GUARD_EXLARGE) Fire("W_GuardDamageLarge") return TRUE else return FALSE end elseif damage_type == DAMAGE_TYPE_GUARD_BREAK then if env(GetSpEffectID, 13799) == TRUE then return TRUE end Replanning() act(SetDamageAnimType, DAMAGE_FLAG_GUARD_BREAK) Fire("W_GuardBreak") return TRUE end return FALSE end function ExecTypeDamage(damage_type) if damage_type == DAMAGE_TYPE_PARRY or damage_type >= DAMAGE_TYPE_PARRY_ENEMY1 and damage_type <= DAMAGE_TYPE_PARRY_ENEMY3 then if CAN_PARRY_RESIST == TRUE and BORDER_PARRY_RESIST >= POINT_PARRY_RESIST and (damage_type == DAMAGE_TYPE_PARRY_ENEMY1 or damage_type == DAMAGE_TYPE_PARRY_ENEMY2) then if env(GetSpEffectID, 14560) == TRUE then Fire("W_Event20005") elseif env(GetSpEffectID, 18460) == TRUE then Fire("W_Event20010") elseif env(GetSpEffectID, 16238) == TRUE then Fire("W_Event20015") elseif env(GetSpEffectID, 16239) == TRUE then Fire("W_Event20015") elseif env(GetSpEffectID, 18590) == TRUE then Fire("W_Event20000") elseif env(GetSpEffectID, 16425) == TRUE then Fire("W_Event20001") elseif env(GetSpEffectID, 15460) == TRUE then Fire("W_Event20000") elseif env(GetSpEffectID, 19630) == TRUE then Fire("W_Event20001") elseif env(GetSpEffectID, 19631) == TRUE then if damage_type == DAMAGE_TYPE_PARRY_ENEMY1 then Fire("W_Event20000") elseif damage_type == DAMAGE_TYPE_PARRY_ENEMY2 then Fire("W_Event20001") end elseif env(GetSpEffectID, 19632) == TRUE then if damage_type == DAMAGE_TYPE_PARRY_ENEMY1 then Fire("W_Event20010") elseif damage_type == DAMAGE_TYPE_PARRY_ENEMY2 then Fire("W_Event20011") end elseif env(GetSpEffectID, 19633) == TRUE then Fire("W_Event20035") end elseif damage_type == DAMAGE_TYPE_PARRY_ENEMY1 and env(GetSpEffectID, 16247) == TRUE and env(GetSpEffectID, 16249) == FALSE and env(GetSpEffectID, 16200) == FALSE then Fire("W_Event3024") elseif damage_type == DAMAGE_TYPE_PARRY_ENEMY2 then if IsExistAnime(ANIME_ID_PARRY_DAMAGE_ENEMY2) == TRUE then Fire("W_DamageParryEnemy2") else Fire("W_DamageParryEnemy1") end if CAN_PARRY_RESIST == TRUE then POINT_PARRY_RESIST = 0 act(AddSpEffect, 6040) end else if IsExistAnime(ANIME_ID_PARRY_DAMAGE_ENEMY1) == TRUE then Fire("W_DamageParryEnemy1") else Fire("W_DamageParryEnemy2") end if CAN_PARRY_RESIST == TRUE then POINT_PARRY_RESIST = 0 act(AddSpEffect, 6040) end end Replanning() return TRUE elseif damage_type >= DAMAGE_TYPE_WALL_ENEMY1 and damage_type <= DAMAGE_TYPE_WALL_ENEMY3 then if damage_type == DAMAGE_TYPE_WALL_ENEMY2 then if IsExistAnime(ANIME_ID_ATTACK_BOUND_ENEMY2) == TRUE then Replanning() Fire("W_AttackBoundEnemy2") return TRUE end elseif IsExistAnime(ANIME_ID_ATTACK_BOUND_ENEMY1) == TRUE then Replanning() Fire("W_AttackBoundEnemy1") return TRUE end elseif damage_type >= DAMAGE_TYPE_GUARDED_BOUND_ENEMY1 and damage_type <= DAMAGE_TYPE_GUARDED_BOUND_ENEMY3 then if damage_type == DAMAGE_TYPE_GUARDED_BOUND_ENEMY2 then if IsExistAnime(ANIME_ID_ATTACK_BOUND_ENEMY2) == TRUE then Replanning() Fire("W_AttackBoundEnemy2") return TRUE else return TRUE end elseif IsExistAnime(ANIME_ID_ATTACK_BOUND_ENEMY1) == TRUE then Replanning() Fire("W_AttackBoundEnemy1") return TRUE else return TRUE end end return FALSE end function ExecWeakDamage() if env(GetSpEffectID, 6008) == TRUE then if env(GetIsWeakPoint) == TRUE then local damage_direction = env(GetMapActionID) if damage_direction ~= 0 then damage_direction = DIRECTION_BACK else damage_direction = DIRECTION_FORWARD end local offset = GetDamageDirectionOffset(damage_direction) local id_with_direction = ANIME_ID_DAMAGE_WEAK + offset if offset ~= 0 then if IsExistAnime(id_with_direction) == TRUE then SetVariable("IndexDamageDirection", DIRECTION_BACK) act(SetDamageAnimType, DAMAGE_FLAG_WEAK) act(TurnTowardAttacker, 180) Replanning() Fire("W_DamageWeak") return TRUE elseif IsExistAnime(ANIME_ID_DAMAGE_WEAK) == TRUE then SetVariable("IndexDamageDirection", DIRECTION_FORWARD) act(SetDamageAnimType, DAMAGE_FLAG_WEAK) Replanning() Fire("W_DamageWeak") return TRUE else return FALSE end elseif IsExistAnime(ANIME_ID_DAMAGE_WEAK) == TRUE then SetVariable("IndexDamageDirection", DIRECTION_FORWARD) act(SetDamageAnimType, DAMAGE_FLAG_WEAK) Replanning() Fire("W_DamageWeak") return TRUE else return FALSE end end elseif env(GetIsWeakPoint) == TRUE then local dir = GetDirOfPlayableDamage(ANIME_ID_DAMAGE_WEAK, FALSE) if dir ~= INVALID then SetVariable("IndexDamageDirection", dir) act(SetDamageAnimType, DAMAGE_FLAG_WEAK) Replanning() Fire("W_DamageWeak") return TRUE end end return FALSE end function ExecJumpDamage(damage_level, damage_type, is_damaged) if env(GetSpEffectID, 89) == TRUE then if damage_type == DAMAGE_TYPE_PARRY or damage_type >= DAMAGE_TYPE_GUARDED_BOUND_ENEMY1 and damage_type <= DAMAGE_TYPE_MAP_BOUND then return FALSE end if env(IsDamageMotionOff) == FALSE and ExecSaBreakDamage(damage_level, is_damaged) == TRUE then act(RequestAIJumpInterupt) return TRUE end if damage_level == DAMAGE_LEVEL_LARGE_BLOW then if IsExistAnime(ANIME_ID_DAMAGE_LARGE_BLOW) == TRUE then act(RequestAIJumpInterupt) act(SetDamageAnimType, DAMAGE_FLAG_LARGE_BLOW) act(TurnTowardAttacker, 0) Replanning() Fire("W_DamageLargeBlow") return TRUE elseif IsExistAnime(ANIME_ID_DAMAGE_SMALL_BLOW) == TRUE then act(RequestAIJumpInterupt) act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) act(TurnTowardAttacker, 0) Replanning() Fire("W_DamageSmallBlow") return TRUE elseif IsExistAnime(ANIME_ID_JUMP_DAMAGE_SMALL) == TRUE then act(RequestAIJumpInterupt) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) SetVariable("Int16Variable02", 0) Replanning() Fire("W_JumpDamage_Start") return TRUE elseif ExecNoSyncAddDamage(DAMAGE_LEVEL_NONE, TRUE) == TRUE then return TRUE end 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 then if IsExistAnime(ANIME_ID_DAMAGE_SMALL_BLOW) == TRUE then act(RequestAIJumpInterupt) act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) act(TurnTowardAttacker, 0) Replanning() Fire("W_DamageSmallBlow") return TRUE elseif IsExistAnime(ANIME_ID_JUMP_DAMAGE_SMALL) == TRUE then act(RequestAIJumpInterupt) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) SetVariable("Int16Variable02", 0) Replanning() Fire("W_JumpDamage_Start") return TRUE elseif ExecNoSyncAddDamage(DAMAGE_LEVEL_NONE, TRUE) == TRUE then return TRUE end elseif damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE or env(GetIsWeakPoint) == TRUE then if IsExistAnime(ANIME_ID_JUMP_DAMAGE_SMALL) == TRUE then act(RequestAIJumpInterupt) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) SetVariable("Int16Variable02", 0) Replanning() Fire("W_JumpDamage_Start") return TRUE elseif ExecNoSyncAddDamage(DAMAGE_LEVEL_NONE, TRUE) == TRUE then return TRUE end elseif ExecNoSyncAddDamage(DAMAGE_LEVEL_NONE, TRUE) == TRUE then return TRUE end end return FALSE end function ExecNpcDamage(damage_level, damage_type, is_damaged) if damage_type == DAMAGE_TYPE_PARRY or damage_type >= DAMAGE_TYPE_GUARDED_BOUND_ENEMY1 and damage_type <= DAMAGE_TYPE_MAP_BOUND then return FALSE end if env(IsDamageMotionOff) == FALSE then if env(GetSpEffectID, 11898) == TRUE and env(GetSpEffectID, 18680) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20023") return TRUE end if env(GetSpEffectID, 17124) == TRUE and env(GetSpEffectID, 18680) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20053") return TRUE end if env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 18680) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20007") return TRUE end if env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 18681) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20013") return TRUE end if env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 18682) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20014") return TRUE end if env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 9796) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20017") return TRUE end if env(GetSpEffectID, 9795) == TRUE and env(GetSpEffectID, 9940) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() return TRUE end if env(GetSpEffectID, 18680) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20044") return TRUE end if env(GetSpEffectID, 18681) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20045") return TRUE end if env(GetSpEffectID, 18682) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_Event20048") return TRUE end if env(GetSpEffectID, 11435) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() if env(GetSpEffectID, 11436) == TRUE then Fire("W_Event20018") return TRUE else Fire("W_Event20011") return TRUE end end if env(GetSpEffectID, 9779) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() if env(GetSpEffectID, 9775) == TRUE then Fire("W_Event20005") return TRUE elseif env(GetSpEffectID, 9776) == TRUE then Fire("W_Event20013") return TRUE elseif env(GetSpEffectID, 9777) == TRUE then Fire("W_Event20016") return TRUE elseif env(GetSpEffectID, 9778) == TRUE then Fire("W_Event20025") return TRUE end end end return FALSE end function ExecDamageExLarge(damage_level) if damage_level == DAMAGE_LEVEL_FLING then if IsExistAnime(ANIME_ID_DAMAGE_FLING) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_FLING) Replanning() Fire("W_DamageFling") return TRUE end elseif damage_level == DAMAGE_LEVEL_SMALL_BLOW or damage_level == DAMAGE_LEVEL_EX_BLAST or damage_level == DAMAGE_LEVEL_BREATH then local dir = env(GetReceivedDamageDirection) SetVariable("IndexDamageDirection", dir) if dir == DIRECTION_BACK and IsExistAnime(ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_BACK) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) Replanning() Fire("W_DamageSpecialBlow") return TRUE elseif dir == DIRECTION_LEFT and IsExistAnime(ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_LEFT) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) Replanning() Fire("W_DamageSpecialBlow") return TRUE elseif dir == DIRECTION_RIGHT and IsExistAnime(ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_RIGHT) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) Replanning() Fire("W_DamageSpecialBlow") return TRUE elseif dir == DIRECTION_FORWARD and IsExistAnime(ANIME_ID_DAMAGE_SMALL_BLOW) == TRUE and IsExistAnime(ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_BACK) == TRUE and IsExistAnime(ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_LEFT) == TRUE and IsExistAnime(ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_RIGHT) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) Replanning() Fire("W_DamageSpecialBlow") return TRUE elseif IsExistAnime(ANIME_ID_DAMAGE_SMALL_BLOW) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_SMALL_BLOW) act(TurnTowardAttacker, 0) Replanning() Fire("W_DamageSmallBlow") return TRUE end elseif damage_level == DAMAGE_LEVEL_UPPER then if IsExistAnime(ANIME_ID_DAMAGE_UPPER) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_UPPER) if env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 5404) == TRUE or env(GetSpEffectID, 10900) == TRUE and (env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 5402) == TRUE) then act(TurnTowardAttacker, 0) end Replanning() Fire("W_DamageUpper") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE_BLOW and IsExistAnime(ANIME_ID_DAMAGE_LARGE_BLOW) == TRUE then act(SetDamageAnimType, DAMAGE_FLAG_LARGE_BLOW) act(TurnTowardAttacker, 0) Replanning() Fire("W_DamageLargeBlow") return TRUE end return FALSE end function ExecMinimumDamage(damage_level) if damage_level == DAMAGE_LEVEL_MINIMUM then if IsExistAnime(ANIME_ID_DAMAGE_MINIMUM) == TRUE then local index = GetRandomIndex(ANIME_ID_DAMAGE_MINIMUM, 2, 1) SetVariable("IndexDamageMinimumRandom", index) act(SetDamageAnimType, DAMAGE_FLAG_MINIMUM) Replanning() if IsExistAnime(ANIME_ID_NO_ADD) == TRUE then Fire("W_DamageMinimumSABlend_Add") SetVariable("BlendDamageMinimumSA", 1) end Fire("W_DamageMinimum") return TRUE elseif ExecNoSyncAddDamage(DAMAGE_LEVEL_NONE, TRUE) == TRUE then return TRUE end end return FALSE end function ExecSleepResist(is_on_cancel) if is_on_cancel == TRUE and env(GetAIChainActionType) <= 0 and env(GetAIAtkCancelType) <= 0 and env(GetAIChainStepType) <= 0 and env(IsMoveCancelPossible) == FALSE then return FALSE end if env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE and IsNodeActive("Sleep_Resist_CMSG") == FALSE and env(IsDamageMotionOff) == FALSE and env(IsLanding) == TRUE and env(GetSpEffectID, 5851) == TRUE and env(GetSpEffectID, 5852) == FALSE and env(GetSpEffectID, 5853) == FALSE and IsExistAnime(ANIME_ID_SLEEP_RESIST) == TRUE then act(RequestAIJumpInterupt) Replanning() Fire("W_Sleep_Resist") return TRUE end return FALSE end function ExecDamageDefault(damage_level) if damage_level == DAMAGE_LEVEL_SMALL then local dir = GetDirOfPlayableDamage(ANIME_ID_DAMAGE_SMALL, TRUE) if dir ~= INVALID then SetVariable("IndexDamageDirection", dir) SetVariable("DamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) ExecSyncAddDamage(damage_level) Replanning() Fire("W_DamageSmall") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then local dir = GetDirOfPlayableDamage(ANIME_ID_DAMAGE_MIDDLE, TRUE) if dir ~= INVALID then SetVariable("IndexDamageDirection", dir) SetVariable("DamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) ExecSyncAddDamage(damage_level) Replanning() Fire("W_DamageMiddle") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then local dir = GetDirOfPlayableDamage(ANIME_ID_DAMAGE_LARGE, TRUE) if dir ~= INVALID then SetVariable("IndexDamageDirection", dir) SetVariable("DamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) ExecSyncAddDamage(damage_level) Replanning() Fire("W_DamageLarge") return TRUE end elseif damage_level == DAMAGE_LEVEL_PUSH then local dir = GetDirOfPlayableDamage(ANIME_ID_DAMAGE_PUSH, FALSE) if dir ~= INVALID then SetVariable("IndexDamageDirection", dir) act(SetDamageAnimType, DAMAGE_FLAG_PUSH) Replanning() Fire("W_DamagePush") return TRUE end end return FALSE end function ExecNewDamageDefault(damage_level) if damage_level == DAMAGE_LEVEL_PUSH then local dir = GetDirOfPlayableDamage(ANIME_ID_DAMAGE_PUSH, FALSE) if dir ~= INVALID then SetVariable("IndexDamageDirection", dir) act(SetDamageAnimType, DAMAGE_FLAG_PUSH) Replanning() Fire("W_DamagePush") return TRUE end end local damage_direction = env(GetReceivedDamageDirection) local attack_direction = env(GetAtkDirection) if damage_direction == DIRECTION_FORWARD then if attack_direction == ATTACK_DIR_FRONT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8030) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8050) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_LEFT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8031) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageSmallFrontDirection", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8041) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 1) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8041) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 1) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8051) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageLargeFrontDirection", 1) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8041) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 1) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_RIGHT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8032) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageSmallFrontDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8042) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8042) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8052) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageLargeFrontDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8042) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_DOWN then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8034) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageSmallFrontDirection", 4) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8044) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 4) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8044) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 4) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8054) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageLargeFrontDirection", 4) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8044) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 4) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_UP then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8033) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageSmallFrontDirection", 3) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8043) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 3) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8043) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 3) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8053) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexDamageLargeFrontDirection", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8043) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 3) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end end elseif damage_direction == DIRECTION_BACK then if attack_direction == ATTACK_DIR_FRONT or attack_direction == ATTACK_DIR_UP or attack_direction == ATTACK_DIR_DOWN then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8035) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9400) == TRUE then Fire("W_DirDamageSmall_Back_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9430) == TRUE then Fire("W_DirDamageMiddle_Back_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9430) == TRUE then Fire("W_DirDamageMiddle_Back_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8055) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9460) == TRUE then Fire("W_DirDamageLarge_Back_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9430) == TRUE then Fire("W_DirDamageMiddle_Back_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_LEFT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8035) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9401) == TRUE then Fire("W_DirDamageSmall_Back_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9431) == TRUE then Fire("W_DirDamageMiddle_Back_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9431) == TRUE then Fire("W_DirDamageMiddle_Back_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8055) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9461) == TRUE then Fire("W_DirDamageLarge_Back_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9431) == TRUE then Fire("W_DirDamageMiddle_Back_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_RIGHT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8035) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9402) == TRUE then Fire("W_DirDamageSmall_Back_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9432) == TRUE then Fire("W_DirDamageMiddle_Back_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9432) == TRUE then Fire("W_DirDamageMiddle_Back_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8055) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9462) == TRUE then Fire("W_DirDamageLarge_Back_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8045) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 0) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9432) == TRUE then Fire("W_DirDamageMiddle_Back_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end end elseif damage_direction == DIRECTION_LEFT then if attack_direction == ATTACK_DIR_FRONT or attack_direction == ATTACK_DIR_UP or attack_direction == ATTACK_DIR_DOWN then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8036) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9410) == TRUE then Fire("W_DirDamageSmall_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9440) == TRUE then Fire("W_DirDamageMiddle_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9440) == TRUE then Fire("W_DirDamageMiddle_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8056) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9470) == TRUE then Fire("W_DirDamageLarge_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9440) == TRUE then Fire("W_DirDamageMiddle_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_LEFT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8036) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9411) == TRUE then Fire("W_DirDamageSmall_Left_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9441) == TRUE then Fire("W_DirDamageMiddle_Left_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9441) == TRUE then Fire("W_DirDamageMiddle_Left_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8056) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9471) == TRUE then Fire("W_DirDamageLarge_Left_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9441) == TRUE then Fire("W_DirDamageMiddle_Left_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_RIGHT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8036) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9412) == TRUE then Fire("W_DirDamageSmall_Left_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9442) == TRUE then Fire("W_DirDamageMiddle_Left_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9442) == TRUE then Fire("W_DirDamageMiddle_Left_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8056) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9472) == TRUE then Fire("W_DirDamageLarge_Left_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8046) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 1) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9442) == TRUE then Fire("W_DirDamageMiddle_Left_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end end elseif damage_direction == DIRECTION_RIGHT then if attack_direction == ATTACK_DIR_FRONT or attack_direction == ATTACK_DIR_UP or attack_direction == ATTACK_DIR_DOWN then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8037) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9420) == TRUE then Fire("W_DirDamageSmall_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9450) == TRUE then Fire("W_DirDamageMiddle_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9450) == TRUE then Fire("W_DirDamageMiddle_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8057) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9480) == TRUE then Fire("W_DirDamageLarge_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9450) == TRUE then Fire("W_DirDamageMiddle_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_LEFT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8037) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9421) == TRUE then Fire("W_DirDamageSmall_Right_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9451) == TRUE then Fire("W_DirDamageMiddle_Right_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9451) == TRUE then Fire("W_DirDamageMiddle_Right_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8057) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9481) == TRUE then Fire("W_DirDamageLarge_Right_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9451) == TRUE then Fire("W_DirDamageMiddle_Right_Left_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end elseif attack_direction == ATTACK_DIR_RIGHT then if damage_level == DAMAGE_LEVEL_SMALL then if IsExistAnime(8037) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 1) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) if IsExistAnime(9422) == TRUE then Fire("W_DirDamageSmall_Right_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageSmall") return TRUE elseif IsExistAnime(8030) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageSmallFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_SMALL) Replanning() Fire("W_DamageSmallFront") return TRUE elseif IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9452) == TRUE then Fire("W_DirDamageMiddle_Right_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE then if IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9452) == TRUE then Fire("W_DirDamageMiddle_Right_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end elseif damage_level == DAMAGE_LEVEL_LARGE then if IsExistAnime(8057) == TRUE then ExecFireBlend(damage_direction, damage_level) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 3) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) if IsExistAnime(9482) == TRUE then Fire("W_DirDamageLarge_Right_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageLarge") return TRUE elseif IsExistAnime(8050) == TRUE then ExecFireBlend(DIRECTION_FORWARD, damage_level) SetVariable("IndexDamageLargeFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_LARGE) Replanning() Fire("W_DamageLargeFront") return TRUE elseif IsExistAnime(8047) == TRUE then ExecFireBlend(damage_direction, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexNewDamageDirection", 2) SetVariable("NewDamageDefaultState", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) if IsExistAnime(9452) == TRUE then Fire("W_DirDamageMiddle_Right_Right_Add") SetVariable("BlendNewDamageDir", 1) end Replanning() Fire("W_NewDamageMiddle") return TRUE else ExecFireBlend(DIRECTION_FORWARD, DAMAGE_LEVEL_MIDDLE) SetVariable("IndexDamageMiddleFrontDirection", 0) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_DamageMiddleFront") return TRUE end end end end return FALSE end function GetDirOfPlayableDamage(id, check_atk_dir) local damage_direction = env(GetReceivedDamageDirection) if check_atk_dir == TRUE and damage_direction == DIRECTION_FORWARD then local dir_real = GetRealDir() if dir_real == LEFT_ADD then if IsExistAnime(id + DIRECTION_FRONTLEFT) == TRUE then return DIRECTION_FRONTLEFT end elseif dir_real == RIGHT_ADD and IsExistAnime(id + DIRECTION_FRONTRIGHT) == TRUE then return DIRECTION_FRONTRIGHT end end local offset = GetDamageDirectionOffset(damage_direction) local id_with_direction = id + offset if IsExistAnime(id_with_direction) == TRUE then return damage_direction elseif IsExistAnime(id) == TRUE then return DIRECTION_FORWARD end return INVALID end function ExecSyncAddDamage(damage_level) if env(IsPartDamageAdditiveBlendInvalid) == TRUE then return end if IsExistAnime(ANIME_ID_NO_ADD) == FALSE then return end if env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then local buff = {[1] = -1} if damage_level == DAMAGE_LEVEL_SMALL then buff[1] = ANIME_ID_BLEND_DAMAGE_FIRE_SMALL buff[2] = ANIME_ID_BLEND_DAMAGE_FIRE_MIDDLE elseif damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_LARGE then buff[1] = ANIME_ID_BLEND_DAMAGE_FIRE_MIDDLE end if buff[1] >= 0 then local anim_id = -1 for i = 1, #buff, 1 do if IsExistAnime(buff[i]) == TRUE then anim_id = buff[i] break end end if anim_id >= 0 then local event = "W_FireSmallDamageBlend_Add" if anim_id == ANIME_ID_BLEND_DAMAGE_FIRE_MIDDLE then event = "W_FireMiddleDamageBlend_Add" end SetVariable("BlendDamageFire", 1) local index = GetRandomIndex(anim_id, 3, 1) SetVariable("IndexFireDamageVariation", index) Fire(event) return end end end local buff = {[1] = -1} if damage_level == DAMAGE_LEVEL_SMALL then buff[1] = ANIME_ID_BLEND_DAMAGE_SMALL_FRONT elseif damage_level == DAMAGE_LEVEL_MIDDLE then buff[1] = ANIME_ID_BLEND_DAMAGE_MIDDLE_FRONT buff[2] = ANIME_ID_BLEND_DAMAGE_SMALL_FRONT elseif damage_level == DAMAGE_LEVEL_LARGE then buff[1] = ANIME_ID_BLEND_DAMAGE_LARGE_FRONT buff[2] = ANIME_ID_BLEND_DAMAGE_MIDDLE_FRONT buff[3] = ANIME_ID_BLEND_DAMAGE_SMALL_FRONT end if buff[1] >= 0 then local dir = GetRealDir() local anim_id = -1 for i = 1, #buff, 1 do if IsExistAnime(buff[i] + dir) == TRUE then anim_id = buff[i] break end end if anim_id >= 0 then local event = "W_DirDamageSmall" if anim_id == ANIME_ID_BLEND_DAMAGE_MIDDLE_FRONT then event = "W_DirDamageMiddle" elseif anim_id == ANIME_ID_BLEND_DAMAGE_LARGE_FRONT then event = "W_DirDamageLarge" end local dir_set = {"Front_Add", "Back_Add", "Left_Add", "Right_Add", "FrontUp_Add", "FrontDown_Add"} SetVariable("BlendDamageDir", 1) Fire(event .. dir_set[dir + 1]) return end end end function ExecFireBlend(damage_direction, damage_level) if env(IsPartDamageAdditiveBlendInvalid) == TRUE then return end if IsExistAnime(ANIME_ID_NO_ADD) == FALSE then return end if env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then if damage_direction == DIRECTION_FORWARD then if damage_level == DAMAGE_LEVEL_SMALL then SetVariable("BlendDamageSmallFrontFire", 1) SetVariable("IndexDamageSmallFrontFireVariation", 0) Fire("W_DamageSmallFrontFireBlend_Add") return elseif damage_level == DAMAGE_LEVEL_MIDDLE then SetVariable("BlendDamageMiddleFrontFire", 1) SetVariable("IndexDamageMiddleFrontFireVariation", 0) Fire("W_DamageMiddleFrontFireBlend_Add") return elseif damage_level == DAMAGE_LEVEL_LARGE then SetVariable("BlendDamageLargeFrontFire", 1) SetVariable("IndexDamageLargeFrontFireVariation", 0) Fire("W_DamageLargeFrontFireBlend_Add") return end elseif damage_direction == DIRECTION_BACK or damage_direction == DIRECTION_LEFT or damage_direction == DIRECTION_RIGHT then if damage_level == DAMAGE_LEVEL_SMALL then SetVariable("BlendNewDamageFire", 1) SetVariable("IndexNewFireDamageVariation", 0) Fire("W_NewFireSmallDamageBlend_Add") return elseif damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_LARGE then SetVariable("BlendNewDamageFire", 1) SetVariable("IndexNewFireDamageVariation", 0) Fire("W_NewFireMiddleDamageBlend_Add") return end end end end function GetRealDir() local pos_dir = env(GetReceivedDamageDirection) local atk_dir = env(GetAtkDirection) local real_dir = FRONT_ADD if atk_dir == ATTACK_DIR_FRONT then if pos_dir == DIRECTION_FORWARD then real_dir = FRONT_ADD elseif pos_dir == DIRECTION_RIGHT then real_dir = RIGHT_ADD elseif pos_dir == DIRECTION_BACK then real_dir = BACK_ADD elseif pos_dir == DIRECTION_LEFT then real_dir = LEFT_ADD end elseif atk_dir == ATTACK_DIR_UP then if pos_dir == DIRECTION_FORWARD then real_dir = FRONTUP_ADD elseif pos_dir == DIRECTION_RIGHT then real_dir = RIGHT_ADD elseif pos_dir == DIRECTION_BACK then real_dir = BACK_ADD elseif pos_dir == DIRECTION_LEFT then real_dir = LEFT_ADD end elseif atk_dir == ATTACK_DIR_DOWN then if pos_dir == DIRECTION_FORWARD then real_dir = FRONTDOWN_ADD elseif pos_dir == DIRECTION_RIGHT then real_dir = RIGHT_ADD elseif pos_dir == DIRECTION_BACK then real_dir = BACK_ADD elseif pos_dir == DIRECTION_LEFT then real_dir = LEFT_ADD end elseif atk_dir == ATTACK_DIR_LEFT then if pos_dir == DIRECTION_FORWARD then real_dir = RIGHT_ADD elseif pos_dir == DIRECTION_RIGHT then real_dir = BACK_ADD elseif pos_dir == DIRECTION_BACK then real_dir = LEFT_ADD elseif pos_dir == DIRECTION_LEFT then real_dir = FRONT_ADD end elseif atk_dir == ATTACK_DIR_RIGHT then if pos_dir == DIRECTION_FORWARD then real_dir = LEFT_ADD elseif pos_dir == DIRECTION_LEFT then real_dir = BACK_ADD elseif pos_dir == DIRECTION_BACK then real_dir = RIGHT_ADD elseif pos_dir == DIRECTION_RIGHT then real_dir = FRONT_ADD end end return real_dir end function ExecDamage(is_weak, ignore_guard_block) if env(GetSpEffectID, SP_EFFECT_SLEEP) == TRUE and env(GetSpEffectID, SP_EFFECT_MIMIC) == TRUE and env(GetSpEffectID, SP_EFFECT_DISABLE_SLEEP) == FALSE then Fire("W_Event20000") return TRUE end local damage_level = env(GetDamageLevel) local damage_type = env(GetReceivedDamageType) local is_damaged = env(HasReceivedAnyDamage) if env(GetBehaviorID, BEH_IDENTIFIER_ROLLING) == TRUE and env(GetSpEffectID, SP_EFFECT_ROLLING_PUSH) == FALSE then return FALSE end if env(GetBehaviorID, BEH_IDENTIFIER_ROLLING) == TRUE and env(GetSpEffectID, SP_EFFECT_ROLLING_PUSH) == TRUE and env(GetSpEffectID, SP_EFFECT_IGNORE_ROLLING_PUSH) == FALSE then damage_level = DAMAGE_LEVEL_PUSH end if is_damaged == FALSE and damage_level == DAMAGE_LEVEL_NONE and (damage_type == DAMAGE_TYPE_NONE or damage_type == DAMAGE_TYPE_WEAK_FRAME) and env(GetBehaviorID, BEH_IDENTIFIER_GOLEM_CONFUSION) == FALSE and env(GetBehaviorID, BEH_IDENTIFIER_MARIQUES_PARRY) == FALSE and env(GetBehaviorID, BEH_IDENTIFIER_TRAUMA_MORGOTT) == FALSE and env(GetBehaviorID, BEH_IDENTIFIER_TRAUMA_GREATER_DEMON) == FALSE and env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == FALSE and env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == FALSE then return FALSE end if env(GetBehaviorID, BEH_IDENTIFIER_ROLLING) == TRUE and env(GetSpEffectID, SP_EFFECT_ROLLING_PUSH) == TRUE and env(GetSpEffectID, SP_EFFECT_IGNORE_ROLLING_PUSH) == TRUE then return FALSE end if env(GetBehaviorID, BEH_IDENTIFIER_MARIQUES_PARRY) == TRUE and env(GetSpEffectID, 15280) == FALSE and env(GetSpEffectID, 15281) == FALSE then return FALSE end if env(GetBehaviorID, BEH_IDENTIFIER_TRAUMA_MORGOTT) == TRUE and env(GetSpEffectID, 16248) == FALSE then return FALSE end if env(GetBehaviorID, BEH_IDENTIFIER_TRAUMA_GREATER_DEMON) == TRUE and env(GetSpEffectID, 10680) == FALSE then return FALSE end SetVariable("BlendDamageDir", 0) SetVariable("BlendDamageFire", 0) SetVariable("BlendNewDamageDir", 0) SetVariable("BlendNewDamageFire", 0) SetVariable("BlendDamageSmallFrontFire", 0) SetVariable("BlendDamageMiddleFrontFire", 0) SetVariable("BlendDamageLargeFrontFire", 0) SetVariable("BlendGuard", 0) SetVariable("BlendDamageMinimumSA", 0) if (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and (damage_level == DAMAGE_LEVEL_NONE or damage_level == DAMAGE_LEVEL_MINIMUM or damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and env(GetSpEffectID, 89) == TRUE then damage_level = DAMAGE_LEVEL_MIDDLE elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and damage_level == DAMAGE_LEVEL_NONE and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and IsExistAnime(8040) == TRUE then damage_level = DAMAGE_LEVEL_MIDDLE elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and damage_level == DAMAGE_LEVEL_MINIMUM and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and (IsExistAnime(8040) == TRUE or IsExistAnime(8050) == TRUE) then damage_level = DAMAGE_LEVEL_LARGE elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and (damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_PUSH) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and (IsExistAnime(8040) == TRUE or IsExistAnime(8050) == TRUE) then damage_level = DAMAGE_LEVEL_LARGE end if ExecNpcDamage(damage_level, damage_type, is_damaged) == TRUE then return TRUE end if ExecJumpDamage(damage_level, damage_type, is_damaged) == TRUE then return TRUE end if ignore_guard_block == TRUE and env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == FALSE and env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == FALSE and damage_type == DAMAGE_TYPE_GUARD then if env(GetSpEffectID, 5827) == TRUE then return FALSE elseif env(GetSpEffectID, 5827) == FALSE and (env(GetGuardLevelAction) == GUARD_LEVEL_NONE or env(GetGuardLevelAction) == GUARD_LEVEL_SMALL) then if ExecNoSyncAddGuardDamage(damage_level, is_damaged) == TRUE then return FALSE end return FALSE end end if ExecGuardBlock(damage_type, ignore_guard_block) == TRUE then return TRUE end if env(IsDamageMotionOff) == FALSE and ExecSaBreakDamage(damage_level, is_damaged) == TRUE then return TRUE end if damage_type == DAMAGE_TYPE_PARRY or damage_type >= DAMAGE_TYPE_GUARDED_BOUND_ENEMY1 and damage_type <= DAMAGE_TYPE_MAP_BOUND then elseif ExecDamageExLarge(damage_level) == TRUE then return TRUE end if env(IsDamageMotionOff) == FALSE then if ExecSpDamage() == TRUE then return TRUE end if is_weak == FALSE and ExecWeakDamage() == TRUE then return TRUE end end if ExecTypeDamage(damage_type) == TRUE then return TRUE end if ExecNoSyncAddDamage(damage_level, is_damaged) == TRUE then return FALSE end if ExecNewDamageDefault(damage_level) == TRUE then return TRUE end if ExecMinimumDamage(damage_level) == TRUE then return TRUE end if damage_level ~= DAMAGE_LEVEL_NONE and ExecNewDamageDefault(DAMAGE_LEVEL_MIDDLE) == TRUE then return TRUE end return FALSE end function GetDeathType() local damage_level = env(GetDamageLevel) local death_type = DEATH_TYPE_DEFAULT if env(GetSpEffectID, 89) == TRUE and (damage_level == DAMAGE_LEVEL_LARGE or damage_level == DAMAGE_LEVEL_LARGE_BLOW 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 death_type = DEATH_TYPE_BLAST elseif damage_level == DAMAGE_LEVEL_LARGE_BLOW or damage_level == DAMAGE_LEVEL_SMALL_BLOW or damage_level == DAMAGE_LEVEL_EX_BLAST or damage_level == DAMAGE_LEVEL_BREATH then death_type = DEATH_TYPE_BLAST elseif damage_level == DAMAGE_LEVEL_UPPER then death_type = DEATH_TYPE_UPPER elseif damage_level == DAMAGE_LEVEL_FLING then death_type = DEATH_TYPE_FLING elseif env(GetSpEffectID, 5850) == TRUE then death_type = DEATH_TYPE_SLEEP elseif env(GetSpEffectID, 5990) == TRUE then death_type = DEATH_TYPE_SLEEP_COLLECT elseif env(GetIsWeakPoint) == TRUE then death_type = DEATH_TYPE_WEAK elseif env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then death_type = DEATH_TYPE_FIRE end return death_type end function GetDamageDirectionOffset(damage_direction) local offset = 1 if damage_direction == 0 then offset = 2 elseif damage_direction == 1 then offset = 3 elseif damage_direction == 2 then offset = 0 end return offset end function GetExistAnimeNum(base_anim_id, anim_num, offset) local num = 0 for i = 0, anim_num - 1, 1 do local i = i * offset local anim_id = base_anim_id + i if IsExistAnime(anim_id) == FALSE then break else num = num + 1 end end return num end function GetRandomIndex(base_anim_id, anim_num, offset) local num = GetExistAnimeNum(base_anim_id, anim_num, offset) local ret = 0 if num > 0 then ret = math.random(0, num - 1) end return ret end function GetMoveDir(move_speed_level) local move_angle = GetVariable("MoveAngle") local angular_velocity = GetVariable("AngularVelocity") local angular_velocity_max = GetVariable("AngularVelocityMax") local fly_route_state = env(GetFlyRouteState) if fly_route_state == AI_FLY_ROUTE_STATE_NOMAL_CRUISE or fly_route_state == AI_FLY_ROUTE_STATE_NOMAL_CRUISE_LAND_REQUESTED then if angular_velocity == 0 then angular_velocity_max = 0 elseif angular_velocity > 0 then if angular_velocity_max < angular_velocity then angular_velocity_max = angular_velocity end elseif angular_velocity < 0 and angular_velocity < angular_velocity_max then angular_velocity_max = angular_velocity end SetVariable("AngularVelocityMax", angular_velocity_max) if math.abs(angular_velocity_max) <= 30 then local InclinationDegree_Left = GetVariable("BlendMoveSlope_Left") local InclinationDegree_Right = GetVariable("BlendMoveSlope_Right") if InclinationDegree_Left > 0 or InclinationDegree_Right > 0 then InclinationDegree_Left = InclinationDegree_Left - 0.004999999888241291 SetVariable("BlendMoveSlope_Left", InclinationDegree_Left) InclinationDegree_Right = InclinationDegree_Right - 0.004999999888241291 SetVariable("BlendMoveSlope_Right", InclinationDegree_Right) end if move_speed_level > 0.75 then return MOVE_TYPE_RUN else return MOVE_TYPE_WALK_FRONT end elseif angular_velocity_max > 0 then local InclinationDegree = GetVariable("BlendMoveSlope_Right") InclinationDegree = InclinationDegree + 0.012000000104308128 SetVariable("BlendMoveSlope_Right", InclinationDegree) return MOVE_TYPE_WALK_FRONT else local InclinationDegree = GetVariable("BlendMoveSlope_Left") InclinationDegree = InclinationDegree + 0.012000000104308128 SetVariable("BlendMoveSlope_Left", InclinationDegree) return MOVE_TYPE_WALK_FRONT end elseif math.abs(move_angle) <= 45 then if move_speed_level > 0.75 then return MOVE_TYPE_RUN else return MOVE_TYPE_WALK_FRONT end elseif move_angle >= 45 and move_angle <= 135 then return MOVE_TYPE_WALK_RIGHT elseif move_angle >= -135 and move_angle <= -45 then return MOVE_TYPE_WALK_LEFT else return MOVE_TYPE_WALK_BACK end end function ExecMove(move_type, is_on_cancel) local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level <= 0 then return FALSE end if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end if env(IsMovingLaterally) == TRUE then if move_type == MOVE_TYPE_PARALLEL then return FALSE end Fire("W_ParallelMove") return TRUE end local move_dir = GetMoveDir(move_speed_level) if move_type == move_dir then return FALSE end local ai_rec = env(GetAITargetAwareState) local ai_state = AI_STATE_DEFAULT if ai_rec > AI_RECOGNITION_NONE then ai_state = AI_STATE_BATTLE end local event = "" local move_table = {} local j = move_dir local action_type = env(GetAIActionType) if action_type == ACTION_TYPE_GUARD then move_table[1] = move_table_guard[j] if move_dir == MOVE_TYPE_RUN then move_table[2] = move_table_guard[MOVE_TYPE_WALK_FRONT] move_table[3] = move_table_battle[j] move_table[4] = move_table_battle[MOVE_TYPE_WALK_FRONT] else move_table[2] = move_table_battle[j] end elseif action_type == ACTION_TYPE_PARRY then move_table[1] = move_table_parry[j] if move_dir == MOVE_TYPE_RUN then move_table[2] = move_table_parry[MOVE_TYPE_WALK_FRONT] move_table[3] = move_table_battle[j] move_table[4] = move_table_battle[MOVE_TYPE_WALK_FRONT] else move_table[2] = move_table_battle[j] end elseif ai_state == AI_STATE_BATTLE then move_table[1] = move_table_battle[j] if move_dir == MOVE_TYPE_RUN then move_table[2] = move_table_battle[MOVE_TYPE_WALK_FRONT] end elseif move_dir == MOVE_TYPE_RUN then move_table[1] = move_table_default[j] move_table[2] = move_table_battle[j] move_table[3] = move_table_default[MOVE_TYPE_WALK_FRONT] move_table[4] = move_table_battle[MOVE_TYPE_WALK_FRONT] else move_table[1] = move_table_default[MOVE_TYPE_WALK_FRONT] move_table[2] = move_table_battle[MOVE_TYPE_WALK_FRONT] end local hit_move_type = MOVE_TYPE_NONE for i = 1, #move_table, 1 do if IsExistAnime(move_table[i][1]) == TRUE then event = move_table[i][2] hit_move_type = move_table[i][3] break end end if hit_move_type == MOVE_TYPE_NONE then return FALSE end if hit_move_type == move_type then return FALSE end SetIdleType(ai_state) Fire(event) return TRUE end function ExecStop() local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level > 0 then return FALSE end local action_type = env(GetAIActionType) local event = "W_Idle" if action_type == ACTION_TYPE_GUARD then event = "W_GuardIdle" elseif action_type == ACTION_TYPE_PARRY then event = "W_ParryIdle" end Fire(event) return TRUE end function SetThrowFlag(attack, defense) act(SetAllowedThrowAttackType, attack) act(SetAllowedThrowDefenseType, defense) end function SetParallelMoveTae(angle) local front, back, left, right = false, false, false, false if math.abs(angle) >= 135 then back = true elseif angle > 45 then right = true elseif angle < -45 then left = true else front = true end SetVariable("ParallelMoveTaeFront", front) SetVariable("ParallelMoveTaeBack", back) SetVariable("ParallelMoveTaeRight", right) SetVariable("ParallelMoveTaeLeft", left) end function GetHpRatio() return env(GetHP) / env(GetSafetyDirection) end function GetStaminaRatio() return env(GetStamina) / env(GetMaxStamina) end function GetSuperArmorRatio() return env(GetPoise) / env(GetMaxPoise) end function SetThrowInvalid() SetThrowFlag(THROW_INVALID, THROW_INVALID) end function SetThrowDefInvalid() SetThrowFlag(THROW_DEFAULT, THROW_INVALID) end function ExecPassiveTransition(judge_fall_type, is_weak, ignore_guard_block, enable_jump) if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if env(HasThrowRequest) == TRUE then return TRUE end if env(IsSummoningRide) == TRUE then if env(IsMount) == FALSE then if env(IsMovingOnMount) == TRUE then FireRideEvent("W_Ride_Enemy_On", "W_Ridden_Enemy_On", FALSE) return TRUE elseif env(IsIdleOnMount) == TRUE then Fire("W_Idle") return TRUE else return TRUE end else return TRUE end end if ExecDeath() == TRUE then return TRUE end if env(GetSpEffectID, 6060) == TRUE and env(IsPlayerInRangeOfMount, 6) == FALSE then Fire("W_PhantomIdle") return TRUE end if env(CheckForEventAnimPlaybackRequest) == TRUE then return TRUE end if env(GetSpEffectID, 5880) == TRUE and env(GetSpEffectID, 5881) == TRUE and env(GetSpEffectID, 5882) == FALSE then Fire("W_Event20012") return TRUE end if env(GetSpEffectID, 14399) == TRUE and env(GetSpEffectID, 14388) == TRUE and IsNodeActive("Event20000_CMSG") == FALSE and IsNodeActive("Event20005_CMSG") == FALSE and IsNodeActive("Event20006_CMSG") == FALSE and IsNodeActive("Event20007_CMSG") == FALSE then if env(GetSpEffectID, 14397) == TRUE then Fire("W_Event20000") return TRUE else local rand = math.random(1, 3) Replanning() if rand == 1 then Fire("W_Event20005") elseif rand == 2 then Fire("W_Event20006") else Fire("W_Event20007") end return TRUE end end if env(GetSpEffectID, 15250) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_Event20000") return TRUE end if env(GetSpEffectID, 16305) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_Event20000") return TRUE end if env(GetSpEffectID, 16306) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_Event20000") return TRUE end if env(GetSpEffectID, 13071) == TRUE and env(IsLanding) == TRUE then Replanning() Fire("W_Event20001") return TRUE end if env(GetSpEffectID, 13075) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingUpward") return TRUE end if (env(GetSpEffectID, 17102) == TRUE or env(GetSpEffectID, 17103) == TRUE) and env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE and IsNodeActive("Event20019_CMSG") == FALSE then Replanning() Fire("W_Event20019") return TRUE end if env(GetSpEffectType, SP_EFFECT_TYPE_RECOVERY_DAMAGE) == TRUE and env(GetSpEffectID, 474) == TRUE then SetVariable("IndexDamageDirection", 2) act(SetDamageAnimType, DAMAGE_FLAG_MIDDLE) Replanning() Fire("W_SABreak") return TRUE end if env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 10501) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingUpward") return TRUE end if env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 10502) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingDownward") return TRUE end if env(GetSpEffectID, 10500) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_AttackBoundEnemy1") return TRUE end if env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 17056) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingUpward") return TRUE end if env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 17057) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingDownward") return TRUE end if env(GetSpEffectID, 17055) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_AttackBoundEnemy1") return TRUE end if env(GetSpEffectID, 10900) == TRUE and env(GetSpEffectID, 10901) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingUpward") return TRUE end if env(GetSpEffectID, 10900) == TRUE and env(GetSpEffectID, 10902) == TRUE and env(IsLanding) == FALSE then Fire("W_FallingDownward") return TRUE end if env(GetSpEffectID, 12003) == TRUE and env(GetSpEffectID, 12020) == TRUE then Fire("W_Event30023") return TRUE end if env(GetSpEffectID, 10132) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_Event20021") return TRUE end if env(GetSpEffectID, 13052) == TRUE and env(GetReceivedDamageType) == DAMAGE_TYPE_MAP_BOUND then Replanning() Fire("W_Event20000") return TRUE end if env(GetSpEffectID, 11432) == TRUE then Fire("W_Event30007") return TRUE end if env(GetSpEffectID, 19629) == TRUE and env(IsLanding) == TRUE then Replanning() Fire("W_Event20011") return TRUE end if ExecDamage(is_weak, ignore_guard_block) == TRUE then return TRUE end if ExecFallStart(judge_fall_type) == TRUE then return TRUE end if enable_jump == TRUE and env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) Fire("W_Jump") return TRUE end act(AllowMounting) if ExecSpEffectEventAction() == TRUE then return TRUE end return FALSE end function ExecActiveTransition(is_on_cancel, style, move_type, enable_turn) if ExecSleepResist(is_on_cancel) == TRUE then return TRUE end if is_on_cancel == TRUE then if ExecAICancelAction(style) == TRUE then return TRUE end elseif ExecAIAction(style) == TRUE then return TRUE end if enable_turn == TRUE and ExecTurn(is_on_cancel) == TRUE then return TRUE end if ExecMove(move_type, is_on_cancel) == TRUE then return TRUE end return FALSE end function IdleCommonFunction(style, anim_id) act(NotifyAIOfBehaviourState, 0, style) act(AllowBuddyWarp) if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, TRUE) == TRUE then return TRUE end if ExecAILadder() == TRUE then return TRUE end if ExecTransToDefaultFromBattle(FALSE, TRUE) == TRUE then return TRUE end if ExecActiveTransition(FALSE, style, MOVE_TYPE_NONE, TRUE) == TRUE then local cur_ai_state = AI_STATE_DEFAULT if env(GetAITargetAwareState) > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE end SetIdleType(cur_ai_state) return TRUE end if ExecTalkTransition(anim_id) == TRUE then return TRUE end if ExecTransToBattleFromDefault(FALSE, TRUE) == TRUE then return TRUE end if style == STYLE_DEFAULT then act(AllowMounting) end return FALSE end function MoveCommonFunction(style, move_type) act(NotifyAIOfBehaviourState, 0, style) act(AllowBuddyWarp) local fly_route_state = env(GetFlyRouteState) if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, TRUE) == TRUE then return TRUE end if ExecAILadder() == TRUE then return TRUE end if ExecTransToDefaultFromBattle(FALSE, TRUE) == TRUE then return TRUE end if fly_route_state == AI_FLY_ROUTE_STATE_DESCENR then Fire("W_Event30001") return TRUE elseif fly_route_state == AI_FLY_ROUTE_STATE_NOMAL_CRUISE_TO_DESCENT and env(Unknown9999) < 40 then Fire("W_Event20002") return TRUE end if (env(GetSpEffectID, 6004) == TRUE or fly_route_state ~= AI_FLY_ROUTE_STATE_NOT_USE_FLY_ROUTE and fly_route_state ~= AI_FLY_ROUTE_STATE_ON_GROUND and fly_route_state ~= AI_FLY_ROUTE_STATE_ON_GROUND_TAKEOFF_REQUESTED) and ExecActiveTransition(FALSE, style, move_type, TRUE) == TRUE then return TRUE end if ExecActiveTransition(FALSE, style, move_type, FALSE) == TRUE then local cur_ai_state = AI_STATE_DEFAULT if env(GetAITargetAwareState) > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE end SetIdleType(cur_ai_state) return TRUE end if ExecTransToBattleFromDefault(FALSE, TRUE) == TRUE then return TRUE end if ExecStop() == TRUE then return TRUE end if style == STYLE_DEFAULT then act(AllowMounting) end return FALSE end function TurnCommonFunction(style) act(NotifyAIOfBehaviourState, 0, style) act(SetIsTurnAnimInProgress) act(AllowBuddyWarp) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, TRUE) == TRUE then return TRUE end if ExecAILadder() == TRUE then return TRUE end if ExecActiveTransition(TRUE, style, MOVE_TYPE_NONE, FALSE) == TRUE then return TRUE end return FALSE end function TransStyleCommonFunction(style) act(NotifyAIOfBehaviourState, 0, style) if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, TRUE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, style, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function TransIdleCommonFunction() if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, TRUE) == TRUE then return TRUE end if ExecAILadder() == TRUE then return TRUE end if ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function GenerateCommonFunction() if env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE or env(GetSpEffectID, SP_EFFECT_NEW_SKELETON_NO_DEAD) == TRUE then if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if env(HasThrowRequest) == TRUE then return TRUE end if ExecDeath() == TRUE then return TRUE end end if ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function AttackCommonFunction(action_number, style, ignore_guard_block) CallActionState(action_number) if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, ignore_guard_block, TRUE) == TRUE then return TRUE end if ExecTransToDefaultFromBattle(TRUE, FALSE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, style, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function DamageCommonFunction(style, is_weak, judge_fall_type) act(NotifyAIOfBehaviourState, 0, style) if ExecPassiveTransition(judge_fall_type, is_weak, FALSE, TRUE) == TRUE then return TRUE end if ExecTransToDefaultFromBattle(TRUE, FALSE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, style, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function IdleUniqueCommonFunction(id) act(SetIsEventAnim) if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecTransToBattleFromIdleUnique(id) == TRUE then return TRUE end return FALSE end function LandCommonFunction() if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecTransToDefaultFromBattle(TRUE, FALSE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function FallCommonFunction(fall_type) if ExecLand(fall_type) == TRUE then return TRUE end return FALSE end function EventCommonFunction(action_number) act(SetIsEventAnim) if action_number ~= nil then CallActionState(action_number) end if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, TRUE, FALSE) == TRUE then return TRUE end if action_number ~= nil and (action_number >= ANIME_ID_EVENT_BEGIN and action_number <= ANIME_ID_EVENT_END or action_number >= 1700 and action_number <= 1729) and ExecTransToDefaultFromBattle(TRUE, FALSE) == TRUE then return TRUE end if env(GetSpEffectID, SP_EFFECT_TOKUSYU_IDLE) == FALSE and ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end if ExecTalkTransition(action_number) == TRUE then return TRUE end return FALSE end function ThrowCommonFunction() if env(IsThrowing) == TRUE then if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if env(IsMoveCancelPossible) == TRUE then act(RequestThrowAnimInterrupt) end else if ExecDeath() == TRUE then return TRUE end if env(CheckForEventAnimPlaybackRequest) == TRUE then return TRUE end if ExecDamage(FALSE, FALSE) == TRUE then return TRUE end end if ExecFallStart(judge_fall_type) == TRUE then return TRUE end if ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function ExecAILadder() local action_type = env(GetAIActionType) if action_type == LADDER_REQUEST_UP then Fire("W_LadderRemoveWeaponBottom") return TRUE elseif action_type == LADDER_REQUEST_DOWN then Fire("W_LadderRemoveWeaponTop") return TRUE end return FALSE end function ExecLadderFall() local hp = env(GetHP) if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if env(GetSpEffectID, 16566) == TRUE and env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE then Fire("W_Event20020") return TRUE end if hp <= 0 then Fire("W_LadderDeath") return TRUE end if hp <= 1 and env(GetSpEffectID, 12510) == FALSE and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE then Fire("W_LadderDeath") return TRUE end if hp <= 1 and env(GetSpEffectID, 10592) == FALSE and env(GetSpEffectID, SP_EFFECT_NEW_SKELETON_NO_DEAD) == TRUE then Fire("W_LadderDeath") return TRUE end if hp <= 1 and env(GetSpEffectID, 14057) == FALSE and env(GetSpEffectID, SP_EFFECT_BALLOON_DOLL_NO_DEAD) == TRUE then Fire("W_LadderDeath") return TRUE end local stamina = env(GetStamina) if stamina <= 0 then Fire("W_LadderFallStart") return TRUE end if env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE then Fire("W_LadderFallStart") return TRUE end return FALSE end function ExecLadderDamage(hand) if env(HasReceivedAnyDamage) == FALSE then return FALSE end local event_hand = "Left" if hand == LADDER_HAND_RIGHT then event_hand = "Right" end local stamina_ratio = GetStaminaRatio() local ladder_damage_large = -(0.6000000238418579 * env(GetMaxStamina)) local ladder_damage_small = -(0.6000000238418579 * env(GetMaxStamina)) if stamina_ratio <= 0.800000011920929 then act(ChangeStamina, ladder_damage_large) Fire("W_LadderDamageLarge" .. event_hand) return TRUE elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE then act(ChangeStamina, ladder_damage_large) Fire("W_LadderDamageLarge" .. event_hand) return TRUE else act(ChangeStamina, ladder_damage_small) Fire("W_LadderDamageSmall" .. event_hand) return TRUE end return FALSE end function ExecLadderNextAction(hand, is_idle) local event_hand = "Left" if hand == LADDER_HAND_RIGHT then event_hand = "Right" end local action_type = env(GetAIActionType) if action_type == LADDER_REQUEST_UP then if env(IsReachTopOfLadder) == TRUE then Fire("W_LadderEndTop" .. event_hand) return TRUE end if env(DoesLadderHaveCharacters, CONFLICT_DIST_CHR, UPSIDE, PLAYER) == TRUE then local stamina_ratio = GetStaminaRatio() local ladder_stamina_consume = -(0.20000000298023224 * env(GetMaxStamina)) if stamina_ratio < 0.30000001192092896 then return FALSE end Fire("W_LadderAttackUp" .. event_hand) act(ChangeStamina, ladder_stamina_consume) return TRUE end if env(IsSomeoneOnLadder, CONFLICT_DIST_CHR, 0) == TRUE then if is_idle == TRUE and env(DoesLadderHaveCharacters, 0, UPSIDE, ENEMY) == TRUE and env(IsReachBottomOfLadder) == TRUE then Fire("W_LadderEndBottom" .. event_hand) return TRUE end return FALSE end Fire("W_LadderUp" .. event_hand) return TRUE elseif action_type == LADDER_REQUEST_DOWN then if env(IsReachBottomOfLadder) == TRUE then Fire("W_LadderEndBottom" .. event_hand) return TRUE end if env(DoesLadderHaveCharacters, CONFLICT_DIST_CHR, DOWNSIDE, PLAYER) == TRUE then local stamina_ratio = GetStaminaRatio() local ladder_stamina_consume = -(0.20000000298023224 * env(GetMaxStamina)) if stamina_ratio < 0.30000001192092896 then return FALSE end Fire("W_LadderAttackDown" .. event_hand) act(ChangeStamina, ladder_stamina_consume) return TRUE end if env(GetSpEffectID, 8933) == TRUE then Fire("W_LadderCoastStart") return TRUE elseif env(GetSpEffectID, 8934) == TRUE then Fire("W_LadderDown" .. event_hand) return TRUE end if env(IsSomeoneUnderLadder, CONFLICT_DIST_COAST, 0) == FALSE then Fire("W_LadderCoastStart") return TRUE end if is_idle == TRUE and env(IsSomeoneUnderLadder, CONFLICT_DIST_CHR, 0) == TRUE then Replanning() Fire("W_FallingDefault") LadderSetActionState(LADDER_ACTION_INVALID) return TRUE end Fire("W_LadderDown" .. event_hand) return TRUE end if is_idle == FALSE then Fire("W_LadderIdle" .. event_hand) return TRUE end return FALSE end function ExecLadderCoastNextAction(hand) if env(IsReachBottomOfLadder) == TRUE then Fire("W_LadderCoastEnd") return TRUE end local event_hand = "Left" if hand == LADDER_HAND_RIGHT then event_hand = "Right" end if env(IsSomeoneUnderLadder, CONFLICT_DIST_CHR, 0) == FALSE then Fire("W_LadderCoast" .. event_hand) return TRUE else Fire("W_LadderCoastStop" .. event_hand) return TRUE end return FALSE end function LadderIdleCommonFunction(hand) if ExecLadderFall() == TRUE then return TRUE end if ExecLadderDamage(hand) == TRUE then return TRUE end if ExecLadderNextAction(hand, TRUE) == TRUE then return TRUE end return FALSE end function LadderMoveCommonFunction(hand) if ExecLadderFall() == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE and ExecLadderNextAction(hand, FALSE) == TRUE then return TRUE end return FALSE end function LadderAttackCommonFunction(hand) if ExecLadderFall() == TRUE then return TRUE end if ExecLadderDamage(hand) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE and ExecLadderNextAction(hand, FALSE) == TRUE then return TRUE end return FALSE end function LadderDamageCommonFunction(hand) if ExecLadderFall() == TRUE then return TRUE end if ExecLadderDamage(hand) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE and ExecLadderNextAction(hand, FALSE) == TRUE then return TRUE end return FALSE end function LadderStartEndCommonFunction() if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, FALSE) == TRUE then return TRUE end return FALSE end function LadderEquipWeaponCommonFunction() if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function LadderCoastCommonFunction(hand) if ExecLadderFall() == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE and ExecLadderCoastNextAction(hand) == TRUE then return TRUE end return FALSE end function LadderSendCommand(command) if command ~= LADDER_COMMAND_INVALID then act(SendMessageIDToEvents, command) end end function LadderSetActionState(state) act(SetLadderActionState, state) end function ConvergeValue(target_val, cur_val, max_inc, max_dec) local ret = target_val if target_val == cur_val then return ret end local dT = GetDeltaTime() local gap = math.abs(target_val - cur_val) local add_val = 0 if cur_val < target_val then add_val = math.abs(max_inc * dT) elseif target_val < cur_val then add_val = -1 * math.abs(max_dec * dT) end if add_val < gap then ret = cur_val + add_val if add_val > 0 then if target_val < ret then ret = target_val end elseif ret < target_val then ret = target_val end end return ret end function GetDeltaTime() return env(ObtainedDT) / 1000 end function SleepCommonFunction(action_number) if action_number ~= nil then CallActionState(action_number) end if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, STYLE_DEFAULT, MOVE_TYPE_NONE, TRUE) == TRUE then return TRUE end return FALSE end function Init_onActivate() SetVariable("IdleUniqueStartTime", math.random() * 3) end function Init_onUpdate() SetIdleType(AI_STATE_DEFAULT) local hp = env(GetHP) local damage_type = env(GetReceivedDamageType) if damage_type == DAMAGE_TYPE_DEATHIDLE then SetVariable("IndexDeathIdleVariation", 0) Fire("W_DeathIdleDefault") return end if env(CheckForEventAnimPlaybackRequest) == TRUE then return end if env(IsGenerateAction) == TRUE and IsExistAnime(ANIME_ID_GENERATE) == TRUE then Fire("W_Generate") return end if ExecIdleUnique() == TRUE then return end Fire("W_Idle") return end function IdleUnique700_onUpdate() if IdleUniqueCommonFunction(700) == TRUE then return end end function IdleUnique701_onUpdate() if IdleUniqueCommonFunction(701) == TRUE then return end end function IdleUnique702_onUpdate() if IdleUniqueCommonFunction(702) == TRUE then return end end function IdleUnique703_onUpdate() if IdleUniqueCommonFunction(703) == TRUE then return end end function IdleUnique704_onUpdate() if IdleUniqueCommonFunction(704) == TRUE then return end end function IdleUnique705_onUpdate() if IdleUniqueCommonFunction(705) == TRUE then return end end function IdleUnique706_onUpdate() if IdleUniqueCommonFunction(706) == TRUE then return end end function IdleUnique707_onUpdate() if IdleUniqueCommonFunction(707) == TRUE then return end end function IdleUnique708_onUpdate() if IdleUniqueCommonFunction(708) == TRUE then return end end function IdleUnique709_onUpdate() if IdleUniqueCommonFunction(709) == TRUE then return end end function IdleUnique710_onUpdate() if IdleUniqueCommonFunction(710) == TRUE then return end end function IdleUnique711_onUpdate() if IdleUniqueCommonFunction(711) == TRUE then return end end function IdleUnique712_onUpdate() if IdleUniqueCommonFunction(712) == TRUE then return end end function IdleUnique713_onUpdate() if IdleUniqueCommonFunction(713) == TRUE then return end end function IdleUnique714_onUpdate() if IdleUniqueCommonFunction(714) == TRUE then return end end function IdleUnique715_onUpdate() if IdleUniqueCommonFunction(715) == TRUE then return end end function IdleUnique716_onUpdate() if IdleUniqueCommonFunction(716) == TRUE then return end end function IdleUnique717_onUpdate() if IdleUniqueCommonFunction(717) == TRUE then return end end function IdleUnique718_onUpdate() if IdleUniqueCommonFunction(718) == TRUE then return end end function IdleUnique719_onUpdate() if IdleUniqueCommonFunction(719) == TRUE then return end end function IdleUnique720_onUpdate() if IdleUniqueCommonFunction(720) == TRUE then return end end function IdleUnique721_onUpdate() if IdleUniqueCommonFunction(721) == TRUE then return end end function IdleUnique722_onUpdate() if IdleUniqueCommonFunction(722) == TRUE then return end end function IdleUnique723_onUpdate() if IdleUniqueCommonFunction(723) == TRUE then return end end function IdleUnique724_onUpdate() if IdleUniqueCommonFunction(724) == TRUE then return end end function IdleUnique725_onUpdate() if IdleUniqueCommonFunction(725) == TRUE then return end end function IdleUnique726_onUpdate() if IdleUniqueCommonFunction(726) == TRUE then return end end function IdleUnique727_onUpdate() if IdleUniqueCommonFunction(727) == TRUE then return end end function IdleUnique728_onUpdate() if IdleUniqueCommonFunction(728) == TRUE then return end end function IdleUnique729_onUpdate() if IdleUniqueCommonFunction(729) == TRUE then return end end function Generate_onUpdate() if GenerateCommonFunction() == TRUE then return end end function BuddyGenerate_onActivate() SetIdleType(AI_STATE_DEFAULT) end function BuddyGenerate_onUpdate() if env(GetSpEffectID, 16301) == TRUE and env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end if GenerateCommonFunction() == TRUE then return end end function BuddyGenerate_onDeactivate() if env(GetSpEffectID, 16301) == TRUE and env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end end function BuddyGenerate2_onActivate() SetIdleType(AI_STATE_DEFAULT) end function BuddyGenerate2_onUpdate() if env(GetSpEffectID, 16301) == TRUE and env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end if GenerateCommonFunction() == TRUE then return end end function BuddyGenerate2_onDeactivate() if env(GetSpEffectID, 16301) == TRUE and env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end end function BuddyGenerate3_onActivate() SetIdleType(AI_STATE_DEFAULT) end function BuddyGenerate3_onUpdate() if env(GetSpEffectID, 16301) == TRUE and env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end if GenerateCommonFunction() == TRUE then return end end function BuddyGenerate3_onDeactivate() if env(GetSpEffectID, 16301) == TRUE and env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end end function BuddyDisappear_onUpdate() CallActionState(1840) if env(IsAnimEnd, 1) == TRUE then act(ChangeBuddyState) end end function BuddyDisappear_onDeactivate() act(ChangeBuddyState) end function IdleUniqueToIdle1700_onUpdate() if EventCommonFunction(1700) == TRUE then return end end function IdleUniqueToIdle1701_onUpdate() if EventCommonFunction(1701) == TRUE then return end end function IdleUniqueToIdle1702_onUpdate() if EventCommonFunction(1702) == TRUE then return end end function IdleUniqueToIdle1703_onUpdate() if EventCommonFunction(1703) == TRUE then return end if env(GetSpEffectID, 11772) == TRUE and env(IsAnimEnd, 1) == TRUE then Fire("W_Event30004") return end end function IdleUniqueToIdle1704_onUpdate() if EventCommonFunction(1704) == TRUE then return end end function IdleUniqueToIdle1705_onUpdate() if EventCommonFunction(1705) == TRUE then return end end function IdleUniqueToIdle1706_onUpdate() if EventCommonFunction(1706) == TRUE then return end end function IdleUniqueToIdle1707_onUpdate() if EventCommonFunction(1707) == TRUE then return end end function IdleUniqueToIdle1708_onUpdate() if EventCommonFunction(1708) == TRUE then return end end function IdleUniqueToIdle1709_onUpdate() if EventCommonFunction(1709) == TRUE then return end end function IdleUniqueToIdle1710_onUpdate() if EventCommonFunction(1710) == TRUE then return end end function IdleUniqueToIdle1711_onUpdate() if EventCommonFunction(1711) == TRUE then return end end function IdleUniqueToIdle1712_onUpdate() if EventCommonFunction(1712) == TRUE then return end end function IdleUniqueToIdle1713_onUpdate() if EventCommonFunction(1713) == TRUE then return end end function IdleUniqueToIdle1714_onUpdate() if EventCommonFunction(1714) == TRUE then return end end function IdleUniqueToIdle1715_onUpdate() if EventCommonFunction(1715) == TRUE then return end end function IdleUniqueToIdle1716_onUpdate() if EventCommonFunction(1716) == TRUE then return end end function IdleUniqueToIdle1717_onUpdate() if EventCommonFunction(1717) == TRUE then return end end function IdleUniqueToIdle1718_onUpdate() if EventCommonFunction(1718) == TRUE then return end end function IdleUniqueToIdle1719_onUpdate() if EventCommonFunction(1719) == TRUE then return end end function IdleUniqueToIdle1720_onUpdate() if EventCommonFunction(1720) == TRUE then return end end function IdleUniqueToIdle1721_onUpdate() if EventCommonFunction(1721) == TRUE then return end end function IdleUniqueToIdle1722_onUpdate() if EventCommonFunction(1722) == TRUE then return end end function IdleUniqueToIdle1723_onUpdate() if EventCommonFunction(1723) == TRUE then return end end function IdleUniqueToIdle1724_onUpdate() if EventCommonFunction(1724) == TRUE then return end end function IdleUniqueToIdle1725_onUpdate() if EventCommonFunction(1725) == TRUE then return end end function IdleUniqueToIdle1726_onUpdate() if EventCommonFunction(1726) == TRUE then return end end function IdleUniqueToIdle1727_onUpdate() if EventCommonFunction(1727) == TRUE then return end end function IdleUniqueToIdle1728_onUpdate() if EventCommonFunction(1728) == TRUE then return end end function IdleUniqueToIdle1729_onUpdate() if EventCommonFunction(1729) == TRUE then return end end function IdleToIdleUnique1750_onUpdate() if EventCommonFunction(1750) == TRUE then return end end function IdleToIdleUnique1751_onUpdate() if EventCommonFunction(1751) == TRUE then return end end function IdleToIdleUnique1752_onUpdate() if EventCommonFunction(1752) == TRUE then return end end function IdleToIdleUnique1753_onUpdate() if EventCommonFunction(1753) == TRUE then return end end function IdleToIdleUnique1754_onUpdate() if EventCommonFunction(1754) == TRUE then return end end function IdleToIdleUnique1755_onUpdate() if EventCommonFunction(1755) == TRUE then return end end function IdleToIdleUnique1756_onUpdate() if EventCommonFunction(1756) == TRUE then return end end function IdleToIdleUnique1757_onUpdate() if EventCommonFunction(1757) == TRUE then return end end function IdleToIdleUnique1758_onUpdate() if EventCommonFunction(1758) == TRUE then return end end function IdleToIdleUnique1759_onUpdate() if EventCommonFunction(1759) == TRUE then return end end function IdleToIdleUnique1760_onUpdate() if EventCommonFunction(1760) == TRUE then return end end function IdleToIdleUnique1761_onUpdate() if EventCommonFunction(1761) == TRUE then return end end function IdleToIdleUnique1762_onUpdate() if EventCommonFunction(1762) == TRUE then return end end function IdleToIdleUnique1763_onUpdate() if EventCommonFunction(1763) == TRUE then return end end function IdleToIdleUnique1764_onUpdate() if EventCommonFunction(1764) == TRUE then return end end function IdleToIdleUnique1765_onUpdate() if EventCommonFunction(1765) == TRUE then return end end function IdleToIdleUnique1766_onUpdate() if EventCommonFunction(1766) == TRUE then return end end function IdleToIdleUnique1767_onUpdate() if EventCommonFunction(1767) == TRUE then return end end function IdleToIdleUnique1768_onUpdate() if EventCommonFunction(1768) == TRUE then return end end function IdleToIdleUnique1769_onUpdate() if EventCommonFunction(1769) == TRUE then return end end function IdleToIdleUnique1770_onUpdate() if EventCommonFunction(1770) == TRUE then return end end function IdleToIdleUnique1771_onUpdate() if EventCommonFunction(1771) == TRUE then return end end function IdleToIdleUnique1772_onUpdate() if EventCommonFunction(1772) == TRUE then return end end function IdleToIdleUnique1773_onUpdate() if EventCommonFunction(1773) == TRUE then return end end function IdleToIdleUnique1774_onUpdate() if EventCommonFunction(1774) == TRUE then return end end function IdleToIdleUnique1775_onUpdate() if EventCommonFunction(1775) == TRUE then return end end function IdleToIdleUnique1776_onUpdate() if EventCommonFunction(1776) == TRUE then return end end function IdleToIdleUnique1777_onUpdate() if EventCommonFunction(1777) == TRUE then return end end function IdleToIdleUnique1778_onUpdate() if EventCommonFunction(1778) == TRUE then return end end function IdleToIdleUnique1779_onUpdate() if EventCommonFunction(1779) == TRUE then return end end function IdleDefault_onUpdate() if IdleCommonFunction(STYLE_DEFAULT, ANIME_ID_IDLE_DEFAULT) == TRUE then return end end function IdleBattle_onUpdate() if IdleCommonFunction(STYLE_DEFAULT, ANIME_ID_IDLE_BATTLE) == TRUE then return end end function TransToDefaultFromBattle_onUpdate() if TransIdleCommonFunction() == TRUE then return end end function TransToBattleFromDefault_onUpdate() if TransIdleCommonFunction() == TRUE then return end end function ParryStart_onUpdate() if TransStyleCommonFunction(STYLE_PARRY) == TRUE then return end end function Attack4000_onActivate() CallActionState(4000) end function Attack4000_onUpdate() if AttackCommonFunction(4000, STYLE_DEFAULT, FALSE) == TRUE then return end end function ParryEnd_onUpdate() if TransStyleCommonFunction(STYLE_DEFAULT) == TRUE then return end end function ParryIdle_onUpdate() if IdleCommonFunction(STYLE_PARRY, ANIME_ID_IDLE_PARRY) == TRUE then return end end function ParryWalkFront_onUpdate() if MoveCommonFunction(STYLE_PARRY, MOVE_TYPE_WALK_FRONT) == TRUE then return end end function ParryWalkBack_onUpdate() if MoveCommonFunction(STYLE_PARRY, MOVE_TYPE_WALK_BACK) == TRUE then return end end function ParryWalkLeft_onUpdate() if MoveCommonFunction(STYLE_PARRY, MOVE_TYPE_WALK_LEFT) == TRUE then return end end function ParryWalkRight_onUpdate() if MoveCommonFunction(STYLE_PARRY, MOVE_TYPE_WALK_RIGHT) == TRUE then return end end function ParryRun_onUpdate() if MoveCommonFunction(STYLE_PARRY, MOVE_TYPE_RUN) == TRUE then return end end function GuardStart_onUpdate() if TransStyleCommonFunction(STYLE_GUARD) == TRUE then return end end function GuardEnd_onUpdate() if TransStyleCommonFunction(STYLE_DEFAULT) == TRUE then return end end function GuardIdle_onUpdate() if IdleCommonFunction(STYLE_GUARD, ANIME_ID_IDLE_GUARD) == TRUE then return end end function GuardWalkFront_onUpdate() if MoveCommonFunction(STYLE_GUARD, MOVE_TYPE_WALK_FRONT) == TRUE then return end end function GuardWalkBack_onUpdate() if MoveCommonFunction(STYLE_GUARD, MOVE_TYPE_WALK_BACK) == TRUE then return end end function GuardWalkLeft_onUpdate() if MoveCommonFunction(STYLE_GUARD, MOVE_TYPE_WALK_LEFT) == TRUE then return end end function GuardWalkRight_onUpdate() if MoveCommonFunction(STYLE_GUARD, MOVE_TYPE_WALK_RIGHT) == TRUE then return end end function GuardRun_onUpdate() if MoveCommonFunction(STYLE_GUARD, MOVE_TYPE_RUN) == TRUE then return end end function RunBattle_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_RUN) == TRUE then return end end function WalkFrontBattle_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_FRONT) == TRUE then return end end function WalkLeftBattle_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_LEFT) == TRUE then return end end function WalkBackBattle_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_BACK) == TRUE then return end end function WalkRightBattle_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_RIGHT) == TRUE then return end end function RunDefault_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_RUN) == TRUE then return end end function WalkFrontDefault_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_FRONT) == TRUE then return end end function ParallelMove_onUpdate() if MoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_PARALLEL) == TRUE then return end end function Attack3000_onActivate() CallActionState(3000) end function Attack3000_onUpdate() if AttackCommonFunction(3000, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3001_onActivate() CallActionState(3001) end function Attack3001_onUpdate() if AttackCommonFunction(3001, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3002_onActivate() CallActionState(3002) end function Attack3002_onUpdate() if AttackCommonFunction(3002, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3003_onActivate() CallActionState(3003) end function Attack3003_onUpdate() if AttackCommonFunction(3003, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3004_onActivate() CallActionState(3004) end function Attack3004_onUpdate() if AttackCommonFunction(3004, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3005_onActivate() CallActionState(3005) end function Attack3005_onUpdate() if AttackCommonFunction(3005, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3006_onActivate() CallActionState(3006) end function Attack3006_onUpdate() if AttackCommonFunction(3006, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3007_onActivate() CallActionState(3007) end function Attack3007_onUpdate() if AttackCommonFunction(3007, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3008_onActivate() CallActionState(3008) end function Attack3008_onUpdate() if AttackCommonFunction(3008, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3009_onActivate() CallActionState(3009) end function Attack3009_onUpdate() if AttackCommonFunction(3009, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3010_onActivate() CallActionState(3010) end function Attack3010_onUpdate() if AttackCommonFunction(3010, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3011_onActivate() CallActionState(3011) end function Attack3011_onUpdate() if AttackCommonFunction(3011, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3012_onActivate() CallActionState(3012) end function Attack3012_onUpdate() if AttackCommonFunction(3012, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3013_onActivate() CallActionState(3013) end function Attack3013_onUpdate() if AttackCommonFunction(3013, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3014_onActivate() CallActionState(3014) end function Attack3014_onUpdate() if AttackCommonFunction(3014, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3015_onActivate() CallActionState(3015) end function Attack3015_onUpdate() if AttackCommonFunction(3015, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3016_onActivate() CallActionState(3016) end function Attack3016_onUpdate() if AttackCommonFunction(3016, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3017_onActivate() CallActionState(3017) end function Attack3017_onUpdate() if AttackCommonFunction(3017, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3018_onActivate() CallActionState(3018) end function Attack3018_onUpdate() if AttackCommonFunction(3018, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3019_onActivate() CallActionState(3019) end function Attack3019_onUpdate() if AttackCommonFunction(3019, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3020_onActivate() CallActionState(3020) end function Attack3020_onUpdate() if AttackCommonFunction(3020, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3021_onActivate() CallActionState(3021) end function Attack3021_onUpdate() if AttackCommonFunction(3021, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3022_onActivate() CallActionState(3022) end function Attack3022_onUpdate() if AttackCommonFunction(3022, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3023_onActivate() CallActionState(3023) end function Attack3023_onUpdate() if AttackCommonFunction(3023, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3024_onActivate() CallActionState(3024) end function Attack3024_onUpdate() if AttackCommonFunction(3024, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3025_onActivate() CallActionState(3025) end function Attack3025_onUpdate() if AttackCommonFunction(3025, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3026_onActivate() CallActionState(3026) end function Attack3026_onUpdate() if AttackCommonFunction(3026, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3027_onActivate() CallActionState(3027) end function Attack3027_onUpdate() if AttackCommonFunction(3027, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3028_onActivate() CallActionState(3028) end function Attack3028_onUpdate() if AttackCommonFunction(3028, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3029_onActivate() CallActionState(3029) end function Attack3029_onUpdate() if AttackCommonFunction(3029, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3030_onActivate() CallActionState(3030) end function Attack3030_onUpdate() if AttackCommonFunction(3030, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3031_onActivate() CallActionState(3031) end function Attack3031_onUpdate() if AttackCommonFunction(3031, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3032_onActivate() CallActionState(3032) end function Attack3032_onUpdate() if AttackCommonFunction(3032, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3033_onActivate() CallActionState(3033) end function Attack3033_onUpdate() if AttackCommonFunction(3033, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3034_onActivate() CallActionState(3034) end function Attack3034_onUpdate() if AttackCommonFunction(3034, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3035_onActivate() CallActionState(3035) end function Attack3035_onUpdate() if AttackCommonFunction(3035, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3036_onActivate() CallActionState(3036) end function Attack3036_onUpdate() if AttackCommonFunction(3036, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3037_onActivate() CallActionState(3037) end function Attack3037_onUpdate() if AttackCommonFunction(3037, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3038_onActivate() CallActionState(3038) end function Attack3038_onUpdate() if AttackCommonFunction(3038, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3039_onActivate() CallActionState(3039) end function Attack3039_onUpdate() if AttackCommonFunction(3039, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3110_onActivate() CallActionState(3110) end function Attack3110_onUpdate() if AttackCommonFunction(3110, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3200_onActivate() CallActionState(3200) end function Attack3200_onUpdate() if AttackCommonFunction(3200, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3201_onActivate() CallActionState(3201) end function Attack3201_onUpdate() if AttackCommonFunction(3201, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3202_onActivate() CallActionState(3202) end function Attack3202_onUpdate() if AttackCommonFunction(3202, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3203_onActivate() CallActionState(3203) end function Attack3203_onUpdate() if AttackCommonFunction(3203, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack3204_onActivate() CallActionState(3204) end function Attack3204_onUpdate() if AttackCommonFunction(3204, STYLE_DEFAULT, TRUE) == TRUE then return end end function GoalAction3500_onActivate() CallActionState(3500) end function GoalAction3500_onUpdate() if AttackCommonFunction(3500, STYLE_DEFAULT, TRUE) == TRUE then return end end function GoalAction3501_onActivate() CallActionState(3501) end function GoalAction3501_onUpdate() if AttackCommonFunction(3501, STYLE_DEFAULT, TRUE) == TRUE then return end end function GoalAction3502_onActivate() CallActionState(3502) end function GoalAction3502_onUpdate() if AttackCommonFunction(3502, STYLE_DEFAULT, TRUE) == TRUE then return end end function GoalAction3503_onActivate() CallActionState(3503) end function GoalAction3503_onUpdate() if AttackCommonFunction(3503, STYLE_DEFAULT, TRUE) == TRUE then return end end function GoalAction3504_onActivate() CallActionState(3504) end function GoalAction3504_onUpdate() if AttackCommonFunction(3504, STYLE_DEFAULT, TRUE) == TRUE then return end end function Attack4600_onActivate() CallActionState(4600) end function Attack4600_onUpdate() if AttackCommonFunction(4600, STYLE_DEFAULT, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then if env(GetStateChangeType, SP_EFFECT_TYPE_DISABLE_EST) == TRUE then ExecAttack(4602) return else ExecAttack(4601) return end end end function Attack4601_onActivate() CallActionState(4600) end function Attack4601_onUpdate() if AttackCommonFunction(4601, STYLE_DEFAULT, FALSE) == TRUE then return end end function Attack4602_onActivate() CallActionState(4600) end function Attack4602_onUpdate() if AttackCommonFunction(4602, STYLE_DEFAULT, FALSE) == TRUE then return end end function Attack1500_onActivate() CallActionState(1500) end function Attack1500_onUpdate() if AttackCommonFunction(1500, STYLE_DEFAULT, FALSE) == TRUE then return end end function Attack1600_onActivate() CallActionState(1600) end function Attack1600_onUpdate() if AttackCommonFunction(1600, STYLE_DEFAULT, FALSE) == TRUE then return end end function Attack1810_onActivate() CallActionState(1810) end function Attack1810_onUpdate() if AttackCommonFunction(1810, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6000_onActivate() CallActionState(6000) end function Step6000_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6000, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6001_onActivate() CallActionState(6001) end function Step6001_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6001, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6002_onActivate() CallActionState(6002) end function Step6002_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6002, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6003_onActivate() CallActionState(6003) end function Step6003_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6003, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6010_onActivate() CallActionState(6010) end function Step6010_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6010, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6011_onActivate() CallActionState(6011) end function Step6011_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6011, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6012_onActivate() CallActionState(6012) end function Step6012_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6012, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6013_onActivate() CallActionState(6013) end function Step6013_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6013, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6020_onActivate() CallActionState(6020) end function Step6020_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6020, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6021_onActivate() CallActionState(6021) end function Step6021_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6021, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6022_onActivate() CallActionState(6022) end function Step6022_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6022, STYLE_DEFAULT, FALSE) == TRUE then return end end function Step6023_onActivate() CallActionState(6023) end function Step6023_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if AttackCommonFunction(6023, STYLE_DEFAULT, FALSE) == TRUE then return end end function TurnDefault_Left90_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnDefault_Right90_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnDefault_Left180_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnDefault_Right180_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnDefault_Left45_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnDefault_Right45_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnBattle_Left90_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnBattle_Right90_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnBattle_Left180_onUpdate() if env(GetSpEffectID, 10211) == TRUE then Fire("W_Event20012") return end if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnBattle_Right180_onUpdate() if env(GetSpEffectID, 10211) == TRUE then Fire("W_Event20013") return end if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnBattle_Left45_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnBattle_Right45_onUpdate() if TurnCommonFunction(STYLE_DEFAULT) == TRUE then return end end function TurnGuard_Left90_onUpdate() if TurnCommonFunction(STYLE_GUARD) == TRUE then return end end function TurnGuard_Right90_onUpdate() if TurnCommonFunction(STYLE_GUARD) == TRUE then return end end function TurnGuard_Left180_onUpdate() if TurnCommonFunction(STYLE_GUARD) == TRUE then return end end function TurnGuard_Right180_onUpdate() if TurnCommonFunction(STYLE_GUARD) == TRUE then return end end function TurnGuard_Left45_onUpdate() if TurnCommonFunction(STYLE_GUARD) == TRUE then return end end function TurnGuard_Right45_onUpdate() if TurnCommonFunction(STYLE_GUARD) == TRUE then return end end function TurnParry_Left90_onUpdate() if TurnCommonFunction(STYLE_PARRY) == TRUE then return end end function TurnParry_Right90_onUpdate() if TurnCommonFunction(STYLE_PARRY) == TRUE then return end end function TurnParry_Left180_onUpdate() if TurnCommonFunction(STYLE_PARRY) == TRUE then return end end function TurnParry_Right180_onUpdate() if TurnCommonFunction(STYLE_PARRY) == TRUE then return end end function TurnParry_Left45_onUpdate() if TurnCommonFunction(STYLE_PARRY) == TRUE then return end end function TurnParry_Right45_onUpdate() if TurnCommonFunction(STYLE_PARRY) == TRUE then return end end function DamageSpecial_onActivate() CallActionState(0) end function DamageSpecial_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageMinimum_onActivate() CallActionState(0) end function DamageMinimum_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function SABreak_onActivate() CallActionState(0) act(AddSpEffect, 5801) act(AddSpEffect, 5805) end function SABreak_onUpdate() act(AddSpEffect, 5801) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageSmall_onActivate() CallActionState(0) end function DamageSmall_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageSmallFront_onActivate() CallActionState(0) end function DamageSmallFront_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function NewDamageSmall_onActivate() CallActionState(0) end function NewDamageSmall_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageMiddle_onActivate() CallActionState(0) end function DamageMiddle_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageMiddleFront_onActivate() CallActionState(0) end function DamageMiddleFront_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function NewDamageMiddle_onActivate() CallActionState(0) end function NewDamageMiddle_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageLarge_onActivate() CallActionState(0) end function DamageLarge_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageLargeFront_onActivate() CallActionState(0) end function DamageLargeFront_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function NewDamageLarge_onActivate() CallActionState(0) end function NewDamageLarge_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageSpecialBlow_onActivate() CallActionState(0) end function DamageSpecialBlow_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageLargeBlow_onActivate() CallActionState(0) end function DamageLargeBlow_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_UPWARD) == TRUE then return end end function DamageSmallBlow_onActivate() CallActionState(0) end function DamageSmallBlow_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_UPWARD) == TRUE then return end end function DamageFling_onActivate() CallActionState(0) end function DamageFling_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamagePush_onActivate() CallActionState(0) end function DamagePush_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageUpper_onActivate() CallActionState(0) end function DamageUpper_onUpdate() if env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 5404) == TRUE or env(GetSpEffectID, 10900) == TRUE and (env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 5402) == TRUE) then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_UPWARD) == TRUE then return end elseif DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageWeak_onActivate() CallActionState(0) end function DamageWeak_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, TRUE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageSmallFire_onActivate() CallActionState(0) end function DamageSmallFire_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageLargeFire_onActivate() CallActionState(0) end function DamageLargeFire_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function GuardDamageSmall_onActivate() CallActionState(0) end function GuardDamageSmall_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(STYLE_GUARD, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function GuardDamageSmallLowStamina_onActivate() CallActionState(0) end function GuardDamageSmallLowStamina_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(STYLE_GUARD, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function GuardDamageMiddle_onActivate() CallActionState(0) end function GuardDamageMiddle_onUpdate() if DamageCommonFunction(STYLE_GUARD, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function GuardDamageLarge_onActivate() CallActionState(0) end function GuardDamageLarge_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(STYLE_GUARD, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function GuardDamageLargeLowStamina_onActivate() CallActionState(0) end function GuardDamageLargeLowStamina_onUpdate() act(SetStaminaRecoveryDisabled) if DamageCommonFunction(STYLE_GUARD, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function GuardBreak_onActivate() CallActionState(0) end function GuardBreak_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageParryEnemy1_onActivate() CallActionState(0) end function DamageParryEnemy1_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DamageParryEnemy2_onActivate() CallActionState(0) end function DamageParryEnemy2_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function AttackBoundEnemy1_onActivate() CallActionState(0) end function AttackBoundEnemy1_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function AttackBoundEnemy2_onActivate() CallActionState(0) end function AttackBoundEnemy2_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function DeathStart_Activate() act(DenyEventAnimPlaybackRequest) end function DeathStart_Update() act(DenyEventAnimPlaybackRequest) end function DeathStartDefault_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_DEFAULT) == TRUE then return end end function DeathStartFire_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_FIRE) == TRUE then return end end function DeathStartWeak_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_WEAK) == TRUE then return end end function DeathStartBlast_onActivate() act(TurnTowardAttacker, 0) end function DeathStartBlast_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_BLAST) == TRUE then return end end function DeathStartFling_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_FLING) == TRUE then return end end function DeathStartUpper_onActivate() if env(GetSpEffectID, 10500) == TRUE and env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 17055) == TRUE and env(GetSpEffectID, 5404) == TRUE or env(GetSpEffectID, 10900) == TRUE and (env(GetSpEffectID, 5401) == TRUE or env(GetSpEffectID, 5402) == TRUE) then act(TurnTowardAttacker, 0) end end function DeathStartUpper_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_UPPER) == TRUE then return end end function DeathStartLandDefault_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_LAND_DEFAULT) == TRUE then return end end function DeathStartLandUpward_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_LAND_UPWARD) == TRUE then return end end function DeathStartLandDownward_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_LAND_DOWNWARD) == TRUE then return end end function DeathStartSleep_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_SLEEP) == TRUE then return end end function DeathStartSleepCollect_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_SLEEP_COLLECT) == TRUE then return end end function FallingDefault_onUpdate() if FallCommonFunction(FALL_DEFAULT) == TRUE then return end end function FallingUpward_onUpdate() if FallCommonFunction(FALL_UPWARD) == TRUE then return end end function FallingDownward_onUpdate() if FallCommonFunction(FALL_DOWNWARD) == TRUE then return end end function LandDefault_onUpdate() if LandCommonFunction() == TRUE then return end end function LandHeavy_onUpdate() if LandCommonFunction() == TRUE then return end end function LandUpward_onUpdate() if LandCommonFunction() == TRUE then return end end function LandDownward_onUpdate() if LandCommonFunction() == TRUE then return end end function Throw_Activate() SetVariable("ThrowID", env(GetThrowAnimID)) end function Throw_Deactivate() act(SetThrowState, THROW_STATE_NONE) end function ThrowAtk_onActivate() CallActionState(3110) Replanning() end function ThrowAtk_onUpdate() CallActionState(3110) if env(DidOpponentDieFromThrow) == TRUE and IsExistAnime(GetVariable("ThrowID") + 1) == TRUE then Fire("W_ThrowKill") return end if env(HasThrowEnded) == TRUE and IsExistAnime(GetVariable("ThrowID") + 2) == TRUE then Fire("W_ThrowRelease") return end if ThrowCommonFunction() == TRUE then return end end function ThrowDef_onActivate() Replanning() end function ThrowDef_onUpdate() if env(GetSpEffectID, 14570) == TRUE then elseif env(GetSpEffectID, 19660) == TRUE then if env(IsThrowSelfDeath) == TRUE then Fire("W_Event20003") return end elseif env(IsThrowSelfDeath) == TRUE then Fire("W_ThrowDefDeath") return end if ThrowCommonFunction() == TRUE then return end if env(IsAnimEnd, 1) == TRUE then if env(GetSpEffectID, SP_EFFECT_TINDALOS_THROW_DEF) == TRUE then Fire("W_Event20005") return else Fire("W_Idle") return end end end function ThrowRelease_onUpdate() if ThrowCommonFunction() == TRUE then return end end function ThrowKill_onUpdate() if ThrowCommonFunction() == TRUE then return end end function ThrowDefDeath_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_THROW_DEF) == TRUE then return end end function ThrowDefDeathIdle_onActivate() act(SetThrowState, THROW_STATE_NONE) end function Event14000_onUpdate() if EventCommonFunction(14000) == TRUE then return end end function Event14001_onUpdate() if EventCommonFunction(14001) == TRUE then return end end function Event14010_onUpdate() if EventCommonFunction(14010) == TRUE then return end end function Event14011_onUpdate() if EventCommonFunction(14011) == TRUE then return end end function Event14020_onUpdate() if EventCommonFunction(14020) == TRUE then return end end function Event14021_onUpdate() if EventCommonFunction(14021) == TRUE then return end end function Ladder_Activate() act(DenyEventAnimPlaybackRequest) end function Ladder_Update() act(DenyEventAnimPlaybackRequest) SetThrowInvalid() LadderSetActionState(INVALID) end function LadderIdleLeft_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_LEFT) if LadderIdleCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderIdleRight_onUpdate() LadderSetActionState(LADDER_ACTION_IDLE_RIGHT) if LadderIdleCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderUpRight_onActivate() LadderSendCommand(LADDER_COMMAND_UP) end function LadderUpRight_onUpdate() LadderSetActionState(LADDER_ACTION_UP_RIGHT) if LadderMoveCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderUpLeft_onActivate() LadderSendCommand(LADDER_COMMAND_UP) end function LadderUpLeft_onUpdate() LadderSetActionState(LADDER_ACTION_UP_LEFT) if LadderMoveCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderDownRight_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderDownRight_onUpdate() LadderSetActionState(LADDER_ACTION_DOWN_RIGHT) if LadderMoveCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderDownLeft_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderDownLeft_onUpdate() LadderSetActionState(LADDER_ACTION_DOWN_LEFT) if LadderMoveCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderStartTop_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderStartTop_onUpdate() LadderSetActionState(LADDER_ACTION_START_TOP) if LadderStartEndCommonFunction() == TRUE then return end end function LadderStartBottom_onActivate() LadderSendCommand(LADDER_COMMAND_UP) end function LadderStartBottom_onUpdate() LadderSetActionState(LADDER_ACTION_START_BOTTOM) if LadderStartEndCommonFunction() == TRUE then return end end function LadderEndTopLeft_onActivate() LadderSendCommand(LADDER_COMMAND_UP) end function LadderEndTopLeft_onUpdate() LadderSetActionState(LADDER_ACTION_END_TOP) if LadderStartEndCommonFunction() == TRUE then return end end function LadderEndTopRight_onActivate() LadderSendCommand(LADDER_COMMAND_UP) end function LadderEndTopRight_onUpdate() LadderSetActionState(LADDER_ACTION_END_TOP) if LadderStartEndCommonFunction() == TRUE then return end end function LadderEndBottomLeft_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderEndBottomLeft_onUpdate() LadderSetActionState(LADDER_ACTION_END_BOTTOM) if LadderStartEndCommonFunction() == TRUE then return end end function LadderEndBottomRight_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderEndBottomRight_onUpdate() LadderSetActionState(LADDER_ACTION_END_BOTTOM) if LadderStartEndCommonFunction() == TRUE then return end end function LadderAttackDownLeft_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_DOWN_LEFT) if LadderAttackCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderAttackDownRight_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_DOWN_RIGHT) if LadderAttackCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderAttackUpLeft_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_UP_LEFT) if LadderAttackCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderAttackUpRight_onUpdate() LadderSetActionState(LADDER_ACTION_ATTACK_UP_RIGHT) if LadderAttackCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderDamageSmallRight_onUpdate() LadderSetActionState(LADDER_ACTION_SMALL_DAMAGE) if LadderDamageCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderDamageSmallLeft_onUpdate() LadderSetActionState(LADDER_ACTION_SMALL_DAMAGE) if LadderDamageCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderDamageLargeRight_onUpdate() LadderSetActionState(LADDER_ACTION_LARGE_DAMAGE) if LadderDamageCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderDamageLargeLeft_onUpdate() LadderSetActionState(LADDER_ACTION_LARGE_DAMAGE) if LadderDamageCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderFallStart_onActivate() Replanning() act(AddSpEffect, 30050) end function LadderFallStart_onUpdate() LadderSetActionState(LADDER_ACTION_INVALID) end function LadderFall_onUpdate() if ExecLand(FALL_LADDER) == TRUE then return end end function LadderFallLand_onUpdate() if LandCommonFunction() == TRUE then return end end function LadderCoastStart_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_START_LEFT) if LadderCoastCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderCoastLeft_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderCoastLeft_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_LEFT) if LadderCoastCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderCoastRight_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderCoastRight_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_RIGHT) if LadderCoastCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderCoastStopLeft_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_STOP_LEFT) if LadderMoveCommonFunction(LADDER_HAND_LEFT) == TRUE then return end end function LadderCoastStopRight_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_STOP_RIGHT) if LadderMoveCommonFunction(LADDER_HAND_RIGHT) == TRUE then return end end function LadderCoastEnd_onActivate() LadderSendCommand(LADDER_COMMAND_DOWN) end function LadderCoastEnd_onUpdate() LadderSetActionState(LADDER_ACTION_COAST_LANDING) if LadderStartEndCommonFunction() == TRUE then return end end function LadderDeath_onActivate() Replanning() end function LadderDeath_onUpdate() LadderSetActionState(LADDER_ACTION_INVALID) end function LadderDeathFall_onUpdate() if ExecLand(FALL_LADDER_DEATH) == TRUE then return end end function DeathStartLadder_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_LADDER) == TRUE then return end end function LadderRemoveWeaponBottom_onUpdate() act(SetInsufficientStrengthAnimID) if LadderStartEndCommonFunction() == TRUE then return end end function LadderRemoveWeaponTop_onUpdate() act(SetInsufficientStrengthAnimID) if LadderStartEndCommonFunction() == TRUE then return end end function LadderEquipWeapon_onUpdate() LadderSetActionState(LADDER_ACTION_INVALID) if LadderEquipWeaponCommonFunction() == TRUE then return end end function Attack3100_onActivate() CallActionState(3100) end function Attack3100_onUpdate() if AttackCommonFunction(3100, STYLE_GUARD, TRUE) == TRUE then return end end function Attack3101_onActivate() CallActionState(3101) end function Attack3101_onUpdate() if AttackCommonFunction(3101, STYLE_GUARD, TRUE) == TRUE then return end end function Attack3102_onActivate() CallActionState(3102) end function Attack3102_onUpdate() if AttackCommonFunction(3102, STYLE_GUARD, TRUE) == TRUE then return end end function Attack3103_onActivate() CallActionState(3103) end function Attack3103_onUpdate() if AttackCommonFunction(3103, STYLE_GUARD, TRUE) == TRUE then return end end function Attack3104_onActivate() CallActionState(3104) end function Attack3104_onUpdate() if AttackCommonFunction(3104, STYLE_GUARD, TRUE) == TRUE then return end end function Sleep_Start_onActivate() CallActionState(12001) end function Sleep_Start_onUpdate() if SleepCommonFunction(12001) == TRUE then act(AddSpEffect, 30050) return end if env(GetSpEffectID, SP_EFFECT_DEEP_SLEEP) == TRUE then if env(GetSpEffectID, 102304) == TRUE then act(AddSpEffect, 102301) end if env(GetSpEffectID, 102308) == TRUE then act(AddSpEffect, 102305) end if env(GetSpEffectID, 90300) == FALSE and env(GetSpEffectID, 5841) == FALSE and env(GetSpEffectID, 5842) == FALSE and env(GetSpEffectID, 102308) == FALSE and env(GetSpEffectID, 102304) == FALSE then act(AddSpEffect, 102303) end end if env(IsAnimEnd, 1) == TRUE then Fire("W_Sleep_Loop") return end end function Sleep_Loop_onActivate() CallActionState(12000) end function Sleep_Loop_onUpdate() local hp = env(GetHP) if env(GetSpEffectID, SP_EFFECT_DEEP_SLEEP) == TRUE and hp > 0 then return end if SleepCommonFunction(12000) == TRUE then act(AddSpEffect, 30050) return end end function Sleep_End_onActivate() CallActionState(12002) end function Sleep_End_onUpdate() if SleepCommonFunction(12002) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Sleep_Resist_onActivate() CallActionState(12020) end function Sleep_Resist_onUpdate() if env(GetSpEffectID, SP_EFFECT_DEEP_SLEEP) == TRUE and env(GetSpEffectID, 102308) == TRUE then act(AddSpEffect, 102305) end if SleepCommonFunction(12020) == TRUE then return end end function SleepCollect_Start_onActivate() CallActionState(14101) end function SleepCollect_Start_onUpdate() if SleepCommonFunction(14101) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_SleepCollect_Loop") return end end function SleepCollect_Loop_onActivate() CallActionState(14100) end function SleepCollect_Loop_onUpdate() if SleepCommonFunction(14100) == TRUE then act(AddSpEffect, 4420) return end end function SleepCollect_Loop_onDeactivate() act(AddSpEffect, 4420) end function SleepCollect_End_onActivate() CallActionState(14102) end function SleepCollect_End_onUpdate() if SleepCommonFunction(14102) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function PartBlend_NoAdd1_onUpdate() SetVariable("BlendPart1", 0) end function PartBlend_NoAdd2_onUpdate() SetVariable("BlendPart2", 0) end function PartBlend_NoAdd3_onUpdate() SetVariable("BlendPart3", 0) end function PartBlend_NoAdd4_onUpdate() SetVariable("BlendPart4", 0) end function PartBlend_NoAdd5_onUpdate() SetVariable("BlendPart5", 0) end function PartBlend_NoAdd6_onUpdate() SetVariable("BlendPart6", 0) end function PartBlend_NoAdd7_onUpdate() SetVariable("BlendPart7", 0) end function PartBlend_NoAdd8_onUpdate() SetVariable("BlendPart8", 0) end function PartBlend_NoAdd9_onUpdate() SetVariable("BlendPart9", 0) end function PartBlend_NoAdd10_onUpdate() SetVariable("BlendPart10", 0) end function PartBlend_NoAdd11_onUpdate() SetVariable("BlendPart11", 0) end function PartBlend_NoAdd12_onUpdate() SetVariable("BlendPart12", 0) end function PartBlend_NoAdd13_onUpdate() SetVariable("BlendPart13", 0) end function PartBlend_NoAdd14_onUpdate() SetVariable("BlendPart14", 0) end function PartBlend_NoAdd15_onUpdate() SetVariable("BlendPart15", 0) end function PartBlend_NoAdd16_onUpdate() SetVariable("BlendPart16", 0) end function WeakPartBlend_NoAdd_onUpdate() SetVariable("BlendWeakPart", 0) end function GuardBlend_NoAdd_onUpdate() SetVariable("BlendGuard", 0) end function SABlend_NoAdd_onUpdate() SetVariable("BlendSA", 0) end function TalkHeadBlend00_onUpdate() local cur_val_TalkHeadBlend = GetVariable("TalkHeadBlend00") local min_val_TalkHeadBlend = 0 local max_val_TalkHeadBlend = 1 local max_inc_TalkHeadBlend = 2.5 local max_dec_TalkHeadBlend = 10 if env(IsSpeaking) == FALSE then local set_val = ConvergeValue(min_val_TalkHeadBlend, cur_val_TalkHeadBlend, max_inc_TalkHeadBlend, max_dec_TalkHeadBlend) SetVariable("TalkHeadBlend00", set_val) elseif cur_val_TalkHeadBlend < max_val_TalkHeadBlend then local set_val = ConvergeValue(max_val_TalkHeadBlend, cur_val_TalkHeadBlend, max_inc_TalkHeadBlend, max_dec_TalkHeadBlend) SetVariable("TalkHeadBlend00", set_val) else end end function LipSync_onUpdate() local cur_val_IndexLipSync = GetVariable("IndexLipSync") local cur_val_LipSyncBlend00 = GetVariable("LipSyncBlend00") local min_val_LipSyncBlend00 = 0 local max_val_LipSyncBlend00 = 1 local max_inc_LipSyncBlend00 = 2.5 local max_dec_LipSyncBlend00 = 10 if env(IsSpeaking) == FALSE then local set_val = ConvergeValue(min_val_LipSyncBlend00, cur_val_LipSyncBlend00, max_inc_LipSyncBlend00, max_dec_LipSyncBlend00) SetVariable("LipSyncBlend00", set_val) elseif cur_val_LipSyncBlend00 < max_val_LipSyncBlend00 then local set_val = ConvergeValue(max_val_LipSyncBlend00, cur_val_LipSyncBlend00, max_inc_LipSyncBlend00, max_dec_LipSyncBlend00) SetVariable("LipSyncBlend00", set_val) elseif env(IsAnimEnd, 2) == TRUE then local next_msg_value = GetNextIndexLipSync(ANIME_ID_GENERAL_LIP_SYNC, 0, 9, 1, 0, "IndexLipSync", false) SetVariable("IndexLipSync", next_msg_value) Fire("W_LipSync") end end function GetNextIndexLipSync(base_anim_id, min, max, offset, index_start, index_name, is_selectable_cur_index) local msg_array = {} local cur_index_val = GetVariable(index_name) local is_expect_cur_index = false local ret = INVALID for i = min, max, 1 do local anim_offset = i * offset local anim_id = base_anim_id + anim_offset if IsExistAnime(anim_id) == FALSE then elseif is_selectable_cur_index == false and cur_index_val == i + index_start then is_expect_cur_index = true else table.insert(msg_array, i + index_start) end end if #msg_array > 0 then local rand = math.random(1, #msg_array) ret = msg_array[rand] elseif is_expect_cur_index then ret = cur_index_val end return ret end function DamageBlend_NoAdd_onUpdate() SetVariable("BlendDamageDir", 0) end function NewDamageBlend_NoAdd_onUpdate() SetVariable("BlendNewDamageDir", 0) end function DamageMinimumSABlend_NoAdd_onUpdate() SetVariable("BlendDamageMinimumSA", 0) end function FireDamageBlend_NoAdd_onUpdate() SetVariable("BlendDamageFire", 0) end function NewFireDamageBlend_NoAdd_onUpdate() SetVariable("BlendNewDamageFire", 0) end function DamageSmallFrontFireBlend_NoAdd_onUpdate() SetVariable("BlendDamageSmallFrontFire", 0) end function DamageMiddleFrontFireBlend_NoAdd_onUpdate() SetVariable("BlendDamageMiddleFrontFire", 0) end function DamageLargeFrontFireBlend_NoAdd_onUpdate() SetVariable("BlendDamageLargeFrontFire", 0) end function ParallelMove_Update() local ret = nil local move_angle = GetVariable("MoveAngle") local move_angle_real = GetVariable("MoveAngleReal") local dT = env(ObtainedDT) / 1000 local threshold = 45 * dT local gap = move_angle - move_angle_real local gap_abs = math.abs(gap) local inverse = FALSE if gap_abs > 180 then gap_abs = 360 - gap_abs inverse = TRUE end if threshold < gap_abs then if move_angle_real < move_angle then if inverse == FALSE then ret = move_angle_real + threshold else ret = move_angle_real - threshold end elseif move_angle < move_angle_real then if inverse == FALSE then ret = move_angle_real - threshold else ret = move_angle_real + threshold end else ret = move_angle end if ret > 180 then ret = -180 + (ret - 180) elseif ret < -180 then ret = 180 + (180 + ret) end else ret = move_angle end SetVariable("MoveAngleReal", ret) SetParallelMoveTae(ret) end function ThrowAtk_Activate() SetVariable("ThrowHoldBlendWeight", 0) SetVariable("ThrowHolding", false) SetVariable("ThrowNoRegistTime", 0) end function ThrowAtk_Update() if IsExistAnime(GetVariable("ThrowID") + 3) == FALSE then return end local regist_num = env(GetThrowDefenseCount) local dT = env(ObtainedDT) / 1000 local blend_weight = GetVariable("ThrowHoldBlendWeight") local is_holding = GetVariable("ThrowHolding") local no_regist_time = GetVariable("ThrowNoRegistTime") if regist_num > 0 then is_holding = true end if is_holding == true then if regist_num <= 0 then no_regist_time = no_regist_time + dT end if no_regist_time > 0.699999988079071 then is_holding = false else blend_weight = blend_weight + 2 * dT if blend_weight > 0.9900000095367432 then blend_weight = 0.9900000095367432 end SetVariable("IsEnableTAEThrowHold", true) end else no_regist_time = 0 blend_weight = blend_weight - 4 * dT if blend_weight < 0.009999999776482582 then blend_weight = 0.009999999776482582 SetVariable("IsEnableTAEThrowHold", false) else SetVariable("IsEnableTAEThrowHold", true) end end SetVariable("ThrowHoldBlendWeight", blend_weight) SetVariable("ThrowHolding", is_holding) SetVariable("ThrowNoRegistTime", no_regist_time) end function JumpCommonFunction(style) if ExecPassiveTransition(JUDGE_FALL_TYPE_DEFAULT, FALSE, FALSE, FALSE) == TRUE then return TRUE end if ExecTransToDefaultFromBattle(TRUE, FALSE) == TRUE then return TRUE end if ExecActiveTransition(TRUE, style, MOVE_TYPE_NONE, FALSE) == TRUE then return TRUE end return FALSE end function Jump_onActivate() act(AIJumpState) end function Jump_onUpdate() act(AIJumpState) if JumpCommonFunction(STYLE_DEFAULT) == TRUE then return end end function JumpDamage_Start_onUpdate() if env(IsAnimEnd, 1) == TRUE then Fire("W_JumpDamage_Loop") return end if env(GetSpEffectID, 98) == TRUE and env(IsLanding) == TRUE then Fire("W_JumpDamage_Land") return end end function JumpDamage_Loop_onUpdate() act(DenyEventAnimPlaybackRequest) if env(IsHamariFallDeath, 12) == TRUE then Fire("W_JumpDamage_Land") return end if env(IsLanding) == TRUE then Fire("W_JumpDamage_Land") return end end function JumpDamage_Land_onUpdate() act(DenyEventAnimPlaybackRequest) if LandCommonFunction() == TRUE then return end 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 function Ride_Activate() act(DebugLogOutput, "Ride_Activate") end function Ride_Deactivate() act(DebugLogOutput, "Ride_Deactivate") end function Ride_Enemy_Activate() act(DebugLogOutput, "Ride_Enemy_Activate") end function Ride_Enemy_Deactivate() act(DebugLogOutput, "Ride_Enemy_Deactivate") act(Dismount) end function Ridden_Enemy_Activate() act(DebugLogOutput, "Ridden_Enemy_Activate") end function Ridden_Enemy_Deactivate() act(DebugLogOutput, "Ridden_Enemy_Deactivate") act(Dismount) end function ExecRide() if env(IsMount) == FALSE and (env(GetAIActionType) == 90000 or env(GetAIAtkCancelType) == 90000 or env(GetAIChainStepType) == 90000) then act(Mounting) end return FALSE end function FireRideEvent(upper_event, lower_event, lower_only) if lower_only == TRUE then act(PlayRideAnim, lower_event) else Fire(upper_event) act(PlayRideAnim, lower_event) end end function IsExistRideAnime(id) if env(DoesAnimExist, id) == TRUE and env(GetMountDamageAnimID, id) == TRUE then return TRUE else return FALSE end end function SetRideIdleType(idle_type) if idle_type == AI_STATE_DEFAULT then if IsExistRideAnime(ANIME_ID_IDLE_DEFAULT) == TRUE then SetVariable("IndexAiState", AI_STATE_DEFAULT) act(ApplyRideBlend, "IndexAiState", AI_STATE_DEFAULT) else SetVariable("IndexAiState", AI_STATE_BATTLE) act(ApplyRideBlend, "IndexAiState", AI_STATE_BATTLE) end else SetVariable("IndexAiState", AI_STATE_BATTLE) act(ApplyRideBlend, "IndexAiState", AI_STATE_BATTLE) end return end function IsRideDead() local hp_top = env(GetHP) local hp_under = env(IsMountDead) local height = env(GetMountFallHeight) / 100 if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH or hp_top <= 0 or env(GetMountRecievedDamageType) == DAMAGE_TYPE_DEATH or hp_under <= 0 then return TRUE end if env(IsMountInFallLoop) == TRUE and height > HEIGHT_FORCE_DEATH and env(GetStateChangeType, SP_EFFECT_TYPE_CAT_LANDING) == FALSE and env(GetMountSpEffectType, SP_EFFECT_TYPE_CAT_LANDING) == FALSE then return TRUE end if env(GetMountSpEffectID, 11840) == TRUE and hp_under <= 1 then return TRUE end if env(GetSpEffectID, 5723) == TRUE and env(GetSpEffectID, 5835) == TRUE then return TRUE end if env(GetSpEffectID, 12510) == TRUE and env(HasReceivedAnyDamage) == TRUE and env(GetSpEffectID, 14717) == FALSE then return TRUE end if hp_top <= 1 and env(GetSpEffectID, 12510) == FALSE and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE then return TRUE end return FALSE end function GetRideDeathType() local hp_top = env(GetHP) local hp_under = env(IsMountDead) local damage_level_top = env(GetDamageLevel) local damage_level_under = env(GetMountDamageLevel) local death_type = -1 local height = env(GetMountFallHeight) / 100 if env(IsMountInFallLoop) == TRUE and height > HEIGHT_FORCE_DEATH and env(GetStateChangeType, SP_EFFECT_TYPE_CAT_LANDING) == FALSE and env(GetMountSpEffectType, SP_EFFECT_TYPE_CAT_LANDING) == FALSE then death_type = DEATH_TYPE_RIDE_DEFAULT_BOTH elseif hp_top <= 0 and hp_under <= 0 then death_type = DEATH_TYPE_RIDE_DEFAULT_BOTH elseif hp_top <= 0 and hp_under <= 1 and env(GetMountSpEffectID, 11840) == TRUE then death_type = DEATH_TYPE_RIDE_DEFAULT_BOTH elseif hp_top <= 1 and hp_under <= 0 and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE then death_type = DEATH_TYPE_RIDE_DEFAULT_BOTH elseif env(GetIsWeakPoint) == TRUE and hp_top <= 0 then death_type = DEATH_TYPE_RIDE_WEAK_ONLY_TOP elseif env(GetSpecialAttribute) == DAMAGE_ELEMENT_FIRE and hp_top <= 0 then death_type = DEATH_TYPE_RIDE_FIRE_ONLY_TOP elseif hp_under >= 1 and env(GetMountSpEffectID, 11840) == FALSE then death_type = DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP elseif hp_under > 1 and env(GetMountSpEffectID, 11840) == TRUE then death_type = DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP elseif hp_top >= 1 then death_type = DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER elseif hp_top > 1 and env(GetSpEffectID, SP_EFFECT_DOSOU_SKELETON_NO_DEAD) == TRUE then death_type = DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER else death_type = DEATH_TYPE_RIDE_DEFAULT_BOTH end return death_type end function ExecRideDeath() if IsRideDead() == FALSE then return FALSE end local death_type = GetRideDeathType() local anim_id_top = -1 local anim_id_under = -1 local event_top = "" local event_under = "" if death_type == DEATH_TYPE_RIDE_DEFAULT_BOTH then anim_id_top = 10000 anim_id_under = 10000 event_top = "W_Ride_Enemy_Death" event_under = "W_Ridden_Enemy_Death" elseif death_type == DEATH_TYPE_RIDE_WEAK_ONLY_TOP then anim_id_top = ANIME_ID_RIDE_DEATH_WEAK anim_id_under = -1 event_top = "W_Ride_Enemy_WeakDeathOnlyTop" event_under = "W_Ridden_Enemy_WeakDeathOnlyTop" elseif death_type == DEATH_TYPE_RIDE_FIRE_ONLY_TOP then anim_id_top = ANIME_ID_RIDE_DEATH_FIRE anim_id_under = -1 event_top = "W_Ride_Enemy_FireDeathOnlyTop" event_under = "W_Ridden_Enemy_FireDeathOnlyTop" elseif death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP then anim_id_top = ANIME_ID_RIDE_DEATH_DEFAULT_TOP anim_id_under = -1 event_top = "W_Ride_Enemy_DeathOnlyTop" event_under = "W_Ridden_Enemy_DeathOnlyTop" elseif death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER then anim_id_top = -1 anim_id_under = ANIME_ID_RIDE_DEATH_DEFAULT_UNDER event_top = "W_Ride_Enemy_DeathOnlyUnder" event_under = "W_Ridden_Enemy_DeathOnlyUnder" end if anim_id_top >= 0 and anim_id_under >= 0 then if IsExistRideAnime(anim_id_top) == FALSE then event_top = "W_Ride_Enemy_Death" event_under = "W_Ridden_Enemy_Death" death_type = DEATH_TYPE_RIDE_DEFAULT_BOTH end elseif anim_id_top >= 0 and anim_id_under == -1 then if IsExistRideAnime(anim_id_top) == FALSE then event_top = "W_Ride_Enemy_DeathOnlyTop" event_under = "W_Ridden_Enemy_DeathOnlyTop" death_type = DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP end elseif anim_id_top == -1 and anim_id_under >= 0 and IsExistRideAnime(anim_id_under) == FALSE then event_top = "W_Ride_Enemy_DeathOnlyUnder" event_under = "W_Ridden_Enemy_DeathOnlyUnder" death_type = DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER end Replanning() FireRideEvent(event_top, event_under, FALSE) return TRUE end function RideCommonFunction(ride_move_type) if GetVariable("MoveSpeedLevel") >= 0.8999999761581421 then SetVariable("Int16Variable00", 1) SetVariable("Int16Variable01", 1) else SetVariable("Int16Variable00", 0) SetVariable("Int16Variable01", 0) end if env(IsOnMount) == FALSE then Fire("W_Idle") return TRUE end return FALSE end function ExecPassiveRide(is_weak, enable_jump) if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if ExecRideDeath() == TRUE then return TRUE end if ExecRideDamage(is_weak) == TRUE then return TRUE end if ExecRideFallStart() == TRUE then return TRUE end if enable_jump == TRUE and env(IsAIJumpRequested) == TRUE then act(NotifyAIOfJumpState) FireRideEvent("W_Ride_Enemy_Jump", "W_Ridden_Enemy_Jump", FALSE) return TRUE end return FALSE end function ExecRideDamage(is_weak) local damage_level = env(GetDamageLevel) local damage_type = env(GetReceivedDamageType) local is_damaged = env(HasReceivedAnyDamage) local damage_direction = env(GetReceivedDamageDirection) local damage_level_under = env(GetMountDamageLevel) local damage_type_under = env(GetMountRecievedDamageType) local is_damaged_under = env(HasMountReceivedAnyDamage) local damage_direction_under = env(GetMountRecievedDamageAngle) local event_top = "" local event_under = "" if env(GetBehaviorID, BEH_IDENTIFIER_ROLLING) == TRUE or env(GetMountBehaviorID, BEH_IDENTIFIER_ROLLING) == TRUE then return FALSE end if damage_type >= DAMAGE_TYPE_GUARDED_BOUND and damage_type <= DAMAGE_TYPE_GUARDED_BOUND_ENEMY3 or damage_type >= DAMAGE_TYPE_WALL_ENEMY1 and damage_type <= DAMAGE_TYPE_MAP_BOUND or damage_type_under >= DAMAGE_TYPE_GUARDED_BOUND and damage_type_under <= DAMAGE_TYPE_GUARDED_BOUND_ENEMY3 or damage_type_under >= DAMAGE_TYPE_WALL_ENEMY1 and damage_type_under <= DAMAGE_TYPE_MAP_BOUND then return FALSE end if is_damaged == FALSE and is_damaged_under == FALSE and damage_level == DAMAGE_LEVEL_NONE and damage_level_under == DAMAGE_LEVEL_NONE and (damage_type == DAMAGE_TYPE_NONE or damage_type == DAMAGE_TYPE_WEAK_FRAME) and (damage_type_under == DAMAGE_TYPE_NONE or damage_type_under == DAMAGE_TYPE_WEAK_FRAME) and env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == FALSE and env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == FALSE and env(GetMountStatusEffect, STATUS_EFFECT_BLOOD) == FALSE and env(GetMountStatusEffect, STATUS_EFFECT_COLD) == FALSE then return FALSE end SetVariable("BlendRideEnemyDamageFire", 0) act(ApplyRideBlend, "BlendRiddenEnemyDamageFire", 0) SetVariable("BlendRideEnemySA", 0) act(ApplyRideBlend, "BlendRiddenEnemySA", 0) if (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and (damage_level == DAMAGE_LEVEL_NONE or damage_level == DAMAGE_LEVEL_MINIMUM or damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and env(GetSpEffectID, 89) == TRUE or (env(GetMountStatusEffect, STATUS_EFFECT_BLOOD) == TRUE or env(GetMountStatusEffect, STATUS_EFFECT_COLD) == TRUE) and (damage_level_under == DAMAGE_LEVEL_NONE or damage_level_under == DAMAGE_LEVEL_MINIMUM or damage_level_under == DAMAGE_LEVEL_SMALL or damage_level_under == DAMAGE_LEVEL_MIDDLE) and env(GetMountSpEffectID, 5890) == FALSE and env(GetMountSpEffectID, 5891) == FALSE and env(GetMountSpEffectID, 89) == TRUE then damage_level = DAMAGE_LEVEL_MIDDLE damage_level_under = DAMAGE_LEVEL_MIDDLE elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and damage_level == DAMAGE_LEVEL_NONE or (env(GetMountStatusEffect, STATUS_EFFECT_BLOOD) == TRUE or env(GetMountStatusEffect, STATUS_EFFECT_COLD) == TRUE) and env(GetMountSpEffectID, 5890) == FALSE and env(GetMountSpEffectID, 5891) == FALSE and damage_level_under == DAMAGE_LEVEL_NONE then damage_level = DAMAGE_LEVEL_MIDDLE damage_level_under = DAMAGE_LEVEL_MIDDLE elseif (env(GetDamageSpecialAttribute, STATUS_EFFECT_BLOOD) == TRUE or env(GetDamageSpecialAttribute, STATUS_EFFECT_COLD) == TRUE) and env(GetSpEffectID, 5890) == FALSE and env(GetSpEffectID, 5891) == FALSE and (damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_PUSH or damage_level == DAMAGE_LEVEL_MINIMUM) or (env(GetMountStatusEffect, STATUS_EFFECT_BLOOD) == TRUE or env(GetMountStatusEffect, STATUS_EFFECT_COLD) == TRUE) and env(GetMountSpEffectID, 5890) == FALSE and env(GetMountSpEffectID, 5891) == FALSE and (damage_level_under == DAMAGE_LEVEL_SMALL or damage_level_under == DAMAGE_LEVEL_MIDDLE or damage_level_under == DAMAGE_LEVEL_PUSH or damage_level_under == DAMAGE_LEVEL_MINIMUM) then damage_level = DAMAGE_LEVEL_LARGE damage_level_under = DAMAGE_LEVEL_LARGE end if env(GetSpEffectID, 89) == TRUE or env(GetMountSpEffectID, 89) == TRUE then if env(IsDamageMotionOff) == FALSE and ExecRideSaBreakDamage(damage_level, damage_level_under, is_damaged, is_damaged_under) == TRUE then act(RequestAIJumpInterupt) return TRUE end if damage_level == DAMAGE_LEVEL_LARGE_BLOW or 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 or damage_level_under == DAMAGE_LEVEL_LARGE_BLOW or damage_level_under == DAMAGE_LEVEL_LARGE or damage_level_under == DAMAGE_LEVEL_PUSH or damage_level_under == DAMAGE_LEVEL_FLING 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 or env(GetMountIsWeakPoint) == TRUE then if IsExistRideAnime(ANIME_ID_JUMP_DAMAGE_SMALL) == TRUE then act(RequestAIJumpInterupt) act(ApplyDamageFlag, DAMAGE_FLAG_MIDDLE) Replanning() FireRideEvent("W_Ride_Enemy_JumpDamage_Start", "W_Ridden_Enemy_JumpDamage_Start", FALSE) return TRUE else local index = 0 SetVariable("IndexRideEnemySARandom", index) act(ApplyRideBlend, "IndexRiddenEnemySARandom", index) FireRideEvent("W_Ride_Enemy_SABlend_Add", "W_Ridden_Enemy_SABlend_Add", FALSE) SetVariable("BlendRideEnemySA", 1) act(ApplyRideBlend, "BlendRiddenEnemySA", 1) return TRUE end elseif damage_level == DAMAGE_LEVEL_MIDDLE or damage_level == DAMAGE_LEVEL_SMALL or damage_level == DAMAGE_LEVEL_MINIMUM or damage_level == DAMAGE_LEVEL_NONE or damage_level_under == DAMAGE_LEVEL_MIDDLE or damage_level_under == DAMAGE_LEVEL_SMALL or damage_level_under == DAMAGE_LEVEL_MINIMUM or damage_level_under == DAMAGE_LEVEL_NONE then local index = 0 SetVariable("IndexRideEnemySARandom", index) act(ApplyRideBlend, "IndexRiddenEnemySARandom", index) FireRideEvent("W_Ride_Enemy_SABlend_Add", "W_Ridden_Enemy_SABlend_Add", FALSE) SetVariable("BlendRideEnemySA", 1) act(ApplyRideBlend, "BlendRiddenEnemySA", 1) return TRUE end end if env(IsDamageMotionOff) == FALSE then if ExecRideSaBreakDamage(damage_level, damage_level_under, is_damaged, is_damaged_under) == TRUE then return TRUE end if is_weak == FALSE and ExecRideWeakDamage() == TRUE then return TRUE end end if damage_level == DAMAGE_LEVEL_LARGE_BLOW 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_LARGE_BLOW 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 if damage_direction == DIRECTION_FORWARD or damage_direction_under == DIRECTION_FORWARD then SetVariable("IndexRideEnemyDamageDirection", DIRECTION_FORWARD) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_FORWARD) elseif damage_direction == DIRECTION_BACK or damage_direction_under == DIRECTION_BACK then SetVariable("IndexRideEnemyDamageDirection", DIRECTION_BACK) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_BACK) elseif damage_direction == DIRECTION_LEFT or damage_direction_under == DIRECTION_LEFT then SetVariable("IndexRideEnemyDamageDirection", DIRECTION_LEFT) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_LEFT) elseif damage_direction == DIRECTION_RIGHT or damage_direction_under == DIRECTION_RIGHT then SetVariable("IndexRideEnemyDamageDirection", DIRECTION_RIGHT) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_RIGHT) end act(ApplyDamageFlag, DAMAGE_FLAG_LARGE_BLOW) Replanning() FireRideEvent("W_Ride_Enemy_DamageExLarge", "W_Ridden_Enemy_DamageExLarge", FALSE) return TRUE elseif ExecRideTypeDamage(damage_type, damage_type_under) == TRUE then 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("BlendRideEnemyDamageFire", 1) act(ApplyRideBlend, "BlendRiddenEnemyDamageFire", 1) SetVariable("IndexRideEnemyFireDamageVariation", 0) act(ApplyRideBlend, "IndexRiddenEnemyFireDamageVariation", 0) FireRideEvent("W_Ride_Enemy_FireMiddleDamageBlend_Add", "W_Ridden_Enemy_FireMiddleDamageBlend_Add", FALSE) end SetVariable("IndexRideEnemyDamageDirection", DIRECTION_FORWARD) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_FORWARD) SetVariable("RideEnemyDamageDefaultState", 2) act(ApplyRideBlend, "RiddenEnemyDamageDefaultState", 2) act(ApplyDamageFlag, DAMAGE_FLAG_LARGE) Replanning() FireRideEvent("W_Ride_Enemy_DamageLarge", "W_Ridden_Enemy_DamageLarge", FALSE) 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("BlendRideEnemyDamageFire", 1) act(ApplyRideBlend, "BlendRiddenEnemyDamageFire", 1) SetVariable("IndexRideEnemyFireDamageVariation", 0) act(ApplyRideBlend, "IndexRiddenEnemyFireDamageVariation", 0) FireRideEvent("W_Ride_Enemy_FireMiddleDamageBlend_Add", "W_Ridden_Enemy_FireMiddleDamageBlend_Add", FALSE) end SetVariable("IndexRideEnemyDamageDirection", DIRECTION_FORWARD) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_FORWARD) SetVariable("RideEnemyDamageDefaultState", 1) act(ApplyRideBlend, "RiddenEnemyDamageDefaultState", 1) act(ApplyDamageFlag, DAMAGE_FLAG_MIDDLE) Replanning() FireRideEvent("W_Ride_Enemy_DamageMiddle", "W_Ridden_Enemy_DamageMiddle", FALSE) 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("BlendRideEnemyDamageFire", 1) act(ApplyRideBlend, "BlendRiddenEnemyDamageFire", 1) SetVariable("IndexRideEnemyFireDamageVariation", 0) act(ApplyRideBlend, "IndexRiddenEnemyFireDamageVariation", 0) FireRideEvent("W_Ride_Enemy_FireSmallDamageBlend_Add", "W_Ridden_Enemy_FireSmallDamageBlend_Add", FALSE) end SetVariable("IndexRideEnemyDamageDirection", DIRECTION_FORWARD) act(ApplyRideBlend, "IndexRiddenEnemyDamageDirection", DIRECTION_FORWARD) SetVariable("RideEnemyDamageDefaultState", 0) act(ApplyRideBlend, "RiddenEnemyDamageDefaultState", 0) act(ApplyDamageFlag, DAMAGE_FLAG_SMALL) Replanning() FireRideEvent("W_Ride_Enemy_DamageSmall", "W_Ridden_Enemy_DamageSmall", FALSE) 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("IndexRideEnemySARandom", index) act(ApplyRideBlend, "IndexRiddenEnemySARandom", index) FireRideEvent("W_Ride_Enemy_SABlend_Add", "W_Ridden_Enemy_SABlend_Add", FALSE) SetVariable("BlendRideEnemySA", 1) act(ApplyRideBlend, "BlendRiddenEnemySA", 1) end return FALSE end function ExecRideTypeDamage(damage_type, damage_type_under) if damage_type == DAMAGE_TYPE_PARRY or damage_type_under == DAMAGE_TYPE_PARRY or damage_type >= DAMAGE_TYPE_PARRY_ENEMY1 and damage_type <= DAMAGE_TYPE_PARRY_ENEMY3 or damage_type_under >= DAMAGE_TYPE_PARRY_ENEMY1 and damage_type_under <= DAMAGE_TYPE_PARRY_ENEMY3 then if damage_type == DAMAGE_TYPE_PARRY_ENEMY2 or damage_type_under == DAMAGE_TYPE_PARRY_ENEMY2 then if IsExistRideAnime(ANIME_ID_PARRY_DAMAGE_ENEMY2) == TRUE then FireRideEvent("W_Ride_Enemy_DamageParryEnemy2", "W_Ridden_Enemy_DamageParryEnemy2", FALSE) else FireRideEvent("W_Ride_Enemy_DamageParryEnemy1", "W_Ridden_Enemy_DamageParryEnemy1", FALSE) end elseif IsExistRideAnime(ANIME_ID_PARRY_DAMAGE_ENEMY1) == TRUE then FireRideEvent("W_Ride_Enemy_DamageParryEnemy1", "W_Ridden_Enemy_DamageParryEnemy1", FALSE) else FireRideEvent("W_Ride_Enemy_DamageParryEnemy2", "W_Ridden_Enemy_DamageParryEnemy2", FALSE) end Replanning() return TRUE end return FALSE end function ExecRideSaBreakDamage(damage_level, damage_level_under, is_damaged, is_damaged_under) if env(HasBrokenSA) == TRUE then if IsExistRideAnime(ANIME_ID_RIDE_DAMAGE_FALL_BACK) == TRUE then Replanning() FireRideEvent("W_Ride_Enemy_DamageBackFall", "W_Ridden_Enemy_DamageBackFall", FALSE) return TRUE else Replanning() FireRideEvent("W_Ride_Enemy_Damage_Fall", "W_Ridden_Enemy_Damage_Fall", FALSE) return TRUE end end return FALSE end function ExecRideWeakDamage() if env(GetIsWeakPoint) == TRUE then if env(DoesAnimExist, ANIME_ID_DAMAGE_WEAK) == TRUE and env(GetMountDamageAnimID, ANIME_ID_DAMAGE_WEAK_UNDER) == TRUE then act(ApplyDamageFlag, DAMAGE_FLAG_WEAK) Replanning() FireRideEvent("W_Ride_Enemy_DamageWeakTop", "W_Ridden_Enemy_DamageWeakTop", FALSE) return TRUE end elseif env(GetMountIsWeakPoint) == TRUE and env(DoesAnimExist, ANIME_ID_DAMAGE_WEAK_UNDER) == TRUE and env(GetMountDamageAnimID, ANIME_ID_DAMAGE_WEAK) == TRUE then act(ApplyDamageFlag, DAMAGE_FLAG_WEAK) Replanning() FireRideEvent("W_Ride_Enemy_DamageWeakUnder", "W_Ridden_Enemy_DamageWeakUnder", FALSE) return TRUE end return FALSE end function ExecRideSleepResist(is_on_cancel) if is_on_cancel == TRUE and env(GetAIChainActionType) <= 0 and env(GetAIAtkCancelType) <= 0 and env(GetAIChainStepType) <= 0 and env(IsMoveCancelPossible) == FALSE then return FALSE end if (env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE or env(GetMountStateInfo, SP_EFFECT_TYPE_SLEEP) == TRUE) and IsNodeActive("Ride_Enemy_Sleep_Resist_CMSG") == FALSE and env(IsDamageMotionOff) == FALSE and env(IsMountInFallLoop) == TRUE and env(GetSpEffectID, 5852) == FALSE and env(GetSpEffectID, 5853) == FALSE and env(GetMountSpEffectID, 5852) == FALSE and env(GetMountSpEffectID, 5853) == FALSE and IsExistRideAnime(ANIME_ID_SLEEP_RESIST) == TRUE then act(RequestAIJumpInterupt) Replanning() FireRideEvent("W_Ride_Enemy_Sleep_Resist", "W_Ridden_Enemy_Sleep_Resist", FALSE) return TRUE end return FALSE end function RideRequestFunction(is_on_cancel, move_type, enable_turn, lower_only) local anim_id = -1 local direction_num = -1 local state_num = -1 if env(IsOnMount) == TRUE then if ExecRideSleepResist(is_on_cancel) == TRUE then return TRUE end if env(GetAIActionType) == 90010 then if env(GetMountReceivedDamageDirection, 2) == TRUE and IsExistRideAnime(15102) == TRUE then direction_num = 0 elseif env(GetMountReceivedDamageDirection, 3) == TRUE and IsExistRideAnime(15103) == TRUE then direction_num = 1 elseif env(GetMountReceivedDamageDirection, 1) == TRUE and IsExistRideAnime(15101) == TRUE then direction_num = 2 end if env(GetSpEffectID, 5227) == TRUE then direction_num = 0 elseif env(GetSpEffectID, 5226) == TRUE then direction_num = 1 elseif env(GetSpEffectID, 5225) == TRUE then direction_num = 2 end if direction_num == 0 then anim_id = 15102 state_num = 0 if env(GetSpEffectID, 5012) == TRUE and env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE and IsExistRideAnime(15112) == TRUE then anim_id = 15112 state_num = 1 end elseif direction_num == 1 then anim_id = 15103 state_num = 0 if env(GetSpEffectID, 5012) == TRUE and env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE and IsExistRideAnime(15113) == TRUE then anim_id = 15113 state_num = 1 end elseif direction_num == 2 then anim_id = 15101 state_num = 0 if env(GetSpEffectID, 5012) == TRUE and env(GetSpEffectType, SP_EFFECT_TYPE_SLEEP) == TRUE and IsExistRideAnime(15111) == TRUE then anim_id = 15111 state_num = 1 end end if direction_num >= 0 then SetVariable("IndexRideOff", direction_num) act(ApplyRideBlend, "IndexRiddenOff", direction_num) SetVariable("IndexRideOff_Anim", state_num) act(ApplyRideBlend, "IndexRiddenOff_Anim", state_num) FireRideEvent("W_Ride_Enemy_Off", "W_Ridden_Enemy_Off", FALSE) return TRUE end end if is_on_cancel == TRUE then if ExecRideAICancelAction(STYLE_DEFAULT) == TRUE then return TRUE end elseif ExecRideAIAction(STYLE_DEFAULT) == TRUE then return TRUE end if enable_turn == TRUE and ExecRideTurn(is_on_cancel) == TRUE then return TRUE end if ExecRideMove(move_type, is_on_cancel) == TRUE then return TRUE end else act(Dismount) Fire("W_Idle") return TRUE end return FALSE end function ExecRideTurn(is_on_cancel) if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end local turn_angle = GetVariable("TurnAngle") if math.abs(turn_angle) <= 0 then return FALSE end local is_emergency_turn = env(IsEmergencyQuickTurnActivated) if math.abs(turn_angle) < 45 and is_emergency_turn == FALSE then return FALSE end if env(GetSpEffectID, 5841) == TRUE or env(GetSpEffectID, 5843) == TRUE then return FALSE end if env(GetSpEffectID, 5840) == TRUE and math.abs(turn_angle) < 135 then return FALSE end local dir = INVALID local correction_factor = 0 if math.abs(turn_angle) < 135 then if turn_angle < 0 then dir = INDEX_TURN_DIRECTION_LEFT90 else dir = INDEX_TURN_DIRECTION_RIGHT90 end correction_factor = 90 else if turn_angle < 0 then dir = INDEX_TURN_DIRECTION_LEFT180 else dir = INDEX_TURN_DIRECTION_RIGHT180 end correction_factor = 180 end if GetVariable("MoveSpeedLevel") >= 0.8999999761581421 then SetVariable("Int16Variable01", 1) else SetVariable("Int16Variable01", 0) end local buff = {} local ai_rec = env(GetAITargetAwareState) if ai_rec > AI_RECOGNITION_NONE then buff[1] = INDEX_TURN_BATTLE buff[2] = INDEX_TURN_DEFAULT else buff[1] = INDEX_TURN_DEFAULT buff[2] = INDEX_TURN_BATTLE end local turn_index = INVALID for i = 1, #buff, 1 do local anim = ANIME_ID_TURN + buff[i] * 10 + dir if IsExistRideAnime(anim) == TRUE then turn_index = buff[i] break end end if turn_index >= 0 then act(SetTurnAnimCorrectionRate, correction_factor) act(SetIsTurnAnimInProgress) local event_top = "W_Ride_Enemy_Turn" local event_under = "W_Ridden_Enemy_Turn" local ai_state = AI_STATE_BATTLE if turn_index == INDEX_TURN_BATTLE then event_top = event_top .. "Battle" event_under = event_under .. "Battle" else event_top = event_top .. "Default" event_under = event_under .. "Default" ai_state = AI_STATE_DEFAULT end SetRideIdleType(ai_state) if dir == INDEX_TURN_DIRECTION_LEFT90 then event_top = event_top .. "_Left90" event_under = event_under .. "_Left90" elseif dir == INDEX_TURN_DIRECTION_RIGHT90 then event_top = event_top .. "_Right90" event_under = event_under .. "_Right90" elseif dir == INDEX_TURN_DIRECTION_LEFT180 then event_top = event_top .. "_Left180" event_under = event_under .. "_Left180" elseif dir == INDEX_TURN_DIRECTION_RIGHT180 then event_top = event_top .. "_Right180" event_under = event_under .. "_Right180" end FireRideEvent(event_top, event_under, FALSE) return TRUE end return FALSE end function ExecRideMove(move_type, is_on_cancel) local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level <= 0 then return FALSE end if is_on_cancel == TRUE and env(IsMoveCancelPossible) == FALSE then return FALSE end local move_dir = GetMoveDir(move_speed_level) if move_type == move_dir then return FALSE end local ai_rec = env(GetAITargetAwareState) local ai_state = AI_STATE_DEFAULT if ai_rec > AI_RECOGNITION_NONE then ai_state = AI_STATE_BATTLE end local event_top = "" local event_under = "" local move_table = {} local j = move_dir if ai_state == AI_STATE_BATTLE then move_table[1] = move_table_ride_battle[j] if move_dir == MOVE_TYPE_RUN then move_table[2] = move_table_ride_battle[MOVE_TYPE_WALK_FRONT] end elseif move_dir == MOVE_TYPE_RUN then move_table[1] = move_table_ride_default[j] move_table[2] = move_table_ride_battle[j] move_table[3] = move_table_ride_default[MOVE_TYPE_WALK_FRONT] move_table[4] = move_table_ride_battle[MOVE_TYPE_WALK_FRONT] else move_table[1] = move_table_ride_default[MOVE_TYPE_WALK_FRONT] move_table[2] = move_table_ride_battle[MOVE_TYPE_WALK_FRONT] end local hit_move_type = MOVE_TYPE_NONE for i = 1, #move_table, 1 do if IsExistRideAnime(move_table[i][1]) == TRUE then event_top = move_table[i][2] event_under = move_table[i][3] hit_move_type = move_table[i][4] break end end if hit_move_type == MOVE_TYPE_NONE then return FALSE end if hit_move_type == move_type then return FALSE end SetRideIdleType(ai_state) FireRideEvent(event_top, event_under, FALSE) return TRUE end function ExecRideStop() local move_speed_level = GetVariable("MoveSpeedLevel") if move_speed_level > 0 then return FALSE end local action_type = env(GetAIActionType) local event_top = "W_Ride_Enemy_Idle" local event_under = "W_Ridden_Enemy_Idle" FireRideEvent(event_top, event_under, FALSE) return TRUE end function ExecRideAIAction(style) local action_type = env(GetAIActionType) if action_type <= 0 then if style == STYLE_DEFAULT then return FALSE else if style == STYLE_GUARD then Fire("W_GuardEnd") elseif style == STYLE_PARRY then Fire("W_ParryEnd") end return TRUE end end if ExecRideAIStep(action_type) == TRUE then return TRUE end if ExecRideAIAttack(action_type) == TRUE then return TRUE end return FALSE end function ExecRideAICancelAction(style) local action_type_atk = INVALID local action_type = INVALID local action_type_combo = env(GetAIChainActionType) local action_type_cancel = env(GetAIAtkCancelType) local action_type_step = env(GetAIChainStepType) if action_type_combo > 0 then action_type_atk = action_type_combo action_type = action_type_combo elseif action_type_cancel > 0 then action_type_atk = action_type_cancel action_type = action_type_cancel elseif action_type_step > 0 then action_type = action_type_step else return FALSE end if ExecRideAIStep(action_type_step) == TRUE then return TRUE end if ExecRideAIAttack(action_type_atk) == TRUE then return TRUE end return FALSE end function ExecRideAIAttack(action_type) if ANIME_ID_ATTACK_BEGIN <= action_type and action_type <= ANIME_ID_ATTACK_END then ExecRideAttack(action_type) return TRUE end return FALSE end function ExecRideAIStep(action_type) if ANIME_ID_STEP_BEGIN <= action_type and action_type <= ANIME_ID_STEP_END or action_type >= ANIME_ID_STEP2_BEGIN and action_type <= ANIME_ID_STEP2_END or action_type >= ANIME_ID_STEP3_BEGIN and action_type <= ANIME_ID_STEP3_END then ExecRideStep(action_type) return TRUE end return FALSE end function ExecRideAttack(action_number) FireRideEvent("W_Ride_Enemy_Attack" .. action_number, "W_Ridden_Enemy_Attack" .. action_number, FALSE) end function ExecRideStep(action_number) FireRideEvent("W_Ride_Enemy_Step" .. action_number, "W_Ridden_Enemy_Step" .. action_number, FALSE) end function RideIdleCommonFunction(style) if ExecRideAIStateChange() == TRUE then return TRUE end return FALSE end function RideMoveCommonFunction(style, move_type) if ExecRideAIStateChange() == TRUE then return TRUE end if ExecRideStop() == TRUE then return TRUE end return FALSE end function ExecRideAIStateChange() local cur_ai_state = env(GetAITargetAwareState) local pre_ai_state = env(GetAITargetAwareStatePreviousFrame) if cur_ai_state > AI_RECOGNITION_NONE then cur_ai_state = AI_STATE_BATTLE elseif IsExistRideAnime(ANIME_ID_IDLE_DEFAULT) == TRUE then cur_ai_state = AI_STATE_DEFAULT else cur_ai_state = AI_STATE_BATTLE end if cur_ai_state == GetVariable("IndexAiState") then return FALSE end SetRideIdleType(cur_ai_state) if cur_ai_state == AI_STATE_DEFAULT then if IsExistRideAnime(ANIME_ID_TRANS_BATTLE_DEFAULT) == TRUE then FireRideEvent("W_Ride_Enemy_TransToDefaultFromBattle", "W_Ridden_Enemy_TransToDefaultFromBattle", FALSE) return TRUE end elseif IsExistRideAnime(ANIME_ID_TRANS_DEFAULT_BATTLE) == TRUE then FireRideEvent("W_Ride_Enemy_TransToBattleFromDefault", "W_Ridden_Enemy_TransToBattleFromDefault", FALSE) return TRUE end return FALSE end function TransRideIdleCommonFunction() if ExecPassiveRide(FALSE, TRUE) == TRUE then return TRUE end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return TRUE end return FALSE end function Ride_Enemy_Adjust_onUpdate() if env(IsMovingOnMount) == TRUE then FireRideEvent("W_Ride_Enemy_On", "W_Ridden_Enemy_On", FALSE) return TRUE elseif env(IsIdleOnMount) == TRUE then Fire("W_Idle") return TRUE end end function Ride_Enemy_On_onActivate() CallActionState(90000) end function Ride_Enemy_On_onUpdate() CallActionState(90000) if env(GetSpEffectID, 5410) == TRUE then if ExecPassiveRide(FALSE, FALSE) == TRUE then return TRUE end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE else end end end function Ride_Enemy_Off_onActivate() CallActionState(90010) end function Ride_Enemy_Off_onUpdate() if env(IsSummoningRide) == TRUE then elseif env(IsOnMount) == TRUE then act(Dismount) end if env(GetSpEffectID, 5410) == TRUE then else if AttackCommonFunction(90010, STYLE_DEFAULT, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_Idle_onActivate() act(Wait) end function Ride_Enemy_Idle_onUpdate() act(Wait) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if RideIdleCommonFunction(STYLE_DEFAULT) == TRUE then return end end function Ride_Enemy_IdleBattle_onActivate() act(Wait) end function Ride_Enemy_IdleBattle_onUpdate() act(Wait) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return TRUE end if RideIdleCommonFunction(STYLE_DEFAULT) == TRUE then return TRUE end end function Ride_Enemy_TransToDefaultFromBattle_onUpdate() if TransRideIdleCommonFunction() == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_TransToBattleFromDefault_onUpdate() if TransRideIdleCommonFunction() == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Walk_onUpdate() act(Wait) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, RIDE_MOVE_TYPE_WALK, FALSE, FALSE) == TRUE then return end end function Ride_Enemy_Run_onUpdate() act(Wait) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, RIDE_MOVE_TYPE_RUN, FALSE, FALSE) == TRUE then return end end function Ride_Enemy_Dash_onUpdate() act(Wait) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, RIDE_MOVE_TYPE_DASH, FALSE, FALSE) == TRUE then return end end function Ride_Enemy_Gallop_onUpdate() act(Wait) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, RIDE_MOVE_TYPE_GALLOP, FALSE, FALSE) == TRUE then return end end function Ride_Enemy_RunBattle_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_RUN, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_RUN) == TRUE then return end end function Ride_Enemy_WalkFrontBattle_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_WALK_FRONT, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_FRONT) == TRUE then return end end function Ride_Enemy_WalkBackBattle_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_WALK_BACK, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_BACK) == TRUE then return end end function Ride_Enemy_WalkLeftBattle_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_WALK_LEFT, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_LEFT) == TRUE then return end end function Ride_Enemy_WalkRightBattle_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_WALK_RIGHT, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_RIGHT) == TRUE then return end end function Ride_Enemy_RunDefault_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_RUN, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_RUN) == TRUE then return end end function Ride_Enemy_WalkFrontDefault_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(FALSE, MOVE_TYPE_WALK_FRONT, FALSE, FALSE) == TRUE then return end if RideMoveCommonFunction(STYLE_DEFAULT, MOVE_TYPE_WALK_FRONT) == TRUE then return end end function Ride_Enemy_Attack3000_onActivate() CallActionState(3000) end function Ride_Enemy_Attack3000_onUpdate() CallActionState(3000) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3001_onActivate() CallActionState(3001) end function Ride_Enemy_Attack3001_onUpdate() CallActionState(3001) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3002_onActivate() CallActionState(3002) end function Ride_Enemy_Attack3002_onUpdate() CallActionState(3002) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3003_onActivate() CallActionState(3003) end function Ride_Enemy_Attack3003_onUpdate() CallActionState(3003) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3004_onActivate() CallActionState(3004) end function Ride_Enemy_Attack3004_onUpdate() CallActionState(3004) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3005_onActivate() CallActionState(3005) end function Ride_Enemy_Attack3005_onUpdate() CallActionState(3005) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3006_onActivate() CallActionState(3006) end function Ride_Enemy_Attack3006_onUpdate() CallActionState(3006) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3007_onActivate() CallActionState(3007) end function Ride_Enemy_Attack3007_onUpdate() CallActionState(3007) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3008_onActivate() CallActionState(3008) end function Ride_Enemy_Attack3008_onUpdate() CallActionState(3008) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3009_onActivate() CallActionState(3009) end function Ride_Enemy_Attack3009_onUpdate() CallActionState(3009) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3010_onActivate() CallActionState(3010) end function Ride_Enemy_Attack3010_onUpdate() CallActionState(3010) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3011_onActivate() CallActionState(3011) end function Ride_Enemy_Attack3011_onUpdate() CallActionState(3011) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3012_onActivate() CallActionState(3012) end function Ride_Enemy_Attack3012_onUpdate() CallActionState(3012) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3013_onActivate() CallActionState(3013) end function Ride_Enemy_Attack3013_onUpdate() CallActionState(3013) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3014_onActivate() CallActionState(3014) end function Ride_Enemy_Attack3014_onUpdate() CallActionState(3014) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3015_onActivate() CallActionState(3015) end function Ride_Enemy_Attack3015_onUpdate() CallActionState(3015) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3016_onActivate() CallActionState(3016) end function Ride_Enemy_Attack3016_onUpdate() CallActionState(3016) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3017_onActivate() CallActionState(3017) end function Ride_Enemy_Attack3017_onUpdate() CallActionState(3017) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3018_onActivate() CallActionState(3018) end function Ride_Enemy_Attack3018_onUpdate() CallActionState(3018) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3019_onActivate() CallActionState(3019) end function Ride_Enemy_Attack3019_onUpdate() CallActionState(3019) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3020_onActivate() CallActionState(3020) end function Ride_Enemy_Attack3020_onUpdate() CallActionState(3020) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3021_onActivate() CallActionState(3021) end function Ride_Enemy_Attack3021_onUpdate() CallActionState(3021) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3022_onActivate() CallActionState(3022) end function Ride_Enemy_Attack3022_onUpdate() CallActionState(3022) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3023_onActivate() CallActionState(3023) end function Ride_Enemy_Attack3023_onUpdate() CallActionState(3023) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3024_onActivate() CallActionState(3024) end function Ride_Enemy_Attack3024_onUpdate() CallActionState(3024) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3025_onActivate() CallActionState(3025) end function Ride_Enemy_Attack3025_onUpdate() CallActionState(3025) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3026_onActivate() CallActionState(3026) end function Ride_Enemy_Attack3026_onUpdate() CallActionState(3026) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3027_onActivate() CallActionState(3027) end function Ride_Enemy_Attack3027_onUpdate() CallActionState(3027) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3028_onActivate() CallActionState(3028) end function Ride_Enemy_Attack3028_onUpdate() CallActionState(3028) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3029_onActivate() CallActionState(3029) end function Ride_Enemy_Attack3029_onUpdate() CallActionState(3029) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3030_onActivate() CallActionState(3030) end function Ride_Enemy_Attack3030_onUpdate() CallActionState(3030) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3031_onActivate() CallActionState(3031) end function Ride_Enemy_Attack3031_onUpdate() CallActionState(3031) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3032_onActivate() CallActionState(3032) end function Ride_Enemy_Attack3032_onUpdate() CallActionState(3032) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3033_onActivate() CallActionState(3033) end function Ride_Enemy_Attack3033_onUpdate() CallActionState(3033) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3034_onActivate() CallActionState(3034) end function Ride_Enemy_Attack3034_onUpdate() CallActionState(3034) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3035_onActivate() CallActionState(3035) end function Ride_Enemy_Attack3035_onUpdate() CallActionState(3035) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3036_onActivate() CallActionState(3036) end function Ride_Enemy_Attack3036_onUpdate() CallActionState(3036) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3037_onActivate() CallActionState(3037) end function Ride_Enemy_Attack3037_onUpdate() CallActionState(3037) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3038_onActivate() CallActionState(3038) end function Ride_Enemy_Attack3038_onUpdate() CallActionState(3038) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Attack3039_onActivate() CallActionState(3039) end function Ride_Enemy_Attack3039_onUpdate() CallActionState(3039) if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_TurnDefault_Left180_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnDefault_Right180_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnDefault_Left90_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnDefault_Right90_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnBattle_Left180_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnBattle_Right180_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnBattle_Left90_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_TurnBattle_Right90_onUpdate() act(SetIsTurnAnimInProgress) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, FALSE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_Jump_onActivate() act(AIJumpState) end function Ride_Enemy_Jump_onUpdate() act(AIJumpState) if ExecPassiveRide(FALSE, FALSE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_Damage_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_DamageSmall_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Damage_M_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_DamageMiddle_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Damage_H_onUpdate() if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return TRUE end end function Ride_Enemy_DamageLarge_onUpdate() if env(GetSpEffectID, 5813) == TRUE then act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end else if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end end function Ride_Enemy_DamageExLarge_onUpdate() if env(GetSpEffectID, 5813) == TRUE then act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end else if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end end function Ride_Enemy_DamageWeakTop_onUpdate() if env(GetSpEffectID, 5813) == TRUE then act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end else if ExecPassiveRide(TRUE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end end function Ride_Enemy_DamageWeakUnder_onUpdate() if env(GetSpEffectID, 5813) == TRUE then act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end else if ExecPassiveRide(TRUE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end end function Ride_Enemy_Damage_Fall_onActivate() act(AddSpEffect, 5801) end function Ride_Enemy_Damage_Fall_onUpdate() act(AddSpEffect, 5801) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_DamageBackFall_onActivate() act(AddSpEffect, 5801) end function Ride_Enemy_DamageBackFall_onUpdate() act(AddSpEffect, 5801) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_Death_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_DEFAULT) == TRUE then return end end function Ride_Enemy_DeathOnlyTop_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP) == TRUE then return end end function Ride_Enemy_DeathOnlyUnder_onActivate() CallActionState(0) end function Ride_Enemy_DeathOnlyUnder_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_FireDeathOnlyTop_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_RIDE_FIRE_ONLY_TOP) == TRUE then return end end function Ride_Enemy_WeakDeathOnlyTop_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_RIDE_WEAK_ONLY_TOP) == TRUE then return end end function Ride_Enemy_ExLargeDeathOnlyTop_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_RIDE_EXLARGE_ONLY_TOP) == TRUE then return end end function Ride_Enemy_ExLargeDeathOnlyUnder_onActivate() CallActionState(0) end function Ride_Enemy_ExLargeDeathOnlyUnder_onUpdate() act(Dismount) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function Ride_Enemy_Fall_Start_onUpdate() if RideFallCommonFunction() == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Fall_Loop", "W_Ridden_Enemy_Fall_Loop", FALSE) return end end function Ride_Enemy_Fall_Loop_onUpdate() if RideFallCommonFunction() == TRUE then return end end function Ride_Enemy_Fall_Land_onUpdate() if RideLandCommonFunction() == TRUE then return end if env(MovementRequest) == TRUE and GetVariable("MoveSpeedLevel") > 0 and RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return end end function Ride_Enemy_Step6000_onActivate() CallActionState(6000) end function Ride_Enemy_Step6000_onUpdate() CallActionState(6000) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6001_onActivate() CallActionState(6001) end function Ride_Enemy_Step6001_onUpdate() CallActionState(6001) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6002_onActivate() CallActionState(6002) end function Ride_Enemy_Step6002_onUpdate() CallActionState(6002) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6003_onActivate() CallActionState(6003) end function Ride_Enemy_Step6003_onUpdate() CallActionState(6003) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6010_onActivate() CallActionState(6010) end function Ride_Enemy_Step6010_onUpdate() CallActionState(6010) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6011_onActivate() CallActionState(6011) end function Ride_Enemy_Step6011_onUpdate() CallActionState(6011) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6012_onActivate() CallActionState(6012) end function Ride_Enemy_Step6012_onUpdate() CallActionState(6012) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6013_onActivate() CallActionState(6013) end function Ride_Enemy_Step6013_onUpdate() CallActionState(6013) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6020_onActivate() CallActionState(6020) end function Ride_Enemy_Step6020_onUpdate() CallActionState(6020) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6021_onActivate() CallActionState(6021) end function Ride_Enemy_Step6021_onUpdate() CallActionState(6021) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6022_onActivate() CallActionState(6022) end function Ride_Enemy_Step6022_onUpdate() CallActionState(6022) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_Step6023_onActivate() CallActionState(6023) end function Ride_Enemy_Step6023_onUpdate() CallActionState(6023) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if ExecPassiveRide(FALSE, TRUE) == TRUE then return end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_SABlend_NoAdd_onUpdate() SetVariable("BlendRideEnemySA", 0) act(ApplyRideBlend, "BlendRiddenEnemySA", 0) end function Ride_Enemy_FireDamageBlend_NoAdd_onUpdate() SetVariable("BlendRideEnemyDamageFire", 0) act(ApplyRideBlend, "BlendRiddenEnemyDamageFire", 0) end function Ridden_Enemy_On_onUpdate() if env(IsAnimEnd, 1) == TRUE and env(IsOnMount) == FALSE then Fire("W_Idle") return TRUE end end function Ridden_Enemy_Off_onUpdate() act(AllowMounting) if env(IsOnMount) == FALSE then if TransStyleCommonFunction(STYLE_DEFAULT) == TRUE then return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_Idle_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_IDLE) == TRUE then return TRUE end end function Ridden_Enemy_IdleBattle_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_IDLE) == TRUE then return TRUE end end function Ridden_Enemy_Walk_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_WALK) then return TRUE end end function Ridden_Enemy_Run_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_RUN) then return TRUE end end function Ridden_Enemy_Dash_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_DASH) then return TRUE end end function Ridden_Enemy_Gallop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_GALLOP) then return TRUE end end function Ridden_Enemy_Gallop_End_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_WALK) and env(IsAnimEnd, 1) == TRUE then return TRUE end end function Ridden_Enemy_TurnDefault_Left180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_Idle") return TRUE end end function Ridden_Enemy_TurnDefault_Right180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_Idle") return TRUE end end function Ridden_Enemy_TurnDefault_Left90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_Idle") return TRUE end end function Ridden_Enemy_TurnDefault_Right90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_Idle") return TRUE end end function Ridden_Enemy_TurnBattle_Left180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_IdleBattle") return TRUE end end function Ridden_Enemy_TurnBattle_Right180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_IdleBattle") return TRUE end end function Ridden_Enemy_TurnBattle_Left90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_IdleBattle") return TRUE end end function Ridden_Enemy_TurnBattle_Right90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Ridden_Enemy_IdleBattle") return TRUE end end function Ridden_Enemy_Jump_onActivate() act(AIJumpState) end function Ridden_Enemy_Jump_onUpdate() act(AIJumpState) if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end end function Ridden_Enemy_DamageLarge_onUpdate() if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_DamageExLarge_onUpdate() if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_DamageWeakTop_onUpdate() if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_DamageWeakUnder_onUpdate() if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_Damage_Fall_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_DamageBackFall_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_Death_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_DEFAULT) == TRUE then return end end function Ridden_Enemy_DeathOnlyTop_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end end end function Ridden_Enemy_DeathOnlyUnder_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER) == TRUE then return end end function Ridden_Enemy_FireDeathOnlyTop_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end end end function Ridden_Enemy_WeakDeathOnlyTop_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end end end function Ridden_Enemy_ExLargeDeathOnlyTop_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end end end function Ridden_Enemy_ExLargeDeathOnlyUnder_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_RIDE_EXLARGE_ONLY_UNDER) == TRUE then return end end function Ride_SA_Add_Default_onUpdate() SetVariable("Ride_SA_Add_Blend", 0) end function RideAdjust_onUpdate() if env(IsIdleOnMount) == TRUE then Fire("W_Idle") return TRUE end end function RideOn_onUpdate() if env(IsAnimEnd, 0) == TRUE and env(IsOnMount) == FALSE then Fire("W_PhantomIdle") return TRUE end end function RideOnDash_onUpdate() if env(IsAnimEnd, 0) == TRUE and env(IsOnMount) == FALSE then Fire("W_PhantomIdle") return TRUE end end function RideOnMachine_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_RideOffMachine") return TRUE end end function RideOff_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_PhantomIdle") return TRUE end end function RideOffMachine_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_Idle") return TRUE end end function RideIdle_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_IDLE) == TRUE then return TRUE end end function RideIdleBattle_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_IDLE) == TRUE then return TRUE end end function RideWalk_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_WALK) then return TRUE end end function RideWalk_End_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return end if RideCommonFunction(RIDE_MOVE_TYPE_WALK) and env(IsAnimEnd, 0) == TRUE then return TRUE end end function RideRun_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_RUN) then return TRUE end end function RideDash_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_DASH) then return TRUE end end function RideDashAccelerate_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_DASH) then return TRUE end end function RideDashAccelerateContinue_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_DASH) then return TRUE end end function RideDash_End_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return end if RideCommonFunction(RIDE_MOVE_TYPE_WALK) and env(IsAnimEnd, 0) == TRUE then return TRUE end end function RideGallop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_GALLOP) then return TRUE end end function RideGallop_End_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return end if RideCommonFunction(RIDE_MOVE_TYPE_WALK) and env(IsAnimEnd, 0) == TRUE then return TRUE end end function RideTurn_Left180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurnDefault_Left180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurn_Right180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurnDefault_Right180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurn_Left90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurnDefault_Left90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurn_Right90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurnDefault_Right90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideTurnBattle_Left180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_RideIdleBattle") return TRUE end end function RideTurnBattle_Right180_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_RideIdleBattle") return TRUE end end function RideTurnBattle_Left90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_RideIdleBattle") return TRUE end end function RideTurnBattle_Right90_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdleBattle") return TRUE end end function RideJump_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideJump_N_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJump_Loop") return TRUE end end function RideJump_F_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJump_Loop") return TRUE end end function RideJump_D_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJump_Loop") return TRUE end end function RideJump2_N_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJump2_Loop") return TRUE end end function RideJump2_F_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJump2_Loop") return TRUE end end function RideJump2_D_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJump2_Loop") return TRUE end end function RideJumpHigh_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end end function RideJumpHighLoop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end local jumpHeight = env(GetFallHeight) local rideHeight = env(GetMountFallHeight) act(DebugLogOutput, "RideJumpHighLoop Height=" .. jumpHeight .. " RideHeight=" .. rideHeight) end function RideJumpHighEnd_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJumpHigh_FallLoop") return TRUE end end function RideJumpHigh2_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE or env(GetEventEzStateFlag, 0) == TRUE then Fire("W_RideJumpHigh_FallLoop") return TRUE end end function RideJump_Land_N_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideJump_Land_F_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideJump_Land_D_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideJump_Land_To_Dash_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideJump_Land_To_Gallop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideJump_Loop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end end function RideJump2_Loop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end end function RideJumpHigh_FallLoop_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_OTHER) == TRUE then return end end function RideGesture_onUpdate() if RideCommonFunction(RIDE_MOVE_TYPE_IDLE) == TRUE then return TRUE end if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function RideDamage_Fall_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 0) == TRUE then Fire("W_Idle") return TRUE end end function RideDamageBackFall_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end function RideDamage_Fall_AbyssalForest_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 0) == TRUE then Fire("W_Idle") return TRUE end end function RideDeath_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_DEFAULT) == TRUE then return end end function RideDeath_Idle_onActivate() act(SetDeathStay, TRUE) end function RideDeath_Idle_onDeactivate() act(SetDeathStay, FALSE) end function RideDeathOnlyTop_onUpdate() if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end end function RideDeathOnlyUnder_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER) == TRUE then return end end function RideDeathOnlyUnder_Idle_onActivate() act(SetDeathStay, TRUE) end function RideDeathOnlyUnder_Idle_onDeactivate() act(SetDeathStay, FALSE) end function RideFall_Land_onUpdate() if env(IsAnimEnd, 0) == TRUE then Fire("W_RideIdle") return TRUE end end function Damage_Update() if env(GetSpEffectID, SP_EFFECT_ENABLE_PARRY_THROW) == FALSE and env(GetSpEffectID, SP_EFFECT_ENABLE_SA_BREAK_THROW) == FALSE and env(GetSpEffectID, SP_EFFECT_ENABLE_FALLHORSE_THROW) == FALSE then SetThrowDefInvalid() end end function Ride_Enemy_NoThrow_Activate() SetThrowInvalid() end function Ride_Enemy_NoThrow_Update() SetThrowInvalid() end function Ride_Enemy_Fall_LandHeavy_onUpdate() if RideLandCommonFunction() == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) return end end function Ride_Enemy_DeathLandDefault_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_LAND_DEFAULT) == TRUE then return end end function Ride_Enemy_DeathLandDefaultOnlyTop_onUpdate() act(Dismount) if ExecTransToDeathIdle(DEATH_TYPE_RIDE_LAND_ONLY_TOP) == TRUE then return end end function Ride_Enemy_DeathLandDefaultOnlyUnder_onActivate() CallActionState(0) end function Ride_Enemy_DeathLandDefaultOnlyUnder_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_JumpDamage_Start_onUpdate() if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_JumpDamage_Loop", "W_Ridden_Enemy_JumpDamage_Loop", FALSE) return end if env(GetMountSpEffectID, 98) == TRUE and env(IsMountInFallLoop) == TRUE then FireRideEvent("W_Ride_Enemy_JumpDamage_Land", "W_Ridden_Enemy_JumpDamage_Land", FALSE) return end end function Ride_Enemy_JumpDamage_Loop_onUpdate() act(DenyEventAnimPlaybackRequest) if env(IsHamariFallDeath, 12) == TRUE then if env(GetSpEffectType, 143) == TRUE then act(AddSpEffect, 5155) end FireRideEvent("W_Ride_Enemy_JumpDamage_Land", "W_Ridden_Enemy_JumpDamage_Land", FALSE) return end if env(IsMountInFallLoop) == TRUE then FireRideEvent("W_Ride_Enemy_JumpDamage_Land", "W_Ridden_Enemy_JumpDamage_Land", FALSE) return end end function Ride_Enemy_JumpDamage_Land_onUpdate() act(DenyEventAnimPlaybackRequest) if RideLandCommonFunction() == TRUE then return end if env(IsAnimEnd, 1) == TRUE then FireRideEvent("W_Ride_Enemy_Idles", "W_Ridden_Enemy_Idles", FALSE) end end function Ride_Enemy_DamageParryEnemy1_onActivate() CallActionState(0) act(AddSpEffect, 5801) end function Ride_Enemy_DamageParryEnemy1_onUpdate() CallActionState(0) act(AddSpEffect, 5801) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_DamageParryEnemy2_onActivate() CallActionState(0) act(AddSpEffect, 5801) end function Ride_Enemy_DamageParryEnemy2_onUpdate() CallActionState(0) act(AddSpEffect, 5801) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ride_Enemy_Sleep_Resist_onActivate() CallActionState(12020) act(AddSpEffect, 5801) end function Ride_Enemy_Sleep_Resist_onUpdate() CallActionState(12020) act(AddSpEffect, 5801) if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(GetSpEffectID, 5410) == TRUE then else act(Dismount) if SleepCommonFunction(12020) == TRUE then return end end end function Ridden_Enemy_DeathLandDefault_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_LAND_DEFAULT) == TRUE then return end end function Ridden_Enemy_DeathLandDefaultOnlyTop_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end end end function Ridden_Enemy_DeathLandDefaultOnlyUnder_onUpdate() if ExecTransToDeathIdle(DEATH_TYPE_RIDE_LAND_ONLY_UNDER) == TRUE then return end end function Ridden_Enemy_DamageParryEnemy1_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_DamageParryEnemy2_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if DamageCommonFunction(STYLE_DEFAULT, FALSE, JUDGE_FALL_TYPE_DIRECTION) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function Ridden_Enemy_Sleep_Resist_onUpdate() if env(GetSpEffectID, 5981) == FALSE then act(FallPreventionAssist) end if env(IsOnMount) == FALSE then if SleepCommonFunction(12020) == TRUE then return end if env(GetHP) > 0 and env(GetSpEffectID, 11845) == TRUE then Fire("W_Event30000") return TRUE end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return TRUE end end end function RideLandCommonFunction() if ExecPassiveRide(FALSE, FALSE) == TRUE then return TRUE end if RideRequestFunction(TRUE, MOVE_TYPE_NONE, TRUE, FALSE) == TRUE then return TRUE end return FALSE end function RideFallCommonFunction() if ExecRideLand() == TRUE then return TRUE end return FALSE end function ExecRideLand() local anim_id = -1 local event_top = "" local event_under = "" if env(IsMountInFallLoop) == FALSE then if env(GetReceivedDamageType) == DAMAGE_TYPE_DEATH and env(HasReceivedAnyDamage) == FALSE or env(GetMountRecievedDamageType) == DAMAGE_TYPE_DEATH and env(HasMountReceivedAnyDamage) == FALSE then FireRideEvent("W_Ride_Enemy_Death", "W_Ridden_Enemy_Death", FALSE) return TRUE end if env(IsHamariFallDeath, 12) == TRUE then if env(GetSpEffectType, 143) == TRUE then act(AddSpEffect, 5155) end FireRideEvent("W_Ride_Enemy_Death", "W_Ridden_Enemy_Death", FALSE) return TRUE end if env(IsVersusDivineDamage) == TRUE then FLAG_HOLY_DAMAGE = TRUE else FLAG_HOLY_DAMAGE = FALSE end if ExecRideDeath() == TRUE then return TRUE end if env(HasReceivedAnyDamage) == TRUE or env(HasMountReceivedAnyDamage) == TRUE then local index = 0 SetVariable("IndexRideEnemySARandom", index) act(ApplyRideBlend, "IndexRiddenEnemySARandom", index) FireRideEvent("W_Ride_Enemy_SABlend_Add", "W_Ridden_Enemy_SABlend_Add", FALSE) SetVariable("BlendRideEnemySA", 1) act(ApplyRideBlend, "BlendRiddenEnemySA", 1) return TRUE end return FALSE end if IsRideDead() == TRUE then local death_type = GetRideDeathType() if death_type == DEATH_TYPE_RIDE_DEFAULT_BOTH then anim_id = ANIME_ID_DEATH_LAND_DEFAULT event_top = "W_Ride_Enemy_DeathLandDefault" event_under = "W_Ridden_Enemy_DeathLandDefault" elseif death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP then anim_id = ANIME_ID_RIDE_DEATH_LAND_TOP event_top = "W_Ride_Enemy_DeathLandDefaultOnlyTop" event_under = "W_Ridden_Enemy_DeathLandDefaultOnlyTop" elseif death_type == DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER then anim_id = ANIME_ID_RIDE_DEATH_LAND_UNDER event_top = "W_Ride_Enemy_DeathLandDefaultOnlyUnder" event_under = "W_Ridden_Enemy_DeathLandDefaultOnlyUnder" end if IsExistRideAnime(anim_id) == FALSE then event_top = "W_Ride_Enemy_Death" event_under = "W_Ridden_Enemy_Death" end Replanning() FireRideEvent(event_top, event_under, FALSE) return TRUE end if env(CheckForEventAnimPlaybackRequest) == TRUE then return TRUE end local height = env(GetMountFallHeight) / 100 if height > HEIGHT_TRANS_TO_HEAVY_LAND then if IsExistRideAnime(ANIME_ID_LAND_HEAVY) == TRUE then FireRideEvent("W_Ride_Enemy_Fall_LandHeavy", "W_Ridden_Enemy_Fall_LandHeavy", FALSE) else FireRideEvent("W_Ride_Enemy_Fall_Land", "W_Ridden_Enemy_Fall_Land", FALSE) end Replanning() return TRUE else Replanning() FireRideEvent("W_Ride_Enemy_Fall_Land", "W_Ridden_Enemy_Fall_Land", FALSE) return TRUE end return FALSE end function ExecRideFallStart() if env(IsMountFalling) == FALSE then return FALSE end FireRideEvent("W_Ride_Enemy_Fall_Loop", "W_Ridden_Enemy_Fall_Loop", FALSE) return TRUE end function Update() g_FrameCount = g_FrameCount + 1 act(Unknown9999) if env(GetSpEffectID, 5980) == TRUE then act(FallPreventionAssist) end if env(IsSpeaking) == TRUE and GetVariable("LipSyncBlend00") <= 0 then SetVariable("LipSyncBlend00", 0.10000000149011612) SetVariable("IndexLipSync", GetNextIndexLipSync(ANIME_ID_GENERAL_LIP_SYNC, 0, 9, 1, 0, "IndexLipSync", false)) Fire("W_LipSync") end if env(IsSpeaking) == TRUE and GetVariable("TalkHeadBlend00") <= 0 and IsExistAnime(ANIME_ID_TALK_HEAD_BLEND) == TRUE then SetVariable("TalkHeadBlend00", 0.10000000149011612) Fire("W_TalkHeadBlend00") end SoulDropUp() GolemConfusion() ParryResist() end ------------------------ -- Core: Global Variables ------------------------ TRUE = 1 FALSE = 0 INVALID = -1 FLAG_HOLY_DAMAGE = 0 IS_INITIALIZED_SOUL_DROP_UP = FALSE IS_INITIALIZED_CONFUSION = FALSE CAN_CONFUSION = FALSE POINT_CONFUSION = 0 BORDER_CONFUSION = 9999 IS_INITIALIZED_PARRY_RESIST = FALSE CAN_PARRY_RESIST = FALSE POINT_PARRY_RESIST = 0 BORDER_PARRY_RESIST = 9999 STYLE_DEFAULT = 0 STYLE_GUARD = 1 STYLE_PARRY = 2 MOVE_TYPE_NONE = 0 MOVE_TYPE_WALK_FRONT = 1 MOVE_TYPE_WALK_BACK = 2 MOVE_TYPE_WALK_LEFT = 3 MOVE_TYPE_WALK_RIGHT = 4 MOVE_TYPE_RUN = 5 MOVE_TYPE_PARALLEL = 6 AI_STATE_DEFAULT = 0 AI_STATE_BATTLE = 1 AI_RECOGNITION_INVALID = -1 AI_RECOGNITION_NONE = 0 AI_RECOGNITION_CAUTION = 1 AI_RECOGNITION_FIND = 2 AI_RECOGNITION_SEARCH = 3 AI_RECOGNITION_SEARCH2 = 4 AI_RECOGNITION_BATTLE = 5 INDEX_TURN_BATTLE = 0 INDEX_TURN_DEFAULT = 1 INDEX_TURN_GUARD = 2 INDEX_TURN_PARRY = 3 INDEX_TURN_DIRECTION_LEFT90 = 0 INDEX_TURN_DIRECTION_RIGHT90 = 1 INDEX_TURN_DIRECTION_LEFT180 = 2 INDEX_TURN_DIRECTION_RIGHT180 = 3 INDEX_TURN_DIRECTION_LEFT45 = 4 INDEX_TURN_DIRECTION_RIGHT45 = 5 THROW_INVALID = 255 THROW_DEFAULT = 0 THROW_STATE_NONE = 0 GUARD_LEVEL_NONE = 0 GUARD_LEVEL_SMALL = 1 GUARD_LEVEL_MIDDLE = 2 GUARD_LEVEL_LARGE = 3 GUARD_LEVEL_EXLARGE = 4 DAMAGE_LEVEL_NONE = 0 DAMAGE_LEVEL_SMALL = 1 DAMAGE_LEVEL_MIDDLE = 2 DAMAGE_LEVEL_LARGE = 3 DAMAGE_LEVEL_LARGE_BLOW = 4 DAMAGE_LEVEL_PUSH = 5 DAMAGE_LEVEL_FLING = 6 DAMAGE_LEVEL_SMALL_BLOW = 7 DAMAGE_LEVEL_MINIMUM = 8 DAMAGE_LEVEL_UPPER = 9 DAMAGE_LEVEL_EX_BLAST = 10 DAMAGE_LEVEL_BREATH = 11 DAMAGE_FLAG_MINIMUM = 0 DAMAGE_FLAG_SMALL = 1 DAMAGE_FLAG_MIDDLE = 2 DAMAGE_FLAG_LARGE = 3 DAMAGE_FLAG_SMALL_BLOW = 4 DAMAGE_FLAG_LARGE_BLOW = 5 DAMAGE_FLAG_FLING = 6 DAMAGE_FLAG_UPPER = 7 DAMAGE_FLAG_PUSH = 8 DAMAGE_FLAG_WEAK = 10 DAMAGE_FLAG_GUARD_SMALL = 11 DAMAGE_FLAG_GUARD_LARGE = 12 DAMAGE_FLAG_GUARD_EXLARGE = 13 DAMAGE_FLAG_GUARD_BREAK = 14 DIRECTION_LEFT = 0 DIRECTION_RIGHT = 1 DIRECTION_FORWARD = 2 DIRECTION_BACK = 3 DIRECTION_FRONTRIGHT = 4 DIRECTION_FRONTLEFT = 5 FRONT_ADD = 0 BACK_ADD = 1 LEFT_ADD = 2 RIGHT_ADD = 3 FRONTUP_ADD = 4 FRONTDOWN_ADD = 5 DAMAGE_TYPE_DEATH = 2 DAMAGE_TYPE_GUARD = 3 DAMAGE_TYPE_PARRY = 5 DAMAGE_TYPE_DEATHIDLE = 8 DAMAGE_TYPE_WEAK_FRAME = 10 DAMAGE_TYPE_GUARDED_BOUND = 1000 DAMAGE_TYPE_GUARD_BREAK = 1001 DAMAGE_TYPE_GUARDED_BOUND_ENEMY1 = 1008 DAMAGE_TYPE_GUARDED_BOUND_ENEMY2 = 1009 DAMAGE_TYPE_GUARDED_BOUND_ENEMY3 = 1010 DAMAGE_TYPE_PARRY_ENEMY1 = 1011 DAMAGE_TYPE_PARRY_ENEMY2 = 1012 DAMAGE_TYPE_PARRY_ENEMY3 = 1013 DAMAGE_TYPE_WALL_ENEMY1 = 1014 DAMAGE_TYPE_WALL_ENEMY2 = 1015 DAMAGE_TYPE_WALL_ENEMY3 = 1016 DAMAGE_TYPE_MAP_BOUND = 1017 DAMAGE_TYPE_NONE = 99999 DAMAGE_ELEMENT_FIRE = 11 DEATH_TYPE_DEFAULT = 0 DEATH_TYPE_FIRE = 1 DEATH_TYPE_WEAK = 2 DEATH_TYPE_BLAST = 3 DEATH_TYPE_FLING = 4 DEATH_TYPE_UPPER = 5 DEATH_TYPE_LAND_DEFAULT = 6 DEATH_TYPE_FIRE = 7 DEATH_TYPE_THROW_DEF = 8 DEATH_TYPE_LADDER = 9 DEATH_TYPE_LAND_UPWARD = 10 DEATH_TYPE_LAND_DOWNWARD = 11 DEATH_TYPE_RIDE_DEFAULT_ONLY_TOP = 12 DEATH_TYPE_RIDE_FIRE_ONLY_TOP = 13 DEATH_TYPE_RIDE_WEAK_ONLY_TOP = 14 DEATH_TYPE_RIDE_LAND_ONLY_TOP = 16 DEATH_TYPE_RIDE_DEFAULT_ONLY_UNDER = 20 DEATH_TYPE_RIDE_LAND_ONLY_UNDER = 22 DEATH_TYPE_RIDE_DEFAULT_BOTH = 30 DEATH_TYPE_SLEEP = 40 DEATH_TYPE_SLEEP_COLLECT = 41 FALL_DEFAULT = 0 FALL_UPWARD = 1 FALL_DOWNWARD = 2 FALL_LADDER = 3 FALL_LADDER_DEATH = 4 JUDGE_FALL_TYPE_DEFAULT = 0 JUDGE_FALL_TYPE_UPWARD = 1 JUDGE_FALL_TYPE_DOWNWARD = 2 JUDGE_FALL_TYPE_DIRECTION = 3 LADDER_REQUEST_UP = 7210 LADDER_REQUEST_DOWN = 7220 ACTION_TYPE_GUARD = 9910 ACTION_TYPE_PARRY = 9920 ANIME_ID_IDLE_DEFAULT = 0 ANIME_ID_IDLE_BATTLE = 20 ANIME_ID_IDLE_GUARD = 30 ANIME_ID_IDLE_PARRY = 40 ANIME_ID_TRANS_BATTLE_DEFAULT = 1020 ANIME_ID_TRANS_DEFAULT_BATTLE = 1040 ANIME_ID_TRANS_DEFAULT_SUDDEN_BATTLE = 1060 ANIME_ID_HEATUP = 1500 ANIME_ID_MODE_CHANGE = 1600 ANIME_ID_IDLE_UNIQUE_TO_IDLE = 1700 ANIME_ID_IDLE_TO_IDLE_UNIQUE_BEGIN = 1750 ANIME_ID_IDLE_TO_IDLE_UNIQUE_END = 1779 ANIME_ID_GENERATE = 1800 ANIME_ID_LOSE_TARGET = 1810 ANIME_ID_BUDDY_DISAPPEAR = 1840 ANIME_ID_WALK_BATTLE = 2000 ANIME_ID_WALK_GUARD = 2030 ANIME_ID_WALK_PARRY = 2040 ANIME_ID_RUN_BATTLE = 2100 ANIME_ID_RUN_GUARD = 2130 ANIME_ID_RUN_PARRY = 2140 ANIME_ID_WALK_DEFAULT = 2300 ANIME_ID_RUN_DEFAULT = 2310 ANIME_ID_ATTACK_BEGIN = 3000 ANIME_ID_ATTACK_END = 3039 ANIME_ID_GUARD_ATTACK_BEGIN = 3100 ANIME_ID_GUARD_ATTACK_END = 3104 ANIME_ID_THROW_ERROR_ATTACK = 3110 ANIME_ID_ART_STANCE_BEGIN = 3200 ANIME_ID_ART_STANCE_END = 3204 ANIME_ID_GOAL_ACTION_BEGIN = 3500 ANIME_ID_GOAL_ACTION_END = 3504 ANIME_ID_PARRY_ATTACK = 4000 ANIME_ID_BRING_EST = 4600 ANIME_ID_TURN = 5000 ANIME_ID_STEP_BEGIN = 6000 ANIME_ID_STEP_END = 6003 ANIME_ID_STEP2_BEGIN = 6010 ANIME_ID_STEP2_END = 6013 ANIME_ID_STEP3_BEGIN = 6020 ANIME_ID_STEP3_END = 6023 ANIME_ID_FALLING_UPWARD = 7010 ANIME_ID_FALLING_DOWNWARD = 7020 ANIME_ID_JUMP_DAMAGE_SMALL = 8150 ANIME_ID_JUMP_DAMAGE_LARGE = 8160 ANIME_ID_LAND_HEAVY = 7401 ANIME_ID_DEATH_LAND_DEFAULT = 7600 ANIME_ID_DEATH_LAND_UPWARD = 7610 ANIME_ID_DEATH_LAND_DOWNWARD = 7620 ANIME_ID_RIDE_DEATH_LAND_TOP = 7630 ANIME_ID_RIDE_DEATH_LAND_UNDER = 7640 ANIME_ID_DAMAGE_SMALL = 8000 ANIME_ID_DAMAGE_MIDDLE = 8010 ANIME_ID_DAMAGE_LARGE = 8020 ANIME_ID_DAMAGE_SMALL_BLOW = 8100 ANIME_ID_DAMAGE_LARGE_BLOW = 8101 ANIME_ID_DAMAGE_FLING = 8110 ANIME_ID_DAMAGE_PUSH = 8120 ANIME_ID_DAMAGE_UPPER = 8130 ANIME_ID_DAMAGE_WEAK = 8140 ANIME_ID_DAMAGE_WEAK_UNDER = 8145 ANIME_ID_DAMAGE_MINIMUM = 8190 ANIME_ID_GUARD_DAMAGE_SMALL_LOW = 8201 ANIME_ID_GUARD_DAMAGE_LARGE_LOW = 8221 ANIME_ID_ATTACK_BOUND_ENEMY1 = 8300 ANIME_ID_ATTACK_BOUND_ENEMY2 = 8310 ANIME_ID_PARRY_DAMAGE_ENEMY1 = 8500 ANIME_ID_PARRY_DAMAGE_ENEMY2 = 8501 ANIME_ID_SPECIAL_DAMAGE_RANDOM = 8600 ANIME_ID_SA_BREAK = 8700 ANIME_ID_RIDE_DAMAGE_FALL_BACK = 8801 ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_BACK = 8851 ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_LEFT = 8852 ANIME_ID_RIDE_DAMAGE_SMALL_BLOW_RIGHT = 8853 ANIME_ID_ADD_BLEND_FRONT = 9000 ANIME_ID_ADD_BLEND_BACK = 9001 ANIME_ID_ADD_BLEND_LEFT = 9002 ANIME_ID_ADD_BLEND_RIGHT = 9003 ANIME_ID_BLEND_DAMAGE_GUARD = 9080 ANIME_ID_PART_WEAK_DAMAGE = 9090 ANIME_ID_PART1_DAMAGE = 9100 ANIME_ID_PART9_DAMAGE = 9171 ANIME_ID_BLEND_DAMAGE_FIRE_SMALL = 9200 ANIME_ID_BLEND_DAMAGE_FIRE_MIDDLE = 9210 ANIME_ID_BLEND_DAMAGE_SMALL_FRONT = 9310 ANIME_ID_BLEND_DAMAGE_MIDDLE_FRONT = 9320 ANIME_ID_BLEND_DAMAGE_LARGE_FRONT = 9330 ANIME_ID_NO_ADD = 9500 ANIME_ID_DEATH_DEFAULT = 10000 ANIME_ID_DEATH_FIRE = 10010 ANIME_ID_DEATH_WEAK = 10030 ANIME_ID_DEATH_BLAST = 10040 ANIME_ID_DEATH_FLING = 10050 ANIME_ID_DEATH_UPPER = 10060 ANIME_ID_DEATH_VARIATION = 10100 ANIME_ID_THROW_DEF_BACKSTAB = 11000 ANIME_ID_DEATH_THROW_BACKSTAB = 11001 ANIME_ID_THROW_DEF_PARRY = 11010 ANIME_ID_DEATH_THROW_PARRY = 11011 ANIME_ID_THROW_DEF_STEALTH = 11020 ANIME_ID_DEATH_THROW_STEALTH = 11021 ANIME_ID_THROW_DEF_FALLHORSE = 11030 ANIME_ID_DEATH_THROW_FALLHORSE = 11031 ANIME_ID_THROW_DEF_FALL = 11040 ANIME_ID_DEATH_THROW_FALL = 11041 ANIME_ID_THROW_DEF_SLEEP = 11050 ANIME_ID_DEATH_THROW_SLEEP = 11051 ANIME_ID_THROW_DEF_TRUNK_FRONT = 11060 ANIME_ID_DEATH_THROW_TRUNK_FRONT = 11061 ANIME_ID_THROW_DEF_TRUNK_BACK = 11070 ANIME_ID_DEATH_THROW_TRUNK_BACK = 11071 ANIME_ID_RIDE_DEATH_DEFAULT_TOP = 10200 ANIME_ID_RIDE_DEATH_DEFAULT_UNDER = 10210 ANIME_ID_RIDE_DEATH_FIRE = 10220 ANIME_ID_RIDE_DEATH_WEAK = 10260 ANIME_ID_SLEEP_LOOP = 12000 ANIME_ID_SLEEP_START = 12001 ANIME_ID_SLEEP_END = 12002 ANIME_ID_DEATH_START_SLEEP = 12010 ANIME_ID_SLEEP_RESIST = 12020 ANIME_ID_DEATH_START_LADDER = 13370 ANIME_ID_SLEEP_COLLECT_LOOP = 14100 ANIME_ID_SLEEP_COLLECT_START = 14101 ANIME_ID_SLEEP_COLLECT_END = 14102 ANIME_ID_DEATH_START_SLEEP_COLLECT = 14110 ANIME_ID_EVENT_BEGIN = 20000 ANIME_ID_EVENT_END = 20059 ANIME_ID_GENERAL_LIP_SYNC = 41000 ANIME_ID_TALK_HEAD_BLEND = 41600 SP_EFFECT_ENABLE_PARRY_THROW = 30 SP_EFFECT_ENABLE_SA_BREAK_THROW = 36 SP_EFFECT_ENABLE_FALLHORSE_THROW = 38 SP_EFFECT_SLEEP = 3150 SP_EFFECT_TOKUSYU_IDLE = 5080 SP_EFFECT_MAGGOT_MAN = 5700 SP_EFFECT_CRUCIFY_GHOST_A = 5701 SP_EFFECT_CRUCIFY_GHOST_B = 5702 SP_EFFECT_TINDALOS_SP_DAMAGE = 5703 SP_EFFECT_COBRA_ASSASSIN = 5704 SP_EFFECT_SANDWORM = 5705 SP_EFFECT_GHOST_DOG = 5706 SP_EFFECT_MOTHER_DORAGON = 5707 SP_EFFECT_GARGOYLE_AT_CASTLE = 5708 SP_EFFECT_GUNDA_GHOST = 5709 SP_EFFECT_FULL_ARMOR_BEAST = 5710 SP_EFFECT_TINDALOS_THROW_DEF = 5711 SP_EFFECT_SKELETON_KNIGHT = 5712 SP_EFFECT_IGNORE_SPECIAL_DAMAGE = 5750 SP_EFFECT_IGNORE_SET_DIST_RATIO = 5800 SP_EFFECT_ART_STANCE = 5820 SP_EFFECT_SKELETON_NO_DEAD = 5830 SP_EFFECT_SKELETON_TMP_DEATH = 5831 SP_EFFECT_DOSOU_SKELETON_NO_DEAD = 5832 SP_EFFECT_DOSOU_SKELETON_TMP_DEATH = 5833 SP_EFFECT_DOSOU_SKELETON_TMP_DEATH_DOWNWARD = 5834 SP_EFFECT_NEW_SKELETON_NO_DEAD = 5860 SP_EFFECT_NEW_SKELETON_TMP_DEATH = 5861 SP_EFFECT_NEW_SKELETON_TMP_DEATH_DOWNWARD = 5862 SP_EFFECT_BALLOON_DOLL_NO_DEAD = 5871 SP_EFFECT_BALLOON_DOLL_TMP_DEATH = 5873 SP_EFFECT_BALLOON_DOLL_TMP_DEATH_DOWNWARD = 5872 SP_EFFECT_ROLLING_PUSH = 6000 SP_EFFECT_IGNORE_ROLLING_PUSH = 6020 SP_EFFECT_CONFUSION = 6910 SP_EFFECT_CONFUSION_SIGN = 6915 SP_EFFECT_CONFUSION_BORDER_A = 6920 SP_EFFECT_CONFUSION_BORDER_B = 6921 SP_EFFECT_CONFUSION_BORDER_C = 6922 SP_EFFECT_CONFUSION_POINT_A = 6930 SP_EFFECT_CONFUSION_POINT_B = 6931 SP_EFFECT_CONFUSION_POINT_C = 6932 SP_EFFECT_MIMIC = 11720 SP_EFFECT_DISABLE_SLEEP = 11721 SP_EFFECT_IGNORE_TURN45 = 10922 SP_EFFECT_KING_OF_STORM = 12060 SP_EFFECT_BUDDY_DELETE = 295190 SP_EFFECT_DEEP_SLEEP = 102300 SP_EFFECT_TYPE_POISON = 2 SP_EFFECT_TYPE_PLAGUE = 5 SP_EFFECT_TYPE_CAT_LANDING = 47 SP_EFFECT_TYPE_HOLY = 145 SP_EFFECT_TYPE_DISABLE_EST = 154 SP_EFFECT_TYPE_FALL_DEATH_INVALID = 266 SP_EFFECT_TYPE_GOLEM_CONFUSION = 394 SP_EFFECT_TYPE_SLEEP = 436 SP_EFFECT_TYPE_MADNESS = 437 SP_EFFECT_TYPE_RECOVERY_DAMAGE = 452 STATUS_EFFECT_POISON = 0 STATUS_EFFECT_DEADLY_POISON = 1 STATUS_EFFECT_BLOOD = 2 STATUS_EFFECT_CURSE = 3 STATUS_EFFECT_COLD = 4 STATUS_EFFECT_SLEEP = 5 STATUS_EFFECT_MADNESS = 6 DOWNSIDE = 0 UPSIDE = 1 ENEMY = 0 PLAYER = 1 CONFLICT_DIST_CHR = 0.30000001192092896 CONFLICT_DIST_START = 1.5 CONFLICT_DIST_COAST = 3 LADDER_COMMAND_INVALID = -1 LADDER_COMMAND_UP = 0 LADDER_COMMAND_DOWN = 1 LADDER_ACTION_INVALID = -1 LADDER_ACTION_START_BOTTOM = 0 LADDER_ACTION_START_TOP = 1 LADDER_ACTION_UP_RIGHT = 2 LADDER_ACTION_UP_LEFT = 3 LADDER_ACTION_DOWN_RIGHT = 4 LADDER_ACTION_DOWN_LEFT = 5 LADDER_ACTION_END_TOP = 6 LADDER_ACTION_END_BOTTOM = 7 LADDER_ACTION_IDLE_RIGHT = 8 LADDER_ACTION_IDLE_LEFT = 9 LADDER_ACTION_ATTACK_UP_RIGHT = 10 LADDER_ACTION_ATTACK_UP_LEFT = 11 LADDER_ACTION_ATTACK_DOWN_RIGHT = 12 LADDER_ACTION_ATTACK_DOWN_LEFT = 13 LADDER_ACTION_COAST_START_RIGHT = 14 LADDER_ACTION_COAST_RIGHT = 15 LADDER_ACTION_COAST_STOP_RIGHT = 16 LADDER_ACTION_COAST_START_LEFT = 17 LADDER_ACTION_COAST_LEFT = 18 LADDER_ACTION_COAST_STOP_LEFT = 19 LADDER_ACTION_COAST_LANDING = 20 LADDER_ACTION_SMALL_DAMAGE = 21 LADDER_ACTION_LARGE_DAMAGE = 22 LADDER_HAND_LEFT = 0 LADDER_HAND_RIGHT = 1 HEIGHT_TRANS_TO_LAND = 2 HEIGHT_TRANS_TO_HEAVY_LAND = 5 HEIGHT_FORCE_DEATH = 20 ATTACK_DIR_FRONT = 0 ATTACK_DIR_UP = 1 ATTACK_DIR_DOWN = 2 ATTACK_DIR_LEFT = 3 ATTACK_DIR_RIGHT = 4 BEH_IDENTIFIER_ROLLING = 1 BEH_IDENTIFIER_NO_ADD_BLEND = 2 BEH_IDENTIFIER_INSECT = 4 BEH_IDENTIFIER_GOLEM_CONFUSION = 5 BEH_IDENTIFIER_MARIQUES_PARRY = 6 BEH_IDENTIFIER_TRAUMA_MORGOTT = 7 BEH_IDENTIFIER_TRAUMA_GREATER_DEMON = 8 TALK_BEH_IDENTIFIER__NOT_TALKING = -1 TALK_BEH_IDENTIFIER__TALK_PLAY_00 = 0 TALK_BEH_IDENTIFIER__TALK_PLAY_01 = 1 TALK_BEH_IDENTIFIER__TALK_PLAY_02 = 2 TALK_BEH_IDENTIFIER__TALK_PLAY_03 = 3 TALK_BEH_IDENTIFIER__TALK_PLAY_04 = 4 TALK_BEH_IDENTIFIER__TALK_PLAY_05 = 5 TALK_BEH_IDENTIFIER__TALK_PLAY_06 = 6 TALK_BEH_IDENTIFIER__TALK_PLAY_07 = 7 TALK_BEH_IDENTIFIER__TALK_PLAY_08 = 8 TALK_BEH_IDENTIFIER__TALK_PLAY_09 = 9 TALK_BEH_IDENTIFIER__TALK_PLAY_10 = 10 TALK_BEH_IDENTIFIER__TALK_PLAY_11 = 11 TALK_BEH_IDENTIFIER__TALK_PLAY_12 = 12 TALK_BEH_IDENTIFIER__TALK_PLAY_13 = 13 TALK_BEH_IDENTIFIER__TALK_PLAY_14 = 14 TALK_BEH_IDENTIFIER__TALK_PLAY_15 = 15 TALK_BEH_IDENTIFIER__CONTINUE = 99 TALK_BEH_IDENTIFIER__NOT_PLAY = 100 AI_FLY_ROUTE_STATE_NOT_USE_FLY_ROUTE = -1 AI_FLY_ROUTE_STATE_NOMAL_CRUISE = 0 AI_FLY_ROUTE_STATE_NOMAL_CRUISE_LAND_REQUESTED = 1 AI_FLY_ROUTE_STATE_NOMAL_CRUISE_TO_DESCENT = 10 AI_FLY_ROUTE_STATE_DESCENR = 11 AI_FLY_ROUTE_STATE_ON_GROUND = 20 AI_FLY_ROUTE_STATE_ON_GROUND_TAKEOFF_REQUESTED = 21 AI_FLY_ROUTE_STATE_CLIMB = 30 AI_FLY_ROUTE_STATE_CLIMB_TO_NOMAL_CRUISE = 31 move_table_battle = { {ANIME_ID_WALK_BATTLE, "W_WalkFrontBattle", MOVE_TYPE_WALK_FRONT}, {ANIME_ID_WALK_BATTLE + 1, "W_WalkBackBattle", MOVE_TYPE_WALK_BACK}, {ANIME_ID_WALK_BATTLE + 2, "W_WalkLeftBattle", MOVE_TYPE_WALK_LEFT}, {ANIME_ID_WALK_BATTLE + 3, "W_WalkRightBattle", MOVE_TYPE_WALK_RIGHT}, {ANIME_ID_RUN_BATTLE, "W_RunBattle", MOVE_TYPE_RUN} } move_table_default = { {ANIME_ID_WALK_DEFAULT, "W_WalkFrontDefault", MOVE_TYPE_WALK_FRONT}, {ANIME_ID_WALK_BATTLE + 1, "W_WalkBackBattle", MOVE_TYPE_WALK_BACK}, {ANIME_ID_WALK_BATTLE + 2, "W_WalkLeftBattle", MOVE_TYPE_WALK_LEFT}, {ANIME_ID_WALK_BATTLE + 3, "W_WalkRightBattle", MOVE_TYPE_WALK_RIGHT}, {ANIME_ID_RUN_DEFAULT, "W_RunDefault", MOVE_TYPE_RUN} } move_table_guard = { {ANIME_ID_WALK_GUARD, "W_GuardWalkFront", MOVE_TYPE_WALK_FRONT}, {ANIME_ID_WALK_GUARD + 1, "W_GuardWalkBack", MOVE_TYPE_WALK_BACK}, {ANIME_ID_WALK_GUARD + 2, "W_GuardWalkLeft", MOVE_TYPE_WALK_LEFT}, {ANIME_ID_WALK_GUARD + 3, "W_GuardWalkRight", MOVE_TYPE_WALK_RIGHT}, {ANIME_ID_RUN_GUARD, "W_GuardRun", MOVE_TYPE_RUN} } move_table_parry = { {ANIME_ID_WALK_PARRY, "W_ParryWalkFront", MOVE_TYPE_WALK_FRONT}, {ANIME_ID_WALK_PARRY + 1, "W_ParryWalkBack", MOVE_TYPE_WALK_BACK}, {ANIME_ID_WALK_PARRY + 2, "W_ParryWalkLeft", MOVE_TYPE_WALK_LEFT}, {ANIME_ID_WALK_PARRY + 3, "W_ParryWalkRight", MOVE_TYPE_WALK_RIGHT}, {ANIME_ID_RUN_PARRY, "W_ParryRun", MOVE_TYPE_RUN} } move_table_ride_battle = { {ANIME_ID_WALK_BATTLE, "W_Ride_Enemy_WalkFrontBattle", "W_Ridden_Enemy_WalkFrontBattle", MOVE_TYPE_WALK_FRONT}, {ANIME_ID_WALK_BATTLE + 1, "W_Ride_Enemy_WalkBackBattle", "W_Ridden_Enemy_WalkBackBattle", MOVE_TYPE_WALK_BACK}, {ANIME_ID_WALK_BATTLE + 2, "W_Ride_Enemy_WalkLeftBattle", "W_Ridden_Enemy_WalkLeftBattle", MOVE_TYPE_WALK_LEFT}, {ANIME_ID_WALK_BATTLE + 3, "W_Ride_Enemy_WalkRightBattle", "W_Ridden_Enemy_WalkRightBattle", MOVE_TYPE_WALK_RIGHT}, {ANIME_ID_RUN_BATTLE, "W_Ride_Enemy_RunBattle", "W_Ridden_Enemy_RunBattle", MOVE_TYPE_RUN} } move_table_ride_default = { {ANIME_ID_WALK_DEFAULT, "W_Ride_Enemy_WalkFrontDefault", "W_Ridden_Enemy_WalkFrontDefault", MOVE_TYPE_WALK_FRONT}, {ANIME_ID_WALK_BATTLE + 1, "W_Ride_Enemy_WalkBackBattle", "W_Ridden_Enemy_WalkBackBattle", MOVE_TYPE_WALK_BACK}, {ANIME_ID_WALK_BATTLE + 2, "W_Ride_Enemy_WalkLeftBattle", "W_Ridden_Enemy_WalkLeftBattle", MOVE_TYPE_WALK_LEFT}, {ANIME_ID_WALK_BATTLE + 3, "W_Ride_Enemy_WalkRightBattle", "W_Ridden_Enemy_WalkRightBattle", MOVE_TYPE_WALK_RIGHT}, {ANIME_ID_RUN_DEFAULT, "W_Ride_Enemy_RunDefault", "W_Ridden_Enemy_RunDefault", MOVE_TYPE_RUN} } g_FrameCount = 0 ------------------------ -- Conditions -- env( , ) -- * are optional ------------------------ IsGeneralAnimEnd = 0 IsAttackAnimEnd = 1 AnimIDOffset = 9 AdditiveBlendAnim = 10 AdditiveBlendAnimOfSlot = 11 IsAtkRequest = 100 -- args: IsAtkReleaseRequest = 101 IsChainAtkRequest = 102 GetAtkDuration = 103 GetWeaponSwitchRequest = 104 GetCommandIDFromEvent = 105 GetAIActionType = 106 GetAIChainActionType = 107 GetChainEvadeRequest = 108 GetWeaponChangeRequest = 109 GetAnimIDFromMoveParam = 110 IsThereAnyAtkRequest = 111 IsThereAnyChainAtkRequest = 112 IsItemUseMenuOpening = 113 IsMagicUseMenuOpening = 114 IsItemUseMenuOpened = 115 IsMagicUseMenuOpened = 116 GetBlendAnimIDFromMoveParam = 117 GetAIChainStepType = 118 GetTransitionToSpecialStayAnimID = 119 GetAIAtkCancelType = 120 GetWeaponCancelType = 121 -- args: IsWeaponCancelPossible = 122 GetAIDefenseCancelType = 123 GetAIVersusBackstabCancelType = 124 IsFalling = 200 IsLanding = 201 GetReceivedDamageType = 202 IsActiveActionValid = 203 GetActionEventNumber = 204 IsNormalDmgPassThroughDuringThrow = 205 IsThrowing = 206 GetWeaponSwitchState = 207 IsEquipmentSwitchPossible = 209 IsAnimCancelPossibleInAtkRelease = 210 IsEmergencyStopAnimPlaying = 211 GetLockRangeState = 212 GetLockAngleState = 213 IsAnimCancelPossibleInDamageHit = 214 IsChangeToScrapeAtk = 215 IsChangeToDeflectAtk = 216 IsChangeToAfterParrySuccess = 217 IsChangeFromNormalToBigAtk = 218 GetMovementType = 219 IsLargeAtkComboPossible = 220 IsMapActionPossible = 221 GetReceivedDamageDirection = 222 GetMapActionID = 223 GetFallHeight = 224 GetEquipWeaponCategory = 225 -- args: IsHoldingBow = 226 GetMagicAnimType = 227 WasNotLargeAtk = 228 IsBackAtkPossible = 229 IsAfterParryAtkPossible = 230 GetItemAnimType = 231 IsMagicUseable = 232 -- args: , IsItemUseable = 233 IsPrecisionShoot = 234 IsFireDamaged = 235 GetDamageLevel = 236 GetGuardLevelAction = 237 IsNewLeftHandAtkFromStay = 238 IsParryFromIdle = 239 IsGuardFromIdle = 240 IsNewLeftHandAtkFromAtkCancel = 241 IsParryFromAtkCancel = 242 IsGuardFromAtkCancel = 243 IsTiedUp = 244 IsOutOfAmmo = 245 -- args: # 1 is left slot, 0 is right slot IsUseCatLanding = 246 GetHoverMoveState = 247 IsTruelyLanding = 248 IsRightHandMagic = 249 IsChangeToSpecialStayAnim = 250 GetSpecialStayAnimID = 251 AcquireSpecialDamageAnimationID = 252 IsRunTurnAnimPlaying = 253 IsGenerateAction = 254 GetSpecialStayCancelAnimID = 255 HasReceivedAnyDamage = 256 GetMoveAnimParamID = 257 GetGuardLevel = 258 IsRequestTurnAnimStart = 259 IsTurningWithAnim = 260 IsFlying = 261 IsAbilityInsufficient = 262 -- args: GetEquipWeightRatioForFalling = 263 GetFlightMotionState = 264 GetIsWeakPoint = 265 GetMoveAnimBlendRatio = 266 GetLadderActionState = 267 IsInDisguise = 268 IsCoopWait = 269 IsCoop = 270 IsSpecialTransitionPossible = 271 GetLandingAnimBlendRatio = 272 GetThrowAnimID = 273 DidOpponentDieFromThrow = 274 HasThrowEnded = 275 IsThrowSelfDeath = 276 IsThrowSuccess = 277 GetGuardMotionCategory = 278 -- args: IsBeingThrown = 279 IsSelfThrow = 280 IsThrowDeathState = 281 GetNewLockState = 282 IsOnLadder = 283 GetPhysicalAttribute = 284 GetSpecialAttribute = 285 GetSpecialStayDeathAnimID = 286 HasReceivedAnyDamage_AnimEnd = 287 EggGrowth_IsHeadScratch = 288 EggGrowth_IsBecomeEggHead = 289 IsStop = 290 IsSomeoneOnLadder = 291 -- args: , IsSomeoneUnderLadder = 292 -- args: , GetLadderHandState = 293 DoesLadderHaveCharacters = 294 -- args: , , IsLadderRightHandStayState = 295 IsDescendingToFloor = 296 IsInputDirectionMatch = 297 IsSpecialTransition2Possible = 298 IsVersusDivineDamage = 299 IsGeneralAnimCancelPossible = 300 GetEventEzStateFlag = 301 -- args: IsLadderEventEnd = 302 IsReachBottomOfLadder = 303 IsReachTopOfLadder = 304 GetStateChangeType = 305 -- args: IsOnLastRungOfLadder = 306 GetWeaponDurability = 311 IsWeaponBroken = 312 IsAnimEndBySkillCancel = 313 EggGrowth_IsBecomeEgghead_SecondStage = 314 IsHamariFallDeath = 315 -- args: IsClient = 316 IsSlope = 317 IsSwitchState = 318 IsPressUpKey = 319 IsSpecialTurning = 320 GetIntValueForTest = 321 IsObjActInterpolatedMotion = 322 GetObjActTargetDirection = 323 GetObjActRemainingInterpolateTime = 324 IsGap = 325 GetWeaponID = 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: