public static SpawnEntityPacket Create(Monster user)
        {
            SpawnEntityPacket packet = new SpawnEntityPacket();

            packet.Names     = new NetStringPacker();
            packet.UID       = user.UID;
            packet.Lookface  = user.BaseMonster.Mesh;
            packet.PositionX = user.X;
            packet.PositionY = user.Y;
            packet.Direction = user.Direction;
            packet.Life      = user.Life;
            packet.Level     = user.BaseMonster.Level;
            packet.Names.AddString(user.BaseMonster.Name);
            return(packet);
        }
Example #2
0
        public static SpawnEntityPacket Create(Player user)
        {
            SpawnEntityPacket packet = new SpawnEntityPacket();

            packet.Names    = new NetStringPacker();
            packet.UID      = user.UID;
            packet.Lookface = user.Character.Lookface;

            Structures.ConquerItem item;
            if (user.TryGetEquipmentByLocation(ItemLocation.Helmet, out item))
            {
                packet.HelmetType  = item.StaticID;
                packet.HelmetColor = item.Color;
            }
            if (user.TryGetEquipmentByLocation(ItemLocation.Armor, out item))
            {
                packet.ArmorType  = item.StaticID;
                packet.ArmorColor = item.Color;
            }
            if (user.TryGetEquipmentByLocation(ItemLocation.WeaponR, out item))
            {
                packet.WeaponRType = item.StaticID;
            }
            if (user.TryGetEquipmentByLocation(ItemLocation.WeaponL, out item))
            {
                packet.WeaponLType = item.StaticID;
            }
            if (user.TryGetEquipmentByLocation(ItemLocation.Garment, out item))
            {
                packet.GarmentType = item.StaticID;
            }

            packet.PositionX   = user.X;
            packet.PositionY   = user.Y;
            packet.Hair        = user.Hair;
            packet.Direction   = user.Direction;
            packet.Action      = user.Action;
            packet.RebornCount = user.RebornCount;
            packet.Level       = user.Level;
            packet.Names.AddString(user.Name);
            packet.GuildID       = (ushort)user.GuildId;
            packet.GuildRank     = (byte)user.GuildRank;
            packet.Nobility      = (byte)user.NobilityMedal;
            packet.StatusEffects = user.SpawnPacket.StatusEffects;
            return(packet);
        }