|
المشاركات 1,372 |
+التقييم 0.68 |
تاريخ التسجيل Apr 2019 |
الاقامة شرقيه/زقازيق |
نظام التشغيل |
رقم العضوية 30 |
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;
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
client.MessageBox("You Want To Join ThunderScoreWar and Got Cps from the War Prize " +
ThunderScoreWar = 10000000,
GetReward(attacker.Owner,
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
كويستة TeamDeathMatch كامله | محمد ياسر | تطوير سيرفرات كونكر | 2 | 2023-10-30 10:52 PM |
كويستة في اي بي 7 بناءا علي طلب zezonever | Commander | تطوير سيرفرات كونكر | 7 | 2020-03-16 04:55 PM |
كويستة vip 7 | ElSaher | تطوير سيرفرات كونكر | 1 | 2020-02-17 09:04 AM |
مشكلة بخصوص البروفكشن [Source Khaled v5] | youssefabdelmanam | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2019-12-01 12:18 AM |
مشكلة في فيزيكال الننجا وتربل المونك والبيرت [Source khaled v5] | youssefabdelmanam | مشكلات السيرفيرات كونكر الشخصيه | 3 | 2019-12-01 12:14 AM |