عرض مشاركة واحدة
احصائياتى

الردود
9

المشاهدات
3911
 
Hassan Emprator

Hassan Emprator is on a distinguished road

    غير متواجد

المشاركات
1,372

+التقييم
0.64

تاريخ التسجيل
Apr 2019

الاقامة

نظام التشغيل

رقم العضوية
30
2020-02-20, 03:22 AM
المشاركة 1 
#1  
افتراضي حرب PoleDomntaion مقدمه من HassanEmprator ليكو احبايبي <3

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

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

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

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


كود:
PoleDomination 

وتضيف فيه


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



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


كود:
public static bool CanAttack(Game.Entity attackerSobNpcSpawn attacked

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


كود:
if (attacked.UID == 123456)
                if (
attacked.Hitpoints 0

تحته ضيف


كود:
if (attacker.GuildID != && attacker.GuildID != Program.World.PoleDomination.KillerGuildID)
                        return 
true

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

سيرش هنا


كود:
        public void Die(Game.Entity killer

هتلاقي دا فيه


كود:
            if (UID == 123456

جواه ضيف


كود:
                Program.World.PoleDomination.KillPole(); 

الانبي سي


كود:
#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 ضيف

كود:
        public PoleDomination PoleDomination

سيرش هنا


كود:
        public void CreateTournaments() 

ضيف


كود:
            PoleDomination = new PoleDomination(500000000

سيرش هنا


كود:
  public static void ReceiveAttack(Game.Entity attackerSobNpcSpawn attacked

هتلاقي دا فيه


كود:
            if (attacked.UID == 123456

ضيف


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

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


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

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

هتبحث عن


كود:
        public class Start 

ضيف فيها


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

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

من هنا


كود:
                    if (time64.Minute 12 == 0

وهنا


كود:
                        if (currentLocation != time64.Minute 12

وهنا


كود:
                            currentLocation time64.Minute 12

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

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


كود:
                //if (time64.Hour == 17) 

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

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

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