Exemplo n.º 1
0
        public Mob(MobBreedLocation mbl)
        {
            ID = mbl.MobID;

            Init();

            // Make random location
            if (!mbl.Map.AssignObjectID(this))
            {
                Log.WriteLine(LogLevel.Warn, "Couldn't spawn mob, out of ID's");
                return;
            }
            Map = mbl.Map;
            Spawnplace = mbl;
            while (true)
            {
                Position = Vector2.GetRandomSpotAround(Program.Randomizer, mbl.Position, 30);
                if (Map.Block.CanWalk(Position.X, Position.Y))
                {
                    break;
                }
            }
            SetBoundriesFromPointAndRange(Position, 100);

            Spawnplace.CurrentMobs++;
        }
Exemplo n.º 2
0
 public static MobBreedLocation CreateLocationFromPlayer(ZoneCharacter pCharacter, ushort MobID)
 {
     MobBreedLocation mbl = new MobBreedLocation();
     mbl.MobID = MobID;
     mbl.MapID = pCharacter.MapID;
     mbl.InstanceID = pCharacter.Map.InstanceID;
     mbl.Position = new Vector2(pCharacter.Position);
     return mbl;
 }
Exemplo n.º 3
0
        private void Init()
        {
            Info = DataProvider.Instance.GetMobInfo(ID);
            MobInfoServer temp;
            DataProvider.Instance.MobData.TryGetValue(Info.Name, out temp);
            InfoServer = temp;
            Moving = false;
            Target = null;
            Spawnplace = null;
            _nextUpdate = Program.CurrentTime;
            DeathTriggered = false;

            HP = MaxHP;
            SP = MaxSP;
            Level = Info.Level;
        }