Crossfire Server, Trunk
|
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "commands.h"
#include "shared/newclient.h"
#include "skills.h"
#include "spells.h"
#include "sproto.h"
Go to the source code of this file.
Functions | |
static void | change_spell (object *op, char k) |
void | command_cast (object *op, const char *params) |
void | command_cast_spell (object *op, const char *params, int cast_now) |
void | command_invoke (object *op, const char *params) |
void | command_rotateshoottype (object *op, const char *params) |
int | legal_range (object *op, int r) |
static void | show_matching_spells (object *op, const char *params) |
Range related commands (casting, shooting, throwing, etc.).
Definition in file c_range.c.
|
static |
Rotate the selected range attack.
op | player. |
k | '+' selects next range, other values previous range. |
Definition at line 285 of file c_range.c.
References draw_ext_info(), draw_ext_info_format(), legal_range(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, give::name, NDI_UNIQUE, give::op, query_base_name(), query_name(), range_bottom, range_bow, range_golem, range_magic, range_misc, range_none, range_size, and range_skill.
Referenced by command_rotateshoottype().
void command_cast | ( | object * | op, |
const char * | params | ||
) |
'cast' command, prepares a spell for laster casting.
op | player. |
params | spell. |
Definition at line 50 of file c_range.c.
References command_cast_spell(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_cast_spell | ( | object * | op, |
const char * | params, | ||
int | cast_now | ||
) |
Sets up to cast a spell.
Invoke casts a spell immediately, whereas cast just set up the range type.
op | caster. |
params | spell name. |
cast_now | 0 to ready the spell, 1 to cast it immediately |
Definition at line 146 of file c_range.c.
References cast_spell(), draw_ext_info_format(), find_skill_by_name(), lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, obj::name, NDI_UNIQUE, object_find_by_tag(), object_free_drop_inventory(), object_get_value(), object_remove(), give::op, roll-o-matic::params, range_golem, range_magic, remove_friendly_object(), make_face_from_files::required, safe_strncpy, show_matching_spells(), obj::skill, SPELL, sstring, and obj::type.
Referenced by command_cast(), and command_invoke().
void command_invoke | ( | object * | op, |
const char * | params | ||
) |
'invoke' command, fires a spell immediately.
op | player. |
params | spell. |
Definition at line 38 of file c_range.c.
References command_cast_spell(), give::op, and roll-o-matic::params.
Referenced by commands_init().
void command_rotateshoottype | ( | object * | op, |
const char * | params | ||
) |
'rotateshoottype' command, switch range attack.
op | player. |
params | arguments to the command. |
Definition at line 351 of file c_range.c.
References change_spell(), give::op, and roll-o-matic::params.
Referenced by commands_init().
int legal_range | ( | object * | op, |
int | r | ||
) |
Check for the validity of a player range.
This function could probably be simplified, eg, everything should index into the ranges[] array.
op | player to check. |
r | range to check. |
1 | range specified is legal - that is, the character has an item that is equipped for that range type. |
0 | no item of that range type that is usable. |
Definition at line 247 of file c_range.c.
References give::op, ring_occidental_mages::r, range_bow, range_golem, range_magic, range_misc, range_none, and range_skill.
Referenced by change_spell(), and check_login().
|
static |
Shows all spells that op knows.
Given there is more than one skill, we can't supply break them down to cleric/wizardry.
op | player wanting to knows her spells. |
params | if supplied, the spell name must match that. |
Definition at line 65 of file c_range.c.
References draw_ext_info(), draw_ext_info_format(), FOR_INV_FINISH, FOR_INV_PREPARE, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, NROFREALSPELLS, give::op, roll-o-matic::params, SP_level_spellpoint_cost(), SPELL, SPELL_HIGHEST, and Ice::tmp.
Referenced by command_cast_spell().