DragnMaw

Member
I want to start playing with the Quest System a little bit more on my shard, and was wondering if anyone knows how to do the following with the quest:

Only have certain quests available on certain days?
Delete quests that are no longer valid after the certain day?
Prevent anyone from repeating a quest within a 24 hour period?

I guess lack for a better explanation, I want to create a Quest Giver, who has a rotating selection of quests, and will only assign 1 of the selection a day, and disable the quest being turned in if completed the next day.
 
Or I guess if no one knows how or it can't be done, anyone know how to set the quest to not be completable within the same 24 hour UTC time?
 
I am not sure about the rotating quest giving (I like the idea, though). But for making a quest a daily, you could add a quest item, and put a 24 self-delete timer on it. I have a script from the old RunUO page with an example of that (their's is a 6 hour timer). But a 24 hour timer would be for 24 hours after the quest was taken - not a calendar day.

Some of that can be done on the xml spawner itself. There is a tutorial here - XML Spawner Tutorial | ServUO - Ultima Online Emulation
This is from that tutorial, about spawning items/mobiles on a delete timer:
TemporaryQuestObject
The syntax is: TemporaryQuestObject,questname[,expiration]
This attachment allows you to tag items/mobiles so that they are automatically deleted after some period of time, or whenever the quest they are associated with is completed

I recently read a script that had variable responses by the amount of time between talking to the NPC... I forget what that was in... I am looking for it. I meant to copy it out into my quest notes folder. It was changing the quality of the loot, depending on time, but could probably be adjusted to change the quest completely depending on time.

Oh, I just of thought of one, the Random Quest Generator. He has a list of quest types/items/adjectives etc. You could make the quest scroll self delete, or put a timer on talking to him. Maybe? It is not exactly what you are looking for, but perhaps a step in the right direction?
 

Attachments

  • Item Self Delete Timer.cs
    2.3 KB · Views: 7
  • Random Quest Gen.zip
    26.4 KB · Views: 13
Thanks Tukaram,

I expected you would pop up here sooner rather than later lol. The Temporary Quest Object is actually a good idea, assuming I can find a way to do like a switch()/case by day... or maybe random the quest given out with a list that reselects the quest every 24 hours... hmmm idk quite yet.
Post automatically merged:

public override TimeSpan RestartDelay { get { return TimeSpan.FromMinutes(90); } }

Thats the code needed to prevent someone from restarting a quest for x minutes, for anyones future reference.
 
Last edited:
Update request for help. Does anyone, know of anyway, to prevent someone from taking multiple quests from the same Quest Giver?
I tried the

public override TimeSpan SpeakDelay => TimeSpan.FromMinutes(60);

But that only stops their random yellings at people for that amount of time.
 
A quick and easy way (and easy for player to get around it) is to add an item as part of the quest, and if the item is in the backpack - he will not speak to you. This gives a quest intro gump OnClick. If you have the quest book, no "talk" option on clicking the NPC. (in this quest the Quest Book is given by this gump)

You could add a timer to limit talking to him to once a day/hour/whatever... timers are not my forte, though.

If you want the quest done one time only, you can use an account tag, but that means once per account only. There is an xml tag for the player... but I do not know how to use that yet.

public override void OnClick()
{
if (!(m_Mobile is PlayerMobile))
return;
PlayerMobile mobile = (PlayerMobile)m_Mobile;
{
Item a = mobile.Backpack.FindItemByType(typeof(ElementalQuestBook)); // This check keeps them from getting multiple quest gems at once.
if (a == null)


if (!mobile.HasGump(typeof(ElementalStartQuestGump)))
{
mobile.SendGump(new ElementalStartQuestGump(mobile));
}
}
}
 
Tukaram, on that same note, couldn't I technically check a players Quest Log to see if they have x quest? Theres 3 quest givers, each giving 7 different quests, but I only want players to get 1 from each quest giver. All of the quests have the same Quest Name (logical not C#). Is there any way to check a players quest log easily?

Also Tukaram, I'm writing these using the ML QuestEngine, not the basic quest engine.

Edit - I found a bit of code I think might work... Tho I'm worried it may backfire...
public static bool QuestLimitReached(PlayerMobile player)
{
if (player.Quests.Count >= 10)
{
player.SendLocalizedMessage(1075141); // You are too busy with other tasks at this time.
return true;
}

return false;
}

So there is a quest limit... Would I be able to do that as an override on the quest giver to 1?

That plan doesnt work, unless I change the overall quest count to a lower number, which will effect the other quests.
Post automatically merged:

Omg I finally got it work. I ended up completely copying the Quest Engine, and essentially making my own to deal with these quests in specific.

1610479988299.png
 
Last edited:

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back