server/c_new.c File Reference

#include <global.h>
#include <sproto.h>

Go to the source code of this file.

Data Structures

struct  _new_char_template

Defines

#define MAP_POS_X   0
#define MAP_POS_Y   1
#define NROF_MAP_NODE   (sizeof(map_pos_array) / (sizeof(int) * 2))

Functions

int command_run (object *op, char *params)
int command_run_stop (object *op, char *params)
void send_target_command (player *pl)
int command_combat (object *op, char *params)
int command_target (object *op, char *params)
static void set_first_map (object *op)
void command_new_char (char *params, int len, player *pl)
void command_face_request (char *params, int len, player *pl)
void command_fire (char *params, int len, player *pl)
void send_mapstats_cmd (object *op, struct mapdef *map)
static char spelllist_determine_path (object *op, int spell_number)
static void add_spell_to_spelllist (object *op, int spell_number, StringBuffer *sb)
void send_spelllist_cmd (object *op, const char *spellname, int mode)
void send_skilllist_cmd (object *op, object *skillp, int mode)
void send_ready_skill (object *op, const char *skillname)
void send_golem_control (object *golem, int mode)
void generate_ext_title (player *pl)

Variables

static int map_pos_array [][2]
static _new_char_template new_char_template []

Detailed Description

This file deals with administrative commands from the client.

Definition in file c_new.c.


Function Documentation

static void add_spell_to_spelllist ( object op,
int  spell_number,
StringBuffer sb 
) [static]

Helper function for send_spelllist_cmd(), adds one spell to buffer which is then sent to the client as the spell list command.

Parameters:
op Object.
spell_number ID of the spell to add.
sb StringBuffer instance to add to.

Definition at line 982 of file c_new.c.

int command_combat ( object op,
char *  params 
)

Turn combat mode on/off.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
Always returns 1.

Definition at line 272 of file c_new.c.

void command_face_request ( char *  params,
int  len,
player pl 
)

Request a face command.

Parameters:
params Parameters.
len Length.
pl Player.

Definition at line 845 of file c_new.c.

void command_fire ( char *  params,
int  len,
player pl 
)

The fire command.

Sent by the client by pressing Ctrl + numpad.

Parameters:
params Parameters.
len Length.
pl Player.

Definition at line 875 of file c_new.c.

void command_new_char ( char *  params,
int  len,
player pl 
)

Client sent us a new char creation.

At this point we know the player's name and the password but nothing about his (player char) base arch.

This command tells us which the player has selected and how he has setup the stats.

If anything is not correct here, we kill this socket.

Parameters:
params Parameters.
len Length.
pl Player structure.

Definition at line 696 of file c_new.c.

int command_run ( object op,
char *  params 
)

Run command. Used to make your character run in specified direction.

Parameters:
op Object requesting this.
params Command parameters.

Definition at line 88 of file c_new.c.

int command_run_stop ( object op,
char *  params 
)

Command to stop running.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
Always returns 1.

Definition at line 121 of file c_new.c.

int command_target ( object op,
char *  params 
)

Look for a target.

Parameters:
op Object requesting this.
params Command parameters.
Returns:
Always returns 1.

Definition at line 300 of file c_new.c.

void generate_ext_title ( player pl  ) 

Generate player's extended name from race, gender, guild, etc.

Parameters:
pl The player.

Definition at line 1122 of file c_new.c.

void send_golem_control ( object golem,
int  mode 
)

Send to client the golem face and name.

Parameters:
golem Golem object (will grab golem owner from this).
mode One of Golem control modes.

Definition at line 1103 of file c_new.c.

void send_mapstats_cmd ( object op,
struct mapdef map 
)

Sends mapstats command to the client, after the player has entered the map.

Command sends map width, map height, map name, map music, etc.

Parameters:
op Player object.
map Map.

Definition at line 937 of file c_new.c.

void send_ready_skill ( object op,
const char *  skillname 
)

Send skill ready command.

Parameters:
op Object.
skillname Name of skill to ready.

Definition at line 1091 of file c_new.c.

void send_skilllist_cmd ( object op,
object skillp,
int  mode 
)

Send skill list to the client.

Parameters:
op Object.
skillp Skill object; if not NULL, will only send this skill.
mode One of Spell list modes.

Definition at line 1056 of file c_new.c.

void send_spelllist_cmd ( object op,
const char *  spellname,
int  mode 
)

Send spell list command to the client.

Parameters:
op Player.
spellname If specified, send only this spell name. Otherwise send all spells the player knows.
mode One of Spell list modes.

Definition at line 1012 of file c_new.c.

void send_target_command ( player pl  ) 

Send target command, calculate the target's color level, etc.

Parameters:
pl Player requesting this.

Definition at line 132 of file c_new.c.

static void set_first_map ( object op  )  [static]

This loads the first map an puts the player on it.

Parameters:
op The player object.

Definition at line 594 of file c_new.c.

static char spelllist_determine_path ( object op,
int  spell_number 
) [static]

Determine spell's path for spell list sending.

Parameters:
op Object.
spell_number Spell ID.
Return values:
d Player is denied from casting the spell.
a Player is attuned to the spell.
r Player is repelled from the spell.
Returns:
If none of the above, a space character is returned.

Definition at line 954 of file c_new.c.


Variable Documentation

Initial value:
{
    {"human_male", 5, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14},
    {"human_female", 5, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14},
    {"half_elf_male", 5, 12, 14, 13, 15, 11, 13, 12, 14, 11, 13, 13, 15, 12, 14},
    {"half_elf_female", 5, 12, 14, 13, 15, 11, 13, 12, 14, 11, 13, 13, 15, 12, 14},
    {NULL, 5, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14, 12, 14}
}

The new character templates.

Definition at line 674 of file c_new.c.


Generated by  doxygen 1.6.2