Full Version : Existing quest addtion in quest log
xmlspawner >>Q&A >>Existing quest addtion in quest log


<< Prev | Next >>

Stormwolf- 02-24-2007
Hey Arte & everyone else, I am finally getting around to using xml quests and I came up with a question.

Is there a way to add something to an already coded quest (non xml quest) so that when a player completes that quest it will show up in the quest log as completed?

I guess what I am picturing is something that I could add in code wise around the completion area of my existing quest.

a simple example

part where I give the player the reward
from.attach questname/type/solo/status/completed/points/1/repeatable/true/





ArteGordon- 02-24-2007
Quest progress in the quest log is held on the XmlQuestPoints attachment on the player.
Quest information is added to it with the AddQuestEntry call which normally gets called whenever a quest is completed and quest points are given.

public static void AddQuestEntry(Mobile m, IXmlQuest quest)

You could call this yourself in your own code in order to add entries to the quest log. The IXmlQuest argument is normally a questholder or the equivalent.

The properties on the quest that are used to create the entry in the log are

TimeCreated
Difficulty
PartyEnabled
Name

So you could just create a temporary questholder, assign those properties, make a call to AddQuestEntry and then delete the questholder, like

QuestHolder tmpquest = new QuestHolder();
tmpquest.Name = "your quest name";
tmpquest.Difficulty = 1;
tmpquest.PartyEnabled = false;
tmpquest.TimeCreated = the_start_time_for_your_quest;
AddQuestEntry(from, tmpquest);
tmpquest.Delete();

Stormwolf- 02-24-2007
Thanks that was what I was looking for.