protected override async Task <bool> Main() { if (!ScriptManager.GetCondition(Condition)()) { Logger.Info(Localization.Localization.ExSalvage_GetCondition, Condition); return(isDone = true); } if (MovementManager.IsFlying #if !RB_CN || MovementManager.IsDiving #endif ) { Logger.Error(Localization.Localization.ExSalvage_Land); return(isDone = true); } await CommonTasks.StopAndDismount(); if (RepairClass > ClassJobType.Thaumaturge && RepairClass < ClassJobType.Miner) { await SalvageDialog.DesynthesizeByRepairClass(RepairClass, (ushort)MaxWait, IncludeArmory, NqOnly); } if (ItemIds != null && ItemIds.Length > 0) { foreach (var id in ItemIds) { await SalvageDialog.DesynthesizeByItemId((uint)id, (ushort)MaxWait, IncludeArmory, NqOnly); } } return(isDone = true); }
protected override async Task <bool> Main() { if (!ScriptManager.GetCondition(Condition)()) { Logger.Info(Localization.Localization.ExSalvage_GetCondition, Condition); return(isDone = true); } var ticks = 0; while (MovementManager.IsFlying && ticks++ < 5 && Behaviors.ShouldContinue) { MovementManager.StartDescending(); await Coroutine.Wait(500, () => !MovementManager.IsFlying); } if (ticks > 5) { Logger.Error(Localization.Localization.ExSalvage_Land); return(isDone = true); } await CommonTasks.StopAndDismount(); if (RepairClass > ClassJobType.Thaumaturge && RepairClass < ClassJobType.Miner) { await SalvageDialog.DesynthesizeByRepairClass(RepairClass, (ushort)MaxWait, IncludeArmory, NqOnly); } if (ItemIds != null && ItemIds.Length > 0) { foreach (var id in ItemIds) { await SalvageDialog.DesynthesizeByItemId((uint)id, (ushort)MaxWait, IncludeArmory, NqOnly); } } return(isDone = true); }