قديم 2019-08-06, 09:00 AM
المشاركة 2
محمد ياسر
*
  • غير متواجد
افتراضي رد: طلب بخصوص الحروب
كام سستم في الموضوع ؟

قديم 2019-08-06, 02:02 PM
المشاركة 3
LyokaWarior
.:: عضو نشيط ::.
  • غير متواجد
افتراضي رد: طلب بخصوص الحروب
اتفضـل الاتـنيـن التيـم بيكي والاليت والاسكـل !

هتفتح كلاس MsgTeamPopPKMatchInfo

هتبدل ده بالى عندك

public void Append(TeamElitePk.FighterStats stats, int rank, TeamElitePk.GamePackets ID)
{
if (ID == TeamElitePk.GamePackets.SkillElitePkBrackets)
{
ushort offset = (ushort)(20 + Index * 44);//21/22
Index++;
WriteUInt32(stats.LeaderUID, offset, packet);
offset += 4;
WriteUInt32((uint)rank, offset, packet);
offset += 4;
WriteString(stats.Name, offset, packet);
offset += 32;
WriteUInt32(stats.LeaderMesh, offset, packet);
offset += 4;
}
else
{
ushort offset = (ushort)(24 + Index * 48);//21/22
Index++;
WriteUInt32(stats.LeaderUID, offset, packet);
offset += 4;
WriteUInt32((uint)rank, offset, packet);
offset += 4;
WriteString(stats.Name, offset, packet);
offset += 32;
WriteUInt32(stats.LeaderMesh, offset, packet);
offset += 4;
}

}
بعد كده هيظهرلك ايرور هتروح كلاس
TeamSkill
هتبدل ده بالى عندك
public void Rankings(Client.GameState client)
{
Network.GamePackets.TeamElitePkTop ranks = new Network.GamePackets.TeamElitePkTop(ID);
{
ranks.Type = Network.GamePackets.TeamElitePkTop.Top8;
ranks.Group = (uint)GroupID;
ranks.GroupStatus = (uint)State;
if (this.State >= 8)
{
ranks.Type = 2U;
if (this.State == 8)
{
ranks.Count = 1U;
ranks.Append(this.Top8[2], 3, ID);
}
else
{
ranks.Count = 3U;
for (int index = 0; index < 3; ++index)
ranks.Append(this.Top8[index], index + 1, ID);
}
client.Send(ranks.ToArray());
}
else
{
ranks.Count = (uint)this.Top8.Length;
for (int rank = 0; (long)rank < (long)ranks.Count; ++rank)
{
if (this.Top8[rank] != null)
ranks.Append(this.Top8[rank], rank, ID);
}
client.Send(ranks.ToArray());
}
}
}
بعد كده هتبحث عن كود ده
public enum GamePackets : ushort
هضيف كود ده جوه
SkillElitePkBrackets = 2252,

بسكـدا سـلامووز

قديم 2019-08-06, 05:35 PM
المشاركة 4
osama
.:: عضو مميز ::.
  • غير متواجد
افتراضي رد: طلب بخصوص الحروب
السورس بتاعى عادى مش Msg يجماعة من فضلكو محتاج

قديم 2019-08-06, 06:32 PM
المشاركة 5
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: طلب بخصوص الحروب
Source/Game/CTF.cs

كود:
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(3460this.Packet);
                
Writer.WriteUInt16(10632this.Packet);
                
this.Packet[4] = 9;
                
this.Packet[6] = 1;
                
this.Packet[14] = 8;
                
Writer.WriteUInt32(client.Guild.CTFPoints18this.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)
< array.Length && != 9)
                    {
                        
Writer.WriteString(array[(int)b].Name, (int)numthis.Packet);
                        
num += 16;
                        
Writer.WriteUInt32(array[(int)b].CTFPoints, (int)numthis.Packet);
                        
num += 4;
                        
Writer.WriteUInt32(array[(int)b].MemberCount, (int)numthis.Packet);
                        
num += 4;
                        
Writer.WriteUInt64((ulong)array[(int)b].CTFdonationSilverold, (int)numthis.Packet);
                        
num += 8;
                        
Writer.WriteUInt32(array[(int)b].CTFdonationCPsold, (int)numthis.Packet);
                        
num += 4;
                        
+= 1;
                    }
                }
                return 
this.Packet;
            }
        }
        public class 
Base
        
