|
You last visited: Today at 16:52
Advertisement
[Help] XPSkills (CoEmuV2)
Discussion on [Help] XPSkills (CoEmuV2) within the CO2 Private Server forum part of the Conquer Online 2 category.
08/07/2009, 13:42
|
#1
|
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
|
[Help] XPSkills (CoEmuV2)
hello ^^
i need a little help to ad xpskills....
i don't need the codes.... only where to add the codes... i wanna to know if ned to create packets for it.... can someone help me whith it?
if someone can ....
CYA!
|
|
|
08/07/2009, 14:02
|
#2
|
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
|
Place them anywhere you want....
|
|
|
08/07/2009, 23:29
|
#3
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
best place for it is at handlers/attack.cs
1-At MagicAttack (case for each skill ID)
Or
2-be4 the Checks (Line 32) put this
Code:
if (MagicID == 1110 || MagicID == 1025||MagicID==6010)
{
XpSkill(CSocket, MagicID);
}
add more xp skills Ids if u want then create a void for all xp skills something like this
Code:
public static void XpSkill(ClientSocket CSocket, int SkillId)
and put in it ur Ids cases
Edit
May be this was not ur question and u needed to know the Xp Status it self , if so then u will need a little more things to do Like the timer for Xp Circle and Timer for the skill itself to end
|
|
|
08/08/2009, 12:40
|
#4
|
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
|
wowwwwwwwwwwww....
samehaven u helped me allot!!...
latter i over the xpskills i will code the upgrade level npc... tkx for all... if i need some help more i call you...
EDIT:
omg ... i think i'm idiot but lets go...
i have these codes.... i don't know where to add them... already try many laces..... but the unique place it can be added is in ClienSocket.cs....
take a look plz
Code:
public DateTime LastXPC;
public Timer XPActivated;
public byte XpCircle = 0;
public bool XpList = false;
public bool Cyclone = false;
public bool SuperMan = false;
public bool FatalStrike = false;
public bool ShurikenVortex = false;
Code:
public void AddXPC()
{
LastXPC = DateTime.Now;
XpCircle += 1;
if (XpCircle >= 100)
{
XpList = true;
Send(ConquerPacket.Status(this, 2, Client.XpCircle, Struct.StatusTypes.XpCircle));
XpCircle = 0;
}
}
public void XPEnd()
{
Cyclone = false;
SuperMan = false;
FatalStrike = false;
ShurikenVortex = false;
Send(ConquerPacket.Status(this, 2, Client.XpCircle, Struct.StatusTypes.XpCircle));
}
public void StartXPCircle()
{
if (XpCircle == 100)
{
AddXPC();
Send(ConquerPacket.Status(this, 2, Client.XpCircle, Struct.StatusTypes.XpCircle));
}
}
maybe have many things wrong but... i'm tryng :X and never works : X plz help!!
PS.: i already added
Code:
if (MagicID == 1110 || MagicID == 1025||MagicID==6010)
{
XpSkill(CSocket, MagicID);
}
|
|
|
08/08/2009, 13:14
|
#5
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
Quote:
Originally Posted by 12tails
i have these codes.... i don't know where to add them... already try many laces..... but the unique place it can be added is in ClienSocket.cs....
take a look plz
Code:
public DateTime LastXPC;
public Timer XPActivated;
public byte XpCircle = 0;
public bool XpList = false;
public bool Cyclone = false;
public bool SuperMan = false;
public bool FatalStrike = false;
public bool ShurikenVortex = false;
|
if u wanna use those Vars then u have to place them at Entities/Character.cs coz u will need them for each character u will have on the server
Code:
public void AddXPC()
{
LastXPC = DateTime.Now;
XpCircle += 1;
if (XpCircle >= 100)
{
XpList = true;
Send(ConquerPacket.Status(this, 2, Client.XpCircle, Struct.StatusTypes.XpCircle));
XpCircle = 0;
}
}
u need to add the XpList effect ,something like that
Code:
CSocket.Send(CoEmu_v2_GameServer.Packets.ConquerPacket.Status(CSocket, 2, 16, Struct.StatusTypes.StatusEffect));
this will send the Xp Effect to the character so he will c his XpSkills if he has any
Code:
public void XPEnd()
{
Cyclone = false;
SuperMan = false;
FatalStrike = false;
ShurikenVortex = false;
Send(ConquerPacket.Status(this, 2, Client.XpCircle, Struct.StatusTypes.XpCircle));
}
looks fine but u will need to send the normal status effect again or else the xp status will last
u can delete ur third Void
Quote:
if (MagicID == 1110 || MagicID == 1025||MagicID==6010)
{
XpSkill(CSocket, MagicID);
}
|
this will automatically work when the player clicks the Xp Skill
now the very important thing u missed is to activate ur timer and call ur voids or else u wont ever reach them ,and that would be after the player login complete
set ur interval and elapsed for the timer ,the interval may be set to 1000 but u will need to increase the XpCircle limit to 340 coz the Circle needs about 5 minuets to reaches 100%
the Elapsed should set to the AddXPC void
the XpEnd Void will be called when the XpSkills ends
If u need my code i can put it but i like ur way (asking and trying) much better to learn that way
|
|
|
08/08/2009, 13:31
|
#6
|
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
|
samehaven ...
if u have the codes... can you show me how you have done ??
because i a bit lost here : X
it's not hard.... but ... i don'tk know what i need to do anymore : /.... i already make what u say... but isn't working :X.... ( i think i will get crazy hahahahaha)
if u can show me your way i will be gratz...
obs.: tryed again and that mother F@#@!#$%@$%¨&*&*@&$*&$@*& don't wroked...
|
|
|
08/08/2009, 13:58
|
#7
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
|
Quote:
public DateTime LastXPC;
public Timer XPActivated;
public byte XpCircle = 0;
public bool XpList = false;
public bool Cyclone = false;
public bool SuperMan = false;
public bool FatalStrike = false;
public bool ShurikenVortex = false;
|
I only use 2 variables (XPCircle & XPStart, both are datetimes), and I have over 10+ XPSkills. There's no need to implement a bool for each xpskill, just looks horrible=P
|
|
|
08/08/2009, 14:39
|
#8
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
Quote:
Originally Posted by EmmeTheCoder
I only use 2 variables (XPCircle & XPStart, both are datetimes), and I have over 10+ XPSkills. There's no need to implement a bool for each xpskill, just looks horrible=P
|
100% agree ,but i also use just one Global Timer
|
|
|
08/08/2009, 14:56
|
#9
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
Quote:
Originally Posted by 12tails
samehaven ...
if u have the codes... can you show me how you have done ??
because i a bit lost here : X
it's not hard.... but ... i don'tk know what i need to do anymore : /.... i already make what u say... but isn't working :X.... ( i think i will get crazy hahahahaha)
if u can show me your way i will be gratz...
obs.: tryed again and that mother F@#@!#$%@$%¨&*&*@&$*&$@*& don't wroked...
|
my way is a bit different than urs , i use one global timer for all players
Code:
public static System.Timers.Timer GlobalTimer = new System.Timers.Timer();
GlobalTimer.Interval = 1000;
then in it's delegate i add the XpCircle checks for all players
Code:
GlobalTimer.Elapsed += delegate
{
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket CSocket = Clients.Value;
CSocket.Client.XpSkillCounter += 1000;
if (CSocket.Client.XpSkillCounter >= 340000)
{
CSocket.Client.XpSkillCounter = 0;
CSocket.Client.XpTime = true;
CSocket.Send(CoEmu_v2_GameServer.Packets.ConquerPacket.Status(CSocket, 2, 16, Struct.StatusTypes.StatusEffect));
}
}
};
of cource u will change my Var name XpSkillCounter to ur XpCircle but as int or short not byte
|
|
|
08/08/2009, 15:19
|
#10
|
elite*gold: 0
Join Date: Jun 2008
Posts: 18
Received Thanks: 3
|
Quote:
Originally Posted by samehvan
my way is a bit different than urs , i use one global timer for all players
Code:
public static System.Timers.Timer GlobalTimer = new System.Timers.Timer();
GlobalTimer.Interval = 1000;
then in it's delegate i add the XpCircle checks for all players
Code:
GlobalTimer.Elapsed += delegate
{
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket CSocket = Clients.Value;
CSocket.Client.XpSkillCounter += 1000;
if (CSocket.Client.XpSkillCounter >= 34000)
{
CSocket.Client.XpSkillCounter = 0;
CSocket.Client.XpTime = true;
CSocket.Send(CoEmu_v2_GameServer.Packets.ConquerPacket.Status(CSocket, 2, 16, Struct.StatusTypes.StatusEffect));
}
}
};
of cource u will change my Var name XpSkillCounter to ur XpCircle but as int or short not byte
|
Hey there, Could you show me where I put these codes? XD
|
|
|
08/08/2009, 16:02
|
#11
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
Quote:
Originally Posted by Waterku
Hey there, Could you show me where I put these codes? XD
|
mine at Nano.cs Void StartServer()
the timer definition at the top of the class with the other definitions ,or u can put it at the Database.cs or anywhere else wherever u want but the timer start line must be at the serverstart void coz it has to start with the server ,it's global timer u know
if u still can't decide and want the exact places i put them at tell me
|
|
|
08/08/2009, 17:00
|
#12
|
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
|
samehven...
i've done this... take a look:
Code:
/*
* Created by SharpDevelop.
* User: sams
* Date: 3/8/2009
* Time: 8:03 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Collections;
using System.Threading;
using System.Collections.Generic;
using System.Collections.Specialized;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Entities;
using OpenSSL;
namespace CoEmu_v2_GameServer
{
/// <summary>
/// Nano, CoEmu v2's Leveling server 'nickname' is hence forth the primary location of threaded operations.
/// This class holds all data which is to be shared amongst connected players, that being said
/// it is here entirely to be a 'dataholder' as seen in CoEmu v2's initial release.
/// </summary>
public static class Nano
{
public const int VIEW_THRESHOLD = 18;
public static string PoleHolder = "None";
public static bool Continue = true;
public static Dictionary<int, ClientSocket> ClientPool = new Dictionary<int, ClientSocket>();
//public static Dictionary<string, ClientSocket> NewCharacters = new Dictionary<string, ClientSocket>();
public static Dictionary<ulong, ConnectionRequest> AuthenticatedLogins = new Dictionary<ulong, ConnectionRequest>();
public static Dictionary<int, Struct.ItemData> Items = new Dictionary<int, Struct.ItemData>();
public static Dictionary<int, Struct.ItemPlusDB> ItemPluses = new Dictionary<int, Struct.ItemPlusDB>();
public static Dictionary<int, MonsterInfo> BaseMonsters = new Dictionary<int, MonsterInfo>();
public static Dictionary<int, Monster> Monsters = new Dictionary<int, Monster>();
public static Dictionary<int, MonsterSpawn> MonsterSpawns = new Dictionary<int, MonsterSpawn>();
public static Dictionary<int, Struct.NPC> Npcs = new Dictionary<int, Struct.NPC>();
public static Dictionary<string, Struct.Portal> Portals = new Dictionary<string, Struct.Portal>();
public static Dictionary<int, Struct.ItemGround> ItemFloor = new Dictionary<int, Struct.ItemGround>();
public static Dictionary<int, Struct.DmapData> Maps = new Dictionary<int, Struct.DmapData>();
public static Dictionary<int, Struct.ServerSkill> ServerSkills = new Dictionary<int, Struct.ServerSkill>();
public static Dictionary<int, Struct.TerrainNPC> TerrainNpcs = new Dictionary<int, Struct.TerrainNPC>();
public static MasterSocket GameServer;
public static MasterSocket AuthServer;
public static System.Random Rand = new System.Random();
public static int TintR = 0;
public static int TintG = 0;
public const int EXP_MULTIPLER = 10;
public const int PROF_MULTIPLER = 10;
public const int SKILL_MULTIPLER = 10;
public static System.Timers.Timer Shutdown;
private static string P = "E7A69EBDF105F2A6BBDEAD7E798F76A209AD73FB466431E2E7352ED262F8C558F10BEFEA977DE9E21DCEE9B04D245F300ECCBBA03E72630556D011023F9E857F", G = "05";
public static OpenSSL.DH ServerKey;
public static System.Timers.Timer GlobalTimer = new System.Timers.Timer();
public static void GenerateKey()
{
Nano.ServerKey = new OpenSSL.DH(OpenSSL.BigNumber.FromHexString(P), OpenSSL.BigNumber.FromHexString(G));
Nano.ServerKey.GenerateKeys();
}
public static void StartServer()
{
GenerateKey();
Struct.LoadItems("items.txt");
Struct.LoadItemPluses("itemadd.ini");
Struct.LoadMaps();
Struct.LoadMonsters();
Struct.LoadNpcs();
Struct.LoadPortals();
Struct.LoadServerskills();
Struct.LoadTNpcs();
GlobalTimer.Interval = 1000;
//Database.Database.PurgeGuilds();
//Please DO NOT REMOVE THIS LINE!
Console.WriteLine("This program is a branch of CoEmu.Nano, property of the CoEmu Foundation.");
//
Console.WriteLine("[GameServer-Init] Creating Game Thread..");
Nano.GameServer = new MasterSocket("GameServer");
new Thread(Nano.GameServer.AcceptNewConnections).Start();
Console.WriteLine("[GameServer-Init](Game Thread) Success.");
Console.WriteLine("[GameServer-Init] Creating Auth Thread..");
Nano.AuthServer = new MasterSocket("AuthServer");
new Thread(Nano.AuthServer.AcceptNewConnections).Start();
Console.WriteLine("[GameServer-Init](Auth Thread) Success.");
ConsoleCommands();
}
public static void ConsoleCommands()
{
Console.WriteLine("Ready for commands.");
string command = Console.ReadLine();
if(command == "#end")
{
Shutdown = new System.Timers.Timer();
Shutdown.Interval = 180000;
Shutdown.AutoReset = false;
Shutdown.Elapsed += delegate { Kill(); };
Shutdown.Start();
CoEmu_v2_GameServer.Packets.ConquerPacket.ToServer(CoEmu_v2_GameServer.Packets.ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", "[GameServer] Shutting down in 3 minutes.", CoEmu_v2_GameServer.Structs.Struct.ChatType.Talk), 0);
}
else
{
Console.WriteLine("Unknown command.");
ConsoleCommands();
}
}
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);
}
this is my Nano.cs!!
i put this two things there:
public static System.Timers.Timer GlobalTimer = new System.Timers.Timer();
GlobalTimer.Interval = 1000;
also i maked the void for xp circle...
Code:
public static void XpCircle()
{
GlobalTimer.Elapsed += delegate
{
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket CSocket = Clients.Value;
CSocket.Client.XpSkillCounter += 1000;
if (CSocket.Client.XpSkillCounter == 3400)
{
CSocket.Client.XpSkillCounter = 0;
CSocket.Client.XpTime = true;
CSocket.Send(CoEmu_v2_GameServer.Packets.ConquerPacket.Status(CSocket, 2, 16, Struct.StatusTypes.StatusEffect));
}
}
};
}
but if its right where i need to put it? at nano.cs too? and... need more something else... like void for end?
|
|
|
08/08/2009, 18:19
|
#13
|
elite*gold: 0
Join Date: Apr 2009
Posts: 354
Received Thanks: 105
|
Code:
/*
* Created by SharpDevelop.
* User: sams
* Date: 3/8/2009
* Time: 8:03 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
how do i put that into mine . i mean iknow i can write but is it like a program?
|
|
|
08/08/2009, 18:22
|
#14
|
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
|
you don't need... its only the date it has been made ... lol ...
|
|
|
08/08/2009, 18:25
|
#15
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
|
Quote:
Originally Posted by CoAttack
Code:
/*
* Created by SharpDevelop.
* User: sams
* Date: 3/8/2009
* Time: 8:03 PM
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
how do i put that into mine . i mean iknow i can write but is it like a program?
|
It says "created by sharpdevelop" so download SharpDevelop lol
|
|
|
|
|
Similar Threads
|
[Fix] 64-Bit Fix for CoEmuV2
02/14/2011 - CO2 PServer Guides & Releases - 11 Replies
Ok believe ive got a fix for the 64-bit problem for CoEmuV2.
Go to "CoEmu v2\CoEmu v2 GameServer\bin\Debug" and replace the "libeay32.dll" with the .dll in this .zip file. This will fix it.
I am running Vista 64-bit and Running CoEmuV2 :)
Good Luck.
|
CoEmuV2
11/20/2009 - CO2 Private Server - 1 Replies
Is this source only compatible with a 5095 client or are there other clients that it can be connected to?
|
CoEmuv2
09/11/2009 - CO2 Private Server - 20 Replies
What do I have to change in my coemu source to allow people to connect with my hamachi ip. Right now I'm connecting to my server with ip in server.dat 127.0.0.1 what do I need to change in the source so that I can put my hamachi ip in server.dat so I can connect with it and other people can connect as well?
|
[HELP]CoemuV2
08/30/2009 - CO2 Private Server - 0 Replies
poeple can connect to my ip but i cant when i sqitch it to 127.0.0.1 i can connect cuz that my personal ip thing but when i chnage it to turn my erver up i cant log in but other can
|
Help Me Please With CoEmuV2
06/12/2009 - CO2 Private Server - 6 Replies
Please All I need some help when i try To Make The Server It`s Give me Error Look At The Error http://www10.0zz0.com/2009/06/02/19/320280174.jpg
|
All times are GMT +2. The time now is 16:52.
|
|