public override bool OnDragDrop(Mobile from, Item item) { // trigger returns true if returnoverride if (XmlScript.HasTrigger(this, TriggerName.onDragDrop) && UberScriptTriggers.Trigger(this, from, TriggerName.onDragDrop, item)) { return(true); } return(XmlQuest.RegisterGive(from, this, item)); //return base.OnDragDrop(from, item); }
public virtual bool CheckAtDestination() { EDI dest = GetDestination(); if (dest == null) { return(false); } Mobile escorter = GetEscorter(); if (escorter == null) { return(false); } if (dest.Contains(Location)) { Say(1042809, escorter.Name); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay. // not going anywhere m_Destination = null; m_DestinationString = null; Container cont = escorter.Backpack; if (cont == null) { cont = escorter.BankBox; } Gold gold = new Gold(165, 333); if (cont == null || !cont.TryDropItem(escorter, gold, false)) { gold.MoveToWorld(escorter.Location, escorter.Map); } Misc.FameKarmaTitles.AwardFame(escorter, 10, true); XmlQuest.RegisterEscort(this, escorter); StopFollow(); SetControlMaster(null); m_EscortTable.Remove(escorter); BeginDelete(); return(true); } return(false); }
private void CheckOwnerFlag() { if (Owner != null && !Owner.Deleted) { // need to check to see if any other questtoken items are owned // search the Owners top level pack for an xmlquest List <Item> list = XmlQuest.FindXmlQuest(Owner); if (list == null || list.Count == 0) { // if none remain then flag the ower as having none Owner.SetFlag(XmlQuest.CarriedXmlQuestFlag, false); } } }
public override bool OnDragDrop(Mobile from, Item item) { return(XmlQuest.RegisterGive(from, this, item)); //return base.OnDragDrop(from, item); }
public XmlQuestStatusGump(IXmlQuest questitem, string gumptitle, int X, int Y, bool solid, int screen) : base(X, Y) { Closable = true; Dragable = true; m_X = X; m_Y = Y; m_solid = solid; m_questitem = questitem; m_gumptitle = gumptitle; m_screen = screen; AddPage(0); if (!solid) { AddImageTiled(54, 33, 369, 400, 2624); AddAlphaRegion(54, 33, 369, 400); } else { AddBackground(54, 33, 369, 400, 5054); } AddImageTiled(416, 39, 44, 389, 203); // AddButton( 338, 392, 2130, 2129, 3, GumpButtonType.Reply, 0 ); // Okay button AddHtmlLocalized(139, 59, 200, 30, 1046026, 0x7fff, false, false); // Quest Log AddImage(97, 49, 9005); // quest ribbon AddImageTiled(58, 39, 29, 390, 10460); // left hand border AddImageTiled(412, 37, 31, 389, 10460); // right hand border AddImage(430, 9, 10441); AddImageTiled(40, 38, 17, 391, 9263); AddImage(6, 25, 10421); AddImage(34, 12, 10420); AddImageTiled(94, 25, 342, 15, 10304); // top border AddImageTiled(40, 414, 415, 16, 10304); // bottom border AddImage(-10, 314, 10402); AddImage(56, 150, 10411); AddImage(136, 84, 96); AddImage(372, 57, 1417); AddImage(381, 66, 5576); // add the status and journal tabs AddImageTiled(90, 34, 322, 5, 0x145E); // top border int tab1 = 0x138F; int tab2 = 0x138E; if (screen == 1) { tab1 = 0x138E; tab2 = 0x138F; } AddButton(100, 18, tab1, tab2, 900, GumpButtonType.Reply, 0); AddLabel(115, 17, 0, "Status"); AddButton(189, 18, tab2, tab1, 901, GumpButtonType.Reply, 0); AddLabel(205, 17, 0, "Journal"); if (screen == 1) { // display the journal if (questitem.Journal != null && questitem.Journal.Count > 0) { string journaltext = null; for (int i = 0; i < questitem.Journal.Count; i++) { journaltext += "<u>"; journaltext += ((XmlQuest.JournalEntry)questitem.Journal[i]).EntryID; journaltext += ":</u><br>"; journaltext += ((XmlQuest.JournalEntry)questitem.Journal[i]).EntryText; journaltext += "<br><br>"; } AddHtml(100, 90, 270, 300, journaltext, true, true); } // add the add journal entry button AddButton(300, 49, 0x99C, 0x99D, 952, GumpButtonType.Reply, 0); //AddButton(300, 49, 0x159E, 0x159D, 952, GumpButtonType.Reply, 0); } else { if (gumptitle != null && gumptitle.Length > 0) { // display the title if it is there AddImage(146, 91, 2103); // bullet AddHtml(164, 86, 200, 30, XmlSimpleGump.Color(gumptitle, "00FF42"), false, false); } if (questitem.NoteString != null && questitem.NoteString.Length > 0) { // display the note string if it is there AddHtml(100, 106, 270, 80, questitem.NoteString, true, true); } DisplayQuestStatus(130, 192, questitem.Objective1, questitem.State1, questitem.Completed1, questitem.Description1); DisplayQuestStatus(130, 224, questitem.Objective2, questitem.State2, questitem.Completed2, questitem.Description2); DisplayQuestStatus(130, 256, questitem.Objective3, questitem.State3, questitem.Completed3, questitem.Description3); DisplayQuestStatus(130, 288, questitem.Objective4, questitem.State4, questitem.Completed4, questitem.Description4); DisplayQuestStatus(130, 320, questitem.Objective5, questitem.State5, questitem.Completed5, questitem.Description5); //if(questitem.HasCollect){ AddButton(100, 350, 0x2A4E, 0x2A3A, 700, GumpButtonType.Reply, 0); AddLabel(135, 356, 0x384, "Collect"); //} if ((questitem.RewardItem != null && !questitem.RewardItem.Deleted)) { m_questitem.CheckRewardItem(); if (questitem.RewardItem.Amount > 1) { AddLabel(230, 356, 55, String.Format("Reward: {0} ({1})", questitem.RewardItem.GetType().Name, questitem.RewardItem.Amount)); AddLabel(230, 373, 55, String.Format("Weight: {0}", questitem.RewardItem.Weight * questitem.RewardItem.Amount)); } else if (questitem.RewardItem is Container) { AddLabel(230, 356, 55, String.Format("Reward: {0} ({1} items)", questitem.RewardItem.GetType().Name, questitem.RewardItem.TotalItems)); AddLabel(230, 373, 55, String.Format("Weight: {0}", questitem.RewardItem.TotalWeight + questitem.RewardItem.Weight)); } else { AddLabel(230, 356, 55, String.Format("Reward: {0}", questitem.RewardItem.GetType().Name)); AddLabel(230, 373, 55, String.Format("Weight: {0}", questitem.RewardItem.Weight)); } AddImageTiled(330, 373, 81, 40, 200); AddItem(340, 376, questitem.RewardItem.ItemID); } if (questitem.RewardAttachment != null && !questitem.RewardAttachment.Deleted) { AddLabel(230, 339, 55, String.Format("Bonus: {0}", questitem.RewardAttachment.GetType().Name)); } if ((questitem.RewardItem != null && !questitem.RewardItem.Deleted) || (questitem.RewardAttachment != null && !questitem.RewardAttachment.Deleted)) { if (questitem.CanSeeReward) { AddButton(400, 380, 2103, 2103, 800, GumpButtonType.Reply, 0); } } // indicate any status info XmlQuest.VerifyObjectives(questitem); if (questitem.Status != null) { AddLabel(100, 392, 33, questitem.Status); } else // indicate the expiration time if (questitem.IsValid) { //AddHtmlLocalized(150, 400, 50, 37, 1046033, 0xf0000 , false , false ); // Expires AddHtml(130, 392, 200, 37, XmlSimpleGump.Color(questitem.ExpirationString, "00FF42"), false, false); } else if (questitem.AlreadyDone) { if (!questitem.Repeatable) { AddLabel(100, 392, 33, "Already done - cannot be repeated"); } else { ArrayList a = XmlAttach.FindAttachments(questitem.Owner, typeof(XmlQuestAttachment), questitem.Name); if (a != null && a.Count > 0) { AddLabel(100, 392, 33, String.Format("Repeatable in {0}", ((XmlQuestAttachment)a[0]).Expiration)); } else { AddLabel(150, 392, 33, "Already done - ???"); } } } else { //AddHtml( 150, 384, 200, 37, XmlSimpleGump.Color( "No longer valid", "00FF42" ), false, false ); AddLabel(150, 392, 33, "No longer valid"); } if (XmlQuest.QuestPointsEnabled) { AddHtml(250, 40, 200, 30, XmlSimpleGump.Color(String.Format("Difficulty Level {0}", questitem.Difficulty), "00FF42"), false, false); } if (questitem.PartyEnabled) { AddHtml(250, 55, 200, 30, XmlSimpleGump.Color("Party Quest", "00FF42"), false, false); if (questitem.PartyRange >= 0) { AddHtml(250, 70, 200, 30, XmlSimpleGump.Color(String.Format("Party Range {0}", questitem.PartyRange), "00FF42"), false, false); } else { AddHtml(250, 70, 200, 30, XmlSimpleGump.Color("No Range Limit", "00FF42"), false, false); } } else { AddHtml(250, 55, 200, 30, XmlSimpleGump.Color("Solo Quest", "00FF42"), false, false); } } }
public void DisplayQuestStatus(int x, int y, string objectivestr, string statestr, bool status, string descriptionstr) { if (objectivestr != null && objectivestr.Length > 0) { // look for special keywords string[] arglist = BaseXmlSpawner.ParseString(objectivestr, 5, ","); int targetcount = 1; bool foundkill = false; bool foundcollect = false; bool foundgive = false; bool foundescort = false; string name = null; string mobname = null; string type = null; string status_str; string text = null; string typestr; bool checkprop; if (arglist.Length > 0) { switch (arglist[0]) { case "GIVE": // format for the objective string will be GIVE,mobname,itemtype[,count][,proptest] if (arglist.Length > 2) { mobname = arglist[1]; //name = arglist[2]; type = arglist[2]; } XmlQuest.CheckArgList(arglist, 3, null, out typestr, out targetcount, out checkprop, out status_str); foundgive = true; break; case "GIVENAMED": // format for the objective string will be GIVENAMED,mobname,itemname[,type][,count][,proptest] if (arglist.Length > 2) { mobname = arglist[1]; name = arglist[2]; } XmlQuest.CheckArgList(arglist, 3, null, out typestr, out targetcount, out checkprop, out status_str); if (typestr != null) { type = typestr; } foundgive = true; break; case "KILL": // format for the objective string will be KILL,mobtype[,count][,proptest] if (arglist.Length > 1) { //name = arglist[1]; type = arglist[1]; } XmlQuest.CheckArgList(arglist, 2, null, out typestr, out targetcount, out checkprop, out status_str); foundkill = true; break; case "KILLNAMED": // format for the objective string KILLNAMED,mobname[,type][,count][,proptest] if (arglist.Length > 1) { name = arglist[1]; } XmlQuest.CheckArgList(arglist, 2, null, out typestr, out targetcount, out checkprop, out status_str); if (typestr != null) { type = typestr; } foundkill = true; break; case "COLLECT": // format for the objective string will be COLLECT,itemtype[,count][,proptest] if (arglist.Length > 1) { //name = arglist[1]; type = arglist[1]; } XmlQuest.CheckArgList(arglist, 2, null, out typestr, out targetcount, out checkprop, out status_str); foundcollect = true; break; case "COLLECTNAMED": // format for the objective string will be COLLECTNAMED,itemname[,itemtype][,count][,proptest] if (arglist.Length > 1) { name = arglist[1]; } XmlQuest.CheckArgList(arglist, 2, null, out typestr, out targetcount, out checkprop, out status_str); if (typestr != null) { type = typestr; } foundcollect = true; break; case "ESCORT": // format for the objective string will be ESCORT,mobname[,proptest] if (arglist.Length > 1) { name = arglist[1]; } foundescort = true; break; } } if (foundkill) { // get the current kill status int killed = 0; try { killed = int.Parse(statestr); } catch { } int remaining = targetcount - killed; if (remaining < 0) { remaining = 0; } // report the kill task objective status if (descriptionstr != null) { text = String.Format("{0} ({1} left)", descriptionstr, remaining); } else { if (name != null) { if (type == null) { type = "mob"; } text = String.Format("Kill {0} {1}(s) named {2} ({3} left)", targetcount, type, name, remaining); } else { text = String.Format("Kill {0} {1}(s) ({2} left)", targetcount, type, remaining); } } } else if (foundescort) { // get the current escort status int escorted = 0; try { escorted = int.Parse(statestr); } catch { } int remaining = targetcount - escorted; if (remaining < 0) { remaining = 0; } // report the escort task objective status if (descriptionstr != null) { text = descriptionstr; } else { text = String.Format("Escort {0}", name); } } else if (foundcollect) { // get the current collection status int collected = 0; try { collected = int.Parse(statestr); } catch { } int remaining = targetcount - collected; if (remaining < 0) { remaining = 0; } // report the collect task objective status if (descriptionstr != null) { text = String.Format("{0} ({1} left)", descriptionstr, remaining); } else { if (name != null) { if (type == null) { type = "mob"; } text = String.Format("Collect {0} {1}(s) named {2} ({3} left)", targetcount, type, name, remaining); } else { text = String.Format("Collect {0} {1}(s) ({2} left)", targetcount, type, remaining); } } } else if (foundgive) { // get the current give status int collected = 0; try { collected = int.Parse(statestr); } catch { } int remaining = targetcount - collected; if (remaining < 0) { remaining = 0; } // report the collect task objective status if (descriptionstr != null) { text = String.Format("{0} ({1} left)", descriptionstr, remaining); } else { if (name != null) { if (type == null) { type = "item"; } text = String.Format("Give {0} {1}(s) named {2} to {3} ({4} left)", targetcount, type, name, mobname, remaining); } else { text = String.Format("Give {0} {1}(s) to {2} ({3} left)", targetcount, type, mobname, remaining); } } } else { // just report the objectivestring text = objectivestr; } AddHtml(x, y, 223, 35, XmlSimpleGump.Color(text, "EFEF5A"), false, false); if (status) { AddImage(x - 20, y + 3, 0x939); // bullet AddHtmlLocalized(x + 222, y, 225, 37, 1046033, 0xff42, false, false); // Complete } else { AddImage(x - 20, y + 3, 0x938); // bullet AddHtmlLocalized(x + 222, y, 225, 37, 1046034, 0x7fff, false, false); // Incomplete } } }
public virtual bool CheckAtDestination() { EDI dest = GetDestination(); if (dest == null) { return(false); } Mobile escorter = GetEscorter(); if (escorter == null) { return(false); } if (dest.Contains(Location)) { Say(1042809, escorter.Name); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay. // not going anywhere m_Destination = null; m_DestinationString = null; Container cont = escorter.Backpack; if (cont == null) { cont = escorter.BankBox; } Gold gold = new Gold(500, 1000); if (cont == null || !cont.TryDropItem(escorter, gold, false)) { if (escorter.Map != null && escorter.Map != Map.Internal) { gold.MoveToWorld(escorter.Location, escorter.Map); } else { gold.Delete(); } } Misc.Titles.AwardFame(escorter, 10, true); bool gainedPath = false; PlayerMobile pm = escorter as PlayerMobile; if (pm != null) { if (pm.CompassionGains > 0 && DateTime.UtcNow > pm.NextCompassionDay) { pm.NextCompassionDay = DateTime.MinValue; pm.CompassionGains = 0; } if (pm.CompassionGains >= 5) // have already gained 5 points in one day, can gain no more { pm.SendLocalizedMessage(1053004); // You must wait about a day before you can gain in compassion again. } else if (VirtueHelper.Award(pm, VirtueName.Compassion, 1, ref gainedPath)) { if (gainedPath) { pm.SendLocalizedMessage(1053005); // You have achieved a path in compassion! } else { pm.SendLocalizedMessage(1053002); // You have gained in compassion. } pm.NextCompassionDay = DateTime.UtcNow + TimeSpan.FromDays(1.0); // in one day CompassionGains gets reset to 0 ++pm.CompassionGains; } else { pm.SendLocalizedMessage(1053003); // You have achieved the highest path of compassion and can no longer gain any further. } } XmlQuest.RegisterEscort(this, escorter); StopFollow(); SetControlMaster(null); m_EscortTable.Remove(escorter); BeginDelete(); return(true); } return(false); }
public override void OnResponse(NetState sender, RelayInfo info) { // Back Button or window closed switch (info.ButtonID) { case (int)Buttons.Donations: CommandSystem.Handle(sender.Mobile, "[DonationShop"); break; case (int)Buttons.MessageOfTheDay: sender.Mobile.SendGump(new WelcomeGump(0)); break; case (int)Buttons.OCBControl: CommandSystem.Handle(sender.Mobile, "[Controlmap"); break; //case (int)Buttons.OCBTreasuryRewards: //sender.Mobile.SendGump(new Server.Custom.Townsystem.TreasuryKeyGump(sender.Mobile)); //break; case (int)Buttons.OCBCalendar: CommandSystem.Handle(sender.Mobile, "[VulnMap"); break; case (int)Buttons.OCBLeaders: //CommandSystem.Handle(sender.Mobile, "[OCLeaderboard"); CommandSystem.Handle(sender.Mobile, "[militiaboard"); break; //case (int)Buttons.ArenaLeaders: //sender.Mobile.SendGump(new ArenaLeaderboardsGump(sender.Mobile, EArenaMatchEra.eAMR_IPY, EArenaMatchRestrictions.eAMC_Order, 0)); //break; case (int)Buttons.ArenaTournaments: break; //case (int)Buttons.ArenaMyTeams: //sender.Mobile.SendGump(new ArenaAdminGump(sender.Mobile, ArenaAdminGump.ListType.MyTeams)); //break; case (int)Buttons.PveLeaderboards: sender.Mobile.SendGump(new Server.Custom.GoldCoinReportGump(sender.Mobile, Server.Custom.GoldCoinTracker.LastReport)); break; case (int)Buttons.Codex: string url = "http://www.uoancorp.com"; sender.Mobile.LaunchBrowser(url); break; case (int)Buttons.Quests: XmlQuest.NormalQuestButton(sender.Mobile as PlayerMobile); break; case (int)Buttons.Titles: CommandSystem.Handle(sender.Mobile, "[titles"); break; case (int)Buttons.DungeonQueue: break; case (int)Buttons.Battlegrounds: CommandSystem.Handle(sender.Mobile, "[battlegrounds"); break; default: break; } }
private List <QuestStringHolder> FilteredHolders(string search, bool active, bool completed, bool notstarted, bool basequests, bool questsystems) { List <QuestStringHolder> holders = new List <QuestStringHolder>(); if (search.Length > 0) { foreach (var quest in Quests.QuestHolders) { if (!holders.Contains(quest) && (Insensitive.Contains(quest.Description, search) || Insensitive.Contains(quest.Name, search) || (quest.MobileName != null && Insensitive.Contains(quest.MobileName, search)))) { holders.Add(quest); } } } else { holders = Quests.QuestHolders; } List <QuestStringHolder> playerHolders = new List <QuestStringHolder>(); if (!active || !completed || !notstarted) { if (active) { foreach (var quest in holders) { if (!playerHolders.Contains(quest) && IsActiveQuest(mPlayer, quest)) { playerHolders.Add(quest); } } } if (completed) { foreach (var quest in holders) { if (!playerHolders.Contains(quest) && IsCompletedQuest(mPlayer, quest)) { playerHolders.Add(quest); } } } if (notstarted) { foreach (var quest in holders) { if (!playerHolders.Contains(quest) && (!IsActiveQuest(mPlayer, quest) && !IsCompletedQuest(mPlayer, quest))) { playerHolders.Add(quest); } } } } else { playerHolders = holders; } holders = new List <QuestStringHolder>(); if (basequests) { foreach (var quest in playerHolders) { if (!holders.Contains(quest) && quest.QuestType == "Base") { holders.Add(quest); } } } if (questsystems) { foreach (var quest in playerHolders) { if (!holders.Contains(quest) && quest.QuestType == "System") { holders.Add(quest); } } } if (active) { List <Item> items = XmlQuest.FindXmlQuest(mPlayer); if (items != null && items.Count > 0) { foreach (var item in items) { if (item is XmlQuestHolder) { XmlQuestHolder xml = (XmlQuestHolder)item; holders.Add(new QuestStringHolder(xml.GetType(), xml.Name, xml.Description1, "XML", "Xml", xml.Objective1)); } } } } return(holders); }