ahmedfathy
2020-04-04, 01:53 PM
السلام عليكم يا رجاله
عايز امسح رنك الفلوس خالص وخلي الناس ترفع بي كبس بس
الحل ايه يا رجاله
لان الناس عندي بتكتب الجولد اللي موجود في في الايميل وبيرفعوا كينج الحل ايه
مستني ردكم
ElSaher
2020-04-04, 02:01 PM
سهلا يا احمد امسح الكلاس Nobility امسح كل الي فيه وبدلو بي دا
using System;
using System.Linq;
using System.Collections.Generic;
using Mr_Panda.Network.GamePackets;
using System.IO;
namespace Mr_Panda.Game.ConquerStructures
{
public class Nobility : Mr_Panda.Network.Writer
{
public static ulong MaxDonation = 0;
public static ulong MaxDonation1 = 0;
public static ulong MaxDonation2 = 0;
public static SafeDictionary<uint, NobilityInformation> Board = new SafeDictionary<uint, NobilityInformation>(10000);
public static List<NobilityInformation> BoardList = new List<NobilityInformation>(10000);
public static void Handle(NobilityInfo information, Client.GameState client)
{
if (information.Type == NobilityInfo.Donate)
return;
switch (information.Type)
{
case NobilityInfo.Donate:
{
if (client.Trade.InTrade)
return;
if (client.Player.DonateTime)
return;
ulong silvers = information.dwParam;
bool newDonator = false;
client.NobilityInformation.Gender = (byte)(client.Player.Body % 10);
if (client.NobilityInformation.Donation == 0)
newDonator = true;
if (information.MoneyType == 1)
{
ulong cps = silvers / 50000;
if (client.Player.ConquerPoints >= 10000)
{
client.Player.ConquerPoints -= 10000;
client.NobilityInformation.Donation += silvers;
}
}
else
{
if (client.Player.Money >= silvers)
{
client.Player.Money -= (uint)silvers;
client.NobilityInformation.Donation += silvers;
}
}
if (!Board.ContainsKey(client.Player.UID) && client.NobilityInformation.Donation == silvers && newDonator)
{
Board.Add(client.Player.UID, client.NobilityInformation);
try
{
Database.NobilityTable.InsertNobilityInformation(c lient.NobilityInformation);
}
catch
{
Database.NobilityTable.UpdateNobilityInformation(c lient.NobilityInformation);
}
}
else
{
Database.NobilityTable.UpdateNobilityInformation(c lient.NobilityInformation);
}
Sort(client.Player.UID);
break;
}
case NobilityInfo.List:
{
byte[] packet = new byte[600 + 8];
Network.Writer.WriteUInt16(600, 0, packet);
Network.Writer.WriteUInt16(2064, 2, packet);
Network.Writer.WriteUInt16(2, 4, packet);
Network.Writer.WriteUInt16(5, 10, packet);
Network.Writer.WriteUInt16(20, 12, packet);
int offset = 120;
for (int i = (int)(information.wParam1 * 10); i < information.wParam1 * 10 + 10 && i < BoardList.Count; i++)
{
var nob = BoardList[i];
Network.Writer.WriteUInt32(nob.EntityUID, offset, packet);
offset += 4;
if (Kernel.GamePool.ContainsKey(nob.EntityUID))
{
Network.Writer.WriteUInt32(1, offset, packet);
offset += 4;
Network.Writer.WriteUInt32(nob.Mesh, offset, packet);
offset += 4;
}
else
{
offset += 8;
}
Network.Writer.WriteString(nob.Name, offset, packet);
offset += 20;
Network.Writer.WriteUInt64(nob.Donation, offset, packet);
offset += 8;
Network.Writer.WriteUInt32((uint)nob.Rank, offset, packet);
offset += 4;
Network.Writer.WriteUInt32((uint)i, offset, packet);
offset += 4;
}
client.Send(packet);
break;
}
}
}
public static void Donate(ulong silvers, Client.GameState client, bool Npc = false)
{
if (Npc == false)
return;
bool newDonator = false;
client.NobilityInformation.Gender = (byte)(client.Player.Body % 10);
if (client.NobilityInformation.Donation == 0)
newDonator = true;
client.NobilityInformation.Donation += silvers;
if (!Board.ContainsKey(client.Player.UID) && client.NobilityInformation.Donation == silvers && newDonator)
{
Board.Add(client.Player.UID, client.NobilityInformation);
try
{
Database.NobilityTable.InsertNobilityInformation(c lient.NobilityInformation);
}
catch
{
Database.NobilityTable.UpdateNobilityInformation(c lient.NobilityInformation);
}
}
else
{
Database.NobilityTable.UpdateNobilityInformation(c lient.NobilityInformation);
}
Sort(client.Player.UID);
}
public static void Sort(uint updateUID)
{
SafeDictionary<uint, NobilityInformation> sortedBoard = new SafeDictionary<uint, NobilityInformation>();
int Place = 0;
foreach (NobilityInformation entry in Board.Values.OrderByDescending((p) => p.Donation))
{
Client.GameState client = null;
try
{
int previousPlace = entry.Position;
entry.Position = Place;
NobilityRank Rank = NobilityRank.Serf;
if (Place >= 10000)
{
if (entry.Donation >= 200000)
{
Rank = NobilityRank.Earl;
}
else if (entry.Donation >= 100000)
{
Rank = NobilityRank.Baron;
}
else if (entry.Donation >= 300000)
{
Rank = NobilityRank.Knight;
}
}
else
{
if (Place < 99999999)
{
Rank = NobilityRank.King;
if (Place < (99999999))
{
MaxDonation = entry.Donation;
}
}
else if (Place < 20)
{
Rank = NobilityRank.Prince;
if (Place < 20)
{
MaxDonation1 = entry.Donation;
}
}
else
{
if (Place < 9999)
{
}
Rank = NobilityRank.Duke;
if (Place < (9999))
{
MaxDonation2 = entry.Donation;
}
}
}
var oldRank = entry.Rank;
entry.Rank = Rank;
if (Kernel.GamePool.TryGetValue(entry.EntityUID, out client))
{
bool updateTheClient = false;
if (oldRank != Rank)
{
updateTheClient = true;
if (Rank == NobilityRank.Baron)
{
Kernel.SendWorldMessage(new Message(" Congratulation " + client.Player.Name + " has the Baron In Pharaohs-Eu ", System.Drawing.Color.White, Message.TopLeft), Program.Values);
}
if (Rank == NobilityRank.Earl)
{
Kernel.SendWorldMessage(new Message(" Congratulation " + client.Player.Name + " has the Earl In Pharaohs-Eu ", System.Drawing.Color.White, Message.TopLeft), Program.Values);
}
if (Rank == NobilityRank.Duke)
{
Kernel.SendWorldMessage(new Message(" Congratulation " + client.Player.Name + " has the Duke In Pharaohs-Eu ", System.Drawing.Color.White, Message.Center), Program.Values);
}
if (Rank == NobilityRank.Prince)
{
Kernel.SendWorldMessage(new Message(" Congratulation " + client.Player.Name + " has the Prince In Pharaohs-Eu ", System.Drawing.Color.White, Message.Center), Program.Values);
}
if (Rank == NobilityRank.King)
{
Kernel.SendWorldMessage(new Message(" Congratulation " + client.Player.Name + " has become the new King/Queen In Pharaohs-Eu ", System.Drawing.Color.White, Message.Center), Program.Values);
}
if (Rank == NobilityRank.Knight)
{
Kernel.SendWorldMessage(new Message(" Congratulation " + client.Player.Name + " has become a Knight By In Pharaohs-Eu ", System.Drawing.Color.White, Message.TopLeft), Program.Values);
}
}
else
{
if (previousPlace != Place)
{
updateTheClient = true;
}
}
if (updateTheClient || client.Player.UID == updateUID)
{
NobilityInfo update = new NobilityInfo(true);
update.Type = NobilityInfo.Icon;
update.dwParam = entry.EntityUID;
update.UpdateString(entry);
client.SendScreen(update, true);
client.Player.NobilityRank = entry.Rank;
}
}
sortedBoard.Add(entry.EntityUID, entry);
Place++;
}
catch { }
}
Board = sortedBoard;
lock (BoardList)
BoardList = Board.Values.ToList();
}
}
public class NobilityInformation
{
public string Name;
public uint EntityUID;
public uint Mesh;
public ulong Donation;
public byte Gender;
public int Position;
public NobilityRank Rank;
public bool king;
public DateTime KingDays;
}
public enum NobilityRank : byte
{
Serf = 0,
Knight = 1,
Baron = 3,
Earl = 5,
Duke = 7,
Prince = 9,
King = 12
}
}
هتغير Mr_Panda بي اسم البروجكت بتاعك
وهتغير دا Pharaohs-Eu بي اسم لعبتك
ملحوظه معمول كلو كنجات
هتبحث عن الجزء الخاص بالفلوس في Nobility
if (client.Player.Money >= silvers)
{
client.Player.Money -= (uint)silvers;
client.NobilityInformation.Donation += silvers;
}
امسحه و حط مكانه return;