Пример #1
0
        private void handle(Player p, Reader r)
        {
            Attack attack = new Attack(r, p, false);

            Console.WriteLine("Magic: " + attack.getSkill());

            Mist mist = null;
            if (attack.getSkill() > 0)
            {
                SkillWz skillWz = Library.getSkill(attack.getSkill());
                Skill s = p.getSkillsManager().getSkill(attack.getSkill());
                if (s == null)
                    return; // player doesn't have the skill
                if (s.getLevel() <= 0)
                    return; // trying to use a skill that isn't atleast level 1

                attack.setLevel(s.getLevel());

                Info i = skillWz.getLevel(s.getLevel());

                int hpCon = i.getInt("hpCon");
                int mpCon = i.getInt("mpCon");
                int x = i.getInt("x");
                int prop = i.getInt("prop");
                int time = i.getInt("time") * 1000; // Status effects for monsters
                int mobCount = i.getInt("mobCount");
                int attackCount = i.getInt("attackCount");
                int cooltime = i.getInt("cooltime");

                if (p.getCooldown(attack.getSkill()) != null)
                {
                    p.send(Packets.enableActions());
                    return;
                }
Пример #2
0
        public void Cast()
        {
            if (!Character.IsAlive)
            {
                return;
            }
            if (IsCoolingDown)
            {
                return;
            }

            Character.Stats.Health -= CostHP;
            Character.Stats.Mana   -= CostMP;

            if (Cooldown > 0)
            {
                CooldownEnd = DateTime.Now.AddSeconds(Cooldown);
            }

            if (CostItem > 0)
            {
            }

            if (CostBullet > 0)
            {
            }

            if (CostMeso > 0)
            {
            }

            if (MapleID == (int)CharacterConstants.SkillNames.FirePoisonMage.PoisonMist)
            {
                Point mistMaxLT = new Point(-200, -150);
                Point mistMaxRB = new Point(200, 150);

                Rectangle boundingBox = new Rectangle(mistMaxLT + Character.Position, mistMaxRB + Character.Position);

                Mist poisonMist = new Mist(boundingBox, Character, this);
                //Mist.SpawnMist(Character.Client, poisonMist);
                //get damage ticks of poisoned mobs within bounds
            }

            if (MapleID == (int)CharacterConstants.SkillNames.FirePoisonWizard.PoisonBreath)
            {
                Mob victim = Character.ControlledMobs.FirstOrDefault();

                victim?.Buff(MobConstants.MobStatus.Poisoned, 1, this);
            }
        }
Пример #3
0
        public void Cast()
        {
            if (this.IsCoolingDown)
            {
                return;
            }

            this.Character.Health -= this.CostHP;
            this.Character.Mana   -= this.CostMP;

            if (this.CostItem > 0)
            {
            }

            if (this.CostBullet > 0)
            {
            }

            if (this.CostMeso > 0)
            {
            }

            if (this.Cooldown > 0)
            {
                this.CooldownEnd = DateTime.Now.AddSeconds(this.Cooldown);
            }

            if (this.MapleID == (int)SkillNames.FirePoisonMage.PoisonMist)
            {
                Point mistMaxLT = new Point(-200, -150);
                Point mistMaxRB = new Point(200, 150);

                Rectangle boundingBox = new Rectangle(mistMaxLT + this.Character.Position, mistMaxRB + this.Character.Position);

                Mist poisonMist = new Mist(boundingBox, this.Character, this);
                //Mist.SpawnMist(this.Character.Client, poisonMist);
                //get damage ticks of poisoned mobs within bounds
            }

            if (this.MapleID == (int)SkillNames.FirePoisonWizard.PoisonBreath)
            {
                Mob victim = this.Character.ControlledMobs.FirstOrDefault();
                if (victim != null)
                {
                    victim.Buff(MobStatus.Poisoned, 1, this);
                }
            }
        }