public static bool Prefix(Humanoid __instance, ref bool __result, bool secondaryAttack) { if (!secondaryAttack) { return(true); } __instance.AbortEquipQueue(); if (__instance.InAttack() && !__instance.HaveQueuedChain() || __instance.InDodge() || !__instance.CanMove() || __instance.IsKnockedBack() || __instance.IsStaggering() || __instance.InMinorAction()) { return(true); } var currentWeapon = __instance.GetCurrentWeapon(); if (currentWeapon == null || currentWeapon.m_dropPrefab == null) { EpicLoot.Log("Weapon or weapon's dropPrefab is null"); return(true); } if (!currentWeapon.IsMagic() || !currentWeapon.GetMagicItem().HasEffect(MagicEffectType.Throwable)) { return(true); } var spearPrefab = ObjectDB.instance?.GetItemPrefab("SpearFlint"); if (spearPrefab == null) { return(true); } if (__instance.m_currentAttack != null) { __instance.m_currentAttack.Stop(); __instance.m_previousAttack = __instance.m_currentAttack; __instance.m_currentAttack = null; } var attack = spearPrefab.GetComponent <ItemDrop>().m_itemData.m_shared.m_secondaryAttack.Clone(); if (!attack.Start(__instance, __instance.m_body, __instance.m_zanim, __instance.m_animEvent, __instance.m_visEquipment, currentWeapon, __instance.m_previousAttack, __instance.m_timeSinceLastAttack, __instance.GetAttackDrawPercentage())) { return(false); } __instance.m_currentAttack = attack; __instance.m_lastCombatTimer = 0.0f; __result = true; return(false); }