Register for your free account! | Forgot your password?

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

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

Advertisement



companions show up but cant do anything else

Discussion on companions show up but cant do anything else within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
companions show up but cant do anything else

first companions where invisible, then i used the Fix Companions in Lotf 5165(or whatever version)

after that companions would appear but they do no follow you or attack.

iv searched and cant find a solution yet.

using Conquer-SX / LOFT 5165

this is what my companions.cs looks like

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

namespace ConquerSx.Game
{
    public class Companion
    {
        public uint MinAttack;
        public uint MaxAttack;
        public byte Level;
        public uint SkillUses;//0 if just melee
        public Location Loc;
        public Character Owner;
        public ushort CurHP;
        public ushort MaxHP;
        public uint Mesh;
        public uint EntityID;
        public string Name;
        public byte Direction;
        DateTime LastMovement = DateTime.Now;
        DateTime LastAttack = DateTime.Now;
        public PoisonType PoisonedInfo = null;
        public Companion(Character Owner, uint Type)
        {
            this.Owner = Owner;
            if (Database.CompanionInfos.Contains(Type))
            {
                CompanionInfo Cmp = (CompanionInfo)Database.CompanionInfos[Type];
                MinAttack = Cmp.MinAttack;
                MaxAttack = Cmp.MaxAttack;
                Level = Cmp.Level;
                SkillUses = Cmp.SkillUses;
                CurHP = Cmp.HP;
                MaxHP = Cmp.HP;
                Mesh = Cmp.Mesh;
                Name = Cmp.Name;
                EntityID = (uint)Program.Rnd.Next(400000, 500000);
                Direction = 0;

                Loc = Owner.Loc;

                World.H_Companions.Add(EntityID, this);
                World.Spawn(this, false);
            }
        }
        public void Dissappear()
        {
            if (World.H_Companions.Contains(EntityID))
            {
                World.H_Companions.Remove(EntityID);
                if (Owner.MyCompanion == this)
                    Owner.MyCompanion = null;
                World.Action(this, Packets.GeneralData(EntityID, 0, 0, 0, 135).Get);
            }
        }
        public void Step()
        {
            if (DateTime.Now > LastMovement.AddMilliseconds(250))
            {
                LastMovement = DateTime.Now;
                if (MyMath.PointDistance(Loc.X, Loc.Y, Owner.Loc.X, Owner.Loc.Y) <= 18)
                {
                    if (Owner.AtkMem.Target != 0 && Owner.AtkMem.Target != Owner.EntityID && (MyMath.PointDistance(Loc.X, Loc.Y, Owner.Loc.X, Owner.Loc.Y) <= 8))
                    {
                        if (SkillUses != 0 && DateTime.Now > LastAttack.AddMilliseconds(1000))
                        {
                            LastAttack = DateTime.Now;
                            uint Damage = (uint)Program.Rnd.Next((int)MinAttack, (int)MaxAttack);

                            if (World.H_Chars.Contains(Owner.AtkMem.Target))
                            {
                                Character C = (Character)World.H_Chars[Owner.AtkMem.Target];
                                if (C.Alive && C.Loc.Map == Loc.Map && (MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y) <= 10))
                                    C.TakeAttack(this, Damage, AttackType.Magic);
                            }
                            else if (World.H_Mobs.Contains(Loc.Map) && ((Hashtable)World.H_Mobs[Loc.Map]).Contains(Owner.AtkMem.Target))
                            {
                                Mob M = (Mob)((Hashtable)World.H_Mobs[Loc.Map])[Owner.AtkMem.Target];
                                if (M.Alive && M.Loc.Map == Loc.Map && (MyMath.PointDistance(Loc.X, Loc.Y, M.Loc.X, M.Loc.Y) <= 10))
                                    M.TakeAttack(this, Damage, AttackType.Magic);
                            }
                        }
                    }
                    else if (MyMath.PointDistance(Loc.X, Loc.Y, Owner.Loc.X, Owner.Loc.Y) >= 4)
                    {
                        GetDirection(Owner.Loc);
                        byte eDir = Direction;
                        bool Success = true;

                        while (!FreeToGo())
                        {
                            Direction = (byte)((Direction + 1) % 8);
                            if (Direction == eDir)
                            {
                                Success = false;
                                break;
                            }
                            Success = true;
                        }
                        if (!Success)
                            JumpToOwner();
                        else
                        {
                            Loc.Walk(Direction);
                            World.Action(this, Packets.Movement(EntityID, Direction).Get);
                            World.Spawn(this, true);
                        }
                    }
                }
                else
                    JumpToOwner();
            }
        }
        void JumpToOwner()
        {
            Loc.X = (ushort)(Owner.Loc.X + Program.Rnd.Next(7) - Program.Rnd.Next(7));
            Loc.Y = (ushort)(Owner.Loc.Y + Program.Rnd.Next(7) - Program.Rnd.Next(7));
            World.Action(this, Packets.GeneralData(EntityID, Loc.X, Loc.Y, 0, 0, 137).Get);
            World.Spawn(this, true);
        }

