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 12:36

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

Advertisement



[Release] Elite-CoEmu OpenSource Revesions

Discussion on [Release] Elite-CoEmu OpenSource Revesions within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old 07/02/2010, 01:28   #331
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
Quote:
Originally Posted by t_dubble_uu View Post
rev[175]
Fixed Mob movement
why is the mob's not moveing?
taylor2846 is offline  
Old 07/02/2010, 03:06   #332
 
t_dubble_uu's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 267
Received Thanks: 180
Quote:
Originally Posted by taylor2846 View Post
why is the mob's not moveing?
This will fix it so mobs can move and not overlap replace this void in entities/monster.cs

Code:
public void AttackMove(int Target, bool First)
        {
            if (Move != null)
            {
                if (Move.Enabled)
                    return;
            }
            if (Moving && First)
                return;
            if (CurrentHP == 0)
                return;
            if (!World.Monsters.ContainsKey(UID))
            {
                if (Move != null)
                {
                    if (Move.Enabled)
                        Move.Stop();
                    Move.Dispose();
                }
                return;
            }
            if (!World.ClientPool.ContainsKey(Target))
            {
                if (Move != null)
                {
                    if (Move.Enabled)
                        Move.Stop();
                    Move.Dispose();
                }
                return;
            }
            Move = new System.Timers.Timer();
            Move.Elapsed += delegate { MoveAgain(Target); };
            Move.Interval = Info.Speed;
            Move.AutoReset = false;
            Moving = true;
            int AttackRange = Info.AttackRange;
            ClientSocket Attacked = World.ClientPool[Target];
            if (Attacked.Client.Dead)
            {
                Moving = false;
                Move = null;
                return;
            }
            if (Attacked.Client.Flying)
            {
                Moving = false;
                Move = null;
                return;
            }
            if (Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, Info.ViewDistance) && !Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, AttackRange))
            {
                byte ToDir = (byte)(7 - (Math.Floor(Calculation.Direction(X, Y, Attacked.Client.Loc.X, Attacked.Client.Loc.Y) / 45 % 8)) - 1 % 8);
                ToDir = (byte)((int)ToDir % 8);
                short AddX = 0;
                short AddY = 0;
                if (ToDir == 255)
                    ToDir = 7;
                switch (ToDir)
                {
                    case 0:
                        {
                            AddY = 1;
                            break;
                        }
                    case 1:
                        {
                            AddX = -1;
                            AddY = 1;
                            break;
                        }
                    case 2:
                        {
                            AddX = -1;
                            break;
                        }
                    case 3:
                        {
                            AddX = -1;
                            AddY = -1;
                            break;
                        }
                    case 4:
                        {
                            AddY = -1;
                            break;
                        }
                    case 5:
                        {
                            AddX = 1;
                            AddY = -1;
                            break;
                        }
                    case 6:
                        {
                            AddX = 1;
                            break;
                        }
                    case 7:
                        {
                            AddY = 1;
                            AddX = 1;
                            break;
                        }
                }
                if (PICMaps.PMaps.ContainsKey(Map))
                {
                    Monitor.Enter(World.Monsters);
                    try
                    {
                        if (!PICMaps.CheckLocation(Map, (ushort)(X + AddX), (ushort)(Y + AddY)))
                        {
                            Move = null;
                            Moving = false;
                            return;
                        }
                        foreach (Monster Mob in World.Monsters.Values)
                        {                           
                            if (Mob.Map == Map && Mob.X == (ushort)(X + AddX) && Mob.Y == (ushort)(Y + AddY))
                            {
                                Move = null;
                                Moving = false;
                                return;
                            }
                        }
                    }
                    catch (Exception EXC) { Program.WriteLine(EXC); }
                    finally
                    {
                        Monitor.Exit(World.Monsters);
                    }
                }
                X += AddX;
                Y += AddY;
                CoPacket.ToLocal(CoPacket.Walk(ToDir, UID), X, Y, Map, 0, 0);
                //CoPacket.ToLocal(CoPacket.Chat(0, Info.Name, "ALL", "Rawr! I must move to attack " + Attacked.Client.Name + "!, But I cannot for I am too lazy.", Struct.ChatType.Talk), X, Y, Map, 0, 0);
                Move.Start();
            }
            else if (Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, Info.ViewDistance) && Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, AttackRange))
            {
                int Damage = 0;
                if (Info.MinAttack < Info.MaxAttack)
                    Damage = World.Rand.Next(Info.MinAttack, Info.MaxAttack);
                else
                    Damage = World.Rand.Next(Info.MaxAttack, Info.MinAttack);
                Damage -= Attacked.Client.Defense;
                if (Attacked.Client.Reborn == 1)
                {
                    Damage = (int)Math.Floor(Damage * .7);
                }
                else if (Attacked.Client.Reborn == 2)
                {
                    Damage = (int)Math.Floor(Damage * .7);
                    Damage = (int)Math.Floor(Damage * .5);
                }
                double Tort = 0;
                Tort += Attacked.Client.NTG * 0.02;
                Tort += Attacked.Client.RTG * 0.04;
                Tort += Attacked.Client.STG * 0.06;
                Damage = (int)Math.Floor(Damage * (1 - Tort));
                if (Attacked.Client.Bless > 0)
                {
                    Damage = (int)Math.Floor(Damage * (1 - (Attacked.Client.Bless * 0.01)));
                }
                if (Damage < 0)
                    Damage = 1;
                if ((Attacked.Client.isGM || Attacked.Client.isPM) && Attacked.Client.Invincible)
                    Damage = 0;
                Calculation.doPlayer(this, Attacked, Damage, 2);
                Move.Interval = Info.AttackSpeed;
                Move.Start();
                if (Info.Name == "Guard1")
                    CoPacket.ToLocal(CoPacket.Chat(0, Info.Name, "ALL", "How dare you try to PK here, " + Attacked.Client.Name + ", you must die!", Struct.ChatType.Talk), X, Y, Map, 0, 0);
                else if (Info.Name == "Guard2")
                    CoPacket.ToLocal(CoPacket.Chat(0, Info.Name, "ALL", "How dare you shows your shamed face here, " + Attacked.Client.Name + ", you must die!", Struct.ChatType.Talk), X, Y, Map, 0, 0);
                //ConquerPacket.ToLocal(ConquerPacket.Chat(0, Info.Name, "ALL", "Die, " + Attacked.Client.Name +"!!!", Struct.ChatType.Talk), X, Y, Map, 0, 0);
            }
            else
            {
                Move = null;
                Moving = false;
            }
        }
