Example #1
0
        public bool RemoveMob(IFieldObject <Mob> mob)
        {
            if (!State.RemoveMob(mob.ObjectId))
            {
                return(false);
            }

            Broadcast(session =>
            {
                session.Send(FieldPacket.RemoveMob(mob));
            });
            return(true);
        }
Example #2
0
        public bool RemoveMob(IFieldObject <Mob> mob)
        {
            if (!State.RemoveMob(mob.ObjectId))
            {
                return(false);
            }

            if (mob.Value.OriginSpawn.Value.Mobs.Remove(mob) && mob.Value.OriginSpawn.Value.Mobs.Count == 0)
            {
                StartSpawnTimer(mob.Value.OriginSpawn);
            }

            Broadcast(session =>
            {
                session.Send(FieldPacket.RemoveMob(mob));
            });
            return(true);
        }