Beispiel #1
0
        public async Task PetCast(PetSpell spell, Unit target)
        {
            var position = target.Index;

            if (target.IsEnemy)
            {
                if (spell.Name.Contains("超强"))
                {
                    position = 0x29;
                }

                if (spell.Name.Contains("强力"))
                {
                    position = position + 20;
                }
            }
            else
            {
                if (spell.Name.Contains("超强"))
                {
                    position = 0x28;
                }

                if (spell.Name.Contains("强力"))
                {
                    position = position + 20;
                }
            }

            await PetAction("W|" + spell.Index.ToString("X") + "|" + position.ToString("X"));
        }
Beispiel #2
0
        public async Task <bool> PetCast(PetSpell spell, Unit target = null)
        {
            if (spell == null)
            {
                return(false);
            }

            if (spell.MpCost > Cg.Combat.Units.Pet.Mp)
            {
                OnInfo($@"宠物行动:使用{spell.Name},Mp不足。");
                return(false);
            }

            if (target != null)
            {
                await Cg.Combat.PetCast(spell, target);

                return(true);
            }
            OnInfo($@"宠物行动:使用{spell.Name}。");
            if (spell.Name.Contains("护卫"))
            {
                await Cg.Combat.PetCast(spell, Cg.Combat.Units.GetLowestHpPerFriend());

                return(true);
            }
            if (spell.Name.Contains("强力"))
            {
                await Cg.Combat.PetCast(spell, Cg.Combat.Units.GetCrossEnemy());

                return(true);
            }
            if (spell.Name.Contains("魔法"))
            {
                await Cg.Combat.PetCast(spell, Cg.Combat.Units.GetRandomEnemy());

                return(true);
            }


            if (Cg.Combat.Units.Pet.IsInFront)
            {
                await Cg.Combat.PetCast(spell, Cg.Combat.Units.GetRandomEnemy());

                return(true);
            }
            else
            {
                await Cg.Combat.PetCast(spell, Cg.Combat.Units.GetRandomFrontEnemy());

                return(true);
            }
        }
Beispiel #3
0
 public async Task PetCast(PetSpell spell)
 {
     await PetAction("W|" + spell.Index.ToString("X"));
 }