Atrinik Server 2.5
Functions
server/quest.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

static void add_one_drop_quest_item (object *op, const char *quest_name)
static objectfind_quest (object *where, const char *quest_name)
static int has_quest_item (object *op, object *quest_item, sint32 flag, sint64 *num)
static void check_quest_container (object *op, object *quest_container, object *quest_object)
void check_quest (object *op, object *quest_container)

Detailed Description

Quest related code.

Definition in file quest.c.


Function Documentation

static void add_one_drop_quest_item ( object op,
const char *  quest_name 
) [static]

Add a one drop quest item to player's quest container, to mark that it has been dropped for that player and will never drop for him again.

Parameters:
opThe player.
quest_nameName of the quest.

Definition at line 37 of file quest.c.

void check_quest ( object op,
object quest_container 
)

When a monster drops inventory and there is quest container object in it, this function is called to parse the quest container and its contents for any possible quests player may be running.

Warning:
ONLY call on player objects.
Todo:
Add support for multiple objects in quest_container's inventory?
Parameters:
opThe player object.
quest_containerThe quest container.

Definition at line 298 of file quest.c.

static void check_quest_container ( object op,
object quest_container,
object quest_object 
) [static]

Check quest trigger in a single quest container.

Parameters:
opPlayer.
quest_containerQuest container (inside monster/chest/etc).
quest_objectQuest container (inside player), can be NULL.

Definition at line 122 of file quest.c.

static object* find_quest ( object where,
const char *  quest_name 
) [static]

Find a quest inside player's quest container.

Parameters:
opThe player object.
quest_nameName of the quest.
Returns:
The object that is used to represent the quest in the quest container, NULL if no matching quest found.

Definition at line 55 of file quest.c.

static int has_quest_item ( object op,
object quest_item,
sint32  flag,
sint64 *  num 
) [static]

Check if specified player object has a given quest item in their inventory (name and arch name are compared).

Note:
This function is recursive and will call itself on any non-system inventories inside the player until it finds a matching item.
Parameters:
opThe player object.
quest_itemThe quest item we'll be comparing values from.
flagFlag to compare the quest item against, 0 for no flag comparison.
[out]numIf not NULL, will contain number of matching objects found and the return value will always be 0.
Returns:
1 if the player has the quest item, 0 otherwise.

Definition at line 82 of file quest.c.