Exemple #1
0
        private void lbxMon_DoubleClick(object sender, EventArgs e)
        {
            if (lbxMon.SelectedIndex >= 0)
            {
                var mon = pfdb.Bestiaries.ToList().ElementAtOrDefault(lbxMonIds[lbxMon.SelectedIndex] - 1); // Offset zero-based index
                if (mon != null)
                {
                    var monHtml    = pfdb.BestiaryDetails.Find(mon.BestiaryId);
                    var monDisplay = new CreatureDisplay(mon.Name);

                    if (monHtml != null && !string.IsNullOrWhiteSpace(monHtml.FullText))
                    {
                        monDisplay.LoadHtml(monHtml.FullText);
                    }
                    else
                    {
                        var searchUrl = @"https://cse.google.com/cse?cx=006680642033474972217%3A6zo0hx_wle8&q={0}#gsc.tab=0&gsc.q={0}&gsc.page=1";
                        var uri       = string.Format(searchUrl, mon.Name);
                        monDisplay.LoadUrl(uri);
                    }
                    monDisplay.Show();
                }
            }
        }
Exemple #2
0
        public CreatureCache(DataStore ds, int id)
        {
            ID = id;

            var titleLength      = ds.GetIntByBits(11);
            var titleAltLength   = ds.GetIntByBits(11);
            var cursorNameLength = ds.GetIntByBits(6);

            Leader = ds.GetBool();
            var name0Length    = ds.GetIntByBits(11);
            var nameAlt0Length = ds.GetIntByBits(11);
            var name1Length    = ds.GetIntByBits(11);
            var nameAlt1Length = ds.GetIntByBits(11);
            var name2Length    = ds.GetIntByBits(11);
            var nameAlt2Length = ds.GetIntByBits(11);
            var name3Length    = ds.GetIntByBits(11);
            var nameAlt3Length = ds.GetIntByBits(11);

            ds.Flush();

            Name       = new string[4];
            NameAlt    = new string[4];
            Name[0]    = ds.GetString(name0Length);
            NameAlt[0] = ds.GetString(nameAlt0Length);
            Name[1]    = ds.GetString(name1Length);
            NameAlt[1] = ds.GetString(nameAlt1Length);
            Name[2]    = ds.GetString(name2Length);
            NameAlt[2] = ds.GetString(nameAlt2Length);
            Name[3]    = ds.GetString(name3Length);
            NameAlt[3] = ds.GetString(nameAlt3Length);
            Flags      = new uint[2]
            {
                ds.GetUInt(),
                    ds.GetUInt(),
            };
            CreatureType    = ds.GetInt();
            CreatureFamily  = ds.GetInt();
            Classification  = ds.GetInt();
            ProxyCreatureID = new int[2]
            {
                ds.GetInt(),
                    ds.GetInt(),
            };

            NumCreatureDisplays = ds.GetInt();
            TotalProbability    = ds.GetFloat();
            CreatureDisplays    = new List <CreatureDisplay>();
            for (var i = 0; i < NumCreatureDisplays; ++i)
            {
                CreatureDisplay cd = new CreatureDisplay();
                cd.CreatureDisplayInfoID = ds.GetInt();
                cd.Scale       = ds.GetFloat();
                cd.Probability = ds.GetFloat();
                CreatureDisplays.Add(cd);
            }

            HPMultiplier               = ds.GetFloat();
            EnergyMultiplier           = ds.GetFloat();
            NumQuestItems              = ds.GetInt();
            CreatureMovementInfoID     = ds.GetInt();
            RequiredExpansion          = ds.GetInt();
            TrackingQuestID            = ds.GetInt();
            VignetteID                 = ds.GetInt();
            CreatureClassMask          = ds.GetInt();
            CreatureDifficultyID       = ds.GetInt();
            UIWidgetParentSetID        = ds.GetInt();
            UIWidgetSetUnitConditionID = ds.GetInt();

            Title    = ds.GetString(titleLength);
            TitleAlt = ds.GetString(titleAltLength);
            if (cursorNameLength != 1)
            {
                CursorName = ds.GetString(cursorNameLength);
            }
            else
            {
                CursorName = "";
            }

            QuestItems = new List <int>();
            for (var i = 0; i < NumQuestItems; i++)
            {
                QuestItems.Add(ds.GetInt());
            }
        }