|
You last visited: Today at 20:56
Advertisement
Mobspeed?
Discussion on Mobspeed? within the CO2 Private Server forum part of the Conquer Online 2 category.
05/07/2010, 10:08
|
#1
|
elite*gold: 0
Join Date: May 2010
Posts: 33
Received Thanks: 9
|
Mobspeed?
There is no1 looking at my last post about changing mobspeed, well like 1 each day :s weird..
Well to the problem..
The mobs (ALL mobs) walk very slow. Like when you have walk mode with your character, i changed mobspeed in both mobinfo.txt and mob.cs but still no change =/
Can someone help me?
|
|
|
05/08/2010, 07:26
|
#2
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
BUMP. SOMEONE PLEASE HELP US SOLVE THIS.
THIS IS DRIVING ME CRAZY TOO.
|
|
|
05/08/2010, 07:41
|
#3
|
elite*gold: 0
Join Date: Jan 2007
Posts: 177
Received Thanks: 57
|
i've only just started coding my private server, but if i remember correctly, there's a speed byte in the packet for entity movement. (0 = walk, 1 = run)
|
|
|
05/08/2010, 13:16
|
#4
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Yeah, the movement packet has a bool in it at offset 9.
Its all on the wiki you know?
|
|
|
05/08/2010, 14:10
|
#5
|
elite*gold: 0
Join Date: May 2010
Posts: 33
Received Thanks: 9
|
Quote:
Originally Posted by Korvacs
Yeah, the movement packet has a bool in it at offset 9.
Its all on the wiki you know?
|
And thats mean?
Sorry im not a supercoder ^^
Can you tell me what to do please?
|
|
|
05/08/2010, 16:45
|
#6
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
EntityMove doesn't exist.
This is what 5165 has:
Code:
public static COPacket Movement(uint UID, byte Dir)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteInt32((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
This is the mob movement problem...
It's highlighted in red
Code:
#region Player Target
if (PlayerTarget != null && (PlayerTarget.CanBeMeleed || AtkType != AttackType.Melee) && PlayerTarget.Alive && PlayerTarget.MyClient != null && MyMath.PointDistance(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) < Math.Max(15, (int)AttackDist) && (Type != MobBehaveour.HuntMobsAndBlue || PlayerTarget.BlueName))
{
if (MyMath.PointDistance(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) >= AttackDist)
{
byte ToDir = (byte)(7 - (Math.Floor(MyMath.PointDirecton(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) / 45 % 8)) - 1 % 8);
Direction = (byte)((int)ToDir % 8);
Location eLoc = Loc;
eLoc.Walk(Direction);
System.Collections.Hashtable H = (System.Collections.Hashtable)World.H_Mobs[Loc.Map];
bool PlaceFree = true;
if (DMaps.Loaded)
{
if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;
}
foreach (Mob M in H.Values)
if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
{
PlaceFree = false;
break;
}
if (PlaceFree)
{
World.Action(this, Packets.Movement(EntityID, Direction).Get);
World.Spawn(this, true);
Loc.Walk(Direction);
}
else
{
for (int i = 0; i < 7; i++)
{
PlaceFree = true;
eLoc = Loc;
Direction = (byte)((Direction + 1) % 8);
eLoc.Walk(Direction);
if (DMaps.Loaded)
if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;
foreach (Mob M in H.Values)
if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
{
PlaceFree = false;
break;
}
[COLOR="Red"]if (PlaceFree)
{
World.Action(this, Packets.Movement(EntityID, Direction).Get);
World.Spawn(this, true);
Loc.Walk(Direction);
break;
}[/COLOR]
}
}
}
else
{
if (MyMath.ChanceSuccess(15) || Type == MobBehaveour.HuntMobsAndBlue)
PlayerTarget.TakeAttack(this, PrepareAttack(), AtkType);
else
PlayerTarget.TakeAttack(this, 0, AtkType);
}
}
else PlayerTarget = null;
#endregion
that's how they move.
If you double the code, the mob will walk twice in a row.
I'm still working on it running.
EDIT:
It's also here:
Code:
if (Alive && DateTime.Now > LastMove.AddMilliseconds(1000))
{
LastMove = DateTime.Now;
if ((Type == MobBehaveour.HuntPlayers || Type == MobBehaveour.HuntMobsAndBlue) && PlayerTarget == null && MobTarget == null)
{
byte NDist = 10; // Distance they can see you by
byte MaxDist = 10;
foreach (Character C in World.H_Chars.Values)
{
if (C.Loc.Map == Loc.Map)
{
if (C.Alive)
{
if (C.CanBeMeleed || AtkType != AttackType.Melee)
{
byte Dst = (byte)MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y);
if (Dst <= MaxDist && Dst < NDist)
{
if (Type != MobBehaveour.HuntMobsAndBlue || C.BlueName)
{
NDist = (byte)MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y);
PlayerTarget = C;
}
}
}
}
}
}
}
|
|
|
05/08/2010, 18:58
|
#7
|
elite*gold: 0
Join Date: May 2010
Posts: 33
Received Thanks: 9
|
Quote:
Originally Posted by -Spirits-
EntityMove doesn't exist.
This is what 5165 has:
Code:
public static COPacket Movement(uint UID, byte Dir)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteInt32((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
This is the mob movement problem...
It's highlighted in red
Code:
#region Player Target
if (PlayerTarget != null && (PlayerTarget.CanBeMeleed || AtkType != AttackType.Melee) && PlayerTarget.Alive && PlayerTarget.MyClient != null && MyMath.PointDistance(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) < Math.Max(15, (int)AttackDist) && (Type != MobBehaveour.HuntMobsAndBlue || PlayerTarget.BlueName))
{
if (MyMath.PointDistance(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) >= AttackDist)
{
byte ToDir = (byte)(7 - (Math.Floor(MyMath.PointDirecton(Loc.X, Loc.Y, PlayerTarget.Loc.X, PlayerTarget.Loc.Y) / 45 % 8)) - 1 % 8);
Direction = (byte)((int)ToDir % 8);
Location eLoc = Loc;
eLoc.Walk(Direction);
System.Collections.Hashtable H = (System.Collections.Hashtable)World.H_Mobs[Loc.Map];
bool PlaceFree = true;
if (DMaps.Loaded)
{
if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;
}
foreach (Mob M in H.Values)
if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
{
PlaceFree = false;
break;
}
if (PlaceFree)
{
World.Action(this, Packets.Movement(EntityID, Direction).Get);
World.Spawn(this, true);
Loc.Walk(Direction);
}
else
{
for (int i = 0; i < 7; i++)
{
PlaceFree = true;
eLoc = Loc;
Direction = (byte)((Direction + 1) % 8);
eLoc.Walk(Direction);
if (DMaps.Loaded)
if (((DMap)DMaps.H_DMaps[Loc.Map]).GetCell(eLoc.X, eLoc.Y).NoAccess) PlaceFree = false;
foreach (Mob M in H.Values)
if (M != this && M.Loc.X == eLoc.X && M.Loc.Y == eLoc.Y && M.Alive)
{
PlaceFree = false;
break;
}
[COLOR="Red"]if (PlaceFree)
{
World.Action(this, Packets.Movement(EntityID, Direction).Get);
World.Spawn(this, true);
Loc.Walk(Direction);
break;
}[/COLOR]
}
}
}
else
{
if (MyMath.ChanceSuccess(15) || Type == MobBehaveour.HuntMobsAndBlue)
PlayerTarget.TakeAttack(this, PrepareAttack(), AtkType);
else
PlayerTarget.TakeAttack(this, 0, AtkType);
}
}
else PlayerTarget = null;
#endregion
that's how they move.
If you double the code, the mob will walk twice in a row.
I'm still working on it running.
EDIT:
It's also here:
Code:
if (Alive && DateTime.Now > LastMove.AddMilliseconds(1000))
{
LastMove = DateTime.Now;
if ((Type == MobBehaveour.HuntPlayers || Type == MobBehaveour.HuntMobsAndBlue) && PlayerTarget == null && MobTarget == null)
{
byte NDist = 10; // Distance they can see you by
byte MaxDist = 10;
foreach (Character C in World.H_Chars.Values)
{
if (C.Loc.Map == Loc.Map)
{
if (C.Alive)
{
if (C.CanBeMeleed || AtkType != AttackType.Melee)
{
byte Dst = (byte)MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y);
if (Dst <= MaxDist && Dst < NDist)
{
if (Type != MobBehaveour.HuntMobsAndBlue || C.BlueName)
{
NDist = (byte)MyMath.PointDistance(Loc.X, Loc.Y, C.Loc.X, C.Loc.Y);
PlayerTarget = C;
}
}
}
}
}
}
}
|
Yeah, double the code makes the mob lag forward once they move 
But actually, the running problem is it somewhere in mob.cs or? ^^
Ya im working on it too
|
|
|
05/08/2010, 19:20
|
#8
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
Quote:
Originally Posted by NeoN[PM]
Yeah, double the code makes the mob lag forward once they move 
But actually, the running problem is it somewhere in mob.cs or? ^^
Ya im working on it too
|
No, i think it's the packet.
I have no idea tho.
I'm looking into it. =[
|
|
|
05/08/2010, 23:36
|
#9
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
All on there.
|
|
|
05/09/2010, 01:05
|
#10
|
elite*gold: 0
Join Date: May 2010
Posts: 33
Received Thanks: 9
|
Quote:
Originally Posted by Korvacs
All on there.
|
Like i said, im not a super coder and i have no clue what i am supposed to do with that packet_entitymove thingy
Would you like to help?
|
|
|
05/09/2010, 02:49
|
#11
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
Quote:
Originally Posted by Korvacs
All on there.
|
You know I'm trying to learn how to create packets right now.
If you would help me make my weather packet and explain to me why the values are such that in the code then maybe I could help other people?
|
|
|
05/09/2010, 13:01
|
#12
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Alright heres your standard Entity Movement Packet:
Code:
public static COPacket Movement(uint UID, byte Dir)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteInt32((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
What you basically need to do is to modify the packet so that you can optionally make the mob walk or run, please note that making this change will require alot of changes to the source wherever this packet is created.
Code:
public static COPacket Movement(uint UID, byte Dir, bool Running)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteByte((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteByte((byte)Running ? 0 : 1);
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
Ok so what ive done is ive added a bool which allows you to set if the entity is running or walking, the ? 0 : 1 basically says that the value will be converted to either 0 or 1 depending on if the bool is true or false.
It turns out that the 5165 movement packet is different from the 5100 packet, so ill have to make changes to the wiki to reflect that.
As for learning packet structures i created a page on the wiki about understand what an offset is, and that should hopefully help you to understand how packets are layed out the way they are:
|
|
|
05/09/2010, 14:18
|
#13
|
elite*gold: 0
Join Date: May 2010
Posts: 33
Received Thanks: 9
|
Quote:
Originally Posted by Korvacs
Alright heres your standard Entity Movement Packet:
Code:
public static COPacket Movement(uint UID, byte Dir)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteInt32((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
What you basically need to do is to modify the packet so that you can optionally make the mob walk or run, please note that making this change will require alot of changes to the source wherever this packet is created.
Code:
public static COPacket Movement(uint UID, byte Dir, bool Running)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteByte((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteByte((byte)Running ? 0 : 1);
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
Ok so what ive done is ive added a bool which allows you to set if the entity is running or walking, the ? 0 : 1 basically says that the value will be converted to either 0 or 1 depending on if the bool is true or false.
It turns out that the 5165 movement packet is different from the 5100 packet, so ill have to make changes to the wiki to reflect that.
As for learning packet structures i created a page on the wiki about understand what an offset is, and that should hopefully help you to understand how packets are layed out the way they are:

|
Sweet thank you
Edit: Still have no clue
|
|
|
05/09/2010, 22:35
|
#14
|
elite*gold: 0
Join Date: Mar 2010
Posts: 126
Received Thanks: 14
|
Don't you mean ..
Code:
public static COPacket Movement(uint UID, byte Dir, byte Running)
{
byte[] Packet = new byte[8 + 16];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10005);
P.WriteByte((byte)(Dir + 8 * Program.Rnd.Next(7)));
P.WriteByte((byte)Running);
P.WriteInt32(UID);
P.WriteInt32((uint)Environment.TickCount);
return P;
}
?
And how the hell does it see Running and make it run?
I don't get how that's supposed to work at all.
|
|
|
05/10/2010, 00:43
|
#15
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
The TQ official packet has a slot for a running bool, the client picks it up and shows either a mob walking, or a mob running, the same is true of when a character moves.
The packet in the 5165 source just didnt include it.
And no i meant for it to be a bool, so that you can go:
Code:
new Movement(1000001, 2, true);
|
|
|
 |
|
Similar Threads
|
[Help]MobSpeed
05/05/2010 - CO2 Private Server - 0 Replies
Okey i've been searching around here on forum but i never find it -.-
My mobs move slow, as like when your character is on "walk" mode. Really slow with other words.. and i changed the mobspeed in mobinfo.txt but their is no change even if i have 1000 or 10000..
Checked around in Mob.cs etc but i havnt find anything =/
Can someone please help me? :)
|
[REQUEST] SPEEDHACk + MOBSPEED
03/12/2010 - Dekaron - 3 Replies
i have 2 scrips of this hacks.. but i play like 2 min with speed+mobspeed and game DC -.-
|
[CT]Help with mobspeed.
01/26/2010 - Dekaron - 8 Replies
Alrighty, I have a high speed ct, but mob is slower than my character's.
How can I increase the mobspeed in the ct file?
alloc(DrakoMobSpeed,64)
label(MobIsWalking)
label(ReturnMobSpeed)
label(MobRunSpeed)
label(MobWalkSpeed)
registersymbol(MobRunSpeed)
|
Need offset for dekaron sea mobspeed?
01/07/2010 - Dekaron - 0 Replies
:pimp:
|
Need help with Mobspeed
10/06/2009 - Dekaron - 0 Replies
Found it !!! Can Closed !!!
Save the W33d -----))))))
|
All times are GMT +1. The time now is 20:57.
|
|