منتدي اكواد

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

محمد ياسر 2019-09-14 05:11 PM

فكره HeroesPoints
 



السلام عليكم ورحمة الله وبركاته
الفكره ده سهله جدا جدا جدا مفيش اسهل منه
انك لما تموت وحش يديلك نقاط تتخزن وتبدله من الانبي سي حاجه سهله:D

npc.cs
كود PHP:

#region HeroesPoints
                
case 505467:
                    {
                        
//uint CpsCount = 8000000;
                        //uint CpsPrize = 360;
                        ///////////////////////////
                        
string item1Name "GoldPrize";//Item Name
                        
uint item1ID 2100075;//Item ID....
                        
uint item1Price 800000;//HeroesPoints needed to get the item.
                        ///////////////////////////
                        
string item2Name "SilverPrize";//Item Name
                        
uint item2ID 2100065;//Item ID....
                        
uint item2Price 500000;//HeroesPoints needed to get the item.
                        ///////////////////////////
                        
string item3Name "BronzePrize";//Item Name
                        
uint item3ID 2100055;//Item ID....
                        
uint item3Price 400000;//HeroesPoints needed to get the item.
                        ///////////////////////////
                        
string item4Name "VIP 6";//Item Name
                        //uint item4ID = 728956;//Item ID....
                        
uint item4Price 800000;//HeroesPoints needed to get the item.
                        ///////////////////////////
                        
switch (npcRequest.OptionID)
                        {
                            case 
0:
                                {


                                    
dialog.Text("All heroes can talk to me to learn about my new items, this items for HeroesPoints only, ");
                                    
dialog.Text("Your HeroesPoints Count is : " client.Entity.HeroesPoints " .");
                                    
dialog.Option("About Heroes Points"1);
                                    
dialog.Option("" item1Name " (" item1Price " Points)."2);
                                    
dialog.Option("" item2Name " (" item2Price " Points)."3);
                                    
dialog.Option("" item3Name " (" item3Price " Points)."4);
                                    
dialog.Option("" item4Name " (" item4Price " Points) ."5);
                                    
dialog.Option("No Thanks"255);
                                    
dialog.Send();
                                    break;
                                }
                            case 
1:
                                {
                                    
dialog.Text("This is new system , Each 1 monster you killing it , will get 1 HeroesPoints directly , you can exchange these Points to prizes");
                                    
dialog.Option("Thanks!"255);
                                    
dialog.Avatar(50);
                                    
dialog.Send();
                                    break;
                                }
                            case 
2:
                                {
                                    if (
client.Entity.HeroesPoints >= item1Price)
                                    {
                                        
client.Entity.HeroesPoints -= item1Price;
                                        
client.Inventory.Add(item1ID01);
                                        
_String str = new _String(true);
                                        
str.UID client.Entity.UID;
                                        
str.Type _String.Effect;
                                        
str.Texts.Add("accession2");
                                        
str.TextsCount 1;
                                        
client.Entity.SendScreen(str);
                                        
dialog.Text("You got " item1Name ", your Points now are : " client.Entity.HeroesPoints ".");
                                        
dialog.Option("Thanks Alot!"255);
                                        
dialog.Avatar(50);
                                        
dialog.Send();

                                    }
                                    break;
                                }
                            case 
3:
                                {
                                    if (
client.Entity.HeroesPoints >= item2Price)
                                    {
                                        
client.Entity.HeroesPoints -= item2Price;
                                        
client.Inventory.Add(item2ID01);
                                        
_String str = new _String(true);
                                        
str.UID client.Entity.UID;
                                        
str.Type _String.Effect;
                                        
str.Texts.Add("accession4");
                                        
str.TextsCount 1;
                                        
client.Entity.SendScreen(str);
                                        
dialog.Text("You got " item2Name ", your Points now are : " client.Entity.HeroesPoints ".");
                                        
dialog.Option("Thanks Alot!"255);
                                        
dialog.Avatar(50);
                                        
dialog.Send();

                                    }
                                    break;
                                }
                            case 
4:
                                {
                                    if (
client.Entity.HeroesPoints >= item3Price)
                                    {
                                        
client.Entity.HeroesPoints -= item3Price;
                                        
client.Inventory.Add(item3ID01);
                                        
_String str = new _String(true);
                                        
str.UID client.Entity.UID;
                                        
str.Type _String.Effect;
                                        
str.Texts.Add("accession5");
                                        
str.TextsCount 1;
                                        
client.Entity.SendScreen(str);
                                        
dialog.Text("You got " item3Name ", your Points now are : " client.Entity.HeroesPoints ".");
                                        
dialog.Option("Thanks Alot!"255);
                                        
dialog.Avatar(50);
                                        
dialog.Send();

                                    }
                                    break;
                                }
                            case 
5:
                                {
                                    if (
client.Entity.HeroesPoints >= item4Price)
                                    {
                                        
//client.Entity.VIPLevel = 6;
                                        
VipTable.SavePlayer(client630);
                                        
client.Entity.Update(Network.GamePackets.Update.VIPLevel6false);
                                        
Network.GamePackets.VipStatus vip = new Network.GamePackets.VipStatus();
                                        
client.Send(vip.ToArray());
                                        
_String str = new _String(true);
                                        
str.UID client.Entity.UID;
                                        
str.Type _String.Effect;
                                        
str.Texts.Add("accession6");
                                        
str.TextsCount 1;
                                        
client.Entity.SendScreen(str);
                                        
dialog.Text("You got " item4Name " For 30 days, your Points now are : " client.Entity.HeroesPoints ".");
                                        
dialog.Option("Thanks Alot!"255);
                                        
dialog.Avatar(50);
                                        
dialog.Send();

                                    }

                                    break;
                                }
                        }
                        break;
                    }
                
#endregion 

افتح EntityTable.cs ابحث عن
كود PHP:

public static bool LoadEntity 


ضيف دة
كود PHP:

client.Entity.HeroesPoints reader.ReadUInt32("HeroesPoints"); 

في نفس الملف ابحث
كود PHP:

public static bool SaveEntity 

ضيف دة
كود PHP:

.Set("HeroesPoints"e.HeroesPoints

نبحث عن
كود PHP:

public void Drop 

ضيف دة مكان الي موجود
كود PHP:

#region HeroesPoints
            
if (Name == "TompBat")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "RedDevilL117")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "RedDevilL118")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "HawKing")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "HawkL93")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "WingedSnake")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "Pheasant")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            if (
Name == "Birdman")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());


                    
///  return;
                
}
            }

            if (
Name == "Bandit")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }

            if (
Name == "Macaque")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }

            if (
Name == "TombBat")
            {
                {
                    
killer.HeroesPoints += 1;
                    
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray());
                    
///  return;
                
}
            }
            
#endregion 

او عشان اسهل عليك تضيف لي اي وحش عندك الكودين دول
كود PHP:

killer.HeroesPoints += 1
killer.Owner.Send(new Message(string.Concat(new object[] { "You Received 1 HeroesPoint , For Kill "this.Name }), System.Drawing.Color.Red0x7dc).ToArray()); 



افتح Entity ضيف دة :
كود PHP:

public uint HeroesPoints

شغل النافي كات بقا :
نروح علي Entities دوس كليك امين بعدين DseginTable ضيف صف باسم
HeroesPoints bigint 20

بس كده حاجه سهله جدا






ALz3em 2019-09-14 05:41 PM

رد: فكره HeroesPoints
 
عاش تسلم

ابو حمزه9 2019-09-14 07:23 PM

رد: فكره HeroesPoints
 
اية ياعم حازم كنت مخبي
الحجات الحلوة دي فين


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

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