Register for your free account! | Forgot your password?

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

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

Advertisement



is this the reflect code? anyone can help me out here :D

Discussion on is this the reflect code? anyone can help me out here :D 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 is this the reflect code? anyone can help me out here :D

I get this code from other source but im not surely what this source come from. so anyone help me converting this to 5165?

i just copy this from other source but i want to put this in my source.


Code:
}
            if (Attacked.PackedSkills.Contains("3060"))
            {
                if (Other.ChanceSuccess(26))
                {
                    Attacked.ReflectOn = true;
                }
                else
                {
                    Attacked.ReflectOn = false;
                }
            }
            if (Attacked.ReflectOn == true)
            {
                Damage = 0;
                Attacked.CurHP -= 0;
                if (AttackType == 0 || AttackType == 1)//Melee
                {
                    ReflectDamage = General.Rand.Next((int)Attacker.MinAtk, (int)Attacker.MaxAtk);
                    double reborn = 1;
                    if (AttackType == 0)
                        ReflectDamage += ExtraDamage;
                    else
                        ReflectDamage = (int)((double)ExtraDamage + ReflectDamage);

                    ReflectDamage = (int)((double)ReflectDamage * Attacker.AddAtkPc);

                    if (Attacker.StigBuff)
                        ReflectDamage = (int)(ReflectDamage * (double)(1 + ((double)(10 + Attacker.StigLevel) / 100)));

                    if (Attacker.SMOn)
                        ReflectDamage *= 2;
                    if (Attacked.RBCount == 1)
                        reborn = 0.7;
                    else if (Attacked.RBCount == 2)
                        reborn = 0.4;


                    ReflectDamage -= (Attacked.Defense * 2);
                    ReflectDamage *= reborn;

                    if (ReflectDamage < 1)
                        ReflectDamage = 1;
                }
                else if (AttackType == 2)//Ranged
                {
                    double reborn = 1;

                    int Atk = General.Rand.Next((int)Attacker.MinAtk, (int)Attacker.MaxAtk);
                    Atk += ExtraDamage;

                    Atk = (int)((double)Atk * Attacker.AddAtkPc);

                    if (Attacker.SMOn)
                        Atk *= 2;
                    if (Attacker.StigBuff)
                        Atk = (int)(Atk * (double)(1 + ((double)(10 + Attacker.StigLevel) / 100)));

                    if (Attacked.RBCount == 1)
                        reborn = 0.7;
                    else if (Attacked.RBCount == 2)
                        reborn = 0.4;

                    ReflectDamage = (int)((Atk * .029 + (Attacker.Level * 2)) - ((Attacked.Dodge) * (Attacked.Level * .04))) * 2 * reborn;

                    if (ReflectDamage < 1)
                        ReflectDamage = 1;
                }
                else if (AttackType == 3 || AttackType == 4)//Magic
                {
                    double reborn = 1;
                    if (AttackType == 3)
                        ReflectDamage = (int)+ExtraDamage;
                    else
                        ReflectDamage = (int)((double)ExtraDamage * Attacker.MAtk);
                    if (Attacked.RBCount == 1)
                        reborn = 0.7;
                    else if (Attacked.RBCount == 2)
                        reborn = 0.4;
                    ReflectDamage = (int)((Attacker.MAtk - (Attacked.MDefense + Attacked.Level * 3)) * reborn);

                    //Atk = (float)(((((Atk - Defense) - PlusDef) * Reborn) * Blessed));

                    if (ReflectDamage < 1)
                        ReflectDamage = 1;

                }
                if (ReflectDamage <= 1)
                {
                    ReflectDamage = 1;
                }
                if (ReflectDamage >= 5000)
                {
                    ReflectDamage = 5000;
                }
                else
                {
                    ReflectDamage = ReflectDamage / 1.6;
                }
                Attacker.MyClient.SendPacket(General.MyPackets.Vital((long)Attacker.UID, 0, Attacker.CurHP));
                foreach (DictionaryEntry DE in World.AllChars)
                {
                    Damage = 0;
                    Attacked.CurHP -= (ushort)Damage;
                    ReflectDamage = ReflectDamage / 1.6;
                    if (ReflectDamage >= 5000)
                    {
                        ReflectDamage = 5000;
                    }

                    if (ReflectDamage == Attacker.CurHP)
                    {
                        Attacker.CurHP = 0;
                        Attacker.Death = DateTime.Now;
                        Attacker.Alive = false;

                        Attacker.MyClient.SendPacket(General.MyPackets.Vital(Attacker.UID, 0, Attacker.CurHP));


                    }
                    if (ReflectDamage > Attacker.CurHP)
                    {
                        Attacker.CurHP = 0;
                        Attacker.Death = DateTime.Now;
                        Attacker.Alive = false;

                        Attacker.MyClient.SendPacket(General.MyPackets.Vital(Attacker.UID, 0, Attacker.CurHP));
                    }
                    if (ReflectDamage < Attacker.CurHP)
                    {
                        Attacker.CurHP -= (ushort)ReflectDamage;
                        Attacker.MyClient.SendPacket(General.MyPackets.Vital(Attacker.UID, 0, Attacker.CurHP));
                    }

                    Character Chaar = (Character)DE.Value;
                    if (Chaar.Name != Attacked.Name)
                        if (Chaar.LocMap == Attacked.LocMap)
                            if (MyMath.PointDistance(Chaar.LocX, Chaar.LocY, Attacked.LocX, Attacked.LocY) < 20)
                                Chaar.MyClient.SendPacket(General.MyPackets.String(Attacked.UID, 10, "MagicReflect"));
                }
                Attacked.MyClient.SendPacket(General.MyPackets.String(Attacked.UID, 10, "MagicReflect"));
                Attacker.MyClient.SendPacket(General.MyPackets.SendMsg(Attacker.MyClient.MessageId, "SYSTEM", Attacker.Name, "The attack reflected back at you!", 2005));

            }
            if (Attacked.ReflectOn == false)
            {

                if (AttackType == 0 || AttackType == 1) // Direct Attack
                {
                    double reborn = 1;
                    Damage = General.Rand.Next((int)Attacker.MinAtk, (int)Attacker.MaxAtk);

                    if (AttackType == 0)
                        Damage += ExtraDamage;
                    else
                        Damage = (int)((ExtraDamage / (double)100) * Damage);
                    if (Attacked.RBCount == 1)
                        reborn = 0.7;
                    else if (Attacked.RBCount == 2)
                        reborn = 0.4;

                    Damage = (int)(Damage * Attacker.AddAtkPc);

                    if (Attacker.StigBuff)
                        Damage = (int)(Damage * (1 + ((10 + Attacker.StigLevel) / (double)100)));

                    if (Attacker.SMOn)
                        Damage *= 2;

                    Damage -= Attacked.Defense;
                    Damage *= reborn;

                    if (Damage < 1)
                        Damage = 1;
                }
                else if (AttackType == 2)//Ranged
                {
                    double reborn = 1;

                    int Atk = General.Rand.Next((int)Attacker.MinAtk, (int)Attacker.MaxAtk);
                    Atk += ExtraDamage;

                    Atk = (int)((double)Atk * Attacker.AddAtkPc);

                    if (Attacker.SMOn)
                        Atk *= 2;
                    if (Attacker.StigBuff)
                        Atk = (int)(Atk * (double)(1 + ((double)(10 + Attacker.StigLevel) / 100)));

                    if (Attacked.RBCount == 1)
                        reborn = 0.7;
                    else if (Attacked.RBCount == 2)
                        reborn = 0.4;

                    Damage = (int)((Atk * .029 + (Attacker.Level * 2)) - ((Attacked.Dodge) * (Attacked.Level * .04))) * 2 * reborn;

                    if (Damage < 1)
                        Damage = 1;
                }
                else if (AttackType == 3 || AttackType == 4)//Magic
                {
                    double reborn = 1;
                    if (AttackType == 3)
                        Damage = (int)+ExtraDamage;
                    else
                        Damage = (int)((double)ExtraDamage * Attacker.MAtk);
                    if (Attacked.RBCount == 1)
                        reborn = 0.7;
                    else if (Attacked.RBCount == 2)
                        reborn = 0.4;
                    Damage = (int)((Attacker.MAtk - (Attacked.MDefense + Attacked.Level * 3)) * reborn );

                    //Atk = (float)(((((Atk - Defense) - PlusDef) * Reborn) * Blessed));

                    if (Damage < 1)
                        Damage = 1;
                }

            }
            return (uint)Damage;
        }
