g_TorrentMovementSpeed = 1.4 -- 1.0 is normal movement speed, 1.5 would be 50% faster. function Event20000_onUpdate() if EventCommonFunction(20000) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_PhantomIdle") return end end function Event20001_onUpdate() if EventCommonFunction(20001) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20002_onUpdate() if EventCommonFunction(20002) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20003_onUpdate() if EventCommonFunction(20003) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20004_onUpdate() if EventCommonFunction(20004) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20005_onUpdate() if EventCommonFunction(20005) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20006_onUpdate() if EventCommonFunction(20006) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20007_onUpdate() if EventCommonFunction(20007) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20008_onUpdate() if EventCommonFunction(20008) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20009_onUpdate() if EventCommonFunction(20009) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20010_onUpdate() if EventCommonFunction(20010) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20011_onUpdate() if EventCommonFunction(20011) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20012_onUpdate() if EventCommonFunction(20012) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20013_onUpdate() if EventCommonFunction(20013) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20014_onUpdate() if EventCommonFunction(20014) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20015_onUpdate() if EventCommonFunction(20015) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20016_onUpdate() if EventCommonFunction(20016) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20017_onUpdate() if EventCommonFunction(20017) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20018_onUpdate() if EventCommonFunction(20018) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20019_onUpdate() if EventCommonFunction(20019) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20020_onUpdate() if EventCommonFunction(20020) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20021_onUpdate() if EventCommonFunction(20021) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20022_onUpdate() if EventCommonFunction(20022) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20023_onUpdate() if EventCommonFunction(20023) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20024_onUpdate() if EventCommonFunction(20024) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20025_onUpdate() if EventCommonFunction(20025) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20026_onUpdate() if EventCommonFunction(20026) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20027_onUpdate() if EventCommonFunction(20027) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20028_onUpdate() if EventCommonFunction(20028) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20029_onUpdate() if EventCommonFunction(20029) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20030_onUpdate() if EventCommonFunction(20030) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20031_onUpdate() if EventCommonFunction(20031) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20032_onUpdate() if EventCommonFunction(20032) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20033_onUpdate() if EventCommonFunction(20033) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20034_onUpdate() if EventCommonFunction(20034) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20035_onUpdate() if EventCommonFunction(20035) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20036_onUpdate() if EventCommonFunction(20036) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20037_onUpdate() if EventCommonFunction(20037) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20038_onUpdate() if EventCommonFunction(20038) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20039_onUpdate() if EventCommonFunction(20039) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20040_onUpdate() if EventCommonFunction(20040) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20041_onUpdate() if EventCommonFunction(20041) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20042_onUpdate() if EventCommonFunction(20042) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20043_onUpdate() if EventCommonFunction(20043) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20044_onUpdate() if EventCommonFunction(20044) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20045_onUpdate() if EventCommonFunction(20045) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20046_onUpdate() if EventCommonFunction(20046) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20047_onUpdate() if EventCommonFunction(20047) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20048_onUpdate() if EventCommonFunction(20048) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20049_onUpdate() if EventCommonFunction(20049) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20050_onUpdate() if EventCommonFunction(20050) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20051_onUpdate() if EventCommonFunction(20051) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20052_onUpdate() if EventCommonFunction(20052) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20053_onUpdate() if EventCommonFunction(20053) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20054_onUpdate() if EventCommonFunction(20054) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20055_onUpdate() if EventCommonFunction(20055) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20056_onUpdate() if EventCommonFunction(20056) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20057_onUpdate() if EventCommonFunction(20057) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20058_onUpdate() if EventCommonFunction(20058) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event20059_onUpdate() if EventCommonFunction(20059) == TRUE then return end if env(IsAnimEnd, 1) == TRUE then Fire("W_Idle") return end end function Event30000_onUpdate() if EventCommonFunction(30000) == TRUE then return end end function Event30001_onUpdate() if EventCommonFunction(30001) == TRUE then return end end function Event30002_onUpdate() if EventCommonFunction(30002) == TRUE then return end end function Event30003_onUpdate() if EventCommonFunction(30003) == TRUE then return end end function Event30004_onUpdate() if EventCommonFunction(30004) == TRUE then return end end function Event30005_onUpdate() if EventCommonFunction(30005) == TRUE then return end end function Event30006_onUpdate() if EventCommonFunction(30006) == TRUE then return end end function Event30007_onUpdate() if EventCommonFunction(30007) == TRUE then return end end function Event30008_onUpdate() if EventCommonFunction(30008) == TRUE then return end end function Event30009_onUpdate() if EventCommonFunction(30009) == TRUE then return end end function Event30010_onUpdate() if EventCommonFunction(30010) == TRUE then return end end function Event30011_onUpdate() if EventCommonFunction(30011) == TRUE then return end end function Event30012_onUpdate() if EventCommonFunction(30012) == TRUE then return end end function Event30013_onUpdate() if EventCommonFunction(30013) == TRUE then return end end function Event30014_onUpdate() if EventCommonFunction(30014) == TRUE then return end end function Event30015_onUpdate() if EventCommonFunction(30015) == TRUE then return end end function Event30016_onUpdate() if EventCommonFunction(30016) == TRUE then return end end function Event30017_onUpdate() if EventCommonFunction(30017) == TRUE then return end end function Event30018_onUpdate() if EventCommonFunction(30018) == TRUE then return end end function Event30019_onUpdate() if EventCommonFunction(30019) == TRUE then return end end function Event30020_onUpdate() if EventCommonFunction(30020) == TRUE then return end end function Event30021_onUpdate() if EventCommonFunction(30021) == TRUE then return end end function Event30022_onUpdate() if EventCommonFunction(30022) == TRUE then return end end function Event30023_onUpdate() if EventCommonFunction(30023) == TRUE then return end end function Event30024_onUpdate() if EventCommonFunction(30024) == TRUE then return end end function Event30025_onUpdate() if EventCommonFunction(30025) == TRUE then return end end function Event30026_onUpdate() if EventCommonFunction(30026) == TRUE then return end end function Event30027_onUpdate() if EventCommonFunction(30027) == TRUE then return end end function Event30028_onUpdate() if EventCommonFunction(30028) == TRUE then return end end function Event30029_onUpdate() if EventCommonFunction(30029) == TRUE then return end end function GetDeltaTime() return env(ObtainedDT) / 1000 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 Move_onGenerate() local speed = 0 local turnangle = GetVariable("TurnAngle") local internaloffset = GetVariable("InternalOffset") if math.abs(turnangle) <= 1 then speed = 1 elseif math.abs(turnangle) <= 2.5999999046325684 then speed = 1.2999999523162842 else speed = 2 end local maxoffset = 0.10000000149011612 * speed local minoffset = -0.10000000149011612 * speed local target_val = 0 if math.abs(turnangle) <= 0.20000000298023224 then target_val = 0 elseif turnangle > 0.20000000298023224 then target_val = minoffset elseif turnangle < -0.20000000298023224 then target_val = maxoffset end local offset = ConvergeValue(target_val, internaloffset, 0.30000001192092896, 0.30000001192092896) local rootpos_pose_modelspace = hkbGetBoneModelSpace("Root") local rootpos_pose_localspace = hkbGetBoneLocalSpace("Root") local quat = rootpos_pose_localspace:getRotation() / rootpos_pose_modelspace:getRotation() local offset_vec = hkVector4.new(1, 0, 0, 0) offset_vec:setRotatedDir(quat, offset_vec) offset_vec = offset_vec * offset local rootpos_translation_localspace = rootpos_pose_localspace:getTranslation() + offset_vec rootpos_pose_localspace:setTranslation(rootpos_translation_localspace) hkbSetBoneLocalSpace("Root", rootpos_pose_localspace) SetVariable("RollTwistAngle", offset * 60) SetVariable("YawTwistAngle", offset * 340) SetVariable("InternalOffset", offset) SetVariable("YawTwistAngle_Twistroot", offset * 340 / 4) act(SetMovementScaleMult, g_TorrentMovementSpeed) end ------------------------ -- 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: