Register for your free account! | Forgot your password?

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

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

Advertisement



[help] trying to add stats in

Discussion on [help] trying to add stats in within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
[help] trying to add stats in

trying to have it so that class stats load by an ini can someone help me with this please


Thanks in advance
coreymills is offline  
Old 06/04/2009, 21:17   #2
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Since CoEmu v2 using Sql, why don't you just load it from the Sql?
Make a Dictionary to load them with a Stat class.
Then when you gain a level, select the stat class from the dictionary level entry.
Attached Files
File Type: rar stats.rar (3.9 KB, 18 views)
kinshi88 is offline  
Thanks
1 User
Old 06/04/2009, 22:29   #3
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
i'm still learning to code could u do a guide for me
coreymills is offline  
Old 06/04/2009, 23:12   #4
 
elite*gold: 0
Join Date: Dec 2007
Posts: 226
Received Thanks: 55
by using the lotf system i've made you the ini read stuff

nano.cs
Code:
[COLOR="RoyalBlue"]using [/COLOR]System;
[COLOR="RoyalBlue"]using [/COLOR]System.Collections;
[COLOR="RoyalBlue"]using [/COLOR]System.Threading;
[COLOR="RoyalBlue"]using [/COLOR]System.Collections.Generic;
[COLOR="RoyalBlue"]using [/COLOR]CoEmu_v2_GameServer.Connections;
[COLOR="RoyalBlue"]using [/COLOR]CoEmu_v2_GameServer.Structs;
[COLOR="RoyalBlue"]using [/COLOR]CoEmu_v2_GameServer.Entities;
[COLOR="RoyalBlue"]using [/COLOR]System.Text;
[COLOR="RoyalBlue"]using [/COLOR]System.Runtime.InteropServices;
[COLOR="RoyalBlue"]using [/COLOR]System.Timers;
[COLOR="RoyalBlue"]using [/COLOR]System.Data;
be sure to have all these location (at the 10 first lines of the page)

