Example #1
0
        private void GetSpellNames(int offset, out string name, out string abbreviature, out string reagents)
        {
            switch (_spellBookType)
            {
            case SpellBookType.Magery:
                SpellDefinition def = SpellsMagery.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = SpellsMagery.SpecialReagentsChars[offset][1];
                reagents     = def.CreateReagentListString("\n");
                break;

            case SpellBookType.Necromancy:
                def          = SpellsNecromancy.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = SpellsNecromancy.SpellsSpecialsName[offset][1];
                reagents     = def.CreateReagentListString("\n");
                break;

            case SpellBookType.Chivalry:
                def          = SpellsChivalry.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = def.PowerWords;
                reagents     = string.Empty;
                break;

            case SpellBookType.Bushido:
                def          = SpellsBushido.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = def.PowerWords;
                reagents     = string.Empty;
                break;

            case SpellBookType.Ninjitsu:
                def          = SpellsNinjitsu.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = def.PowerWords;
                reagents     = string.Empty;
                break;

            case SpellBookType.Spellweaving:
                def          = SpellsSpellweaving.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = def.PowerWords;
                reagents     = string.Empty;
                break;

            case SpellBookType.Mysticism:
                def          = SpellsMysticism.GetSpell(offset + 1);
                name         = def.Name;
                abbreviature = def.PowerWords;
                reagents     = def.CreateReagentListString("\n");
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Example #2
0
        private void CreateSpellDetailsPage(int page, bool isright, int circle, SpellDefinition spell)
        {
            if (_spellBookType == SpellBookType.Magery)
            {
                AddChildren(new Label(SpellsMagery.CircleNames[circle], false, 0x0288, font: 6)
                {
                    X = isright ? 64 + 162 : 85, Y = 10
                }, page);
            }

            GumpPic spellImage = new GumpPic(isright ? 225 : 62, 40, (Graphic)(spell.GumpIconID - 0x1298), 0)
            {
                LocalSerial = (uint)(Graphic)(spell.GumpIconID - 0x1298), Tag = spell.ID
            };

            spellImage.DragBegin += (sender, e) =>
            {
                GumpControl     ctrl = (GumpControl)sender;
                SpellDefinition def  = SpellsMagery.GetSpell((int)ctrl.Tag);

                UseSpellButtonGump gump = new UseSpellButtonGump(def)
                {
                    X = Mouse.Position.X - 22, Y = Mouse.Position.Y - 22
                };
                UIManager.Add(gump);
                UIManager.AttemptDragControl(gump, Mouse.Position, true);
            };
            AddChildren(spellImage, page);

            Label spellnameLabel = new Label(spell.Name, false, 0x0288, 80, 6)
            {
                X = isright ? 275 : 112, Y = 34
            };

            AddChildren(spellnameLabel, page);

            if (spell.Regs.Length > 0)
            {
                AddChildren(new GumpPicTiled(isright ? 225 : 62, 88, 120, 4, 0x0835), page);

                AddChildren(new Label("Reagents:", false, 0x0288, font: 6)
                {
                    X = isright ? 225 : 62, Y = 92
                }, page);
                string reagList = spell.CreateReagentListString(",\n");

                if (_spellBookType == SpellBookType.Magery)
                {
                    int y = spellnameLabel.Height < 24 ? 31 : 24;
                    y += spellnameLabel.Height;

                    AddChildren(new Label(SpellsMagery.SpecialReagentsChars[spell.ID - 1][1], false, 0x0288, font: 8)
                    {
                        X = isright ? 275 : 112, Y = y
                    }, page);
                }

                AddChildren(new Label(reagList, false, 0x0288, font: 9)
                {
                    X = isright ? 225 : 62, Y = 114
                }, page);
            }
        }
Example #3
0
 private void CreateSpellPage(int page, bool rightPage, int circle, SpellDefinition spell)
 {
     // header: "NTH CIRCLE"
     AddControl(new HtmlGumpling(this, 64 + (rightPage ? 148 : 0), 10, 130, 200, 0, 0,
                                 string.Format("<span color='#004' style='font-family=uni0;'><center>{0}</center></span>", Magery.CircleNames[circle])),
                page);
     // icon and spell name
     AddControl(new HtmlGumpling(this, 56 + (rightPage ? 156 : 0), 38, 130, 44, 0, 0,
                                 string.Format("<a href='spellicon={0}'><gumpimg src='{1}'/></a>",
                                               spell.ID, spell.GumpIconID - 0x1298)),
                page);
     ((HtmlGumpling)LastControl).OnDragHRef += OnSpellDrag;
     AddControl(new HtmlGumpling(this, 104 + (rightPage ? 156 : 0), 38, 88, 40, 0, 0, string.Format(
                                     "<a href='spell={0}' color='#542' hovercolor='#875' activecolor='#420' style='font-family=uni0; text-decoration=none;'>{1}</a>",
                                     spell.ID, spell.Name)),
                page);
     // reagents.
     AddControl(new HtmlGumpling(this, 56 + (rightPage ? 156 : 0), 84, 146, 106, 0, 0, string.Format(
                                     "<span color='#400' style='font-family=uni0;'>Reagents:</span><br/><span style='font-family=ascii6;'>{0}</span>", spell.CreateReagentListString(", "))),
                page);
 }