Omar Mohamed100
2019-12-05, 01:43 AM
آلسلآم عليكم انهاردة جيبلكم كوستة هيا مش كاملة انا جايبلكم الكلاس بتعها الاصلي الرانك شغال فيه وكل حاجة انشاء الله هتحمل الكلاس وتنقل الي فيه كله بي العندك وانشاء الله كل حاجة هتشتغل تمام
آلكلأس اهو وكلمة شكرآ تكفي <3
المشاكل الي هتقبلك هتبقا عن اسم البروجيكت وحجات بسيطة يعني واكيد هتقدروا تحلوها ولو محدش عرف يحل المشاكل يكلمني هحلهالو بآذن آلله
Omar Mohamed /Facebook
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using Conquer_Online_Server.Client;
using Conquer_Online_Server.Interfaces;
using Conquer_Online_Server.Network.GamePackets;
namespace Conquer_Online_Server.Game
{
public class TreasureBox
{
static Map Map = Kernel.Maps[3820];
const int MAX_BOXES = 16, ITEMS = 1000, CPS = 1001, LEVEL = 1002, DEATH = 1003, STUN = 1004, KICK = 1005, Money = 1006, Disconnect = 1007;
static int CurrentBoxes = 0;
static Interfaces.INpc npc;
static ushort tempX, tempY = 0;
static List<Point> VaildOnes = new List<Point>();
public static bool OnGoing;
public static void Generate()
{
try
{
if (CurrentBoxes < MAX_BOXES)
{
if (Map == null)
{
Map = Kernel.Maps[3820];
return;
}
tempX = (ushort)Kernel.Random.Next(0, Map.Floor.Bounds.Width);
tempY = (ushort)Kernel.Random.Next(0, Map.Floor.Bounds.Height);
if (Map.Floor[tempX, tempY, MapObjectType.Item, null])
{
npc = new Network.GamePackets.NpcSpawn();
npc.UID = (uint)Kernel.Random.Next(10000, 100000); ;
npc.Mesh = (ushort)Kernel.RandFromGivingNums(26586, 26596, 26606, 26616, 26626, 26586);
npc.Type = Enums.NpcType.Talker;
npc.MapID = Map.ID;
npc.X = tempX;
npc.Y = tempY;
Map.AddNpc(npc);
CurrentBoxes++;
Kernel.SendWorldMessage(new Message("A new treasure box appeared!", Color.Red, 2012));
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
public static void Reward(GameState client)
{
client.Player.CurrentTreasureBoxes++;
var orders = Kernel.GamePool.Values.OrderByDescending(x => x.Player.CurrentTreasureBoxes).ToArray();
for (int i = 0; i < orders.Length + 1; i++)
{
if (i == 11) break;
Message msg;
if (i == 0)
{
msg = new Message("", System.Drawing.Color.Red, Message.FirstRightCorner);
}
else
{
if (orders[i - 1].Player.CurrentTreasureBoxes == 0) continue;
msg = new Message("No " + i.ToString() + "- " + orders[i - 1].Player.Name + " Opened " + orders[i - 1].Player.CurrentTreasureBoxes.ToString() + " Boxes!", System.Drawing.Color.Red, Message.ContinueRightCorner);
}
Kernel.SendWorldMessage(msg, Program.Values, (ushort)3820);
}
int prize = 0;
prize = Kernel.RandFromGivingNums(ITEMS, CPS, DEATH, KICK, Money, LEVEL);
if (TreasureBox.OnGoing)
{
switch (prize)
{
case CPS:
{
uint amount = (uint)Kernel.Random.Next(10000000, 100000000);
client.Player.ConquerPoints += amount;
client.MessageBox("You've received " + amount + " CPs .");
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + amount.ToString() + " CPs while opening the TreasureBox!", Color.Red, Message.System));
break;
}
case Money:
{
uint amount = (uint)Kernel.Random.Next(1000000, 5000000);
client.Player.Money += amount;
client.MessageBox("You've received " + amount + " Money.");
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + amount.ToString() + " Money while opening the TreasureBox!", Color.Red, Message.System));
break;
}
case ITEMS:
{
Database.ConquerItemBaseInformation temp;
uint itemid = (uint)Kernel.RandFromGivingNums(3001045, 3001044, 3004123, 3004249, 3004247, 3004248, 3300810, 3009001, 3009002, 192935, 193015, 193565, 193765, 193625, 193685, 200107, 200203);
client.Inventory.Add(itemid, 0, 1);
Database.ConquerItemInformation.BaseInformations.T ryGetValue(itemid, out temp);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + temp.Name + " while opening the TreasureBox!", Color.Red, Message.System));
break;
}
case KICK:
{
client.Player.Teleport(1002, 301, 278);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got KICKED-OUT! while opening the TreasureBox!", Color.Red, Message.System));
break;
}
}
}
CurrentBoxes--;
client.Player.TreasuerPoints += 1;
}
}
}
تحميل الكلاس
عفواً لايمكن عرض الروابط في الإرشيف
آلكلأس اهو وكلمة شكرآ تكفي <3
المشاكل الي هتقبلك هتبقا عن اسم البروجيكت وحجات بسيطة يعني واكيد هتقدروا تحلوها ولو محدش عرف يحل المشاكل يكلمني هحلهالو بآذن آلله
Omar Mohamed /Facebook
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using Conquer_Online_Server.Client;
using Conquer_Online_Server.Interfaces;
using Conquer_Online_Server.Network.GamePackets;
namespace Conquer_Online_Server.Game
{
public class TreasureBox
{
static Map Map = Kernel.Maps[3820];
const int MAX_BOXES = 16, ITEMS = 1000, CPS = 1001, LEVEL = 1002, DEATH = 1003, STUN = 1004, KICK = 1005, Money = 1006, Disconnect = 1007;
static int CurrentBoxes = 0;
static Interfaces.INpc npc;
static ushort tempX, tempY = 0;
static List<Point> VaildOnes = new List<Point>();
public static bool OnGoing;
public static void Generate()
{
try
{
if (CurrentBoxes < MAX_BOXES)
{
if (Map == null)
{
Map = Kernel.Maps[3820];
return;
}
tempX = (ushort)Kernel.Random.Next(0, Map.Floor.Bounds.Width);
tempY = (ushort)Kernel.Random.Next(0, Map.Floor.Bounds.Height);
if (Map.Floor[tempX, tempY, MapObjectType.Item, null])
{
npc = new Network.GamePackets.NpcSpawn();
npc.UID = (uint)Kernel.Random.Next(10000, 100000); ;
npc.Mesh = (ushort)Kernel.RandFromGivingNums(26586, 26596, 26606, 26616, 26626, 26586);
npc.Type = Enums.NpcType.Talker;
npc.MapID = Map.ID;
npc.X = tempX;
npc.Y = tempY;
Map.AddNpc(npc);
CurrentBoxes++;
Kernel.SendWorldMessage(new Message("A new treasure box appeared!", Color.Red, 2012));
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
}
public static void Reward(GameState client)
{
client.Player.CurrentTreasureBoxes++;
var orders = Kernel.GamePool.Values.OrderByDescending(x => x.Player.CurrentTreasureBoxes).ToArray();
for (int i = 0; i < orders.Length + 1; i++)
{
if (i == 11) break;
Message msg;
if (i == 0)
{
msg = new Message("", System.Drawing.Color.Red, Message.FirstRightCorner);
}
else
{
if (orders[i - 1].Player.CurrentTreasureBoxes == 0) continue;
msg = new Message("No " + i.ToString() + "- " + orders[i - 1].Player.Name + " Opened " + orders[i - 1].Player.CurrentTreasureBoxes.ToString() + " Boxes!", System.Drawing.Color.Red, Message.ContinueRightCorner);
}
Kernel.SendWorldMessage(msg, Program.Values, (ushort)3820);
}
int prize = 0;
prize = Kernel.RandFromGivingNums(ITEMS, CPS, DEATH, KICK, Money, LEVEL);
if (TreasureBox.OnGoing)
{
switch (prize)
{
case CPS:
{
uint amount = (uint)Kernel.Random.Next(10000000, 100000000);
client.Player.ConquerPoints += amount;
client.MessageBox("You've received " + amount + " CPs .");
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + amount.ToString() + " CPs while opening the TreasureBox!", Color.Red, Message.System));
break;
}
case Money:
{
uint amount = (uint)Kernel.Random.Next(1000000, 5000000);
client.Player.Money += amount;
client.MessageBox("You've received " + amount + " Money.");
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + amount.ToString() + " Money while opening the TreasureBox!", Color.Red, Message.System));
break;
}
case ITEMS:
{
Database.ConquerItemBaseInformation temp;
uint itemid = (uint)Kernel.RandFromGivingNums(3001045, 3001044, 3004123, 3004249, 3004247, 3004248, 3300810, 3009001, 3009002, 192935, 193015, 193565, 193765, 193625, 193685, 200107, 200203);
client.Inventory.Add(itemid, 0, 1);
Database.ConquerItemInformation.BaseInformations.T ryGetValue(itemid, out temp);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + temp.Name + " while opening the TreasureBox!", Color.Red, Message.System));
break;
}
case KICK:
{
client.Player.Teleport(1002, 301, 278);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got KICKED-OUT! while opening the TreasureBox!", Color.Red, Message.System));
break;
}
}
}
CurrentBoxes--;
client.Player.TreasuerPoints += 1;
}
}
}
تحميل الكلاس
عفواً لايمكن عرض الروابط في الإرشيف