public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is Gold) { int Coins = dropped.Amount; string sMessage = ""; if (Coins == 10000 || Coins == 9000 || Coins == 8000 || Coins == 7000 || Coins == 6000 || Coins == 5000 ) { int nAllowedForAnotherQuest = SearchPage.ArtifactQuestTimeNew(from); int nServerQuestTimeAllowed = DifficultyLevel.GetTimeBetweenArtifactQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; if (nWhenForAnotherQuest > 0) { TimeSpan t = TimeSpan.FromMinutes(nWhenForAnotherQuest); string wait = string.Format("{0:D2} days {1:D2} hours and {2:D2} minutes", t.Days, t.Hours, t.Minutes); sMessage = "I have no artifact encyclopedias at the moment. Check back in " + wait + "."; from.AddToBackpack(dropped); } else { sMessage = "Good luck in your quest."; ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is SearchBook) { SearchBook searchbook = (SearchBook)item; if (searchbook.owner == from) { targets.Add(item); } } else if (item is SearchPage) { SearchPage searchpage = (SearchPage)item; if (searchpage.owner == from) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; item.Delete(); } from.AddToBackpack(new SearchBook(from, Coins)); dropped.Delete(); } } else { sMessage = "You look like you need this more than I do."; from.AddToBackpack(dropped); } this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState); } return(base.OnDragDrop(from, dropped)); }
public override bool OnDragDrop(Mobile from, Item dropped) { if (dropped is Gold) { int Coins = dropped.Amount; string sMessage = ""; if (Coins == 500) { if (from.Skills[SkillName.Inscribe].Value >= 30) { if (Server.Misc.Research.AlreadyHasBag(from)) { this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Good luck with your research.")); } else { ResearchBag bag = new ResearchBag(); from.PlaySound(0x2E6); Server.Misc.Research.SetupBag(from, bag); from.AddToBackpack(bag); this.PublicOverheadMessage(MessageType.Regular, 0, false, string.Format("Good luck with your research.")); } dropped.Delete(); } else { sMessage = "You need to be a neophyte scribe before I sell that to you."; from.AddToBackpack(dropped); } } else if (Coins == 10000 || Coins == 9000 || Coins == 8000 || Coins == 7000 || Coins == 6000 || Coins == 5000 ) { int nAllowedForAnotherQuest = SearchPage.ArtifactQuestTimeNew(from); int nServerQuestTimeAllowed = MyServerSettings.GetTimeBetweenArtifactQuests(); int nWhenForAnotherQuest = nServerQuestTimeAllowed - nAllowedForAnotherQuest; if (nWhenForAnotherQuest > 0) { TimeSpan t = TimeSpan.FromMinutes(nWhenForAnotherQuest); string wait = string.Format("{0:D2} days {1:D2} hours and {2:D2} minutes", t.Days, t.Hours, t.Minutes); sMessage = "I have no artifact encyclopedias at the moment. Check back in " + wait + "."; from.AddToBackpack(dropped); } else { sMessage = "Good luck in your quest."; ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is SearchBook) { SearchBook searchbook = (SearchBook)item; if (searchbook.owner == from) { targets.Add(item); } } else if (item is SearchPage) { SearchPage searchpage = (SearchPage)item; if (searchpage.owner == from) { targets.Add(item); } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; item.Delete(); } from.AddToBackpack(new SearchBook(from, Coins)); dropped.Delete(); } } else { sMessage = "You look like you need this more than I do."; from.AddToBackpack(dropped); } this.PrivateOverheadMessage(MessageType.Regular, 1153, false, sMessage, from.NetState); } return(base.OnDragDrop(from, dropped)); }