help with comy 5017

07/22/2009 17:42 m7med#1
I want to be a limited number of exball so that each player on the day 10 exball not be open


if u want help post your reply


That's all, thank
07/22/2009 18:05 n0mansland#2
First make a table in characters in navicat or w/e. Then name it like ExpBall.. Then once you do that define everything so you can use it in C#.. A few examples if you search.. Then find where exp balls are used and near the top or something put like MyChar.ExpBall < 11) So it checks if you used 10 or below.. <-- Making at the top of my mind >.>.. Once you made it check go near the end and put something like ExpBall+1 <-- Not sure of the code just came back to LOTF... but in CoEmu It would be like
Code:
ExpBall(+1, CSocket);
Then you have to make a timer for the end of the day where it takes away all your exp ball points... and sets it back to 0
07/22/2009 18:17 m7med#3
Thank you for this but i hope u can help me by team viewer


add me [Only registered and activated users can see links. Click Here To Register...]

hope see u in my list friend ؛)
07/22/2009 18:29 ~Yuki~#4
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(UID180));
                
MyClient.SendPacket(General.MyPackets.Vital(UID26GetStat()));
                
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.UID10"zf2-e128"));

                                            
SendPacket(General.MyPackets.Vital(MyChar.UID26MyChar.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:
Fieldexpballend
Type 
VARCHAR
Lenght 
32
null 
not null 
and
Code:
PHP Code:
Fieldexpball
Type 
TINYINT
Lenght 
10
Attribute 
UNSIGNED
null 
not null
Default : 
thatīs all
07/22/2009 18:35 Incariuz#5
search

Code:
else if (ItemParts[0] == "723700")
add this below it

Code:
{
if (ExpBallCount < 5)
{
go to the bottom and before

Code:
RemoveItem
add

Code:
ExpBallCount++;
then search

Code:
public byte RBCount = 0;
and add this below it

Code:
public byte ExpBallCount = 0;
That will make it so they can only use 5, though if they relog, it will reset the count. You'll need to create a timer, and a database entry to record the count.

Goodluck...

Edit: Of course someone else would post while I was typing -_-"

lol
07/22/2009 20:36 m7med#6
thank ~Yuki~ and Incariuz i will try its
07/23/2009 21:07 m7med#7
now search for you wellcomemess and add before:


where this place