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 16:19

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

Advertisement



[Release] adding wepon skills to CoEmu

Discussion on [Release] adding wepon skills to CoEmu within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
[Release] adding wepon skills to CoEmu

add
1st
add this to Structs/skill.cs after Public Class ServerSkill
Code:
        public enum SkillIds : int
        {
            Thunder = 1000,
            Fire = 1001,
            Tornado = 1002,
            Cure = 1005,
            Lightning = 1010,
            Accuracy = 1015,
            Shield = 1020,
            Fortress = 1021,
            Superman = 1025,
            Roar = 1040,
            FastBlade = 1045,
            ScentSword = 1046,
            Revive = 1050,
            Dash = 1051,
            HealingRain = 1055,
            Summon = 1060,
            Invisibility = 1075,
            StarofAccuracy = 1085,
            MagicShield = 1090,
            Stigma = 1095,
            Pray = 1100,
            Restore = 1105,
            Cyclone = 1110,
            FireCircle = 1120,
            Volcano = 1125,
            FireRing = 1150,
            Bomb = 1160,
            FireofHell = 1165,
            Nectar = 1170,
            AdvancedCure = 1175,
            FireMeteor = 1180,
            SpiritHealing = 1190,
            Meditation = 1195,
            Hercules = 1115,
            Disguise = 1210,
            Stun = 1220,
            Strike = 1230,
            WideStrike = 1250,
            SpeedGun = 1260,
            Robot = 1270,
            WaterElf = 1280,
            Penetration = 1290,
            Halt = 1300,
            Binding = 1310,
            FlyingMoon = 1320,
            DivineHare = 1350,
            NightDevil = 1360,
            Dance2 = 1380,
            Dance3 = 1385,
            Dance4 = 1390,
            Dance5 = 1395,
            Dance6 = 1400,
            Dance7 = 1405,
            Dance8 = 1410,
            CruelShade = 3050,
            Reflect = 3060,
            Dodge = 3080,
            Pervade = 3090,
            SummonGuard = 4000,
            SummonBat = 4010,
            SummonBatBoss = 4020,
            StandinBat = 4030,
            BloodyBat = 4050,
            FireEvil = 4060,
            Skeleton = 4070,
            SpeedLightning = 5001,
            Snow = 5010,
            StrandedMonster = 5020,
            Phoenix = 5030,
            Boom = 5040,
            Boreas = 5050,
            Seizer = 7000,
            Earthquake = 7010,
            Rage = 7020,
            Celestial = 7030,
            Roamer = 7040,
            RapidFire = 8000,
            Scatter = 8001,
            XPFly = 8002,
            AdvancedFly = 8003,
            ArrowRain = 8030,
            GuardSpell = 8036,
            Intensify = 9000,
            Bless = 9876,
            Poison = 10200,
            Bs_Cure = 10201,
            Bs_Meditation = 10202,

        }

then go to Attack.cs in Checks under region Melee find
Code:
				if(AttackedChar != null && !AttackedChar.Dead)
				{
and add this code under it
Code:
                    #region R8 hand chances
                    byte WeaponChance = (byte)Nano.Rand.Next(255);
                    if (CSocket.Client.Equipment.ContainsKey(4))
                    {

                        if (WeaponChance > 150)
                        {
                            switch (RightHand.ID)
                            {

                                case 480://Club
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Rage))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Rage, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 510://Glaive 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.WideStrike))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.WideStrike, X, Y);
                                        }
                                        break;
                                    }
                                case 561://Wand 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Snow))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Snow, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 560://Spear 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.SpeedGun))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.SpeedGun, X, Y);
                                        }
                                        break;
                                    }
                                case 530://Poleaxe 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Boreas))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Boreas, X, Y);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                    #endregion
                    #region Left hand chances
                    if (CSocket.Client.Equipment.ContainsKey(5))
                    {
                        WeaponChance = (byte)Nano.Rand.Next(255);
                        if (WeaponChance > 180)
                        {
                            switch (LeftHand.ID)
                            {

                                case 480://Club
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Rage))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Rage, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 510://Glaive 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.WideStrike))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.WideStrike, X, Y);
                                        }
                                        break;
                                    }
                                case 561://Wand 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Snow))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Snow, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 560://Spear 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.SpeedGun))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.SpeedGun, X, Y);
                                        }
                                        break;
                                    }
                                case 530://Poleaxe 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Boreas))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Boreas, X, Y);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                    #endregion
