Atrinik Server  4.0
Functions
quest.c File Reference
#include <global.h>
#include <toolkit/string.h>
#include <plugin.h>
#include <arch.h>
#include <player.h>
#include <object.h>

Go to the source code of this file.

Functions

static objectquest_find (object *quest, shstr *quest_name)
 
static int quest_item_check (object *op, object *quest_item, int flag, int64_t *num)
 
static void quest_check_item_drop (object *op, object *quest, object *quest_pl, object *item)
 
static void quest_check_kill (object *op, object *quest, object *quest_pl, object *item)
 
static void quest_check_item (object *op, object *quest, object *quest_pl, object *item)
 
static void quest_object_handle (object *op, object *quest, object *quest_pl)
 
void quest_handle (object *op, object *quest)
 

Detailed Description

Quest related code.

Author
Alex Tokar

Definition in file quest.c.

Function Documentation

static void quest_check_item ( object op,
object quest,
object quest_pl,
object item 
)
static

Handle the item quest type.

Parameters
opPlayer object.
questQuest object.
quest_plQuest object in the player, can be NULL.
itemQuest item.

Definition at line 246 of file quest.c.

static void quest_check_item_drop ( object op,
object quest,
object quest_pl,
object item 
)
static

Handle the item drop quest type.

Parameters
opPlayer object.
questQuest object.
quest_plQuest object in the player, can be NULL.
itemQuest item.

Definition at line 128 of file quest.c.

static void quest_check_kill ( object op,
object quest,
object quest_pl,
object item 
)
static

Handle the kill quest type.

Parameters
opPlayer object.
questQuest object.
quest_plQuest object in the player, can be NULL.
itemQuest item.

Definition at line 196 of file quest.c.

static object* quest_find ( object quest,
shstr *  quest_name 
)
static

Find a quest inside the specified quest object.

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

Definition at line 49 of file quest.c.

void quest_handle ( object op,
object quest 
)

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

Warning
ONLY call on player objects.
Parameters
opThe player object.
questThe quest.

Definition at line 377 of file quest.c.

static int quest_item_check ( object op,
object quest_item,
int  flag,
int64_t *  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, -1 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 80 of file quest.c.

static void quest_object_handle ( object op,
object quest,
object quest_pl 
)
static

Called from quest_handle(). Handles the parsing of a specific quest object.

Parameters
opPlayer object.
questQuest object.
quest_plQuest object in the player, can be NULL.

Definition at line 314 of file quest.c.