now, scroll down a bit
where you see
Code:
	[COLOR="royalblue"]public class [/COLOR]COLOR="Lime"]Nano[/COLOR]
	{
and place this right under it
Code:
[COLOR="RoyalBlue"]public static[/COLOR] [COLOR="Lime"]Ini [/COLOR]Stats = [COLOR="RoyalBlue"]new [/COLOR][COLOR="Lime"]Ini[/COLOR](System.Windows.Forms.[COLOR="lime"]Application[/COLOR].StartupPath + [COLOR="Red"]@"\Stats.ini"[/COLOR]);
i put it in nano.cs caus i have other ini reading stuff in there too

open exp.cs
searche for
Code:
[COLOR="RoyalBlue"]public static void[/COLOR] GiveLevel([COLOR="Lime"]ClientSocket [/COLOR]CSocket)
		{
under
Code:
CSocket.Client.Level++;
add
Code:
[COLOR="RoyalBlue"]if[/COLOR] (CSocket.Client.Reborn == 0)
            {
                [COLOR="RoyalBlue"]if[/COLOR] (CSocket.Client.Level <= 120)
                {
                    [COLOR="RoyalBlue"]if[/COLOR] ([COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class > 9 && [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class < 16)
                    {
                        CSocket.Client.Strength = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Trojan"[/COLOR], [COLOR="Red"]"Strength["[/COLOR] + CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Dexterity = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Trojan"[/COLOR], [COLOR="Red"]"Agility["[/COLOR] + CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Vitality = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Trojan"[/COLOR], [COLOR="Red"]"Vitality["[/COLOR] + CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Spirit = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Trojan"[/COLOR], [COLOR="Red"]"Spirit[" + CSocket.Client.Level + [COLOR="Red"]"]"));
                    }
                    [COLOR="RoyalBlue"]else if[/COLOR] ([COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class > 19 && [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class < 26)
                    {
                        CSocket.Client.Strength = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Warrior"[/COLOR], [COLOR="Red"]"Strength["[/COLOR] + CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Dexterity = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Warrior"[/COLOR], [COLOR="Red"]"Agility["[/COLOR] + CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Vitality = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Warrior"[/COLOR], [COLOR="Red"]"Vitality["[/COLOR] + CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Spirit = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Warrior"[/COLOR], [COLOR="Red"]"Spirit[" + CSocket.Client.Level + [COLOR="Red"]"]"));
                    }
                    [COLOR="RoyalBlue"]else if[/COLOR] ([COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class > 39 && [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class < 46)
                    {
                        CSocket.Client.Strength = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Archer"[/COLOR], [COLOR="Red"]"Strength[" [/COLOR]+ CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Dexterity = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Archer"[/COLOR], [COLOR="Red"]"Agility[" [/COLOR]+ CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Vitality = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Archer"[/COLOR], [COLOR="Red"]"Vitality[" [/COLOR]+ CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Spirit = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Archer"[/COLOR], [COLOR="Red"]"Spirit[" + CSocket.Client.Level + [COLOR="Red"]"]"));
                    }
                    [COLOR="RoyalBlue"]else if[/COLOR] ([COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class > 129 && [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class < 136 || [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class > 139 && [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class < 146 || [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class == 100 || [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class == 101)
                    {
                        CSocket.Client.Strength = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Taoist"[/COLOR], [COLOR="Red"]"Strength[" [/COLOR]+ CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Dexterity = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Taoist"[/COLOR], [COLOR="Red"]"Agility[" [/COLOR]+ CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Vitality = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Taoist"[/COLOR], [COLOR="Red"]"Vitality[" [/COLOR]+ CSocket.Client.Level + [COLOR="Red"]"]"[/COLOR]));
                        CSocket.Client.Spirit = [COLOR="RoyalBlue"]int[/COLOR].Parse([COLOR="Lime"]Nano[/COLOR].Stats.ReadValue([COLOR="Red"]"Taoist"[/COLOR], [COLOR="Red"]"Spirit[" + CSocket.Client.Level + [COLOR="Red"]"]"));
                    }
                    [COLOR="RoyalBlue"]else if[/COLOR]([COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class > 69 && [COLOR="RoyalBlue"]([COLOR="RoyalBlue"]int[/COLOR])[/COLOR]CSocket.Client.Class < 75)
                    {
                        CSocket.Client.StatPoints += 3;
                    }
                    [COLOR="Lime"]//CSocket.Client.StatPoints += 3;[/COLOR]
                }
            }
            [COLOR="RoyalBlue"]else[/COLOR]
            {
               CSocket.Client.StatPoints += 3;
            }
than just aboven the if(lvl < 135)
you add
Code:
CSocket.Send([COLOR="lime"]ConquerPacket[/COLOR].Status(CSocket, 2, CSocket.Client.Dexterity, [COLOR="lime"]Struct[/COLOR].[COLOR="lime"]StatusTypes[/COLOR].DexterityStatPoints));
            CSocket.Send([COLOR="lime"]ConquerPacket[/COLOR].Status(CSocket, 2, CSocket.Client.Spirit, [COLOR="lime"]Struct[/COLOR].[COLOR="lime"]StatusTypes[/COLOR].ManaStatPoints));
            CSocket.Send([COLOR="lime"]ConquerPacket[/COLOR].Status(CSocket, 2, CSocket.Client.Vitality, [COLOR="lime"]Struct[/COLOR].[COLOR="lime"]StatusTypes[/COLOR].VitalityStatPoints));
            CSocket.Send([COLOR="lime"]ConquerPacket[/COLOR].Status(CSocket, 2, CSocket.Client.Strength, [COLOR="lime"]Struct[/COLOR].[COLOR="lime"]StatusTypes[/COLOR].StrengthStatPoints));
            [COLOR="Lime"]Calculation[/COLOR].Vitals(CSocket, [COLOR="RoyalBlue"]false[/COLOR]);
the last thing is adding the ini file it belongs in debug folder (Stats.ini)
you'll just need to add ninja if you want that
good luck

----------------------edit------------------------------
Code:
public class Ini
        {
            public IniFile TheIni;

            public Ini(string path)
            {
                TheIni = new IniFile(path);
            }

            public string ReadValue(string Section, string Key)
            {
                string it = TheIni.IniReadValue(Section, Key);
                return it;
            }
            public void WriteString(string Section, string Key, string Value)
            {
                TheIni.IniWriteValue(Section, Key, Value);
            }
        }

        public class IniFile
        {
            public string path;

            [DllImport("kernel32")]
            private static extern long WritePrivateProfileString(string section, string key, string val, string filePath);
            [DllImport("kernel32")]
            private static extern int GetPrivateProfileString(string section,
                string key, string def, StringBuilder retVal, int size, string filePath);

            public IniFile(string INIPath)
            {
                path = INIPath;
            }
            public void IniWriteValue(string Section, string Key, string Value)
            {
                WritePrivateProfileString(Section, Key, Value, this.path);
            }

            public string IniReadValue(string Section, string Key)
            {
                StringBuilder temp = new StringBuilder(255);
                int i = GetPrivateProfileString(Section, Key, "", temp, 255, this.path);
                return temp.ToString();

            }
        }
this belonges in nano.cs
i put it at the end of
Code:
public static void Kill()
		{
			CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 5 seconds.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
			Thread.Sleep(1000);
			CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 4 seconds.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
			Thread.Sleep(1000);
			CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 3 seconds.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
			Thread.Sleep(1000);
			CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 2 seconds.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
			Thread.Sleep(1000);
			CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 1 second.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
			Nano.AuthServer.Close();
			Nano.GameServer.Close();
			System.Environment.Exit(1);
		}
Attached Files
File Type: zip Stats.zip (5.2 KB, 8 views)
yuko is offline  
Thanks
1 User
Old 06/04/2009, 23:37   #5
 
coreymills's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 555
Received Thanks: 99
error: the type or namespace name Ini could not be found (are u missing a using directive or an assembly reference?)
coreymills is offline  
Old 06/04/2009, 23:38   #6
 
elite*gold: 0
Join Date: Dec 2007
Posts: 226
Received Thanks: 55
last edit thats whats missing
yuko is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
char stats, and item stats
01/27/2010 - Lineage 2 - 6 Replies
hi all today.. on a private server. i made a verry strange exp..... some clannies called me to come to HS to help for pvp as i came there i seen mass pvp arround 30 ppl all hitted 1 person ................ a S dagger items drago set and AS i watched it.... he needed for everyone just 1 or 2 hits beamed arround like hell..
stats bug
07/15/2008 - WoW PServer Exploits, Hacks & Tools - 17 Replies
ihr zu einer instanz gehen und dort sterben dann muss euch ein befreundeter spieler wiederbeleben ihr dürft aber nichts klicken weder annehmen noch ablehnen dann rennt in die instanz rein und eure stats und spelldmg usw sollten sich erhöht haben das könnt ihr so oft wiederholen wie ihr wollt nach einem relogg ist alles wieder normal ihr könnt ja mal posten auf welchen servern das funktioniert und wo es gefixxt ist bitte ein thanks wenns funzt und euch was gebracht hat^^ klappt auf...
Stats
04/14/2008 - Archlord - 33 Replies
Hey.. im new to archlord and i have some questions :S the list of stats: Physical Strenght - Increase your MAX hp + MAX hep per lvl Power - Increase damge dealt by you in close combat Wisdom - Increase max MANA(not usefull really) Inteligence- Increases damage dealt by your char from Spell attacks(magic casters usefull only) Agility- Increase your long range damage and hit accuracy Accuracy- Additional chance to preven missing an opponent
Stats help --------------> stats calculator!
02/02/2008 - Kal Online - 3 Replies
Hi. Can anyone post here any site or program for calculating the stats so if u put points u see how much hp otp and all u have and where u can put what kind stuff u wear. THX
stats generator or stats calculator
08/12/2006 - Conquer Online 2 - 7 Replies
For reborn classes is there calculator or stat generator, which will show what effect would happen if u put #s of attrubites in str,hp,mana, dex. Thx for help



All times are GMT +1. The time now is 15:42.


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