anyone?

please
salem rey is offline  
Old 02/17/2010, 03:53   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Simply go to wherever your attacks are handled in your source and do a check to see if the client has the skill learned. If they do do a percent success rate (sweet jesus, not a 26 percent chance though!) for reflect to activate. If it does do a damage calculation for how much dmg to return. If it doesn't activate continue on with the normal attack calculation.

This isn't something someone can just copy/paste a guide on how to do it. you have to go into your own attack calculations and read through how they work and then re-write them to include the check.
pro4never is offline  
Old 02/17/2010, 04:01   #3
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
nah need a major help out here, or anyone got the code for reflect in 5165? please?
salem rey is offline  
Old 02/19/2010, 14:54   #4
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
use more or less the same code of counterkill.... just add the reflect effect and make the damage return to the attacker : D
12tails is offline  
Old 02/19/2010, 14:59   #5
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
nah, i really dont know where to add and cs
salem rey is offline  
Old 02/19/2010, 17:47   #6
 
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
There was just a code released in the releases section. Go look.
Decker_ is offline  
Old 02/19/2010, 23:11   #7


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
IMHO delete the whole code, and examine it. When you fully understand how it works, port it to your source on your own, recoding every bit of it using your source`s variables, etc.
KraHen is offline  
Old 02/20/2010, 04:05   #8
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Thats kinda how i learned i would go learn a lesson from and use what i learned in the source

Quick way to learn
hunterman01 is offline  
Reply


Similar Threads Similar Threads
[Release] Reflect Code (5165 LOTF)
04/18/2012 - CO2 PServer Guides & Releases - 46 Replies
Maybe isn't very right but it works.... at Character.cs more ore less at line 1711 add this: public bool CanReflect = false; Now you have to make a check for the CanReflect become true.... go to LoadCharacter void at database.cs and add this after the load for skills:
[Request] Reflect Code
02/22/2009 - CO2 Private Server - 2 Replies
may anyone give me the reflect code? i would be grateful
[Release] Reflect Code
12/04/2008 - CO2 PServer Guides & Releases - 5 Replies
#Deleted Sorry
New Reflect!
02/02/2008 - CO2 Weapon, Armor, Effects & Interface edits - 9 Replies
This is my new modified Reflect effects! As your reflect skill activiate a boring blue bubble... and ure so sick of the gay effect... well, HAVE NO FEAR, DEJAVU IS HERE! My new reflect mod is a BLACK DRAGON HEAD guarantee you like it ! Sorry there will be no picture for preview because it was very hard to take SS... my apology for that. well ENJOY!
Reflect?
04/25/2007 - Conquer Online 2 - 17 Replies
I'm getting pretty close to my first rb with my fire tao. and I cant decide what i should rb into. I was thinking fire->warr->fire cause i get reflect and still have all the kick ass fire attacks, but I have heard that reflect is a random skill and it kinda goes off when it wants to. But, fire->fire->fire you get doge through it all and no one can hit you anyway. What do you guys think?



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


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.