|
المشاركات 127 |
+التقييم 0.07 |
تاريخ التسجيل Jul 2019 |
الاقامة |
نظام التشغيل |
رقم العضوية 407 |
using Extreme.Game;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ResidentEvil.Network.GamePackets;
using System.Threading;
using System.Threading.Generic;
using ResidentEvil.Network.Sockets;
using ResidentEvil.Game.ConquerStructures;
using ResidentEvil.Game.ConquerStructures.Society;
using ResidentEvil.Client;
using System.Drawing;
using ResidentEvil.Game.Events;
using ResidentEvil.Database;
using System.Data.SqlClient;
using System.Configuration;
namespace ResidentEvil
{
public class NobilityTimer
{
public DateTime StartOn, EndOn;
public ulong OldDonation;
public byte Donation;
public Time32 CheckStamp = Time32.Now;
public void Insert(DateTime _StartOn, DateTime _EndOn, byte _Donation, ulong _OldDonation, Client.GameState client)
{
this.StartOn = _StartOn;
this.EndOn = _EndOn;
this.Donation = _Donation;
this.OldDonation = _OldDonation;
client.NobilityInformation.Donation = this.OldDonation;
#region Insert
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("nobilitytimer").Where("UID", client.Entity.UID))
using (var reader = new MySqlReader(cmd))
{
if (!reader.Read())
using (var cmds = new MySqlCommand(MySqlCommandType.INSERT))
cmds.Insert("nobilitytimer").Insert("UID", client.Entity.UID).Execute();
}
#endregion
this.Save(client);
client.Send("Your Rank Will End In " + this.EndOn + "");
}
public void Load(Client.GameState c)
{
using (var cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("nobilitytimer").Where("UID", c.Entity.UID))
using (var reader = new MySqlReader(cmd))
{
if (reader.Read())
{
this.Donation = reader.ReadByte("Number");
this.OldDonation = reader.ReadByte("OldDonation");
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("nobilitytimer").Set("Number", this.Donation).Set("OldDonation", this.OldDonation).Set("StartOn", Kernel.ToDateTimeInt(this.StartOn)).Set("EndOn", Kernel.ToDateTimeInt(this.EndOn))
.Where("UID", client.Entity.UID).Execute();
}
}
}
GameState or GameClient
public NobilityTimer NobilityTimer = new NobilityTimer();
void ShutDown()
Database.EntityTable.SaveEntity(this, conn);
NobilityTimer.Save(this);
EntityTable
client.Entity.FullyLoaded = true;
client.NobilityTimer.Load(client);
Nobility
case NobilityInfo.Donate:
if (client.NobilityTimer.Donation == 1 || client.NobilityTimer.Donation == 2 || client.NobilityTimer.Donation == 3)
{
client.MessageBox("Sorry U Can't Donate Now.", null, null, 60);
return;
}
void DoLogin
client.NobilityTimer.Load(client);
void CharactersCallback
#region NobilityTimer Check
if (client.NobilityTimer.Donation > 0 && DateTime.Now >= client.NobilityTimer.EndOn)
{
client.NobilityInformation.Donation = client.NobilityTimer.OldDonation;
Game.ConquerStructures.Nobility.Sort(client.Entity.UID);
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
client.NobilityTimer.Save(client);
client.Send("Your Rank, Is Ended, Now Your Rank is Back.");
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE);
cmd.Delete("nobilitytimer", "UID", client.Entity.UID).Execute();
client.NobilityTimer.Donation = 0;
}
#endregion
#region DonationTime
case 38213:
{
switch (npcRequest.OptionID)
{
case 0:
{
dialog.Text("Hey there " + client.Entity.Name + ", I'm Here to Up Ur Rank 7 Days For Cps.");
dialog.Option("Up Me To King/Queen", 1);
dialog.Option("Up Me To Prince/Princess.", 2);
dialog.Option("Up Me To Duke/Duchess.", 3);
dialog.Option("No Thanks.", 255);
dialog.Avatar(50);
dialog.Send();
break;
}
case 1:
{
dialog.Text("I'll Up U To King/Queen to 7 Days For 200.000 Cps.");
dialog.Option("Ok, Up Me.", 4);
dialog.Option("No Thanks.", 255);
dialog.Avatar(50);
dialog.Send();
break;
}
case 2:
{
dialog.Text("I'll Up U To Prince/Princess to 7 Days For 100.000 Cps.");
dialog.Option("Ok, Up Me.", 5);
dialog.Option("No Thanks.", 255);
dialog.Avatar(50);
dialog.Send();
break;
}
case 3:
{
dialog.Text("I'll Up U To Duke/Duchess to 7 to Days 50.000 Cps.");
dialog.Option("Ok, Up Me.", 6);
dialog.Option("No Thanks.", 255);
dialog.Avatar(50);
dialog.Send();
break;
}
case 4:
{
if (DateTime.Now >= client.NobilityTimer.EndOn)
{
if (client.Entity.ConquerPoints >= 200000)
{
client.Entity.ConquerPoints -= 200000;
client.NobilityTimer.Insert(DateTime.Now, DateTime.Now.AddDays(7), 1, client.NobilityInformation.Donation, client);
client.NobilityTimer.Save(client);
client.NobilityInformation.Donation = 1;
Kernel.SendWorldMessage(new Message("Congratulation! " + client.Entity.Name + " Has been King/Queen For 7 Days. ", Color.Red, Message.Center));
Game.ConquerStructures.Nobility.Sort(client.Entity.UID);
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
}
else
{
dialog.Text("Please come back to me with 200.000 Conquer Points.");
dialog.Option("Ahh sorry.", 255);
dialog.Avatar(50);
dialog.Send();
}
}
else
{
dialog.Text("U Already do it.");
dialog.Option("Ahh sorry.", 255);
dialog.Avatar(50);
dialog.Send();
}
break;
}
case 5:
{
if (DateTime.Now >= client.NobilityTimer.EndOn)
{
if (client.Entity.ConquerPoints >= 100000)
{
client.Entity.ConquerPoints -= 100000;
client.NobilityTimer.Insert(DateTime.Now, DateTime.Now.AddDays(7), 2, client.NobilityInformation.Donation, client);
client.NobilityTimer.Save(client);
client.NobilityInformation.Donation = 2;
Kernel.SendWorldMessage(new Message("Congratulation! " + client.Entity.Name + " Has been Prince/Princess For 7 Days. ", Color.Red, Message.Center));
Game.ConquerStructures.Nobility.Sort(client.Entity.UID);
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
}
else
{
dialog.Text("Please come back to me with 100.000 Conquer Points.");
dialog.Option("Ahh sorry.", 255);
dialog.Avatar(50);
dialog.Send();
}
}
else
{
dialog.Text("U Already do it.");
dialog.Option("Ahh sorry.", 255);
dialog.Avatar(50);
dialog.Send();
}
break;
}
case 6:
{
if (DateTime.Now >= client.NobilityTimer.EndOn)
{
if (client.Entity.ConquerPoints >= 50000)
{
client.Entity.ConquerPoints -= 50000;
client.NobilityTimer.Insert(DateTime.Now, DateTime.Now.AddDays(7), 3, client.NobilityInformation.Donation, client);
client.NobilityTimer.Save(client);
client.NobilityInformation.Donation = 3;
Kernel.SendWorldMessage(new Message("Congratulation! " + client.Entity.Name + " Has been Duke/Duchess For 7 Days. ", Color.Red, Message.Center));
Game.ConquerStructures.Nobility.Sort(client.Entity.UID);
Database.NobilityTable.UpdateNobilityInformation(client.NobilityInformation);
}
else
{
dialog.Text("Please come back to me with 50.000 Conquer Points.");
dialog.Option("Ahh sorry.", 255);
dialog.Avatar(50);
dialog.Send();
}
}
else
{
dialog.Text("U Already do it.");
dialog.Option("Ahh sorry.", 255);
dialog.Avatar(50);
dialog.Send();
}
break;
}
}
break;
}
#endregion
nobility
if (Place >= 51)
if (entry.Donation == 1)
{
Rank = NobilityRank.King;
}
if (entry.Donation == 2)
{
Rank = NobilityRank.Prince;
}
if (entry.Donation == 3)
{
Rank = NobilityRank.Duke;
}
DateTime.Now.AddDays(7),
nobility
if (Place >= 51)
if (entry.Donation == 1)
{
Rank = NobilityRank.King;
}
if (entry.Donation == 2)
{
Rank = NobilityRank.Prince;
}
if (entry.Donation == 3)
{
Rank = NobilityRank.Duke;
}
الذين يشاهدون محتوى الموضوع الآن : 5 ( الأعضاء 0 والزوار 5) | |
|
الموضوع | كاتب الموضوع | المنتدى | مشاركات | آخر مشاركة |
اعمل سجن بدون خروج وكمان بوقت انت الى بتحددو ورسالة | محمد ياسر | تطوير سيرفرات كونكر | 4 | 2023-07-27 12:41 AM |
مشكله في DonationTime الدونشين بوقت | Tyranny-Team's | مشكلات السيرفيرات كونكر الشخصيه | 9 | 2020-04-19 07:43 AM |
كيفية اعطاء باند بوقت | محمد ياسر | تطوير سيرفرات كونكر | 2 | 2020-04-17 04:14 AM |
اضافه استف بوقت | Tyranny-Team's | مشكلات السيرفيرات كونكر الشخصيه | 2 | 2020-04-05 06:21 PM |