        void GetDirection(Location Target)
        {
            byte ToDir = (byte)(7 - (Math.Floor(MyMath.PointDirecton(Loc.X, Loc.Y, Target.X, Target.Y) / 45 % 8)) - 1 % 8);
            Direction = (byte)((int)ToDir % 8);
        }
        bool FreeToGo()
        {
            Location eLoc = Loc;
            eLoc.Walk(Direction);
            if (!DMaps.H_DMaps.Contains(Loc.Map))
                return true;
            if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess)
                return false;
            return true;
        }
    }
}
macht102 is offline  
Old 10/21/2010, 23:18   #2
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
I really need help on this one.
if anyone knows where to look or where i should be looking id appreciate it.

even better if i can get a fix.
macht102 is offline  
Old 10/22/2010, 00:46   #3
 
killersub's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 884
Received Thanks: 211
#edit

my bad didn't read well lol.

well it might have to do with Companions.cs in your source.
killersub is offline  
Old 10/22/2010, 01:29   #4
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
i posted my companion.cs in first post.

does anything seem off?
macht102 is offline  
Old 10/22/2010, 14:02   #5
 
elite*gold: 0
Join Date: Sep 2008
Posts: 128
Received Thanks: 8
StefanHAKER is offline  
Old 10/22/2010, 22:17   #6
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
if you have not noticed i already said i used that fix, all it did was make the companions appear.
macht102 is offline  
Old 10/22/2010, 22:45   #7
 
elite*gold: 0
Join Date: Oct 2010
Posts: 6
Received Thanks: 2
Did you put these in OldCODB/Companions.txt:

Code:
9000 3500 3500 90 1000 10000 920 IronGuard
9001 4500 4500 100 1001 20000 920 CopperGuard
9002 5500 5500 110 1001 35000 920 SilverGuard
9003 6500 6500 120 1002 60000 920 GoldGuard
9005 28 28 15 1002 3000 148 GhostBat
9006 66 66 40 1002 6000 148 FastBat
9007 195 195 70 1002 15000 148 SwiftBat
9008 448 448 100 1002 60000 148 MagicBat
9010 28 28 15 1002 10000 548 GhostBatBoss
9011 66 66 40 1002 20000 548 FastBatBoss
9012 195 195 70 1002 35000 548 SwiftBatBoss
9013 448 448 100 1002 60000 548 MagicBatBoss
9015 14 14 15 0 3000 206 EvilBatA
9016 30 50 40 0 6000 206 EvilBatB
9017 50 90 70 0 15000 206 EvilBatC
9018 70 130 100 0 30000 206 EvilBatD
9020 16 16 15 1002 3000 209 FireRatA
9021 30 60 40 1002 15000 209 FireRatB
9022 130 130 70 1002 15000 209 FireRatC
9023 400 400 100 1002 30000 209 FireRatD
9025 14 14 15 0 10000 211 SkeletonA
9026 30 50 40 0 20000 211 SkeletonB
9027 50 90 70 0 35000 211 SkeletonC
9028 70 130 100 0 60000 211 SkeletonD
Raptоr is offline  
Old 10/23/2010, 02:54   #8
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
yep i put those in the companions.txt in OldCODB
macht102 is offline  
Old 10/24/2010, 06:11   #9
 
macht102's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 36
Received Thanks: 1
still trying to fix this bug, any other suggestions?
macht102 is offline  
Reply


Similar Threads Similar Threads
Fix Companions in Lotf 5165(or whatever version)
03/28/2012 - CO2 PServer Guides & Releases - 61 Replies
Change the SpawnEntity packet for Companions to the one listed below. public static COPacket SpawnEntity(Game.Companion Cmp) { byte Packet = new byte; COPacket P = new COPacket(Packet); P.WriteInt16((ushort)(Packet.Length - 8)); P.WriteInt16((ushort)10014); P.WriteInt32(Cmp.Mesh);
Mini Project: Companions/Bots
10/26/2010 - CO2 Private Server - 37 Replies
<REVAMP: October 26> So I'm gaining an interest in artificial intelligence again. With hellmouth slowly being rebuilt, this is something I'd like to PROPERLY add (not the simple test versions I've coded before) this for the open beta stage of the server (month or so away minimum) My thoughts.... If you can limit the FUNCTION of AI and limit the SCOPE of AI then it shouldn't be very difficult to create a near player like experience. As far as function and scope goes we really only need...
[Fix] Companions Disappear (5165)
03/20/2010 - CO2 PServer Guides & Releases - 14 Replies
None of you deserve this. #request close
[5165] Summoning Companions
02/14/2010 - CO2 Private Server - 10 Replies
Hey everyone, I'm using the 5165 source and I was going to replace the bat with something cooler ... but the bat, skeleton, FireEvil, and BatBoss doesn't work. Instead of summoning a bat, it does this effect (which does nothing): http://i746.photobucket.com/albums/xx110/brokentw ilight91/Capture3.png Help would be appreciated. Thank you =s
Hello fellow companions i was seeking some help.
11/25/2006 - Conquer Online 2 - 3 Replies
Hi, i recently started using a bot to lvl myself but im not quite convinced with it, my one doesn't ignite xp skills such as cyclone..and also i put in the bot to pick up items such as meteors as there is a option to do that but when theres one on the floor he doesn't pick it up..is their a new bot lvler that does all that? i tried everyway with mine but still doesnt pick items up, i looked throguh the exploits and hacks but i did not see anything as im new to all this i didn't understand much....



All times are GMT +2. The time now is 08:47.


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.