Example #1
0
        public void AddKilledMonster(Int32 p_key, Int32 p_val, Boolean p_fromLoad)
        {
            Int32 num = 0;

            if (!p_fromLoad)
            {
                if (m_allMonsters.ContainsKey(p_key))
                {
                    num = m_allMonsters[p_key];
                }
                else
                {
                    m_allMonsters.Add(p_key, num);
                }
                Int32             num2       = num + p_val;
                MonsterStaticData staticData = StaticDataHandler.GetStaticData <MonsterStaticData>(EDataType.MONSTER, p_key);
                String            nameKey    = staticData.NameKey;
                if (num == 0)
                {
                    BestiaryEntryEventArgs p_eventArgs = new BestiaryEntryEventArgs(nameKey, BestiaryEntryEventArgs.EEntryState.ENTRY_NEW);
                    LegacyLogic.Instance.EventManager.InvokeEvent(null, EEventType.BESTIARY_ENTRY_CHANGED, p_eventArgs);
                    m_newEntries.Add(p_key);
                    if (staticData.Grade == EMonsterGrade.CORE)
                    {
                        m_killedCoreMonsters++;
                    }
                    if (nameKey == "MONSTER_GIANT_SPIDER")
                    {
                        LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.STORY_2);
                    }
                }
                else if (num2 == staticData.BestiaryThresholds[0] || num2 == staticData.BestiaryThresholds[1] || num2 == staticData.BestiaryThresholds[2])
                {
                    BestiaryEntryEventArgs p_eventArgs2 = new BestiaryEntryEventArgs(nameKey, BestiaryEntryEventArgs.EEntryState.ENRTY_UPDATED);
                    LegacyLogic.Instance.EventManager.InvokeEvent(null, EEventType.BESTIARY_ENTRY_CHANGED, p_eventArgs2);
                }
                m_allMonsters[p_key]    = num2;
                m_killedMonsters[p_key] = num2;
                CheckForQuestProgress();
            }
            else
            {
                m_allMonsters.Add(p_key, p_val);
                if (p_val > 0)
                {
                    m_killedMonsters.Add(p_key, p_val);
                }
            }
        }
        private void BestiaryEntryChanged(Object p_sender, EventArgs p_args)
        {
            BestiaryEntryEventArgs bestiaryEntryEventArgs = p_args as BestiaryEntryEventArgs;

            if (bestiaryEntryEventArgs == null)
            {
                return;
            }
            String text      = LocaManager.GetText(bestiaryEntryEventArgs.MonsterNameKey);
            String p_message = String.Empty;

            if (bestiaryEntryEventArgs.EntryState == BestiaryEntryEventArgs.EEntryState.ENTRY_NEW)
            {
                p_message = LocaManager.GetText("GAME_MESSAGE_BESTIARY_ENTRY_NEW", text);
            }
            else
            {
                p_message = LocaManager.GetText("GAME_MESSAGE_BESTIARY_ENTRY_CHANGED", text);
            }
            GameMessage item = new GameMessage(p_message);

            m_queuedMessages.Enqueue(item);
        }