Register for your free account! | Forgot your password?

You last visited: Today at 15:07

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

Advertisement



[Release] Ko Count & Ko Board

Discussion on [Release] Ko Count & Ko Board within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
[Release] Ko Count & Ko Board

This is everything you need to setup an XP Skill(superman/cyclone) Ko Count and Ko Board for your webiste.

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));
                                            }
Then in World.cs, search for if (Mob.GetDamage(Damage)), under that add:
Code:
                    if (User.CycloneOn || User.SMOn)
                    {
                        User.KO++;
                        User.MyClient.SendPacket(General.MyPackets.SendMsg(User.MyClient.MessageId, "SYSTEM", User.Name, "Kills:" + User.KO, 2005));
                    }
- Now everytime you kill a monster with Cyclone or SM, you will get +1 KO.

- 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;
                        }
                    }
                }
Then search for if (SkillId == 1110), and replace the whole code with:
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()));
                        }
Same with if (SkillId == 1025):
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()));
                        }
Now in Character.cs, search for public void Save(), above that add:
Code:
        public void SaveKO()
        {
            if (MyClient.There)
                if (MyClient.Online)
                    DataBase.SaveKO(this);
        }
Next, in Database.cs, search for public static void SaveChar(Character Charr), above that add:
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;
        }
Then search for DataRow DR = DSet.Tables["Character"].Rows[0];, below that add:
Code:
                    Charr.KO = Convert.ToUInt16((uint)DR["KO"]);
                    Charr.OldKO = Convert.ToUInt16((uint)DR["OldKO"]);
In Client.cs, search for public void Drop(), inside that code, find MyChar.Enemies.Clear();, under that add:
Code:
                        MyChar.KO = 0;
Then search for case 74:, inside that code find MyChar.UnPackEnemies();, under that add:
Code:
                                        MyChar.KO = 0;
kinshi88 is offline  
Thanks
18 Users
Old 08/13/2008, 09:39   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Website:

If you have a PHP enabled webhost (a MUST for Private Servers), then you can do some wicked things.

This is how to make a Ko Board on your website that lists the KO's from highest to lowest!

Link:


Hope this helped!!!
Press Thanks if it did!
kinshi88 is offline  
Thanks
10 Users
Old 08/13/2008, 10:13   #3
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Another awesome script bro, keep em coming... oh yeah, this is =)
taguro is offline  
Old 08/13/2008, 12:42   #4
 
tony_987's Avatar
 
elite*gold: 0
Join Date: Nov 2007
Posts: 150
Received Thanks: 5
Thanks?!
tony_987 is offline  
Old 08/13/2008, 13:37   #5
 
gerble93's Avatar
 
elite*gold: 40
Join Date: Sep 2006
Posts: 1,890
Received Thanks: 805
Error 1 The name 'SaveKO' does not exist in the current context C:\Users\Gerble\Desktop\Gurgens Desktop\Gurgens server things\Source\TCWNN Source\Character.cs 695 25 COServerProject
Error 2 The name 'SaveKO' does not exist in the current context C:\Users\Gerble\Desktop\Gurgens Desktop\Gurgens server things\Source\TCWNN Source\Character.cs 703 29 COServerProject


How do i fix that?


NVM! GOT IT!
I love your guides.
Hey I think i have an idea. Make a forums, and post all of your topics there, like in 1 spot. =]
I would LOVE TO JOIN!
gerble93 is offline  
Old 08/13/2008, 14:01   #6
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 912
Haha thanks guys.
kinshi88 is offline  
Old 08/13/2008, 14:31   #7
 
elite*gold: 0
Join Date: Jun 2007
Posts: 323
Received Thanks: 30
You OD >_<
Zanzibar is offline  
Old 08/13/2008, 15:42   #8
 
gerble93's Avatar
 
elite*gold: 40
Join Date: Sep 2006
Posts: 1,890
Received Thanks: 805
I found an error. When ever I do cyclone again, it changes my score?
gerble93 is offline  
Old 08/14/2008, 21:32   #9
 
