|
You last visited: Today at 19:13
Advertisement
Need some coemu coding help
Discussion on Need some coemu coding help within the CO2 Private Server forum part of the Conquer Online 2 category.
10/03/2009, 20:31
|
#1
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
Need some coemu coding help
Keep in mind that i CANT code, what so ever.
Well ive been trying to add implement some of the release from here into my coemu and i kinda gets some errors.
First one is from the coded aimbot, i get this error:
Quote:
Error 2 'CoEmu_v2_GameServer.Handlers.Handler' does not contain a definition for 'NoTargetMagic' C:\Users\Barhoom\Desktop\LegendCoSource\coemu\CoEm u v2 GameServer\Handlers\Aimbot.cs 55 45 CoEmu v2 GameServer
|
Can you guys also teach me how to define and where to define, so when i get errors like this i know what to do ;o.
Second error is from the global timer:
Quote:
Error 1 The type 'CoEmu_v2_GameServer.Nano' already contains a definition for 'GlobalTimer' C:\Users\Barhoom\Desktop\LegendCoSource\coemu\CoEm u v2 GameServer\Nano.cs 84 43 CoEmu v2 GameServer
|
Yes i hate my self for not knowing how to code and it annoys me...So any help would be appreciated!
Edit
I just remembered, my /pkevent command doesnt work for some reason and the invincibility command /i doesnt make me invincible, guards still 1 hit me..
And after a little help with fixing the pkevent command, how can i code a simple code that checks the last player standing in the pk event and announce him the winner?
I know its alot to ask, thanks in advance!
|
|
|
10/04/2009, 11:03
|
#2
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
#Bump
Had to bump the thread before it got lost ;3
|
|
|
10/04/2009, 11:32
|
#3
|
elite*gold: 0
Join Date: Sep 2009
Posts: 260
Received Thanks: 59
|
Quote:
Originally Posted by onlyme64
Keep in mind that i CANT code, what so ever.
Well ive been trying to add implement some of the release from here into my coemu and i kinda gets some errors.
First one is from the coded aimbot, i get this error:
I guess it's a bool? Like public bool NoMagicTarget = false; otherwise show me your line that contains that word so that i can look into it.
Can you guys also teach me how to define and where to define, so when i get errors like this i know what to do ;o.
Second error is from the global timer:
It is telling you you already have a globaltimer in the containing file, so delete one of the two.
Yes i hate my self for not knowing how to code and it annoys me...So any help would be appreciated!
Edit
I just remembered, my /pkevent command doesnt work for some reason Post the code and i will fix it for you.and the invincibility command /i doesnt make me invincible, It isn't suppose to make you invincible it is supposed to let everyone hit you 1. guards still 1 hit me..
And after a little help with fixing the pkevent command, how can i code a simple code that checks the last player standing in the pk event and announce him the winner? Post your code and i will try it for you.
I know its alot to ask, thanks in advance!
|
Just read the quote.
|
|
|
10/04/2009, 13:24
|
#4
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
Quote:
else if (!Aim.Dead)
{
if ((int)Aim.Map == (int)CSocket.Client.Map)
{
if (Calculation.InRange(CSocket.Client.X, CSocket.Client.Y, Aim.X, Aim.Y, 9))
{
Handler.NoTargetMagic(CSocket, SkillID, Aim.X, Aim.Y);
|
And here is the code for the pkevent
Quote:
case "pkevent":
{
if (CSocket.Client.isGM)
{
if (Command.Length == 2)
{
switch (Command[1].ToLower())
{
case "on":
{
Nano.PKEvent = true;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", "ALL", "PKEvent has started say /join to participate!!!.", Struct.ChatType.Talk));
break;
}
case "off":
{
Nano.PKEvent = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", "ALL", "Sorry, PK event participation has ended, better luck next time.", Struct.ChatType.Talk));
break;
}
}
}
}
break;
}
case "join":
{
if (!Nano.PKEvent)
{
Handler.Teleport(1005, 50, 50, 0, CSocket);
}
else
{
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "PKEvent hasnt started yet.", Struct.ChatType.Top));
}
break;
}
|
And for the last part, i need a code to check for the last player standing, announce him the winner, and gives him cps as reward.
As i said before i cant code, it should be a simple 2 min coding for u guys.
Thanks again <3
|
|
|
10/04/2009, 13:33
|
#5
|
elite*gold: 0
Join Date: Sep 2009
Posts: 260
Received Thanks: 59
|
Quote:
Originally Posted by onlyme64
And here is the code for the pkevent
|
Quote:
case "pkevent":
{
if (CSocket.Client.isGM)
{
if (Command.Length > 2)
{
switch (Command[1].ToLower())
{
case "on":
{
Nano.PKActive = true;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "PKEVENT HAS STARTED !!!.", Struct.ChatType.Talk));
break;
}
case "off":
{
Nano.PKActive = false;
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "Sorry, PK event participation has ended, you can rejoin tomorrow.", Struct.ChatType.Talk));
break;
}
case "join":
{
if (Nano.PKActive == true)
{
Handler.Teleport(1005, 50, 50, 0, CSocket);
}
else { CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, " MSG HERE ", Struct.ChatType.Top)); }
}
}
}
}
break;
}
|
Should work and with the NoTargetMagic i cant help you because you copy&pasted smething from somewhere and you have to link me first from where.
|
|
|
10/04/2009, 13:41
|
#6
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
|
|
|
10/04/2009, 14:38
|
#7
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
|
Haven't read comments yet,
but all I see is;
- You haven't got the "NoTargetMagic" handler.
- You've defined something twice.
|
|
|
10/04/2009, 14:56
|
#8
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
And how can i add this Handler then good sir?
|
|
|
10/04/2009, 16:08
|
#9
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
Quote:
Originally Posted by onlyme64
And how can i add this Handler then good sir?
|
NoTargetMagic
Code:
public static void NoTargetMagic(ClientSocket CSocket, int MagicID, int X, int Y)
{
if (CSocket.Client.Skills.ContainsKey(MagicID))
{
Struct.CharSkill Skill = CSocket.Client.Skills[MagicID];
if ((int)CSocket.Client.Map != 1039)
{
bool OK = Calculation.MagicCost(Skill.ID, Skill.Level, CSocket);
if (!OK)
{
if (CSocket.Client.Attack != null)
{
if (CSocket.Client.Attack.Enabled)
{
CSocket.Client.Attack.Stop();
CSocket.Client.Attack.Dispose();
}
}
return;
}
}
else
{
if (CSocket.Client.Attack != null)
{
if (!CSocket.Client.Attack.Enabled)
{
CSocket.Client.Attack = new System.Timers.Timer();
CSocket.Client.Attack.Interval = 900;
CSocket.Client.Attack.Elapsed += delegate { Attack(0, MagicID, 21, X, Y, CSocket); };
CSocket.Client.Attack.Start();
}
}
else
{
CSocket.Client.Attack = new System.Timers.Timer();
CSocket.Client.Attack.Interval = 900;
CSocket.Client.Attack.Elapsed += delegate { Attack(0, MagicID, 21, X, Y, CSocket); };
CSocket.Client.Attack.Start();
}
}
switch (MagicID)
{
#region Scatter
case 8001://Scatter
{
Dictionary<int, Monster> ToDo = new Dictionary<int, Monster>();
Dictionary<int, int> Targets = new Dictionary<int, int>();
try
{
Monitor.Enter(Nano.Monsters);
foreach (KeyValuePair<int, Monster> Mob in Nano.Monsters)
{
if ((int)CSocket.Client.Map == Mob.Value.Map)
{
if (Calculation.InRange(Mob.Value.X, Mob.Value.Y, CSocket.Client.X, CSocket.Client.Y, 12))
{
if (Mob.Value.Info.Name == "Guard" || Mob.Value.Info.Name == "Patrol" || Mob.Value.Info.Name == "GuardReviver")
{
if (CSocket.Client.PKMode == Struct.PkType.PK)
{
if (!ToDo.ContainsKey(Mob.Value.UID))
ToDo.Add(Mob.Key, Mob.Value);
}
}
else
{
if (!ToDo.ContainsKey(Mob.Value.UID))
ToDo.Add(Mob.Key, Mob.Value);
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
Monitor.Exit(Nano.Monsters);
}
try
{
Monitor.Enter(Nano.ClientPool);
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket ASocket = Clients.Value;
if ((int)CSocket.Client.Map == (int)ASocket.Client.Map && CSocket.Client.ID != ASocket.Client.ID)
{
if (Calculation.InRange(ASocket.Client.X, ASocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, 12) && !ASocket.Client.Dead)
{
if (CheckMode(CSocket, ASocket)&&!ASocket.Client.Flying)
{
int Damage = Calculation.Damage(CSocket.Client, ASocket.Client, 25, 0, 0);
Calculation.doPlayer(CSocket, ASocket, Damage, 21);
if (!Targets.ContainsKey(ASocket.Client.ID))
{
Targets.Add(ASocket.Client.ID, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 15));
}
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
Monitor.Exit(Nano.ClientPool);
}
foreach (KeyValuePair<int, Struct.TerrainNPC> TNPCS in Nano.TerrainNpcs)
{
Struct.TerrainNPC Tnpc = TNPCS.Value;
if ((int)CSocket.Client.Map == Tnpc.Map)
{
if (Calculation.InRange(Tnpc.X, Tnpc.Y, CSocket.Client.X, CSocket.Client.Y, 12))
{
int Damage = 0;
if (CSocket.Client.MinAttack < CSocket.Client.MaxAttack)
Damage = Nano.Rand.Next(CSocket.Client.MinAttack, CSocket.Client.MaxAttack);
Calculation.doTNpc(CSocket, Tnpc, Damage, 21);
if (!Targets.ContainsKey(Tnpc.UID))
{
Targets.Add(Tnpc.UID, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 25));
}
}
}
}
//TODO: GW, TG
foreach (KeyValuePair<int, Monster> Mob in ToDo)
{
int Damage = Calculation.Damage(CSocket.Client, Mob.Value, 25, 0, 0);
Calculation.doMonster(Mob.Value, Damage, 21, CSocket);
if (!Targets.ContainsKey(Mob.Value.UID))
{
if (Mob.Value.CurrentHP > 0)
{
Targets.Add(Mob.Key, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 12));
}
}
}
ToDo.Clear();
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, Skill.ID, Skill.Level, Targets, CSocket.Client.X, CSocket.Client.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
Targets.Clear();
break;
}
#endregion Scatter
#region Fast Blade
case 1045:
{
int Distance = 0;
if (Skill.Level == 0)
Distance = 3;
if (Skill.Level == 1)
Distance = 5;
if (Skill.Level == 2)
Distance = 6;
if (Skill.Level == 3)
Distance = 7;
if (Skill.Level == 4)
Distance = 8;
int[][] FB = fbCoords(CSocket.Client.X, CSocket.Client.Y, X, Y, Distance);
Dictionary<int, int> Targets = new Dictionary<int, int>();
foreach (int[] HitCoords in FB)
{
int HitX = HitCoords[0];
int HitY = HitCoords[1];
try
{
Monitor.Enter(Nano.ClientPool);
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket ASocket = Clients.Value;
if ((int)CSocket.Client.Map == (int)ASocket.Client.Map && CSocket.Client.ID != ASocket.Client.ID)
{
if (Calculation.InRange(ASocket.Client.X, ASocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, Distance) && !ASocket.Client.Dead)
{
if (ASocket.Client.X == HitX && ASocket.Client.Y == HitY && !Targets.ContainsKey(ASocket.Client.ID))
{
if (CheckMode(CSocket, ASocket) && !ASocket.Client.Flying)
{
int Damage = Calculation.Damage(CSocket.Client, ASocket.Client, 2, 0, 0);
Calculation.doPlayer(CSocket, ASocket, Damage, 21);
Targets.Add(ASocket.Client.ID, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 15));
}
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
Monitor.Exit(Nano.ClientPool);
}
Dictionary<int, Monster> ToDo = new Dictionary<int, Monster>();
try
{
Monitor.Enter(Nano.Monsters);
foreach (KeyValuePair<int, Monster> Mob in Nano.Monsters)
{
if ((int)CSocket.Client.Map == Mob.Value.Map)
{
if (Calculation.InRange(Mob.Value.X, Mob.Value.Y, CSocket.Client.X, CSocket.Client.Y, Distance))
{
if (Mob.Value.X == HitX && Mob.Value.Y == HitY && !Targets.ContainsKey(Mob.Value.UID))
{
if (Mob.Value.Info.Name == "Guard" || Mob.Value.Info.Name == "Patrol" || Mob.Value.Info.Name == "GuardReviver")
{
if (CSocket.Client.PKMode == Struct.PkType.PK)
{
if (!ToDo.ContainsKey(Mob.Value.UID))
ToDo.Add(Mob.Key, Mob.Value);
}
}
else
{
if (!ToDo.ContainsKey(Mob.Value.UID))
ToDo.Add(Mob.Key, Mob.Value);
}
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
Monitor.Exit(Nano.Monsters);
}
foreach (KeyValuePair<int, Struct.TerrainNPC> TNPCS in Nano.TerrainNpcs)
{
Struct.TerrainNPC Tnpc = TNPCS.Value;
if ((int)CSocket.Client.Map == Tnpc.Map)
{
if (Calculation.InRange(Tnpc.X, Tnpc.Y, CSocket.Client.X, CSocket.Client.Y, 12))
{
if (HitX == Tnpc.X && HitY == Tnpc.Y)
{
int Damage = 0;
if (CSocket.Client.MinAttack < CSocket.Client.MaxAttack)
Damage = Nano.Rand.Next(CSocket.Client.MinAttack, CSocket.Client.MaxAttack);
Calculation.doTNpc(CSocket, Tnpc, Damage, 21);
if (!Targets.ContainsKey(Tnpc.UID))
{
Targets.Add(Tnpc.UID, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 25));
}
}
}
}
}
if (ToDo.Count > 0)
{
foreach (KeyValuePair<int, Monster> Mob in ToDo)
{
int Damage = Calculation.Damage(CSocket.Client, Mob.Value, 2, 0, 0);
Calculation.doMonster(Mob.Value, Damage, 21, CSocket);
if (!Targets.ContainsKey(Mob.Value.UID))
{
Targets.Add(Mob.Key, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 12));
}
}
}
ToDo.Clear();
}
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, Skill.ID, Skill.Level, Targets, X, Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
Targets.Clear();
break;
}
#endregion Fast Blade
#region SaintSword
case 1046:
{
int Distance = 0;
if (Skill.Level == 0)
Distance = 3;
if (Skill.Level == 1)
Distance = 5;
if (Skill.Level == 2)
Distance = 6;
if (Skill.Level == 3)
Distance = 7;
if (Skill.Level == 4)
Distance = 8;
int[][] FB = fbCoords(CSocket.Client.X, CSocket.Client.Y, X, Y, Distance);
Dictionary<int, int> Targets = new Dictionary<int, int>();
foreach (int[] HitCoords in FB)
{
int HitX = HitCoords[0];
int HitY = HitCoords[1];
try
{
Monitor.Enter(Nano.ClientPool);
foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
{
ClientSocket ASocket = Clients.Value;
if ((int)CSocket.Client.Map == (int)ASocket.Client.Map)
{
if (Calculation.InRange(ASocket.Client.X, ASocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, Distance) && !ASocket.Client.Dead)
{
if (ASocket.Client.X == HitX && ASocket.Client.Y == HitY && !Targets.ContainsKey(ASocket.Client.ID))
{
if (CheckMode(CSocket, ASocket) && !ASocket.Client.Flying)
{
int Damage = Calculation.Damage(CSocket.Client, ASocket.Client, 2, 0, 0);
Calculation.doPlayer(CSocket, ASocket, Damage, 21);
Targets.Add(ASocket.Client.ID, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 15));
}
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
Monitor.Exit(Nano.ClientPool);
}
Dictionary<int, Monster> ToDo = new Dictionary<int, Monster>();
try
{
Monitor.Enter(Nano.Monsters);
foreach (KeyValuePair<int, Monster> Mob in Nano.Monsters)
{
if ((int)CSocket.Client.Map == Mob.Value.Map)
{
if (Calculation.InRange(Mob.Value.X, Mob.Value.Y, CSocket.Client.X, CSocket.Client.Y, Distance))
{
if (Mob.Value.X == HitX && Mob.Value.Y == HitY && !Targets.ContainsKey(Mob.Value.UID))
{
if (Mob.Value.Info.Name == "Guard" || Mob.Value.Info.Name == "Patrol" || Mob.Value.Info.Name == "GuardReviver")
{
if (CSocket.Client.PKMode == Struct.PkType.PK)
{
if (!ToDo.ContainsKey(Mob.Value.UID))
ToDo.Add(Mob.Key, Mob.Value);
}
}
else
{
if (!ToDo.ContainsKey(Mob.Value.UID))
ToDo.Add(Mob.Key, Mob.Value);
}
}
}
}
}
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
finally
{
Monitor.Exit(Nano.Monsters);
}
foreach (KeyValuePair<int, Struct.TerrainNPC> TNPCS in Nano.TerrainNpcs)
{
Struct.TerrainNPC Tnpc = TNPCS.Value;
if ((int)CSocket.Client.Map == Tnpc.Map)
{
if (Calculation.InRange(Tnpc.X, Tnpc.Y, CSocket.Client.X, CSocket.Client.Y, 12))
{
if (HitX == Tnpc.X && HitY == Tnpc.Y)
{
int Damage = 0;
if (CSocket.Client.MinAttack < CSocket.Client.MaxAttack)
Damage = Nano.Rand.Next(CSocket.Client.MinAttack, CSocket.Client.MaxAttack);
Calculation.doTNpc(CSocket, Tnpc, Damage, 21);
if (!Targets.ContainsKey(Tnpc.UID))
{
Targets.Add(Tnpc.UID, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 25));
}
}
}
}
}
if (ToDo.Count > 0)
{
foreach (KeyValuePair<int, Monster> Mob in ToDo)
{
int Damage = Calculation.Damage(CSocket.Client, Mob.Value, 2, 0, 0);
Calculation.doMonster(Mob.Value, Damage, 21, CSocket);
if (!Targets.ContainsKey(Mob.Value.UID))
{
Targets.Add(Mob.Key, Damage);
Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 12));
}
}
}
ToDo.Clear();
}
ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, Skill.ID, Skill.Level, Targets, X, Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
Targets.Clear();
break;
}
#endregion
}
}
}
|
|
|
10/04/2009, 18:21
|
#10
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
im gonna be more nooby and ask you where to put that code <3
|
|
|
10/04/2009, 18:35
|
#11
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
Quote:
Originally Posted by onlyme64
im gonna be more nooby and ask you where to put that code <3
|
Handler/attack.cs
|
|
|
10/09/2009, 20:35
|
#12
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
I get 4 errors.
I'll post em up in abit.
#Edit
First error -
Quote:
Error 1 'CoEmu_v2_GameServer.Calculations.Calculation' does not contain a definition for 'MagicCost'
|
Second, third and fourth errors -
Quote:
Error 2 No overload for method 'CheckMode' takes '2' arguments
|
Thanks for any help given!
|
|
|
10/09/2009, 22:39
|
#13
|
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
|
what source u use ?? those classes are in the main coemu source , how come u don't have them ?
|
|
|
10/09/2009, 22:50
|
#14
|
elite*gold: 0
Join Date: Sep 2008
Posts: 1,683
Received Thanks: 505
|
this source is ****** up.
|
|
|
10/09/2009, 23:42
|
#15
|
elite*gold: 0
Join Date: Mar 2008
Posts: 268
Received Thanks: 25
|
Eh, its that animeco coemu source, i'll stick with andy's then. Lemme try it out on there =x
|
|
|
Similar Threads
|
[Guide] Coding for CoEmu/Cofuture
05/12/2011 - CO2 PServer Guides & Releases - 36 Replies
CONTENTS OF THREAD:
- Creating Ingame Commands and Database Functions
saving/loading/updating databases using SQL
- Coding more advanced Npcs for use on your server
- Timers and processes
(By Yashi)
- Data types in C# and what they can hold
|
[Question] Coemu V2 coding team
09/07/2009 - CO2 Private Server - 0 Replies
I was thinking of getting a team or coders to help fix up a coemu v2 source like adding all the npcs and more stuff. I know Im just starting to code but i will try my best to do what I know so far and to learn some new stuff so if your intrested add me or pm me [email protected] thats my email and Bye. :mofo:
|
All times are GMT +2. The time now is 19:13.
|
|