LeGend NOOB!
Posts : 18 Join date : 2009-05-09 Age : 31 Location : California
| Subject: [Release] Free Cps by Npc Sat 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: add the NPC in the databse and DONE | |
|