Completing quests

There are several ways to complete a quest. In the previous example, the player completes the quest by talking to the NPC or adding friends. We can complete a quest anywhere and dispatch a complete event to inform the monitoring quest daemon.

Another common method to complete a quest is to hand in an item that the NPC needs. A panel will pop up for the player to hand in some items. The panel is basically the same as the selling item panel that was discussed in the last chapter except that now we are giving a specific item to NPC instead of selling any items. Therefore, the only difference between this panel and the selling panel is that we need to check if the submit item is what NPC needs. The NPC's desired item type is stored ...

Get Flash Multiplayer Virtual Worlds now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.