t_dubble_uu is offline  
Thanks
2 Users
Old 07/02/2010, 07:47   #333
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
Mobs will still not move!
taylor2846 is offline  
Old 07/02/2010, 15:03   #334
 
elite*gold: 0
Join Date: Aug 2006
Posts: 18
Received Thanks: 0
i gotta say i am following closely this thread because i think that this source is going to become the best by far!!!! you guys are doing excellent work and very professional...well done
gxaris is offline  
Old 07/02/2010, 17:57   #335
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
Quote:
Originally Posted by t_dubble_uu View Post
This will fix it so mobs can move and not overlap replace this void in entities/monster.cs

Code:
public void AttackMove(int Target, bool First)
        {
            if (Move != null)
            {
                if (Move.Enabled)
                    return;
            }
            if (Moving && First)
                return;
            if (CurrentHP == 0)
                return;
            if (!World.Monsters.ContainsKey(UID))
            {
                if (Move != null)
                {
                    if (Move.Enabled)
                        Move.Stop();
                    Move.Dispose();
                }
                return;
            }
            if (!World.ClientPool.ContainsKey(Target))
            {
                if (Move != null)
                {
                    if (Move.Enabled)
                        Move.Stop();
                    Move.Dispose();
                }
                return;
            }
            Move = new System.Timers.Timer();
            Move.Elapsed += delegate { MoveAgain(Target); };
            Move.Interval = Info.Speed;
            Move.AutoReset = false;
            Moving = true;
            int AttackRange = Info.AttackRange;
            ClientSocket Attacked = World.ClientPool[Target];
            if (Attacked.Client.Dead)
            {
                Moving = false;
                Move = null;
                return;
            }
            if (Attacked.Client.Flying)
            {
                Moving = false;
                Move = null;
                return;
            }
            if (Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, Info.ViewDistance) && !Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, AttackRange))
            {
                byte ToDir = (byte)(7 - (Math.Floor(Calculation.Direction(X, Y, Attacked.Client.Loc.X, Attacked.Client.Loc.Y) / 45 % 8)) - 1 % 8);
                ToDir = (byte)((int)ToDir % 8);
                short AddX = 0;
                short AddY = 0;
                if (ToDir == 255)
                    ToDir = 7;
                switch (ToDir)
                {
                    case 0:
                        {
                            AddY = 1;
                            break;
                        }
                    case 1:
                        {
                            AddX = -1;
                            AddY = 1;
                            break;
                        }
                    case 2:
                        {
                            AddX = -1;
                            break;
                        }
                    case 3:
                        {
                            AddX = -1;
                            AddY = -1;
                            break;
                        }
                    case 4:
                        {
                            AddY = -1;
                            break;
                        }
                    case 5:
                        {
                            AddX = 1;
                            AddY = -1;
                            break;
                        }
                    case 6:
                        {
                            AddX = 1;
                            break;
                        }
                    case 7:
                        {
                            AddY = 1;
                            AddX = 1;
                            break;
                        }
                }
                if (PICMaps.PMaps.ContainsKey(Map))
                {
                    Monitor.Enter(World.Monsters);
                    try
                    {
                        if (!PICMaps.CheckLocation(Map, (ushort)(X + AddX), (ushort)(Y + AddY)))
                        {
                            Move = null;
                            Moving = false;
                            return;
                        }
                        foreach (Monster Mob in World.Monsters.Values)
                        {                           
                            if (Mob.Map == Map && Mob.X == (ushort)(X + AddX) && Mob.Y == (ushort)(Y + AddY))
                            {
                                Move = null;
                                Moving = false;
                                return;
                            }
                        }
                    }
                    catch (Exception EXC) { Program.WriteLine(EXC); }
                    finally
                    {
                        Monitor.Exit(World.Monsters);
                    }
                }
                X += AddX;
                Y += AddY;
                CoPacket.ToLocal(CoPacket.Walk(ToDir, UID), X, Y, Map, 0, 0);
                //CoPacket.ToLocal(CoPacket.Chat(0, Info.Name, "ALL", "Rawr! I must move to attack " + Attacked.Client.Name + "!, But I cannot for I am too lazy.", Struct.ChatType.Talk), X, Y, Map, 0, 0);
                Move.Start();
            }
            else if (Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, Info.ViewDistance) && Calculation.InRange(Attacked.Client.Loc.X, Attacked.Client.Loc.Y, X, Y, AttackRange))
            {
                int Damage = 0;
                if (Info.MinAttack < Info.MaxAttack)
                    Damage = World.Rand.Next(Info.MinAttack, Info.MaxAttack);
                else
                    Damage = World.Rand.Next(Info.MaxAttack, Info.MinAttack);
                Damage -= Attacked.Client.Defense;
                if (Attacked.Client.Reborn == 1)
                {
                    Damage = (int)Math.Floor(Damage * .7);
                }
                else if (Attacked.Client.Reborn == 2)
                {
                    Damage = (int)Math.Floor(Damage * .7);
                    Damage = (int)Math.Floor(Damage * .5);
                }
                double Tort = 0;
                Tort += Attacked.Client.NTG * 0.02;
                Tort += Attacked.Client.RTG * 0.04;
                Tort += Attacked.Client.STG * 0.06;
                Damage = (int)Math.Floor(Damage * (1 - Tort));
                if (Attacked.Client.Bless > 0)
                {
                    Damage = (int)Math.Floor(Damage * (1 - (Attacked.Client.Bless * 0.01)));
                }
                if (Damage < 0)
                    Damage = 1;
                if ((Attacked.Client.isGM || Attacked.Client.isPM) && Attacked.Client.Invincible)
                    Damage = 0;
                Calculation.doPlayer(this, Attacked, Damage, 2);
                Move.Interval = Info.AttackSpeed;
                Move.Start();
                if (Info.Name == "Guard1")
                    CoPacket.ToLocal(CoPacket.Chat(0, Info.Name, "ALL", "How dare you try to PK here, " + Attacked.Client.Name + ", you must die!", Struct.ChatType.Talk), X, Y, Map, 0, 0);
                else if (Info.Name == "Guard2")
                    CoPacket.ToLocal(CoPacket.Chat(0, Info.Name, "ALL", "How dare you shows your shamed face here, " + Attacked.Client.Name + ", you must die!", Struct.ChatType.Talk), X, Y, Map, 0, 0);
                //ConquerPacket.ToLocal(ConquerPacket.Chat(0, Info.Name, "ALL", "Die, " + Attacked.Client.Name +"!!!", Struct.ChatType.Talk), X, Y, Map, 0, 0);
            }
            else
            {
                Move = null;
                Moving = false;
            }
        }
