Пример #1
0
        public void DisplayRunebooks(int y, int h, int w, int tiers)
        {
            this.AddBackground(0, y, w, h, 9270);
            this.AddImageTiled(10, y + 10, w - 20, h - 20, 2624);
            this.AddAlphaRegion(10, y + 10, w - 20, h - 20);
            for (int i = tiers, j = 1; i > 0; i--, j++)
            {
                this.AddBackground(j * 5, y + 37, ((i - 1) * 5) + 278, 42, 9270);
                if (i == 1)
                {
                    this.AddImageTiled((j * 5) + 10, y + 47, ((i - 1) * 5) + 258, 22, 2624);
                    this.AddAlphaRegion((j * 5) + 10, y + 47, ((i - 1) * 5) + 258, 22);
                }
            }

            SR_Rune rune = this.RuneAcc.Runes[this.RuneAcc.PageIndex];

            this.AddItem(SR_Utilities.ItemOffsetX(rune), y + SR_Utilities.ItemOffsetY(rune) + 12, SR_Utilities.RunebookID, SR_Utilities.ItemHue(rune));
            this.AddLabelCropped(35, y + 12, w - 108, 20, 2100, rune.Name);
            this.AddButton(w - 70, y + 10, 4014, 4016, 5, GumpButtonType.Reply, 0);
            this.AddButton(w - 40, y + 10, 4017, 4019, 4, GumpButtonType.Reply, 0);

            if (tiers > 0)
            {
                rune = this.RuneAcc.ChildRune;
                this.AddItem(SR_Utilities.ItemOffsetX(rune) + tiers * 5, y + SR_Utilities.ItemOffsetY(rune) + 12 + 37, SR_Utilities.RunebookID, SR_Utilities.ItemHue(rune));
                this.AddLabelCropped(35 + tiers * 5, y + 12 + 37, 170, 20, 2100, rune.Name);
                this.AddButton(w - 70, y + 10 + 37, 4014, 4016, 7, GumpButtonType.Reply, 0);
                this.AddButton(w - 40, y + 10 + 37, 4017, 4019, 6, GumpButtonType.Reply, 0);
            }
            // AddButton(238, 30 + bgY + 10, 4011, 4013, 0, GumpButtonType.Reply, 0);
        }
Пример #2
0
        public static void SR_Reset_OnCommand(CommandEventArgs e)
        {
            Mobile mob = e.Mobile;

            SR_Utilities.NewRuneAcc(SR_Utilities.FetchInfo(mob.Account));

            mob.SendMessage("Your staff runebook has been reset to default.");
        }
Пример #3
0
        public static void SR_OnCommand(CommandEventArgs e)
        {
            Mobile mob = e.Mobile;

            SR_Gump.Send(mob, SR_Utilities.FetchInfo(mob.Account));
        }
Пример #4
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int    button = info.ButtonID;
            Mobile mob    = sender.Mobile;

            switch (button)
            {
            case 0:
                break;

            case 1:
                mob.SendMessage("Enter a description:");
                mob.Prompt = new SR_NewRunePrompt(this.RuneAcc, mob.Location, mob.Map);
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            case 2:
                mob.SendMessage("Target a location to mark:");
                mob.Target = new SR_NewRuneTarget(this.RuneAcc);
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            case 3:
                mob.SendMessage("Enter a description:");
                mob.Prompt = new SR_NewRunePrompt(this.RuneAcc);
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            case 4:
                this.RuneAcc.RemoveRune(this.RuneAcc.PageIndex, true);
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            case 5:
                this.RuneAcc.ResetPageIndex();
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            case 6:
                this.RuneAcc.ChildRune.ParentRune.RemoveRune(this.RuneAcc.ChildRune.ParentRune.PageIndex, true);
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            case 7:
                this.RuneAcc.ChildRune.ParentRune.ResetPageIndex();
                Send(mob, SR_Utilities.FetchInfo(mob.Account));
                break;

            default:
                bool moongate = false;
                button -= 10;
                if (button >= 60000)
                {
                    if (this.RuneAcc.ChildRune == null)
                    {
                        this.RuneAcc.RemoveRune(button - 60000);
                    }
                    else
                    {
                        this.RuneAcc.ChildRune.RemoveRune(button - 60000);
                    }
                    Send(mob, SR_Utilities.FetchInfo(mob.Account));
                    break;
                }

                if (button >= 30000)
                {
                    button  -= 30000;
                    moongate = true;
                }
                SR_Rune rune = null;
                if (this.RuneAcc.ChildRune == null)
                {
                    rune = this.RuneAcc.Runes[button];
                }
                else
                {
                    rune = this.RuneAcc.ChildRune.Runes[button];
                }

                if (rune.IsRunebook)
                {
                    if (this.RuneAcc.ChildRune == null)
                    {
                        this.RuneAcc.PageIndex = button;
                    }
                    else
                    {
                        this.RuneAcc.ChildRune.PageIndex = button;
                    }

                    Send(mob, SR_Utilities.FetchInfo(mob.Account));
                }
                else
                {
                    if (mob.Location == rune.TargetLoc && mob.Map == rune.TargetMap)
                    {
                        mob.SendMessage("You are already there.");
                    }
                    else if (!moongate)
                    {
                        mob.PlaySound(0x1FC);
                        mob.MoveToWorld(rune.TargetLoc, rune.TargetMap);
                        mob.PlaySound(0x1FC);
                    }
                    else
                    {
                        if (SR_Utilities.FindItem(typeof(Moongate), mob.Location, mob.Map))
                        {
                            mob.SendMessage("You are standing on top of a moongate, please move.");
                        }
                        else if (SR_Utilities.FindItem(typeof(Moongate), rune.TargetLoc, rune.TargetMap))
                        {
                            mob.SendMessage("There is already a moongate there, sorry.");
                        }
                        else
                        {
                            mob.SendLocalizedMessage(501024);     // You open a magical gate to another location

                            Effects.PlaySound(mob.Location, mob.Map, 0x20E);

                            SR_RuneGate firstGate = new SR_RuneGate(rune.TargetLoc, rune.TargetMap);
                            firstGate.MoveToWorld(mob.Location, mob.Map);

                            Effects.PlaySound(rune.TargetLoc, rune.TargetMap, 0x20E);

                            SR_RuneGate secondGate = new SR_RuneGate(mob.Location, mob.Map);
                            secondGate.MoveToWorld(rune.TargetLoc, rune.TargetMap);
                        }
                    }
                }

                break;
            }
        }
