public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "StandardQuest"); int nAllowedForAnotherQuest = StandardQuestFunctions.QuestTimeNew(m_Mobile); int nServerQuestTimeAllowed = DifficultyLevel.GetTimeBetweenQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; string sAllowedForAnotherQuest = nWhenForAnotherQuest.ToString(); if (CharacterDatabase.GetQuestState(m_Mobile, "StandardQuest")) { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You are already on a quest. Return here when you are done.", m_Mobile.NetState); } else if (nWhenForAnotherQuest > 0) { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "There are no quests at the moment. Check back in " + sAllowedForAnotherQuest + " minutes.", m_Mobile.NetState); } else { int nFame = m_Mobile.Fame * 2; nFame = Utility.RandomMinMax(0, nFame) + 2000; StandardQuestFunctions.FindTarget(m_Mobile, nFame); string TellQuest = StandardQuestFunctions.QuestStatus(m_Mobile) + "."; m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, TellQuest, m_Mobile.NetState); } }
public override void OnClick() { if (!(m_Mobile is PlayerMobile)) { return; } string myQuest = CharacterDatabase.GetQuestInfo(m_Mobile, "StandardQuest"); int nSucceed = StandardQuestFunctions.DidQuest(m_Mobile); if (nSucceed > 0) { StandardQuestFunctions.PayAdventurer(m_Mobile); } else if (myQuest.Length > 0) { if (!m_Mobile.HasGump(typeof(SpeechGump))) { m_Mobile.SendGump(new SpeechGump("Your Reputation Is At Stake", SpeechFunctions.SpeechText(m_Mobile.Name, m_Mobile.Name, "QuestBoardFail"))); } } else { m_Mobile.PrivateOverheadMessage(MessageType.Regular, 1150, false, "You are not currently on a quest.", m_Mobile.NetState); } }
public override void Open(Mobile from) { if (from.Blessed) { from.SendMessage("You cannot open that while in this state."); return; } else if (from.Hidden && from is PlayerMobile && from.Skills[SkillName.Hiding].Value < Utility.RandomMinMax(1, 125)) { from.RevealingAction(); } if (CheckLocked(from)) { return; } if (/* from.AccessLevel == AccessLevel.Player && */ ContainerTouched != 1 && !from.Blessed) { OpenCoffin(from, this.ItemID, ContainerLevel); int FillMeUpLevel = ContainerLevel; if (GetPlayerInfo.LuckyPlayer(from.Luck)) { FillMeUpLevel = FillMeUpLevel + Utility.RandomMinMax(1, 2); } string sWorld = Worlds.GetMyWorld(this.Map, this.Location, this.X, this.Y); ContainerFunctions.FillTheContainerByWorld(FillMeUpLevel, this, sWorld, from); ContainerFunctions.FillTheContainer(ContainerLevel, this, from); LoggingFunctions.LogLoot(from, this.Name, "box"); StandardQuestFunctions.CheckTarget(from, null, this); ContainerTouched = 1; RemoveBox(); Server.Items.CharacterDatabase.LootContainer(from, this); } base.Open(from); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is Gold) { int nPenalty = StandardQuestFunctions.QuestFailure(from); if (dropped.Amount == nPenalty) { CharacterDatabase.ClearQuestInfo(from, "StandardQuest"); from.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Someone else will eventually take care of this.", from.NetState); dropped.Delete(); } else { from.AddToBackpack(dropped); } } else { from.AddToBackpack(dropped); } return(true); }