public bool Invoke(AbilityInfo info) { if (!InvokeAbility.CanBeCasted() || _invokeSleeper.Sleeping) { Log.Info($"can't invoke (cd) {(int)InvokeAbility.Cooldown + 1}"); return(false); } if (!CheckSpheresForLevel(info)) { return(false); } info.One.UseAbility(); info.Two.UseAbility(); info.Three.UseAbility(); /*if (!Check(info)) * { * Log.Error("wrong spheres -> " + SpCounter + " let's recast"); * return false; * }*/ InvokeAbility.UseAbility(); _invokeSleeper.Sleep(250); Log.Info($"invoke: [{info.Ability.Name}]"); return(true); }
public async Task <bool> InvokeAsync(AbilityInfo info) { Log.Info($"Try to invoke -> {info.Ability.GetAbilityId()} ({info.Name})"); if (!InvokeAbility.CanBeCasted()) { Log.Info($"can't invoke (cd) {InvokeAbility.Cooldown + 1}"); return(false); } if (!CheckSpheresForLevel(info)) { return(false); } //BlockActions = true; if (Config.SmartInvoke) { var sphereDelay = Config.InvokeTime; info.One.UseAbility(); await Task.Delay(sphereDelay); info.Two.UseAbility(); await Task.Delay(sphereDelay); info.Three.UseAbility(); await Task.Delay(sphereDelay); if (!Check(info)) { Log.Error("wrong spheres -> " + SpCounter + " let's recast"); await Task.Delay(sphereDelay); return(false); } } else if (Config.ExpInvoke) { Owner.Stop(); info.One.UseAbility(true); info.Two.UseAbility(true); info.Three.UseAbility(true); } else { info.One.UseAbility(); info.Two.UseAbility(); info.Three.UseAbility(); } InvokeAbility.UseAbility(); Log.Info($"invoke: [{info.Ability.Name}]"); await Task.Delay(Config.AfterInvokeDelay); //BlockActions = false; return(true); }
public async Task <bool> InvokeAsync(AbilityInfo info) { if (!InvokeAbility.CanBeCasted()) { Log.Info($"can't invoke (cd) {(int)InvokeAbility.Cooldown + 1}"); return(false); } if (!CheckSpheresForLevel(info)) { return(false); } if (Config.SmartInvoke) { var sphereDelay = Config.InvokeTime; info.One.UseAbility(); await Task.Delay(sphereDelay); info.Two.UseAbility(); await Task.Delay(sphereDelay); info.Three.UseAbility(); await Task.Delay(sphereDelay); if (!Check(info)) { Log.Error("wrong spheres -> " + SpCounter + " let's recast"); await Task.Delay(sphereDelay); return(false); } } else { info.One.UseAbility(); info.Two.UseAbility(); info.Three.UseAbility(); } InvokeAbility.UseAbility(); Log.Info($"invoke: [{info.Ability.Name}]"); await Task.Delay(Config.AfterInvokeDelay); return(true); }