منتدي اكواد

منتدي اكواد (https://code.vpscairo.com/index.php)
-   تطوير سيرفرات كونكر (https://code.vpscairo.com/forumdisplay.php?f=11)
-   -   اضافه رنك الورد (https://code.vpscairo.com/showthread.php?t=729)

محمد ياسر 2019-07-11 10:25 AM

اضافه رنك الورد
 

السلام عليكم ورحمة الله وبركاته
في عضو نزل مشكله عن حكايه رنك الورد انه مش شغال
فدلوقتي انضيفه مع بعض
افتح كلاس Flowers.cs
وبدله بده كله
كود PHP:

using System;
using System.Linq;
using System.Text;
using code.Client;
using System.Collections.Generic;
using code.Network.GamePackets;
using System.Collections.Concurrent;
using code.Rangers.Inner;

namespace 
code.Game.Features
{
    public 
unsafe class Flowers
    
{
        public 
enum Effect byte
        
{
            
None 0,

            
Rouse 1,
            
Lilies 2,
            
Orchids 3,
            
Tulips 4,

            
Kiss 1,
            
love 2,
            
Tins 3,
            
Jade 4,
        }
        public 
enum FlowersT byte
        
{
            
Rouse 0,
            
Lilies 1,
            
Orchids 2,
            
Tulips 3,

            
Kiss 4,
            
love 5,
            
Tins 6,
            
Jade 7,
        }

        public 
Flowers()
        {
        }
        public 
Flowers(uint _UIDstring name)
        {
            
UID _UID;
            
Name name;
        }
        public 
uint UID;
        public 
uint aFlower 1;
        public 
uint SendDay 0;
        public 
string Name "";

        public 
int SendScreenValue(FlowersT typint rak)
        {
            if (
rak == || rak 100)
                return 
0;
            return (int)(
30000002 + (uint)(100 * (byte)typ) + GetRank(rak));
        }
        public 
ushort GetRank(int rank)
        {
            if (
rank == 1)
                return 
0;
            if (
rank == 2)
                return 
10000;
            if (
rank == 3)
                return 
20000;
            if (
rank 3)
                return 
30000;
            return 
0;
        }
        public 
int BoySendScreenValue(FlowersT typint rak)
        {
            
int ret 0;
            if (
rak == -1) return 0;
            if (
rak 100) return 0;
            
ret = (int)(30000402 + (uint)(100 * (byte)typ));
            return 
ret;
        }

        public 
int RankRoses 0;
        public 
int RankLilies 0;//max 10 start with -1.
        
public int RankOrchids 0;//max 10 start with -1.
        
public int RankTuilps 0;//max 10 start with -1.

        
public uint RedRoses;//kiss
        
public uint RedRoses2day;
        public 
uint Lilies;//love
        
public uint Lilies2day;
        public 
uint Orchads;//wine
        
public uint Orchads2day;
        public 
uint Tulips;//jade
        
public uint Tulips2day;

        public 
override string ToString()
        {
            return 
UID "#"
                
Name "#"
                
RedRoses "#"
                
RedRoses2day "#"
                
Lilies "#"
                
Lilies2day "#"
                
Orchads "#"
                
Orchads2day "#"
                
Tulips "#"
                
Tulips2day "#"
                
SendDay "#"
                
aFlower "#"
                
"#"
                
"#"
                
"#"
                
"#"
                
"#";
        }
        public 
void Read(string aLine)
        {
            if (
aLine == "" || aLine == null) return;
            
string[] line aLine.Split('#');
            
UID uint.Parse(line[0]);
            
Name line[1];
            
RedRoses uint.Parse(line[2]);
            
RedRoses2day uint.Parse(line[3]);
            
Lilies uint.Parse(line[4]);
            
Lilies2day uint.Parse(line[5]);
            
Orchads uint.Parse(line[6]);
            
Orchads2day uint.Parse(line[7]);
            
Tulips uint.Parse(line[8]);
            
Tulips2day uint.Parse(line[9]);
            
SendDay uint.Parse(line[10]);
            
aFlower uint.Parse(line[11]);
            
Reset();
        }
        public 
void Reset()
        {
            if (
SendDay != DateTime.Now.Day)
            {
                
RedRoses2day Lilies2day Orchads2day Tulips2day 0;
                
aFlower 1;
                
SendDay = (uint)DateTime.Now.Day;
            }
        }

        public static 
ConcurrentDictionary<uintFlowersFlowers_Poll = new ConcurrentDictionary<uintFlowers>();
        public static 
ConcurrentDictionary<uintFlowersBoyFlowers = new ConcurrentDictionary<uintFlowers>();

        public static 
Flowers[] KissTop100 = new Flowers[0];
        public static 
Flowers[] LoveTop100 = new Flowers[0];
        public static 
Flowers[] TineTop100 = new Flowers[0];
        public static 
Flowers[] JadeTop100 = new Flowers[0];

        public static 
Flowers[] RedRousesTop100 = new Flowers[0];
        public static 
Flowers[] LiliesTop100 = new Flowers[0];
        public static 
Flowers[] OrchidsTop100 = new Flowers[0];
        public static 
Flowers[] TulipsTop100 = new Flowers[0];

        public static 
object RouseLock = new object();
        public static 
object LilisLock = new object();
        public static 
object OrchidsLock = new object();
        public static 
object TulipsLock = new object();

        public static 
object KissLock = new object();
        public static 
object LoveLock = new object();
        public static 
object TineLock = new object();
        public static 
object JadeLock = new object();

        public static List<
FlowersRankKiss = new List<Flowers>();
        public static List<
FlowersRankLove = new List<Flowers>();
        public static List<
FlowersRankTine = new List<Flowers>();
        public static List<
FlowersRankJade = new List<Flowers>();

        public static List<
FlowersRankrose = new List<Flowers>();
        public static List<
FlowersRanklili = new List<Flowers>();
        public static List<
FlowersRankorchid = new List<Flowers>();
        public static List<
FlowersRankTulips = new List<Flowers>();

        public static 
void CulculateRankJade(Flowers afflow)
        {
            
lock (JadeLock)
            {
                try
                {
                    if (!
RankJade.Contains(afflow))
                        
RankJade.Add(afflow);
                    var 
data RankJade.ToArray();

                    Array.
Sort(data, (c1c2) => { return c2.Tulips.CompareTo(c1.Tulips); });

                    var 
room data.ToArray();

                    List<
FlowersbackUpd = new List<Flowers>();

                    
int x 1;
                    foreach (
Flowers flow in room)
                    {
                        if (
flow.Tulips == 0) continue;
                        if (
100)
                        {

                            
flow.RankTuilps x;
                            
backUpd.Add(flow);
                        }
                        else
                            
flow.RankTuilps 0;
                        
x++;
                    }
                    
lock (JadeTop100)
                    {
                        
RankJade = new List<Flowers>(backUpd);
                        
JadeTop100 backUpd.ToArray();
                    }
                }
                catch (
Exception e) { Console.WriteLine(e.ToString()); }
            }
        }
        public static 
void CulculateRankTine(Flowers afflow)
        {
            
lock (TineLock)
            {
                try
                {
                    if (!
RankTine.Contains(afflow))
                        
RankTine.Add(afflow);
                    var 
data RankTine.ToArray();

                    Array.
Sort(data, (c1c2) => { return c2.Orchads.CompareTo(c1.Orchads); });

                    var 
room data.ToArray();

                    List<
FlowersbackUpd = new List<Flowers>();

                    
int x 1;
                    foreach (
Flowers flow in room)
                    {
                        if (
flow.Orchads == 0) continue;
                        if (
100)
                        {

                            
flow.RankOrchids x;
                            
backUpd.Add(flow);
                        }
                        else
                            
flow.RankOrchids 0;
                        
x++;
                    }
                    
lock (TineTop100)
                    {
                        
RankTine = new List<Flowers>(backUpd);
                        
TineTop100 backUpd.ToArray();
                    }
                }
                catch (
Exception e) { Console.WriteLine(e.ToString()); }
            }
        }
        public static 
void CulculateRankLove(Flowers afflow)
        {
            
lock (LoveLock)
            {
                try
                {
                    if (!
RankLove.Contains(afflow))
                        
RankLove.Add(afflow);
                    var 
data RankLove.ToArray();

                    Array.
Sort(data, (c1c2) => { return c2.Lilies.CompareTo(c1.Lilies); });

                    var 
room data.ToArray();

                    List<
FlowersbackUpd = new List<Flowers>();

                    
int x 1;
                    foreach (
Flowers flow in room)
                    {
                        if (
flow.Lilies == 0) continue;
                        if (
100)
                        {
                            
flow.RankLilies x;
                            
backUpd.Add(flow);
                        }
                        else
                            
flow.RankLilies 0;
                        
x++;
                    }
                    
lock (LoveTop100)
                    {
                        
RankLove = new List<Flowers>(backUpd);
                        
LoveTop100 backUpd.ToArray();
                    }
                }
                catch (
Exception e) { Console.WriteLine(e.ToString()); }
            }
        }
        public static 
void CulculateRankKiss(Flowers afflow)
        {
            
lock (KissLock)
            {
                try
                {
                    if (!
RankKiss.Contains(afflow))
                        
RankKiss.Add(afflow);
                    var 
data RankKiss.ToArray();

                    Array.
Sort(data, (c1c2) => { return c2.RedRoses.CompareTo(c1.RedRoses); });

                    var 
room data.ToArray();

                    List<
FlowersbackUpd = new List<Flowers>();

                    
int x 1;
                    foreach (
Flowers flow in room)
                    {
                        if (
flow.RedRoses == 0) continue;
                        if (
100)
                        {

                            
flow.RankRoses x;
                            
backUpd.Add(flow);
                        }
                        else
                            
flow.RankRoses 0;
                        
x++;
                    }
                    
lock (KissTop100)
                    {
                        
RankKiss = new List<Flowers>(backUpd);
                        
KissTop100 backUpd.ToArray();
                    }
                }
                catch (
Exception e) { Console.WriteLine(e.ToString()); }
            }
        }

        public static 
void CulculateRankRouse(Flowers afflow)
        {
            
lock (RouseLock)
            {
                try
                {
                    if (!
Rankrose.Contains(afflow))
                        
Rankrose.Add(afflow);
                    var 
data Rankrose.ToArray();

                    Array.
Sort(data, (c1c2) => { return c2.RedRoses.CompareTo(c1.RedRoses); });

                    var 
room data.ToArray();

                    List<
FlowersbackUpd = new List<Flowers>();

                    
int x 1;
                    foreach (
Flowers flow in room)
                    {
                        if (
flow.RedRoses == 0) continue;
                        if (
100)
                        {
                            
flow.RankRoses x;
                            
backUpd.Add(flow);
                        }
                        else
                        {
                            
flow.RankRoses 0;
                        }

                        
x++;
                    }
                    
lock (RedRousesTop100)
                    {
                        
Rankrose = new List<Flowers>(backUpd);
                        
RedRousesTop100 backUpd.ToArray();
                    }
                }
                catch (
Exception e) { Console.WriteLine(e.ToString()); }
            }
        }
        public static 
void CulculateRankLilies(Flowers afflow)
        {
            
lock (LilisLock)
            {
                if (!
Ranklili.Contains(afflow))
                    
Ranklili.Add(afflow);
                var 
data Ranklili.ToArray();

                Array.
Sort(data, (c1c2) => { return c2.Lilies.CompareTo(c1.Lilies); });

                
//IEnumerable<Flowers> query = data.OrderBy(redrous => redrous.Tulips);

                //var room = query.ToArray();
                
var room data.ToArray();
                List<
FlowersbackUpd = new List<Flowers>();

                
int x 1;
                foreach (
Flowers flow in room)
                {
                    if (
flow.Lilies == 0) continue;
                    if (
100)
                    {

                        
flow.RankLilies x;
                        
backUpd.Add(flow);
                    }
                    else
                    {
                        
flow.RankLilies 0;
                    }

                    
x++;
                }
                
lock (LiliesTop100)
                {
                    
Ranklili = new List<Flowers>(backUpd);
                    
LiliesTop100 backUpd.ToArray();
                }
            }
        }
        public static 
void CulculateRankOrchids(Flowers afflow)
        {
            
lock (OrchidsLock)
            {
                if (!
Rankorchid.Contains(afflow))
                    
Rankorchid.Add(afflow);
                var 
data Rankorchid.ToArray();

                Array.
Sort(data, (c1c2) => { return c2.Orchads.CompareTo(c1.Orchads); });

                
//IEnumerable<Flowers> query = data.OrderBy(redrous => redrous.Tulips);

                //var room = query.ToArray();
                
var room data.ToArray();

                List<
FlowersbackUpd = new List<Flowers>();

                
int x 1;
                foreach (
Flowers flow in room)
                {
                    if (
flow.Orchads == 0) continue;
                    if (
100)
                    {
                        
flow.RankOrchids x;
                        
backUpd.Add(flow);
                    }
                    else
                    {
                        
flow.RankOrchids 0;

                    }

                    
x++;
                }
                
lock (OrchidsTop100)
                {
                    
Rankorchid = new List<Flowers>(backUpd);
                    
OrchidsTop100 backUpd.ToArray();
                }
            }
        }
        public static 
void CulculateRankTulips(Flowers afflow)
        {
            
lock (TulipsLock)
            {
                if (!
RankTulips.Contains(afflow))
                    
RankTulips.Add(afflow);
                var 
data RankTulips.ToArray();

                Array.
Sort(data, (c1c2) => { return c2.Tulips.CompareTo(c1.Tulips); });

                var 
room data.ToArray();

                List<
FlowersbackUpd = new List<Flowers>();

                
int x 1;
                foreach (
Flowers flow in room)
                {
                    if (
flow.Tulips == 0) continue;
                    if (
100)
                    {
                        
flow.RankTuilps x;
                        
backUpd.Add(flow);
                    }
                    else
                    {
                        
flow.RankTuilps 0;
                    }

                    
x++;
                }
                
lock (TulipsTop100)
                {
                    
RankTulips = new List<Flowers>(backUpd);
                    
TulipsTop100 backUpd.ToArray();
                }
            }
        }

        public static 
void MsgRank(byte[] packetGameState client)
        {
            
MsgRank ranking = new MsgRank(false0);
            
ranking.Deserialize(packet);
            switch (
ranking.Mode)
            {
                case 
6://Prestige
                    
{
                        foreach (var 
c in Kernel.GamePool.Values)
                        {
                            
PerfectionManager.CalcAndAdd(c);
                        }
                        
PerfectionManager.ShowRank(rankingclient);
                        var 
index = new byte[11] { 015254555657585135145165 };
                        
EntityRank[] Chars = new EntityRank[11];
                        for (
int i 0Chars.Lengthi++)
                        {
                            if (
== 0)
                                
Chars[i] = PerfectionManager.Ranking.Values.OrderByDescending(=> e.Prestige).ThenByDescending(=> x.Class).ThenByDescending(=> x.Level).ThenBy(=> x.UID).FirstOrDefault();
                            else 
Chars[i] = PerfectionManager.Ranking.Values.Where(=> x.Class >= (index[i] - 5) && x.Class <= index[i]).OrderByDescending(=> x.Prestige).ThenByDescending(=> x.Level).ThenBy(=> x.UID).FirstOrDefault();

                        }
                        
byte count 0;
                        foreach (var 
zz in Chars) if (zz != nullcount++;
                        var 
nRanking = new MsgRank(truecount);
                        
nRanking.Mode 6;
                        
nRanking.Count count;
                        for (
byte z 0Chars.Lengthz++)
                        {
                            var 
Entity Chars[z];
                            if (
Entity == null) continue;
                            
nRanking.Append2((uint)(1), (uint)Entity.PrestigeEntity.UIDEntity.NameEntity.LevelEntity.Class, Entity.Meshtrue);
                        }
                        
client.Send(nRanking);
                        break;
                    }
                case 
Network.GamePackets.MsgRank.Ranking:
                    {
                        if (
ranking.RankingType == Network.GamePackets.MsgRank.InnerPower)
                        {
                            
ushort page ranking.Page;
                            
InnerPower[] list = null;
                            
Func<InnerPoweruintselect null;
                            list = 
InnerPower.InnerPowerRank.GetRankingList();
                            
select = (inner) => { return inner.TotalScore; };
                            if (list.
Length page 10) return;
                            
uint count = (uint)Math.Min(list.Length page 1010);
                            var 
nRanking = new Network.GamePackets.MsgRank(true);
                            
nRanking.Mode Network.GamePackets.MsgRank.Ranking;
                            
nRanking.RankingType ranking.RankingType;
                            
nRanking.Page page;
                            
nRanking.RegisteredCount = (ushort)list.Length;
                            
int rank = (int)page 10;
                            for (
int i rankrank counti++)
                            {
                                var 
current = list[i];
                                
nRanking.Append((uint)(1), (uint)select(current), current.UIDcurrent.Name);
                            }
                            
client.Send(nRanking);
                        }
                        if (
ranking.RankingType >= Network.GamePackets.MsgRank.DragonChi && ranking.RankingType <= Network.GamePackets.MsgRank.TurtleChi)
                            
MsgTrainingVitality.ShowGenericRanking(rankingclient);
                        else if (
ranking.RankingType >= Network.GamePackets.MsgRank.RoseFairy && ranking.RankingType <= Network.GamePackets.MsgRank.TulipFairy)
                            
MsgTrainingVitality.ShowGenericRanking2(rankingclient);
                        else if (
ranking.RankingType >= Network.GamePackets.MsgRank.Kiss && ranking.RankingType <= Network.GamePackets.MsgRank.Jade)
                            
MsgTrainingVitality.ShowGenericRanking2(rankingclient);
                        if (
ranking.RankingType >= Network.GamePackets.MsgRank.Prestige && ranking.RankingType <= Network.GamePackets.MsgRank.Prestige 10)
                        {
                            switch (
ranking.Mode)
                            {
                                case 
Network.GamePackets.MsgRank.Ranking:
                                    {
                                        foreach (var 
c in Kernel.GamePool.Values)
                                        {
                                            
PerfectionManager.CalcAndAdd(c);
                                        }
                                        
PerfectionManager.ShowRank(rankingclient);
                                        return;
                                    }
                            }
                            return;
                        }
                        break;
                    }

                case 
Network.GamePackets.MsgRank.QueryCount:
                    {
                        if (
ranking.RankingType == 70000000)
                        {
                            if (
client.Player.InnerPower != null)
                            {
                                
MsgRank genericRanking3 = new MsgRank(true1);
                                
genericRanking3.Mode 2;
                                
genericRanking3.RankingType ranking.RankingType;
                                
genericRanking3.Count 1;
                                
genericRanking3.Append((uint)client.Player.InnerPower.Rankclient.Player.InnerPower.TotalScoreclient.Player.UIDclient.Player.Name);
                                
client.Send(genericRanking3.ToArray());
                            }
                            return;
                        }
                        
/* if (ranking.RankingType == Network.GamePackets.MsgRank.Prestige)
                         {
                             if (client.Player.Prestige > 1)
                             {
                                 MsgRank genericRanking3 = new MsgRank(true, 1);
                                 genericRanking3.Mode = 2;
                                 genericRanking3.RankingType = ranking.RankingType;
                                 genericRanking3.Count = 1;
                                 genericRanking3.Append((uint)PerfectionManager.GetRank(client, ranking.RankingType), (uint)client.Player.Prestige, client.Player.UID, client.Player.Name);
                                 client.Send(genericRanking3.ToArray());
                             }
                             return;
                         }
                         if (ranking.RankingType >= Network.GamePackets.MsgRank.PrestigeTrojan && ranking.RankingType <= Network.GamePackets.MsgRank.Prestigewing)
                         {
                             if (client.Player.Prestige > 1)
                             {
                                 MsgRank genericRanking3 = new MsgRank(true, 1);
                                 genericRanking3.Mode = 2;
                                 genericRanking3.RankingType = ranking.RankingType;
                                 genericRanking3.Count = 1;
                                 genericRanking3.Append((uint)PerfectionManager.GetRank(client, ranking.RankingType), (uint)client.Player.Prestige, client.Player.UID, client.Player.Name);
                                 client.Send(genericRanking3.ToArray());
                             }
                             return;
                         }*/
                        
if (Flowers.IsGirl((uint)client.Player.Body))
                        {
                            if (
client.Player.MyFlowers != null)
                            {
                                
int num61 = -1;
                                
uint num62 Flowers.CreateMyRank(clientout num61);
                                
packet[4] = 5;
                                
client.Send(packet);
                                
client.Player.FlowerRank = (uint)client.Player.MyFlowers.SendScreenValue((Game.Features.Flowers.FlowersT)num62num61);
                                
MsgRank genericRanking2 = new MsgRank(true1u);
                                
genericRanking2.Mode 2u;
                                
genericRanking2.RankingType client.Player.FlowerRank;
                                
genericRanking2.Count 1u;
                                
int rank num61;
                                if (
client.Player.MyFlowers.RankRoses 100 && client.Player.MyFlowers.RankRoses 0)
                                {
                                    
genericRanking2.RankingType Network.GamePackets.MsgRank.RoseFairy;
                                    
genericRanking2.Append((uint)client.Player.MyFlowers.RankRosesclient.Player.MyFlowers.RedRosesclient.Player.UIDclient.Player.Name);
                                    
client.Send(genericRanking2.ToArray());
                                }
                                if (
client.Player.MyFlowers.RankLilies 100 && client.Player.MyFlowers.RankLilies 0)
                                {
                                    
genericRanking2.Reset();
                                    
genericRanking2.RankingType Network.GamePackets.MsgRank.LilyFairy;
                                    
genericRanking2.Append((uint)client.Player.MyFlowers.RankLiliesclient.Player.MyFlowers.Liliesclient.Player.UIDclient.Player.Name);
                                    
client.Send(genericRanking2.ToArray());
                                }
                                if (
client.Player.MyFlowers.RankOrchids 100 && client.Player.MyFlowers.RankOrchids 0)
                                {
                                    
genericRanking2.Reset();
                                    
genericRanking2.RankingType Network.GamePackets.MsgRank.OrchidFairy;
                                    
genericRanking2.Append((uint)client.Player.MyFlowers.RankOrchidsclient.Player.MyFlowers.Orchadsclient.Player.UIDclient.Player.Name);
                                    
client.Send(genericRanking2.ToArray());
                                }
                                if (
client.Player.MyFlowers.RankTuilps 100 && client.Player.MyFlowers.RankTuilps 0)
                                {
                                    if (
client.Player.MyFlowers.RankTuilps == && !client.Player.TulipsWing)
                                    {
                                        
//client.TitleStorage.Add(6005, 6005, false);
                                        
if (client.Player.EquippedWing == 0)
                                            new 
TitleStorage().AddTitle(client60056005true);
                                        else
                                            new 
TitleStorage().AddTitle(client60056005false);
                                        
client.Player.TulipsWing true;
                                    }
                                    
//Mrali
                                    
genericRanking2.Reset();
                                    
genericRanking2.RankingType Network.GamePackets.MsgRank.TulipFairy;
                                    
genericRanking2.Append((uint)client.Player.MyFlowers.RankTuilpsclient.Player.MyFlowers.Tulipsclient.Player.UIDclient.Player.Name);
                                    
client.Send(genericRanking2.ToArray());
                                }
                                
packet[4] = 5;
                                
client.Send(packet);
                                break;
                            }
                            break;
                        }
                        else
                        {
                            if (
client.Player.MyFlowers != null)
                            {
                                
MsgRank genericRanking3 = new MsgRank(true1u);
                                
genericRanking3.Mode 2u;
                                
genericRanking3.RankingType 30000402u;
                                
genericRanking3.Count 1u;
                                if (
client.Player.MyFlowers.RankRoses 100 && client.Player.MyFlowers.RankRoses 0)
                                {
                                    
genericRanking3.Append((uint)client.Player.MyFlowers.RankRosesclient.Player.MyFlowers.RedRosesclient.Player.UIDclient.Player.Name);
                                    
client.Send(genericRanking3.ToArray());
                                }
                                if (
client.Player.MyFlowers.RankLilies 100 && client.Player.MyFlowers.RankLilies 0)
                                {
                                    
genericRanking3.Reset();
                                    
genericRanking3.Append((uint)client.Player.MyFlowers.RankLiliesclient.Player.MyFlowers.Liliesclient.Player.UIDclient.Player.Name);
                                    
genericRanking3.RankingType 30000502u;
                                    
client.Send(genericRanking3.ToArray());
                                }
                                if (
client.Player.MyFlowers.RankOrchids 100 && client.Player.MyFlowers.RankOrchids 0)
                                {
                                    
genericRanking3.Reset();
                                    
genericRanking3.Append((uint)client.Player.MyFlowers.RankOrchidsclient.Player.MyFlowers.Orchadsclient.Player.UIDclient.Player.Name);
                                    
genericRanking3.RankingType 30000602u;
                                    
client.Send(genericRanking3.ToArray());
                                }
                                if (
client.Player.MyFlowers.RankTuilps 100 && client.Player.MyFlowers.RankTuilps 0)
                                {
                                    
genericRanking3.Reset();
                                    
genericRanking3.Append((uint)client.Player.MyFlowers.RankTuilpsclient.Player.MyFlowers.Tulipsclient.Player.UIDclient.Player.Name);
                                    
genericRanking3.RankingType 30000702u;
                                    
client.Send(genericRanking3.ToArray());
                                }
                                
packet[4] = 5;
                                
client.Send(packet);
                                break;
                            }
                        }
                        break;
                    }
                
/*case Network.GamePackets.MsgRank.TotemRank:
                    {
                        PerfectionManager.ShowHighWall(ranking, client);
                        break;
                    } */
                
default:
                    if (
client.Account.State == Database.AccountTable.AccountState.Administrator)
                        
client.Send("Unknown RankID : " ranking.Mode); break;
            }

        }
        public static 
void MsgFlower(Client.GameState clientbyte[] packet)
        {
            
byte typ1 packet[4];
            
uint Target BitConverter.ToUInt32(packet8);
            
uint ITEM_UID BitConverter.ToUInt32(packet12);
            if (
IsBoy(client.Player.Body) && typ1 == 0)//boy send
            
{
                switch (
ITEM_UID)
                {
                    case 
0://send my flower
                        
{
                            if (
client.Player.MyFlowers.aFlower == 0) break;
                            
Client.GameState target_client;
                            if (
Kernel.GamePool.TryGetValue(Targetout target_client))
                            {
                                if (!
IsGirl(target_client.Player.Body)) return;
                                
client.Player.MyFlowers.aFlower 0;
                                
client.Player.MyFlowers.SendDay = (uint)DateTime.Now.Day;
                                
target_client.Player.MyFlowers.RedRoses2day += 1;
                                
target_client.Player.MyFlowers.RedRoses += 1;
                                
SendFlower flow = new SendFlower();
                                
flow.Typing 0;
                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Tulips;
                                
flow.Amount 1;
                                
flow.SenderName client.Player.Name;
                                
flow.ReceiverName target_client.Player.Name;
                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Rouse;
                                
client.SendScreen(flow.ToArray(), true);
                            }
                            break;
                        }
                    default:
                        {
                            
Network.GamePackets.MsgItemInfo Item null;
                            if (
client.Inventory.TryGetItem(ITEM_UIDout Item))
                            {
                                
Client.GameState target_client;
                                if (
Kernel.GamePool.TryGetValue(Targetout target_client))
                                {
                                    if (!
IsGirl(target_client.Player.Body)) return;
                                    
uint Amount Item.ID 1000;
                                    
SendFlower flow = new SendFlower();
                                    
flow.Typing typ1;
                                    
flow.Amount Amount;
                                    
flow.SenderName client.Player.Name;
                                    
flow.ReceiverName target_client.Player.Name;
                                    switch (
GetFlowerTyp(Item.ID))
                                    {
                                        case (
byte)Game.Features.Flowers.FlowersT.Rouse:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Rouse;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Rouse;
                                                
target_client.Player.MyFlowers.RedRoses2day += Amount;
                                                
target_client.Player.MyFlowers.RedRoses += Amount;
                                                if (
Game.Features.Flowers.RedRousesTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.RedRousesTop100[98].RedRoses <= target_client.Player.MyFlowers.RedRoses)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankRouse(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankRouse(target_client.Player.MyFlowers);
                                                break;
                                            }
                                        case (
byte)Game.Features.Flowers.FlowersT.Lilies:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Lilies;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Lilies;
                                                
target_client.Player.MyFlowers.Lilies2day += Amount;
                                                
target_client.Player.MyFlowers.Lilies += Amount;
                                                if (
Game.Features.Flowers.LiliesTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.LiliesTop100[98].Lilies <= target_client.Player.MyFlowers.Lilies)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankLilies(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankLilies(target_client.Player.MyFlowers);
                                                break;
                                            }
                                        case (
byte)Game.Features.Flowers.FlowersT.Orchids:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Orchids;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Orchids;

                                                
target_client.Player.MyFlowers.Orchads2day += Amount;
                                                
target_client.Player.MyFlowers.Orchads += Amount;
                                                if (
Game.Features.Flowers.OrchidsTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.OrchidsTop100[98].Orchads <= target_client.Player.MyFlowers.Orchads)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankOrchids(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankOrchids(target_client.Player.MyFlowers);
                                                break;
                                            }
                                        case (
byte)Game.Features.Flowers.FlowersT.Tulips:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Tulips;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Tulips;

                                                
target_client.Player.MyFlowers.Tulips2day += Amount;
                                                
target_client.Player.MyFlowers.Tulips += Amount;
                                                if (
Game.Features.Flowers.TulipsTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.TulipsTop100[98].Tulips <= target_client.Player.MyFlowers.Tulips)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankTulips(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankTulips(target_client.Player.MyFlowers);
                                                break;
                                            }
                                    }
                                    
client.Inventory.Remove(ItemEnums.ItemUse.Remove);
                                    
client.SendScreen(flow.ToArray(), true);
                                }
                            }
                            break;
                        }
                }
            }
            else if (
IsGirl(client.Player.Body) && typ1 == 1)//girl send
            
{
                switch (
ITEM_UID)
                {
                    case 
0://curent flower
                        
{
                            if (
client.Player.MyFlowers.aFlower == 0)
                                return;
                            
Client.GameState target_client;
                            if (
Kernel.GamePool.TryGetValue(Targetout target_client))
                            {
                                if (!
IsBoy(target_client.Player.Body)) return;
                                
client.Player.MyFlowers.aFlower 0;
                                
client.Player.MyFlowers.SendDay = (uint)DateTime.Now.Day;
                                
target_client.Player.MyFlowers.RedRoses += 1;
                                
target_client.Player.MyFlowers.RedRoses2day += 1;
                                
SendFlower flow = new SendFlower();
                                
flow.Typing 1;
                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Kiss;
                                
flow.Amount 1;
                                
flow.SenderName client.Player.Name;
                                
flow.ReceiverName target_client.Player.Name;
                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Kiss;
                                
client.SendScreen(flow.ToArray(), true);
                            }
                            break;
                        }
                    default:
                        {
                            
MsgItemInfo Item null;
                            if (
client.Inventory.TryGetItem(ITEM_UIDout Item))
                            {
                                
Client.GameState target_client null;
                                if (
Kernel.GamePool.TryGetValue(Targetout target_client))
                                {
                                    if (!
IsBoy(target_client.Player.Body)) return;
                                    
uint Amount Item.ID 1000;
                                    
SendFlower flow = new SendFlower();
                                    
flow.Typing 1;
                                    
flow.Amount Amount;
                                    
flow.SenderName client.Player.Name;
                                    
flow.ReceiverName target_client.Player.Name;
                                    switch (
GetFlowerTyp(Item.ID))
                                    {
                                        case (
byte)Game.Features.Flowers.FlowersT.Rouse:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Kiss;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Kiss;

                                                
target_client.Player.MyFlowers.RedRoses2day += Amount;
                                                
target_client.Player.MyFlowers.RedRoses += Amount;
                                                if (
Game.Features.Flowers.KissTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.KissTop100[98].RedRoses <= target_client.Player.MyFlowers.RedRoses)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankKiss(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankKiss(target_client.Player.MyFlowers);
                                                break;
                                            }
                                        case (
byte)Game.Features.Flowers.FlowersT.Lilies:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.love;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.love;

                                                
target_client.Player.MyFlowers.Lilies2day += Amount;
                                                
target_client.Player.MyFlowers.Lilies += Amount;
                                                if (
Game.Features.Flowers.LoveTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.LoveTop100[98].Lilies <= target_client.Player.MyFlowers.Lilies)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankLove(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankLove(target_client.Player.MyFlowers);
                                                break;
                                            }
                                        case (
byte)Game.Features.Flowers.FlowersT.Orchids:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Tins;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Tins;

                                                
target_client.Player.MyFlowers.Orchads2day += Amount;
                                                
target_client.Player.MyFlowers.Orchads += Amount;
                                                if (
Game.Features.Flowers.TineTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.TineTop100[98].Orchads <= target_client.Player.MyFlowers.Orchads)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankTine(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankTine(target_client.Player.MyFlowers);
                                                break;
                                            }
                                        case (
byte)Game.Features.Flowers.FlowersT.Tulips:
                                            {
                                                
flow.Effect = (byte)Game.Features.Flowers.Effect.Jade;
                                                
flow.FType = (byte)Game.Features.Flowers.FlowersT.Jade;

                                                
target_client.Player.MyFlowers.Tulips2day += Amount;
                                                
target_client.Player.MyFlowers.Tulips += Amount;
                                                if (
Game.Features.Flowers.JadeTop100.Length 98)
                                                {
                                                    if (
Game.Features.Flowers.JadeTop100[98].Tulips <= target_client.Player.MyFlowers.Tulips)
                                                    {
                                                        
Game.Features.Flowers.CulculateRankJade(target_client.Player.MyFlowers);
                                                    }
                                                }
                                                else 
Game.Features.Flowers.CulculateRankJade(target_client.Player.MyFlowers);
                                                break;
                                            }
                                    }
                                    
client.Inventory.Remove(ItemEnums.ItemUse.Remove);
                                    
client.SendScreen(flow.ToArray(), true);
                                }
                            }
                            break;
                        }
                }
            }
        }
        public static 
uint CreateMyRank(Client.GameState clientout int rank)
        {
            List<
ClientRankFRanks = new List<ClientRank>()
            {
           new 
ClientRank(){Rank = (uint)client.Player.MyFlowers.RankLiliesAmount client.Player.MyFlowers.Lilies}
           ,   new 
ClientRank(){Rank = (uint)client.Player.MyFlowers.RankOrchidsAmount client.Player.MyFlowers.Orchads}
           ,   new 
ClientRank(){Rank = (uint)client.Player.MyFlowers.RankRosesAmount client.Player.MyFlowers.RedRoses}
           ,   new 
ClientRank(){Rank = (uint)client.Player.MyFlowers.RankTuilpsAmount client.Player.MyFlowers.Tulips}
            };
            var array = 
FRanks.Where((f1) => f1.Rank != 0).ToArray();
            Array.
Sort(array, (f1f2) =>
            {
                
int n_rank f1.Rank.CompareTo(f2.Rank);

                if (
f2.Rank == f1.Rank)
                    return 
f2.Amount.CompareTo(f1.Amount);
                return 
n_rank;
            });
            if (array != 
null && array.Length 0)
            {
                
ClientRank BestRank = array[0];
                if (
BestRank.Rank != 0)
                {
                    
rank = (int)BestRank.Rank;
                    if (
client.Player.MyFlowers.RankLilies == BestRank.Rank && client.Player.MyFlowers.Lilies == BestRank.Amount)
                        return (
byte)Game.Features.Flowers.FlowersT.Lilies;
                    if (
client.Player.MyFlowers.RankOrchids == BestRank.Rank && client.Player.MyFlowers.Orchads == BestRank.Amount)
                        return (
byte)Game.Features.Flowers.FlowersT.Orchids;
                    if (
client.Player.MyFlowers.RankRoses == BestRank.Rank && client.Player.MyFlowers.RedRoses == BestRank.Amount)
                        return (
byte)Game.Features.Flowers.FlowersT.Rouse;
                    if (
client.Player.MyFlowers.RankTuilps == BestRank.Rank && client.Player.MyFlowers.Tulips == BestRank.Amount)
                        return (
byte)Game.Features.Flowers.FlowersT.Tulips;
                }
            }
            
rank 0;
            return 
0;
        }
        public static 
uint GetFlowerTyp(uint ID)
        {
            if (
ID >= 751001 && ID <= 751999 || ID >= 755001 && ID <= 755999)
                return (
uint)Game.Features.Flowers.FlowersT.Rouse;
            if (
ID >= 752001 && ID <= 752999 || ID >= 756001 && ID <= 756999)
                return (
uint)Game.Features.Flowers.FlowersT.Lilies;
            if (
ID >= 753001 && ID <= 753999 || ID >= 757001 && ID <= 757999)
                return (
uint)Game.Features.Flowers.FlowersT.Orchids;
            if (
ID >= 754001 && ID <= 754999 || ID >= 758001 && ID <= 758999)
                return (
uint)Game.Features.Flowers.FlowersT.Tulips;
            return 
0;
        }
        public static 
bool IsBoy(uint mesh)
        {
            return 
mesh == 1005 || mesh == 1006;
        }
        public static 
bool IsGirl(uint mesh)
        {
            return 
mesh == 2005 || mesh == 2006;
        }
        public class 
ClientRank
        
{
            public 
uint Rank;
            public 
uint Amount;
        }
    }


الكود دا المسئول عن اللد والبنت لو مش عاوز تغير الكلاس بدلو بالى عندك فى الكلاس
كود PHP:

        public static bool IsBoy(uint mesh)

        {

            return 
mesh == 1005 || mesh == 1006;

        }

        public static 
bool IsGirl(uint mesh)

        {

            return 
mesh == 2005 || mesh == 2006;

        } 

طبعا ده ابجريد ال 3d لو 2d انت اتغيره حسب الابجريد والرقم بتاع البنت والولد
افتح كلاس
SendFlower.cs
بدل بده
كود PHP:

using System.Text;
using code.Game.Features;

namespace 
code.Network.GamePackets
{
    public 
unsafe class SendFlower Writer
    
{
        private 
byte[] Packet;
        public 
SendFlower()
        {
            
Packet = new byte[68];
            
WriteUInt16(600Packet);
            
WriteUInt16(11502Packet);
        }
        public 
uint Typing
        
{
            
get { return BitConverter.ToUInt32(Packet4); }
            
set WriteUInt32(value4Packet); }
        }
        public 
string SenderName
        
{
            
get { return Encoding.ASCII.GetString(Packet1616); }
            
set WriteString(value16Packet); }
        }
        public 
string ReceiverName
        
{
            
get { return Encoding.ASCII.GetString(Packet3216); }
            
set WriteString(value32Packet); }
        }
        public 
uint Amount
        
{
            
get { return BitConverter.ToUInt32(Packet48); }
            
set WriteUInt32(value48Packet); }
        }
        public 
uint FType
        
{
            
get { return BitConverter.ToUInt32(Packet52); }
            
set WriteUInt32(value52Packet); }
        }
        public 
uint Effect
        
{
            
get { return BitConverter.ToUInt32(Packet56); }
            
set WriteUInt32(value56Packet); }
        }
        public 
void Apprend(Flowers flowers)
        {
            
WriteUInt32(flowers.RedRoses16Packet);
            
WriteUInt32(flowers.RedRoses2day20Packet);
            
WriteUInt32(flowers.Lilies24Packet);
            
WriteUInt32(flowers.Lilies2day28Packet);
            
WriteUInt32(flowers.Orchads32Packet);
            
WriteUInt32(flowers.Orchads2day36Packet);
            
WriteUInt32(flowers.Tulips40Packet);
            
WriteUInt32(flowers.Tulips2day44Packet);
        }
        public 
byte[] ToArray()
        {
            return 
Packet;
        }
    }


وصور الرنك اهو
عفواً لايمكن عرض الروابط إلا بعد الرد على الموضوع

ابو حمزه9 2019-07-11 11:23 AM

رد: اضافه رنك الورد
 


جميل :o


ابو حمزه9 2019-07-11 11:27 AM

رد: اضافه رنك الورد
 


جميل :o


Users 2019-07-11 11:33 AM

رد: اضافه رنك الورد
 
الله ينور

MohamedModyAdel 2019-07-11 03:44 PM

رد: اضافه رنك الورد
 
جميل جدا


الساعة الآن 03:53 PM

مرحبا بكم في منتدي اكواد لتطوير الالعاب