and add that code after
Code:
				else if(AttackedMob != null)
				{
to

thats done now go and find case 5010:
above that add
Code:
                #region Rage
                case 7020:
                    {
                        int Distance = 2;
                        Dictionary<int, Monster> ToDo = new Dictionary<int, Monster>();
                        Dictionary<int, int> Targets = new Dictionary<int, int>();
                        try
                        {
                            Monitor.Enter(Nano.Monsters);
                            foreach (KeyValuePair<int, Monster> Mob in Nano.Monsters)
                            {
                                if ((int)CSocket.Client.Map == Mob.Value.Map)
                                {
                                    if (Calculation.InRange(Mob.Value.X, Mob.Value.Y, CSocket.Client.X, CSocket.Client.Y, Distance))
                                    {
                                        if (Mob.Value.Info.Name == "Guard" || Mob.Value.Info.Name == "Patrol" || Mob.Value.Info.Name == "GuardReviver")
                                        {
                                            if (CSocket.Client.PKMode == Struct.PkType.PK)
                                            {
                                                if (!ToDo.ContainsKey(Mob.Value.UID))
                                                    ToDo.Add(Mob.Key, Mob.Value);
                                            }
                                        }
                                        else
                                        {
                                            if (!ToDo.ContainsKey(Mob.Value.UID))
                                                ToDo.Add(Mob.Key, Mob.Value);
                                        }
                                    }
                                }
                            }
                            //}
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                        finally
                        {
                            Monitor.Exit(Nano.Monsters);
                        }
                        try
                        {
                            Monitor.Enter(Nano.ClientPool);
                            foreach (KeyValuePair<int, ClientSocket> Clients in Nano.ClientPool)
                            {
                                ClientSocket ASocket = Clients.Value;
                                if ((int)CSocket.Client.Map == (int)ASocket.Client.Map && CSocket.Client.ID != ASocket.Client.ID)
                                {
                                    if (Calculation.InRange(ASocket.Client.X, ASocket.Client.Y, CSocket.Client.X, CSocket.Client.Y, Distance) && !ASocket.Client.Dead)
                                    {
                                        if (CheckMode(CSocket, ASocket))
                                        {
                                            int Damage = Calculation.Damage(CSocket.Client, ASocket.Client, 2, 0, 0);
                                            Damage = (Damage / 3);
                                            Calculation.doPlayer(CSocket, ASocket, Damage, 21);
                                            if (!Targets.ContainsKey(ASocket.Client.ID))
                                            {
                                                Targets.Add(ASocket.Client.ID, Damage);
                                                Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 15));
                                            }
                                        }
                                    }
                                }
                            }
                        }
                        catch (Exception e)
                        {
                            Console.WriteLine(e.ToString());
                        }
                        finally
                        {
                            Monitor.Exit(Nano.ClientPool);
                        }
                        foreach (KeyValuePair<int, Struct.TerrainNPC> TNPCS in Nano.TerrainNpcs)
                        {
                            Struct.TerrainNPC Tnpc = TNPCS.Value;
                            if ((int)CSocket.Client.Map == Tnpc.Map)
                            {
                                if (Calculation.InRange(Tnpc.X, Tnpc.Y, CSocket.Client.X, CSocket.Client.Y, Distance))
                                {
                                    int Damage = 0;
                                    if (CSocket.Client.MinAttack < CSocket.Client.MaxAttack)
                                    {
                                        Damage = Nano.Rand.Next(CSocket.Client.MinAttack, CSocket.Client.MaxAttack);
                                        Damage = (Damage / 3);
                                    }
                                    Calculation.doTNpc(CSocket, Tnpc, Damage, 21);
                                    if (!Targets.ContainsKey(Tnpc.UID))
                                    {
                                        Targets.Add(Tnpc.UID, Damage);
                                        Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 25));
                                    }
                                }
                            }
                        }
                        foreach (KeyValuePair<int, Monster> Mob in ToDo)
                        {
                            int Damage = Calculation.Damage(CSocket.Client, Mob.Value, 2, 0, 0);
                            Damage = (Damage / 3);
                            Calculation.doMonster(Mob.Value, Damage, 21, CSocket);
                            if (!Targets.ContainsKey(Mob.Value.UID))
                            {
                                Targets.Add(Mob.Key, Damage);
                                Calculation.SkillExp(Skill.ID, CSocket, (int)(Damage / 12));
                            }
                        }
                        ToDo.Clear();
                        ConquerPacket.ToLocal(ConquerPacket.MagicAttack(CSocket.Client.ID, Skill.ID, Skill.Level, Targets, CSocket.Client.X, CSocket.Client.Y), CSocket.Client.X, CSocket.Client.Y, (int)CSocket.Client.Map, 0, 0);
                        Targets.Clear();
                        break;
                    }

                #endregion
