Stendhal Quest Coding - Part 3: Difference between revisions

Content deleted Content added
imported>Hendrik Brummermann
No edit summary
imported>Kymara
typos
Line 12:
== Rewarding the player ==
 
In the last section of this tutorial we taught Hayunn to only accept one beer per player. We diddidn't neitheractually care about takingtake the beer from the player nor did we reward the player. We want to add this functionality now.
 
We have to do several things at once:
* take the beer from the player
* provide some money as refund
* increase the xp and karmykarma
* and finally remember that the quest was completed
 
But don't worry, that sounds more complicated than it actually is. There are already actions for all of these tasks that can be combined using a MultiActionMultipleAction:
 
<source lang="java">
Line 42:
Let's make it a bit easier for player to remember that they bought a beer in order to give it to Hayunn. Hayunn will notice the beer as soon as the player says "hi" and actively asks for it.
 
Therefore we add a new trigger for the GREETING_MESSAGE. There is an internal rule that transitions which have a condition (that is true) are preferred over equal transitions without one. So our greeting transition is used instead of the normal one if the player has the item and the quest is active. Similar to the MultiActionMultipleAction, there is an AndCondition which combines multiple elementary ones.
 
<source lang="java">
Line 97:
== Quest Documentation ==
 
We are almost done now. Almost? Yes, a very important thing is still missing. And we should have done it as the first thing. But well, better late than never.
 
<source lang="java">