add in Character.cs
PHP Code:
// ExpBall-limit
public uint expball = 0;
public DateTime expballend;
public string expballend2 = "";
then search for: else if (ItemParts[0] == "723700")
and replace this item with:
PHP Code:
else if (ItemParts[0] == "723700")
{
if (expball < 10)
{
expball++;
expballend = DateTime.Now.AddDays(1);
SaveExpball();
if (Level < 100)
AddExp((ulong)(1295000 + Level * 50000), false);
else if (Level < 110)
AddExp((ulong)(1395000 + Level * 80000), false);
else if (Level < 115)
AddExp((ulong)(1595000 + Level * 100000), false);
else if (Level < 120)
AddExp((ulong)(1895000 + Level * 120000), false);
else if (Level < 125)
AddExp((ulong)(2095000 + Level * 150000), false);
else if (Level < 130)
AddExp((ulong)(2395000 + Level * 180000), false);
else if (Level < 135)
AddExp((ulong)(2895000 + Level * 200000), false);
RemoveItem(ItemUID);
}
else
{
MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You used allready 10 used ExpBalls", 2005));
}
}
search for : if (DateTime.Now > GotBlueName.AddMilliseconds(35000))
and an before:
PHP Code:
if (DateTime.Now >= expballend)
{
expballend2 = "";
expball = 0;
SaveExpball();
MyClient.SendPacket(General.MyPackets.Vital(UID, 18, 0));
MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat()));
World.UpdateSpawn(this);
}
then search for: public void Save()
and add before
PHP Code:
public void SaveExpball()
{
if (MyClient.There)
if (MyClient.Online)
DataBase.SaveExpball(this);
}
now search for you wellcomemess and add before:
PHP Code:
if (MyChar.expball > 0)
{
MyChar.expballend = DateTime.Parse(MyChar.expballend2);
SendPacket(General.MyPackets.String(MyChar.UID, 10, "zf2-e128"));
SendPacket(General.MyPackets.Vital(MyChar.UID, 26, MyChar.GetStat()));
World.UpdateSpawn(MyChar);
}
search for: public static void SaveChar(Character Charr)
and add befor:
HTML Code:
[PHP]public static void Expball(Character Charr)
{
try
{
MySqlCommand Command = null;
Command = new MySqlCommand("UPDATE `Characters` SET `expballend` = '" + Charr.expballend.ToString() + "',`expball` = '" + Charr.expball + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}[/PHP]
Now,search for:
Charr.RealModel = Charr.Model;
and add before
PHP Code:
Charr.expballend2 = (string)DR["expballend"];
Charr.expball = (byte)DR["expball"];
Last part,add this into your Character table in database :
Code:
PHP Code:
Field: expballend
Type : VARCHAR
Lenght : 32
null : not null
and
Code:
PHP Code:
Field: expball
Type : TINYINT
Lenght : 10
Attribute : UNSIGNED
null : not null
Default : 0
thatīs all