Atrinik Server 2.5
Functions
commands/object.c File Reference
#include <global.h>

Go to the source code of this file.

Functions

objectfind_best_object_match (object *pl, char *params)
int command_uskill (object *pl, char *params)
int command_rskill (object *pl, char *params)
int command_apply (object *op, char *params)
int sack_can_hold (object *pl, object *sack, object *op, int nrof)
static void pick_up_object (object *pl, object *op, object *tmp, int nrof, int no_mevent)
void pick_up (object *op, object *alt, int no_mevent)
void put_object_in_sack (object *op, object *sack, object *tmp, long nrof)
void drop_object (object *op, object *tmp, long nrof, int no_mevent)
void drop (object *op, object *tmp, int no_mevent)
int command_take (object *op, char *params)
int command_drop (object *op, char *params)
static objectfind_marked_object_rec (object *op, object **marked, uint32 *marked_count)
objectfind_marked_object (object *op)
void examine_living (object *op, object *tmp)
char * long_desc (object *tmp, object *caller)
void examine (object *op, object *tmp)
int command_rename_item (object *op, char *params)

Detailed Description

Object ID parsing functions

Definition in file object.c.


Function Documentation

int command_apply ( object op,
char *  params 
)

Apply an item. Accepts parameters like -a to always apply, and -u to always unapply.

Parameters:
opObject requesting this.
paramsCommand parameters.
Returns:
Always returns 0.

Definition at line 120 of file object.c.

int command_drop ( object op,
char *  params 
)

/drop command.

Parameters:
opPlayer.
paramsWhat to drop.
Returns:
0.

Definition at line 1050 of file object.c.

int command_rename_item ( object op,
char *  params 
)

Add a custom name to the marked object.

Parameters:
opPlayer.
paramsNew name.
Returns:
1.

Definition at line 1813 of file object.c.

int command_rskill ( object pl,
char *  params 
)

Ready skill command.

Parameters:
plPlayer object.
paramsCommand parameters.
Returns:
1 on success, 0 on failure.

Definition at line 88 of file object.c.

int command_take ( object op,
char *  params 
)

/take command.

Parameters:
opPlayer.
paramsWhat to take.
Returns:
0.

Definition at line 928 of file object.c.

int command_uskill ( object pl,
char *  params 
)

Use skill command.

Parameters:
plPlayer object.
paramsCommand parameters.
Returns:
1 on success, 0 on failure.

Definition at line 67 of file object.c.

void drop ( object op,
object tmp,
int  no_mevent 
)

Drop an item, either on the floor or in a container.

Parameters:
opWho is dropping an item.
tmpWhat object to drop.
no_meventIf 1, no drop map-wide event will be triggered.

Definition at line 884 of file object.c.

void drop_object ( object op,
object tmp,
long  nrof,
int  no_mevent 
)

Drop an object onto the floor.

Parameters:
opPlayer object.
tmpThe object to drop.
nrofNumber of items to drop (0 for all).
no_meventIf 1, no map-wide event will be triggered.

Definition at line 702 of file object.c.

void examine ( object op,
object tmp 
)

Player examines some object.

Parameters:
opPlayer.
tmpObject to examine.

Definition at line 1366 of file object.c.

void examine_living ( object op,
object tmp 
)

Player examines a living object.

Parameters:
opPlayer.
tmpObject being examined.

Definition at line 1193 of file object.c.

object* find_best_object_match ( object pl,
char *  params 
)

Search the inventory of 'pl' for what matches best with params. We use item_matched_string above - this gives us consistent behavior between many commands.

Parameters:
plPlayer object.
paramsParameters string.
Returns:
Best match, or NULL if no match.

Definition at line 39 of file object.c.

object* find_marked_object ( object op)

Return the object the player has marked.

Parameters:
opObject. Should be a player.
Returns:
Marked object if still valid, NULL otherwise.

Definition at line 1179 of file object.c.

static object* find_marked_object_rec ( object op,
object **  marked,
uint32 marked_count 
) [static]

Recursive helper function for find_marked_object() to search for marked object in containers.

Parameters:
opObject. Should be a player.
markedMarked object.
marked_countMarked count.
Returns:
The object if found, NULL otherwise.

Definition at line 1128 of file object.c.

char* long_desc ( object tmp,
object caller 
)

Long description of an object.

Parameters:
tmpObject to get description of.
callerCaller.
Returns:
The returned description.

Definition at line 1293 of file object.c.

void pick_up ( object op,
object alt,
int  no_mevent 
)

Try to pick up an item.

Parameters:
opObject trying to pick up.
altOptional object op is trying to pick. If NULL, try to pick first item under op.
no_meventIf 1, no map-wide pickup event will be triggered.

Definition at line 408 of file object.c.

static void pick_up_object ( object pl,
object op,
object tmp,
int  nrof,
int  no_mevent 
) [static]

Pick up object.

Parameters:
plObject that is picking up the object.
opObject to put tmp into.
tmpObject to pick up.
nrofNumber to pick up (0 means all of them).
no_meventIf 1, no map-wide pickup event will be triggered.

Definition at line 226 of file object.c.

void put_object_in_sack ( object op,
object sack,
object tmp,
long  nrof 
)

Player tries to put object into sack, if nrof is non zero, then nrof objects is tried to put into sack.

Parameters:
opPlayer object.
sackThe sack.
tmpThe object to put into sack.
nrofNumber of items to put into sack (0 for all).

Definition at line 554 of file object.c.

int sack_can_hold ( object pl,
object sack,
object op,
int  nrof 
)

Check if an item op can be put into a sack. If pl exists then tell a player the reason of failure.

Parameters:
plPlayer object.
sackThe sack.
opThe object to check.
nrofNumber of objects we want to put in.
Returns:
1 if the object will fit, 0 if it will not.

Definition at line 180 of file object.c.