コード例 #1
0
ファイル: Quests.cs プロジェクト: Ariette/GarlandTools
        void ImportQuestEventIcon(dynamic quest, Saint.Quest sQuest)
        {
            var sEventIconType = (Saint.IXivRow)sQuest["EventIconType"];

            if (sEventIconType == null)
            {
                byte index = (byte)sQuest.GetRaw("EventIconType");
                if (index > 32)
                {
                    index         -= 32;
                    sEventIconType = _builder.Sheet("EventIconType").ElementAt(index);
                }
                else
                {
                    throw new NotImplementedException();
                }
            }
            var baseIconIndex = (int)(UInt32)sEventIconType.GetRaw(0);

            // Mark function quests
            if (baseIconIndex == 071340)
            {
                quest.unlocksFunction = 1;
            }

            // Calculate the event icon to record.
            var questIconIndex = 0;

            if (sEventIconType.Key == 4)
            {
                questIconIndex = baseIconIndex;
            }
            else if (sQuest.IsRepeatable)
            {
                questIconIndex = baseIconIndex + 2;
            }
            else
            {
                questIconIndex = baseIconIndex + 1;
            }

            var eventIcon = SaintCoinach.Imaging.IconHelper.GetIcon(sQuest.Sheet.Collection.PackCollection, questIconIndex);

            quest.eventIcon = IconDatabase.EnsureEntry("event", eventIcon);
        }