Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 20:38

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

Advertisement



[Guide] make Effects viewable by players

Discussion on [Guide] make Effects viewable by players within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2006
Posts: 127
Received Thanks: 91
[Guide] make Effects viewable by players

I feel so darn` to found out this late... in Character.cs there is a pre-made void/method called SendScreen() which has a code that would send packets to any nearby players from the executor player.

With this we may able now to use SendScreen instead of using AddSend method to any Effect code that we want... example in my previous CoolEffect UPDATE I used to have this code:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.PacketHandling
{
   class CoolEffect
    {
        public static void ActiveCool(Main.GameClient MyClient)
        {
            byte counter = 0;

            for (byte i = 1; i < 9; i++)
            {
                if (i == 7) i++;
                Game.Item I = MyClient.MyChar.Equips.Get(i);
                if (I.ID != 0)
                {
                    Game.ItemIDManipulation Q = new CoPinoy.Game.ItemIDManipulation(I.ID);
                    if (Q.Quality == Game.Item.ItemQuality.Super)
                        counter += 1;
                }
            }

            if (MyClient.MyChar.Job >= 100)
                if (counter == 6)
                    counter = 7;
            if (MyClient.MyChar.Job >= 40 && MyClient.MyChar.Job <= 45)
                if (counter == 6)
                {
                    Game.Item I = MyClient.MyChar.Equips.Get(5);
                    I.ID = MyClient.MyChar.Equips.LeftHand.ID;
                    if (I.ID == 0)
                        counter = 7;
                }
            new Thread(delegate()
            {
                [COLOR="Blue"]foreach (Game.Character CC in Game.World.H_Chars.Values)[/COLOR]
                {
                   [COLOR="Lime"] if (CC.Loc.Map == MyClient.MyChar.Loc.Map && MyMath.InBox(MyClient.MyChar.Loc.X, MyClient.MyChar.Loc.Y, CC.Loc.X, CC.Loc.Y, 100))[/COLOR]
                    {
                        if (counter == 7)
                        {
                            if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "warrior"));
                            else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "fighter"));
                            else if (MyClient.MyChar.Job >= 100)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "taoist"));
                            else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "archer"));
                            else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
                        }
                        else
                        {
                            if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "warrior-s"));
                            else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "fighter-s"));
                            else if (MyClient.MyChar.Job >= 100)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "taoist-s"));
                            else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "archer-s"));
                            else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
                                CC.MyClient.[COLOR="Red"]AddSend[/COLOR](Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
                        }
                    }
                    MyClient.MyChar.Action = 100;
                }
            }).Start();   
        }
    }
}
obviously in this code I uses a for each loop(in color blue) that would map/iterate the number of players in the game and in side the loop i have a conditional statement(in color green) that would check either a particular player that has been mapped from the game is a nearby player, If so the latter effect will be executed. this algorithm is likely similar to the algorithm in SendScreen() method found in Character.cs, so therefore we may able to change the code above and make it look simpler like this.

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NewestCOServer.PacketHandling
{
   class CoolEffect
    {
        public static void ActiveCool(Main.GameClient MyClient)
        {
            byte counter = 0;

            for (byte i = 1; i < 9; i++)
            {
                if (i == 7) i++;
                Game.Item I = MyClient.MyChar.Equips.Get(i);
                if (I.ID != 0)
                {
                    Game.ItemIDManipulation Q = new CoPinoy.Game.ItemIDManipulation(I.ID);
                    if (Q.Quality == Game.Item.ItemQuality.Super)
                        counter += 1;
                }
            }

            if (MyClient.MyChar.Job >= 100)
                if (counter == 6)
                    counter = 7;
            if (MyClient.MyChar.Job >= 40 && MyClient.MyChar.Job <= 45)
                if (counter == 6)
                {
                    Game.Item I = MyClient.MyChar.Equips.Get(5);
                    I.ID = MyClient.MyChar.Equips.LeftHand.ID;
                    if (I.ID == 0)
                        counter = 7;
                }
                if (counter == 7)
                {
                  if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "warrior"));
                            else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "fighter"));
                            else if (MyClient.MyChar.Job >= 100)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "taoist"));
                            else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "archer"));
                            else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
                        }
                        else
                        {
                            if (MyClient.MyChar.Job >= 10 && MyClient.MyChar.Job <= 15)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "warrior-s"));
                            else if (MyClient.MyChar.Job >= 20 && MyClient.MyChar.Job <= 25)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "fighter-s"));
                            else if (MyClient.MyChar.Job >= 100)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "taoist-s"));
                            else if (MyClient.MyChar.Job >= 39 && MyClient.MyChar.Job <= 46)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "archer-s"));
                            else if (MyClient.MyChar.Job >= 50 && MyClient.MyChar.Job <= 55)
                                MyClient.MyChar.SendScreen(Packets.String(MyClient.MyChar.EntityID, 10, "Ninja120"));
                        }
                    }
                    MyClient.MyChar.Action = 100;
                }
            }).Start();   
        }
    }
}
kamote is offline  
Thanks
4 Users
Old 03/09/2010, 04:07   #2
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
gj
copz1337 is offline  
Old 03/09/2010, 04:48   #3
 
elite*gold: 0
Join Date: Feb 2010
Posts: 378
Received Thanks: 86
Shouldn't it be MyClient.MyChar.SendScreen?
good job btw.
-NewDawn- is offline  
Old 03/09/2010, 04:48   #4
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Very nice. Wouldn't of thought of this by myself, so you deserve my special thanks. :P
walmartboi is offline  
Old 03/09/2010, 05:35   #5
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
I got error, dont have definition of SendScreen.
salem rey is offline  
Old 03/09/2010, 05:41   #6
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by salem rey View Post
I got error, dont have definition of SendScreen.
Dude, it's not 'really' that hard to fix that, just a simple adding of GC or MyChar(which ever one it is) will fix it.
walmartboi is offline  
Old 03/09/2010, 05:57   #7
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
Can you tell me how to do it? im a super noob please.?
salem rey is offline  
Old 03/09/2010, 06:23   #8
 
walmartboi's Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 378
Received Thanks: 163
Quote:
Originally Posted by salem rey View Post
Can you tell me how to do it? im a super noob please.?
No offense, but if you can't trouble-shoot simple errors like that by yourself, you shouldn't have a private server of ANY KIND. You've been around here for over a month, you should at least know how some of the things in your server run.
walmartboi is offline  
Old 03/09/2010, 06:28   #9
 
elite*gold: 0
Join Date: May 2006
Posts: 127
Received Thanks: 91
Quote:
Originally Posted by salem rey View Post
Can you tell me how to do it? im a super noob please.?
sorry if i forgot MyChar in my example code above.

anyway do it this way... MyClient.MyChar.SendScreen or if you're using GC ... it should be GC.MyChar.SendScreen
kamote is offline  
Thanks
1 User
Old 03/09/2010, 07:15   #10
 
elite*gold: 0
Join Date: Feb 2010
Posts: 378
Received Thanks: 86
Quote:
Originally Posted by walmartboi View Post
No offense, but if you can't trouble-shoot simple errors like that by yourself, you shouldn't have a private server of ANY KIND. You've been around here for over a month, you should at least know how some of the things in your server run.
****... what crawled up your ***?
Help the community- don't criticize it.
-NewDawn- is offline  
Old 03/09/2010, 08:40   #11
 
ramix's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 272
Received Thanks: 61
why ppl you not use this

Quote:
Game.World.Action(GC.MyChar, Packets.String(GC.MyChar.EntityID, 10, "warrior").Get);

that is more simple and work 100%
ramix is offline  
Old 03/09/2010, 08:43   #12
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,785
Received Thanks: 5,304
Quote:
Originally Posted by ramix View Post
why ppl you not use this




that is more simple and work 100%
Won't that show it to EVERYONE in the server instead of just people in your area?
Arcо is offline  
Old 03/09/2010, 08:52   #13
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
Quote:
Originally Posted by -NewDawn- View Post
****... what crawled up your ***?
Help the community- don't criticize it.
It comes to a point (rather often on epvp) where people just need the truth. If you've read any of her threads he/she doesn't really understand English and doesn't even try half the time. People have tried to help and offered a number of times but it turns into them being expected to do it line by line 100 pct themselves with him/her not even trying.

When it gets to that point, a little criticism is deserved imo. He wasn't being overly harsh.

</offtopic>

Looks to be a good release... shocking that lotf doesn't have something like this built in but I suppose it shouldn't be.
pro4never is offline  
Thanks
1 User
Old 03/09/2010, 09:27   #14
 
elite*gold: 0
Join Date: Sep 2009
Posts: 321
Received Thanks: 60
yeh i agree she was here when i first started on the forums and it looked like she was here quite sometime when i started making my own p server and ive basicly debugged mine 100% and shes still getting stuck on stuff like that... shes not even trying tbh, she needs to start meeting us half way at some point.
LegalConquer is offline  
Old 03/09/2010, 09:29   #15
 
ramix's Avatar
 
elite*gold: 0
Join Date: Aug 2008
Posts: 272
Received Thanks: 61
Quote:
Originally Posted by .Arco View Post
Won't that show it to EVERYONE in the server instead of just people in your area?
show only the ppl is in the area... i tested and works good for me...
ramix is offline  
Reply


Similar Threads Similar Threads
[Request]Visual mods on viewable on self.
01/28/2010 - Mabinogi - 4 Replies
is this possible by dll editing?
How to make effects show again?
09/20/2008 - CO2 Private Server - 0 Replies
hi, can soemone please tell me how to make my effects in CO show again? my ss skills and cyclone skills and phoenix, dragon gem effect etc
can u make the king,prince,duke effects go away
03/31/2008 - Conquer Online 2 - 2 Replies
tittle says all I run dial up :D so i was wondering is i can take it out somehow cause it really is laggy in GW when alot of them are dukes and others, and also sdg effect pretty much everything cept for the fb/ss effect and the dmg number



All times are GMT +1. The time now is 20:41.


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.