private static async Task <SetChocoboStanceResult> SetChocoboStance(CompanionStance stance) { if (ChocoboManager.Stance == stance) { return(SetChocoboStanceResult.Success); } switch (stance) { case CompanionStance.Follow: Logger.SendLog("Switching " + ChocoboName + " to follow stance."); ChocoboManager.Follow(); break; case CompanionStance.Free: Logger.SendLog("Switching " + ChocoboName + " to free stance."); ChocoboManager.FreeStance(); break; case CompanionStance.Defender: Logger.SendLog("Switching " + ChocoboName + " to defender stance."); ChocoboManager.DefenderStance(); break; case CompanionStance.Attacker: Logger.SendLog("Switching " + ChocoboName + " to attacker stance."); ChocoboManager.AttackerStance(); break; case CompanionStance.Healer: Logger.SendLog("Switching " + ChocoboName + " to healer stance."); ChocoboManager.HealerStance(); break; default: throw new ArgumentOutOfRangeException(nameof(stance), stance, null); } await Coroutine.Wait(TimeSpan.FromMilliseconds(200), () => ChocoboManager.Stance == stance); return(ChocoboManager.Stance == stance ? SetChocoboStanceResult.Success : SetChocoboStanceResult.Failure); }
private static async Task <bool> ChangeStance(CompanionStance stance) { if (Me.IsMounted) { return(false); } Logger.BokoLog(@"====> {0}", @"Changing stance to " + stance + "."); switch (stance) { case CompanionStance.Healer: HealerStance(); await Coroutine.Wait(2000, () => Stance == CompanionStance.Healer); break; case CompanionStance.Defender: DefenderStance(); await Coroutine.Wait(2000, () => Stance == CompanionStance.Defender); break; case CompanionStance.Attacker: AttackerStance(); await Coroutine.Wait(2000, () => Stance == CompanionStance.Attacker); break; case CompanionStance.Free: FreeStance(); await Coroutine.Wait(2000, () => Stance == CompanionStance.Free); break; } return(false); }
public static void LoadThresholdOrders() { lowestThreshold1 = LowestThreshold1(); if (lowestThreshold1 != 0) { lowestThreshold2 = LowestThreshold2(); } else { LowestThresholdValue2 = 0; lowestThreshold2 = 0; } if (lowestThreshold2 != 0) { lowestThreshold3 = LowestThreshold3(); } else { LowestThresholdValue3 = 0; lowestThreshold3 = 0; } if (lowestThreshold3 != 0) { lowestThreshold4 = LowestThreshold4(); } else { LowestThresholdValue4 = 0; lowestThreshold4 = 0; } if (lowestThreshold4 != 0) { highestThreshold1 = 0; highestThreshold2 = 0; highestThreshold3 = 0; highestThreshold4 = 0; HighestThresholdValue1 = 100; HighestThresholdValue2 = 100; HighestThresholdValue3 = 100; HighestThresholdValue4 = 100; } else { highestThreshold1 = HighestThreshold1(); if (highestThreshold1 != 0) { highestThreshold2 = HighestThreshold2(); } else { HighestThresholdValue2 = 100; highestThreshold2 = 0; } if (highestThreshold2 != 0) { highestThreshold3 = HighestThreshold3(); } else { HighestThresholdValue3 = 100; highestThreshold3 = 0; } if (highestThreshold3 != 0) { highestThreshold4 = HighestThreshold4(); } else { HighestThresholdValue4 = 100; highestThreshold4 = 0; } } }