|
المشاركات 1,990 |
+التقييم 1.05 |
تاريخ التسجيل Jun 2019 |
الاقامة |
نظام التشغيل ويندوز 0 |
رقم العضوية 279 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KhaledMohamed.Network.GamePackets;
using KhaledMohamed.Client;
using System.Collections.Concurrent;
using KhaledMohamed.Game.ConquerStructures.Society;
using KhaledMohamed.Network;
using KhaledMohamed.Database;
namespace KhaledMohamed.Game
{
public class CaptureTheFlag
{
public class CTF_Rank : Writer
{
private byte[] Packet;
public CTF_Rank(GameState client)
{
this.Packet = new byte[354];
Writer.WriteUInt16(346, 0, this.Packet);
Writer.WriteUInt16(1063, 2, this.Packet);
this.Packet[4] = 9;
this.Packet[6] = 1;
this.Packet[14] = 8;
Writer.WriteUInt32(client.Guild.CTFPoints, 18, this.Packet);
}
public void Send(GameState client)
{
client.Send(this.ToArray());
}
public byte[] ToArray()
{
ushort num = 30;
Guild[] array = (
from p in Kernel.Guilds.Values
where p.CTFPoints != 0u
orderby p.CTFPoints descending
select p).ToArray<Guild>();
if (array != null)
{
byte b = 0;
while ((int)b < array.Length && b != 9)
{
Writer.WriteString(array[(int)b].Name, (int)num, this.Packet);
num += 16;
Writer.WriteUInt32(array[(int)b].CTFPoints, (int)num, this.Packet);
num += 4;
Writer.WriteUInt32(array[(int)b].MemberCount, (int)num, this.Packet);
num += 4;
Writer.WriteUInt64((ulong)array[(int)b].CTFdonationSilverold, (int)num, this.Packet);
num += 8;
Writer.WriteUInt32(array[(int)b].CTFdonationCPsold, (int)num, this.Packet);
num += 4;
b += 1;
}
}
return this.Packet;
}
}
public class Base
{
public SobNpcSpawn Flag;
public ConcurrentDictionary<uint, uint> Scores;
public uint CapturerID;
public Base(SobNpcSpawn flag)
{
Flag = flag;
Scores = new ConcurrentDictionary<uint, uint>();
CapturerID = 0;
}
public void Capture()
{
if (Scores.Count == 0) Scores.Add((uint)0, (uint)0);
uint guildId = Scores.OrderByDescending(p => p.Value).FirstOrDefault().Key;
CapturerID = guildId;
var guild = Kernel.Guilds[guildId];
Flag.Name = guild.Name;
Flag.Hitpoints = Flag.MaxHitpoints;
Kernel.SendScreen(Flag, Flag);
foreach (var Entity in Program.Values)
{
if (Entity.Entity.MapID == MapID)
{
Entity.Send(generatePacket2(5, (Flag.UID - 20570)));
}
}
Scores.Clear();
}
}
public const ushort MapID = 2057;
private Map Map;
public Dictionary<uint, Base> Bases;
public static bool IsWar;
public static DateTime StartTime;
public CaptureTheFlag()
{
Database.DMaps.LoadMap(2057);
Bases = new Dictionary<uint, Base>();
if (!Kernel.Maps.ContainsKey((int)2057L))
{
new Map(MapID, DMaps.MapPaths[MapID]);
}
Map = Kernel.Maps[MapID];
foreach (var npc in Map.Npcs.Values)
if (npc is SobNpcSpawn)
Bases.Add(npc.UID, new Base((SobNpcSpawn)npc));
SpawnFlags();
}
public void SpawnFlags()
{
int toAdd = 6 - Map.StaticEntities.Count;
for (int i = toAdd; i > 0; i--)
{
var coords = Map.RandomCoordinates();
StaticEntity entity = new StaticEntity((uint)(coords.Item1 * 1000 + coords.Item2), coords.Item1, coords.Item2, MapID);
//Console.WriteLine("X : {0} | Y : {1}", coords.Item1, coords.Item2);
entity.DoFlag();
Map.AddStaticEntity(entity);
}
}
public bool SignUp(GameState client)
{
if (client.Entity.GuildID == 0) return false;
if (client.Guild == null) return false;
var coords = Map.RandomCoordinates(482, 367, 27);
client.Entity.Teleport(MapID, coords.Item1, coords.Item2);
return true;
}
public void AroundBase(GameState client)
{
if (client.Entity.MapID != MapID) return;
if (client.Entity.GuildID == 0) return;
if (client.Guild == null) return;
foreach (var _base in Bases.Values)
{
if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, _base.Flag.X, _base.Flag.Y) == 9)
{
if (_base.CapturerID == client.Entity.GuildID)
{
if (client.Entity.ContainsFlag2(Update.Flags2.CarryingFlag))
{
client.Send(generateTimer(0));
client.Send(generateEffect(client));
client.Entity.RemoveFlag2(Update.Flags2.CarryingFlag);
// client.Entity.nRemoveFlag(91);
client.Guild.CTFPoints += 15;
Program.World.CTF.SendUpdates();
client.Send(generatePacket(7, client.Entity.UID));
client.AsMember.Exploits += (ushort)(client.Entity.Level / 2);
}
}
}
else
{
foreach (var item in client.Map.StaticEntities.Values)
{
if (Kernel.GetDistance(item.X, item.Y, client.Entity.X, client.Entity.Y) == 0)
{
if (client.Entity.ContainsFlag2(Update.Flags2.CarryingFlag))
{
client.Entity.FlagStamp = Time32.Now;
client.Send(Program.World.CTF.generateTimer(60));
client.Send(Program.World.CTF.generateEffect(client));
client.Guild.CTFPoints += 3;
client.Map.RemoveStaticItem(item);
client.RemoveScreenSpawn(item, true);
}
}
}
}
}
}
public static bool Attackable(Game.Entity entity)
{
return Kernel.GetDistance(entity.X, entity.Y, 482, 367) > 32;
}
public void AddScore(uint damage, Guild guild, SobNpcSpawn attacked)
{
if (Bases.ContainsKey(attacked.UID))
{
{
var _base = Program.World.CTF.Bases[attacked.UID];
if (!_base.Scores.ContainsKey(guild.ID))
_base.Scores.Add(guild.ID, damage);
else
_base.Scores[guild.ID] += damage;
}
}
}
public void FlagOwned(SobNpcSpawn attacked)
{
if (Bases.ContainsKey(attacked.UID))
{
foreach (var Entity in Program.Values)
{
if (Entity.Entity.MapID == MapID)
{
Entity.Send(generatePacket(5, (attacked.UID - 20570)));
}
}
}
}
public static void Close()
{
foreach (var Entity in Program.Values)
if (Entity.Entity.MapID == MapID)
Entity.Entity.Teleport(1002, 300, 278);
var array = Kernel.Guilds.Values.Where(p => p.CTFPoints != 0).OrderByDescending(p => p.CTFPoints).ToArray();
for (int i = 0; i < Math.Min(8, array.Length); i++)
{
array[i].CalculateCTFRANK(true);
Database.GuildTable.SaveCTFPoins(array[i]);
if (i == 0)
{
array[i].CTFReward += 10;
array[i].ConquerPointFund += 3000;
array[i].SilverFund += 12000;
}
else if (i == 1)
{
array[i].CTFReward += 9;
array[i].ConquerPointFund += 2000;
array[i].SilverFund += 10000;
}
else if (i == 2)
{
array[i].CTFReward += 8;
array[i].ConquerPointFund += 1000;
array[i].SilverFund += 8000;
}
else if (i == 3)
{
array[i].CTFReward += 7;
array[i].ConquerPointFund += 6000;
array[i].SilverFund += 6500;
}
else if (i == 4)
{
array[i].CTFReward += 6;
array[i].ConquerPointFund += 5000;
array[i].SilverFund += 5000;
}
else if (i == 5)
{
array[i].CTFReward += 5;
array[i].ConquerPointFund += 4000;
array[i].SilverFund += 4000;
}
else if (i == 6)
{
array[i].CTFReward += 4;
array[i].ConquerPointFund += 3000;
array[i].SilverFund += 3000;
}
else if (i == 7)
{
array[i].CTFReward += 3;
array[i].ConquerPointFund += 2000;
array[i].SilverFund += 2000;
}
Database.GuildTable.SaveCTFReward(array[i]);
array[i].CTFdonationCPs = array[i].CTFdonationCPsold;
array[i].CTFdonationSilver = array[i].CTFdonationSilverold;
array[i].CTFdonationCPsold = 0;
array[i].CTFdonationSilverold = 0;
}
if (array.Length > 8)
{
for (int x = 8; x < array.Length; x++)
{
array[x].CTFPoints = 0;
foreach (var meme in array[x].Members.Values)
{
meme.Exploits = 0;
meme.ExploitsRank = 0;
}
}
}
}
public void SendUpdates(GameState client)
{
if (Time32.Now > client.CTFUpdateStamp.AddSeconds(5))
{
client.CTFUpdateStamp = Time32.Now;
var buffer = generateCTFRanking4();
client.Send(buffer);
foreach (var _base in Bases.Values)
{
if (Kernel.GetDistance(client.Entity.X, client.Entity.Y, _base.Flag.X, _base.Flag.Y) <= 9)
{
buffer = generateFlagRanking(_base);
client.Send(buffer);
}
}
}
}
public byte[] generateCTFRanking4()
{
var array = Kernel.Guilds.Values.Where(p => p.CTFPoints != 0).OrderByDescending(p => p.CTFPoints).ToArray();
return generateList4(2, array, p => p.CTFPoints);
}
public byte[] generateCTFRanking()
{
var array = Kernel.Guilds.Values.Where(p => p.CTFPoints != 0).OrderByDescending(p => p.CTFPoints).ToArray();
return generateList(2, array, p => p.CTFPoints);
}
private byte[] generateFlagRanking(Base flag)
{
var scores = flag.Scores.OrderByDescending(p => p.Value).ToArray();
var array = new Guild[Math.Min(5, scores.Length)];
for (int i = 0; i < array.Length; i++)
{
array[i] = Kernel.Guilds[scores[i].Key];
array[i].CTFFlagScore = scores[i].Value;
}
return generateList(1, array, p => p.CTFFlagScore);
}
private byte[] generateList(int type, Guild[] array = null, Func<Guild, UInt32> select = null)
{
byte[] data = null;
if (array == null)
data = new byte[48];
else
data = new byte[48 + (array.Length * 24)];
Writer.WriteInt32(data.Length - 8, 0, data);
Writer.WriteUInt16(2224, 2, data);
Writer.WriteInt32(type, 4, data);
if (array != null)
{
Writer.WriteInt32(array.Length, 28, data);
for (int i = 0; i < array.Length; i++)
{
int offset = 32 + (i * 24);
Writer.WriteInt32(i, offset, data); offset += 4;
Writer.WriteUInt32(select(array[i]), offset, data); offset += 4;
Writer.WriteString(array[i].Name, offset, data); offset += 16;
}
}
return data;
}
private byte[] generateList4(int type, Guild[] array = null, Func<Guild, UInt32> select = null)
{
byte[] data = null;
if (array == null)
data = new byte[48 + 4];
else
data = new byte[48 + 4 + (array.Length * 24)];
Writer.WriteInt32(data.Length - 8, 0, data);
Writer.WriteUInt16(2224, 2, data);
Writer.WriteInt32(type, 4 + 4, data);
if (array != null)
{
Writer.WriteInt32(array.Length, 28 + 4, data);
for (int i = 0; i < array.Length; i++)
{
int offset = 32 + 4 + (i * 24);
Writer.WriteInt32(i, offset, data); offset += 4;
Writer.WriteUInt32(select(array[i]), offset, data); offset += 4;
Writer.WriteString(array[i].Name, offset, data); offset += 16;
}
}
return data;
}
public byte[] generateTimer(uint time)
{
return generatePacket(8, time);
}
public byte[] generateEffect(GameState Client)
{
//return generatePacket3(6, 6327607);
return generatePacket(6, Client.Entity.UID);
}
private byte[] generatePacket(int type, uint dwParam)
{
byte[] data = new byte[48];
Writer.WriteInt32(data.Length - 8, 0, data);
Writer.WriteUInt16(2224, 2, data);
Writer.WriteInt32(type, 4, data);
Writer.WriteUInt32(dwParam, 8, data);
return data;
}
public static byte[] generatePacket2(int type, uint dwParam)
{
byte[] data = new byte[48];
Writer.WriteInt32(data.Length - 8, 0, data);
Writer.WriteUInt16(2224, 2, data);
Writer.WriteInt32(type, 4, data);
Writer.WriteUInt32(dwParam, 8, data);
return data;
}
public void SendUpdates()
{
foreach (var Entity in Program.Values)
if (Entity.Entity.MapID == MapID)
SendUpdates(Entity);
}
public void CloseList(GameState client)
{
client.Send(generateList(3));
}
public static void CTFGuildsRank(GameState client, byte[] packet)
{
var array = Kernel.Guilds.Values.Where(p => p.CTFPoints != 0).OrderByDescending(p => p.CTFPoints).ToArray();
const byte maxcount = 5;
byte page = packet[10];
if (array.Length == 0)
return;
byte[] buffer = new byte[908];
Writer.WriteUInt16(900, 0, buffer);
Writer.WriteUInt16(1063, 2, buffer);
Writer.WriteUInt16(0, 4, buffer);
Writer.WriteUInt32(1, 6, buffer);
Writer.WriteUInt32((uint)(array.Length), 10, buffer);
Writer.WriteUInt32((uint)(array.Length), 14, buffer);
Writer.WriteUInt32(client.Guild.CTFdonationCPsold, 18, buffer);
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold, 22, buffer);
int offset = 30;
for (ushort x = (ushort)(page * maxcount - maxcount); x < page * maxcount; x++)
{
if (x >= array.Length) break;
var guild = array[x];
Writer.WriteUInt32(guild.CTFdonationCPs, offset, buffer);
offset += 4;
Writer.WriteUInt64((ulong)guild.CTFdonationSilver, offset, buffer);
offset += 8;
Writer.WriteString(guild.Name, offset, buffer);
offset += 0x24;
Writer.WriteUInt32(guild.ID, offset, buffer);
offset += 4;
}
client.Send(buffer);
}
public static void CTFGuildsRank2(GameState client, byte[] packet)
{
const byte maxcount = 5;
byte page = packet[10];
var guild_array = Kernel.Guilds.Values.Where(p => p.CTFPoints != 0).OrderByDescending(p => p.CTFPoints).ToArray();
if (guild_array.Length == 0)
return;
byte[] buffer2 = new byte[0x38c];
Writer.WriteUInt16(900, 0, buffer2);
Writer.WriteUInt16(0x427, 2, buffer2);
Writer.WriteUInt16(0, 4, buffer2);
Writer.WriteUInt16(page, 6, buffer2);
Writer.WriteUInt32(10, 10, buffer2);
Writer.WriteUInt32((uint)guild_array.Length, 14, buffer2);
client.Guild = client.AsMember.Guild;
Writer.WriteUInt32(client.Guild.CTFdonationCPsold, 0x12, buffer2);
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold, 0x16, buffer2);
ushort offset = 30;
for (ushort x = (ushort)(page * maxcount - maxcount); x < page * maxcount; x++)
{
if (x >= guild_array.Length) break;
var guild = guild_array[x];
Writer.WriteUInt32(guild.CTFdonationCPsold, offset, buffer2);
offset += 4;
Writer.WriteUInt64((ulong)guild.CTFdonationSilverold, offset, buffer2);
offset += 8;
Writer.WriteString(guild.Name, offset, buffer2);
offset += 0x24;
Writer.WriteUInt32(guild.ID, offset, buffer2);
offset += 4;
}
client.Send(buffer2);
}
public static void CTFsRank(GameState client, byte[] packet)
{
var array = Kernel.Guilds.Values.Where(p => p.CTFPoints != 0).OrderByDescending(p => p.CTFPoints).ToArray();
byte[] Packet = new byte[356];
Writer.WriteUInt16(348, 0, Packet);
Writer.WriteUInt16(1063, 2, Packet);
Packet[4] = 9;//type
Packet[6] = 1; // count
Packet[14] = 8; // count
ushort index = 26;
Writer.WriteUInt32(client.Entity.UID, 18, Packet);
for (byte i = 0; i < array.Length; i++)
{
if (i >= 8)
break;
if (i >= array.Length)
break;
var guild = array[i];
Packet[index] = (byte)(i + 1);
index = (ushort)(index + 4);
Writer.WriteString(guild.Name, index, Packet);
index = (ushort)(index + 16);
Writer.WriteUInt32(guild.CTFPoints, index, Packet);
index = (ushort)(index + 4);
Writer.WriteUInt32(guild.MemberCount, index, Packet);
index = (ushort)(index + 12);
}
client.Send(Packet);
}
public static void CTFExpolitsRank(GameState client, byte[] packet)
{
byte page = packet[10];
var array = client.Guild.Members.Values.Where(p => p.Exploits != 0).OrderByDescending(p => p.Exploits).ToArray();
if (array.Length == 0)
return;
byte[] buffer = new byte[0x38c];
Writer.WriteUInt16(900, 0, buffer);
Writer.WriteUInt16(0x427, 2, buffer);
Writer.WriteUInt16(8, 4, buffer);
Writer.WriteUInt32(page, 6, buffer);
Writer.WriteUInt32((uint)array.Length, 10, buffer);
Writer.WriteUInt32(8, 14, buffer);
Writer.WriteUInt32(client.AsMember.Exploits, 0x12, buffer);
int offset = 30;
for (ushort x = 0; x < array.Length; x++)//(ushort)(page * maxcount - maxcount); x < page * maxcount; x++)
{
if (x > 20)
break;
if (x >= array.Length) break;
var member = array[x];
Writer.WriteString(member.Name, offset, buffer);
offset += 0x10;
Writer.WriteUInt32(member.Exploits, offset, buffer);
offset += 4;
}
client.Send(buffer);
}
public static void CTFExpolitsRank2(GameState client, byte[] packet)
{
const byte maxcount = 5;
byte page = packet[10];
var array = client.Guild.Members.Values.Where(p => p.Exploits != 0).OrderByDescending(p => p.Exploits).ToArray();
if (array.Length == 0)
return;
byte[] buffer = new byte[0x38c];
Writer.WriteUInt16(900, 0, buffer);
Writer.WriteUInt16(0x427, 2, buffer);
Writer.WriteUInt16(1, 4, buffer);
Writer.WriteUInt32(page, 6, buffer);
Writer.WriteUInt32((uint)array.Length, 10, buffer);
Writer.WriteUInt32(5, 14, buffer);
Writer.WriteUInt32(client.Guild.CTFdonationCPsold, 0x12, buffer);
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold, 0x16, buffer);
Writer.WriteUInt32((ushort)array.Length, 30, buffer);
int offset = 30;
for (ushort x = (ushort)(page * maxcount - maxcount); x < page * maxcount; x++)
{
if (x >= array.Length) break;
var member = array[x];
Writer.WriteUInt32((ushort)(x + 1), offset, buffer);
offset += 4;
Writer.WriteUInt32(member.Exploits, offset, buffer);
offset += 4;
Writer.WriteUInt32(member.CTFCpsReward, offset, buffer);
offset += 4;
Writer.WriteUInt64(member.CTFSilverReward, offset, buffer);
offset += 8;
Writer.WriteUInt32(member.ID, offset, buffer);
offset += 4;
Writer.WriteString(member.Name, offset, buffer);
offset += 0x24;
}
client.Send(buffer);
}
}
}
if (attacker.MapID == CaptureTheFlag.MapID)
if (attacker.GuildID != 0 && Program.World.CTF.Bases[attacked.UID].CapturerID != attacker.GuildID)
{
Program.World.CTF.AddScore(damage, attacker.Owner.Guild, attacked);
}
#region CaptureTheFlag
if (killer.GuildID != 0 && killer.MapID == CaptureTheFlag.MapID && CaptureTheFlag.IsWar)
{
if (GuildID != 0)
{
if (killer.Owner.Guild.Enemy.ContainsKey(GuildID))
killer.Owner.Guild.CTFPoints += 1;
else if (killer.Owner.Guild.Ally.ContainsKey(GuildID))
killer.Owner.Guild.CTFPoints += 1;
}
if (ContainsFlag2(Network.GamePackets.Update.Flags2.CarryingFlag))
{
StaticEntity entity = new StaticEntity((uint)(X * 1000 + Y), X, Y, MapID);
entity.DoFlag();
Owner.Map.AddStaticEntity(entity);
RemoveFlag2(Network.GamePackets.Update.Flags2.CarryingFlag);
Owner.Send(Program.World.CTF.generateTimer(0));
Owner.Send(Program.World.CTF.generateEffect(Owner));
if (killer.GuildID != GuildID)
{
Killer.AddFlag2(Network.GamePackets.Update.Flags2.CarryingFlag);
Time32 end = FlagStamp.AddSeconds(60) - Time32.Now;
killer.FlagStamp = end;
killer.Owner.Send(Program.World.CTF.generateTimer((uint)end.Value));
killer.Owner.Send(Program.World.CTF.generateEffect(killer.Owner));
killer.Owner.Guild.CTFPoints += 3;
}
}
}
#endregion
CaptureTheFlag = 2224,
if (MapID == CaptureTheFlag.MapID)
{
if (Program.World.CTF.Bases.ContainsKey(UID))
{
var _base = Program.World.CTF.Bases[UID];
_base.Capture();
}
}
case 1063:
{
//if (packet[6] == 3)
//{
// client.Send(packet);
// uint m = BitConverter.ToUInt32(packet, 10);
// client.Send(CrossServer.generateRanking(m));
// return;
//}
byte typ = packet[4];
switch (typ)
{
case 0:
{
if (client.Guild == null || client.AsMember == null)
break;
if (!CaptureTheFlag.IsWar)
{
CaptureTheFlag.CTFGuildsRank(client, packet);
}
else
{
CaptureTheFlag.CTFExpolitsRank(client, packet);
}
break;
}
case 1:
{
if (client.Guild == null || client.AsMember == null)
break;
CaptureTheFlag.CTFExpolitsRank2(client, packet);
break;
}
case 3:
{
uint setCTFCps = BitConverter.ToUInt32(packet, 18);
if (client.Guild == null || client.AsMember == null)
break;
if (client.Guild.ConquerPointFund > setCTFCps)
{
client.Guild.ConquerPointFund -= setCTFCps;
client.Guild.CTFdonationCPsold += setCTFCps;
Database.GuildTable.SaveFunds(client.Guild);
}
goto case 0;
}
case 4:
{
uint setCTFMoney = BitConverter.ToUInt32(packet, 22);
if (client.Guild == null || client.AsMember == null)
break;
if (client.Guild.SilverFund > setCTFMoney)
{
client.Guild.SilverFund -= setCTFMoney;
client.Guild.CTFdonationSilverold += setCTFMoney;
Database.GuildTable.SaveFunds(client.Guild);
}
goto case 0;
}
case 5:
{
uint setCTFCps = BitConverter.ToUInt32(packet, 18);
if (client.Guild == null || client.AsMember == null)
break;
if (client.Guild.ConquerPointFund > setCTFCps)
{
client.Guild.ConquerPointFund -= setCTFCps;
client.Guild.CTFdonationCPsold += setCTFCps;
Database.GuildTable.SaveFunds(client.Guild);
}
uint setCTFMoney = BitConverter.ToUInt32(packet, 22);
if (client.Guild.SilverFund > setCTFMoney)
{
client.Guild.SilverFund -= setCTFMoney;
client.Guild.CTFdonationSilverold += setCTFMoney;
Database.GuildTable.SaveFunds(client.Guild);
}
goto case 0;
}
case 8:
{
if (client.Guild == null || client.AsMember == null)
break;
CaptureTheFlag.CTFGuildsRank2(client, packet);
break;
}
case 9:
{
if (client.Guild == null || client.AsMember == null)
break;
if (CaptureTheFlag.IsWar)
{
new CaptureTheFlag.CTF_Rank(client).Send(client);
}
else
{
CaptureTheFlag.CTFsRank(client, packet);
}
break;
}
}
break;
}
case 2224:
{
if (packet[4] == 7)//2
client.Send(Program.World.CTF.generateCTFRanking());
if (CaptureTheFlag.IsWar)
{
byte[] p773 = new byte[] { 60, 0, 176, 8, 11, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 84, 81, 83, 101, 114, 118, 101, 114 };
client.Send(p773);
}
else
client.Send(packet);
break;
}
MsgCaptureTheFlagUpdate = 2224,
CaptureTheFlagRankings = 1063,
public CaptureTheFlag CTF;
#region Capture the flag [19H] Saturday
if (Copra_Times.Start.CTF && !CaptureTheFlag.IsWar)
{
CaptureTheFlag.IsWar = true;
CaptureTheFlag.StartTime = DateTime.Now;
foreach (var guild in Kernel.Guilds.Values)
{
guild.CTFFlagScore = 0;
guild.CTFPoints = 0;
}
foreach (Client.GameState client in Kernel.GamePool.Values)
{
if (client.Map.BaseID != 6001 && client.Map.BaseID != 6000 && !client.Entity.Dead)
{
EventAlert alert = new EventAlert
{
StrResID = 10539,
Countdown = 60,
UK12 = 1
};
client.Entity.StrResID = 10539;
client.Send(alert);
}
}
}
if (CaptureTheFlag.IsWar && CTF != null)
{
Program.World.CTF.SendUpdates();
if (Now64 > CaptureTheFlag.StartTime.AddHours(1))
{
CaptureTheFlag.IsWar = false;
CaptureTheFlag.Close();
}
}
if (CTF != null)
CTF.SpawnFlags();
#endregion
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
شرح كيفيت تركيب اللودر في السورس | ElSaher | تطوير سيرفرات كونكر | 9 | 2024-02-10 07:24 PM |
كيفيت الغاء ال3دي من السورس كلو وا البدش | ElSaher | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2020-03-09 01:39 PM |
عندى مشاكل فى السورس للى معايا | nova | الطلبات المدفوعه | 1 | 2019-12-04 04:09 PM |
انا ركبت سورس وبتش تمام ورفعت القاعده وفيه Npc موجودين في العبه و الكلاس لكن في القاع | Mawdo3jded | مشكلات السيرفيرات كونكر الشخصيه | 14 | 2019-12-04 04:07 PM |
لو سمحتوا عاوز كونكت سوكت علشان اللي عندي مبوظ السورس | سمير | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2019-11-08 11:57 PM |