Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 01:51

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

Advertisement



Cps Save // Why my code don't work?

Discussion on Cps Save // Why my code don't work? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Mar 2008
Posts: 27
Received Thanks: 16
Question Cps Save // Why my code don't work?

Hello, I have some questions, I know that this forum has many people who can help, I hope the same please help me.

-----------------------------------------------------------------------

Q.1.: That's work for CoEmu? Because here don't work:
PS: This code is in database.cs above it has: public static class Database {
Code:
        public static void SaveConquerPoints(Character Client)
        {
            MySqlCommand Command = new MySqlCommand("UPDATE `characters` SET `CPoint` = " + Client.CPs + " WHERE `CharID` = " + Client.ID, DatabaseConnection.NewConnection());
            Command.ExecuteNonQuery();
            Command.Connection.Close();
            Command.Connection.Dispose();
        }
-----------------------------------------------------------------------

Q.2.:Okay, this code will certainly seem ridiculous, but I can say, "I tried!" In several ways, but here I am asking for help.
All help is welcome:
PS: This code is in useitem.cs above it has: case 1002040://Stancher{

Code:
case 723583:
                    {
                        if (CSocket.Client.Model == 11004)
                        {
                            int Model = 11004;
                            Model -= 1;
                        }
                        if (CSocket.Client.Model == 11003)
                        {
                            int Model = 11003;
                            Model += 1;
                        }
                        break;
                    }
I tried this too:
Code:
                        if (CSocket.Client.Model == 11003)
                        {
                            CSocket.Client.Model == 11004;
                        }
-----------------------------------------------------------------------

Q.3.:Realloter NPC ... This code was for LOFT, but I want to put CoEmu.
MyChar there, in place of what should I use?
Sample:
Code:
MyChar.Str = 0;
Here's SendPacket and MyChar:
Code:
SendPacket(General.MyPackets.Vital((long)MyChar.UID, 16, MyChar.Str));
Currently my code is like this:
Code:
case 350050:
                    {
                        if (LinkBack == 0){
                            Text("*Reborn level 70+ players can redistribute their attribute points at the cost of a dragonball.", CSocket);
                            Link("I will reallot my points.", 1, CSocket);
                            Link("let me think it over.", 255, CSocket);
                        if (LinkBack == 1)
                                {
                                    if (CSocket.Client.Reborn >= 1)
                                    {
                                        if (CSocket.Client.Inventory.ContainsKey(1088000))
                                        {
                                            CSocket.Client.Inventory.Remove(1088000);

                                            uint Points = 0;

                                            Points += CSocket.Client.Str;
                                            Points += CSocket.Client.Spi;
                                            Points += CSocket.Client.Agi;
                                            Points += CSocket.Client.vit;

                                            CSocket.Client.StatPoints += (ushort)Points;

                                            MyChar.Str = 0;
                                            MyChar.Spi = 0;
                                            MyChar.Agi = 0;
                                            MyChar.Vit = 0;

                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 16, MyChar.Str));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 17, MyChar.Agi));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 15, MyChar.Vit));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 14, MyChar.Spi));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 5, (ulong)MyChar.Exp));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 2, MyChar.MaxMana()));
                                            SendPacket(General.MyPackets.GeneralData((long)MyChar.UID, 0, 0, 0, 92));
                                            SendPacket(General.MyPackets.Vital((long)MyChar.UID, 0, MyChar.CurHP));
                                            SendPacket(General.MyPackets.Vital(MyChar.UID, 11, MyChar.StatP));

                                            MyChar.SaveStatPoints();
                                            MyChar.Save();
                                            SendPacket(General.MyPackets.NPCSay("You cannot reallot your stats manually, Please use the /allot command."));
                                            SendPacket(General.MyPackets.NPCSay(" Command Breakdown: /allot [vit, str, agi, spi] [Amount to ADD to the Stat]"));
                                            SendPacket(General.MyPackets.NPCLink("I see, Thanks.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                        else
                                        {
                                            SendPacket(General.MyPackets.NPCSay("You don't have a Dragonball."));
                                            SendPacket(General.MyPackets.NPCLink("I see.", 255));
                                            SendPacket(General.MyPackets.NPCSetFace(30));
                                            SendPacket(General.MyPackets.NPCFinish());
                                        }
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("You cannot reallot your attribute points if you aren't reborn."));
                                        SendPacket(General.MyPackets.NPCLink("I see.", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());
                                    }
                                }
                            }
                        break;
                    }
PS: This code is in npctalk.cs

-----------------------------------------------------------------------

I hope to get help here, and sorry for my English, thanks;
leandrorocha is offline  
Old 08/08/2009, 17:57   #2
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
lol.... only put this at SaveCharacter

Code:
        public static void SaveCharacter(Character Client)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `Level` = " + Client.Level + ", `WHMoney` = " + Client.WHMoney + ", `PkPoints` = " + Client.PkPoints + ", `xCord` = " + Client.X + ", `yCord` = " + Client.Y + ", `Map` = " + (int)Client.Map + ", `HairStyle` = " + Client.Hair + ", `Class` = " + (int)Client.Class + ", `Exp` = " + Client.Exp + ", `Money` = " + Client.Money + ", `CPoints` = " + Client.CPs + ", `Str` = " + Client.Strength + ",`Vit` = " + Client.Vitality + ", `Spi` = " + Client.Spirit + ", `Dex` = " + Client.Dexterity + ", `StatPoints` = " + Client.StatPoints + ", `FirstLog` = " + 1 + ", `Reborn` = " + Client.Reborn + ", `HP` = " + Client.CurrentHP + ", `MP` = " + Client.CurrentMP + " WHERE `CharID` = " + Client.ID, DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
