public static void ReceiveAttack(Game.Entity attacker, SobNpcSpawn attacked, Attack attack, uint damage, Database.SpellInformation spell)
        {

            if (attacker.EntityFlag == EntityFlag.Player)
            {
                
                if (damage > attacked.Hitpoints)
                {
                   // if (attacker.MapID == 1039)
                      //  attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                    if (spell != null)
                        attacker.Owner.IncreaseSpellExperience(Math.Min(damage, attacked.Hitpoints), spell.ID);
                }
                else
                {
                   // if (attacker.MapID == 1039)
                     //   attacker.Owner.IncreaseExperience(damage, true);
                    if (spell != null)
                        attacker.Owner.IncreaseSpellExperience(damage, spell.ID);
                }
                if (attacker.MapID == 1038)
                {
                    if (attacked.UID == 810)
                    {
                        if (Game.ConquerStructures.Society.GuildWar.PoleKeeper == attacker.Owner.Guild)
                            return;
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        Game.ConquerStructures.Society.GuildWar.AddScore(damage, attacker.Owner.Guild);
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10001)
                    {
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Hitpoints = 0;
                            if (Game.Team.RScore > 0)
                            {
                                Game.Team.RScore -= 1;
                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Message("[CaptureTheFlag] RedFlag has Destroyed and RedTeam losed 1 Points and  Score Now for RedTeam:" + Game.Team.RScore + "", System.Drawing.Color.Black, Message.Center), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                            }
                        }
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10002)
                    {
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Hitpoints = 0;
                            if (Game.Team.BScore > 0)
                            {
                                Game.Team.BScore -= 1;
                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Message("[CaptureTheFlag] BlueFlag has Destroyed and BlueTeam losed 1 Points and  Score Now for BlueTeam:" + Game.Team.BScore + "", System.Drawing.Color.Black, Message.Center), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                            }
                        }
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10003)
                    {
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Hitpoints = 0;
                            if (Game.Team.WScore > 0)
                            {
                                Game.Team.WScore -= 1;
                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Message("[CaptureTheFlag] WhiteFlag has Destroyed and WhiteTeam losed 1 Points and  Score Now for WhiteTeam:" + Game.Team.WScore + "", System.Drawing.Color.Black, Message.Center), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                            }
                        }
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10004)
                    {
                        if (attacked.Hitpoints <= damage)
                        {
                            attacked.Hitpoints = 0;
                            if (Game.Team.BLScore > 0)
                            {
                                Game.Team.BLScore -= 1;
                                PhoenixProject.ServerBase.Kernel.SendWorldMessage(new Message("[CaptureTheFlag] BlackFlag has Destroyed and BlackTeam losed 1 Points and  Score Now for BlackTeam:" + Game.Team.BLScore + "", System.Drawing.Color.Black, Message.Center), PhoenixProject.ServerBase.Kernel.GamePool.Values);
                            }
                        }
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10011)
                    {
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        attacker.AddFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                        Game.Team.RedCapture = true;
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10012)
                    {
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        attacker.AddFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                        Game.Team.BlueCapture = true;
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10013)
                    {
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        attacker.AddFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                        Game.Team.WhiteCapture = true;
                    }
                }
                if (attacker.MapID == 2060)
                {
                    if (attacked.UID == 10014)
                    {
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        attacker.AddFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                        Game.Team.BlackCapture = true;
                    }
                }
                if (attacker.MapID == 2071)
                {
                    if (attacked.UID == 811)
                    {
                        if (Game.ConquerStructures.Society.EliteGuildWar.PoleKeeper == attacker.Owner.Guild)
                            return;
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        Game.ConquerStructures.Society.EliteGuildWar.AddScore(damage, attacker.Owner.Guild);
                    }
                }
                if (attacker.MapID == 1509)
                {
                    if (attacked.UID == 812)
                    {
                        if (Game.ClanWar.PoleKeeper == attacker.Myclan)
                            return;
                        if (attacked.Hitpoints <= damage)
                            attacked.Hitpoints = 0;
                        Game.ClanWar.AddScore(damage, attacker.Myclan);
                    }
                }
                if (attack.AttackType == Attack.Magic)
                {
                    if (attacked.Hitpoints <= damage)
                    {
                        attacked.Die(attacker);
                    }
                    else
                    {
                        attacked.Hitpoints -= damage;
                    }
                }
                else
                {
                    attacker.Owner.SendScreen(attack, true);
                    if (attacked.Hitpoints <= damage)
                    {
                        attacked.Die(attacker);
                    }
                    else
                    {
                        attacked.Hitpoints -= damage;
                        attacker.AttackPacket = attack;
                        attacker.AttackStamp = Time32.Now;
                    }
                }
            }
        }
