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

Go to the source code of this file.

Functions

static int find_spell_byname (object *op, char *params, int options)
int command_cast_spell (object *op, char *params)
int fire_cast_spell (object *op, char *params)
int legal_range (object *op, int r)

Detailed Description

Range related commands (casting, shooting, throwing, etc.).

Definition in file range.c.


Function Documentation

int command_cast_spell ( object op,
char *  params 
)

Casts the specified spell.

Parameters:
opCaster.
paramsSpell name.
Returns:
1 on success, 0 otherwise.

Definition at line 99 of file range.c.

static int find_spell_byname ( object op,
char *  params,
int  options 
) [static]

Finds spell by name.

Parameters:
opThe caster.
paramsSpell name.
optionsSpecifies if the search is done with the length of the input spell name, or the length of the stored spell name. This allows you to find out if the spell name entered had extra optional parameters at the end (ie: marking rune <text>)
Returns:
The index value of the spell in the spells array for a match, -1 if there is no match, -2 if there are multiple matches.

Definition at line 42 of file range.c.

int fire_cast_spell ( object op,
char *  params 
)

Similar to command_cast_spell(), but used from command_fire().

Parameters:
opCaster.
paramsSpell name.
Returns:
1 on success, 0 otherwise.
Todo:
Avoid code repetition by merging with command_cast_spell().

Definition at line 200 of file range.c.

int legal_range ( object op,
int  r 
)

Check for the validity of a player range.

Parameters:
opPlayer to check.
rRange to check.
Return values:
1Range specified is legal - that is, the character has an item that is equipped for that range type.
0No item of that range type that is usable.

Definition at line 271 of file range.c.