|
المشاركات 199 |
+التقييم 0.11 |
تاريخ التسجيل Oct 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 2186 |
public static void ReceiveAttack(Game.Entity attacker, SobNpcSpawn attacked,
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);
}
public static bool CanAttack
if (attacker.MapID == CaptureTheFlag.MapID)
{
if (Program.World.CTF.Bases.ContainsKey(attacked.UID))
{
var _base = Program.World.CTF.Bases[attacked.UID];
if (_base.CapturerID == attacker.GuildID)
return false;
}
return true;
}
public static bool CanAttack(Game.Entity attacker, Game.Entity attacked
if (attacked.MonsterInfo.ID == MonsterInformation.ReviverID)
if (attacker.MapID == CaptureTheFlag.MapID)
if (!CaptureTheFlag.Attackable(attacker) || !CaptureTheFlag.Attackable(attacked))
return false;
public void Die(Entity killer)
#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
public unsafe class PacketID
CaptureTheFlag = 2224,
if (UID == 123456)
if (MapID == CaptureTheFlag.MapID)
{
if (Program.World.CTF.Bases.ContainsKey(UID))
{
var _base = Program.World.CTF.Bases[UID];
_base.Capture();
}
}
//////////
public static void HandlePacket(byte[] packet, Client.GameState client)
#region CTF
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;
}
#endregion
client.lastJumpDistance = Kernel.GetDistance(new_X, new_Y, client.Entity.X, client.Entity.Y);
if (client.Entity.MapID == CaptureTheFlag.MapID)
CheckForFlag(client);
client.SendScreen(generalData, true);
client.Screen.Reload(generalData);
static void PlayerGroundMovment(GroundMovement groundMovement, Client.GameState client)
if (client.Entity.MapID == CaptureTheFlag.MapID)
CheckForFlag(client);
client.SendScreen(groundMovement, true);
client.Screen.Reload(groundMovement);
static void GetSurroundings(Client.GameState client)
if (client.Entity.PreviousMapID == CaptureTheFlag.MapID)
Program.World.CTF.CloseList(client);
#region Reward CTF
case 8713:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Just The Guild Leader will receive the CTF Reward?");
dialog.Option("CTF area.", 2);
dialog.Option("Give Me CTF Reward.", 3);
dialog.Option("I See.", 255);
dialog.Avatar(83);
dialog.Send();
break;
}
case 2:
{
if (client.Entity.Level >= 1)
if (CaptureTheFlag.IsWar)
{
Program.World.CTF.SignUp(client);
}
else
{
dialog.Text("The CTF is not on going at this time. The GuildWar is scheduled to start everyDay at 03:00 .");
dialog.Option("Oh.", 255);
dialog.Send();
}
else
{
dialog.Text("You Should Level 1 .");
dialog.Option("Oh.", 255);
dialog.Send();
}
break;
}
case 3:
{
if (client.Guild != null)
{
if (client.AsMember != null)
{
if (client.AsMember.Rank == Enums.GuildMemberRank.GuildLeader)
{
uint Reaward = (uint)(client.Guild.CTFReward * ServerRates.WarFlag1);
if (Reaward != 0)
{
byte[] messaje = new Network.GamePackets.Message("The Guild Leader " + client.Entity.Name + " of " + client.Guild.Name + " Receive the CTFReward " + Reaward + "", System.Drawing.Color.Red, Network.GamePackets.Message.System).ToArray();
client.Entity.ConquerPoints += Reaward;
client.Guild.CTFReward = 0;
Database.GuildTable.SaveCTFReward(client.Guild);
foreach (var clients in Kernel.GamePool.Values)
{
client.Send(messaje);
}
}
else
{
dialog.Text("You Guild Not Have CTF Points ");
dialog.Option("Oh Sorry.", 255);
dialog.Avatar(83);
dialog.Send();
}
}
else
{
dialog.Text("Just The Guild Leader will receive the CTF Reward ");
dialog.Option("Oh Sorry.", 255);
dialog.Avatar(83);
dialog.Send();
}
break;
}
}
break;
}
}
break;
}
#endregion
public CaptureTheFlag CTF;
public void CreateTournaments()
CTF = new CaptureTheFlag();
private void WorldTournaments(int time)
#region CaptureTheFlag
if (Now64.Hour == 17)
{
if (Now64.Minute == 05 && Now64.Second <= 05)
{
if (!CaptureTheFlag.IsWar)
{
CTF = new CaptureTheFlag();
CaptureTheFlag.IsWar = true;
CaptureTheFlag.StartTime = DateTime.Now;
Kernel.SendWorldMessage(new Message("Capture The Flag has Start !", Color.White, Message.BroadcastMessage), Program.Values);
foreach (var client in Program.Values)
client.MessageBox("Capture The Flag has Start! Would you Like to join ...?",
p => { p.Entity.Teleport(1002, 224, 240); }, null, 60);
foreach (var guild in Kernel.Guilds.Values)
{
guild.CTFFlagScore = 0; guild.CTFPoints = 0;
}
}
}
if (CaptureTheFlag.IsWar)
{
if (CTF != null)
CTF.SpawnFlags();
}
if (Now64.Minute == 59 && Now64.Second == 59)
{
if (CaptureTheFlag.IsWar)
{
Kernel.SendWorldMessage(new Message("Capture The Flag has Ended !", Color.White, Message.BroadcastMessage), Program.Values);
Program.World.CTF.SendUpdates();
CaptureTheFlag.IsWar = false;
CaptureTheFlag.Close();
}
}
}
#endregion
player.Send("TeamQualifier has ended!");
AcceptingNewBattles = ((Now64.Hour >= 11 && Now64.Hour < 13) || (Now64.Hour >= 19 && Now64.Hour < 21));
// AcceptingNewBattles = ((Now64.Hour >= 11 && Now64.Hour < 13) || (Now64.Hour >= 19 && Now64.Hour < 21));
player.send("teamqualifier has ended!");
acceptingnewbattles = ((now64.hour >= 11 && now64.hour < 13) || (now64.hour >= 19 && now64.hour < 21));
// acceptingnewbattles = ((now64.hour >= 11 && now64.hour < 13) || (now64.hour >= 19 && now64.hour < 21));
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
أدوات الموضوع | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
بخصوص الاضافة بتاعت التيم والاسكل تيم بكيه | nova | مشكلات السيرفيرات كونكر الشخصيه | 5 | 2020-04-07 06:34 PM |
مشكله بان اكاونت بسرعه يا رجااله بعد ازن الناس | ahmedshetos888 | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2020-01-26 02:50 AM |
مشكله بخصوص الاسكل تيم بيكي وي التيم بيكي وي اليت جيلد وير | سمير | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2019-10-25 08:44 PM |
صنع كوسته بتيم | محمد ياسر | تطوير سيرفرات كونكر | 1 | 2019-09-14 01:05 PM |
مشكله في التيم بوكيه | abuhaneen | مشكلات السيرفيرات كونكر الشخصيه | 11 | 2019-07-06 06:52 PM |