EDIT:
Fixed realloter NPC... and works!!


NpcTalk.cs:
Code:
                    case 350050:// Reallot Stats
                    {
                        if (LinkBack == 0)
                        {
                            Text("Reborn players who are level 70 or higher can redistribute their attribute points at the cost of a Dragonball.", CSocket);
                            Link("I will reallot my points.", 1, CSocket);
                            Link("Let me think it over.", 225, CSocket);
                            End(CSocket);

                        }
                        else if (LinkBack == 1)
                        {
                            if (CSocket.Client.Level >= 70)
                            {
                                if (CSocket.Client.Reborn >= 1)
                                {
                                    int uid = 0;
                                    bool cont = false;

                                    foreach (Struct.ItemInfo Item in CSocket.Client.Inventory.Values)
                                    {
                                        if (Item.ItemID == 1088000)
                                        {
                                            uid = Item.UID;
                                            cont = true;
                                            break;
                                        }
                                    }

                                    if (cont)
                                    {
                                        CSocket.Client.Inventory.Remove(uid);
                                        CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                        Database.Database.DeleteItem(uid);
                                        while (!CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem)))
                                        {
                                            CSocket.Client.Inventory.Remove(uid);
                                            CSocket.Send(ConquerPacket.ItemUsage(uid, 255, Struct.ItemUsage.RemoveItem));
                                            Database.Database.DeleteItem(uid);
                                        }

                                        CSocket.Client.StatPoints += CSocket.Client.Strength;
                                        CSocket.Client.StatPoints += CSocket.Client.Spirit;
                                        CSocket.Client.StatPoints += CSocket.Client.Dexterity;
                                        CSocket.Client.StatPoints += CSocket.Client.Vitality;

                                        CSocket.Client.Strength = 0;
                                        CSocket.Client.Dexterity = 0;
                                        CSocket.Client.Vitality = 0;
                                        CSocket.Client.Spirit = 0;

                                        CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Dexterity, Struct.StatusTypes.DexterityStatPoints));
                                        CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Spirit, Struct.StatusTypes.ManaStatPoints));
                                        CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Vitality, Struct.StatusTypes.VitalityStatPoints));
                                        CSocket.Send(ConquerPacket.Status(CSocket, 2, CSocket.Client.Strength, Struct.StatusTypes.StrengthStatPoints));
CSocket.Disconnect();
                                    }
                                    else
                                    {
                                        Text("You do not have a DragonBall.", CSocket);
                                        Link("I see.", 225, CSocket);
                                        End(CSocket);
                                    }
                                }
                                else
                                {
                                    Text("You cannot reallot your attribute points if you aren't reborn.", CSocket);
                                    Link("I see.", 225, CSocket);
                                    End(CSocket);
                                }
                            }
                            else
                            {
                                Text("You do not have the level.", CSocket);
                                Link("I see.", 225, CSocket);
                                End(CSocket);
                            }
                        }
                        break;
                    }
12tails is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
Need Auto Save Code for 5165
09/11/2010 - CO2 Private Server - 29 Replies
hi, my source don't save the caracters actions some times ex: i was lvl 120 and i had 2000cps i was in TC , i level up to 200 and i get 5kkcps and i go to BI i relog and i find my character lvl 120 with 2000cps in TC a friend told me you have to make auto save code to save each 2min or 2sec whatever but i don't know what's this code and where i put it
CODE : Save Ragnarok :)
04/29/2010 - 12Sky2 - 2 Replies
Hello every one~ after using my small brains, ive atlast come to understand the working of ragnarok bot by Strike aid ...and how to make it sun again with new adresses... to make it clear iam not good at this .....i was expecting others like mega or spare to do this but seems they are busy XD the last ingredient in making ragnarok work are the adresses that i need.... the following adresses are the ones i need and the following alone are the capablities that may work in the ragnarok...
fix 100% code save characters lvl and all for 5165
03/09/2010 - CO2 PServer Guides & Releases - 6 Replies
hello all this code for save lvl character and cps open Database.cs and search return "Error: Character already exists!"; del this code and add this new code
code save characters lvl and all
03/07/2010 - CO2 Private Server - 2 Replies
hello all this code for save lvl character and cps open Database.cs and search return "Error: Character already exists!"; del this code and add this new code
About Save Config In TBot919... 100% work
10/23/2007 - SRO Hacks, Bots, Cheats & Exploits - 12 Replies
You need TBot919 and TServer 19//913 of course. 1. Log in game, and press F5 2. Set wha you want in menus... 3. Klick "Load Script One" 4. Choose any Script can be named "save" or what you want, you can choose script in TBot folder too. 5. Klick "Save settings" buttons twice times. 6. Klick "auto training". 7. Happy Botting :D



All times are GMT +1. The time now is 01:51.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.