Register for your free account! | Forgot your password?

You last visited: Today at 08:00

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

Advertisement



Item "Bomb" Help

Discussion on Item "Bomb" Help within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Oct 2012
Posts: 43
Received Thanks: 3
Red face Item "Bomb" Help

how can I make the item Bomb operate only near the gate and take only half the life of the gate

Here the code I use!

Code:
#region Bomb
                case 3003499:
                    {






                        if (client.Entity.MapID == 1038 && DateTime.Now.DayOfWeek == DayOfWeek.Sunday)
                        {
                            foreach (GameState Player in Kernel.GamePool.Values)
                            {
                                if (Player.Entity.MapID == 1038 && (!Player.Entity.Dead))
                                Argentina.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh = (ushort)(250 + Argentina.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh % 10);
                                client.Entity.Die(0);
                                _String str = new _String(true);
                                str.UID = client.Entity.UID;
                                str.TextsCount = 1;
                                str.Type = _String.Effect;
                                str.Texts.Add("bombarrow");
                                str.Texts.Add("bombarrow3");
                                client.Entity.SendScreen(str);
                                Update upd = new Update(true);
                                upd.UID = Argentina.Game.ConquerStructures.Society.GuildWar.LeftGate.UID;
                                upd.Append(Update.Mesh, Argentina.Game.ConquerStructures.Society.GuildWar.LeftGate.Mesh);
                                client.SendScreen(upd, true);
                                Argentina.Kernel.SendWorldMessage(new Network.GamePackets.Message("BOOOOM#58 O Player :" + client.Entity.Name + ". Destruiu o 1Gate da GW...Com a bomba#58", System.Drawing.Color.White, Network.GamePackets.Message.Center), Program.GamePool);
                                client.Inventory.Remove(item, Argentina.Game.Enums.ItemUse.Remove);
                                break;
                                    
                        }
                    }
                }
                     break;
            
           
                                        #endregion Bomb
perfect0 is offline  
Old 06/27/2014, 02:26   #2
 
InsomniacPro's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 397
Received Thanks: 205
Why are you doing a foreach loop for EVERY character in the server. Why not just the ones within the character using the bomb's screen?
InsomniacPro is offline  
Thanks
1 User
Old 06/27/2014, 03:58   #3
 
elite*gold: 0
Join Date: Feb 2006
Posts: 726
Received Thanks: 271
I agree with Insomniac, thats alot of extra processing time being wasted.
Hell I bet a bunch of players could spam bombs away from the gate and be able to slow your server down at least a fraction. Plus I am sure this isn't the only case of something similar happening.

Regardless, the string effects for the guild bomb is firemagic followed by bombarrow.
Code:
Packet Nr 47. Server -> Client, Length : 30, PacketType: 1015
16 00 F7 03 1B 43 E6 00 0A 01 09 66 69 72 65 6D      ; ÷Cæ 
	firem
61 67 69 63 00 00 54 51 53 65 72 76 65 72            ;agic  TQServer


Packet Nr 48. Server -> Client, Length : 30, PacketType: 1015
16 00 F7 03 1B 43 E6 00 0A 01 09 62 6F 6D 62 61      ; ÷Cæ 
	bomba
72 72 6F 77 00 00 54 51 53 65 72 76 65 72            ;rrow  TQServer
Also looks like your code is killing the gate with 1 bomb use.

You have a couple options.
Best option is to probably pull both gates and check the user is within say 5 co ords?

Or you can hardcode a distance check in. Say for example the clients X co ord has to be between 50-60 and the y between 100-110. (Whatever the range is for one gate).
Not the greatest option and I wouldn't recommend it.

Then if that check passes, I assume you have some kind of damage method?
entity.receiveDmg(dmg, attacker) <- Something like that.
Well you would set the damage to be half the gates max health. (Why am I thinking it always took 4 bombs? *** I haven't played live CO in so long).
And then your receive damage method should take over from there and kill the gate if its dead and open it up etc.

If your asking for us to code it for you, aint gonna happen.
Aceking is offline  
Reply




All times are GMT +1. The time now is 08:01.


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.