Exemple #2
0
        public static void ReceiveAttack(Game.Entity attacker, SobNpcSpawn attacked, Attack attack, uint damage, Database.SpellInformation spell)
        {
            if (attacker.EntityFlag == EntityFlag.Player)
                if (attacker.MapID == 1017)
                {
                    if (attacked.UID == 8684)
                    {
                        if (attacked.Hitpoints == 0 && attacked.MaxHitpoints == 0)

                            attacked.Hitpoints = 0;
                        attacked.MaxHitpoints = 0;

                        attacker.AddFlag2(Update.Flags2.CaryingFlag);

                        //  Game.ConquerStructures.Society.GuildWar.AddScore(damage, attacker.Owner.Guild);
                    }
                }
            if (damage > attacked.Hitpoints)
            {
                if (attacker.MapID == 1039)
                    attacker.Owner.IncreaseExperience(Math.Min(damage, attacked.Hitpoints), true);
                if (spell != null)
                    attacker.Owner.IncreaseSpellExperience(Math.Min(damage, attacked.Hitpoints), spell.ID);
            }
            else
            {
                if (attacker.MapID == 1039)
                    attacker.Owner.IncreaseExperience(damage, true);
                if (spell != null)
                    attacker.Owner.IncreaseSpellExperience(damage, spell.ID);
            }
            if (attacker.MapID == 1038)
            {
                if (attacked.UID == 810)
                {
                    if (Game.ConquerStructures.Society.GuildWar.PoleKeeper == attacker.Owner.Guild)
                        return;
                    if (attacked.Hitpoints <= damage)
                        attacked.Hitpoints = 0;
                    Game.ConquerStructures.Society.GuildWar.AddScore(damage, attacker.Owner.Guild);
                }
            }

            if (attack.AttackType == Attack.Magic)
            {
                if (attacked.Hitpoints <= damage)
                {
                    attacked.Die(attacker);
                }
                else
                {
                    attacked.Hitpoints -= damage;
                }
            }
            else
            {
                attacker.Owner.SendScreen(attack, true);
                if (attacked.Hitpoints <= damage)
                {
                    attacked.Die(attacker);
                }
                else
                {
                    attacked.Hitpoints -= damage;
                    attacker.AttackPacket = attack;
                    attacker.AttackStamp = Time32.Now;
                }
            }
        }
        public static void ReceiveAttack(Game.Entity attacker, Game.Entity attacked, Attack attack, uint damage, Database.SpellInformation spell)
        {
            //Console.WriteLine("ssS");
            if (attacked.EntityFlag == EntityFlag.Player)
            {
                if (attacked.Action == Enums.ConquerAction.Sit)
                    if (attacked.Stamina > 20)
                        attacked.Stamina -= 20;
                    else
                        attacked.Stamina = 0;
                attacked.Action = Enums.ConquerAction.None;
                //Console.WriteLine("ssS");
            }
            #region TeamSkill
            if (attacker.MapID == KimoSkillWar.MapID && attacker.Owner.YellowOn == true)
            {
                if (attacker.Owner.YellowOn == true && attacked.Owner.YellowOn == true)
                    return;
                damage = 1;
                #region Disqualification & Spell check
                try
                {
                    if (spell == null)
                    {
                        attacker.Owner.Send(new Message("Only Skills is allowed!", System.Drawing.Color.Red, Message.TopLeft));
                        return;
                    }
                    else
                    {
                        if (!ServerBase.Constants.SkillTeamSkills.Contains(spell.ID))
                        {
                            attacker.Owner.Send(new Message("Only Skills is allowed!", System.Drawing.Color.Red, Message.TopLeft));
                            return;
                        }

                    }
                }
                catch { }
                #endregion

                /*if (attacked.Owner.Equipment.Objects[8].ID == attacker.Owner.Equipment.Objects[8].ID)
                    return;*/

                KimoSkillWar.YKills += 1;
                return;
            }
            if (attacker.MapID == KimoSkillWar.MapID && attacker.Owner.RedOn == true)
            {
                if (attacker.Owner.RedOn == true && attacked.Owner.RedOn == true)
                    return;
                damage = 1;
                #region Disqualification & Spell check
                try
                {
                    if (spell == null)
                    {
                        attacker.Owner.Send(new Message("Only Skills is allowed!", System.Drawing.Color.Red, Message.TopLeft));
                        return;
                    }
                    else
                    {
                        if (!ServerBase.Constants.SkillTeamSkills.Contains(spell.ID))
                        {
                            attacker.Owner.Send(new Message("Only Skills is allowed!", System.Drawing.Color.Red, Message.TopLeft));
                            return;
                        }

                    }
                }
                catch { }
                #endregion

                if (attacked.Owner.Equipment.Objects[8].ID == attacker.Owner.Equipment.Objects[8].ID)
                    return;

                KimoSkillWar.RKills += 1;
                return;
            }
            #endregion

           // if (!(attacked.Name.Contains("Guard") && attacked.EntityFlag == EntityFlag.Monster))
            if (attacker.EntityFlag == EntityFlag.Player && !attacked.Name.Contains("Guard"))
            {
                if (attacked.EntityFlag == EntityFlag.Monster)
                {
                    if (damage > attacked.Hitpoints)
                    {
                        attacker.Owner.IncreaseExperience(Calculate.CalculateExpBonus(attacker.Level, attacked.Level, Math.Min(damage, attacked.Hitpoints)), true);
                        if (spell != null)
                            attacker.Owner.IncreaseSpellExperience((uint)Calculate.CalculateExpBonus(attacker.Level, attacked.Level, Math.Min(damage, attacked.Hitpoints)), spell.ID);
                    }
                    else
                    {
                        attacker.Owner.IncreaseExperience(Calculate.CalculateExpBonus(attacker.Level, attacked.Level, damage), true);
                        if (spell != null)
                            attacker.Owner.IncreaseSpellExperience((uint)Calculate.CalculateExpBonus(attacker.Level, attacked.Level, damage), spell.ID);
                    }
                }
                else
                {
                    if (attacked.EntityFlag == EntityFlag.Player)
                    {
                        if (spell != null)
                            attacker.Owner.IncreaseSpellExperience((uint)Calculate.CalculateExpBonus(attacker.Level, attacked.Level, damage), spell.ID);
                    }
                }

            }
           

            if (attack.AttackType == Attack.Magic)
            {
                if (attacked.Hitpoints <= damage)
                {
                    if (attacker.Owner.QualifierGroup != null)
                        attacker.Owner.QualifierGroup.UpdateDamage(attacker.Owner, attacked.Hitpoints);
                    attacked.CauseOfDeathIsMagic = true;
                    if (attacker.MapID == 2060)
                    {
                        if (attacked.ContainsFlag2(Network.GamePackets.Update.Flags2.CaryingFlag))
                        {
                            attacked.RemoveFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                            attacker.AddFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                        }
                    }
                    attacked.Die(attacker);
                }
                else
                {
                    if (attacker.Owner.QualifierGroup != null)
                        attacker.Owner.QualifierGroup.UpdateDamage(attacker.Owner, damage);
                    attacked.Hitpoints -= damage;
                }
            }
            else
            {
                if (attacked.Hitpoints <= damage)
                {
                    if (attacked.EntityFlag == EntityFlag.Player)
                    {
                        if (attacker.Owner.QualifierGroup != null)
                            attacker.Owner.QualifierGroup.UpdateDamage(attacker.Owner, attacked.Hitpoints);
                        attacked.Owner.SendScreen(attack, true);
                        attacker.AttackPacket = null;
                        if (attacker.MapID == 2060)
                        {
                            if (attacked.ContainsFlag2(Network.GamePackets.Update.Flags2.CaryingFlag))
                            {
                                attacked.RemoveFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                                attacker.AddFlag2(Network.GamePackets.Update.Flags2.CaryingFlag);
                            }
                        }
                    }
                    else
                    {
                        attacked.MonsterInfo.SendScreen(attack);
                    }
                    attacked.Die(attacker);
                }
                else
                {
                    attacked.Hitpoints -= damage;
                    if (attacked.EntityFlag == EntityFlag.Player)
                    {
                        if (attacker.Owner.QualifierGroup != null)
                            attacker.Owner.QualifierGroup.UpdateDamage(attacker.Owner, damage);
                        attacked.Owner.SendScreen(attack, true);
                    }
                    else
                        attacked.MonsterInfo.SendScreen(attack);
                    attacker.AttackPacket = attack;
                    attacker.AttackStamp = Time32.Now;
                }
            }
        }