منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3 (https://code.vpscairo.com/showthread.php?t=3802)

Hassan Emprator 2020-02-20 03:22 AM

حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 

سلام عليكم الفكره دي اولا شوفتها في كام سورسات ززي الاعاب الكبيهر وشوفتها في لعهب اسمها توب كونكر يعني فا كان نفسي جامد في الكويسته دي لغايه اما خت قرار اني اكودها وكودتها الحمد لله

وقررت اني انزلهالكو عشان تلاقو كل حاجه free احبايبي :D:D:D

يله نبدا واحده واحده معايا يض تمام

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

كود PHP:

PoleDomination 

وتضيف فيه

كود PHP:

// Created By HassanEmprator(HasssanHany)
// please dont change my information
// Have Fun <3
// 01009045798




using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MrHassan.Network.GamePackets;
using MrHassan.Client;


namespace 
MrHassan.Game
{
    
using Coordinate Tuple<ushortushortushort>;
    
using System.Drawing;
    
using MrHassan.Game.ConquerStructures.Society;
    
using MySql.Data.MySqlClient;
    
using System.Collections.Concurrent;
    
using System.IO;

    public class 
PoleDomination
    
{
        public const 
uint MaxHitPoints 30000000;
        private 
SobNpcSpawn Pole = new SobNpcSpawn()
        {
            
Hitpoints MaxHitPoints,
            
MaxHitpoints MaxHitPoints,
            
Mesh 1137,
            
ShowName true,
            
Type = (Enums.NpcType)10,
            
Name "FlameLotus-Pole",
            
Sort 21,
            
UID 123456
        
};

        private 
IDisposable Subscriber;
        private 
Coordinate[] Locations = new[]
        {
            new 
Coordinate(1002402255),
            new 
Coordinate(1011216324),
            new 
Coordinate(1020612590),
            new 
Coordinate(1000508709),
            new 
Coordinate(1015737641)
        };
        private 
int currentLocation;
        private 
bool poleKilled;
        private 
Map currentMap;
        private 
Coordinate currentCoordinate;
        private 
uint prize;
        private 
Guild lastKiller;
        public 
uint KillerGuildID get { if (lastKiller == null) return 0; return lastKiller.ID; } }
        private 
ConcurrentDictionary<Guildulongdamages;
        private List<
stringwinners;

        public 
PoleDomination(uint prize)
        {
            
Subscriber World.Subscribe(work1000);
            
currentLocation = -1;
            
this.prize prize;
            
damages = new ConcurrentDictionary<Guildulong>();
            
winners = new List<string>();
            
File.Open("database\\poledomination.txt"FileMode.OpenOrCreate).Close();
            foreach (var 
name in File.ReadAllLines("database\\poledomination.txt"))
                if (
name.Length != 0)
                    
winners.Add(name);
        }

        private 
void work(int time)
        {
            
Time32 time32 = new Time32(time);
            
DateTime time64 DateTime.Now;
            
//  if (time64.DayOfWeek == DayOfWeek.Tuesday)
            
{
                if (
Emprator_Times.Start.PoleDomnation/*time64.Hour == 00*/)
                
//if (time64.Hour == 17)
                
{
                    if (
time64.Minute 12 == 0)
                    {
                        if (
currentLocation != time64.Minute 12)
                        {
                            
ushort ID 0;
                            if (
currentLocation != -1)
                            {
                                
ID currentMap.ID;
                                
removePole();
                            }
                            
setWinner();
                            
bool killedPole poleKilled;
                            
poleKilled false;
                            
lastKiller null;
                            
currentLocation time64.Minute 12;
                            
currentCoordinate Locations[currentLocation];
                            if (!
Kernel.Maps.ContainsKey(currentCoordinate.Item1))
                                new 
Map(currentCoordinate.Item1"");
                            
currentMap Kernel.Maps[currentCoordinate.Item1];
                            
Pole.MapID currentMap.ID;
                            
Pole.currentCoordinate.Item2;
                            
Pole.currentCoordinate.Item3;
                            
currentMap.AddPole(Pole);
                            
Pole.Hitpoints Pole.MaxHitpoints MaxHitPoints;
                            
Kernel.Execute((client) =>
                            {
                                if (
client.Entity.MapID == currentMap.ID)
                                    if (
client.Screen.Add(Pole))
                                        
client.Send(Pole);
                                
client.MessageOK = (pClient) => { joinClient(pClient); };
                                
client.Send(new NpcReply(NpcReply.MessageBox"Pole Domination began in " + ((Enums.Maps)currentMap.ID).ToString() + ". Would you like to join?"));
                            });
                            
currentMap.WasPKFree Constants.PKFreeMaps.Contains(currentMap.ID);
                            if (!
currentMap.WasPKFreeConstants.PKFreeMaps.Add(currentMap.ID);
                            if (
currentLocation != -&& (killedPole && lastKiller != null && currentMap != null))
                                
Kernel.SendWorldMessage(new Message("Guild " lastKiller.Name " won the pole in " + ((Enums.Maps)ID).ToString() + "!" "The Pole Domination moved to " + ((Enums.Maps)currentMap.ID).ToString() + "!"Color.RedMessage.Guild));
                            else
                                
Kernel.SendWorldMessage(new Message("The Pole Domination moved to " + ((Enums.Maps)currentMap.ID).ToString() + "!"Color.RedMessage.Guild));
                        }
                    }
                    if (
time64.Second == 0)
                    {
                        var array = 
damages.OrderByDescending((p) => p.Value);
                        
int Place 0;
                        foreach (
KeyValuePair<Guildulongentry in array)
                        {
                            
string str "No  " + (Place 1).ToString() + ": " entry.Key.Name "(" entry.Value ")";

                            
Message msg = new Message(strSystem.Drawing.Color.RedPlace == Message.FirstRightCorner Message.ContinueRightCorner);
                            
Kernel.SendWorldMessage(msgProgram.Values, (ushort)currentMap.ID);
                            
Place++;
                            if (
Place == 4) break;
                        }
                    }
                }
                else
                {
                    if (
Pole.MapID != 0)
                    {
                        
currentMap Kernel.Maps[Pole.MapID];
                        
removePole();
                        
currentLocation = -1;
                        
setWinner();
                        if (
poleKilled)
                            
Kernel.SendWorldMessage(new Message("Guild " lastKiller.Name " won the pole in " + ((Enums.Maps)currentMap.ID).ToString() + "!"Color.RedMessage.Center));
                        
poleKilled false;
                        
lastKiller null;
                        
Pole.MapID 0;
                    }
                }
            }
        }
        private 
void setWinner()
        {
            if (
poleKilled)
            {
                
Kernel.SendWorldMessage(new Message("Guild " lastKiller.Name " won the pole in " + ((Enums.Maps)currentMap.ID).ToString() + "!"Color.RedMessage.Guild));
                
winners.Add(lastKiller.Name);
                
SaveWinners();
            }
        }

        public 
void SaveWinners()
        {
            
StringBuilder builder = new StringBuilder();
            foreach (var 
line in winnersbuilder.AppendLine(line);
            
File.WriteAllText("database\\poledomination.txt"builder.ToString());
        }
        public 
uint GetWinnerPrize(string name)
        {
            return (
uint)(prize winners.Count(=> == name));
        }
        public 
void RemoveWinner(string name)
        {
            
winners.RemoveAll(=> == name);
        }

        private 
void joinClient(GameState client)
        {
            
int x Kernel.Random.Next(36) - 18Kernel.Random.Next(36) - 18;
            
int times 1000;
            while (
times-- > 0)
            {
                if (!
currentMap.Floor[Pole.xPole.yMapObjectType.Entitynull])
                {
                    
Kernel.Random.Next(36) - 18;
                    
Kernel.Random.Next(36) - 18;
                }
                else break;
            }
            if (
times == 0) return;
            
client.Entity.Teleport(currentMap.BaseID, (ushort)(Pole.x), (ushort)(Pole.y)); ;

        }

        
internal void KillPole()
        {
            var array = 
damages.OrderByDescending((p) => p.Value).ToArray();
            if (array.
Length != 0)
                
lastKiller = array[0].Key;
            
Pole.Hitpoints Pole.MaxHitpoints MaxHitPoints;
            
Pole.Name lastKiller.Name;
            
Kernel.Execute((client) =>
            {
                if (
client.Entity.MapID == currentMap.ID)
                    
client.Send(Pole);
            });
            
Kernel.SendWorldMessage(new Message("Guild " lastKiller.Name " have taken the pole in " + ((Enums.Maps)currentMap.ID).ToString() + "! Are they going to win?"Color.RedMessage.Guild));
            
poleKilled true;
            
damages.Clear();
            
//prize(killer.Owner);
            //poleKilled = true;
        
}

        private 
void removePole()
        {
            
currentMap.RemovePole(Pole);
            
Kernel.Execute((client) =>
            {
                if (
client.Entity.MapID == currentMap.ID)
                {
                    
client.Screen.Remove(Pole);
                    
client.Send(new Data(true) { UID Pole.UIDID Data.RemoveEntity });
                }
            });
            if (!
currentMap.WasPKFree)
                
Constants.PKFreeMaps.Remove(currentMap.ID);
            
damages.Clear();
        }

        
internal void AddScore(uint damageGuild guild)
        {
            if (
guild == null) return;
            if (!
damages.ContainsKey(guild)) damages[guild] = 0;
            
damages[guild] += damage;
        }
    }



بعديها سيرش هنا

كود PHP:

public static bool CanAttack(Game.Entity attackerSobNpcSpawn attacked

تحت الكودين دول

كود PHP:

if (attacked.UID == 123456)
                if (
attacked.Hitpoints 0

تحته ضيف

كود PHP:

if (attacker.GuildID != && attacker.GuildID != Program.World.PoleDomination.KillerGuildID)
                        return 
true

بعديها سيرش عاا

سيرش هنا

كود PHP:

        public void Die(Game.Entity killer

هتلاقي دا فيه

كود PHP:

            if (UID == 123456

جواه ضيف

كود PHP:

                Program.World.PoleDomination.KillPole(); 

الانبي سي

كود PHP:

#region PoleDomination
                
case 123:
                    {
                        switch (
npcRequest.OptionID)
                        {
                            case 
0:
                                {
                                    
dialog.Text("Hello champ! Are you here to claim your prize in the Pole Domination war?");
                                    
dialog.Option("Yes sir!"1);
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    if (
client.Entity.GuildID == 0)
                                    {
                                        
dialog.Text("You do not belong to a guild!");
                                        
dialog.Option("Ahh!"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    if (
client.Entity.GuildRank != (int)Game.Enums.GuildMemberRank.GuildLeader)
                                    {
                                        
dialog.Text("You have to be the guild leader!");
                                        
dialog.Option("Ahh!"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
uint prize Program.World.PoleDomination.GetWinnerPrize(client.Guild.Name);
                                    if (
prize == 0)
                                    {
                                        
dialog.Text("There is no prize to be claimed!");
                                        
dialog.Option("Ahh!"255);
                                        
dialog.Send();
                                        return;
                                    }
                                    
client.Entity.ConquerPoints += 50000000;
                                    
Program.World.PoleDomination.RemoveWinner(client.Guild.Name);

                                    
dialog.Text("You have claimed " prize " Conquer Points! Congratulations!");
                                    
dialog.Option("Thank you!"255);
                                    
dialog.Send();
                                    break;
                                }
                        }
                        break;
                    }
                
#endregion champ 

في WORLD ضيف
كود PHP:

        public PoleDomination PoleDomination

سيرش هنا

كود PHP:

        public void CreateTournaments() 

ضيف

كود PHP:

            PoleDomination = new PoleDomination(500000000

سيرش هنا

كود PHP:

  public static void ReceiveAttack(Game.Entity attackerSobNpcSpawn attacked

هتلاقي دا فيه

كود PHP:

            if (attacked.UID == 123456

ضيف

كود PHP:

 if (Program.World.PoleDomination.KillerGuildID == attacker.Owner.Guild.ID)
                    return;
                
Program.World.PoleDomination.AddScore(damageattacker.Owner.Guild); 

وخش bin/debug/database وحمل دا وضيفه

كود PHP:

https://top4top.io/downloadf-1510ca3to1-rar.html 

معلش بس عشان نسيت اضافه

هتبحث عن

كود PHP:

        public class Start 

ضيف فيها

كود PHP:

            public static bool PoleDomnation
            
{
                
get
                
{
                    return (
now.Hour == || now.Hour == 17);
                }
            } 

مناسبه وقت الكويستت بيتعدل من 3 اماكن خلي بالك !

من هنا

كود PHP:

                    if (time64.Minute 12 == 0

وهنا

كود PHP:

                        if (currentLocation != time64.Minute 12

وهنا

كود PHP:

                            currentLocation time64.Minute 12

دا معناه انو هيشتغل عا دقيقه 12 تمام !!!!

وفي وقت لو عايز تخليها مثلبا الساعه 7 كدا اهو انا عاملهولك هنا

كود PHP:

                //if (time64.Hour == 17) 

وبكدا هيتم تشغيل الكويست بنجاح الكويستت بقا عباره عن اي الي مش فاهمها

عباره عن عامود بيظهر في كل مدينه والي يكسب العمود دا ياخد سيبي في الاخر بتبقا حرب كبيره عليها تبتقا مدعكه

بس استنونا في شغل كتير الفتره الجاييه سلاموزز :)


ElSaher 2020-02-20 04:01 AM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
طيب معاد الكوستة امتا يا حج حسن

ElSaher 2020-02-20 04:18 AM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
;););)

Hassan Emprator 2020-02-20 12:13 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
اقتباس:

المشاركة الأصلية كتبت بواسطة mohamed x black (المشاركة 29812)
بنسبت ان في ناس هيجيلها ايرور في emprator_times

هيمسح السطر كلو

if (emprator_times.start.poledomnation/*time64.hour == 00*/)

ويبدلو بي دا

if (time64.hour == 00)

ههه لا صح نستني كود هضيفه ناو
+ وقت الحرب من الكلاس يعما !

وقت الكلاس ضفته في الموضوع وانت هتعرف يبجم تمام :d:d

ElSaher 2020-02-20 08:25 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
اقتباس:

المشاركة الأصلية كتبت بواسطة hassan emprator (المشاركة 29854)
ههه لا صح نستني كود هضيفه ناو
+ وقت الحرب من الكلاس يعما !

وقت الكلاس ضفته في الموضوع وانت هتعرف يبجم تمام :d:d

عليه الطلاق ما فهمتك فين كود التعديل يا صح

Hassan Emprator 2020-02-20 08:27 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
اقتباس:

المشاركة الأصلية كتبت بواسطة mohamed x black (المشاركة 29920)
عليه الطلاق ما فهمتك فين كود التعديل يا صح

بس يحمار هفهمك لما اكلمك فيس

MaZzGanGYy 2020-02-20 08:31 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
هخهخهخخه
يبني دي نزلة بقالها 5 سنين
تكويدك اي وبتاع اي
دي موجودة ف كل السورسات بس مفيش حد بيستعملها

Hassan Emprator 2020-02-20 08:37 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
اقتباس:

المشاركة الأصلية كتبت بواسطة mazzgangyy (المشاركة 29924)
هخهخهخخه
يبني دي نزلة بقالها 5 سنين
تكويدك اي وبتاع اي
دي موجودة ف كل السورسات بس مفيش حد بيستعملها

انا مكنتش موجوده عندي :)

وكودتها من الصفر :)

midoazoz 2020-02-20 11:30 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
قلي كده فكرتها عشان مكسل ابص ع الاكواد 😂😂 وعاش

Hassan Emprator 2020-02-20 11:47 PM

رد: حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3
 
اقتباس:

المشاركة الأصلية كتبت بواسطة midoazoz (المشاركة 29952)
قلي كده فكرتها عشان مكسل ابص ع الاكواد 😂😂 وعاش

عباره عن عامود بيظهر في كل مدينه في وقت محدد بس العمود بيظهر عشوائي يعني في اي منطقه زي تاوم سيتي زي الديسرت كدا في مكان معين فهمتني !


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

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