|
|
المشاركات 82 |
+التقييم 0.04 |
تاريخ التسجيل May 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 238 |
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using Mr_Panda.Client;
using Mr_Panda.Interfaces;
using Mr_Panda.Network.GamePackets;
namespace Mr_Panda.Game
{
public class TreasureBox
{
static Map Map = Kernel.Maps[3820];
const int MAX_BOXES = 20, ITEMS = 1000, CPSMoney = 1001, LEVEL = 1002, DEATH = 1003, STUN = 1004, KICK = 1005;
static int CurrentBoxes = 0;
static Mr_Panda.Interfaces.INpc npc;
static ushort tempX, tempY = 0;
static uint BaseId = 101002;
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 = BaseId++;
npc.Mesh = (ushort)Kernel.RandFromGivingNums(9307, 9277, 9267, 9287, 9287, 9287 ,9257, 9257, 9257, 9257, 9257, 9257, 9307, 9307, 9307, 9307, 9307, 9277, 9267, 9267, 9267, 9277, 9277, 9277, 9277, 9277);
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.GamePool, (ushort)3820);
}
int prize = 0;
if (client.Player.Level <= 135)
prize = Kernel.RandFromGivingNums(ITEMS, CPSMoney, KICK, ITEMS, CPSMoney, ITEMS, CPSMoney, DEATH);
else prize = Kernel.RandFromGivingNums(ITEMS, CPSMoney, KICK, ITEMS, CPSMoney, ITEMS, CPSMoney, DEATH);
//#warning TREASURE BOX PRIZE
switch (prize)
{
case CPSMoney:
{
uint amount = (uint)Kernel.Random.Next(10000000,100000000);
if (amount >= 1)
{
client.Player.ConquerPoints += amount;
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + amount.ToString() + " CPs while opening the TreasureBox!", Color.White, Message.Talk));
}
break;
}
case ITEMS:
{
Database.ConquerItemBaseInformation temp;
uint itemid = (uint)Kernel.RandFromGivingNums(188755, 192935, 192775, 187405, 188105, 188705, 188945, 188515, 192825, 200220, 187855, 200475, 187405, 187415, 187425, 3004124, 183325, 183495, 184305, 184315, 184375, 187305, 187315, 181395, 184405, 184365);
client.Inventory.Add(itemid, 0, 1);
Database.ConquerItemInformation.BaseInformations.TryGetValue(itemid, out temp);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got " + temp.Name + " while opening the TreasureBox!", Color.White, Message.Talk));
break;
}
case KICK:
{
client.Player.Teleport(1002, 338, 345);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got KICKED-OUT! while opening the TreasureBox!", Color.White, Message.Talk));
break;
}
case DEATH:
{
client.Player.Die(client.Player);
Kernel.SendWorldMessage(new Message(client.Player.Name + " got Death! while opening the TreasureBox!", Color.White, Message.Talk));
break;
}
}
CurrentBoxes--;
client.Player.ConquerPoints += 100000;
//client.Entity.TreasuerPoints += 1;
}
}
}
private void WorldTournaments
#region TreasureBox
if ((Now64.Minute == 32) && (Now64.Second == 01))
{
TreasureBox.OnGoing = true;
for (int i = 0; i < 10; i++)
Game.TreasureBox.Generate();
Kernel.SendWorldMessage(new Message("The Lost TreasureBox event began!", Color.Red, Message.Center));
foreach (var client in Program.Values)
client.MessageBox("Lost treasure box event has started! Would you like to join? [Prize: 5kk or 1 kk CPs or more]",
(p) => { p.Player.Teleport(1002, 300, 229); }, null);
}
if (TreasureBox.OnGoing)
{
Game.TreasureBox.Generate();
}
if ((Now64.Minute == 37) && TreasureBox.OnGoing)
{
TreasureBox.OnGoing = false;
foreach (var client in Program.Values)
if (client.Player.MapID == 3820)
client.Player.Teleport(1002, 302, 286);
Kernel.SendWorldMessage(new Message("The Lost TreasureBox event ended!", Color.Red, Message.Center));
}
#endregion
if ((Now64.Minute == 32) && (Now64.Second == 01))
if ((Now64.Minute == 37) && TreasureBox.OnGoing)
switch (client.ActiveNpc)
#region TreasureThief
case 16970:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("I have lost all my treasure boxes inside the DisCity map when I was doing the quest! now you'll need to find them for me!");
dialog.Option("Send me there.", 1);
dialog.Option("Meh!", 255);
dialog.Send();
break;
}
case 1:
{
if (TreasureBox.OnGoing)
{
client.Player.Teleport(3820, (ushort)Kernel.Random.Next(87, 212), (ushort)Kernel.Random.Next(114, 200));
}
else
{
dialog.Text("I can only send you there when it's xx:32 To xx:37 ");
dialog.Option("Oh I See!.", 255);
dialog.Send();
}
break;
}
}
break;
}
#endregion
if (client.ActiveNpc >= 101002
if (client.ActiveNpc >= 101002 && client.Player.MapID == 3820)
{
client.SendScreen(new Network.GamePackets.Data(true) { UID = client.ActiveNpc, ID = Network.GamePackets.Data.RemoveEntity }, true);
client.Map.RemoveNpc(client.Map.Npcs[client.ActiveNpc]);
Mr_Panda.Game.TreasureBox.Reward(client);
}
public class Entity : Writer,
public int CurrentTreasureBoxes = 0;
Npc
16970 TreasureBox 2 20337 1002 296 224
10002 3820 65544 0
uint amount = (uint)Kernel.Random.Next(10000000,100000000);
|
الذين يشاهدون محتوى الموضوع الآن : 1 ( الأعضاء 0 والزوار 1) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
Vip Quest | محمد ياسر | تطوير سيرفرات كونكر | 2 | 2023-07-25 04:42 AM |
Creazy War Quest | karem010 | تطوير سيرفرات كونكر | 4 | 2020-05-12 04:18 PM |
طلب خاص مطلوب توب TreasureBox | ahmedfathy | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2019-11-06 11:54 AM |
مشكله بخصوص TreasureBox | سمير | مشكلات السيرفيرات كونكر الشخصيه | 1 | 2019-10-22 07:16 PM |
مشكلة في TreasureBox | Avengers-Co | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2019-09-03 06:49 PM |