Пример #1
0
        public virtual bool Teleport(Map temp, Point location, bool effects = true, byte effectnumber = 0)
        {
            if (temp == null || !temp.ValidPoint(location)) return false;

            CurrentMap.RemoveObject(this);
            if (effects) Broadcast(new S.ObjectTeleportOut {ObjectID = ObjectID, Type = effectnumber});
            Broadcast(new S.ObjectRemove {ObjectID = ObjectID});

            CurrentMap = temp;
            CurrentLocation = location;

            InTrapRock = false;

            CurrentMap.AddObject(this);
            BroadcastInfo();

            if (effects) Broadcast(new S.ObjectTeleportIn { ObjectID = ObjectID, Type = effectnumber });

            BroadcastHealthChange();

            return true;
        }
Пример #2
0
        public bool Spawn(Map temp, Point location)
        {
            if (!temp.ValidPoint(location)) return false;

            CurrentMap = temp;
            CurrentLocation = location;

            CurrentMap.AddObject(this);

            RefreshAll();
            SetHP(MaxHP);

            Spawned();
            Envir.MonsterCount++;
            CurrentMap.MonsterCount++;
            return true;
        }
Пример #3
0
        public bool Spawn(Map temp, Point location)
        {
            if (!temp.ValidPoint(location)) return false;
            if (uniqueAI != null && uniqueAI.UseKillTimer)
            {
                DateTime timeKilled = new DateTime(uniqueAI.LastKillYear, uniqueAI.LastKillMonth, uniqueAI.LastKillDay, uniqueAI.LastKillHour, uniqueAI.LastKillMinute, 0, 0);
                DateTime timeNow = DateTime.Now;
                if (timeNow.CompareTo(timeKilled) < 0)
                    return false;
            }

            CurrentMap = temp;
            CurrentLocation = location;

            CurrentMap.AddObject(this);

            RefreshAll();
            SetHP(MaxHP);

            Spawned();
            Envir.MonsterCount++;
            CurrentMap.MonsterCount++;
            return true;
        }