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 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); }