Register for your free account! | Forgot your password?

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

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

Advertisement



[Help]Guildwar Error of 5165.

Discussion on [Help]Guildwar Error of 5165. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
Question [Help]Guildwar Error of 5165.



does anyone know this error? and how to fix it?

and by the way this is my whole guildwars.cs

Quote:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NewestCOServer.Game;

namespace NewestCOServer.Features
{
public class GuildWars
{
public class GWScore
{
public Guild TheGuild;
public uint Score;
}
public struct Pole
{
public Location Loc;
public uint MaxHP;
public uint CurHP;
public uint Mesh;
public uint EntityID;

public void Spawn(Character C, bool Check)
{
if (C.Loc.Map == Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, Loc.X, Loc.Y, 16) && (!MyMath.InBox(C.Loc.PreviousX, C.Loc.PreviousY, Loc.X, Loc.Y, 16) || !Check))
{
if (LastWinner == null)
C.MyClient.AddSend(Packets.SpawnNPCWithHP(EntityID , (ushort)Mesh, 10, Loc, true, "Pole", CurHP, MaxHP));
else
C.MyClient.AddSend(Packets.SpawnNPCWithHP(EntityID , (ushort)Mesh, 10, Loc, true, LastWinner.GuildName, CurHP, MaxHP));
}
}
public void ReSpawn()
{
foreach (Character C in World.H_Chars.Values)
if (C.Loc.Map == Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, Loc.X, Loc.Y, 16))
{
if (LastWinner == null)
C.MyClient.AddSend(Packets.SpawnNPCWithHP(EntityID , (ushort)Mesh, 10, Loc, true, "Pole", CurHP, MaxHP));
else
C.MyClient.AddSend(Packets.SpawnNPCWithHP(EntityID , (ushort)Mesh, 10, Loc, true, LastWinner.GuildName, CurHP, MaxHP));
}
}
public void TakeAttack(Character C, uint Damage, byte AtkType)
{
if (War && C.MyGuild != null && C.MyGuild != LastWinner)
{
if (AtkType != 21)
World.Action(C, Packets.AttackPacket(C.EntityID, EntityID, Loc.X, Loc.Y, Damage, AtkType).Get);
if (Damage >= CurHP)
{
AddScore(C.MyGuild, CurHP);
C.AtkMem.Attacking = false;
C.AtkMem.Target = 0;
World.Action(C, Packets.AttackPacket(C.EntityID, EntityID, Loc.X, Loc.Y, 0, 14).Get);
CurHP = MaxHP;
EndWar();
}
else
{
CurHP -= Damage;
AddScore(C.MyGuild, Damage);
}
}
}
}
public struct Gate
{
public Location Loc;
public uint MaxHP;
public uint CurHP;
public uint EntityID;
public uint Mesh;

public bool Opened
{
set
{
if (EntityID == 6701)//Left Gate
{
if (value) Mesh = 250;
else Mesh = 240;
}
else if (EntityID == 6702)//Right Gate
{
if (value) Mesh = 280;
else Mesh = 270;
}
}
get
{
if (EntityID == 6701)//Left Gate
{
if (Mesh == 250) return true;
else return false;
}
else if (EntityID == 6702)//Right Gate
{
if (Mesh == 280) return true;
else return false;
}
return false;
}
}
public void Spawn(Character C, bool Check)
{
if (C.Loc.Map == Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, Loc.X, Loc.Y, 16) && (!MyMath.InBox(C.Loc.PreviousX, C.Loc.PreviousY, Loc.X, Loc.Y, 16) || !Check))
C.MyClient.AddSend(Packets.SpawnNPCWithHP(EntityID , (ushort)Mesh, 26, Loc, true, "Gate", CurHP, MaxHP));
}
public void ReSpawn()
{
foreach (Character C in World.H_Chars.Values)
if (C.Loc.Map == Loc.Map && MyMath.InBox(C.Loc.X, C.Loc.Y, Loc.X, Loc.Y, 16))
C.MyClient.AddSend(Packets.SpawnNPCWithHP(EntityID , (ushort)Mesh, 26, Loc, true, "Gate", CurHP, MaxHP));
}
public void TakeAttack(Character C, uint Damage, byte AtkType)
{
if (AtkType != 21)
World.Action(C, Packets.AttackPacket(C.EntityID, EntityID, Loc.X, Loc.Y, Damage, AtkType).Get);
if (Damage >= CurHP)
{
C.AtkMem.Attacking = false;
C.AtkMem.Target = 0;
World.Action(C, Packets.AttackPacket(C.EntityID, EntityID, Loc.X, Loc.Y, 0, 14).Get);
Opened = true;
ReSpawn();
}
else
CurHP -= Damage;
}
}

