المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت


Tyranny-Team's
2020-04-01, 02:26 AM
بعد اذنكو عايز اخلي الكينج مياخدش البرنس 1 هت وياخدو 2 هت
وكذالك ف البرنس مياخدش الدوق 1 ياخدو 2 هت
عشن انا عندي الكينج بياخد الكينج 2 هت دي تمم
لكن بياخد البرنس 1 هت
لو حد عندو حل ان الكينج ياخد البرنس 2 هت يساعدني

ElSaher
2020-04-01, 02:37 AM
دي بتحددها من Handle من الاسكلات

Tyranny-Team's
2020-04-01, 03:38 AM
دي بتحددها من handle من الاسكلات

ايوه تمام عارف عايز اعرف الأكواد اللي هكتبها ع كده

ElSaher
2020-04-01, 03:53 AM
ايوه تمام عارف عايز اعرف الأكواد اللي هكتبها ع كده

للاسف ولله معرفشي بس جرب كدا اعمل دي

هتخوش علي كلاس Nobility.cs

هتمسح كل الي فيه وتضيف دا


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 < 10)
{
Rank = NobilityRank.King;
if (Place < (10))
{
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 بي اسم البروجكت بتاعك
ولو جالك ايرور في Player خليها Entity

جرب كدا وقولي

Tyranny-Team's
2020-04-01, 04:05 AM
للاسف ولله معرفشي بس جرب كدا اعمل دي

هتخوش علي كلاس nobility.cs

هتمسح كل الي فيه وتضيف دا


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 < 10)
{
rank = nobilityrank.king;
if (place < (10))
{
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 بي اسم البروجكت بتاعك
ولو جالك ايرور في player خليها entity

جرب كدا وقولي

بس بصراحه انا شايف انو مفيش اي علاقه بينو وبين الأتاك

ElSaher
2020-04-01, 04:18 AM
بس بصراحه انا شايف انو مفيش اي علاقه بينو وبين الأتاك

جرب بس

Users
2020-04-01, 10:55 AM
بس بصراحه انا شايف انو مفيش اي علاقه بينو وبين الأتاك

عندك حق 😂😂😂

ElSaher
2020-04-01, 11:15 AM
عندك حق 😂😂😂

انا بجرب بس ولله يا ايمن يمكن تطلع صح اصل

Tyranny-Team's
2020-04-01, 12:42 PM
تسلمو ي روح قلبي انا كودت الاكواد ع ايدي واشتغلت انتظرووها في المنتدي

ElSaher
2020-04-01, 01:00 PM
تسلمو ي روح قلبي انا كودت الاكواد ع ايدي واشتغلت انتظرووها في المنتدي

تمام يا حوب

Avengers-Co
2020-04-01, 01:55 PM
متابع

عادل عصام
2020-04-01, 01:56 PM
علي حسب انت شغال بأنهي نوع اتاك ,
بس غالباً جوة Handle.cs ابحث عن السطر دة ,
if (attacker.NobilityRank == Game.ConquerStructures.NobilityRank.King && attacked.NobilityRank == Game.ConquerStructures.NobilityRank.Prince)
دية ضربة الكينج للبرنس هتلاقي تحتها قيمة وليكن مثلاً كدة ,
damage = (uint)(damage * 105 / 100);
عدلها براحتك لحد ما الاتاك يعجبك ,