now you have rage working.
All Credits to samehvan

and plz release any tang that can help any one with CoEmu
taylor2846 is offline  
Thanks
3 Users
Old 07/30/2009, 19:40   #2
 
elite*gold: 0
Join Date: Aug 2004
Posts: 26
Received Thanks: 4
Thank you so much this will greatly help me.
Yaksha is offline  
Old 07/30/2009, 20:31   #3

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Thanks will try later.
Kiyono is offline  
Old 07/30/2009, 20:43   #4
 
elite*gold: 0
Join Date: Oct 2006
Posts: 75
Received Thanks: 17
maybe i done something wrong but aint working for me
gad-legion is offline  
Old 07/30/2009, 21:03   #5

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
It works ^^
Kiyono is offline  
Old 07/30/2009, 21:03   #6
 
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
Thank you taylor

Quote:
Originally Posted by gad-legion View Post
maybe i done something wrong but aint working for me
just follow the steps , may be u just confused with that part

Quote:
and add that code after

Code:
else if(AttackedMob != null)
				{
he meant that u should copy / past the lase code once again under that line

so , u put the next code 2wice
Code:
#region R8 hand chances
                    byte WeaponChance = (byte)Nano.Rand.Next(255);
                    if (CSocket.Client.Equipment.ContainsKey(4))
                    {

                        if (WeaponChance > 150)
                        {
                            switch (RightHand.ID)
                            {

                                case 480://Club
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Rage))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Rage, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 510://Glaive 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.WideStrike))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.WideStrike, X, Y);
                                        }
                                        break;
                                    }
                                case 561://Wand 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Snow))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Snow, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 560://Spear 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.SpeedGun))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.SpeedGun, X, Y);
                                        }
                                        break;
                                    }
                                case 530://Poleaxe 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Boreas))
                                        {

                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Boreas, X, Y);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                    #endregion
                    #region Left hand chances
                    if (CSocket.Client.Equipment.ContainsKey(5))
                    {
                        WeaponChance = (byte)Nano.Rand.Next(255);
                        if (WeaponChance > 180)
                        {
                            switch (LeftHand.ID)
                            {

                                case 480://Club
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Rage))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Rage, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 510://Glaive 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.WideStrike))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.WideStrike, X, Y);
                                        }
                                        break;
                                    }
                                case 561://Wand 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Snow))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Snow, CSocket.Client.X, CSocket.Client.Y);
                                        }
                                        break;
                                    }
                                case 560://Spear 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.SpeedGun))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.SpeedGun, X, Y);
                                        }
                                        break;
                                    }
                                case 530://Poleaxe 2Hand
                                    {
                                        if (Attacker.Skills.ContainsKey((int)Struct.SkillIds.Boreas))
                                        {
                                            NoTargetMagic(CSocket, (int)Struct.SkillIds.Boreas, X, Y);
                                        }
                                        break;
                                    }
                            }
                        }
                    }
                    #endregion
one under

Code:
if(AttackedChar != null && !AttackedChar.Dead)
				{
and the other under

Code:
else if(AttackedMob != null)
				{
that is it

thanks again taylor
samehvan is offline  
Thanks
1 User
Old 07/30/2009, 22:05   #7
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
np
taylor2846 is offline  
Old 07/30/2009, 23:26   #8
 
elite*gold: 0
Join Date: Oct 2006
Posts: 75
Received Thanks: 17
well my prob is i dont have any case 5010 not the one u mantioned samehvan but thx ,so i added rage above hercules and now works
gad-legion is offline  
Reply


Similar Threads Similar Threads
Adding more than 3 skills in DB-Bot doesn't work
08/01/2010 - SRO Private Server - 3 Replies
Hey All my bot use only 3 skills if i add more than 3 skills in attack skill list it only use the first 3 skills except the buffs it use all buffs i add i'm using bot: SRO-DB Bot v1.0b2
[Question]Adding Skills
08/22/2009 - CO2 Private Server - 1 Replies
How do you add skills? For example I want a skill for GMs only that uses magic and 1 hits everyone.
[HELP]After adding 2 skills...
04/23/2009 - CO2 Private Server - 5 Replies
//EDIT: NVM got it to work...
[Help] With adding skills in lotf
09/09/2008 - CO2 Private Server - 4 Replies
How exactly would i like add skills in lotf casue i want to add some more skills. I'll release it if some one could help me on how to do it :)
Adding Skills [LOFT]
08/24/2008 - CO2 Private Server - 1 Replies
#Edit : Already got the skill working,



All times are GMT +1. The time now is 16:24.


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.