منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   كويستة TeamDeathMatch كامله (https://code.vpscairo.com/showthread.php?t=84)

محمد ياسر 2019-04-20 10:11 PM

كويستة TeamDeathMatch كامله
 

كويستة TeamDeathMatch هيا موجودة في كل السورسات الي موجودة تقريبأ
بس للاسف مش كاملة و فيها مشاكل:popcorm2:
انا حليتها و شغلتها 100% و ظبطت المواعيد و البريز
كفاية كلام :buba:
اتفضلو
بسم الله
خش على Nps
دور على

case 54239:

و بدل الان بي سي القديم بدا
كود PHP:

#region TeamDeathMatch 0
                
case 54239:
                    {
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    if (
client.Entity.Tournament_Signed == false)
                                    {
                                        var 
time DateTime.Now;
                                        if (
DateTime.Now.Minute >= 40 && DateTime.Now.Minute 41)
                                        {
                                            
dialog.Text("The TeamDeathMatch tournament has now started!");
                                            
dialog.Text("You will get divided into 4 teams, black and white , blue and red, and ");
                                            
dialog.Text("must eliminate the other. Only fastblade/scentsword is allowed!");
                                            
dialog.Option("Let me join!"1);
                                            
dialog.Option("Not intrested"255);
                                        }
                                        else
                                        {
                                            
dialog.Text("The TeamDeathMatch  tournament is not active");
                                            
dialog.Option("I see"255);
                                        }
                                    }
                                    else
                                    {
                                        
dialog.Text("You already Signed in TeamDeathMatch");
                                        
dialog.Option("I see"255);
                                    }
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    if (!
client.Spells.ContainsKey(1045) && !client.Spells.ContainsKey(1046))
                                    {
                                        
dialog.Text("You need to learn FastBlade or ScentSword first!");
                                        
dialog.Option("I see"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
//181515 BlackElegance
                                    //181615 RedElegance
                                    //181815 BlueElegance
                                    //181315 WhiteElegence
                                    
if (client.Entity.Tournament_Signed == false)
                                    {
                                        var 
time DateTime.Now;
                                            if (
DateTime.Now.Minute >= 40 && DateTime.Now.Minute 41)
                                       {
                                            
Random r = new Random();
                                            
int Team r.Next(18);
                                            if (
Team == || Team == 2)
                                            {
                                                
client.BackupArmorLook client.ArmorLook;
                                                
client.SetNewArmorLook(181325);

                                                
//client.Entity.CurHP = 1;
                                                
client.Entity.Tournament_Signed true;
                                                
client.Entity.TeamDeathMatch_WhiteTeam true;
                                                
client.Entity.TeamDeathMatch_Hits 0;

                                                
dialog.Text("You have been signed up for <TeamDeathMatch> <Team White>");
                                                
//GC.AddSend(Packets.NPCSetFace(0));
                                                //GC.AddSend(Packets.NPCFinish());
                                            
}
                                            if (
Team == || Team == 4)
                                            {
                                                
client.BackupArmorLook client.ArmorLook;//TeamXor We Not Only But We Are The Best members
                                                
client.SetNewArmorLook(181525);


                                                
//client.Entity.CurHP = 1;
                                                
client.Entity.Tournament_Signed true;
                                                
client.Entity.TeamDeathMatch_BlackTeam true;
                                                
client.Entity.TeamDeathMatch_Hits 0;

                                                
dialog.Text("You have been signed up for <TeamDeathMatch> <Team Black>");
                                                
//GC.AddSend(Packets.NPCSetFace(0));
                                                //GC.AddSend(Packets.NPCFinish());
                                            
}
                                            if (
Team == || Team == 6)
                                            {
                                                
client.BackupArmorLook client.ArmorLook;
                                                
client.SetNewArmorLook(181825);


                                                
//client.Entity.CurHP = 1;
                                                
client.Entity.Tournament_Signed true;
                                                
client.Entity.TeamDeathMatch_BlueTeam true;
                                                
client.Entity.TeamDeathMatch_Hits 0;

                                                
dialog.Text("You have been signed up for <TeamDeathMatch> <Team Blue>");
                                                
//GC.AddSend(Packets.NPCSetFace(0));
                                                //GC.AddSend(Packets.NPCFinish());
                                            
}
                                            if (
Team == || Team == 8)
                                            {
                                                
client.BackupArmorLook client.ArmorLook;
                                                
client.SetNewArmorLook(181625);


                                                
//client.Entity.CurHP = 1;
                                                
client.Entity.Tournament_Signed true;
                                                
client.Entity.TeamDeathMatch_RedTeam true;
                                                
client.Entity.TeamDeathMatch_Hits 0;

                                                
dialog.Text("You have been signed up for <TeamDeathMatch> <Team Red>");
                                                
//GC.AddSend(Packets.NPCSetFace(0));
                                                //GC.AddSend(Packets.NPCFinish());
                                            
}
                                        }
                                    }
                                    else
                                    {
                                        
dialog.Text("You are already signed up for this tournament!");
                                        
dialog.Option("I see."255);
                                        
//GC.AddSend(Packets.NPCSetFace(67));
                                        //GC.AddSend(Packets.NPCFinish());
                                    
}
                                    
dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 

تمام خش على World
و دور على

#region DTM

لو ملقيتوش دور على


كود PHP:

DeathMatch.SendTimer(); 

اقفلو و بدلو بدا
كود PHP:

 #region DTM
            
if ((Now64.Minute == 39) && (Now64.Second == 1))
            {
                
DeathMatch.SendTimer();
                
Kernel.SendWorldMessage(new Message("Team Death match will start in one minute!"Color.WhiteMessage.TopLeft), Program.GamePool);
            }
            
#endregion 

نكمل خش المسار دا
\Game\Features\Tournaments
يعني افتح الكلاس دا
DeathMatch.cs
امسح كل الي في و بدلو بدا


كود PHP:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Conquer_Online_Server.Network.GamePackets;

namespace 
Conquer_Online_Server.Game
{
    public class 
DeathMatch
    
{
        public const 
ushort MAPID 8883;
        public static 
int[] Points = new int[4];
        public const 
uint 
            BlackTeam 
0,
            
BlueTeam 1,
            
RedTeam 2,
            
WhiteTeam 3;
        public static 
bool IsOn false;
        public static 
bool CouplesWar false;
        public static 
IDisposable TimerATimerBTimerC;
        public static 
void SendTimer()
        {
            
TimerA World.Subscribe(SignUp1000);
        }
        public static 
bool signup false;
        public static 
bool send false;
        public static 
bool end false;

        public static 
void SignUp(int ttime)
        {
            var 
time DateTime.Now;
            if ((
time.Minute == 40) && signup == false)
            {
                
TimerA.Dispose();
                
TimerB World.Subscribe(Send1000);
                for (
int i 0Points.Lengthi++) Points[i] = 0;
                
send false;
                
end false;
                
signup true;
                
IsOn true;
                
Kernel.SendWorldMessage(new Message("TeamDeathMatch have started. Sign Up in TwinCity! You have one minute"System.Drawing.Color.RedMessage.Center), Program.GamePool);
                foreach (var 
player in Program.GamePool)
                {
                    
player.MessageBox("Team DeathMatch has started. Do you want to join?",
                        (
p) => { p.Entity.Teleport(1002456378); }, null60);
                }
            }
        }
        static 
Time32 LastUpdate;
        public static 
void Send(int ttime)
        {
            
Time32 now = new Time32(ttime);

            var 
time DateTime.Now;
            if ((
time.Minute == 41) && send == false)
            {
                
TimerC World.Subscribe(End1000);
                
signup false;
                
send true;
                
LastUpdate now;
                
Kernel.SendWorldMessage(new Network.GamePackets.Message("Kill!!"System.Drawing.Color.RedNetwork.GamePackets.Message.Center), Program.GamePool);
                
SendTeam();
            }
            if (
send)
            {
                if (
now LastUpdate.AddSeconds(5))
                {
                    
LastUpdate now;

                    var array = new[] 
                    {
                        
string.Format("Black team: {0}"Points[BlackTeam]),
                        
string.Format("Blue team: {0}"Points[BlueTeam]),
                        
string.Format("Red team: {0}"Points[RedTeam]),
                        
string.Format("White team: {0}"Points[WhiteTeam]),
                    };
                    
int Place 0;
                    foreach (var 
str in array)
                    {
                        
Message msg = new Message(strSystem.Drawing.Color.RedPlace == Message.FirstRightCorner Message.ContinueRightCorner);
                        
Kernel.SendWorldMessage(msgProgram.GamePool, (ushort)MAPID);
                        
Place++;
                    }
                }
            }
        }
        public static 
void SendTeam()
        {
            foreach (
Client.GameClient C in Program.GamePool)
            {
                if (
C.Entity.Tournament_Signed == true)
                {
                    
C.Entity.SpawnProtection true;
                    
C.Entity.TeamDeathMatch_Hits 0;
                    
C.Entity.AppearanceBkp C.Entity.Appearance;
                    
Network.PacketHandler.ChangeAppearance(new Data(true) { ID Data.AppearanceTypeUID C.Entity.UIDdwParam = (byte)AppearanceType.Garment }, C);
                    if (
C.Entity.TeamDeathMatch_BlackTeam == true)
                    {
                        
C.Entity.Teleport(8883042 ,051);
                    }
                    if (
C.Entity.TeamDeathMatch_BlueTeam == true)
                    {
                        
C.Entity.Teleport(8883060042);
                    }
                    if (
C.Entity.TeamDeathMatch_WhiteTeam == true)
                    {
                        
C.Entity.Teleport(8883066064);
                    }
                    if (
C.Entity.TeamDeathMatch_RedTeam == true)
                    {
                        
C.Entity.Teleport(8883039036);
                    }
                }
            }
        }
        public static 
void End(int ttime)
        {
            var 
time DateTime.Now;
            if ((
time.Minute == 46) && end == false)
            {
                
signup false;
                
end true;
                
IsOn false;
                foreach (
Client.GameClient client in Program.GamePool)
                {
                    if (
client.Entity.MapID == 8883)
                    {
                        
client.Entity.Teleport(1002400400);
                        
client.Entity.RemoveFlag(Update.Flags.Flashy);
                    }
                    if (
client.Entity.Tournament_Signed)
                    {
                        
client.Entity.Tournament_Signed false;
                        
Network.PacketHandler.ChangeAppearance(new Data(true) { ID Data.AppearanceTypeUID client.Entity.UIDdwParam = (byte)client.Entity.AppearanceBkp }, client);
                        
client.SetNewArmorLook(client.BackupArmorLook);
                        
client.BackupArmorLook 0;
                     }
                }
                
Reward();
                
TimerB.Dispose();
                
TimerC.Dispose();
            }
        }

        public static 
bool redwin false;
        public static 
bool blackwin false;
        public static 
bool bluewin false;
        public static 
bool whitewin false;

        public static 
void Reward()
        {
            
Dictionary<intinttop = new Dictionary<intint>();
            for (
int i 0Points.Lengthi++) top.Add(iPoints[i]);
            var array = 
top.OrderByDescending(=> o.Value).ToArray();
            if (array[
0].Key == RedTeam)
            {
                
redwin true;
            }
            else if (array[
0].Key == BlueTeam)
            {
                
bluewin true;
            }
            else if (array[
0].Key == WhiteTeam)
            {
                
whitewin true;
            }
            else
            {
                
blackwin true;
            }
            
int winKey = array[0].Key;
            
int hits DeathMatch.Points[winKey];
            
uint prize 250 * (uint)hits;
            
string name "RedTeam";
            if (
bluewinname "BlueTeam";
            if (
blackwinname "BlackTeam";
            if (
whitewinname "WhiteTeam";
            
Kernel.SendWorldMessage(new Network.GamePackets.Message(name " have won TeamDeathMatch! The Winner Team Have Gained " prize " ConquerPoints"System.Drawing.Color.RedConquer_Online_Server.Network.GamePackets.Message.Center), Program.GamePool);

            foreach (
Client.GameClient C in Program.GamePool)
            {
                
#region Winner
                
if (C.Entity.TeamDeathMatch_RedTeam && redwin)
                    
C.Entity.ConquerPoints += prize;
                if (
C.Entity.TeamDeathMatch_BlueTeam == bluewin)
                    
C.Entity.ConquerPoints += prize;
                if (
C.Entity.TeamDeathMatch_BlackTeam == blackwin)
                    
C.Entity.ConquerPoints += prize;
                if (
C.Entity.TeamDeathMatch_WhiteTeam == whitewin)
                    
C.Entity.ConquerPoints += prize;
                
#endregion

                
C.Entity.Tournament_Signed false;
                
C.Entity.TeamDeathMatch_Hits 0;
                
C.Entity.TeamDeathMatch_RedCaptain false;
                
C.Entity.TeamDeathMatch_RedTeam false;
                
C.Entity.TeamDeathMatch_BlueCaptain false;
                
C.Entity.TeamDeathMatch_BlueTeam false;
                
C.Entity.TeamDeathMatch_BlackCaptain false;
                
C.Entity.TeamDeathMatch_BlackTeam false;
                
C.Entity.TeamDeathMatch_WhiteCaptain false;
                
C.Entity.TeamDeathMatch_WhiteTeam false;
            }
        }
    }


تمام كدا جربو قولي الكويستة بتبدأ كل ساعة في الدقيقة 40 عندك دقيقة وحدة عشان تسجل و بعد دقيقة هتخش المابة اوتوماتك
و تضرب اس اس و اف بي و هتاخد سي بي اس على قد بيونتات التيم بتاعك بالعدل يعني لو احنا 5 في تيم و كسبنا 50 الف كل واحد هياخد 50 الف مش هتتقسم



karem1q 2023-10-13 09:06 PM

رد: كويستة TeamDeathMatch كامله
 
عاش

Ahmed3bdElR2ouF 2023-10-30 10:52 PM

رد: كويستة TeamDeathMatch كامله
 
تسلم ايدك ياخويا <3

بس للاسف مش شغاله معايا ، الــ npc مش بيديلي الجرمنت ولا حتي بيغير الشكل وبالتالي مش بتبدأ الوار!


الساعة الآن 09:01 PM

مرحبا بكم في منتدي اكواد لتطوير الالعاب