Пример #1
0
 public override void Destroy()
 {
     base.Destroy();
     m_staticData         = null;
     m_tradingInventory   = null;
     m_tradingSpells      = null;
     m_identifyController = null;
     m_repairController   = null;
     m_conversation       = null;
     m_restCount.Clear();
     m_restCount = null;
     m_dayCount.Clear();
     m_dayCount = null;
     m_perTurnCount.Clear();
     m_perTurnCount = null;
 }
Пример #2
0
        protected override void LoadStaticData()
        {
            m_staticData = StaticDataHandler.GetStaticData <NpcStaticData>(EDataType.NPC, StaticID);
            if (m_staticData == null)
            {
                LegacyLogger.Log("npc staticdata id " + StaticID + " not found");
            }
            try
            {
                NpcConversationStaticData staticData = XmlStaticDataHandler <NpcConversationStaticData> .GetStaticData(StaticData.ConversationKey);

                if (staticData == null)
                {
                    LegacyLogger.Log(String.Concat(new Object[]
                    {
                        "npc staticdata id: ",
                        StaticID,
                        ", Conversation staticdata ",
                        StaticData.ConversationKey,
                        " not found"
                    }));
                }
                m_conversation     = new NpcConversation(staticData);
                m_tradingInventory = new TradingInventoryController(staticData, this);
                m_tradingSpells    = new TradingSpellController(staticData, this);
            }
            catch (Exception ex)
            {
                LegacyLogger.LogError(String.Concat(new Object[]
                {
                    "Error load NPC data\nStaticId: ",
                    StaticID,
                    ", ConversationKey: ",
                    StaticData.ConversationKey,
                    "\n",
                    ex
                }));
            }
            m_identifyController = new IdentifyInventoryController(this);
            m_repairController   = new RepairInventoryController();
        }