public bool Close()
        {
            StopAnim();

            if (!rightPanel.pnlOpenedFiles.CloseAllFiles())
            {
                return(false);
            }

            ResetBoneColors();
            SaveSettings();

            _viewerForm?.Close();

            _interpolationForm?.Close();

            MDL0TextureNode._folderWatcher.SynchronizingObject = null;

            TargetModel = null;

            _targetModels.Clear();
            ModelPanel.ClearAll();

            if (Instances.Contains(this))
            {
                Instances.Remove(this);
            }

            return(true);
        }
Beispiel #2
0
        public override bool OnBeforeDeath()
        {
            if (Utility.RandomDouble() < 0.2)
            {
                DistributeRandomArtifact(this, m_Artifact);
            }

            Map map = this.Map;

            if (map != null)
            {
                for (int x = -8; x <= 8; ++x)
                {
                    for (int y = -8; y <= 8; ++y)
                    {
                        double dist = Math.Sqrt(x * x + y * y);

                        if (dist <= 8)
                        {
                            new GoldTimer(map, X + x, Y + y).Start();
                        }
                    }
                }
            }

            if (Instances != null && Instances.Contains(this))
            {
                Instances.Remove(this);
            }

            return(true);
        }
Beispiel #3
0
        public override void OnDeath(Container c)
        {
            List <DamageStore> rights = GetLootingRights();

            foreach (Mobile m in rights.Select(x => x.m_Mobile).Distinct())
            {
                if (m is PlayerMobile)
                {
                    PlayerMobile pm = m as PlayerMobile;

                    if (pm.ExploringTheDeepQuest == ExploringTheDeepQuestChain.CollectTheComponent)
                    {
                        Item item = new MercutiosCutlass();

                        if (m.Backpack == null || !m.Backpack.TryDropItem(m, item, false))
                        {
                            m.BankBox.DropItem(item);
                        }

                        m.SendLocalizedMessage(1154489); // You received a Quest Item!
                    }
                }
            }

            if (Instances != null && Instances.Contains(this))
            {
                Instances.Remove(this);
            }

            base.OnDeath(c);
        }
Beispiel #4
0
 public void SetInstancePosition(Instance instance, Coord position)
 {
     if (!Instances.Contains(instance))
     {
         throw new EngineException("Instance not exists in SceneInstance.", "SceneInstance.SetInstancePosition()");
     }
     instance.Position = position;
     PhysicsWorld?.SetObjectPosition(instance);
 }
Beispiel #5
0
        public override void OnDelete()
        {
            if (Instances != null && Instances.Contains(this))
            {
                Instances.Remove(this);
            }

            Timer.DelayCall(TimeSpan.FromSeconds(3), new TimerCallback(
                                delegate
            {
                Spawn();
            }));

            base.OnDelete();
        }