Go to the documentation of this file.
35 #define WANT_UNARMED_SKILLS
84 LOG(
llevError,
"init_skills: too many skills, increase MAX_SKILLS and rebuild server!");
123 assert(
"invalid skill!");
150 if (!
skill && !skill_tool)
215 int num_names, highest_level_skill=0, i;
221 if (!strchr(
name,
',')) {
223 skill_tools[0] = NULL;
229 ourname = strdup(
name);
231 if ((
skill_names[0] = strtok_r(ourname,
",", &lasts)) == NULL) {
233 LOG(
llevError,
"find_skill_by_name: strtok_r returned null, but strchr did not?\n");
237 skill_tools[0] = NULL;
241 while ((
skill_names[num_names] = strtok_r(NULL,
",", &lasts)) != NULL) {
248 skill_tools[num_names] = NULL;
263 for (i = 0; i<num_names; i++) {
270 highest_level_skill=i;
279 skill_tools[i] =
tmp;
315 object *
skill = NULL, *skill_tool = NULL;
365 old_range =
who->contr->shoottype;
368 if (new_skill &&
who->chosen_skill &&
who->chosen_skill->skill == new_skill->
skill) {
375 if (
who->chosen_skill)
386 who->contr->shoottype = old_range;
399 who->chosen_skill = NULL;
432 int success = 0, exp = 0;
449 LOG(
llevError,
"do_skill: asked for skill %s but couldn't find matching SKILL archetype.\n",
skill->skill);
456 if (
skill->anim_suffix)
459 switch (
skill->subtype) {
469 "You come to earth.");
473 "You rise into the air!.");
568 "This skill is not currently implemented.");
574 "There is no special attack for this skill.");
595 "This skill is already in effect.");
607 LOG(
llevDebug,
"%s attempted to use unknown skill: %d\n",
name,
op->chosen_skill->stats.sp);
620 op->speed_left -= 1.0;
670 float base,
value, lvl_mult;
686 op_lvl =
MAX(
who->map->difficulty, 1);
690 op_exp =
op->stats.Cha > 1 ?
op->stats.Cha :
op->stats.exp;
693 op_exp =
op->stats.exp;
696 op_lvl += 5*abs(
op->magic);
704 return ((int64_t)(op_exp*0.1)+1);
713 base +=
skill->arch->clone.stats.exp;
715 if (
skill->arch->clone.level)
716 lvl_mult = (float)
skill->arch->clone.level/100.0;
721 lvl_mult = ((float)
skill->arch->clone.level*(
float)op_lvl)/((
float)
skill->level*100.0);
727 lvl_mult = (float)op_lvl/(
float)(
skill->level ?
skill->level : 1);
732 value = base*lvl_mult;
736 #ifdef SKILL_UTIL_DEBUG
737 LOG(
llevDebug,
"calc_skill_exp(): who: %s(lvl:%d) op:%s(lvl:%d)\n",
who->name,
skill->level,
op ?
op->name :
"", op_lvl);
739 return ((int64_t)
value);
762 if (!scroll->
skill) {
763 LOG(
llevError,
"skill scroll %s does not have skill pointer set.\n", scroll->
name);
794 LOG(
llevError,
"skill scroll %s does not have valid skill name (%s).\n", scroll->
name, scroll->
skill);
820 rv = (
int)((100.0f*((
float)
a)/((
float)
b))+0.5f);
841 return num == 0 ? 1 :
floor( log10( labs(num) ) ) + 1;
862 int i, num_skills_found = 0;
865 const char *search =
parms;
866 bool long_format =
false;
871 while ( *search && *search !=
' ' ) ++search;
872 while ( *search ==
' ' ) ++search;
876 if (search && strstr(
tmp->name, search) == NULL)
912 "Your character has too many skills.\n"
913 "Something isn't right - contact the server admin");
919 if ( search && *search ) {
921 "Player skills%s: (matching '%s')", long_format ?
" (long format)":
"",search);
924 "Player skills%s:", long_format ?
" (long format)":
"");
927 if (num_skills_found > 1)
928 qsort(
skills, num_skills_found,
MAX_BUF, (
int (*)(
const void *,
const void *))strcmp);
930 for (i = 0; i < num_skills_found; i++) {
936 if (strcmp(cp,
"none") == 0)
940 "You can handle %d weapon improvements.\n"
942 "Your equipped item power is %d out of %d\n",
944 cp ? cp :
"no god at current time",
945 op->contr->item_power,
op->level);
975 && !strncasecmp(
string,
tmp->skill,
MIN(strlen(
string), strlen(
tmp->skill)))) {
980 && !strncasecmp(
string,
tmp->skill,
MIN(strlen(
string), strlen(
tmp->skill)))) {
987 "Unable to find skill %s",
992 len = strlen(skop->
skill);
999 if (len >= strlen(
string)) {
1003 while (*
string == 0x20)
1005 if (strlen(
string) == 0)
1009 #ifdef SKILL_UTIL_DEBUG
1043 object *best_skill = NULL;
1046 if (
op->contr->unarmed_skill) {
1062 "Unable to find skill %s - using default unarmed skill",
1063 op->contr->unarmed_skill);
1067 for (i = 0; i <
sizeof(unarmed_skills); i++)
1068 if (best_skill->
subtype == unarmed_skills[i])
1070 if (i <
sizeof(unarmed_skills))
1092 last_skill =
sizeof(unarmed_skills);
1105 for (i = 0; i < last_skill; i++) {
1148 if (
op->chosen_skill) {
1151 for (i = 0; unarmed_skills[i] != 0; i++)
1152 if (
op->chosen_skill->subtype == unarmed_skills[i]) {
1164 "You have no unarmed combat skills!");
1169 if (
skill !=
op->chosen_skill) {
1174 "Couldn't change to skill %s",
1184 if (!
op->current_weapon) {
1187 LOG(
llevError,
"Player %s does not have current weapon set but flag_ready_weapon is set\n",
op->name);
1190 LOG(
llevError,
"Could not find applied weapon on %s\n",
op->name);
1191 op->current_weapon = NULL;
1197 op->current_weapon =
tmp;
1202 if (!
op->chosen_skill ||
op->current_weapon->skill !=
op->chosen_skill->skill) {
1204 assert(found_skill != NULL);
1212 if (
op->type ==
PLAYER &&
op->contr->tmp_invis) {
1213 op->contr->tmp_invis = 0;
1229 }
else if (
string != NULL) {
1305 && (
pl->contr->party != NULL &&
pl->contr->party == tmp2->contr->party))
1315 "There is nothing to attack!");
1345 if (weapon != NULL) {
1352 "You are unable to unwield %s in order to attack with %s.",
1353 weaponname,
skill->name);
1357 "You unwield your weapon in order to attack.");
1388 "You have no ready weapon to attack with!");
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters as well as how often the character can attack this affects the prices when buying and selling items if this drops the player will start losing hit points wd Cleric or Dwarf sm Elf wd Fireborn ft Human ra Mage C Monk se Ninja hi Priest C Quetzalcoatl mw Swashbuckler si Thief st Viking ba Warrior or Wizard C Wraith C Class Prof Str Dex Con Wis Cha Int Pow Net Skills Enclosed are codes used for the skills above The ones in and fighting should all be pretty self explanatory For the other skills
object * object_find_by_type_applied(const object *who, int type)
#define MSG_TYPE_ATTACK_MISS
int learn_skill(object *pl, object *scroll)
void LOG(LogLevel logLevel, const char *format,...)
int use_alchemy(object *op)
static void do_skill_attack(object *tmp, object *op, const char *string, object *skill)
#define QUERY_FLAG(xyz, p)
void archetypes_for_each(arch_op op)
#define MSG_TYPE_ATTACK_DID_HIT
object * give_skill_by_name(object *op, const char *skill_name)
int write_on_item(object *pl, const char *params, object *skill)
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...) PRINTF_ARGS(6
int use_oratory(object *pl, int dir, object *skill)
int singing(object *pl, int dir, object *skill)
int skill_ident(object *pl, object *skill)
void fix_object(object *op)
object * object_find_by_type_and_skill(const object *who, int type, const char *skill)
int find_traps(object *pl, object *skill)
object * find_skill_by_number(object *who, int skillno)
sstring skill_messages[MAX_SKILLS]
static int digits_in_long(int64_t num)
static int free_skill_index()
Plugin animator file specs[Config] name
static event_registration m
const char * skill_names[MAX_SKILLS]
void object_update(object *op, int action)
int pick_lock(object *pl, int dir, object *skill)
int change_skill(object *who, object *new_skill, int flag)
sstring add_refcount(sstring str)
const char * determine_god(object *op)
short freearr_y[SIZEOFFREE]
static void attack_hth(object *pl, int dir, const char *string, object *skill)
static int clipped_percent(int64_t a, int64_t b)
void query_name(const object *op, char *buf, size_t size)
int shop_describe(const object *op)
int remove_trap(object *op, object *skill)
sstring add_string(const char *str)
void apply_anim_suffix(object *who, const char *suffix)
int do_skill(object *op, object *part, object *skill, int dir, const char *string)
const Face * skill_faces[MAX_SKILLS]
int exp_level(int64_t exp)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
#define MSG_TYPE_SKILL_MISSING
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
int64_t level_exp(int level, double expmul)
int pray(object *pl, object *skill)
void skill_attack(object *tmp, object *pl, int dir, const char *string, object *skill)
static void do_each_skill(archetype *at)
#define FLAG_CAN_USE_SKILL
#define MSG_TYPE_VICTIM_WAS_HIT
int skill_throw(object *op, object *part, int dir, object *skill)
int get_skill_client_code(const char *skill_name)
void clear_skill(object *who)
static void attack_melee_weapon(object *op, int dir, const char *string, object *skill)
static object * find_best_player_hth_skill(object *op)
static object * adjust_skill_tool(object *who, object *skill, object *skill_tool)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
#define PERM_EXP(exptotal)
#define MSG_TYPE_SKILL_ERROR
void fatal(enum fatal_error err)
#define MSG_TYPE_SKILL_FAILURE
int use_skill(object *op, const char *string)
int is_dragon_pl(const object *op)
int get_learn_spell(int stat)
#define MSG_TYPE_SKILL_LIST
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
const typedef char * sstring
Magical Runes Runes are magical inscriptions on the dungeon floor
#define CLEAR_FLAG(xyz, p)
void do_harvest(object *pl, int dir, object *skill)
#define SK_SUBTRACT_SKILL_EXP
int random_roll(int min, int max, const object *op, int goodbad)
int apply_special(object *who, object *op, int aflags)
void show_skills(object *op, const char *parms)
void meditate(object *pl, object *skill)
int steal(object *op, int dir, object *skill)
int64_t calc_skill_exp(const object *who, const object *op, const object *skill)
Magical Runes Runes are magical inscriptions on the dungeon which cast a spell or detonate when something steps on them Flying objects don t detonate runes Beware ! Runes are invisible most of the time They are only visible occasionally ! There are several runes which are there are some special runes which may only be called with the invoke and people may apply it to read it Maybe useful for mazes ! This rune will not nor is it ordinarily invisible Partial Visibility of they ll be visible only part of the time They have a(your level/2) chance of being visible in any given round
#define OB_TYPE_MOVE_BLOCK(ob1, type)
uint8_t permanent_exp_ratio
#define MSG_TYPE_SKILL_SUCCESS
int attack_ob(object *op, object *hitter)
short freearr_x[SIZEOFFREE]
void link_player_skills(object *op)
#define FLAG_READY_WEAPON
object * find_skill_by_name(object *who, const char *name)
#define FOR_INV_PREPARE(op_, it_)
int jump(object *pl, int dir, object *skill)