| mohamedomar |
2020-06-03 07:10 PM |
حصرياً كوستة TreasureThief تبع سورس ConquerSquad
حصرياً كوستة TreasureThief تبع سورس Squad Conquer بس دا اصدار م علي النت
نيجى لشرح التركيب
أول حاجة هتعمل كلاس بإسم : => MsgTreasureThief
وتضيف فيه الكود دا كله
كود PHP:
namespace SquadConquer { public enum ProcesType : byte { Alive = 1, Idle = 2, Dead = 3 } public class MsgTreasureThief { public const ushort MapID = 3820; public static GameClient C; public static ProcesType Process { get; set; } public static int CurrentBoxes = 0; public static DateTime StartTimer = new DateTime(); public static DateTime BoxesStamp = new DateTime(); static Map _map; public static Map Map { get { if (_map == null) _map = Kernel.Maps[MapID]; return _map; } } public static void Open() { if (Process != ProcesType.Alive) { Create(); foreach (var user in Kernel.GamePool.Values) user.Entity.CurrentTreasureBoxes = 0; Process = ProcesType.Alive; StartTimer = DateTime.Now.AddMinutes(10); BoxesStamp = DateTime.Now.AddSeconds(30); foreach (var client in Kernel.GamePool.Values) client.MessageBox("Hello " + client.Entity.Name + " TreasureThief ConquerPoints,Money,Vip and others treasures", p => { p.Entity.Teleport(1002, 371, 364); }, null); } } public static bool Join(Client.GameClient user) { if (Process == ProcesType.Alive) { var cord = Map.RandomCoordinates(); ushort x = cord.Item1; ushort y = cord.Item2; Map.SelectCoordonates(ref x, ref y); user.Entity.Teleport(MapID, x, y); return true; } else { user.MessageBox("Not now my friend you have to wait"); } return false; } public static void Create() { GenerateBoxes(); } public static void GenerateBoxes() { foreach (var c in Kernel.GamePool.Values) { for (int i = CurrentBoxes; i < 10; i++) { byte rand = (byte)Program.GetRandom.Next(0, 5); var cord = Map.RandomCoordinates(); ushort x = cord.Item1; ushort y = cord.Item2; Map.SelectCoordonates(ref x, ref y); Interfaces.INpc np; np = new Network.GamePackets.SobNpcSpawn(); switch (rand) { case 0: np.Mesh = 26586; break; case 1: np.Mesh = 26596; break; case 2: np.Mesh = 26606; break; case 3: np.Mesh = 26616; break; case 4: np.Mesh = 26626; break; default: np.Mesh = 26586; break; } np.UID = (uint)Program.GetRandom.Next(10000, 100000); np.Type = Game.Enums.NpcType.Talker; np.X = x; np.Y = y; np.MapID = MapID; Map.AddNpc(np); } } CurrentBoxes = 10; } public static void CheckUp() { if (Process == ProcesType.Alive) { if (DateTime.Now > StartTimer) { foreach (var user in Kernel.GamePool.Values) { user.Entity.Teleport(1002, 409, 353); } Process = ProcesType.Dead; } else if (DateTime.Now > BoxesStamp) { GenerateBoxes(); BoxesStamp = DateTime.Now.AddSeconds(30); } } } public static void Reward(Client.GameClient user) { CurrentBoxes -= 1; jmp: byte rand = (byte)Program.GetRandom.Next(0, 5); switch (rand) { case 0://money { uint value = (uint)Program.GetRandom.Next(1000000, 50000000); user.Entity.Money += value; user.MessageBox("You've received " + value + " Money."); user.Entity.SendSysMesage(user.Entity.Name + " got " + value.ToString() + " Money while opening the TreasureBox!"); break; } case 1://experience { if (user.Entity.Level == 140) goto jmp; // user.GainExpBall(600 * 2, true, Role.Flags.ExperienceEffect.angelwing); user.Entity.SendSysMesage(user.Entity.Name + " got 2xExpBalls while opening the TreasureBox!"); break; } case 2://cps { uint value = (uint)Program.GetRandom.Next(1000, 5000); user.Entity.ConquerPoints += (int)value; user.Entity.SendSysMesage(user.Entity.Name + " got " + value.ToString() + " CPs while opening the TreasureBox!"); user.MessageBox("You've received " + value + " ConquerPoints."); break; } case 3://dead. { user.Entity.Die(0); user.Entity.SendSysMesage(user.Entity.Name + " found DEATH! while opening the TreasureBox!"); break; } case 4://item. { uint[] Items = new uint[] { 780001, 3005126, 3005127, 3005125, 3005124, 720027, 723711, 1088001, 1088000, 721080, 720598, 729022,729023, 723712, 723727, 723342,1200002,720173 }; uint ItemID = Items[Program.GetRandom.Next(0, Items.Length)]; Database.Items.ConquerItemBaseInformation DBItem; if (Database.Items.ConquerItemInformation.BaseInformations.TryGetValue(ItemID, out DBItem)) { if (user.Inventory.HaveSpace(1)) user.Inventory.Add(DBItem.ID); user.Entity.SendSysMesage(user.Entity.Name + " got " + DBItem.Name + " while opening the TreasureBox!"); } break; } } INpc npc = new SobNpcSpawn(); npc.UID = user.ActiveNpc; user.Map.RemoveNpc(npc); user.SendScreen(new Data(user, user.ActiveNpc, Data.RemoveEntity), true); user.Entity.CurrentTreasureBoxes += 1; user.Entity.SendString(_String.Effect, true, "accession1"); ShuffleGuildScores(); } public static void ShuffleGuildScores() { foreach (var user in Kernel.GamePool.Values) { Message msg = new Message("---Your Score: " + user.Entity.CurrentTreasureBoxes + "---", System.Drawing.Color.Yellow, Message.FirstRightCorner); user.Send(msg); } var array = Kernel.GamePool.Values.OrderByDescending(p => p.Entity.CurrentTreasureBoxes).ToArray(); for (int x = 0; x < Math.Min(10, Map.Values.Length); x++) { var element = array[x]; Message msg = new Message("No " + (x + 1).ToString() + "- " + element.Entity.Name + " Opened " + element.Entity.CurrentTreasureBoxes.ToString() + " Boxes!", System.Drawing.Color.Yellow, Message.ContinueRightCorner); C.Send(msg); } } } }
وطبعاً هتغير اسم بروجيكت من SquadConquer
لأسم البروجكت بتاعك
هتيجى على كلاس World
وتضيف
كود PHP:
if (Now64.Minute == 30 && Now64.Second == 00) { MsgTreasureThief.Open(); }
انا عامل الكوسته تشتغل نص ساعه غير برحتك
ف نفس الكلاس هتبحث عن
وتيجى فوقه وتحط الكود دا
كود PHP:
MsgTreasureThief.CheckUp();
هتيجى بقى لكلاس NPC
ونضيف
كود PHP:
#region TreasureThief case 1919447: { switch (npcRequest.OptionID) { case 0: { dialog.Text("You are now about to enter a mission It has many passports You have to hurry to open /n"); dialog.Text("The lucky box that when you receive it gives you some of the different rewards /n"); dialog.Text("That helps you raise your level /n"); dialog.Option("Return~to~Treasure~Thief.", 1); dialog.Option("I`ll~tell~you~if~I~need.", 255); dialog.Avatar(7); break; } case 1: { MsgTreasureThief.Join(client); break; } } break; } #endregion
وضيف دا ف الاخر
كود PHP:
if (client.Entity.MapID == 3820) { MsgTreasureThief.Reward(client); }
هتبحث بقا عن LoginMessages
وتحط فيه الكود دا
if (client.Entity.MapID == 3820)
{
client.Entity.Teleport(1002, 410, 354);
}
الكود دا عشان لو الايميل قفل وهو جوه المابة يخرج منها
وضيف ف القاعدة
كود PHP:
1919447 TreasureThief 2 19950 1002 370 368
وظبط المكان وعيش
وقريب هنزلها ف الاستيرم
|