Full Version : Quest rewards
xmlspawner >>Q&A >>Quest rewards


<< Prev | Next >>

malavon- 05-24-2006
Hi Arte!

Please, how can I give quest rewards directly to players backpack? I found some info about rewardstring, but this dont work.

I have item *expstonefifty* (give to player 50 exp). Expstone is non-stackable item.

I tryed:

/autoreward/true/rewardstring/expstonefifty - work correctly, give 1 expstone to player
/autoreward/true/rewardstring/expstonefifty/expstonefifty - dont work
/autoreward/true/rewardstring/expstonefifty,2 - dont work
/autoreward/true/rewardstring/@expstonefifty/expstonefifty - dont work
/autoreward/true/rewardstring/@/expstonefifty/expstonefifty - dont work
/autoreward/true/rewardstring/@expstonefifty,expstonefifty - dont work

Have you any idea?

Thanks

ArteGordon- 05-24-2006
QUOTE (malavon @ May 24, 2006 07:20 am)
Hi Arte!

Please, how can I give quest rewards directly to players backpack? I found some info about rewardstring, but this dont work.

I have item *expstonefifty* (give to player 50 exp). Expstone is non-stackable item.

I tryed:

/autoreward/true/rewardstring/expstonefifty - work correctly, give 1 expstone to player
/autoreward/true/rewardstring/expstonefifty/expstonefifty - dont work
/autoreward/true/rewardstring/expstonefifty,2 - dont work
/autoreward/true/rewardstring/@expstonefifty/expstonefifty - dont work
/autoreward/true/rewardstring/@/expstonefifty/expstonefifty - dont work
/autoreward/true/rewardstring/@expstonefifty,expstonefifty - dont work

Have you any idea?

Thanks

/autoreward/true/rewardstring/expstonefifty - work correctly, give 1 expstone to player

this works because you have an item called expstonefifty that has a constructor that can be called with no arguments.

/autoreward/true/rewardstring/expstonefifty,2 - dont work

this tries to call the constructor for your expstonefifty item with an argument of 2. If it doesnt work it means that you dont have any constructor that accepts an argument like that.

The rewardstring can only refer to a single item. So if you wanted to add a reward of multiple items, the way to do it is to ADD them into a single bag, and since you apparently cant add them using a quantity argument (they probably arent stackable), then you would add each one separately like this

/autoreward/true/rewardstring/@bag/ADD/expstonefifty/ADD/expstonefifty

you need to put this at the end of the entry string, and you need to use the @ operator so that the literal string "bag/ADD/expstonefifty/ADD/expstonefifty" is assigned as the reward string. If you didnt have the @, then it would try to parse the special '/' characters. The @ allows you to include such special chars in your rewardstring.

Note that the rewardstring "bag/ADD/expstonefifty/ADD/expstonefifty" is exactly what you would use as a spawn entry if you wanted to spawn a bag with two of those items.

malavon- 05-24-2006
QUOTE (ArteGordon @ May 24, 2006 02:18 pm)
/autoreward/true/rewardstring/@bag/ADD/expstonefifty/ADD/expstonefifty

Rewards in a bag are probably right way and I made this before I wrote my previous post. But I want to give rewards directly to players backpack (inventory) without any containers.

ArteGordon- 05-24-2006
QUOTE (malavon @ May 24, 2006 11:45 am)
QUOTE (ArteGordon @ May 24, 2006 02:18 pm)
/autoreward/true/rewardstring/@bag/ADD/expstonefifty/ADD/expstonefifty

Rewards in a bag are probably right way and I made this before I wrote my previous post. But I want to give rewards directly to players backpack (inventory) without any containers.

you can give rewards without containers, but if you do it using the autoreward system, then they have to be single items. They can be stacked (that still counts as a single item), but you cant have multiple separate items unless they are held in a container.

LDamian- 06-22-2006
Hi Arte!

Please, could you help me? How can I give quest rewards without using the autoreward system? Please, give me an example.

