Quote:
Originally Posted by CptSky
From my very old 5017 source... The packet is incomplete, but functionnal. It's spawn a shop carpet.
Code:
UInt16 -> Length (28 + String Length)
UInt16 -> Type (1109)
UInt32 -> UniqId (Shop)
UInt64 -> Unknow
UInt16 -> PosX (Player.PosX + 1)
UInt16 -> PosY (Player.PosY)
UInt16 -> Look (406)
UInt16 -> Type (14)
UInt16 -> Unknow
UInt8 -> String Count (1)
foreach String
UInt8 -> String Length
UInt8* -> String (Player.Name)
|
Quote:
Originally Posted by samehvan
it is for spawning tnpcs
Code:
ushort(28+Name.Lenght);
ushort(1109);
uint32(TerrianNpcID);
uint32(TerrianMaxHp);
uint32(TerrianCurrentHp);
uint32(TerrianX);
uint32(TerrianY);
uint32(TerrianNpcType);
ushort(26);//unknown i think it may be TerrianNpc.Look (Subtype)
byte(Terrian.Facing);
byte(Name.Length);
Text(Name);
|
Just a copy-paste from ConquerServer_v2 with a quick-mod:
\Packet Structures\Spawn SOB 0x455.cs\
Code:
public enum SOBType : ushort
{
Gate = 0x1A,
Scarecrow = 0x16,
Stake = 0x15,
Pole = 0x0A,
Carpet = 0x0E
}
public enum SOBMesh : ushort
{
LeftGate = 0x00F1,
RightGate = 0x0115,
Pole = 0x471,
Carpet = 0x196
}
/// <summary>
/// 0x455 (Server->Client)
/// </summary>
public unsafe struct SpawnSOBPacket
{
public ushort Size;
public ushort Type;
public uint UID;
public int MaxHitpoints;
public int Hitpoints;
public ushort X;
public ushort Y;
public SOBMesh SOBMesh;
public SOBType SOBType;
public ushort Facing;
public bool ShowName;
public byte NameLength;
public fixed byte Strings[24];
public static SpawnSOBPacket Create()
{
SpawnSOBPacket Data = new SpawnSOBPacket();
Data.Size = 0x1C;
Data.Type = 0x455;
PacketBuilder.AppendTQServer(Data.Strings, 8);
return Data;
}
}
If a name was assigned (and note: having a name is optional) to the static-object-monster the following changes are required:
\Core\SOBMonster.cs
Code:
set
{
if (value.Length > 15)
value = value.Substring(0, 15);
m_Name = value;
Spawn.ShowName = true;
Spawn.NameLength = (byte)value.Length;
fixed (byte* lpStrings = Spawn.Strings)
{
MSVCRT.memset(lpStrings, 0, 24);
m_Name.CopyTo(lpStrings);
PacketBuilder.AppendTQServer((byte*)lpStrings + Spawn.NameLength + 1, 8);
}
Spawn.Size = (ushort)(0x1C + Spawn.NameLength + 1);
}