public static Creature Create(CreatureTemplate template) { if(template == null) { return null; } return new Creature(template) { Entry = template.Id, DisplayId = template.DisplayId }; }
private Creature(CreatureTemplate template) { _template = template; }
public void SendCreatureQueryResponce(CreatureTemplate creature) { Send(GetCreatureQueryResponse(creature)); }
private static IPacket GetCreatureQueryResponse(CreatureTemplate template) { IPacket packet = WorldPacketFactory.Create(WMSG.SMSG_CREATURE_QUERY_RESPONSE); BinaryWriter writer = packet.CreateWriter(); writer.Write(template.Id); writer.WriteCString(template.Name); writer.WriteCString(""); writer.WriteCString(""); writer.WriteCString(""); writer.WriteCString(template.GuildName); writer.WriteCString(""); writer.Write((uint)template.Flags); writer.Write((uint)template.Type); writer.Write((uint)template.Family); writer.Write((uint)template.Rank); writer.Write(0); // SpellGroupId writer.Write(template.DisplayId); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(1f); writer.Write(1f); writer.Write((byte)0); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(0); // id from CreatureMovement.dbc return packet; }