EDIT: Thank you very much. You helped me.

ArteGordon- 06-22-2006
you can take a look at some of the quest examples, such as blather3.xml, draugquest.xml, dracondarquest.xml, or harmonsquest.xml

They all use reward spawners to give out rewards instead of using autorewards.

The basic idea is to simply set up a triggered spawner that has the TriggerOnCarried set to the questholder with the desired objectives completed, like

myquestname,1,2,3

and then in that spawner, use the GIVE keyword to give the reward item, and the TAKE keyword to take the questholder or anything else (like a returned item etc.)

You can also do the same thing with xmldialogs.

(edit)

here is a very simple example of a .npc file with just 2 dialog entries that gives a quest and then gives the reward on completion.
Just save it to a file named simplequest.npc, and load it onto an npc or object with '[loadnpc simplequest'.
When you approach the npc/object it will give you the quest. When you complete the objective (kill an orc) and return, it will give you the reward and take the questholder.
Notice how it uses the IgnoreCarried flag on the reward dialog entry to allow that entry to be triggered even though the NoTriggerOnCarried string would normally prevent triggering of entries if the player was carrying the quest.
The reward entry uses the GETONCARRIED keyword in the Condition field to check to see if the player has completed the quest.

QUOTE

<?xml version="1.0" standalone="yes"?>
<XmlQuestNPC>
  <NPC>
    <Name>Radinka</Name>
    <Running>True</Running>
    <ProximityRange>3</ProximityRange>
    <NoTriggerOnCarried>SimpleQuest</NoTriggerOnCarried>
    <AllowGhost>False</AllowGhost>
    <SpeechPace>10</SpeechPace>
    <ResetTime>0.0833333333333333</ResetTime>
    <SpeechEntries>3</SpeechEntries>
  </NPC>
  <SpeechEntry>
    <EntryNumber>10</EntryNumber>
    <ID>10</ID>
    <Text>Here is my quest</Text>
    <Action>GIVE/&lt;questholder/name/SimpleQuest/objective1/KILL,orc&gt;</Action>
    <DependsOn>-2</DependsOn>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>False</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
  <SpeechEntry>
    <EntryNumber>20</EntryNumber>
    <ID>20</ID>
    <Text>You've done it! Here is your reward.</Text>
    <Action>GIVE/gold,100 ; TAKE/SimpleQuest</Action>
    <Condition>GETONCARRIED,SimpleQuest,questholder,iscompleted=true</Condition>
    <DependsOn>-1</DependsOn>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>True</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
  <SpeechEntry>
    <EntryNumber>0</EntryNumber>
    <ID>0</ID>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>False</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
</XmlQuestNPC>


and here is a variation that adds another entry to say something to the player if they return but havent completed the quest.

QUOTE

<?xml version="1.0" standalone="yes"?>
<XmlQuestNPC>
  <NPC>
    <Name>Radinka</Name>
    <Running>True</Running>
    <ProximityRange>3</ProximityRange>
    <NoTriggerOnCarried>SimpleQuest</NoTriggerOnCarried>
    <AllowGhost>False</AllowGhost>
    <SpeechPace>10</SpeechPace>
    <ResetTime>0.0833333333333333</ResetTime>
    <ConfigFile>simplequest</ConfigFile>
    <SpeechEntries>4</SpeechEntries>
  </NPC>
  <SpeechEntry>
    <EntryNumber>0</EntryNumber>
    <ID>0</ID>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>False</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
  <SpeechEntry>
    <EntryNumber>10</EntryNumber>
    <ID>10</ID>
    <Text>Here is my quest</Text>
    <Action>GIVE/&lt;questholder/name/SimpleQuest/objective1/KILL,orc&gt;</Action>
    <DependsOn>-2</DependsOn>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>False</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
  <SpeechEntry>
    <EntryNumber>20</EntryNumber>
    <ID>20</ID>
    <Text>You've done it! Here is your reward.</Text>
    <Action>GIVE/gold,100 ; TAKE/SimpleQuest</Action>
    <Condition>GETONCARRIED,SimpleQuest,questholder,iscompleted=true</Condition>
    <DependsOn>-1</DependsOn>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>True</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
  <SpeechEntry>
    <EntryNumber>30</EntryNumber>
    <ID>30</ID>
    <Text>Back so soon? Get on out there and finish the job!</Text>
    <Condition>GETONCARRIED,SimpleQuest,questholder,iscompleted=false</Condition>
    <DependsOn>-1</DependsOn>
    <Pause>1</Pause>
    <PrePause>-1</PrePause>
    <LockConversation>True</LockConversation>
    <IgnoreCarried>True</IgnoreCarried>
    <AllowNPCTrigger>False</AllowNPCTrigger>
    <SpeechStyle>Regular</SpeechStyle>
    <SpeechHue>-1</SpeechHue>
  </SpeechEntry>
