Пример #1
0
        private bool CastSkillAt(uint skillId, Creature target)
        {
            while (core.me.isCasting || core.me.isGlobalCooldown)
                Thread.Sleep(50);

            double x = target.X;
            double z = target.Z;
            double y = target.Y;

            if (!core.UseSkill(skillId, x, y, z))
            {
                if (target != null && core.GetLastError() == LastError.NoLineOfSight)
                {
                    if (core.dist(target) <= 5)
                        core.ComeTo(target, 2);
                    else if (core.dist(core.me.target) <= 10)
                        core.ComeTo(target, 3);
                    else if (core.dist(target) < 20)
                        core.ComeTo(target, 8);
                    else
                        core.ComeTo(target, 8);
                }
            }

            while ((core.me.isCasting && target.dist(x, y, z) < 1) || core.me.isGlobalCooldown)
                Thread.Sleep(10);

            return true;
        }