I kinda got a problem lol...when I logg in and den re-logg I spawn at BirthVillage place...like when I log-in it does dat idk y lol...any ideas?

also, I dont think my mobs are moving still =/
killersub is offline  
Old 07/02/2010, 17:58   #336
 
taylor2846's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 469
Received Thanks: 94
no mobs still dont move.
i was hoping someone could tell me why mobs still dont move.
taylor2846 is offline  
Old 07/03/2010, 06:49   #337
 
t_dubble_uu's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 267
Received Thanks: 180
Quote:
Originally Posted by taylor2846 View Post
no mobs still dont move.
i was hoping someone could tell me why mobs still dont move.
If i can get some free time this weekend i will help you out over teamviewer or something but i have 9 family members coming to my house for the weekend so i wont have much time to be on the pc because i will be entertaining them. If not it will be first thing tuesday

Quote:
Originally Posted by gxaris View Post
i gotta say i am following closely this thread because i think that this source is going to become the best by far!!!! you guys are doing excellent work and very professional...well done
Thank you its always good to see ppl that appreciate our work. If you need any help dont hesitate to ask.
t_dubble_uu is offline  
Thanks
2 Users
Old 07/03/2010, 18:46   #338
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
if you use source in 5165 version, please post the pmaps to me?

#Edit
Thanks...
felipeboladao is offline  
Old 07/03/2010, 18:50   #339
 