public static Pole ThePole;
public static Gate TheLeftGate;
public static Gate TheRightGate;

public static bool War;
public static Hashtable Scores;
public static DateTime LastScores;
public static Guild LastWinner;
public static bool DuelAreaFree; // 1v1
public static bool Ocupado; // 1v1

public static void Init()
{
War = false;
Scores = new Hashtable();
LastScores = DateTime.Now;

ThePole = new Pole();
ThePole.EntityID = 6700;
ThePole.Mesh = 1137;
ThePole.CurHP = 20000000;
ThePole.MaxHP = 20000000;
ThePole.Loc = new Location();
ThePole.Loc.Map = 1511;
ThePole.Loc.X = 51;
ThePole.Loc.Y = 49;

TheLeftGate = new Gate();
TheLeftGate.EntityID = 6701;
TheLeftGate.Opened = false;
TheLeftGate.MaxHP = 10000000;
TheLeftGate.CurHP = 10000000;
TheLeftGate.Loc = new Location();
TheLeftGate.Loc.Map = 1038;
TheLeftGate.Loc.X = 163;
TheLeftGate.Loc.Y = 210;
TheLeftGate.ReSpawn();

TheRightGate = new Gate();
TheRightGate.EntityID = 6702;
TheRightGate.Opened = false;
TheRightGate.MaxHP = 10000000;
TheRightGate.CurHP = 10000000;
TheRightGate.Loc = new Location();
TheRightGate.Loc.Map = 1038;
TheRightGate.Loc.X = 222;
TheRightGate.Loc.Y = 177;
TheRightGate.ReSpawn();
}
public static void AddScore(Guild G, uint Points)
{
if (!Scores.Contains(G.GuildID))
{
GWScore S = new GWScore();
S.Score = Points;
S.TheGuild = G;
Scores.Add(G.GuildID, S);
}
else
{
GWScore S = (GWScore)Scores[G.GuildID];
S.Score += Points;
}
}
public static string[] ShuffleGuildScores()
{
try
{
string[] ret = new string[5];
DictionaryEntry[] Vals = new DictionaryEntry[5];

for (sbyte i = 0; i < 5; i++)
{
Vals[i] = new DictionaryEntry();
Vals[i].Key = (ushort)0;
Vals[i].Value = (uint)0;
}

foreach (DictionaryEntry Score in Scores)
{
sbyte Pos = -1;
for (sbyte i = 0; i < 5; i++)
{
//if (((GWScore)Score.Value).Score > (uint)Vals[i].Value)
if ((uint)Score.Value > (uint)Vals[i].Value) This is my line 219
{
Pos = i;
break;
}
}
if (Pos == -1)
continue;

for (sbyte i = 4; i > Pos; i--)
Vals[i] = Vals[i - 1];

Vals[Pos] = Score;
}

for (sbyte i = 0; i < 5; i++)
{
if ((ushort)Vals[i].Key == 0)
{
ret[i] = "";
continue;
}
Features.Guild eGuild = (Features.Guild)Features.Guilds.AllTheGuilds[(ushort)Vals[i].Key];
ret[i] = "No " + (i + 1).ToString() + ": " + eGuild.GuildName + "(" + ((GWScore)Vals[i].Value).Score + ")";
}

return ret;
}
catch (Exception Exc) { Program.WriteLine(Exc); return null; }
}
public static void SendScores()
{
LastScores = DateTime.Now;
string[] ShuffledScores = ShuffleGuildScores();

foreach (Character C in World.H_Chars.Values)
{
if (C.Loc.Map == 1038)
{
byte c = 0;
foreach (string t in ShuffledScores)
{
if (t != "")
{
if (c == 0)
C.MyClient.AddSend(Packets.ChatMessage(0, "SYSTEM", "ALLUSERS", t, 0x83c, 0));
else
C.MyClient.AddSend(Packets.ChatMessage(0, "SYSTEM", "ALLUSERS", t, 0x83d, 0));
}
c++;
}
}
}
}
public static void StartWar()
{
Init();
Database.TopGuildReset();
Game.World.Gw = true;
World.SendMsgToAll("SYSTEM", "Guild War has begun! Previous Guild Winner, defend your Pole now!", 2011, 0);
War = true;
}
public static void FinishWar()
{
War = false;
TheLeftGate.Opened = false;
TheRightGate.Opened = false;

TheLeftGate.CurHP = TheLeftGate.MaxHP;
TheRightGate.CurHP = TheRightGate.MaxHP;
TheLeftGate.ReSpawn();
TheRightGate.ReSpawn();

GWScore Highest = new GWScore();
Highest.Score = 0;


if (Highest.TheGuild != null)
{
//LastWinner = Highest.TheGuild;
LastWinner.Wins++;
ThePole.ReSpawn();
World.SendMsgToAll("SYSTEM", LastWinner + " have won!", 2011, 0);
Game.World.Gw = false;
}
Features.Guilds.SaveGuilds();
SendScores();
Scores = new Hashtable();
}
public static void EndWar()
{
War = false;
TheLeftGate.Opened = false;
TheRightGate.Opened = false;

TheLeftGate.CurHP = TheLeftGate.MaxHP;
TheRightGate.CurHP = TheRightGate.MaxHP;
TheLeftGate.ReSpawn();
TheRightGate.ReSpawn();

GWScore Highest = new GWScore();
Highest.Score = 0;

foreach (GWScore Score in Scores.Values)
{
if (Score.Score > Highest.Score)
Highest = Score;
}

if (Highest.TheGuild != null)
{
LastWinner = Highest.TheGuild;
LastWinner.Wins++;
ThePole.ReSpawn();
World.SendMsgToAll("SYSTEM", LastWinner.GuildName + " have won!", 2011, 0);
Game.World.Gw = false;
}
Features.Guilds.SaveGuilds();
SendScores();
Scores = new Hashtable();
}
}
}