</XmlQuestNPC>

Discord- 06-22-2006
How would you set that up so that the item had to be dropped on the quest giving npc - I would think you use a COLLECT objective, does that require the GIVE/TAKE actions or does using that objective make you have to drop the item that you have collected on the npc?

Im thinking up something in my head and just needed a bit of clarification using the above example.

Thanks.

Dis~

ArteGordon- 06-22-2006
QUOTE (Discord @ June 22, 2006 07:26 pm)
How would you set that up so that the item had to be dropped on the quest giving npc - I would think you use a COLLECT objective, does that require the GIVE/TAKE actions or does using that objective make you have to drop the item that you have collected on the npc?

Im thinking up something in my head and just needed a bit of clarification using the above example.

Thanks.

Dis~

you would use a GIVE objective (not related to the GIVE keyword for giving items to players).

the COLLECT objective just requires that you use the Collect button in the quest gump to target the required item which gets consumed.

Discord- 06-23-2006
ahaaa smile.gif

ArteGordon- 06-23-2006
By default, the GIVE objective will only work with npcs that are derived from one of the talking base classes, like talkingbasecreatures, talkingbasevendors, or talkingbaseescortables (the xmlquestnpcs are talkingbasecreatures).
If you try to give things to any other npc they just wont recognize them.
It is a simple mod to basecreature.cs if you really want to be able to allow all creatures to support the GIVE objective.

QUOTE

  public override bool OnDragDrop(Mobile from, Item dropped)
  {
  if (XmlQuest.RegisterGive(from, this, dropped))
    return true;
  else

  if (CheckFeed(from, dropped))
    return true;
  else if (CheckGold(from, dropped))
    return true;

  return base.OnDragDrop(from, dropped);
  }

Vladimir- 10-09-2006
Hi there

I had a complaint that a quest book I was giving out through a spawner, with gold as a reward, allowed players to use the gold in the questholder to purchase items before they had completed the quest... is there a way around this?

ArteGordon- 10-09-2006
this is a problem with all containers. The same thing happens with things like locked paragon chests. I am hoping that this will be fixed with 2.0.

The only solution is to give out bankchecks instead of gold.

Vladimir- 10-09-2006
Thanks

Lord Hog Fred- 10-10-2006
Um, just a question Arte.
How can I add random rewards to my autoreward bag?
BAsically I have a bag on the autoreward which gives between 500 - 100 gold and some gems, but I'd like to be able to add "rare" rewards, so have say a 10% chance of recieving ArtifactX for example. Is this possible with autoreward?
Cheers smile.gif,

ArteGordon- 10-10-2006
QUOTE (Lord Hog Fred @ October 10, 2006 06:46 pm)
Um, just a question Arte.
How can I add random rewards to my autoreward bag?
BAsically I have a bag on the autoreward which gives between 500 - 100 gold and some gems, but I'd like to be able to add "rare" rewards, so have say a 10% chance of recieving ArtifactX for example. Is this possible with autoreward?
Cheers smile.gif,

You can do something like this

.../rewardstring/@bag/ADD,0.1/ArtifactX/ADD/gold,500