elite*gold: 0
Join Date: Jun 2008
Posts: 62
Received Thanks: 2
I love you man, yeah make a forum.

And FYI: you should make a .sql file that people can add that auto add's these table. for complete retards like me. :P.

But I got it Thanks :P
ciphas009 is offline  
Old 08/14/2008, 21:44   #10
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
Quote:
Originally Posted by ciphas009 View Post
I love you man, yeah make a forum.

And FYI: you should make a .sql file that people can add that auto add's these table. for complete retards like me. :P.

But I got it Thanks :P
Code:
ALTER TABLE `characters` ADD `KO` INT(10) UNSIGNED DEFAULT 0 NOT NULL;
ALTER TABLE `characters` ADD `OldKO` INT(10) UNSIGNED DEFAULT 0 NOT NULL;
That should do it. This is adds two new fields (KO, OldKO) to an existing table (characters).
nTL3fTy is offline  
Thanks
1 User
Old 08/14/2008, 22:41   #11
 
elite*gold: 0
Join Date: Jun 2008
Posts: 62
Received Thanks: 2
Need help.
Theres no
Code:
DataRow DR = DSet.Tables["Character"].Rows[0];
in database.cs ...
What do I do @_@?
ciphas009 is offline  
Old 08/14/2008, 23:04   #12
 
elite*gold: 0
Join Date: Jun 2008
Posts: 62
Received Thanks: 2
PLEASE HELP?
I can't add it becuase theres no such thing *** ["charcter"] only account and guild.
ciphas009 is offline  
Old 08/15/2008, 00:33   #13
 
elite*gold: 0
Join Date: Aug 2008
Posts: 36
Received Thanks: 2
Same problem

["character"] Is not there, only accountand guild

Edited LOTF Source.
CrazyKilla1 is offline  
Old 08/15/2008, 11:22   #14
 
elite*gold: 0
Join Date: Jan 2008
Posts: 15
Received Thanks: 0
Error 1 Invalid expression term 'else' C:\Users\nonofyourbussines\Desktop\Source\PowerSou rce CO\COServerProject1\COServerProject\Character.cs 2174 42 COServerProject
omg -.-
zelda55 is offline  
Old 08/15/2008, 12:43   #15
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Because his guide's sucks Nah I dunno,well I will release this + alot more,so you can check my thread daily,called "Releasing all my priv server codes"
_Emme_ is offline  
Reply


Similar Threads Similar Threads
[Release] 5165 Kill Count
03/30/2010 - CO2 PServer Guides & Releases - 6 Replies
Well, some of you people may saw my other one for CoEmu.Nano... i saw some people posting, i will make this for 5165, so.. i made it instead of you people ;) 1. goto your OldCODB\Users\Characters folder, and create folder: 'kills' 2. add this to Database public static void SaveNewKOs(Game.Character C) { if (File.Exists(@"C:\OldCODB\Users\Characters\ki lls\" + C.Name + ".chr")) { FileStream FS = new...
[Release] CoEmu.Nano Monster Kill Count
03/07/2010 - CO2 PServer Guides & Releases - 17 Replies
This kill counter i made my self its NOT the counter on the bottom right. it is a counter for specific NPCs you can add more your self if you want GREEN = things to add RED = things to change/replace ORANGE = things to search 1.
[Release] KO-Board in php
12/21/2008 - CO2 PServer Guides & Releases - 4 Replies
ok here is a ko board <?php $link=mysql_connect ("localhost", "root", "mysql password") or die ('Error: ' . mysql_error()); mysql_select_db ("database"); $Chars = mysql_query("SELECT CharName, KO FROM characters ORDER BY KO DESC LIMIT 0,10;"); Echo "<br><div style='top: 100; left: 1; position: absolute; z-index: 1; visibility: show;'>Top KO<br>";



All times are GMT +2. The time now is 15:07.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.