منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   EliteGuildwar To Alex Source (https://code.vpscairo.com/showthread.php?t=3203)

Tarek Y Fareed 2019-12-03 03:42 PM

EliteGuildwar To Alex Source
 


| السلام عليكم انشاء الله اليوم هنضيف EliteGuildwar |


" طبعا دة اول موضوع ليا علي المنتدي و انشاء الله مش هيبقا الاخير "


" يلا نخش ع الاضافة ع طول حمل التكست دة و في شرح كامل للحرب بي كل الاكواد "

Add EliteGuildWar

Add Class in Tournaments Name MsgEliteGuildWar\

Add

كود PHP:

using Extensions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Collections.Concurrent;

namespace 
Project_Terror_v2.Game.MsgTournaments
{
    public class 
MsgEliteGuildWar
    
{
        public static 
SafeDictionary<uintWinnerScoreList = new SafeDictionary<uintWinner>();
        public 
Dictionary<Role.SobNpc.StaticMeshRole.SobNpcFurnitures;
        public 
Winner RoundOwner;
        public static 
ushort MapID 6521;
        public 
ProcesType Proces;
        public class 
Winner
        
{
            public 
uint GuildID;
            public 
uint Score;
            public 
string GuildName;
        }
        public 
MsgEliteGuildWar()
        {
            
Proces ProcesType.Dead;
            
Furnitures = new Dictionary<Role.SobNpc.StaticMeshRole.SobNpc>();
        }
        public 
void Load()
        {
            
Furnitures.Add(Role.SobNpc.StaticMesh.PoleDatabase.Server.ServerMaps[MapID].View.GetMapObject<Role.SobNpc>(Role.MapObjectType.SobNpc6521));
        }
        public 
void CheckUP()
        {
            
DateTime Now DateTime.Now;
            if (
Proces == ProcesType.Dead && Now.Hour == 12 && Now.Minute == 30)
            
this.Start();
            if (
Proces == ProcesType.Alive)
            {
                if (
Now.Hour == 12 && Now.Minute == 40 && Now.Second <= 2)
                    
MsgSchedules.SendSysMesage("EliteGuildWar will ended after 10 Minutes."MsgServer.MsgMessage.ChatMode.Center);

                if (
Now.Hour == 12 && Now.Minute == 43 && Now.Second <= 2)
                    
MsgSchedules.SendSysMesage("EliteGuildWar will ended after 2 Minutes."MsgServer.MsgMessage.ChatMode.Center);

                if (
Now.Hour == 12 && Now.Minute == 45 && Now.Second 2)
                    
this.End();
            }
        }
        public 
void Start()
        {
            
RoundOwner null;
            
Proces ProcesType.Alive;
            
ScoreList = new SafeDictionary<uintWinner>();
            
MsgSchedules.SendSysMesage("EliteGuildWar war has began"MsgServer.MsgMessage.ChatMode.Center);
            
MsgSchedules.SendInvitation("EliteGuildWar has begun! Would you like to join?""CPs"3302491002060);
        }
        public 
void Reset(ServerSockets.Packet stream)
        {
            
ScoreList = new SafeDictionary<uintWinner>();

            foreach (var 
npc in Furnitures.Values)
                
npc.HitPoints npc.MaxHitPoints;

            var 
Pole Furnitures[Role.SobNpc.StaticMesh.Pole];
            var 
users Database.Server.GamePoll.Values.Where(=> Role.Core.GetDistance(u.Player.Xu.Player.YPole.XPole.Y) <= Role.SobNpc.SeedDistrance).ToArray();
            if (
users != null)
            {
                foreach (var 
user in users)
                {
                    
MsgServer.MsgUpdate upd = new MsgServer.MsgUpdate(streamPole.UID2);
                    
stream upd.Append(streamMsgServer.MsgUpdate.DataType.Mesh, (long)Pole.Mesh);
                    
stream upd.Append(streamMsgServer.MsgUpdate.DataType.HitpointsPole.HitPoints);
                    
stream upd.GetArray(stream);
                    
user.Send(stream);
                    if ((
Role.SobNpc.StaticMesh)Pole.Mesh == Role.SobNpc.StaticMesh.Pole)
                        
user.Send(Pole.GetArray(streamfalse));
                }
            }
        }
        public 
void FinishRound(ServerSockets.Packet stream)
        {
            
SortScores(true);
            
Furnitures[Role.SobNpc.StaticMesh.Pole].Name RoundOwner.GuildName;
            
MsgSchedules.SendSysMesage("The Round Ownered by guild " RoundOwner.GuildName "."MsgServer.MsgMessage.ChatMode.Center);
            
Reset(stream);
        }
        public 
void End()
        {
            if (
Proces == ProcesType.Alive)
            {
                
Proces ProcesType.Dead;
                
MsgSchedules.SendSysMesage(RoundOwner == null "EliteGuildWar has ended and there is no winner" "Guild " RoundOwner.GuildName ", He is the winner of EliteGuildWar."MsgServer.MsgMessage.ChatMode.Center);
                
ScoreList.Clear();
            }
        }
        public 
void UpdateScore(ServerSockets.Packet streamuint ScoreRole.Instance.Guild Guild)
        {
            if (!
ScoreList.ContainsKey(Guild.Info.GuildID))
                
ScoreList.Add(Guild.Info.GuildID, new Winner() { GuildName Guild.GuildNameGuildID Guild.Info.GuildIDScore Score });
            else
                
ScoreList[Guild.Info.GuildID].Score += Score;

            
SortScores();

            if (
Furnitures[Role.SobNpc.StaticMesh.Pole].HitPoints 1)
            {
                
FinishRound(stream);
                return;
            }
        }
        private 
void SortScores(bool getwinner false)
        {
            if (
Proces != ProcesType.Dead)
            {
                var Array = 
ScoreList.Values.ToArray();
                var 
DescendingList = Array.OrderByDescending(=> p.Score).ToArray();
                for (
int x 0DescendingList.Lengthx++)
                {
                    var 
element DescendingList[x];
                    if (
== && getwinner)
                    {
                        
RoundOwner element;
                    }
                    
using (var rec = new ServerSockets.RecycledPacket())
                    {
                        
Game.MsgServer.MsgMessage msg = new MsgServer.MsgMessage("No " + (1).ToString() + ". " element.GuildName " (" element.Score ")"
                           
MsgServer.MsgMessage.MsgColor.yellow== MsgServer.MsgMessage.ChatMode.FirstRightCorner MsgServer.MsgMessage.ChatMode.ContinueRightCorner);

                        
SendMapPacket(msg.GetArray(rec.GetStream()));
                    }
                    if (
== 4)
                        break;
                }
            }
        }
        public 
void SendMapPacket(ServerSockets.Packet packet)
        {
            foreach (var 
client in Database.Server.ServerMaps[MapID].Values)
                
client.Send(packet);
        }
    }


Step 2

Search in NPCServer From
كود PHP:

Game.MsgTournaments.MsgSchedules.GuildWar.Load(); 

And Add
كود PHP:

Game.MsgTournaments.MsgSchedules.EliteGuildWar.Load(); 

Step3
Open Class NpcID
and add
كود PHP:

EliteGuildWar 6522

step4
Open Class CanAttackNPC
and add
كود PHP:

if (attacked.UID == Game.MsgTournaments.MsgSchedules.EliteGuildWar.Furnitures[Role.SobNpc.StaticMesh.Pole].UID)
           {
               if (
Game.MsgTournaments.MsgSchedules.EliteGuildWar.Furnitures[Role.SobNpc.StaticMesh.Pole].HitPoints == 0)
                   return 
false;
               if (
client.Player.MyGuild.GuildName == Game.MsgTournaments.MsgSchedules.EliteGuildWar.Furnitures[Role.SobNpc.StaticMesh.Pole].Name)
                   return 
false;
               if (
Game.MsgTournaments.MsgSchedules.EliteGuildWar.Proces != MsgTournaments.ProcesType.Alive)
                   return 
false;
           } 

step5
Open class NPC
and add
كود PHP:

else if (Game.MsgTournaments.MsgSchedules.EliteGuildWar.Proces == MsgTournaments.ProcesType.Alive && attacked.UID == Game.MsgTournaments.MsgSchedules.EliteGuildWar.Furnitures[Role.SobNpc.StaticMesh.Pole].UID)
                    
Game.MsgTournaments.MsgSchedules.EliteGuildWar.UpdateScore(streamobj.Damageclient.Player.MyGuild); 


Step6
Open class MsgSchedules
and Search
كود PHP:

internal static MsgDragonIsland DragonIsland

add add
كود PHP:

internal static MsgEliteGuildWar EliteGuildWar

step7
Open class MsgSchedules
and Search
كود PHP:

GuildWar = new MsgGuildWar(); 

and add
كود PHP:

EliteGuildWar = new MsgEliteGuildWar(); 

step8
class Search MsgSchedules
And Search
كود PHP:

SteedRace.work(0); 

add add
كود PHP:

EliteGuildWar 

Step9
Open Class Program
and Search
كود PHP:

case "powerarena"

and add
كود PHP:

case "eliteguildwaron":
                        {
                            
Game.MsgTournaments.MsgSchedules.EliteGuildWar.Start();
                            break;
                        }
                    case 
"eliteguildwarend":
                        {
                            
Game.MsgTournaments.MsgSchedules.EliteGuildWar.End();
                            break;
                        } 

Step 10
Open Class SobNpc
and Search
كود PHP:

Game.MsgTournaments.MsgSchedules.CaptureTheFlag.UpdateFlagScore(killer.Playerthis0stream); 

And add

كود PHP:

else if (UID == Game.MsgTournaments.MsgSchedules.EliteGuildWar.Furnitures[StaticMesh.Pole].UID)
            {
                
uint Damage = (uint)HitPoints;

                if (
HitPoints 0)
                    
HitPoints 0;

                
Game.MsgTournaments.MsgSchedules.EliteGuildWar.UpdateScore(streamDamagekiller.Player.MyGuild);
            } 

Step 11
Open Class NpcHandler
And Add
كود PHP:

[NpcAttribute(NpcID.ElitGuildWar)]
        public static 
void ServerEvents(Client.GameClient clientServerSockets.Packet streambyte Optionstring Inputuint id)
        {
            
DateTime Now64 DateTime.Now;
            
Dialog dialog = new Dialog(clientstream);
            
Dialog data = new Dialog(clientstream);

            switch (
Option)
            {

                case 
0:
                    {
                        
dialog.AddText("Hey there " client.Player.Name " Would you like to join Quest in time?!");
                        if (
Game.MsgTournaments.MsgSchedules.EliteGuildWar.Proces == MsgTournaments.ProcesType.Alive)
                            
dialog.AddOption("EliteGuildWar[Open]"1);
                        else
                            
dialog.AddOption("EliteGuildWar[Claim]"2);
                        if (
Project_Terror_v2.Game.MsgTournaments.MsgWarOfPlayers.Proces == MsgTournaments.ProcesType.Alive)
                            
dialog.AddOption("Thanxs."255).AddAvatar(80).FinalizeDialog();
                        break;
                    }
                case 
1:
                    {
                        if (
client.Player.MyGuild == null)
                        {
                            
dialog.AddText("Sorry you not have Guild.")
                    .
AddAvatar(123).FinalizeDialog();
                            break;
                        }
                        if (
Game.MsgTournaments.MsgSchedules.EliteGuildWar.Proces == MsgTournaments.ProcesType.Alive)
                        {
                            
client.Teleport(831396521);
                        }
                        else
                            
dialog.AddText("The EliteGuildWar Is Not Started / 22.00 End 23.00 .").AddOption("Alright.").FinalizeDialog();
                        break;
                    }
                case 
2:
                    {
                        if (
Game.MsgTournaments.MsgSchedules.EliteGuildWar.Proces != MsgTournaments.ProcesType.Alive)
                        {
                            if (
Game.MsgTournaments.MsgSchedules.EliteGuildWar.RoundOwner != null && Role.Instance.Guild.GuildPoll.ContainsKey(Game.MsgTournaments.MsgSchedules.EliteGuildWar.RoundOwner.GuildID))
                            {
                                if (
client.Player.GuildRank == Role.Flags.GuildMemberRank.GuildLeader)
                                {
                                    if (
client.Player.MyGuild.Info.GuildID == Game.MsgTournaments.MsgSchedules.EliteGuildWar.RoundOwner.GuildID)
                                    {
                                        
client.Player.ConquerPoints += 50000;
                                        
client.Inventory.Add(stream3009003);
                                        
client.Inventory.Add(stream722057);
                                        
client.Inventory.Add(stream722057);
                                        
client.Inventory.Add(stream722057);
                                        
client.Inventory.Add(stream722057);
                                        
client.Inventory.Add(stream3009001);
                                        
client.Inventory.Add(stream3009002);
                                        
Game.MsgTournaments.MsgSchedules.EliteGuildWar.RoundOwner null;
                                        
Game.MsgTournaments.MsgSchedules.SendSysMesage(client.Player.Name " has receved 50,000 CPs + 3x Stone Perf for winning EliteGuildWar ."MsgMessage.ChatMode.Center);
                                    }
                                    else
                                        
dialog.AddText("You dont have any rewrd to claim.").AddOption("Alright.").FinalizeDialog();
                                }
                                else
                                    
dialog.AddText("Only the guild leader can claim the reward.").AddOption("Alright.").FinalizeDialog();
                            }
                            else
                                
dialog.AddText("There is no any rewards now..").AddOption("Alright.").FinalizeDialog();
                        }
                        else
                            
dialog.AddText("Please come back when eliteguildwar is finished.").AddOption("Alright.").FinalizeDialog();

                        break;
                    }
            }
        } 

Step 12
Open Class NpcID
add
كود PHP:

ElitGuildWar 159853


This is NPC Number 159853
And You Make NPc Exit If You Need

Enjoy



| التحميل |


عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع


يلا سلام و استنو مني حرب تاني قريب انشاء الله

محمد ياسر 2019-12-03 07:28 PM

رد: EliteGuildwar To Alex Source
 
عاش استمر

HBESA 2019-12-03 09:52 PM

رد: EliteGuildwar To Alex Source
 
عاش استمر

ابو حمزه 2019-12-04 01:31 AM

رد: EliteGuildwar To Alex Source
 
thanks brother

uncelsam 2020-03-03 11:12 PM

رد: EliteGuildwar To Alex Source
 
عاااش

asd201230099 2020-03-04 01:48 AM

رد: EliteGuildwar To Alex Source
 
عااااااااااااااااااااااش

ahmedyhaey 2021-07-24 05:56 AM

رد: EliteGuildwar To Alex Source
 
عاش

OmarMimi5095 2021-07-25 06:17 AM

رد: EliteGuildwar To Alex Source
 
عااش

KekoCoder 2021-07-30 09:50 AM

رد: EliteGuildwar To Alex Source
 
3aaash

cotest1 2023-05-16 08:42 PM

رد: EliteGuildwar To Alex Source
 
nice bro


الساعة الآن 12:44 AM

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