|
المشاركات 1,941 |
+التقييم 0.99 |
تاريخ التسجيل Apr 2019 |
الاقامة Egypt |
نظام التشغيل windows 7 |
رقم العضوية 1 |
public static readonly System.Collections.Generic.List<ushort> PKFreeMaps = new System.Collections.Generic.List<ushort>()
public static readonly System.Collections.Generic.List<ushort> PKJiangHu = new System.Collections.Generic.List<ushort>()
{
1011,
1015,
1020,
1000
};
public static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
public static bool CanAttack(Game.Entity attacker, Game.Entity attacked, Database.SpellInformation spell, bool melee)
{
if (attacker.EntityFlag == EntityFlag.Player)
if (attacker.PKMode == Enums.PKMode.JiangHu)
if (Constants.PKJiangHu.Contains(attacker.Owner.Map.ID))
if (attacked.EntityFlag == EntityFlag.Player)
if (attacked.PKMode == Enums.PKMode.JiangHu)
if (Constants.PKJiangHu.Contains(attacked.Owner.Map.ID))
return true;
if (attacked.EntityFlag == EntityFlag.Monster)
if (attacked.MonsterInfo.ID == MonsterInformation.ReviverID)
return false;
if (attacked.Dead) return false;
if (attacker.EntityFlag == EntityFlag.Player)
if (attacker.Owner.WatchingElitePKMatch != null)
return false;
if (attacked.EntityFlag == EntityFlag.Player)
if (attacked.Owner.WatchingElitePKMatch != null)
return false;
if (attacker.EntityFlag == EntityFlag.Player)
if (attacked != null && attacked.EntityFlag == EntityFlag.Player)
if (attacker.Owner.InTeamQualifier() && attacked.Owner.InTeamQualifier())
return !attacker.Owner.Team.IsTeammate(attacked.UID);
if (attacker.MapID == CaptureTheFlag.MapID)
if (!CaptureTheFlag.Attackable(attacker) || !CaptureTheFlag.Attackable(attacked))
return false;
if (attacker.MapID == DeathMatch.MAPID)
return attacker.TeamDeathMatchTeamKey != attacked.TeamDeathMatchTeamKey;
if (spell != null)
if (spell.CanKill && attacker.EntityFlag == EntityFlag.Player && Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID) && attacked.EntityFlag == EntityFlag.Player && (attacker.TalentStaus == 0))
return false;
if (attacker.EntityFlag == EntityFlag.Player)
if (attacker.Owner.WatchingGroup != null)
return false;
if (attacked == null)
return false;
if (attacked.Dead)
{
attacker.AttackPacket = null;
return false;
}
if (attacker.EntityFlag == EntityFlag.Player && attacked.EntityFlag == EntityFlag.Player)
if ((attacker.Owner.InQualifier() && attacked.Owner.IsWatching()) || (attacked.Owner.InQualifier() && attacker.Owner.IsWatching()))
return false;
if (attacker.EntityFlag == EntityFlag.Player)
if (Time32.Now < attacker.Owner.CantAttack)
return false;
if (attacked.EntityFlag == EntityFlag.Monster)
{
if (attacked.Companion)
{
if (Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID))
{
if (attacked.Owner == attacker.Owner)
return false;
if (attacker.PKMode != Conquer_Online_Server.Game.Enums.PKMode.PK &&
attacker.PKMode != Conquer_Online_Server.Game.Enums.PKMode.Team)
return false;
else
{
attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
attacker.FlashingNameStamp = Time32.Now;
attacker.FlashingNameTime = 10;
return true;
}
}
}
if (attacked.Name.Contains("[P|O|L|I|C|E]"))
{
if (attacker.PKMode != Conquer_Online_Server.Game.Enums.PKMode.PK &&
attacker.PKMode != Conquer_Online_Server.Game.Enums.PKMode.Team)
return false;
else
{
attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
attacker.FlashingNameStamp = Time32.Now;
attacker.FlashingNameTime = 10;
return true;
}
}
else
return true;
}
else
{
if (attacked.EntityFlag == EntityFlag.Player)
if (!attacked.Owner.Attackable)
return false;
if (attacker.EntityFlag == EntityFlag.Player)
if (attacker.Owner.WatchingGroup == null)
if (attacked.EntityFlag == EntityFlag.Player)
if (attacked.Owner.WatchingGroup != null)
return false;
if (spell != null)
{//Ahmed Samak : fixing the scatter on fly issue .. the condition below to constraint the cecking for the attacked is on ground or not on any spell except the scatter.
if (spell.ID != 8001)
{
if (spell.OnlyGround)
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
if (melee && attacked.ContainsFlag(Update.Flags.Fly))
return false;
}
}
if (spell != null)
{
if (spell.ID == 6010)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
}
}
if (spell != null)
{
if (spell.ID == 10381)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
}
}
if (spell != null)
{
if (spell.ID == 6000)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
}
}
if (spell != null)
{
if (spell.ID == 5030)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
}
}
if (spell == null)
{
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
}
if (Constants.PKForbiddenMaps.Contains(attacker.Owner.Map.ID))
{
if (attacker.PKMode == Enums.PKMode.JiangHu)
{
if (attacked == null)
{
return false;
}
if ((attacker.TalentStaus >= 1) && (attacked.TalentStaus == 0))
{
attacker.Owner.Send(new Message("Sorry You Can't Attack Players Not in Jiang Hu Mode", System.Drawing.Color.Red, 0x7dc));
attacker.AttackPacket = null;
return false;
}
if (((attacker.TalentStaus >= 1) && (attacked.TalentStaus >= 1)) && Allyss(attacker, attacked))
{
attacker.AttackPacket = null;
return false;
}
if (((attacked.EntityFlag == EntityFlag.Player) && (attacker.EntityFlag == EntityFlag.Player)) &&
((attacker.TalentStaus >= 1) && (attacked.TalentStaus >= 1)) &&
(Constants.PKJiangHu.Contains(attacker.Owner.Map.ID)))
{
if ((attacker.EntityFlag == EntityFlag.Player) && (attacker.Owner.WatchingGroup != null))
{
return false;
}
if (attacked.Dead)
{
attacker.AttackPacket = null;
return false;
}
}
return true;
}
if (((attacker.PKMode == Enums.PKMode.PK) || (attacker.PKMode == Enums.PKMode.Team)) || ((spell != null) && spell.CanKill))
{
attacker.Owner.Send(Constants.PKForbidden);
attacker.AttackPacket = null;
}
return false;
}
if (attacker.PKMode == Conquer_Online_Server.Game.Enums.PKMode.Capture)
{
if (attacked.ContainsFlag(Update.Flags.FlashingName) || attacked.PKPoints > 99)
{
return true;
}
}
if (attacker.PKMode == Conquer_Online_Server.Game.Enums.PKMode.Peace)
{
return false;
}
if (attacker.UID == attacked.UID)
return false;
if (attacker.PKMode == Conquer_Online_Server.Game.Enums.PKMode.Team)
{
if (attacker.Owner.Team != null)
{
if (attacker.Owner.Team.IsTeammate(attacked.UID))
{
attacker.AttackPacket = null;
return false;
}
}
if (attacker.GuildID == attacked.GuildID && attacker.GuildID != 0)
{
attacker.AttackPacket = null;
return false;
}
if (attacker.ClanId == attacked.ClanId && attacker.ClanId != 0)
{
attacker.AttackPacket = null;
return false;
}
if (attacker.Owner.Friends.ContainsKey(attacked.UID))
{
attacker.AttackPacket = null;
return false;
}
if (attacker.Owner.Guild != null)
{
if (attacker.Owner.Guild.Ally.ContainsKey(attacked.GuildID))
{
attacker.AttackPacket = null;
return false;
}
}
if (attacker.ClanId != 0)
{
if (attacker.GetClan.Allies.ContainsKey(attacked.ClanId))
{
attacker.AttackPacket = null;
return false;
}
}
}
if (spell != null)
if (spell.OnlyGround)
if (attacked.ContainsFlag(Update.Flags.Fly))
return false;
if (spell != null)
if (!spell.CanKill)
return true;
if (attacker.PKMode != Conquer_Online_Server.Game.Enums.PKMode.PK &&
attacker.PKMode != Conquer_Online_Server.Game.Enums.PKMode.Team && attacked.PKPoints < 99)
{
attacker.AttackPacket = null;
return false;
}
if (attacker.PKMode == Enums.PKMode.JiangHu)
{
if (attacked == null)
{
return false;
}
if (((attacker.TalentStaus >= 1) && (attacked.TalentStaus == 0)) && Allyss(attacker, attacked))
{
attacker.AttackPacket = null;
return false;
}
if (((attacked.EntityFlag == EntityFlag.Player) &&
(attacker.EntityFlag == EntityFlag.Player)) &&
((attacker.TalentStaus >= 1) && (attacked.TalentStaus >= 1)) &&
(Constants.PKJiangHu.Contains(attacker.Owner.Map.ID)))
{
if ((attacker.EntityFlag == EntityFlag.Player) && (attacker.Owner.WatchingGroup != null))
{
return false;
}
if (attacked.Dead)
{
attacker.AttackPacket = null;
return false;
}
}
return true;
}
if (((attacker.TalentStaus == 0) && (attacked.TalentStaus >= 1)) && Allyss(attacker, attacked))
{
attacker.AttackPacket = null;
return false;
}
else
{
if (!attacked.ContainsFlag(Update.Flags.FlashingName))
{
if (!attacked.ContainsFlag(Update.Flags.BlackName))
{
if (Constants.PKFreeMaps.Contains(attacker.MapID))
return true;
//if (Constants.PKJiangHu.Contains(attacker.MapID))
// return true;
if (Constants.Damage1Map.Contains(attacker.MapID))
return true;
if (attacker.Owner.Map.BaseID == 700)
return true;
attacker.AddFlag(Network.GamePackets.Update.Flags.FlashingName);
attacker.FlashingNameStamp = Time32.Now;
attacker.FlashingNameTime = 10;
}
}
}
return true;
}
}
if (Constants.PKFreeMaps.Contains(killer.MapID))
goto Over;
if (Constants.PKJiangHu.Contains(killer.MapID) && killer.PKMode == Enums.PKMode.JiangHu)
goto Over;
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
حل مشكله كود التسيف فى الجانج | Mr. Co | تطوير سيرفرات كونكر | 2 | 2019-08-01 11:31 AM |
التحكم بصعوبة او سهولة الجانج | Tefa | تطوير سيرفرات كونكر | 23 | 2019-07-29 03:08 AM |
مشكلة فى الجانج يجماعة | osama | مشكلات السيرفيرات كونكر الشخصيه | 16 | 2019-07-23 01:43 AM |
مشكلة بخصوص الجانج | osama | مشكلات السيرفيرات كونكر الشخصيه | 11 | 2019-07-13 11:00 AM |