public MonsterDatabaseData()
     : base()
 {
     // TODO: this is just a hack to let status know that this is mob status
     //		 find some other way than a none-existing mob..
     Status    = new WorldObjectStatus(mEmptyMonster);
     Drops     = new MonsterDropList();
     Skills    = new MonsterSkillList();
     ViewData  = new WorldObjectViewData();
     SpawnInfo = new List <MonsterSpawnInfo>();
 }
Exemple #2
0
        public Character(DatabaseID dbID, bool addToWorld)
            : base(dbID, addToWorld)
        {
            BaseStatus   = new WorldObjectStatus(this);
            BattleStatus = new WorldObjectStatus(this);
            ViewData     = new WorldObjectViewData();
            StatusChange = new WorldObjectStatusChangeList();

            // TODO: i dont where eAthena initialize them realy..
            //		 they using struct, which cant be null x.x
            Regen   = new WorldObjectRegenerationData(this);
            HPRegen = new StatusVariationData();
            SPRegen = new StatusVariationData();
            SRegen  = new CharacterRegenerationData();
            SSRegen = new CharacterRegenerationData();
        }
Exemple #3
0
        private static Monster SpawnOnceSub(Character character, Location loc, string name, int mobID)
        {
            // Create new world object based on mobID
            Monster mob = new Monster(new DatabaseID(mobID, EDatabaseType.Mob));
            // Search free cell to spawn, if no given
            Point2D spawnPoint = loc.Point;

            if (character != null && (spawnPoint.X < 0 || spawnPoint.Y < 0))
            {
                // if none found, pick random position on map
                if (loc.Map.SearchFreeCell(character, ref spawnPoint, 1, 1, 0) == false)
                {
                    if (spawnPoint.X <= 0 || spawnPoint.Y <= 0 || loc.Map.CheckCell(spawnPoint, ECollisionType.Reachable) == false)
                    {
                        // Failed to fetch random spot on the whole map?
                        if (loc.Map.SearchFreeCell(null, ref spawnPoint, -1, -1, 1) == false)
                        {
                            ServerConsole.ErrorLine("SpawnSub: Failed to locate spawn pos on map " + loc.Map.Name);
                            return(null);
                        }
                    }
                }
            }

            mob.Location = new Location(loc.Map.ID, spawnPoint);
            mob.Name     = name;
            mob.Class    = (short)mobID;

            // mob_parse_dataset here; check for tiny/large, event and so on

            // TODO: takeover of special_state AI ect; need mob_parse_dataset before
            //		 and place in Monster class to store it (look @ eA mob_data)

            mob.ViewData   = WorldObjectViewData.GetViewData(mob.Database, mobID);
            mob.Status     = new WorldObjectStatus(mob);
            mob.BaseStatus = new WorldObjectStatus(mob);
            mob.StatusChange.Clear();

            return(mob);
        }