عرض مشاركة واحدة
احصائياتى

الردود
37

المشاهدات
16539
 
MohamedModyAdel

MohamedModyAdel is on a distinguished road

    غير متواجد

المشاركات
503

+التقييم
0.23

تاريخ التسجيل
May 2019

الاقامة

نظام التشغيل

رقم العضوية
131
2019-06-11, 01:22 PM
المشاركة 1 
#1  
افتراضي في اي بي ايام دا شغال تمام مش الي علي نت بيظ
سلام عليكم انهاردة جيبلكو في اه بي ايام شغاله تمام
كلاس EntityTable
هتبحث عن

كود:
client.Entity.LoadTopStatus(); 

هتحط تحتها

كود:
client.VIPDays.Load(client); 

وبعدين هتخش علي gamestate او gameclient
هتحط دا في اي مكان

كود:
public VIPDays VIPDays = new VIPDays(); 

هتبحث عن

كود:
private void ShutDown() 

وبعدين لغيت

كود:
Kernel.GamePool.Remove(this.Entity.UID); 

تحتيها دا

كود:
VIPDays.Save(this); 

كلاس packethandle
هتبحث عن

كود:
case 2032

هتنزل تحت
لغيت

كود:
#region Captchas 

هتحط تحتها

كود:
#region VIIPDays.
                            
if (client.ActiveNpc == 780000)
                            {
                                
//Npcs dialog = new Npcs(client);
                                
if (client.Inventory.Contains(client.ActiveNpc1))
                                {
                                    if (
req.OptionID == 1)
                                    {
                                        if (
client.Entity.VIPLevel 3)
                                        {
                                            
dialog.Text("You are VIPLevel " client.Entity.VIPLevel ", So You Can't Unlock This Item.");
                                            
dialog.Option("Sorry."255);
                                            
dialog.Send();
                                        }
                                        else
                                        {
                                            if (
client.Entity.VIPLevel 4)
                                            {
                                                
dialog.Text("Are You Sure You Want To Unlock This Item.");
                                                
dialog.Option("Yes I'M Sure."2);
                                                
dialog.Send();
                                            }
                                        }
                                    }
                                    if (
req.OptionID == 2)
                                        if (
client.Entity.VIPLevel 4)
                                        {
                                            
client.VIPDays.Insert(DateTime.NowDateTime.Now.AddHours(1), 4client.Entity.VIPLevelclient);
                                            
client.Inventory.Remove(client.ActiveNpc1);
                                        }
                                }
                            }
                            
#endregion
                            #region VIIPDays.
                            
if (client.ActiveNpc == 780001)
                            {
                                
//Npcs dialog = new Npcs(client);
                                
if (client.Inventory.Contains(client.ActiveNpc1))
                                {
                                    if (
req.OptionID == 1)
                                    {
                                        if (
client.Entity.VIPLevel 3)
                                        {
                                            
dialog.Text("You are VIPLevel " client.Entity.VIPLevel ", So You Can't Unlock This Item.");
                                            
dialog.Option("Sorry."255);
                                            
dialog.Send();
                                        }
                                        else
                                        {
                                            if (
client.Entity.VIPLevel 4)
                                            {
                                                
dialog.Text("Are You Sure You Want To Unlock This Item.");
                                                
dialog.Option("Yes I'M Sure."2);
                                                
dialog.Send();
                                            }
                                        }
                                    }
                                    if (
req.OptionID == 2)
                                        if (
client.Entity.VIPLevel 4)
                                        {
                                            
client.VIPDays.Insert(DateTime.NowDateTime.Now.AddDays(1), 4client.Entity.VIPLevelclient);
                                            
client.Inventory.Remove(client.ActiveNpc1);
                                        }
                                }
                            }
                            
#endregion
                            #region VIIPDays.
                            
if (client.ActiveNpc == 780010)
                            {
                                
//Npcs dialog = new Npcs(client);
                                
if (client.Inventory.Contains(client.ActiveNpc1))
                                {
                                    if (
req.OptionID == 1)
                                    {
                                        if (
client.Entity.VIPLevel 3)
                                        {
                                            
dialog.Text("You are VIPLevel " client.Entity.VIPLevel ", So You Can't Unlock This Item.");
                                            
dialog.Option("Sorry."255);
                                            
dialog.Send();
                                        }
                                        else
                                        {
                                            if (
client.Entity.VIPLevel 4)
                                            {
                                                
dialog.Text("Are You Sure You Want To Unlock This Item.");
                                                
dialog.Option("Yes I'M Sure."2);
                                                
dialog.Send();
                                            }
                                        }
                                    }
                                    if (
req.OptionID == 2)
                                        if (
client.Entity.VIPLevel 4)
                                        {
                                            
client.VIPDays.Insert(DateTime.NowDateTime.Now.AddDays(7), 4client.Entity.VIPLevelclient);
                                            
client.Inventory.Remove(client.ActiveNpc1);
                                        }
                                }
                            }
                            
