Stendhal Quest Coding: Difference between revisions

Jump to navigation Jump to search
Content deleted Content added
imported>MiguelAngelBlanchLardin
No edit summary
imported>Oslsachem
No edit summary
Line 447: Line 447:
}
}
}
}
</pre>

Finally, when you have finished your quest Java file, you have to edit the ''StendhalQuestSystem.java'' Java file at ''games/stendhal/server'' and add your quest to it to make the Quest System "aware" of the existence of your newly added quest. In this example, our Java quest file is ''LookBookForCeryl.java'' so we add its name at the end of the list of already existent quests:

<pre>
package games.stendhal.server;
import marauroa.common.Log4J;
import org.apache.log4j.Logger;
import games.stendhal.server.maps.quests.IQuest;
public class StendhalQuestSystem
{
/** the logger instance. */
private static final Logger logger = Log4J.getLogger(StendhalQuestSystem.class);
StendhalRPWorld world;
StendhalRPRuleProcessor rules;
public StendhalQuestSystem(StendhalRPWorld world, StendhalRPRuleProcessor rules)
{
this.world=world;
this.rules=rules;
loadQuest("SheepGrowing");
loadQuest("OrcishHappyMeal");
loadQuest("LookBookforCeryl");
}
</pre>
</pre>