Exemplo n.º 1
0
        public void Use2(Entities.BossMonster boss, Entities.GameClient target)
        {
            if (!target.Alive)
                return;

            #region SkillAnimation + Power
            if (RealSkill != -1)
            {
                var usespell = new Packets.UseSpellPacket();

                usespell.EntityUID = boss.EntityUID;
                usespell.SpellID = (ushort)RealSkill;
                usespell.SpellX = boss.X;
                usespell.SpellY = boss.Y;
                usespell.SpellLevel = RealSkilllevel;

                if (PercentTageEffect != -1)
                {
                    int damage = (target.HP / PercentTageEffect);
                    usespell.AddTarget(target.EntityUID, (uint)damage);
                    target.HP -= damage;
                    if (target.HP <= 0)
                    {
                        Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                    }
                }
                else if (DamageEffect > 0)
                {
                    int damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(DamageEffect / 2, DamageEffect);
                    usespell.AddTarget(target.EntityUID, (uint)damage);
                    target.HP -= damage;
                    if (target.HP <= 0)
                    {
                        Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                    }
                }
                else
                    usespell.AddTarget(target.EntityUID, 0);

                boss.Screen.UpdateScreen(usespell);
            }
            else
            {
                using (var interact = new Packets.InteractionPacket())
                {
                    interact.Action = Enums.InteractAction.Attack;
                    interact.EntityUID = boss.EntityUID;
                    interact.TargetUID = target.EntityUID;
                    interact.UnPacked = true;
                    interact.X = target.X;
                    interact.Y = target.Y;
                    if (PercentTageEffect != -1)
                    {
                        int damage = (target.HP / PercentTageEffect);
                        interact.Data = (uint)damage;

                        target.HP -= damage;
                        if (target.HP <= 0)
                        {
                            Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                        }
                    }
                    else if (DamageEffect > 0)
                    {
                        int damage = ProjectX_V3_Lib.ThreadSafe.RandomGenerator.Generator.Next(DamageEffect / 2, DamageEffect);
                        interact.Data = (uint)damage;

                        target.HP -= damage;
                        if (target.HP <= 0)
                        {
                            Packets.Interaction.Battle.Combat.Kill(boss, target, (uint)damage);
                        }
                    }
                    else
                        interact.Data = 0;
                    boss.Screen.UpdateScreen(interact);
                }
            }
            #endregion

            #region Freeze
            if (Freeze)
            {
                target.AddStatusEffect1(Enums.Effect1.IceBlock, FreezeTime);
            }
            #endregion

            #region Paralyze
            if (Paralyzed)
            {
                target.ParalyzeClient(ParalyzeTime);
            }
            #endregion
        }