Game-Elites
Would you like to react to this message? Create an account in a few clicks or log in to continue.


Game Elites is offering you all kind of Hacks, Bots, Tips and Tools.
 
HomeLatest imagesSearchRegisterLog in

 

 [Release] Free Cps by Npc

Go down 
AuthorMessage
LeGend
NOOB!
NOOB!
LeGend


Posts : 18
Join date : 2009-05-09
Age : 31
Location : California

[Release] Free Cps by Npc Empty
PostSubject: [Release] Free Cps by Npc   [Release] Free Cps by Npc EmptySat May 09, 2009 5:42 pm

here is a smal code that gives new players some cps gut they can get them only once.

add in the character.cs:
Code:
      // FreeCps
        public uint FCPs = 0;


search for:
Code:
  public void Save()
add before:
Code:
        public void SaveFCPs()
        {
            LastSave = DateTime.Now;
            if (MyClient.There)
                if (MyClient.Online)
                {
                    DataBase.SaveChar(this);
                    DataBase.SaveFCPs(this);
                }
        }

now search in databse.cs for
Code:
  public static void SaveChar(Character Charr)
add before
Code:
        public static void SaveFCPs(Character Charr)
        {
            MySqlCommand Command = null;
            Command = new MySqlCommand("UPDATE `Characters` SET `FCPs` = '" + Charr.FCPs + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
            Command.ExecuteNonQuery();
        }

search for
Code:
DataRow DR = DSet.Tables["Character"].Rows[0];
and add under this
Code:
 Charr.FCPs = (uint)DR["FCPs"];

Now for the NPC:

go into your client.cs to the npc talk
or search for
Code:
if (CurrentNPC == 390)
after this NPCcode add
Code:
                            if (CurrentNPC == 912)//Give CPS Pack
                            {
                                SendPacket(General.MyPackets.NPCSay("Hi, my name in HuangZoe. I can give u some free cps if u want?"));
                                SendPacket(General.MyPackets.NPCLink("OH! Yes plz.", 1));
                                SendPacket(General.MyPackets.NPCLink("Good Bye.", 255));
                                SendPacket(General.MyPackets.NPCSetFace(30));
                                SendPacket(General.MyPackets.NPCFinish());
                            }


go to the NPCDO
search agien for
Code:
if (CurrentNPC == 390)
and add after this NPCcode
Code:
                            if (CurrentNPC == 912)
                            {
                                if (Control == 1)
                                {
                                    if (MyChar.FCPs == 0)
                                    {

                                        MyChar.FCPs += 1;


                                        MyChar.CPs += 1000;
                                        SendPacket(General.MyPackets.Vital(MyChar.UID, 30, MyChar.CPs));
                                        MyChar.SaveFCPs();
                                    }
                                    else
                                    {
                                        SendPacket(General.MyPackets.NPCSay("You have get some CPS from me. Go away"));
                                     
                                        SendPacket(General.MyPackets.NPCLink("ok.", 255));
                                        SendPacket(General.MyPackets.NPCSetFace(30));
                                        SendPacket(General.MyPackets.NPCFinish());

                                    }
                                   
                                }
                            }

now add i your mysqldatabse in the character table:
[Release] Free Cps by Npc FCPS
add the NPC in the databse and
DONE
Back to top Go down
 
[Release] Free Cps by Npc
Back to top 
Page 1 of 1
 Similar topics
-
» [Release] Day & Night
» [Release] Nobility
» [Release] Lucytime aka BlessSkill
» [Release]Console Commands
» [RELEASE] GUILD CONTROLLER

Permissions in this forum:You cannot reply to topics in this forum
Game-Elites :: Conquer Online 2 :: CO2 Programming-
Jump to: