|
You last visited: Today at 10:06
Advertisement
[Problem]5165 Guard
Discussion on [Problem]5165 Guard within the CO2 Private Server forum part of the Conquer Online 2 category.
06/13/2010, 06:36
|
#16
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Quote:
Originally Posted by Tweety.4Girls
you can post you paket for companions and how I can fix my problem with summon guards  I w8 you answer
|
public static COPacket SpawnEntity(Game.Companion Cmp)
{
byte[] Packet = new byte[8 + 138 + Cmp.Name.Length];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length - 8));
P.WriteInt16((ushort)10014);
P.WriteInt32(Cmp.Mesh);
P.WriteInt32(Cmp.EntityID);
P.WriteInt32(0);
P.WriteInt64(0);//Status Effect
P.Move(28);
P.WriteInt16((ushort)Cmp.CurHP);
P.WriteInt16(Cmp.Level);
P.Move(2);//Hair
P.WriteInt16(Cmp.Loc.X);
P.WriteInt16(Cmp.Loc.Y);
P.WriteByte(Cmp.Direction);
P.WriteByte(100);
P.Move(72);
P.WriteByte(1);
P.WriteByte((byte)Cmp.Name.Length);
P.WriteString(Cmp.Name);
return P;
}
Is the correct packet.
I don't see why its causing you trouble.
|
|
|
06/13/2010, 12:01
|
#17
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
If hes spawning correctly but not moving, have you checked that you are loading your dmaps correctly? Ive heard that bugs mob movement.
|
|
|
06/13/2010, 12:30
|
#18
|
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
|
I will add now all maps for 5165 and I will try again
look on this
Quote:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NewestCOServer.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;
}
}
}
|
I'm not pretty sure about that but I will w8 anyone who try to help me
|
|
|
06/13/2010, 12:51
|
#19
|
elite*gold: 0
Join Date: May 2009
Posts: 162
Received Thanks: 26
|
i think you need that too....
Code:
[URL="http://www.elitepvpers.com/forum/co2-pserver-guides-releases/177649-release-rb-guard.html"]Click here for the topic[/URL]l
|
|
|
06/13/2010, 18:09
|
#20
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
Quote:
Originally Posted by dodolinobobo
i think you need that too....
Code:
[URL="http://www.elitepvpers.com/forum/co2-pserver-guides-releases/177649-release-rb-guard.html"]Click here for the topic[/URL]l
|
Got nothing to do with the 5165 source.
|
|
|
06/13/2010, 18:26
|
#21
|
elite*gold: 0
Join Date: May 2009
Posts: 162
Received Thanks: 26
|
Quote:
Originally Posted by Korvacs
Got nothing to do with the 5165 source.
|
i know but i want only to say that you need somethink like that,sure converted for the 5165 system
|
|
|
06/13/2010, 20:20
|
#22
|
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
|
Quote:
Originally Posted by Korvacs
Got nothing to do with the 5165 source.
|
I'm 100% agree with you  nothing to do with my problem :|
|
|
|
06/13/2010, 22:38
|
#23
|
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
|
Quote:
Originally Posted by Tweety.4Girls
I'm 100% agree with you  nothing to do with my problem :|
|
The packet works perfectly with me, so I'm going to assume you either put it in the wrong place, or didn't replace the existing one.
|
|
|
06/14/2010, 14:13
|
#24
|
elite*gold: 0
Join Date: Nov 2009
Posts: 380
Received Thanks: 58
|
hmm not I put it in packets.cs but I have 2 type of problem
1. with my packet guard is invisible
2. with you packet guard is visible but not move and not attack
|
|
|
03/28/2012, 20:00
|
#25
|
elite*gold: 0
Join Date: Jan 2008
Posts: 67
Received Thanks: 23
|
Sorry i bump this very old thread but anyone find a fix for the guard is visible but not move and not attack ?
i looked in to the companion.cs and don't find anything wrong.
Or maybe what Korvacs said :
If hes spawning correctly but not moving, have you checked that you are loading your dmaps correctly? Ive heard that bugs mob movement.
Again sorry...
|
|
|
 |
|
Similar Threads
|
How can I change the guard NPC type (5165)
12/20/2010 - CO2 Private Server - 5 Replies
title.. for example my guards on my 5165 server look like monsters, i want them to look regular. in olcodb in MobInfos.txt do i edit something here only?
97 DarkGuard 6 2168 250 50000 2500 70 10000 0 0 100 70 21 8036 0 False 18 100000 500000 500 3 False
|
[Release]Reviver Guard[5165]
10/02/2010 - CO2 PServer Guides & Releases - 46 Replies
Sup,
I have not released anything yet so I will release a reviver guard....
go into Program.cs and find
foreach (Hashtable H in Game.World.H_Mobs.Values)
{
foreach (Mob M in H.Values)
{
|
5165 Source- Reborn Guard Probs...
02/27/2010 - CO2 Private Server - 3 Replies
I kno I'm probably getting annoying with these posts but this might probably be my last one since I got my server up and running...
PROBLEM:
I will be very appreciated with some help =) and this goes for the skills too...like how do I change the skill exp...thanks again!
|
[Release]5165 code to prohibit Guard attack
02/17/2010 - CO2 PServer Guides & Releases - 28 Replies
hi guys let me share you this simple code that will prohibit players from attacking the guards in most city of CO. i hope this release will be useful.
here is the guide:
1. open Attack.cs in PacketHandling.
2. in Attack.cs look for this code
public static void Handle(Main.GameClient GC, byte Data)
|
All times are GMT +1. The time now is 10:06.
|
|