public static bool ClaimBods(Mobile from, Item bod) { Item reward; int gold, fame; if ((bod is SmallBOD && !((SmallBOD)bod).Complete) || (bod is LargeBOD && !((LargeBOD)bod).Complete)) { from.SendMessage(32, "You have not completed the order yet."); return(false); } if (bod is SmallBOD) { ((SmallBOD)bod).GetRewards(out reward, out gold, out fame); } else if (bod is LargeBOD) { ((LargeBOD)bod).GetRewards(out reward, out gold, out fame); } else { from.SendMessage(32, "This isn't an acceptable bod"); return(false); } from.SendSound(0x3D); from.SendLocalizedMessage(1045132); // Thank you so much! Here is a reward for your effort. if (reward != null) { from.AddToBackpack(reward); } if (gold > 1000) { from.AddToBackpack(new BankCheck(gold)); } else if (gold > 0) { from.AddToBackpack(new Gold(gold)); } if (OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.BOD_GIVE_TOKENS) && gold > 100) { GiveTokens.RewardTokens(from, (int)(gold / 100)); } Titles.AwardFame(from, fame, true); bod.Delete(); return(true); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (info.ButtonID == (int)BUTTONS_ENUM.WEBSITE) { from.LaunchBrowser("http://daat99.home.dyndns.org/index.html"); } else if (!b_ForStaff) { return; } else if (info.ButtonID >= OPTIONS_DIFF) //switch settings { int optionId = info.ButtonID - OPTIONS_DIFF; if (Enum.IsDefined(typeof(OWLTROptionsManager.OPTIONS_ENUM), optionId)) { OWLTROptionsManager.SwitchOption((OWLTROptionsManager.OPTIONS_ENUM)optionId); } else { from.SendMessage(1173, "Unable to interpret the option id: " + optionId); } } else if (info.ButtonID == (int)BUTTONS_ENUM.TOKENS_EXCHANGE_SET) { TextRelay tr_Text = info.GetTextEntry((int)BUTTONS_ENUM.TOKENS_EXCHANGE_AMOUNT); if (tr_Text != null) { int iNewPrice = 0; try { iNewPrice = Convert.ToInt32(tr_Text.Text, 10); } catch { from.SendMessage("Please make sure you wrote only numbers."); } if (iNewPrice > 60000) { from.SendMessage(32, "You can't set the price for more then 60k gold per token."); } else if (iNewPrice > 0) { LadyLuck.TokenCostInGold = iNewPrice; from.SendMessage(88, "You set a new price for tokens, from now on each tokens will be exchanged for {0} gold", iNewPrice); } } } if (info.ButtonID != (int)BUTTONS_ENUM.OK) { from.SendGump(new Daat99CustomOWLTRGump(p_From)); } }
public static void Initialize() { OWLTROptionsManager.Manager.InitOwltrOptions(); bool found = false; foreach (Item item in World.Items.Values) { if (item is Daat99OWLTR && !((Daat99OWLTR)item).Deletable) { found = true; } } if (!found) { GenOWLTR(); } if (StaticHolders == null) { StaticHolders = new Hashtable(); } if (TempHolders == null) { TempHolders = new Hashtable(); } CommandSystem.Register("OWLTR", AccessLevel.Player, new CommandEventHandler(OWLTR_OnCommand)); if (Core.AOS) { CommandSystem.Register("OWLTRBOD", AccessLevel.Player, new CommandEventHandler(OWLTRBOD_OnCommand)); } if (OWLTROptionsManager.IsEnabled(OWLTROptionsManager.OPTIONS_ENUM.RECIPE_CRAFT)) { CommandSystem.Register("MissingRecipes", AccessLevel.Player, new CommandEventHandler(MissingRecipes_OnCommand)); } CommandSystem.Register("Daat99Holder", AccessLevel.Administrator, new CommandEventHandler(Daat99HolderOnCommand)); EventSink.Login += new LoginEventHandler(OnLogin); EventSink.Disconnected += new DisconnectedEventHandler(EventSink_Disconnected); }
public Daat99CustomOWLTRGump(PlayerMobile from) : base(100, 100) { p_From = from; if (from.AccessLevel >= AccessLevel.Administrator) { b_ForStaff = true; } else { b_ForStaff = false; } AddPage(0); AddBackground(0, 0, 560, 480, 3500); //white string version = String.Format("{0}.{1:00}{2}", Daat99OWLTR.MajorVersion, Daat99OWLTR.MinorVersion, Daat99OWLTR.BuildNumber == 0 ? "" : "." + Daat99OWLTR.BuildNumber.ToString("00")); AddHtml(65, 15, 450, 20, "<basefont color=#ff0000>Daat99's O.W.L.T.R (Ore Wood Leather Tokens Recipes) " + version + " Control Center:</basefont>", false, false); AddLabel(15, 40, 2, @"==================="); AddLabel(55, 50, 2, @" /\"); AddLabel(16, 60, 2, @" -----/---\-----"); AddLabel(20, 70, 2, @" \ / \ /"); AddLabel(28, 80, 2, @" / \"); AddLabel(30, 80, 2, @" \ /"); AddLabel(19, 90, 2, @" / \ / \"); AddLabel(17, 100, 2, @" -----\---/-----"); AddLabel(57, 110, 2, @" \/"); AddLabel(15, 120, 2, @"==================="); AddButton(160, 40, 5526, 5527, OPTIONS_DIFF + (int)BUTTONS_ENUM.WEBSITE, GumpButtonType.Reply, 0); //web site AddLabel(155, 68, 1263, "Hall of Helpers"); AddButton(135, 70, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 1, GumpButtonType.Page, 1); AddLabel(35, 138, 70, @"Ubber Resources & Harvesting"); AddButton(15, 140, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 2, GumpButtonType.Page, 2); AddLabel(35, 158, 70, @"A_Li_N's Clean Champ"); AddButton(15, 160, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 3, GumpButtonType.Page, 3); AddLabel(35, 178, 70, @"Custom Craftables"); AddButton(15, 180, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 4, GumpButtonType.Page, 4); AddLabel(35, 198, 70, @"MuleForge\RunicJewelry\StorageResources"); AddButton(15, 200, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 5, GumpButtonType.Page, 5); AddLabel(35, 218, 70, @"Monsters and BoDs Tokens"); AddButton(15, 220, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 6, GumpButtonType.Page, 6); AddLabel(35, 238, 70, @"Harvesting and Crafting Tokens"); AddButton(15, 240, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 7, GumpButtonType.Page, 7); AddLabel(35, 258, 70, @"Recipe Crafting"); AddButton(15, 260, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 8, GumpButtonType.Page, 8); AddLabel(35, 278, 70, @"Resource Cost and Lottery\Exchange"); AddButton(15, 280, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 9, GumpButtonType.Page, 9); AddLabel(35, 298, 70, @"Master Storage\Looter"); AddButton(15, 300, 4033, 4033, (int)BUTTONS_ENUM.FIRST_PAGE_INDEX + 10, GumpButtonType.Page, 10); ///DO NOT CHANGE THESE LINES AddPage(1); //hall of helpers ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES AddHtml(260, 45, 285, 20, String.Format("<basefont color=#ff00ff>Hall of Helpers:</font>"), false, false); ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES AddHtml(260, 65, 285, 40, String.Format("<basefont color=#00ff00>I would like to say special Thanks for a huge assistance in testing efforts to:</font>"), false, false); ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES AddHtml(260, 105, 285, 40, String.Format("<basefont color=#0000ff>Hammerhand, Alyssa Dark, GhostRiderGrey, John Moore, frank dalton and Thomas Gordon.</font>"), false, false); ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES AddHtml(260, 145, 285, 40, String.Format("<basefont color=#ff0000>I would also like to say Thanks to my fellow RunUO & ServUO members:</font>"), false, false); ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES AddHtml(260, 185, 285, 220, String.Format("<basefont color=#0000ff>ViWinfii, Lokai, UOT, ArteGordon, Guadah, Ashenfall, Ashlars and his beloved Morrigan, beau, Raider, Liam, telekea, porker, A_Li_N, Roseanne, RANCID77, Tark, n0brain, Arthemis, jjarmis, ssalter, Raelis, Briseis, Rift, bzk90, RoninGT, Memnoch, feralfreak, DaZiL, joshw, Greystar, XxSP1DERxX, Joeku, Freya, francecio, pvtjoker, Kiki, Viago, ChaosSally, Khephren, awakenlands, ChaosSally, Sotho Tal Ker, Wilcard, Beldr, Thundar, TesterSam, CynsPixie, Sunshine, TMSTKSBK, artio, Turmoil, KatNyte, Jakob, STalKer-X, ASayre8, alexander, Bham, toddjumper, Arvoreen, IndigoParadox, MatrixMan, Jebbit, Sorious, AdminVile, arul, RipRizzle.</font>"), false, false); ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES ///DO NOT CHANGE THESE LINES AddPage(2); //ubber resources OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.UBBER_RESOURCES).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.UBBER_RESOURCES, true, true); // mining OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_MINING).AddToGump(this, 260, 175, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.DAAT99_MINING, true); // lumberjacking OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.DAAT99_LUMBERJACKING).AddToGump(this, 260, 325, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.DAAT99_LUMBERJACKING, true); AddPage(3); //A_Li_N clean champ OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.A_LI_N_CLEAN_CHAMP).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.A_LI_N_CLEAN_CHAMP, true); //A_Li_N OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.SAVE_CLEAN_CHAMP_GOLD).AddToGump(this, 260, 175, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.SAVE_CLEAN_CHAMP_GOLD, true); AddPage(4); //custom craftables //BankHive OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.CRAFTING_BANK_HIVE).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.CRAFTING_BANK_HIVE, true); //Storage Deeds OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.CRAFTING_STORAGE_DEEDS).AddToGump(this, 260, 135, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.CRAFTING_STORAGE_DEEDS, true); //Mobile Forge OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.CRAFTING_MOBILE_FORGE).AddToGump(this, 260, 255, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.CRAFTING_MOBILE_FORGE, true); AddPage(5); //Mule Forge OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.MULE_FORGE).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.MULE_FORGE, true); //Runic Jewelry OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.CRAFT_RUNIC_JEWELRY).AddToGump(this, 260, 175, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.CRAFT_RUNIC_JEWELRY, true); //Use Storage Resources OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.USE_STORAGE_RESOURCES).AddToGump(this, 260, 315, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.USE_STORAGE_RESOURCES, true); AddPage(6); //Monster Give Tokens OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.MONSTER_GIVE_TOKENS).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.MONSTER_GIVE_TOKENS, true); //Bod Give Tokens OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.BOD_GIVE_TOKENS).AddToGump(this, 260, 175, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.BOD_GIVE_TOKENS, true); AddPage(7); //Harvest Give Tokens OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.HARVEST_GIVE_TOKENS).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.HARVEST_GIVE_TOKENS, true); //Craft Give Tokens OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.CRAFT_GIVE_TOKENS).AddToGump(this, 260, 255, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.CRAFT_GIVE_TOKENS, true); AddPage(8); //Recipe Craft OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.RECIPE_CRAFT).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.RECIPE_CRAFT, true); //DedicationRecipes OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.DEDICATION_RECIPE).AddToGump(this, 260, 125, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.DEDICATION_RECIPE, true); //crafts AddHtml(260, 225, 285, 20, @"<basefont color=#ff0000>Enable\Disable each craft individualy:</font>", false, false); //alchemy OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.ALCHEMY_RECIPES).AddToGump(this, 260, 245, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.ALCHEMY_RECIPES); //Blacksmithy OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.BLACKSMITH_RECIPES).AddToGump(this, 260, 265, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.BLACKSMITH_RECIPES); //BowFletching OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.BOWFLETCH_RECIPES).AddToGump(this, 260, 285, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.BOWFLETCH_RECIPES); //Carpentry OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.CARPENTRY_RECIPES).AddToGump(this, 260, 305, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.CARPENTRY_RECIPES); //Cooking OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.COOKING_RECIPES).AddToGump(this, 260, 325, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.COOKING_RECIPES); //Glassblowing OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.GLASSBLOWING_RECIPES).AddToGump(this, 260, 345, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.GLASSBLOWING_RECIPES); //Inscription OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.INSCRIPTION_RECIPES).AddToGump(this, 260, 365, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.INSCRIPTION_RECIPES); //Masonry OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.MASONRY_RECIPES).AddToGump(this, 260, 385, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.MASONRY_RECIPES); //Glassblowing OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.TAILORING_RECIPES).AddToGump(this, 260, 405, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.TAILORING_RECIPES); //Tinkering OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.TINKERING_RECIPES).AddToGump(this, 260, 425, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.TINKERING_RECIPES); //Resources OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.RECIPE_HARVESTING).AddToGump(this, 260, 445, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.RECIPE_HARVESTING); AddPage(9); //Resource Cost OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.RESOURCE_COST).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.RESOURCE_COST, true); //Tokens Lottery OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.TOKENS_LOTTERY).AddToGump(this, 260, 175, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.TOKENS_LOTTERY, true); //Tokens Exchange OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.TOKENS_EXCHANGE).AddToGump(this, 260, 320, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.TOKENS_EXCHANGE, true); AddHtml(260, 380, 240, 20, String.Format("<basefont color=#111111>Each token cost " + LadyLuck.TokenCostInGold + " gold coins.</font>"), false, false); if (b_ForStaff) { AddLabel(305, 415, 20, "Set a new price:"); AddTextEntry(415, 417, 90, 20, 32, (int)BUTTONS_ENUM.TOKENS_EXCHANGE_AMOUNT, LadyLuck.TokenCostInGold.ToString()); AddButton(260, 407, 2642, 2643, (int)BUTTONS_ENUM.TOKENS_EXCHANGE_SET, GumpButtonType.Reply, 0); } //Master Storage AddPage(10); OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.BLESSED_STORAGE).AddToGump(this, 260, 35, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.BLESSED_STORAGE, true); OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.GOLD_STORAGE).AddToGump(this, 260, 115, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.GOLD_STORAGE, true); OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.TOKEN_STORAGE).AddToGump(this, 260, 210, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.TOKEN_STORAGE, true); OWLTROptionsManager.GetOption(OWLTROptionsManager.OPTIONS_ENUM.STORAGE_KEEP_ITEMS_DEATH).AddToGump(this, 260, 310, b_ForStaff, OPTIONS_DIFF + (int)OWLTROptionsManager.OPTIONS_ENUM.STORAGE_KEEP_ITEMS_DEATH, true); AddHtml(260, 420, 285, 40, "<basefont color=#770000>NOTE: Changes are immediate but existing MasterStorage items will show the old values until used.</font>", false, false); }