Register for your free account! | Forgot your password?

You last visited: Today at 14:46

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

Advertisement



CoolEffect 5165 (impulse)

Discussion on CoolEffect 5165 (impulse) within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
CoolEffect 5165 (impulse)

emmm yes, this a noob release i know, but i'm starting to "work" in this source and i want to share somethings including when they are easy to do, so maybe u can help me to improve the code and improve my skills at coding

look for this in entity.cs

public Enums.ConquerAction Action

under the set statment (i dk how to call it :c)

HandleCoolEffect((Enums.ConquerAction)SpawnPacket[63]);

then add this where u want in entity.cs

Code:
        void HandleCoolEffect(Enums.ConquerAction action)
        {
            bool FullSuper = true;
            if (action != Enums.ConquerAction.Cool || Owner.Equipment.TryGetItem(3) == null)
                return;
            else
            {
                uint ID = Owner.Equipment.TryGetItem(3).ID;
                if (IsSuper(ID))
                {
                    Network.GamePackets.StringPacket stringPacket = new Network.GamePackets.StringPacket(true);
                    stringPacket.UID = this.UID;
                    stringPacket.Type = Network.GamePackets.StringPacket.Effect;
                    for (byte i = 1; i < 8; i++)
                    {
                        if (i == 7)
                            continue;
                        if (this.Owner.Equipment.TryGetItem(i) != null)
                        {
                            if (!IsSuper(this.Owner.Equipment.TryGetItem(i).ID))
                            {
                                FullSuper = false;
                                break;
                            }
                        }
                        else
                        {
                            FullSuper = false;
                            break;
                        }
                    }
                    switch (this.Class / 10 * 10)
                    {
                        case 10:
                            {
                                stringPacket.Texts.Add(FullSuper ? "warrior" : "warrior-s");
                                break;
                            }
                        case 20:
                            {
                                stringPacket.Texts.Add(FullSuper ? "fighter" : "fighter-s");
                                break;
                            }
                        case 45:
                            {
                                stringPacket.Texts.Add(FullSuper ? "archer" : "archer-s");
                                break;
                            }
                        case 50:
                            {
                                return;
                            }
                        case 130:
                        case 140:
                            {
                                stringPacket.Texts.Add(FullSuper ? "taoist" : "taoist-s");
                                break;
                            }
                    }
                    Owner.Send(stringPacket);
                }
            }
        }
        bool IsSuper(uint ID)
        {
            return (ID - 9) % 10 == 0;
        }
thanks for read
U2_Caparzo is offline  
Old 05/15/2012, 01:22   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
This might help you in your switch statement:
this.Class / 10 * 10.

Also, instead of this:
Code:
if (FullSuper)
    stringPacket.Texts.Add("fighter");
else
    stringPacket.Texts.Add("fighter-s");
You could just do this:
stringPacket.Texts.Add(FullSuper ? "fighter" : "fighter-s");
Spirited is offline  
Thanks
1 User
Old 05/15/2012, 01:34   #3
 
nTL3fTy's Avatar
 
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
You could also do it the proper way:
nTL3fTy is offline  
Thanks
2 Users
Old 05/15/2012, 01:37   #4
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Quote:
Originally Posted by Fаng View Post
This might help you in your switch statement:
this.Class / 10 * 10.
srry but i don't understand why
#EDIT ohhh i see, lol, 130-139 / 10 = 13 ^^ forgot that too :s


Quote:
Originally Posted by Fаng View Post
Also, instead of this:
Code:
if (FullSuper)
    stringPacket.Texts.Add("fighter");
else
    stringPacket.Texts.Add("fighter-s");
You could just do this:
stringPacket.Texts.Add(FullSuper ? "fighter" : "fighter-s");
totally forgot about that, thanks

Quote:
Originally Posted by nTL3fTy View Post
You could also do it the proper way:
i'll try, thanks too

#EDIT
updated.
U2_Caparzo is offline  
Old 05/21/2012, 09:59   #5
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
Code:
                    for (byte i = 1; i < 8; i++)
                    {
                        if (i == 7)
                            continue;
Can you see your mistake?

i < 8, that means your for loop will go up to when i is equal to 7
You're telling your loop to continue when i gets to 7, however there is nothing looped after that.

Just do:
Code:
                    for (byte i = 1; i < 7; i++)
                    {
I don't have a username is offline  
Thanks
1 User
Old 05/21/2012, 18:01   #6
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Quote:
Originally Posted by I don't have a username View Post
Code:
                    for (byte i = 1; i < 8; i++)
                    {
                        if (i == 7)
                            continue;
Can you see your mistake?

i < 8, that means your for loop will go up to when i is equal to 7
You're telling your loop to continue when i gets to 7, however there is nothing looped after that.

Just do:
Code:
                    for (byte i = 1; i < 7; i++)
                    {
Inventory = 0,
Head = 1,
Necklace = 2,
Armor = 3,
RightWeapon = 4,
LeftWeapon = 5,
Ring = 6,
Bottle = 7,
Boots = 8,

the mistake was that the number in the loop should be 9 :s
U2_Caparzo is offline  
Reply


Similar Threads Similar Threads
Wow Addon Impulse
11/15/2011 - WoW Guides & Templates - 49 Replies
Impulse - Instant Pro-Level Keybinds & Macros Ist draußen, habt ihr auch den Bug das man es nicht kaufen kann? Wenn es klappen würde würde ich es releasen Download Link: http://www.multiupload.com/V4L3AQT6W3 thanks tt22
[Help]i need code for fix monster in impulse source 5165
04/06/2011 - CO2 Private Server - 0 Replies
i need code for fix monster in impulse source 5165 or nobility and vinding
i got a problem in 5165 impulse source
02/21/2011 - CO2 Private Server - 13 Replies
hi, i have a co pserver 5165 impulse " http://www.elitepvpers.com/forum/co2-pserver-guides -releases/741395-5165-source.html " i followed the guide , but when i made server on i got an error, well i gone to C# and i debugged , and i got the same thing , look: http://img713.imageshack.us/img713/3217/sdfsdft.p ng and "coserver" is the name of database "coserver.sql" there is "coserver" written in OldCODB
dekaron First-Impulse
05/20/2009 - Private Server - 0 Replies
hii guys isaw in xtreme top 100 dekaron First-Impulse but idont know what the hamachi chanels and how to download clinte soo who know how to get game plz post....tnx



All times are GMT +2. The time now is 14:46.


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.