private bool AllowStartCast() { if (_caster.BlockedByCC(_pendingInfo.ConstantInfo)) { return(false); } if (_abInterface.IsOnCooldown(_pendingInfo)) { return(false); } if (_pendingItemCooldownGroup > 0 && !_abInterface.CanCastItemGroupCooldown(_pendingItemCooldownGroup)) { return(false); } Player plr = _caster as Player; if (plr != null) { if (plr.StealthLevel > 0 && _pendingInfo.ConstantInfo.StealthInteraction == AbilityStealthType.Block) { return(false); } if (_pendingInfo.SpecialCost != 0) { if (_pendingInfo.SpecialCost > 0) { if (!plr.CrrInterface.HasResource((byte)_pendingInfo.SpecialCost)) { return(false); } } else if (plr.MoraleLevel < -_pendingInfo.SpecialCost || !_abInterface.IsValidMorale(_pendingInfo.Entry, (byte)(-_pendingInfo.SpecialCost))) { return(false); } } } if (_pendingInfo.Target != null) { if (_pendingInfo.Target.IsDead ^ _pendingInfo.ConstantInfo.AffectsDead) { return(false); } if (_pendingInfo.Target != _caster) { uint abRange = (uint)_pendingInfo.Target.GetAbilityRangeTo(_caster); uint maxRange = _pendingInfo.Range; if (_caster.IsMoving && _pendingInfo.Target.IsMoving) { maxRange = maxRange + 5; } if (abRange > maxRange || abRange < _pendingInfo.MinRange) { return(false); } } } if (_caster.ItmInterface != null) { return(_caster.ItmInterface.WeaponCheck(_pendingInfo.ConstantInfo.WeaponNeeded) == AbilityResult.ABILITYRESULT_OK); } return(true); }