{
            public 
SobNpcSpawn Flag;
            public 
ConcurrentDictionary<uintuintScores;
            public 
uint CapturerID;

            public 
Base(SobNpcSpawn flag)
            {
                
Flag flag;
                
Scores = new ConcurrentDictionary<uintuint>();
                
CapturerID 0;
            }

            public 
void Capture()
            {
                if (
Scores.Count == 0Scores.Add((uint)0, (uint)0);
                
uint guildId Scores.OrderByDescending(=> p.Value).FirstOrDefault().Key;
                
CapturerID guildId;
                var 
guild Kernel.Guilds[guildId];
                
Flag.Name guild.Name;
                
Flag.Hitpoints Flag.MaxHitpoints;
                
Kernel.SendScreen(FlagFlag);
                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<uintBaseBases;
        public static 
bool IsWar;
        public static 
DateTime StartTime;

        public 
CaptureTheFlag()
        {
            
Database.DMaps.LoadMap(2057);
            
Bases = new Dictionary<uintBase>();
            if (!
Kernel.Maps.ContainsKey((int)2057L))
            {
                new 
Map(MapIDDMaps.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 Map.StaticEntities.Count;
            for (
int i toAdd0i--)
            {
                var 
coords Map.RandomCoordinates();
                
StaticEntity entity = new StaticEntity((uint)(coords.Item1 1000 coords.Item2), coords.Item1coords.Item2MapID);
                
//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(48236727);
            
client.Entity.Teleport(MapIDcoords.Item1coords.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.Xclient.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(7client.Entity.UID));
                            
client.AsMember.Exploits += (ushort)(client.Entity.Level 2);
                        }
                    }
                }
                else
                {
                    foreach (var 
item in client.Map.StaticEntities.Values)
                    {
                        if (
Kernel.GetDistance(item.Xitem.Yclient.Entity.Xclient.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(itemtrue);
                            }
                        }
                    }
                }
            }
        }

        public static 
bool Attackable(Game.Entity entity)
        {
            return 
Kernel.GetDistance(entity.Xentity.Y482367) > 32;
        }

        public 
void AddScore(uint damageGuild guildSobNpcSpawn attacked)
        {
            if (
Bases.ContainsKey(attacked.UID))
            {
                {
                    var 
_base Program.World.CTF.Bases[attacked.UID];
                    if (!
_base.Scores.ContainsKey(guild.ID))
                        
_base.Scores.Add(guild.IDdamage);
                    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(1002300278);

            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();

            for (
int i 0Math.Min(8, array.Length); i++)
            {
                array[
i].CalculateCTFRANK(true);
                
Database.GuildTable.SaveCTFPoins(array[i]);

                if (
== 0)
                {
                    array[
i].CTFReward += 10;
                    array[
i].ConquerPointFund += 3000;
                    array[
i].SilverFund += 12000;
                }
                else if (
== 1)
                {
                    array[
i].CTFReward += 9;
                    array[
i].ConquerPointFund += 2000;
                    array[
i].SilverFund += 10000;
                }
                else if (
== 2)
                {
                    array[
i].CTFReward += 8;
                    array[
i].ConquerPointFund += 1000;
                    array[
i].SilverFund += 8000;
                }
                else if (
== 3)
                {
                    array[
i].CTFReward += 7;
                    array[
i].ConquerPointFund += 6000;
                    array[
i].SilverFund += 6500;
                }
                else if (
== 4)
                {
                    array[
i].CTFReward += 6;
                    array[
i].ConquerPointFund += 5000;
                    array[
i].SilverFund += 5000;
                }
                else if (
== 5)
                {
                    array[
i].CTFReward += 5;
                    array[
i].ConquerPointFund += 4000;
                    array[
i].SilverFund += 4000;
                }
                else if (
== 6)
                {
                    array[
i].CTFReward += 4;
                    array[
i].ConquerPointFund += 3000;
                    array[
i].SilverFund += 3000;
                }
                else if (
== 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< array.Lengthx++)
                {
                    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.Xclient.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.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            return 
generateList4(2, array, => p.CTFPoints);
        }

        public 
byte[] generateCTFRanking()
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            return 
generateList(2, array, => p.CTFPoints);
        }

        private 
byte[] generateFlagRanking(Base flag)
        {
            var 
scores flag.Scores.OrderByDescending(=> p.Value).ToArray();
            var array = new 
Guild[Math.Min(5scores.Length)];
            for (
int i 0< array.Lengthi++)
            {
                array[
i] = Kernel.Guilds[scores[i].Key];
                array[
i].CTFFlagScore scores[i].Value;
            }
            return 
generateList(1, array, => p.CTFFlagScore);
        }

        private 
byte[] generateList(int typeGuild[] array = nullFunc<GuildUInt32select null)
        {
            
byte[] data null;
            if (array == 
null)
                
data = new byte[48];
            else
                
data = new byte[48 + (array.Length 24)];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            if (array != 
null)
            {
                
Writer.WriteInt32(array.Length28data);
                for (
int i 0< array.Lengthi++)
                {
                    
int offset 32 + (24);
                    
Writer.WriteInt32(ioffsetdata); offset += 4;
                    
Writer.WriteUInt32(select(array[i]), offsetdata); offset += 4;
                    
Writer.WriteString(array[i].Nameoffsetdata); offset += 16;
                }
            }
            return 
data;
        }
        private 
byte[] generateList4(int typeGuild[] array = nullFunc<GuildUInt32select null)
        {
            
byte[] data null;
            if (array == 
null)
                
data = new byte[48 4];
            else
                
data = new byte[48 + (array.Length 24)];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            if (array != 
null)
            {
                
Writer.WriteInt32(array.Length28 4data);
                for (
int i 0< array.Lengthi++)
                {
                    
int offset 32 + (24);
                    
Writer.WriteInt32(ioffsetdata); offset += 4;
                    
Writer.WriteUInt32(select(array[i]), offsetdata); offset += 4;
                    
Writer.WriteString(array[i].Nameoffsetdata); offset += 16;

                }
            }
            return 
data;
        }

        public 
byte[] generateTimer(uint time)
        {
            return 
generatePacket(8time);
        }

        public 
byte[] generateEffect(GameState Client)
        {
            
//return generatePacket3(6, 6327607);
            
return generatePacket(6Client.Entity.UID);
        }

        private 
byte[] generatePacket(int typeuint dwParam)
        {
            
byte[] data = new byte[48];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            
Writer.WriteUInt32(dwParam8data);
            return 
data;
        }

        public static 
byte[] generatePacket2(int typeuint dwParam)
        {
            
byte[] data = new byte[48];
            
Writer.WriteInt32(data.Length 80data);
            
Writer.WriteUInt16(22242data);
            
Writer.WriteInt32(type4data);
            
Writer.WriteUInt32(dwParam8data);
            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 clientbyte[] packet)
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();

            const 
byte maxcount 5;
            
byte page packet[10];

            if (array.
Length == 0)
                return;

            
byte[] buffer = new byte[908];
            
Writer.WriteUInt16(9000buffer);
            
Writer.WriteUInt16(10632buffer);
            
Writer.WriteUInt16(04buffer);
            
Writer.WriteUInt32(16buffer);
            
Writer.WriteUInt32((uint)(array.Length), 10buffer);
            
Writer.WriteUInt32((uint)(array.Length), 14buffer);

            
Writer.WriteUInt32(client.Guild.CTFdonationCPsold18buffer);
            
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold22buffer);

            
int offset 30;
            for (
ushort x = (ushort)(page maxcount maxcount); page maxcountx++)
            {
                if (
>= array.Length) break;
                var 
guild = array[x];
                
Writer.WriteUInt32(guild.CTFdonationCPsoffsetbuffer);
                
offset += 4;
                
Writer.WriteUInt64((ulong)guild.CTFdonationSilveroffsetbuffer);
                
offset += 8;
                
Writer.WriteString(guild.Nameoffsetbuffer);
                
offset += 0x24;
                
Writer.WriteUInt32(guild.IDoffsetbuffer);
                
offset += 4;
            }
            
client.Send(buffer);
        }

        public static 
void CTFGuildsRank2(GameState clientbyte[] packet)
        {
            const 
byte maxcount 5;
            
byte page packet[10];


            var 
guild_array Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            if (
guild_array.Length == 0)
                return;
            
byte[] buffer2 = new byte[0x38c];
            
Writer.WriteUInt16(9000buffer2);
            
Writer.WriteUInt16(0x4272buffer2);
            
Writer.WriteUInt16(04buffer2);
            
Writer.WriteUInt16(page6buffer2);
            
Writer.WriteUInt32(1010buffer2);
            
Writer.WriteUInt32((uint)guild_array.Length14buffer2);
            
client.Guild client.AsMember.Guild;
            
Writer.WriteUInt32(client.Guild.CTFdonationCPsold0x12buffer2);
            
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold0x16buffer2);
            
ushort offset 30;

            for (
ushort x = (ushort)(page maxcount maxcount); page maxcountx++)
            {
                if (
>= guild_array.Length) break;
                var 
guild guild_array[x];
                
Writer.WriteUInt32(guild.CTFdonationCPsoldoffsetbuffer2);
                
offset += 4;
                
Writer.WriteUInt64((ulong)guild.CTFdonationSilveroldoffsetbuffer2);
                
offset += 8;
                
Writer.WriteString(guild.Nameoffsetbuffer2);
                
offset += 0x24;
                
Writer.WriteUInt32(guild.IDoffsetbuffer2);
                
offset += 4;
            }

            
client.Send(buffer2);
        }

        public static 
void CTFsRank(GameState clientbyte[] packet)
        {
            var array = 
Kernel.Guilds.Values.Where(=> p.CTFPoints != 0).OrderByDescending(=> p.CTFPoints).ToArray();
            
byte[] Packet = new byte[356];
            
Writer.WriteUInt16(3480Packet);
            
Writer.WriteUInt16(10632Packet);
            
Packet[4] = 9;//type
            
Packet[6] = 1// count
            
Packet[14] = 8// count
            
ushort index 26;
            
Writer.WriteUInt32(client.Entity.UID18Packet);
            for (
byte i 0< array.Lengthi++)
            {
                if (
>= 8)
                    break;
                if (
>= array.Length)
                    break;
                var 
guild = array[i];
                
Packet[index] = (byte)(1);
                
index = (ushort)(index 4);
                
Writer.WriteString(guild.NameindexPacket);
                
index = (ushort)(index 16);
                
Writer.WriteUInt32(guild.CTFPointsindexPacket);
                
index = (ushort)(index 4);
                
Writer.WriteUInt32(guild.MemberCountindexPacket);
                
index = (ushort)(index 12);
            }
            
client.Send(Packet);
        }

        public static 
void CTFExpolitsRank(GameState clientbyte[] packet)
        {
            
byte page packet[10];

            var array = 
client.Guild.Members.Values.Where(=> p.Exploits != 0).OrderByDescending(=> p.Exploits).ToArray();
            if (array.
Length == 0)
                return;

            
byte[] buffer = new byte[0x38c];
            
Writer.WriteUInt16(9000buffer);
            
Writer.WriteUInt16(0x4272buffer);
            
Writer.WriteUInt16(84buffer);
            
Writer.WriteUInt32(page6buffer);
            
Writer.WriteUInt32((uint)array.Length10buffer);
            
Writer.WriteUInt32(814buffer);
            
Writer.WriteUInt32(client.AsMember.Exploits0x12buffer);
            
int offset 30;
            for (
ushort x 0< array.Lengthx++)//(ushort)(page * maxcount - maxcount); x < page * maxcount; x++)
            
{
                if (
20)
                    break;
                if (
>= array.Length) break;
                var 
member = array[x];
                
Writer.WriteString(member.Nameoffsetbuffer);
                
offset += 0x10;

                
Writer.WriteUInt32(member.Exploitsoffsetbuffer);
                
offset += 4;
            }
            
client.Send(buffer);
        }

        public static 
void CTFExpolitsRank2(GameState clientbyte[] packet)
        {
            const 
byte maxcount 5;
            
byte page packet[10];

            var array = 
client.Guild.Members.Values.Where(=> p.Exploits != 0).OrderByDescending(=> p.Exploits).ToArray();
            if (array.
Length == 0)
                return;

            
byte[] buffer = new byte[0x38c];
            
Writer.WriteUInt16(9000buffer);
            
Writer.WriteUInt16(0x4272buffer);
            
Writer.WriteUInt16(14buffer);
            
Writer.WriteUInt32(page6buffer);
            
Writer.WriteUInt32((uint)array.Length10buffer);
            
Writer.WriteUInt32(514buffer);
            
Writer.WriteUInt32(client.Guild.CTFdonationCPsold0x12buffer);
            
Writer.WriteUInt64((ulong)client.Guild.CTFdonationSilverold0x16buffer);

            
Writer.WriteUInt32((ushort)array.Length30buffer);

            
int offset 30;

            for (
ushort x = (ushort)(page maxcount maxcount); page maxcountx++)
            {
                if (
>= array.Length) break;
                var 
member = array[x];
                
Writer.WriteUInt32((ushort)(1), offsetbuffer);
                
offset += 4;

                
Writer.WriteUInt32(member.Exploitsoffsetbuffer);
                
offset += 4;
                
Writer.WriteUInt32(member.CTFCpsRewardoffsetbuffer);
                
offset += 4;
                
Writer.WriteUInt64(member.CTFSilverRewardoffsetbuffer);
                
offset += 8;
                
Writer.WriteUInt32(member.IDoffsetbuffer);
                
offset += 4;
                
Writer.WriteString(member.Nameoffsetbuffer);
                
offset += 0x24;
            }
            
client.Send(buffer);
        }
    }


Handle.cs

كود:
if (attacker.MapID == CaptureTheFlag.MapID)
                if (
attacker.GuildID != && Program.World.CTF.Bases[attacked.UID].CapturerID != attacker.GuildID)
                {
                    
Program.World.CTF.AddScore(damageattacker.Owner.Guildattacked);
                } 

entity.cs

كود:
 #region CaptureTheFlag
            
if (killer.GuildID != && 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)(1000 Y), XYMapID);
                    
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 

