Why Release it?
- I coded it myself, so I have the right to release it.
- Also, I believe that open source coding for servers is a lot more efficient, and produces better/more advanced results.
What is a Ko Count and Ko Board?
- You know in Real Conquer, when you get Superman or Cyclone XP Skills, and you kill a certain number of monsters with that skill? Well this code does just that. Note that it does not setup the Ko Board in the server, you can do that on your website.
What will I need?
- Brain w/ common sense
- LOTF source [Link: ]
How to Code Ko Count and Ko Board
Database:
- To access the database:
- You need to create 2 new Tables in Characters:
KO and OldKO
Definition of these tables:
KO: Your highest number of kills with an XP Skill
OldKO: Compares the KO count you get with this one, if it is higher, it changes both to your new KO
Source:
Define our variables, etc
In Character.cs:
Code:
public uint KO = 0; public uint OldKO = 0;
- We gotta make it so everytime you kill a monster when you have Cyclone or Superman, you get +1 KO.
In Character.cs search for if (MobTarget.GetDamage((uint)AttackDMG)), under that add:
Code:
if (CycloneOn || SMOn) { KO++; MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "Kills:" + KO, 2005)); }
Code:
if (User.CycloneOn || User.SMOn) { User.KO++; User.MyClient.SendPacket(General.MyPackets.SendMsg(User.MyClient.MessageId, "SYSTEM", User.Name, "Kills:" + User.KO, 2005)); }
- Next are some codes just to perfect the Code and make it work:
In Character.cs, search for: if (DateTime.Now > XPActivated.AddMilliseconds(ExtraXP)), and replace the whole code with:
Code:
if (DateTime.Now > XPActivated.AddMilliseconds(ExtraXP)) if (SMOn || CycloneOn) { XPEnd(); if (KO >= 100) { World.SendMsgToAll(Name + " killed " + KO + " monsters with their XP skill! Check the website for KO Board rankings!", "SYSTEM", 2005); SaveKO(); KO = 0; } else { if (KO >= 1) { MyClient.SendPacket(General.MyPackets.SendMsg(MyClient.MessageId, "SYSTEM", Name, "You killed " + KO + " monsters with their XP skill! Check the website for KO Board rankings!", 2005)); SaveKO(); KO = 0; } } }
Code:
if (SkillId == 1110) { if ((!CycloneOn || !SMOn) & (XpList = false)) KO = 0; CycloneOn = true; XpList = false; XpCircle = 0; XPActivated = DateTime.Now; ExtraXP = 20000; MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat())); }
Code:
if (SkillId == 1025) { if ((!CycloneOn || !SMOn) & (XpList = false)) KO = 0; SMOn = true; XpList = false; XpCircle = 0; XPActivated = DateTime.Now; ExtraXP = 20000; MyClient.SendPacket(General.MyPackets.Vital(UID, 26, GetStat())); }
Code:
public void SaveKO() { if (MyClient.There) if (MyClient.Online) DataBase.SaveKO(this); }
Code:
public static void SaveKO(Character Charr) { try { if (Charr.OldKO > Charr.KO) { Charr.KO = 0; } else if (Charr.KO > Charr.OldKO) { MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `KO` = '" + Charr.KO + "',`OldKO` = '" + Charr.KO + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection); Command.ExecuteNonQuery(); } } catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); } Charr.KO = 0; }
Code:
Charr.KO = Convert.ToUInt16((uint)DR["KO"]); Charr.OldKO = Convert.ToUInt16((uint)DR["OldKO"]);
Code:
MyChar.KO = 0;
Code:
MyChar.KO = 0;