local DEBUG_FORCE_DEFLECT = false -- Aegis of Hadea function SkardeShieldHandler(on, noFpCost) local wep_hand = HAND_LEFT noFpCost = noFpCost or FALSE local spEffect = 5322500 -- Normal VFX if env(GetSpEffectID, 1674000) == TRUE then -- Immutable Shield spEffect = 5322501 -- VFX White elseif env(GetSpEffectID, 501691) == TRUE or env(GetSpEffectID, 1447000) == TRUE then -- Shield Grease or Scolars Shield spEffect = 5322502 -- VFX Blue end if noFpCost == TRUE then wep_hand = c_SwordArtsHand elseif c_Style == HAND_RIGHT_BOTH then wep_hand = HAND_RIGHT end if wep_hand == HAND_RIGHT then spEffect = spEffect + 5 end if env(GetFP) == 0 then act(AddSpEffect, 5322520) end if GetWeaponID(wep_hand) == "31350000" and on and GetParamValue(PARAM.EquipParamWeapon.REQUIREMENT_FAITH, 31350000) <= GetPointerValue(CHR_INS_BASE.PLAYER_GAME_DATA.FAITH) and env(GetSpEffectID, 5322520) == FALSE then act(AddSpEffect, spEffect) -- Base act(AddSpEffect, 5322525) -- Cover feet if noFpCost == FALSE then act(AddSpEffect, 5322510) -- FP Cost end elseif env(GetSpEffectID, spEffect) == TRUE and (not on or GetWeaponID(wep_hand) ~= "31350000") then act(ClearSpEffect, spEffect) end end local SkardeShieldAshesCost = { [90] = true, -- Shield Bash [91] = true, -- Barricade Shield [92] = true, -- Parry [93] = true, -- Bucklet Parry --95, -- Carian Retaliation [97] = true, -- Golden Parry [98] = true, -- Shield Crash [152] = true, -- Holy Ground --399, -- Shield Strike } function SkardeShieldAltAshHandler() local c_WeaponSwordArts = GetWeaponID(c_SwordArtsHand) if c_WeaponSwordArts == "31350000" and SkardeShieldAshesCost[c_SwordArtsID] then act(AddSpEffect, 5322511) -- 3 FP Cost end end SkardeShieldVisualAshes = { [90] = true, -- Shield Bash [91] = true, -- Barricade Shield [92] = true, -- Parry [93] = true, -- Bucklet Parry [95] = true, -- Carian Retaliation [97] = true, -- Golden Parry [98] = true, -- Shield Crash [152] = true, -- Holy Ground --399, -- Shield Strike } function DeflectActive() if DEBUG_FORCE_DEFLECT or env(GetSpEffectID, 102000) == TRUE -- Deflecting Tear or env(GetSpEffectID, 1976) == TRUE -- Deflecting Ash (R) or env(GetSpEffectID, 1978) == TRUE then -- Deflecting Ash (L) return TRUE end return FALSE end -- Other function NecroFistsVFXManager() if (env(GetSpEffectID, 2061) == FALSE and env(GetSpEffectID, 2063) == FALSE) then act(ClearSpEffect, 2064) act(ClearSpEffect, 2065) return end if env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 168 then if env(GetSpEffectID, 2061) == TRUE then act(AddSpEffect, 2064) if c_Style == HAND_RIGHT_BOTH then act(AddSpEffect, 2065) end end end if env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) == 168 then if env(GetSpEffectID, 2063) == TRUE then act(AddSpEffect, 2065) if c_Style == HAND_LEFT_BOTH then act(AddSpEffect, 2064) end end end end function DragonCultDaggersOffHandler() local isWepLeft = env(GetEquipWeaponSpecialCategoryNumber, HAND_LEFT) == 148 local isWepRight = env(GetEquipWeaponSpecialCategoryNumber, HAND_RIGHT) == 148 if not isWepLeft and not isWepRight then return end local isInLeft = isWepLeft and c_Style ~= HAND_RIGHT_BOTH local isInRight = isWepRight and c_Style ~= HAND_LEFT_BOTH if not isInLeft and not isInRight then if env(GetSpEffectID, 4000171) == TRUE and not OnCooldown(0.33, CultDaggers_Cooldown[1]) then act(ClearSpEffect, 4000171) end return end if (env(GetSpEffectID, 4000171) == FALSE) and env(GetSpEffectID, Jewel_of_the_Ancients) == FALSE then TrickWeaponHandler(0, 1205000, 1200000, CultDaggers_Cooldown, true, false) -- Cult Daggers - Throwing Weapons to Twin Daggers return end if isInRight then act(AddSpEffect, 4000173) else act(AddSpEffect, 4000174) end end function BlightpoleOffHandler() TrickWeaponHandler(0, 18205000, 18200000, Blightpole_Cooldown, true, false) -- Blightpole - Catalyst to Basic end local equippedWeaponSlots = { { ptr = CHR_INS_BASE.PLAYER_GAME_DATA.EQUIP_GAME_DATA.CHR_ASM.R_HAND_WEAPON_GA_ITEM_HANDLE(0), found = false }, { ptr = CHR_INS_BASE.PLAYER_GAME_DATA.EQUIP_GAME_DATA.CHR_ASM.R_HAND_WEAPON_GA_ITEM_HANDLE(1), found = false }, { ptr = CHR_INS_BASE.PLAYER_GAME_DATA.EQUIP_GAME_DATA.CHR_ASM.R_HAND_WEAPON_GA_ITEM_HANDLE(2), found = false }, { ptr = CHR_INS_BASE.PLAYER_GAME_DATA.EQUIP_GAME_DATA.CHR_ASM.L_HAND_WEAPON_GA_ITEM_HANDLE(0), found = false }, { ptr = CHR_INS_BASE.PLAYER_GAME_DATA.EQUIP_GAME_DATA.CHR_ASM.L_HAND_WEAPON_GA_ITEM_HANDLE(1), found = false }, { ptr = CHR_INS_BASE.PLAYER_GAME_DATA.EQUIP_GAME_DATA.CHR_ASM.L_HAND_WEAPON_GA_ITEM_HANDLE(2), found = false }, } local _recallAsh_fpContainer = -1 function RecallAsh() if g_DeltaTimeCount <= 0 then return end RecallAshUsage() if not StaggerExecution(2) then return end RecallAshBulletHandler() if not StaggerExecution(6) then return end PositionTrackerReset(false) RecallAshBulletEnabler() RecallAshMonitor() end local recallAshMonitorIndex = 1; function RecallAshMonitor() if env(GetSpEffectID, 2052) == TRUE or env(IsOnMount) == TRUE then return end local slot = equippedWeaponSlots[recallAshMonitorIndex] local weaponGa = GetPointerValue(slot.ptr) local gaItem = GetGaItemByHandle(weaponGa) slot.found = false if gaItem ~= nil and tostring(gaItem.Id) ~= "110000" then if gaItem.GemGaItemHandle ~= 0 then local gemItem = GetGaItemByHandle(gaItem.GemGaItemHandle) if gemItem ~= nil and tostring(gemItem.Id) == "80500" then slot.found = true end end end recallAshMonitorIndex = recallAshMonitorIndex + 1 if recallAshMonitorIndex > 6 then recallAshMonitorIndex = 1 end MONITOR_POSITION = equippedWeaponSlots[1].found or equippedWeaponSlots[2].found or equippedWeaponSlots[3].found or equippedWeaponSlots[4].found or equippedWeaponSlots[5].found or equippedWeaponSlots[6].found end function RecallAshBulletEnabler() if MONITOR_POSITION and env(GetSpEffectID, 2050) == FALSE and env(GetSpEffectID, 2052) == FALSE then if env(GetSwordArtID, HAND_RIGHT) == 307 or env(GetSwordArtID, HAND_LEFT) == 307 then local chunkX, chunkY, chunkZ = GetPointerValue(CHR_INS_BASE.CHUNK_POSITION) _recallAsh_chunks = { chunkX, chunkY, chunkZ } act(AddSpEffect, 2050) -- Enable Recall Ash Bullet end elseif env(GetSpEffectID, 2050) == TRUE and env(GetSwordArtID, HAND_RIGHT) ~= 307 and env(GetSwordArtID, HAND_LEFT) ~= 307 then act(ClearSpEffect, 2050) -- Disable Recall Ash Bullet end if env(GetSpEffectID, 2052) == FALSE and _recallAsh_fpContainer > -1 then SetFP(_recallAsh_fpContainer - 40) _recallAsh_fpContainer = -1 end end local bulletEnabled = false function RecallAshBulletHandler() if (env(GetSpEffectID, 2050) == FALSE and not bulletEnabled) or #POSITION_CONTAINER == 0 then return end local fieldInsHandle = GetFieldInsHandle() local index = 0 while true do local bulletExists = GetPointerValue(GAME_BASE.CS_BULLET_MANAGER.BULLET_LIST.EXISTS(index)) if bulletExists == FALSE then break end local isOwnedByCurrentChrIns = false if GetPointerValue(GAME_BASE.CS_BULLET_MANAGER.BULLET_LIST.OWNER_CHR_HANDLE(index)) == fieldInsHandle then isOwnedByCurrentChrIns = true end if isOwnedByCurrentChrIns then local param = GetBulletParam(index) if param == "3320" then if env(GetSpEffectID, 2050) == FALSE then SetPointerValue(GAME_BASE.CS_BULLET_MANAGER.BULLET_LIST.LIFE(index), 0) bulletEnabled = true else local pos = POSITION_CONTAINER[1] local chunkX, chunkY, chunkZ = GetPointerValue(CHR_INS_BASE.CHUNK_POSITION) local blockDiffX = pos.BlockCoordinates.X - chunkX; local blockDiffY = pos.BlockCoordinates.Y - chunkY; local blockDiffZ = pos.BlockCoordinates.Z - chunkZ; local offset_X = pos.Coordinates.X - blockDiffX local offset_Y = pos.Coordinates.Y - blockDiffY local offset_Z = pos.Coordinates.Z - blockDiffZ SetPointerValue(GAME_BASE.CS_BULLET_MANAGER.BULLET_LIST.ORIENTATION(index), pos.Rotation.X, pos.Rotation.Y, pos.Rotation.Z, pos.Rotation.W) SetPointerValue(GAME_BASE.CS_BULLET_MANAGER.BULLET_LIST.POSITION(index), offset_X, offset_Y, offset_Z) bulletEnabled = true end return end end index = index + 1 end bulletEnabled = false end function RecallAshUsage() if not MONITOR_POSITION then return elseif env(GetSpEffectID, 2051) == FALSE then return elseif env(GetSpEffectID, 2052) == TRUE then return end _recallAsh_fpContainer = env(GetFP) act(AddSpEffect, 2052) -- Cooldown act(ClearSpEffect, 2051) -- Trigger act(ClearSpEffect, 2050) -- Disable Recall Ash Bullet local newPos = POSITION_CONTAINER[1] local newPosVector = hkVector4.new(newPos.Coordinates.X, newPos.Coordinates.Y, newPos.Coordinates.Z, 0) local playerPos = GetLocalPositionVector() local distance = CalculateDistance(newPosVector, playerPos) TeleportToBullet("3320", false, true, true) ExecEventAllBody("W_SwordArtsOneShotComboEnd") if distance > 5 then SetPointerValue(GAME_BASE.WORLD_CHR_MAN.CHR_CAM.REQUEST_CAMERA_RESET, TRUE) act(AddSpEffect, 2053) -- Recall Ash Blur VFX end local targetTime = g_DeltaTimeCount - 6.0 for i = 1, #hpTrackerTable do local entry = hpTrackerTable[i] if entry.timeStamp <= targetTime then if entry.hp > env(GetHP) then CalculatedHeal(entry.hp - env(GetHP)) end break end end end