packetid.cs

كود:
CaptureTheFlag 2224

sobnpcspawn.cs

كود:
if (MapID == CaptureTheFlag.MapID)
            {
                if (
Program.World.CTF.Bases.ContainsKey(UID))
                {
                    var 
_base Program.World.CTF.Bases[UID];
                    
_base.Capture();
                }
            } 

packetHandler.cs

كود:
 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(clientpacket);
                                    }
                                    else
                                    {
                                        
CaptureTheFlag.CTFExpolitsRank(clientpacket);
                                    }
                                    break;
                                }
                            case 
1:
                                {
                                    if (
client.Guild == null || client.AsMember == null)
                                        break;

                                    
CaptureTheFlag.CTFExpolitsRank2(clientpacket);
                                    break;
                                }
                            case 
3:
                                {
                                    
uint setCTFCps BitConverter.ToUInt32(packet18);
                                    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(packet22);
                                    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(packet18);
                                    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(packet22);

                                    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(clientpacket);
                                    break;
                                }
                            case 
9:
                                {
                                    if (
client.Guild == null || client.AsMember == null)
                                        break;
                                    if (
CaptureTheFlag.IsWar)
                                    {
                                        new 
CaptureTheFlag.CTF_Rank(client).Send(client);
                                    }
                                    else
                                    {
                                        
CaptureTheFlag.CTFsRank(clientpacket);
                                    }
                                    break;
                                }

                        }
                        break;
                    } 


