Exemplo n.º 1
0
        public int FindFreeSkill(ObjNPC npc, ObjCharacter target)
        {
            foreach (var i in skills)
            {
                var        skillId = i;
                ErrorCodes result;
                switch (skillId)
                {
                case 7:
                    if (npc.BuffList.IsHaveBuffById(7))
                    {
                        continue;
                    }
                    result = npc.CheckUseSkill(ref skillId, npc);
                    break;

                case 111:
                    if (npc.BuffList.IsHaveBuffById(114))
                    {
                        continue;
                    }
                    result = npc.CheckUseSkill(ref skillId, npc);
                    break;

                case 209:
                    if (npc.BuffList.IsHaveBuffById(211))
                    {
                        continue;
                    }
                    result = npc.CheckUseSkill(ref skillId, npc);
                    break;

                case 208:
                    if (npc.BuffList.IsHaveBuffById(210))
                    {
                        continue;
                    }
                    result = npc.CheckUseSkill(ref skillId, npc);
                    break;

                default:
                    result = npc.CheckUseSkill(ref skillId, target);
                    break;
                }
                if (result == ErrorCodes.OK || result == ErrorCodes.Error_SkillDistance)
                {
                    return(i);
                }
            }
            return(normalSkill);
        }