منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   حرب PoleIslanD (https://code.vpscairo.com/showthread.php?t=3816)

Hassan Emprator 2020-02-20 04:12 PM

حرب PoleIslanD
 

سلام عليكم حبايبي قولتلكو هنيجي بكل حاجه جديده طبعا

يله نبدا ونقول بسم الله

اعمل كلاس ومسيه

كود PHP:

PoleIslanD 

وضيف فيه

كود PHP:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EmpratorServer.Network.GamePackets;
using EmpratorServer.Game.ConquerStructures.Society;

namespace 
EmpratorServer.Game
{
    public class 
PoleIslanD
    
{
        public static 
SobNpcSpawn PoleRightGateLeftGate;

        public static 
SobNpcSpawn Poles;
        public const 
ushort MapID 2075;
        public static 
SafeDictionary<uintGuildScores = new SafeDictionary<uintGuild>(100);

        public static 
bool IsWar falseFlame10th falseFirstRound false;

        public static 
Time32 ScoreSendStampLastWin;

        public static 
Guild PoleKeeperCurrentTopLeader;

        private static 
bool changed false;

        private static 
string[] scoreMessages;

        public static 
DateTime StartTime;

        public static 
bool Claim
        
{
            
get { return Program.Vars["pwclaim"]; }
            
set Program.Vars["pwclaim"] = value; }
        }
        public static 
uint KeeperID
        
{
            
get { return Program.Vars["pwkeeperid"]; }
            
set Program.Vars["pwkeeperid"] = value; }
        }

        public static 
void PoleIslanDIni()
        {
            var 
Map Kernel.Maps[2075];
            
Pole = (SobNpcSpawn)Map.Npcs[815];
            
LeftGate = (SobNpcSpawn)Map.Npcs[516020];
            
RightGate = (SobNpcSpawn)Map.Npcs[516021];
        }

        public static 
void Start()
        {
            
object[] name;
            if (
LeftGate == null) return;
            
Scores = new SafeDictionary<uintGuild>(100);
            
StartTime DateTime.Now;
            
LeftGate.Mesh = (ushort)(240 LeftGate.Mesh 10);
            
RightGate.Mesh = (ushort)(270 LeftGate.Mesh 10);
            
name = new object[] { "Quest PoleIslanD Has Started Go To Guild Controller At TwinCity (352,337)" };
            
Kernel.SendWorldMessage(new Message(string.Concat(name), "ALLUSERS""PoleIslanD"System.Drawing.Color.Red2500), Program.Values);
            
Kernel.SendWorldMessage(new Message("PoleIslanD has began!"System.Drawing.Color.RedMessage.Center), Program.Values);
            
FirstRound true;
            foreach (
Guild guild in Kernel.Guilds.Values)
            {
                
guild.PIScore 0;
            }
            
Update upd = new Update(true);
            
upd.UID LeftGate.UID;
            
upd.Append(Update.MeshLeftGate.Mesh);
            
upd.Append(Update.HitpointsLeftGate.Hitpoints);
            
Kernel.SendWorldMessage(updProgram.Values, (ushort)2075);
            
upd.Clear();
            
upd.UID RightGate.UID;
            
upd.Append(Update.MeshRightGate.Mesh);
            
upd.Append(Update.HitpointsRightGate.Hitpoints);
            
Kernel.SendWorldMessage(updProgram.Values, (ushort)2075);
            
Claim false;
            
IsWar true;
        }

        public static 
void Reset()
        {
            
Scores = new SafeDictionary<uintGuild>(100);

            
LeftGate.Mesh = (ushort)(240 LeftGate.Mesh 10);
            
RightGate.Mesh = (ushort)(270 LeftGate.Mesh 10);

            
LeftGate.Hitpoints LeftGate.MaxHitpoints;
            
RightGate.Hitpoints RightGate.MaxHitpoints;
            
Pole.Hitpoints Pole.MaxHitpoints;

            
Update upd = new Update(true);
            
upd.UID LeftGate.UID;
            
upd.Append(Update.MeshLeftGate.Mesh);
            
upd.Append(Update.HitpointsLeftGate.Hitpoints);
            
Kernel.SendWorldMessage(updProgram.Values, (ushort)2075);
            
upd.Clear();
            
upd.UID RightGate.UID;
            
upd.Append(Update.MeshRightGate.Mesh);
            
upd.Append(Update.HitpointsRightGate.Hitpoints);
            
Kernel.SendWorldMessage(updProgram.Values, (ushort)2075);

            foreach (
Guild guild in Kernel.Guilds.Values)
            {
                
guild.PIScore 0;
            }

            
IsWar true;
        }

        public static 
void FinishRound()
        {
            if (
PoleKeeper != null && !FirstRound)
            {
                if (
PoleKeeper.Wins == 0)
                    
PoleKeeper.Losts++;
                else
                    
PoleKeeper.Wins--;
                
Database.GuildTable.UpdateGuildWarStats(PoleKeeper);
            }
            
LastWin Time32.Now;

            
FirstRound false;
            
SortScores(out PoleKeeper);
            if (
PoleKeeper != null)
            {
                
KeeperID PoleKeeper.ID;
                
Kernel.SendWorldMessage(new Message("The guild, " PoleKeeper.Name ", owned by " PoleKeeper.LeaderName " has won this PoleIslanD round!"System.Drawing.Color.RedMessage.Center), Program.Values);
                
Kernel.SendWorldMessage(new Message("It is generald pardon time. You have 5 minutes to leave, run for your life!"System.Drawing.Color.WhiteMessage.TopLeft), Program.Values, (ushort)6001);
                if (
PoleKeeper.Losts == 0)
                    
PoleKeeper.Wins++;
                else
                    
PoleKeeper.Losts--;
                
Database.GuildTable.UpdateGuildWarStats(PoleKeeper);
                
Pole.Name PoleKeeper.Name;
            }
            
Pole.Hitpoints Pole.MaxHitpoints;
            
Kernel.SendWorldMessage(PoleProgram.Values, (ushort)2075);
            
Reset();
        }

        public static 
void End()
        {
            if (
PoleKeeper != null)
            {
                
Kernel.SendWorldMessage(new Message("The guild, " PoleKeeper.Name ", owned by " PoleKeeper.LeaderName " has won this PoleIslanD!---PoleIslanD has ended!"System.Drawing.Color.WhiteMessage.Center), Program.Values);
                
//EmpratorServer.Database.EntityTable.Status2(); 
            
}
            else
            {
                
Kernel.SendWorldMessage(new Message("PoleIslanD has ended and there was no winner!"System.Drawing.Color.RedMessage.Center), Program.Values);
                
//EmpratorServer.Database.EntityTable.Status2(); 
            
}
            
IsWar false;
            
Claim true;
            
UpdatePole(Pole);
            foreach (
Client.GameState client in Program.Values)
            {
                
//client.Entity.Status2 = 0; 
                //client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.TopDeputyLeader); 
                //client.Entity.RemoveFlag(Network.GamePackets.Update.Flags.TopGuildLeader); 
            
}
        }

        public static 
void AddScore(uint addScoreGuild guild)
        {
            if (
guild != null)
            {
                
guild.PIScore += addScore;
                
changed true;
                if (!
Scores.ContainsKey(guild.ID))
                    
Scores.Add(guild.IDguild);
                if ((int)
Pole.Hitpoints <= 0)
                {
                    
FinishRound();

                    return;
                }
            }
        }

        public static 
void SendScores()
        {
            if (
scoreMessages == null)
                
scoreMessages = new string[0];
            if (
Scores.Count == 0)
                return;
            if (
changed)
                
SortScores(out CurrentTopLeader);

            for (
int c 0scoreMessages.Lengthc++)
            {
                
Message msg = new Message(scoreMessages[c], System.Drawing.Color.Red== Message.FirstRightCorner Message.ContinueRightCorner);
                
Kernel.SendWorldMessage(msgProgram.Values, (ushort)2075);
                
//Kernel.SendWorldMessage(msg, Program.GamePool, (ushort)6001); 
            
}
        }

        private static 
void SortScores(out Guild winner)
        {
            
winner null;
            List<
stringret = new List<string>();

            
int Place 0;
            foreach (
Guild guild in Scores.Values.OrderByDescending((p) => p.PTScore))
            {
                if (
Place == 0)
                    
winner guild;
                
string str "No  " + (Place 1).ToString() + ": " guild.Name "(" guild.PTScore ")";
                
ret.Add(str);
                
Place++;
                if (
Place == 4)
                    break;
            }

            
changed false;
            
scoreMessages ret.ToArray();
        }

        private static 
void UpdatePole(SobNpcSpawn pole)
        {
            new 
Database.MySqlCommand(EmpratorServer.Database.MySqlCommandType.UPDATE)
            .
Update("sobnpcs").Set("name"pole.Name).Set("life"Pole.Hitpoints).Where("id"pole.UID).Execute();
        }
    }