#endregion 

وبعدين هتبحث عن

كود:
#region Misc 

هتحط تختها

كود:
#region VIP4Days
                
case 780000:
                    {
                        
Npcs dialog = new Npcs(client);
                        
dialog.Avatar(item.ID);
                        
dialog.Text("Hello " client.Entity.Name ", There is VIPLevel 4 For 1 Hour. If You Want To Get it Just Confirm.");
                        
dialog.Option("Confirm."1);
                        
dialog.Option("Cancel."255);
                        
dialog.Send();
                        
client.ActiveNpc item.ID;
                        break;
                    }
                
#endregion
                #region VIP4Days
                
case 780001:
                    {
                        
Npcs dialog = new Npcs(client);
                        
dialog.Avatar(item.ID);
                        
dialog.Text("Hello " client.Entity.Name ", There is VIPLevel 4 For 1 Day. If You Want To Get it Just Confirm.");
                        
dialog.Option("Confirm."1);
                        
dialog.Option("Cancel."255);
                        
dialog.Send();
                        
client.ActiveNpc item.ID;
                        break;
                    }
                
#endregion
                #region VIP4Days
                
case 780010:
                    {
                        
Npcs dialog = new Npcs(client);
                        
dialog.Avatar(item.ID);
                        
dialog.Text("Hello " client.Entity.Name ", There is VIPLevel 4 For 7 Days. If You Want To Get it Just Confirm.");
                        
dialog.Option("Confirm."1);
                        
dialog.Option("Cancel."255);
                        
dialog.Send();
                        
client.ActiveNpc item.ID;
                        break;
                    }
                
#endregion 

هتعمل كلاس بي الاسم دا VIPDays
هتحط فيه دول

كود:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DarkWay.Database;
namespace 
DarkWay
{
    public class 
VIPDays
    
{
        public 
DateTime StartOnEndOn;
        public 
byte LevelOLDLevel;
        public 
Time32 CheckStamp Time32.Now;
        public 
void Insert(DateTime _StartOnDateTime _EndOnbyte _Levelbyte _OLDLevelClient.GameState client)
        {
            
this.StartOn _StartOn;
            
this.EndOn _EndOn;
            
this.Level _Level;
            
this.OLDLevel _OLDLevel;
            
client.Entity.VIPLevel this.Level;
            
#region Insert
            
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("vipdays").Where("UID"client.Entity.UID))
            
using (var reader = new MySqlReader(cmd))
            {
                if (!
reader.Read())
                    
using (var cmds = new MySqlCommand(MySqlCommandType.INSERT))
                        
cmds.Insert("vipdays").Insert("UID"client.Entity.UID).Execute();
            }
            
#endregion
            
this.Save(client);
            
client.Send("Your VIP, Now level " this.Level " will end in " this.EndOn "");
        }

        public 
void Check(Client.GameState client)
        {
            if (
DateTime.Now >= this.EndOn)
            {
                
client.Entity.VIPLevel this.OLDLevel;
                
this.Level 0;
                
this.OLDLevel 0;
                
this.Delete(client);
                
client.Send("Your VIP, is ended, Now your VIP level is " client.Entity.VIPLevel "");
            }
            
this.CheckStamp Time32.Now;
        }
        public 
void Load(Client.GameState c)
        {
            
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("vipdays").Where("UID"c.Entity.UID))
            
using (var reader = new MySqlReader(cmd))
            {
                if (
reader.Read())
                {
                    
this.Level reader.ReadByte("Level");
                    
this.OLDLevel reader.ReadByte("OLDLevel");
                    
this.StartOn Kernel.FromDateTimeInt(reader.ReadUInt64("StartOn"));
                    
this.EndOn Kernel.FromDateTimeInt(reader.ReadUInt64("EndOn"));
                }
            }
        }
        public 
void Save(Client.GameState client)
        {
            
Database.MySqlCommand cmd = new Database.MySqlCommand(Database.MySqlCommandType.UPDATE);
            
cmd.Update("vipdays").Set("Level"this.Level).Set("OLDLevel"this.OLDLevel).Set("StartOn"Kernel.ToDateTimeInt(this.StartOn)).Set("EndOn"Kernel.ToDateTimeInt(this.EndOn))
            .
Where("UID"client.Entity.UID).Execute();
        }
        public 
void Delete(Client.GameState client)
        {
            
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE);
            
cmd.Delete("vipdays""UID"client.Entity.UID).Execute();
        }

    }


هتخش علي كلاس world
هتبحث عن

كود:
private void CharactersCallback 

هتحط تحتها دا

كود:
#region VIPDays
            
if (client.VIPDays.Level && Time32.Now >= client.VIPDays.CheckStamp.AddSeconds(2))
            {

                
client.VIPDays.Check(client);
            }
            
#endregion 

الي هيطلعه ارور
خش علي كلاس
gamestate
ابحث عن دا

كود:
public DateTime LastVote

هتلقي تحتها

كود:
public uint VIPDays

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