Stendhal Quest Coding: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Hendrik Brummermann →Second Part of this Tutorial: linkfix |
imported>Hendrik Brummermann decreased indent |
||
| Line 37: | Line 37: | ||
public class BeerForHayunn extends AbstractQuest { |
public class BeerForHayunn extends AbstractQuest { |
||
public static final String QUEST_SLOT = "beer_hayunn"; |
|||
@Override |
|||
public void addToWorld() { |
|||
super.addToWorld(); |
|||
} |
|||
} |
|||
@Override |
|||
public String getSlotName() { |
|||
return QUEST_SLOT; |
|||
} |
|||
} |
|||
@Override |
|||
public String getName() { |
|||
return "BeerForHayunn"; |
|||
} |
|||
} |
|||
} |
} |
||
</source> |
</source> |
||
| Line 61: | Line 61: | ||
<source lang="java"> |
<source lang="java"> |
||
import games.stendhal.server.maps.quests.BeerForHayunn; |
|||
// [...] |
// [...] |
||
loadQuest(new BeerForHayunn()); |
|||
</source> |
</source> |
||
| Line 77: | Line 77: | ||
<source lang="java"> |
<source lang="java"> |
||
public void prepareQuestStep() { |
|||
// get a reference to the Hayunn npc |
|||
SpeakerNPC npc = npcs.get("Hayunn Naratha"); |
|||
// add a reply on the trigger phrase "quest" to Hayunn |
|||
npc.addReply("quest", "My mouth is dry, but I can't be seen to abandon this teaching room!"); |
|||
} |
|||
} |
|||
</source> |
</source> |
||
| Line 91: | Line 91: | ||
<source lang="java"> |
<source lang="java"> |
||
@Override |
|||
public void addToWorld() { |
|||
super.addToWorld(); |
|||
prepareQuestStep(); |
|||
} |
|||
} |
|||
</source> |
</source> |
||
| Line 108: | Line 108: | ||
<source lang="java"> |
<source lang="java"> |
||
public void prepareQuestStep() { |
|||
// get a reference to the Hayunn npc |
|||
SpeakerNPC npc = npcs.get("Hayunn Naratha"); |
|||
// add a reply on quest related trigger phrases to Hayunn |
|||
npc.addReply(ConversationPhrases.QUEST_MESSAGES, |
|||
"My mouth is dry, but I can't be seen to abandon this teaching room!"); |
|||
} |
} |
||
</source> |
</source> |
||