using System; using Server; using Server.Mobiles; using Server.Network; using Server.Gumps; using Server.Targeting; namespace Server.Gumps { public class DuelSetupGump:Gump { private int m_Rules; private Mobile m_Mobile; private Mobile m_Mobile2; public DuelSetupGump(int Rules, Mobile m, Mobile m2) : base(45, 45) { m_Rules = Rules; m_Mobile = m; m_Mobile2 = m2; this.Closable = true; this.Disposable = false; this.Dragable = true; this.Resizable = false; this.AddPage(0); this.AddBackground(10, 15, 220, 300, 9250); this.AddBackground(20, 25, 200, 280, 3500); this.AddLabel(45, 45, 0, @"Dueling Rules"); this.AddLabel(70, 230, 0, m.Name); this.AddButton(50, 232, 1209, 1210, (int)Buttons.Btn_PlayerOne, GumpButtonType.Reply, 0); if(m2 == null) this.AddLabel(70, 260, 0, @"Empty"); else this.AddLabel(70, 260, 0, m2.Name); this.AddButton(50, 262, 1209, 1210, (int)Buttons.Btn_PlayerTwo, GumpButtonType.Reply, 0); this.AddLabel(45, 200, 0, @"Participants in the Duel"); if(Rules == 0) this.AddRadio(50, 77, 11410, 11402, true, (int)Buttons.Radio_MageFiveX); else this.AddRadio(50, 77, 11410, 11402, false, (int)Buttons.Radio_MageFiveX); if(Rules == 1) this.AddRadio(50, 107, 11410, 11402, true, (int)Buttons.Radio_MageSevenX); else this.AddRadio(50, 107, 11410, 11402, false, (int)Buttons.Radio_MageSevenX); if(Rules == 2) this.AddRadio(50, 137, 11410, 11402, true, (int)Buttons.Radio_StandardSevenX); else this.AddRadio(50, 137, 11410, 11402, false, (int)Buttons.Radio_StandardSevenX); if(Rules == 3) this.AddRadio(50, 167, 11410, 11402, true, (int)Buttons.Radio_AnythingGoes); else this.AddRadio(50, 167, 11410, 11402, false, (int)Buttons.Radio_AnythingGoes); this.AddLabel(70, 75, 0, @"Mage 5x"); this.AddLabel(70, 105, 0, @"Mage 7x"); this.AddLabel(70, 135, 0, @"Standard 7x"); this.AddLabel(70, 105, 0, @"Mage 7x"); this.AddLabel(70, 165, 0, @"Anything Goes"); this.AddButton(170, 265, 4005, 4006, (int)Buttons.Button4, GumpButtonType.Reply, 0); } public enum Buttons { Btn_PlayerOne = 1, Btn_PlayerTwo, Radio_MageFiveX, Radio_MageSevenX, Radio_StandardSevenX, Radio_AnythingGoes, Button4, } public override void OnResponse(NetState sender, RelayInfo info) { Mobile m = sender.Mobile; int button = info.ButtonID; if(button == 1) { m.SendGump(new DuelSetupGump(m_Rules, m_Mobile, m_Mobile2)); m.SendMessage("You cannot remove or add yourself to a duel."); } else if(button == 2) { m.SendGump(new DuelSetupGump(m_Rules, m_Mobile, m_Mobile2)); m.Target = new AddPlayetTarget(); } else if(button == 3) { m_Rules = 0; m.SendGump(new DuelSetupGump(m_Rules, m_Mobile, m_Mobile2)); m.SendMessage("You change the rules to Mage 5x."); } else if(button == 4) { m_Rules = 1; m.SendGump(new DuelSetupGump(m_Rules, m_Mobile, m_Mobile2)); m.SendMessage("You change the rules to Mage 7x."); } else if(button == 5) { m_Rules = 2; m.SendGump(new DuelSetupGump(m_Rules, m_Mobile, m_Mobile2)); m.SendMessage("You change the rules to Standard 7x."); } else if(button == 6) { m_Rules = 3; m.SendGump(new DuelSetupGump(m_Rules, m_Mobile, m_Mobile2)); m.SendMessage("You have removed the rules, anything now goes."); } } } public class AddPlayerTarget:Target { public AddPlayerTarget() : base(15, false, TargetFlags.None) { } protected override void OnTarget(Mobile m, object targ) { if(!(targ is PlayerMobile)) { m.SendMessage("That is not a player."); m.SendGump(new DuelSetupGump(0, m, null)); return; } else if(targ = m) { m.SendMessage("You cannot duel yourself."); m.SendGump(new DuelSetupGump(0, m, null)); return; } else { PlayerMobile pm = (PlayerMobile)targ; m.SendGump(new DuelSetupGump(0, m, pm)); } } } }