/// <summary> /// Drop item in town and record it so we can avoid picking it up again. /// </summary> public static async Task <CoroutineResult> Drop(ACDItem item) { if (!ZetaDia.IsInGame || !ZetaDia.IsInTown || item.IsAccountBound) { return(CoroutineResult.NoAction); } s_logger.Information($"[{nameof(Drop)}] Dropping {item.Name} ({item.ActorSnoId}) in town. AnnId={item.AnnId} "); bool dropResult = false; try { dropResult = item.Drop(); } catch (InjectionSEHException) { s_logger.Information($"[{nameof(DropItems)}] Failed to Drop {item.Name} ({item.ActorSnoId}) in town. AnnId={item.AnnId} "); DroppedItemAnnIds.Add(item.AnnId); } if (dropResult) { DroppedItemAnnIds.Add(item.AnnId); ItemEvents.FireItemDropped(item); await Coroutine.Yield(); return(CoroutineResult.Done); } return(CoroutineResult.Failed); }
/// <summary> /// Drop item in town and record it so we can avoid picking it up again. /// </summary> public static async Task <bool> Drop(TrinityItem item) { if (!ZetaDia.IsInGame || !ZetaDia.IsInTown || item.IsAccountBound) { return(false); } Core.Logger.Log($"[DropItems] --> Dropping {item.Name} ({item.ActorSnoId}) in town. AnnId={item.AnnId} "); bool dropResult = false; try { dropResult = item.Drop(); } catch (InjectionSEHException) { Core.Logger.Log($"[DropItems] --> Failed to Drop {item.Name} ({item.ActorSnoId}) in town. AnnId={item.AnnId} "); DroppedItemAnnIds.Add(item.AnnId); } if (dropResult) { DroppedItemAnnIds.Add(item.AnnId); ItemEvents.FireItemDropped(item); await Coroutine.Sleep(500); return(true); } return(false); }
public void OnDropped() { if (IsPickupNoClick) { return; } if (IsPrimalAncient) { Core.Logger.Warn($"Primal {Name} dropped. (SnoId={ActorSnoId} Ann={AnnId} AcdId={AcdId} GbId={GameBalanceId}) InternalName={InternalName} Quality={ItemQualityLevel} Ancient={IsAncient} Primal={IsPrimalAncient} RawType={RawItemType}"); } else { Core.Logger.Log($"{Name} dropped. (SnoId={ActorSnoId} Ann={AnnId} AcdId={AcdId} GbId={GameBalanceId}) InternalName={InternalName} Quality={ItemQualityLevel} Ancient={IsAncient} Primal={IsPrimalAncient} RawType={RawItemType}"); } ItemEvents.FireItemDropped(this); }