xSynthesis's Avatar
 
elite*gold: 0
Join Date: Feb 2010
Posts: 80
Received Thanks: 29
Quote:
Originally Posted by felipeboladao View Post
if you use source in 5165 version, please post the pmaps to me?
I need them aswell. Couldn't find them either here or in the folder. D=
xSynthesis is offline  
Old 07/03/2010, 19:00   #340

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
Quote:
Originally Posted by felipeboladao View Post
if you use source in 5165 version, please post the pmaps to me?

#Edit
Thanks...
Can't you make your own?
Kiyono is offline  
Old 07/03/2010, 19:17   #341
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
I convert all, more time to log into the game, do not enter ..
felipeboladao is offline  
Old 07/04/2010, 12:12   #342
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
has saving accounts been fixed yet because i can seam to login after i change the mysqlhandler.dll but if i log out i end right back to birth it seams the accounts dont save when you log out or even use /save
BioHazarxPaul is offline  
Old 07/04/2010, 15:03   #343
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at WorldServer.Structures.MonsterSpawn.Respawn() in C:\Documents and Settings\Administrator\Desktop\5095_5165 Source\WorldServer\Structures\Monsters\MonsterSpaw n.cs:line 88
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(Exceptio nResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKe y key, TValue value, Boolean add)
BioHazarxPaul is offline  
Old 07/04/2010, 15:38   #344

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 924
Quote:
Originally Posted by SilentKill View Post
has saving accounts been fixed yet because i can seam to login after i change the mysqlhandler.dll but if i log out i end right back to birth it seams the accounts dont save when you log out or even use /save
They don't? The last time I tried this source, char saving worked.
Kiyono is offline  
Old 07/04/2010, 20:29   #345
 
BioHazarxPaul's Avatar
 
elite*gold: 0
Join Date: Nov 2005
Posts: 548
Received Thanks: 93
well i got the newest one rev175 and they dont seam to be saving but the items the person wears saves fine
BioHazarxPaul is offline  
Reply


Similar Threads Similar Threads
[Release] Elite-CoEmu 5095 Source
09/27/2013 - CO2 PServer Guides & Releases - 126 Replies
Ok ive decided to release my older modified coemu source because ive remade it and fixed almost everything in it. Here is some info about this source: GuildWars = Finished. Talis up scores threw hole gw and the guild with the most at the end wins. DisCity = Done. Nobility = Done. Added a GUI instead of Console. MultiThreaded to add stability. Fixed password on First Log, it now reads pw set from register script. Added Config file to load settings db / ip / ports / number of noble...
[Release] Elite CoEmu (rev 80) with partial Duelist/Companion System
09/12/2013 - CO2 PServer Guides & Releases - 11 Replies
Ok so I wrote this thread earlier and apparently closed the tab while raring/uploading the source... my bad. Basically to save people time I'm releasing my FIRST version of the duelist bots I was coding. This is the worst version I have but it works and doesn't have any massive bugs (for the amount coded). I'm releasing it because I'm re-coding every bot feature and making it more modular/self contained so I can transfer it to the new revision and any other sources in the future. I'm also...
[Release]Website for Elite-CoEmu Source
07/10/2010 - CO2 PServer Guides & Releases - 9 Replies
any information u want to know post it and i'll gladly answer it but first please read the readme included with the site if u still have questions feel free to pm me or post in this thread again please read the readme included with the file befor asking questions Update: P.S. this only works with the 5095 part of it right now ImageShack Album - 1 image of updated website
[Release] 1v1 Pk Event for Elite-CoEmu
06/06/2010 - CO2 PServer Guides & Releases - 14 Replies
Here is my first event ive coded. Its a 1 v 1 Pk Event where the winner gets a prize First add a new .cs file in Structures/features folder and name it what ever u want. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading;



All times are GMT +2. The time now is 12:36.


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.