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; } } }