Example #1
0
 public void SpawnAll(AuthoryServer server)
 {
     for (int i = 0; i < MaxCount; i++)
     {
         MobEntity mob = new MobEntity(NPCFactory.Instance.GetNpcValuesOf((new Random().Next(0, 20) > 10 ? ModelType.WizardNPC : ModelType.MeleeNPC)), Center + Vector3.RandomRangeSquare(-(int)Radius, (int)Radius), server);
         MobEntities.Add(mob);
         server.Data.Add(mob);
         Count++;
     }
 }
Example #2
0
        public MobEntity(MobEntity entity, Vector3 position, AuthoryServer server)
        {
            Health = new Resource();
            Mana   = new Resource();

            this.MobSkill = entity.MobSkill;
            this.Server   = server;

            this.ACTION_TICK += (ushort)(new Random().Next(0, 40));

            this.Attributes = new int[entity.Attributes.Length];

            this.Buffs  = new List <Buff>(20);
            this.Skills = new List <AbstractSkill>(20);

            this.EntityTick = 0;

            this.SetPosition(position);

            this.SpawnPosition     = position;
            this.MovementDirection = new Vector3();


            Target = null;

            ModelType = entity.ModelType;
            Name      = entity.Name;

            Level = entity.Level;

            entity.Attributes.CopyTo(Attributes, 0);

            CalculateResources();

            Health.MaxValue   = entity.Health.MaxValue;
            Health.RegenValue = entity.Health.RegenValue;

            Respawn();
        }