والانبي سي

كود PHP:

                #region PoleIslanD
                
case 115202:
                    {
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    
dialog.Text("Hey there " client.Entity.Name " Would you like to Join PoleIslanD?.");
                                    
dialog.Text("or claim the Prize?, you can join Every day  At 16:00 to 17:00.");
                                    
dialog.Text("and the winner Guild Leader will get 999.999.999 cps after it finish u have 5 minutes to claim?.");
                                    
dialog.Option("Join PoleIslanD"1);
                                    
dialog.Option("Claim Prize."5);
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    if (
PoleIslanD.IsWar)
                                    {
                                        
Random R = new Random();
                                        
int Nr R.Next(17);
                                        if (
Nr == 1client.Entity.Teleport(2075790571);
                                        if (
Nr == 2client.Entity.Teleport(2075790534);
                                        if (
Nr == 3client.Entity.Teleport(2075790590);
                                        if (
Nr == 4client.Entity.Teleport(2075789620);
                                        if (
Nr == 5client.Entity.Teleport(2075759530);
                                        if (
Nr == 6client.Entity.Teleport(2075737624);
                                        if (
Nr == 7client.Entity.Teleport(2075713622);


                                    }
                                    else
                                    {
                                        
dialog.Text("The war is not held now! It will start every day at 16:00");
                                        
dialog.Option("okay"255);
                                        
dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                            case 
5:
                                {
                                    if (!
PoleIslanD.IsWar)
                                    {
                                        if (
client.Guild != null)
                                        {
                                            if (
PoleIslanD.KeeperID != 0)
                                            {
                                                if (
PoleIslanD.Claim && client.AsMember.Rank == Game.Enums.GuildMemberRank.GuildLeader && client.Guild.ID == PoleIslanD.KeeperID)
                                                {
                                                    
PoleIslanD.Claim false;
                                                    
PoleIslanD.KeeperID 0;
                                                    
EmpratorServer.Kernel.SendWorldMessage(new Message("Congratulations! " client.Entity.Name " claimed the prize 999.999.999 CPs for winning the PoleIslanD."System.Drawing.Color.BlackMessage.Center), Program.Values);
                                                    
client.Entity.ConquerPoints += ServerRates.Poles;
                                                    
Program.AddWarLog("Pole""5.00.000.000 CPS"client.Entity.Name);
                                                }
                                                else
                                                {
                                                    
dialog.Text("sorry u dont have any prize to claim....");
                                                    
dialog.Option("okay"255);
                                                    
dialog.Send();
                                                    break;
                                                }
                                            }
                                        }
                                        else
                                        {
                                            
dialog.Text("sorry u dont have any prize to claim");
                                            
dialog.Option("okay"255);
                                            
dialog.Send();
                                            break;
                                        }
                                    }
                                    else
                                    {
                                        
dialog.Text("Hey there " client.Entity.Name " You can't get the prize while the war is on!");
                                        
dialog.Option("okay"255);
                                        
dialog.Send();
                                        break;
                                    }
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion
                #region PoleIslanD
                
case 815:
                    {
                        
dialog.Text("Welcome in PoleIslanD HaveFun!.");
                        
dialog.Option("Thanks."255);
                        
dialog.Send();
                        break;
                    }
                
#endregion 

سيرش عا

كود PHP:

 public static void ReceiveAttack(Game.Entity attackerSobNpcSpawn attackedAttack attackuint damage

وبعديها هتلاقي جوها

كود PHP:

            if (attacked.UID == 123456

تحته ضيف

كود PHP:

  if (attacker.MapID == 2075)
            {
                if (
attacked.UID == 815)
                {
                    if (
Game.PoleIslanD.PoleKeeper == attacker.Owner.Guild)
                        return;
                    if (
attacked.Hitpoints <= damage)
                        
attacked.Hitpoints 0;
                    
Game.PoleIslanD.AddScore(damageattacker.Owner.Guild);
                }
            } 

سيرش هنا

كود PHP:

 public static bool CanAttack(Game.Entity attackerSobNpcSpawn attacked

فوق

كود PHP:

                if (Game.PoleIslanD.PoleKeeper != null

ضيف

كود PHP:

            if (attacker.MapID == 2075)
            {
                if (
attacker.GuildID == || !Game.PoleIslanD.IsWar)
                {
                    if (
attacked.UID == 815)
                    {
                        return 
false;
                    }
                } 

شفره تشغيل

كود PHP:

                            case "island":
                                {
                                    switch (
Data[1])
                                    {
                                        case 
"on"PoleIslanD.Start();
                                            foreach (var 
cclient in Program.Values)
                                                
cclient.MessageBox("PoleIslanD has begun! Would you like to join?",
                                                       
=> { p.Entity.Teleport(1002313267); }, null); break;
                                        case 
"off"PoleIslanD.End(); break;
                                    }
                                    break;
                                } 

بعدين سيرش عا

كود PHP:

                Database.MapsTable.Load(); 

تحته ضيف

كود PHP:

                    Game.PoleIslanD.PoleIslanDIni();
                    
Console.WriteLine("PoleIslanD initializated."); 

الاوتو انفنت

كود PHP:

          #region PoleIslanD

            
if (!Game.PoleIslanD.IsWar)
            {
                if (
Now64.Hour == 16 && Now64.Minute == 00 && Now64.Second == 04)
                {
                    
Game.PoleIslanD.Start();

                    foreach (var 
client in Program.Values)
                        if (
client.Entity.MapID == 6000 || client.Entity.MapID == 6001 || client.Entity.MapID == 6002 || client.Entity.MapID == 6003 || client.Entity.MapID == 6004)
                            return;
                    foreach (var 
client in Program.Values)
                        if (
client.Entity.GuildID != 0)
                            
client.MessageBox("PoleIslanD has begun! Would you like to join? ",
                                
=> { p.Entity.Teleport(1002278192); }, null);
                }
            }
            if (
Game.PoleIslanD.IsWar)
            {
                if (
Time32.Now Game.PoleIslanD.ScoreSendStamp.AddSeconds(3))
                {
                    
Game.PoleIslanD.ScoreSendStamp Time32.Now;
                    
Game.PoleIslanD.SendScores();
                }
                if (
Now64.Hour == 16 && Now64.Minute == 50 && Now64.Second <= 2)
                {
                    
Kernel.SendWorldMessage(new Network.GamePackets.Message("10 Minutes left till PoleIslanD End Hurry kick other Guild's Ass!."System.Drawing.Color.WhiteNetwork.GamePackets.Message.Center), Program.Values);
                }
            }

            if (
Game.PoleIslanD.IsWar)
            {
                if (
Now64.Hour == 17 && Now64.Minute == 00 && Now64.Second == 04)
                {
                    
Game.PoleIslanD.End();
                    {

                    }
                }
            }
            
#endregion 

وفي program برضو ضيف

كود PHP:

                new Game.Map(2075Database.DMaps.MapPaths[2075]); 

سيرش هنا

كود PHP:

        public void Die(Game.Entity killer

ضيف

كود PHP:

 if (MapID == 2075)//island
            
{
                if (
UID != 815)
                {
                    if (
Hitpoints != || Mesh != 252 && Mesh != 282)
                    {
                        if (
Mesh == 241)
                            
Mesh = (ushort)(250 Mesh 10);
                        else
                            
Mesh = (ushort)(280 Mesh 10);

                        
Update upd = new Update(true);
                        
upd.UID UID;
                        
upd.Append(Update.MeshMesh);
                        
killer.Owner.SendScreen(updtrue);
                        
Hitpoints 0;
                    } 

سيرش عا

كود PHP:

     public static readonly System.Collections.Generic.List<ushortPKFreeMaps 

ضيف

كود PHP:

            2075

المابه بقا

كود PHP:

2075    2075    7    0 

بالتوفيق احبايبي



محمد ياسر 2020-02-20 04:44 PM

رد: حرب PoleIslanD
 
مانا منزله ايه الجديد هههههههههه
وكامله كمان
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع

Hassan Emprator 2020-02-20 06:04 PM

رد: حرب PoleIslanD
 
اقتباس:

المشاركة الأصلية كتبت بواسطة Hazem (المشاركة 29893)
مانا منزله ايه الجديد هههههههههه
وكامله كمان

لا دي غير دي وفي واحده كمان اسمها polephonix

ModyMohamedAdel 2020-02-21 04:40 PM

رد: حرب PoleIslanD
 
عاش

blackconquer222 2021-08-09 06:34 PM

رد: حرب PoleIslanD
 
عاش

Eslamahmed 2024-03-24 12:28 PM

رد: حرب PoleIslanD
 
بب

Castala7 2024-04-01 03:18 AM

رد: حرب PoleIslanD
 
تسلم

ahmednero2 2024-04-08 08:30 PM

رد: حرب PoleIslanD
 
ty


الساعة الآن 07:15 AM

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