كود:
case 2224:
                    {
                        if (
packet[4] == 7)//2
                            
client.Send(Program.World.CTF.generateCTFRanking());

                        if (
CaptureTheFlag.IsWar)
                        {
                            
byte[] p773 = new byte[] { 6001768110001000000000000000000000000000000000000000000000000000848183101114118101114 };
                            
client.Send(p773);
                        }
                        else
                            
client.Send(packet);
                        break;
                    } 

GamePackets.cs

كود:
MsgCaptureTheFlagUpdate 2224,
CaptureTheFlagRankings 1063

world.cs

كود:
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 


قديم 2019-08-07, 02:02 AM
المشاركة 6
osama
.:: عضو مميز ::.
  • غير متواجد
افتراضي رد: طلب بخصوص الحروب
شكرا يا ريدر انا ضيفت التيم والاسكل كان فاضل ال ctf شكرا على مساعدتك لية

قديم 2019-08-07, 04:49 AM
المشاركة 7
Tefa
.:: عضو خبير ::.
  • غير متواجد
افتراضي رد: طلب بخصوص الحروب
حبيبي يا غالي <3


العلامات المرجعية



الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1)
 

الانتقال السريع

المواضيع المتشابهه للموضوع: طلب بخصوص الحروب
الموضوع كاتب الموضوع المنتدى مشاركات آخر مشاركة
طلب بخصوص الدروب الوحوش الكبيرة abdocoder مشكلات السيرفيرات كونكر الشخصيه 2 2020-05-02 05:00 AM
بخصوص الدروب stevenayman1 مشكلات السيرفيرات كونكر الشخصيه 6 2020-04-04 05:14 PM
بخصوص الحروب xAttack مشكلات السيرفيرات كونكر الشخصيه 4 2019-11-17 06:36 AM
حاجه بخصوص الحروب uncelsam مشكلات السيرفيرات كونكر الشخصيه 5 2019-07-14 05:12 PM
طلب بخصوص الدروب osama مشكلات السيرفيرات كونكر الشخصيه 17 2019-07-01 10:16 PM


الساعة الآن 08:45 PM

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.