Пример #5
0
        public void DisplayRunes(int y, int h)
        {
            this.AddBackground(0, y, 430 /*400*/, h, 9270);
            this.AddImageTiled(10, y + 10, 410, h - 20, 2624);
            this.AddAlphaRegion(10, y + 10, 410, h - 20);

            List <SR_Rune> runes = null;
            int            count, runebooks;

            if (this.RuneAcc.ChildRune == null)
            {
                runes     = this.RuneAcc.Runes;
                count     = this.RuneAcc.Count;
                runebooks = this.RuneAcc.RunebookCount;
            }
            else
            {
                runes     = this.RuneAcc.ChildRune.Runes;
                count     = this.RuneAcc.ChildRune.Count;
                runebooks = this.RuneAcc.ChildRune.RunebookCount;
            }

            this.AddPage(1);
            int pages = (int)Math.Ceiling((double)count / 9.0), temp = 0;

            for (int i = 0, loc = 0, page = 1; i < count; i++, loc++)
            {
                temp = 10 + y + (22 + 5) * loc;

                this.AddItem(SR_Utilities.ItemOffsetX(runes[i]), 2 + SR_Utilities.ItemOffsetY(runes[i]) + temp, runes[i].IsRunebook ? SR_Utilities.RunebookID : SR_Utilities.RuneID, SR_Utilities.ItemHue(runes[i]));
                if (runes[i].IsRunebook)
                {
                    this.AddLabelCropped(35, 2 + temp, 175, 20, 2100, String.Format("{0}. {1}", i + 1, runes[i].Name));
                }
                else
                {
                    this.AddLabelCropped(35, 2 + temp, 175, 20, 2100, String.Format("{0}. {1} ({2})", i + 1 - runebooks, runes[i].Name, runes[i].TargetMap.ToString()));
                    this.AddLabelCropped(215, 2 + temp, 110, 20, 2100, runes[i].TargetLoc.ToString());
                    this.AddButton(360, temp, 4008, 4010, i + 30010, GumpButtonType.Reply, 0);
                }
                this.AddButton(330 + (runes[i].IsRunebook ? 30 : 0), temp, 4005, 4007, i + 10, GumpButtonType.Reply, 0);
                //AddButton(340, 40 + ((22+5)*i), 4026, 4028, 0, GumpButtonType.Reply, 0);
                //AddImage(340, 40 + ((22+5)*i), 4026, 1000);
                this.AddButton(390, temp, 4017, 4019, i + 60010, GumpButtonType.Reply, 0); // delete

                if (pages > 1 && ((loc == 8 && i < count - 1) || i == count - 1))
                {
                    temp = 10 + y + (22 + 5) * 9;
                    // (430(bg) - 20 (buffer) - 70 (txt/buffer) - 60(buttons)) / 2 = 140
                    if (page > 1)
                    {
                        this.AddButton(140, temp, 4014, 4016, 0, GumpButtonType.Page, page - 1);
                    }
                    else
                    {
                        this.AddImage(140, temp, 4014, 1000);
                    }

                    this.AddHtml(170, 2 + temp, 90, 20, String.Format("<BASEFONT COLOR=#FFFFFF><CENTER>Page {0}/{1}", page, pages), false, false);

                    if (page < pages)
                    {
                        this.AddButton(260, temp, 4005, 4007, 0, GumpButtonType.Page, page + 1);
                    }
                    else
                    {
                        this.AddImage(260, temp, 4005, 1000);
                    }

                    page++;
                    this.AddPage(page);
                    loc = -1;
                }
            }
        }