Ejemplo n.º 1
0
        public override EntityPacket EntityPacket(EntityPacket packet = null, Player forPlayer = null)
        {
            if (packet == null)
            {
                packet = new NpcEntityPacket();
            }

            packet = base.EntityPacket(packet, forPlayer);

            var pkt = (NpcEntityPacket)packet;

            pkt.Aggression = GetAggression(forPlayer);

            return(pkt);
        }
Ejemplo n.º 2
0
        //NpcEntityPacket
        private static void HandlePacket(NpcEntityPacket packet)
        {
            var en = Globals.GetEntity(packet.EntityId, EntityTypes.GlobalEntity);

            if (en != null)
            {
                en.Load(packet);
                en.Type = packet.Aggression;
            }
            else
            {
                Globals.Entities.Add(packet.EntityId, new Entity(packet.EntityId, packet));
                Globals.Entities[packet.EntityId].Type = packet.Aggression;
            }
        }