Register for your free account! | Forgot your password?

You last visited: Today at 05:34

  • Please register to post and access all features, it's quick, easy and FREE!

 

[Release]Expball-limit peer day

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 132
Received Thanks: 64
[Release]Expball-limit peer day

ok
here i show you how you can add a axpball limit peer day

add in Character.cs
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:
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:
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
Code:
        public void SaveExpball()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveExpball(this);
        }
now search for you wellcomemess and add before:
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:
Code:
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)); }
        }
Now,search for:
Charr.RealModel = Charr.Model;
and add before
Code:
Charr.expballend2 = (string)DR["expballend"];
                    Charr.expball = (byte)DR["expball"];
Last part,add this into your Character table in database :
Code:
Field: expballend
Type : VARCHAR
Lenght : 32
null : not null
and
Code:
Field: expball
Type : TINYINT
Lenght : 10
Attribute : UNSIGNED
null : not null
Default : 0
thatīs all



koio is offline  
Thanks
11 Users
Old   #2
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Even thought i`ll never use this code, very nice! Congratulation.


alexbigfoot is offline  
Thanks
1 User
Old   #3
 
elite*gold: 0
Join Date: Sep 2007
Posts: 370
Received Thanks: 115
Great realse, 100% working im testing good job GZ
mejo33 is offline  
Thanks
1 User
Old   #4
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 490
+K teaches me more about timers to help others with some things

great release also


PeTe Ninja is offline  
Thanks
1 User
Old   #5
 
elite*gold: 20
Join Date: Mar 2008
Posts: 958
Received Thanks: 494
Very good , i will use it Thanks
danielachraf is offline  
Thanks
1 User
Old   #6
 
elite*gold: 0
Join Date: May 2008
Posts: 80
Received Thanks: 25
Quote:
Originally Posted by koio View Post
ok
here i show you how you can add a axpball limit peer day

add in Character.cs
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:
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:
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
Code:
        public void SaveExpball()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveExpball(this);
        }
now search for you wellcomemess and add before:
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:
Code:
public static void SaveHB(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)); }
        }
Now,search for:
Charr.RealModel = Charr.Model;
and add before
Code:
Charr.expballend2 = (string)DR["expballend"];
                    Charr.expball = (byte)DR["expball"];
Last part,add this into your Character table in database :
Code:
Field: expballend
Type : VARCHAR
Lenght : 32
null : not null
and
Code:
Field: expball
Type : TINYINT
Lenght : 10
Attribute : UNSIGNED
null : not null
Default : 0
thatīs all

Heres a question would lottery be about the same? Adding a 10 limit to it? I mean a few things go but basic idea.
spade12 is offline  
Thanks
1 User
Old   #7
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
uhm...yeah.
alexbigfoot is offline  
Thanks
1 User
Old   #8
 
elite*gold: 0
Join Date: Mar 2009
Posts: 510
Received Thanks: 104
nice release!! even though i dont copy and paste codes i will use this as a referal for when im going to code it in my own server.. thx!
AndreaCo is offline  
Thanks
1 User
Old   #9
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 490
Quote:
Originally Posted by spade12 View Post
Heres a question would lottery be about the same? Adding a 10 limit to it? I mean a few things go but basic idea.
yeah i was going to make one and release but i thought since this is like a quick guide anyone can do it ... also why you quoted the whole thing lol :d
PeTe Ninja is offline  
Old   #10
 
elite*gold: 0
Join Date: May 2008
Posts: 80
Received Thanks: 25
Quote:
Originally Posted by PeTe Ninja View Post
yeah i was going to make one and release but i thought since this is like a quick guide anyone can do it ... also why you quoted the whole thing lol :d
I dont know lol just felt like it. I was just making sure because I was going about the entire lotto limit differently. I wasn't using SQL to limit it I was doing it server sided, BUT SQL would be MUCH less time consuming and YES I have to capitalize every word or so its what make this FUN.

Thanks Though
spade12 is offline  
Thanks
1 User
Old   #11
 
elite*gold: 0
Join Date: Aug 2008
Posts: 275
Received Thanks: 23
nice release even tho i like spamming xp ***** xD
superplox is offline  
Old   #12
 
elite*gold: 0
Join Date: Jun 2008
Posts: 20
Received Thanks: 0
hey how where can i find welcommess?
vladrage08 is offline  
Old   #13
 
elite*gold: 0
Join Date: Jun 2008
Posts: 80
Received Thanks: 7
Quote:
Originally Posted by vladrage08 View Post
hey how where can i find welcommess?
Same question...
ZkiNeF is offline  
Old   #14
 
elite*gold: 0
Join Date: May 2008
Posts: 103
Received Thanks: 3
what this **** this code by ~Yuki~ and link here
m7med is offline  
Old   #15
 
elite*gold: 0
Join Date: Jul 2009
Posts: 548
Received Thanks: 52
Quote:
Originally Posted by m7med View Post
what this **** this code by ~Yuki~ and link here
no... lol he probably copied it from here ><


f0am is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
[Release]Nearly Perfect Expball Calculations
I went and tested these calculations for expballs for the 5165 source. I'll release them here. Keep in mind that these are not perfect. They are...
30 Replies - CO2 PServer Guides & Releases
[Release] ExpBall Max use (CoEmu v2)
Hya!! Maybe this will be a stupid thing but here we go! first add this at character.cs: public bool ExpUsed = false; public int ExpBallN = 0;...
5 Replies - CO2 PServer Guides & Releases
[Release]ExpBall+ExpPot Experience Gain Fix[LOTF]
Ok... Well this isn't really anything too spectacular, but I know I myself got extremely annoyed at the fact that when I used an ExpBall while using...
8 Replies - CO2 PServer Guides & Releases
[Release]CoEmuV2 EXPBall code
This is converted from LOTF, but meh, here it goes. 1) Open your UseItem.cs 2) Add this code under one of the cases :
28 Replies - CO2 PServer Guides & Releases



All times are GMT +2. The time now is 05:34.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.