Register for your free account! | Forgot your password?

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

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

Advertisement



[Help]The gate and pole wont die!

Discussion on [Help]The gate and pole wont die! within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
JobvdH's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 371
Received Thanks: 120
[Help]The gate and pole wont die!

Hello all,

I finished coding guildwar and guilds on CoEmu.
But when my guildwar is started the gates and the pole won't "Die"
Can someone help me with this?

Heres my code:
Code:
		public static void doTNpc(ClientSocket CSocket, Struct.TerrainNPC AttackedTNpc, int Damage, int AType)
		{
			if(AttackedTNpc.UID >= 6700)
			{
                if (AType != 21)
                    ConquerPacket.ToLocal(ConquerPacket.Attack(CSocket.Client.ID, AttackedTNpc.UID, AttackedTNpc.X, AttackedTNpc.Y, Damage, AType), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
                if (AType == 25)
                    ConquerPacket.ToLocal(ConquerPacket.Status(CSocket, 2, AttackedTNpc.CurrentHP, (Struct.StatusTypes)0), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
                if (AttackedTNpc.UID == 6701)
                {
                    if (AttackedTNpc.CurrentHP <= 0)
                    {
                        Handler.OpenGate((Struct.TerrainNPC)Nano.TerrainNpcs[6701]);
                    }
                }
                else if (AttackedTNpc.UID == 6702)
                {
                    if (AttackedTNpc.CurrentHP <= 0)
                    {
                        Handler.OpenGate((Struct.TerrainNPC)Nano.TerrainNpcs[6702]);
                    }
                }
                else if (AttackedTNpc.UID == 6700)
                {
                    if (AttackedTNpc.CurrentHP <= 0)
                    {
                        AttackedTNpc.CurrentHP = 0;
                        Handler.RestartWar(CSocket, AttackedTNpc);
                    }
                    else
                    {
                        if (Struct.GuildWars.Scores.Contains(CSocket.Client.Guild.Name))
                            Struct.GuildWars.Scores[CSocket.Client.Guild.Name] = (int)Struct.GuildWars.Scores[CSocket.Client.Guild.Name] + Damage;
                        else
                            Struct.GuildWars.Scores.Add(CSocket.Client.Guild.Name, Damage);
                    }
                }
			}
			else
			{
				GiveExp(CSocket, AttackedTNpc, Damage);
				if(AType != 21)
					ConquerPacket.ToLocal(ConquerPacket.Attack(CSocket.Client.ID, AttackedTNpc.UID, AttackedTNpc.X, AttackedTNpc.Y, Damage, AType), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
			}
		}
Thanks in advance,
JobvdH!
JobvdH is offline  
Old 02/20/2012, 19:01   #2
 
JobvdH's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 371
Received Thanks: 120
Bump
JobvdH is offline  
Old 02/21/2012, 00:33   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
All anyone can say is breakpoint, see where the issue is and then fix the problem.

Does it ever call the open gate or restart war method? What about inside that method, where does it fail?
pro4never is offline  
Old 02/21/2012, 09:43   #4
 
JobvdH's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 371
Received Thanks: 120
Well I tried putting the OpenGate method on a command and it works fine, but when I attack the gate it will remain closed.

#Edit:
Heres my OpenGate void:
Code:
        public static void OpenGate(Struct.TerrainNPC TNpc)
        {
            if (TNpc.UID == 6701)
            {
                TNpc.CurrentHP = 0;
                TNpc.Type = 1704177;
                ConquerPacket.ToLocal(ConquerPacket.TerrainNPC(TNpc.UID, TNpc.MaximumHP, TNpc.CurrentHP, TNpc.X, TNpc.Y - 2, TNpc.Type, "ii", 1), TNpc.X, TNpc.Y - 2, TNpc.Map, 0, 0);
            }
            else if (TNpc.UID == 6702)
            {
                TNpc.CurrentHP = 0;
                TNpc.Type = 1704213;
                ConquerPacket.ToLocal(ConquerPacket.TerrainNPC(TNpc.UID, TNpc.MaximumHP, TNpc.CurrentHP, TNpc.X, TNpc.Y - 4, TNpc.Type, "ii", 1), TNpc.X, TNpc.Y - 4, TNpc.Map, 0, 0);
            }
        }
JobvdH is offline  
Old 02/21/2012, 11:00   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
As I said.. breakpoint and see where the issue lies. Aka basic introductory debugging anyone who wants to program should be comfortable with doing regularly.
pro4never is offline  
Old 02/21/2012, 11:30   #6
 
JobvdH's Avatar
 
elite*gold: 0
Join Date: Nov 2010
Posts: 371
Received Thanks: 120
Nothing is wrong with the brake points, that went wrong with making a copy.
I found out that if passes the else if (AttackedTNpc.UID == 6702) but at the HP check. It just doesn't check it or the check is wrong.

Code:
                else if (AttackedTNpc.UID == 6702) //Left gate
                {
                    if (Nano.TerrainNpcs[6702].CurrentHP <= 0)
                    {
                        Handler.OpenGate((Struct.TerrainNPC)Nano.TerrainNpcs[6702]);
                    }
                }
#EDIT:
I've already got it fixed, thanks for the support!

#Request Close!
JobvdH is offline  
Reply


Similar Threads Similar Threads
[Energy Gate Clicker] Dark Galaxy Gate :) V. 1.6.5
12/23/2011 - DarkOrbit - 12 Replies
Hello, becouse this Thread -> http://www.elitepvpers.com/forum/darkorbit/782730- dark-galaxy-gate-energie-klicker.html <- isn't going to be updated anymore (the user is banned) i thought i will just upload the newest version of it :) DarkGalaxyGate http://i54.tinypic.com/2nc0846.jpg http://i52.tinypic.com/2jhyxc.jpg
Epsilon Gate and Zeta Gate[Waves and Rewards]
10/26/2011 - DarkOrbit - 5 Replies
Hello, I wanted to do my epsilon gate,so i searched about waves before i jumped in. I couldn't find anything.After ~10 minutes of searching i found what i need. Here it is.. Epsilon Gate - DarkOrbit Wiki* Zeta Gate - DarkOrbit Wiki*
Using a ghost to hit gw gate/pole
06/26/2007 - CO2 Guides & Templates - 19 Replies
When you and your guild members/allies are trying to hit gate or pole, while the enemies are attacking you, it's best if you all stand under one ghost, this way noone can fb, herc or ss you, concidering the fact that you will all be on team and most probably a few will be using rage, as soon as an enemy gets closer he'll be killed straight away.



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


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.