Full Version : Protect npc quest
xmlspawner >>Q&A >>Protect npc quest


<< Prev | Next >>

grimman- 05-07-2007
Hi there. I need some help with a quest that I am planning to do. It is a quest where you have to kill a certain mobile (this is not the problem) but, you also have to protect the questgiver that is helping you. Now I have no idea how to do that.

Basicly I want to do it like this: if the questgiver is killed, the quest changes to "failed" and the Quest book is deleted from the inventory.

ArteGordon- 05-07-2007
There is no built-in quest type like that, but the way I would do it is like this.

I would add an XmlDeathAction attachment to your npc that you want to be protected, with an Action that deletes the players questholder.

Try something like this

SETONSPAWN,questnpcspawner,1/ATTACH/<xmldeathaction/expiration/00:10/action/@SET,{GETONCARRIED,questname,questholder,serial}/DELETE>

where you would have your questnpc spawned on a spawner named 'questnpcspawner' and you would put it in subgroup 1. Then have a triggered spawner, or an xmldialog entry that executes the line above.
You would also substitute the name of your questholder for the 'questname' argument to the GETONCARRIED keyword.
For this to work you would have to have already given the questholder to the player, and the player should be the triggering mob for the entry that GETONCARRIED would refer to.
I also added an expiration time, so that after 10 mins, the attachment would delete itself, so that is how long they would have to keep them alive.

When the npc dies, it will delete the item with the specified serial no (the questholder).

grimman- 05-09-2007
Cheers mate! But now I got another question. I am trying to make the spawners that are related to the quest to reset when the quest npc is killed, but I am not sure how to do that. I already know about the:

SET,spawner1,xmlspawner/doreset/true

So I guess I need to put something in to the Condition, and I have already tryed some, which haven't worked.

jan- 11-24-2008
CODE
{GETONCARRIED,questname,questholder,serial}/


QUOTE

When the npc dies, it will delete the item with the specified serial no (the questholder).


Every item have the specified serial number.

How can I know the serial number ?

LowCastle- 11-25-2008
QUOTE (jan @ November 25, 2008 05:55 am)
CODE
{GETONCARRIED,questname,questholder,serial}/


QUOTE

When the npc dies, it will delete the item with the specified serial no (the questholder).


Every item have the specified serial number.

How can I know the serial number ?

Since each item has a unique serial, you cannot know it. I believe Arte meant for us to leave the word serial in there, just as he had it. Give it a try and let us know if it works!