If anyone know about this problem and how to fix this. please comment below. please
salem rey is offline  
Reply


Similar Threads Similar Threads
5165 mob error.
07/20/2011 - CO2 Private Server - 2 Replies
I've screwed up with the /spawn command. I've made a spawn in tc that extends outside of the maps areas. Now, it won't let me run the server, it just keeps saying loading mobs. Any ideas on how to fix it?
[Release] GuildWar {5165}
10/25/2010 - CO2 PServer Guides & Releases - 3 Replies
Hello everybody! I Decided to Give you some informations about the GW.. GW Pole and a little release about the gw ending , I was searching for posts around and the "/endgw" command isnt very right since the void is not for the cmd. 1st Changing Pole HP *Search for public static void Init() in Features>GuildWars.cs - There you gonna find ThePole.CurHP = 20000000; and ThePole.MaxHP = 20000000; Change both to whatever you think is right.... 2nd How to make GW Re-Start after the pole has...
5165 Error!
03/04/2010 - CO2 Private Server - 4 Replies
I followed Korvacs guide to run a 5165 server on Windows 7. Afterwards I tried to run the server, it got to the point where it says "Dmaps loaded successfully in 208 milliseconds" At that point it will go back to Visual C# and highlight In DMap.cs line 124 I need help.
5165 Error X_X
02/20/2010 - CO2 Private Server - 1 Replies
Aite since i like aint a decent coder, I got a error on ma source The name 'Skill' does not exist in this current context It was for the Reflect Fix Release, for (int n = 0; n < 5; n++) { BW.Write((byte)0);//WH Count
how i fix this error in c# 5165
01/16/2010 - CO2 Private Server - 15 Replies
how i fix this error http://img85.imageshack.us/img85/1940/48502865.jp g



All times are GMT +1. The time now is 06:02.


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