Hassan Emprator
2020-02-15, 06:23 AM
فديو لي الكويستت
عفواً لايمكن عرض الروابط في الإرشيف
.............................
سلام عليكم الكويستت دي خالد الي مكودها وانا سحبتها وانشاء الله هسحبلكو سحبه سحبه من سورس هه نعيد تاني الحقوق محفوظه لي
KhaledMohamed
نبتدي بقا اولا اعمل كلاس وسميه ThunderScoreWar وضيف فيه
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MrHassan.Client;
using MrHassan.Interfaces;
using MrHassan.Network.GamePackets;
using System.Drawing;
using MrHassan.Network;
using MrHassan.Game.ConquerStructures;
using System.Threading.Generic;
using MrHassan.Game.ConquerStructures.Society;
namespace MrHassan.Game
{
public class ThunderScoreWar
{
public static SobNpcSpawn RightGate, LeftGate, Pole;
public static DateTime WarStart;
public static Map Map;
public static bool IsWar = false;
private IDisposable Subscriber;
public static uint Winner;
public static uint WinnerGuild = 1, WinnderDep = 20;
public ThunderScoreWar()
{
Database.DMaps.LoadMap(3979);
Map = Kernel.Maps[3979].MakeDynamicMap();
Subscriber = World.Subscribe(work, 1000);
}
public void work(int time)
{
if (IsWar)
if ((DateTime.Now > WarStart.AddMinutes(13)) && (DateTime.Now < WarStart.AddMinutes(15)))
EndWar();
if (Emprator_Times.Start.ThunderScoreWar && !IsWar)
StartWar();
if (IsWar)
{
if (Time32.Now > ScoreSendStamp.AddSeconds(3))
{
ScoreSendStamp = Time32.Now;
SendScores();
}
}
}
public static void Join(Client.GameState client)
{
if (IsWar)
{
var cooord = Map.RandomCoordinates();
client.Entity.Teleport(Map.ID, cooord.Item1, cooord.Item2);
client.Entity.PKMode = Game.Enums.PKMode.PK;
client.Send(Pole);
client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)client.Entity.PKMode });
client.OnDisconnect = p =>
{
client.Entity.Teleport(Map.ID, 160, 170);
};
{
}
}
}
public static void StartWar()
{
try
{
if (IsWar)
EndWar();
IsWar = true;
WarStart = DateTime.Now;
Start();
if (!Constants.PKFreeMaps.Contains(Map.ID))
Constants.PKFreeMaps.Add(Map.ID);
Kernel.SendWorldMessage(new Message(" ThunderScoreWar War began Join Top Mellion Cps Fighters #07#07#07#07 ", Color.White, Message.BroadcastMessage), Program.Values);
foreach (var client in Program.Values)
client.MessageBox("You Want To Join ThunderScoreWar and Got Cps from the War Prize " + ServerRates.ThunderScoreWar + " CPs #07#07#07#07 #11",
p => { p.Entity.Teleport(1002, 308, 239); }, null, 60);
Map.Npcs.Clear();
#region StatuesPole
Pole = new Network.GamePackets.SobNpcSpawn();
Pole.UID = Map.EntityUIDCounter2.Next;
Pole.Mesh = 1137;
Pole.Type = (Enums.NpcType)10;
Pole.X = 165;
Pole.Y = 174;
Pole.ShowName = true;
Pole.Sort = 17;
Pole.Hitpoints = 20000000;
Pole.MaxHitpoints = 20000000;
Pole.Name = "ThunderScoreWar";
Pole.MapID = Map.ID;
#endregion
// Map.AddNpc(LeftGate);//.Npcs.Add(LeftGate.UID, LeftGate);
// Map.AddNpc(RightGate);//.Npcs.Add(RightGate.UID, RightGate);
Map.AddNpc(Pole);
}
catch (Exception ex)
{
Console.WriteLine(ex);
Program.SaveException(ex);
}
}
public static void EndWar()
{
IsWar = false;
Kernel.SendWorldMessage(new Message(" ThunderScoreWar war has ended ", System.Drawing.Color.Red, Message.Center), Program.Values);
foreach (var client in Program.Values)
if (client.Entity.MapID == Map.ID)
client.Entity.Teleport(1002, 300, 278);
}
#region Score
public static SafeDictionary<uint, Guild> Scores = new SafeDictionary<uint, Guild>(100);
public static Time32 ScoreSendStamp;
public static void Start()
{
// Scores = new SafeDictionary<uint, Guild>();
WarStart = DateTime.Now;
IsWar = true;
}
private static string[] scoreMessages;
public static void AddScore(uint addScore, Entity attacker)
{
if (attacker.Owner.Guild != null)
{
if (attacker.Owner.Entity.ConquerPoints >= 5000000)
{
attacker.Owner.Guild.ThunderScoreWar += addScore;
attacker.Update(_String.Effect, "ssch_wlhd_hit", true);
Random D = new Random();
int Damg = D.Next(30000, 50000);
if (attacker.Hitpoints <= Damg)
{
if (attacker.Owner.Entity.ConquerPoints >= 5000000)
attacker.Owner.Entity.ConquerPoints -= 5000000;
else
attacker.Owner.Entity.ConquerPoints = 1000;
attacker.Die(attacker.Owner.Entity);
}
else
{
GetReward(attacker.Owner, 1000000);
attacker.Hitpoints -= (uint)Damg;
Update update = new Update(true);
update.Append(Update.MaxHitpoints, attacker.MaxHitpoints);
update.Append(Update.Hitpoints, attacker.Hitpoints);
//msg
}
changed = true;
if (!Scores.ContainsKey(attacker.Owner.Guild.ID))
{
Scores.Add(attacker.Owner.Guild.ID, attacker.Owner.Guild);
}
}
else
{
attacker.Owner.MessageBox("Sorry Dont have 5 M cps.");
return;
}
}
}
public static Guild CurrentTop;
public static bool changed = false;
public static void SendScores()
{
if (scoreMessages == null)
scoreMessages = new string[0];
if (Scores.Count == 0)
return;
// if (changed)
// SortScores(out CurrentTop);
for (int c = 0; c < scoreMessages.Length; c++)
{
Message msg = new Message(scoreMessages[c], System.Drawing.Color.Red, c == 0 ? Message.FirstRightCorner : Message.ContinueRightCorner);
Kernel.SendWorldMessage(msg, Program.Values, Map.ID);
}
}
private static void SortScores(out Guild winner)
{
winner = null;
List<string> ret = new List<string>();
int Place = 0;
foreach (Guild guild in Scores.Values.OrderByDescending((p) => p.ThunderScoreWar))
{
if (Place == 0)
winner = guild;
string str = "No " + (Place + 1).ToString() + ": " + guild.Name + "(" + guild.ThunderScoreWar + ")";
ret.Add(str);
Place++;
if (Place == 4)
break;
}
changed = false;
scoreMessages = ret.ToArray();
}
#endregion
public static void GetReward(GameState client, uint cps)
{
if (client.Entity.GuildRank == (ushort)GuildRank.GuildLeader)
{
client.Entity.ConquerPoints += cps;
client.Entity.OnlinePoints += 2;
}
else
{
client.Entity.ConquerPoints += cps / 2;
client.Entity.OnlinePoints += 1;
}
}
}
}
وفي هاندل سيرش
public static bool CanAttack(Game.Entity attacker, SobNpcSpawn attacked,
ضيف فيه
if (ThunderScoreWar.Map != null)
{
if (attacker.MapID == ThunderScoreWar.Map.ID)
{
if (attacker.GuildID == 0 || !Game.ThunderScoreWar.IsWar)
{
if (attacked.UID == ThunderScoreWar.Pole.UID)
{
return false;
}
}
}
}
وسيرش عا
public static void ReceiveAttack(Game.Entity attacker, SobNpcSpawn attacked,
ضيف
if (ThunderScoreWar.IsWar)
{
if (ThunderScoreWar.Map != null)
{
if (attacker.MapID == ThunderScoreWar.Map.ID)
ThunderScoreWar.AddScore(damage, attacker);
}
}
الانبي سي
#region ThunderScoreWar
case 411870:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hello there. Do you want to Join The ThunderScoreWar?.");
dialog.Option("Yes Please.", 1);
dialog.Option("information ThunderScoreWar.", 2);
dialog.Option("Just Passing By!", 255);
dialog.Send();
break;
}
case 1:
{
if (ThunderScoreWar.IsWar)
{
ThunderScoreWar.Join(client);
}
else
{
dialog.Text("The War Hat Not Started Start At [02] Minute");
dialog.Option("Aww ok!", 255);
dialog.Send();
}
break;
}
case 2:
{
{
{
dialog.Text("evento has Work 02 Minute and Close Evento 15 Minute");
dialog.Text("This War you can give you 500,000 alf IN [DeputyLeader] and GuildLeader Cps [1,000,000] but!!");
dialog.Text("You need 5,000,000 Cps or can AttackPole bitch !!");
dialog.Text("CopyRight MeGo and Mr.khled and Mr.Mohamed Yasser");
dialog.Send();
}
break;
}
}
}
break;
}
#endregion
سيرش عا
public uint WarScore;
ضيف فوقه قصدي
public uint ThunderScoreWar;
وفي program ضيف
public static uint ThunderScoreWar = 0;
وسيرش هنا
public class Start
ضيف
public static bool ThunderScoreWar
{
get
{
return (now.Minute == 2 && now.Second == 4); //|| (now.Hour == 22 && now.Minute == 0);
}
}
سيرش عا
public void CreateTournaments()
ضيف
new ThunderScoreWar();
المابه اهي
3979 3979 7 0
ودا الانبي سي في النافي كات بي شكل بي الافكت بتاع الانبي سي
411870 ThunderScoreWar 2 51920 1002 308 234 ssch_wlhd_hit
بالمناسبه في ناس هيجلها ايورر في ServerRates عموما هيا بتكسب 10 مليون سيبي هيجيلك ايورر هنا برضو
client.MessageBox("You Want To Join ThunderScoreWar and Got Cps from the War Prize " +
هتخليه 10 مليون ما بين ++
وي الي عنده سرفر ريتس دي يضيف في الكلاس
ThunderScoreWar = 10000000,
والنسبه لي مش عنده يخلي الجايزه عا طول يكتب رقم السيبي يعني هيسرش عا
GetReward(attacker.Owner,
هيلاقي فيه ServerRaters.ThunderScoreWar
لا اكتب فيها رقم السيبي رقم السيبي دا الي هوا لما تيجي تضرب العموم يديك كام فهمني !!
وبكدا الكويستت هتشغل زي الفل كويسته جميله وعجباني اوي ونزلتها عندي اي حاجه عايزني اسحبهالكو من سورس خالد اسحبها
وانزلهالكو احبايبي
عفواً لايمكن عرض الروابط في الإرشيف
.............................
سلام عليكم الكويستت دي خالد الي مكودها وانا سحبتها وانشاء الله هسحبلكو سحبه سحبه من سورس هه نعيد تاني الحقوق محفوظه لي
KhaledMohamed
نبتدي بقا اولا اعمل كلاس وسميه ThunderScoreWar وضيف فيه
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MrHassan.Client;
using MrHassan.Interfaces;
using MrHassan.Network.GamePackets;
using System.Drawing;
using MrHassan.Network;
using MrHassan.Game.ConquerStructures;
using System.Threading.Generic;
using MrHassan.Game.ConquerStructures.Society;
namespace MrHassan.Game
{
public class ThunderScoreWar
{
public static SobNpcSpawn RightGate, LeftGate, Pole;
public static DateTime WarStart;
public static Map Map;
public static bool IsWar = false;
private IDisposable Subscriber;
public static uint Winner;
public static uint WinnerGuild = 1, WinnderDep = 20;
public ThunderScoreWar()
{
Database.DMaps.LoadMap(3979);
Map = Kernel.Maps[3979].MakeDynamicMap();
Subscriber = World.Subscribe(work, 1000);
}
public void work(int time)
{
if (IsWar)
if ((DateTime.Now > WarStart.AddMinutes(13)) && (DateTime.Now < WarStart.AddMinutes(15)))
EndWar();
if (Emprator_Times.Start.ThunderScoreWar && !IsWar)
StartWar();
if (IsWar)
{
if (Time32.Now > ScoreSendStamp.AddSeconds(3))
{
ScoreSendStamp = Time32.Now;
SendScores();
}
}
}
public static void Join(Client.GameState client)
{
if (IsWar)
{
var cooord = Map.RandomCoordinates();
client.Entity.Teleport(Map.ID, cooord.Item1, cooord.Item2);
client.Entity.PKMode = Game.Enums.PKMode.PK;
client.Send(Pole);
client.Send(new Data(true) { UID = client.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)client.Entity.PKMode });
client.OnDisconnect = p =>
{
client.Entity.Teleport(Map.ID, 160, 170);
};
{
}
}
}
public static void StartWar()
{
try
{
if (IsWar)
EndWar();
IsWar = true;
WarStart = DateTime.Now;
Start();
if (!Constants.PKFreeMaps.Contains(Map.ID))
Constants.PKFreeMaps.Add(Map.ID);
Kernel.SendWorldMessage(new Message(" ThunderScoreWar War began Join Top Mellion Cps Fighters #07#07#07#07 ", Color.White, Message.BroadcastMessage), Program.Values);
foreach (var client in Program.Values)
client.MessageBox("You Want To Join ThunderScoreWar and Got Cps from the War Prize " + ServerRates.ThunderScoreWar + " CPs #07#07#07#07 #11",
p => { p.Entity.Teleport(1002, 308, 239); }, null, 60);
Map.Npcs.Clear();
#region StatuesPole
Pole = new Network.GamePackets.SobNpcSpawn();
Pole.UID = Map.EntityUIDCounter2.Next;
Pole.Mesh = 1137;
Pole.Type = (Enums.NpcType)10;
Pole.X = 165;
Pole.Y = 174;
Pole.ShowName = true;
Pole.Sort = 17;
Pole.Hitpoints = 20000000;
Pole.MaxHitpoints = 20000000;
Pole.Name = "ThunderScoreWar";
Pole.MapID = Map.ID;
#endregion
// Map.AddNpc(LeftGate);//.Npcs.Add(LeftGate.UID, LeftGate);
// Map.AddNpc(RightGate);//.Npcs.Add(RightGate.UID, RightGate);
Map.AddNpc(Pole);
}
catch (Exception ex)
{
Console.WriteLine(ex);
Program.SaveException(ex);
}
}
public static void EndWar()
{
IsWar = false;
Kernel.SendWorldMessage(new Message(" ThunderScoreWar war has ended ", System.Drawing.Color.Red, Message.Center), Program.Values);
foreach (var client in Program.Values)
if (client.Entity.MapID == Map.ID)
client.Entity.Teleport(1002, 300, 278);
}
#region Score
public static SafeDictionary<uint, Guild> Scores = new SafeDictionary<uint, Guild>(100);
public static Time32 ScoreSendStamp;
public static void Start()
{
// Scores = new SafeDictionary<uint, Guild>();
WarStart = DateTime.Now;
IsWar = true;
}
private static string[] scoreMessages;
public static void AddScore(uint addScore, Entity attacker)
{
if (attacker.Owner.Guild != null)
{
if (attacker.Owner.Entity.ConquerPoints >= 5000000)
{
attacker.Owner.Guild.ThunderScoreWar += addScore;
attacker.Update(_String.Effect, "ssch_wlhd_hit", true);
Random D = new Random();
int Damg = D.Next(30000, 50000);
if (attacker.Hitpoints <= Damg)
{
if (attacker.Owner.Entity.ConquerPoints >= 5000000)
attacker.Owner.Entity.ConquerPoints -= 5000000;
else
attacker.Owner.Entity.ConquerPoints = 1000;
attacker.Die(attacker.Owner.Entity);
}
else
{
GetReward(attacker.Owner, 1000000);
attacker.Hitpoints -= (uint)Damg;
Update update = new Update(true);
update.Append(Update.MaxHitpoints, attacker.MaxHitpoints);
update.Append(Update.Hitpoints, attacker.Hitpoints);
//msg
}
changed = true;
if (!Scores.ContainsKey(attacker.Owner.Guild.ID))
{
Scores.Add(attacker.Owner.Guild.ID, attacker.Owner.Guild);
}
}
else
{
attacker.Owner.MessageBox("Sorry Dont have 5 M cps.");
return;
}
}
}
public static Guild CurrentTop;
public static bool changed = false;
public static void SendScores()
{
if (scoreMessages == null)
scoreMessages = new string[0];
if (Scores.Count == 0)
return;
// if (changed)
// SortScores(out CurrentTop);
for (int c = 0; c < scoreMessages.Length; c++)
{
Message msg = new Message(scoreMessages[c], System.Drawing.Color.Red, c == 0 ? Message.FirstRightCorner : Message.ContinueRightCorner);
Kernel.SendWorldMessage(msg, Program.Values, Map.ID);
}
}
private static void SortScores(out Guild winner)
{
winner = null;
List<string> ret = new List<string>();
int Place = 0;
foreach (Guild guild in Scores.Values.OrderByDescending((p) => p.ThunderScoreWar))
{
if (Place == 0)
winner = guild;
string str = "No " + (Place + 1).ToString() + ": " + guild.Name + "(" + guild.ThunderScoreWar + ")";
ret.Add(str);
Place++;
if (Place == 4)
break;
}
changed = false;
scoreMessages = ret.ToArray();
}
#endregion
public static void GetReward(GameState client, uint cps)
{
if (client.Entity.GuildRank == (ushort)GuildRank.GuildLeader)
{
client.Entity.ConquerPoints += cps;
client.Entity.OnlinePoints += 2;
}
else
{
client.Entity.ConquerPoints += cps / 2;
client.Entity.OnlinePoints += 1;
}
}
}
}
وفي هاندل سيرش
public static bool CanAttack(Game.Entity attacker, SobNpcSpawn attacked,
ضيف فيه
if (ThunderScoreWar.Map != null)
{
if (attacker.MapID == ThunderScoreWar.Map.ID)
{
if (attacker.GuildID == 0 || !Game.ThunderScoreWar.IsWar)
{
if (attacked.UID == ThunderScoreWar.Pole.UID)
{
return false;
}
}
}
}
وسيرش عا
public static void ReceiveAttack(Game.Entity attacker, SobNpcSpawn attacked,
ضيف
if (ThunderScoreWar.IsWar)
{
if (ThunderScoreWar.Map != null)
{
if (attacker.MapID == ThunderScoreWar.Map.ID)
ThunderScoreWar.AddScore(damage, attacker);
}
}
الانبي سي
#region ThunderScoreWar
case 411870:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hello there. Do you want to Join The ThunderScoreWar?.");
dialog.Option("Yes Please.", 1);
dialog.Option("information ThunderScoreWar.", 2);
dialog.Option("Just Passing By!", 255);
dialog.Send();
break;
}
case 1:
{
if (ThunderScoreWar.IsWar)
{
ThunderScoreWar.Join(client);
}
else
{
dialog.Text("The War Hat Not Started Start At [02] Minute");
dialog.Option("Aww ok!", 255);
dialog.Send();
}
break;
}
case 2:
{
{
{
dialog.Text("evento has Work 02 Minute and Close Evento 15 Minute");
dialog.Text("This War you can give you 500,000 alf IN [DeputyLeader] and GuildLeader Cps [1,000,000] but!!");
dialog.Text("You need 5,000,000 Cps or can AttackPole bitch !!");
dialog.Text("CopyRight MeGo and Mr.khled and Mr.Mohamed Yasser");
dialog.Send();
}
break;
}
}
}
break;
}
#endregion
سيرش عا
public uint WarScore;
ضيف فوقه قصدي
public uint ThunderScoreWar;
وفي program ضيف
public static uint ThunderScoreWar = 0;
وسيرش هنا
public class Start
ضيف
public static bool ThunderScoreWar
{
get
{
return (now.Minute == 2 && now.Second == 4); //|| (now.Hour == 22 && now.Minute == 0);
}
}
سيرش عا
public void CreateTournaments()
ضيف
new ThunderScoreWar();
المابه اهي
3979 3979 7 0
ودا الانبي سي في النافي كات بي شكل بي الافكت بتاع الانبي سي
411870 ThunderScoreWar 2 51920 1002 308 234 ssch_wlhd_hit
بالمناسبه في ناس هيجلها ايورر في ServerRates عموما هيا بتكسب 10 مليون سيبي هيجيلك ايورر هنا برضو
client.MessageBox("You Want To Join ThunderScoreWar and Got Cps from the War Prize " +
هتخليه 10 مليون ما بين ++
وي الي عنده سرفر ريتس دي يضيف في الكلاس
ThunderScoreWar = 10000000,
والنسبه لي مش عنده يخلي الجايزه عا طول يكتب رقم السيبي يعني هيسرش عا
GetReward(attacker.Owner,
هيلاقي فيه ServerRaters.ThunderScoreWar
لا اكتب فيها رقم السيبي رقم السيبي دا الي هوا لما تيجي تضرب العموم يديك كام فهمني !!
وبكدا الكويستت هتشغل زي الفل كويسته جميله وعجباني اوي ونزلتها عندي اي حاجه عايزني اسحبهالكو من سورس خالد اسحبها
وانزلهالكو احبايبي