Crossfire Server, Trunk
skills.h
Go to the documentation of this file.
1 
6 #ifndef SKILLS_H
7 #define SKILLS_H
8 
19 enum SK {
21  SK_HIDING = 2,
23  SK_BOWYER = 4,
24  SK_JEWELER = 5,
25  SK_ALCHEMY = 6,
29  SK_JUMPING = 10,
30  SK_DET_MAGIC = 11,
31  SK_ORATORY = 12,
32  SK_SINGING = 13,
33  SK_DET_CURSE = 14,
36  SK_PUNCHING = 17,
38  SK_KARATE = 19,
39  SK_CLIMBING = 20,
40  SK_WOODSMAN = 21,
44  SK_THROWING = 25,
47  SK_SET_TRAP = 28,
49  SK_PRAYING = 30,
50  SK_CLAWING = 31,
52  SK_SUMMONING = 33,
53  SK_PYROMANCY = 34,
54  SK_EVOCATION = 35,
55  SK_SORCERY = 36,
59  SK_AIR_MAGIC = 40,
63 };
64 
70 #define MAX_SKILLS 50
71 
78 #define SK_EXP_ADD_SKILL 0
79 #define SK_EXP_TOTAL 1
80 #define SK_EXP_NONE 2
81 #define SK_SUBTRACT_SKILL_EXP 3
83 
84 
85 #define USING_SKILL(op, skill) ((op)->chosen_skill && (op)->chosen_skill->subtype == skill)
86 
91 #define IS_COMBAT_SKILL(num) \
92  ((num == SK_PUNCHING) \
93  || (num == SK_FLAME_TOUCH) \
94  || (num == SK_KARATE) \
95  || (num == SK_ONE_HANDED_WEAPON) \
96  || (num == SK_MISSILE_WEAPON) \
97  || (num == SK_THROWING) \
98  || (num == SK_CLAWING) \
99  || (num == SK_TWO_HANDED_WEAPON) \
100  || (num == SK_WRAITH_FEED))
101 
106 #define IS_MANA_SKILL(num) \
107  ((num == SK_SORCERY) \
108  || (num == SK_EVOCATION) \
109  || (num == SK_PYROMANCY) \
110  || (num == SK_SUMMONING) \
111  || (num==SK_AIR_MAGIC) \
112  || (num==SK_EARTH_MAGIC) \
113  || (num==SK_FIRE_MAGIC) \
114  || (num==SK_WATER_MAGIC))
115 
116 
120 #define IS_GRACE_SKILL(num) \
121  (num == SK_PRAYING)
122 
123 extern const char *skill_names[MAX_SKILLS];
124 extern const Face *skill_faces[MAX_SKILLS];
126 
127 extern int get_skill_client_code(const char *skill_name);
128 
129 #ifdef WANT_UNARMED_SKILLS
130 
142 static uint8_t unarmed_skills[] = {
143  SK_KARATE,
144  SK_CLAWING,
146  SK_PUNCHING,
148  0
149 };
150 
151 /* Just in case one file includes this more than once */
152 #undef WANT_UNARMED_SKILLS
153 
154 #endif
155 
156 #endif /* SKILLS_H */
Face
Definition: face.h:14
SK_FIRE_MAGIC
@ SK_FIRE_MAGIC
Definition: skills.h:62
SK_INSCRIPTION
@ SK_INSCRIPTION
Definition: skills.h:41
SK_ALCHEMY
@ SK_ALCHEMY
Definition: skills.h:25
SK_CLAWING
@ SK_CLAWING
Definition: skills.h:50
get_skill_client_code
int get_skill_client_code(const char *skill_name)
Definition: skill_util.cpp:116
SK_DET_MAGIC
@ SK_DET_MAGIC
Definition: skills.h:30
SK_DISARM_TRAPS
@ SK_DISARM_TRAPS
Definition: skills.h:46
SK_PRAYING
@ SK_PRAYING
Definition: skills.h:49
SK_KARATE
@ SK_KARATE
Definition: skills.h:38
SK_MEDITATION
@ SK_MEDITATION
Definition: skills.h:35
SK_SET_TRAP
@ SK_SET_TRAP
Definition: skills.h:47
SK_SINGING
@ SK_SINGING
Definition: skills.h:32
SK_SORCERY
@ SK_SORCERY
Definition: skills.h:55
SK_EARTH_MAGIC
@ SK_EARTH_MAGIC
Definition: skills.h:60
SK_HARVESTING
@ SK_HARVESTING
Definition: skills.h:58
SK_TWO_HANDED_WEAPON
@ SK_TWO_HANDED_WEAPON
Definition: skills.h:56
SK_JEWELER
@ SK_JEWELER
Definition: skills.h:24
SK_LITERACY
@ SK_LITERACY
Definition: skills.h:27
SK_DET_CURSE
@ SK_DET_CURSE
Definition: skills.h:33
SK_BOWYER
@ SK_BOWYER
Definition: skills.h:23
SK
SK
Definition: skills.h:19
SK_EVOCATION
@ SK_EVOCATION
Definition: skills.h:54
skill_names
const char * skill_names[MAX_SKILLS]
Definition: skill_util.cpp:59
SK_BARGAINING
@ SK_BARGAINING
Definition: skills.h:28
SK_SUMMONING
@ SK_SUMMONING
Definition: skills.h:52
SK_AIR_MAGIC
@ SK_AIR_MAGIC
Definition: skills.h:59
MAX_SKILLS
#define MAX_SKILLS
Definition: skills.h:70
SK_FLAME_TOUCH
@ SK_FLAME_TOUCH
Definition: skills.h:37
SK_JUMPING
@ SK_JUMPING
Definition: skills.h:29
SK_HIDING
@ SK_HIDING
Definition: skills.h:21
SK_LEVITATION
@ SK_LEVITATION
Definition: skills.h:51
SK_LOCKPICKING
@ SK_LOCKPICKING
Definition: skills.h:20
SK_WOODSMAN
@ SK_WOODSMAN
Definition: skills.h:40
SK_PUNCHING
@ SK_PUNCHING
Definition: skills.h:36
SK_WRAITH_FEED
@ SK_WRAITH_FEED
Definition: skills.h:57
sstring
const typedef char * sstring
Definition: sstring.h:2
skill_faces
const Face * skill_faces[MAX_SKILLS]
Definition: skill_util.cpp:63
SK_STEALING
@ SK_STEALING
Definition: skills.h:26
SK_MISSILE_WEAPON
@ SK_MISSILE_WEAPON
Definition: skills.h:43
SK_ONE_HANDED_WEAPON
@ SK_ONE_HANDED_WEAPON
Definition: skills.h:42
SK_PYROMANCY
@ SK_PYROMANCY
Definition: skills.h:53
SK_SMITHERY
@ SK_SMITHERY
Definition: skills.h:22
skill_messages
sstring skill_messages[MAX_SKILLS]
Definition: skill_util.cpp:69
SK_THAUMATURGY
@ SK_THAUMATURGY
Definition: skills.h:48
SK_FIND_TRAPS
@ SK_FIND_TRAPS
Definition: skills.h:34
SK_USE_MAGIC_ITEM
@ SK_USE_MAGIC_ITEM
Definition: skills.h:45
SK_CLIMBING
@ SK_CLIMBING
Definition: skills.h:39
SK_THROWING
@ SK_THROWING
Definition: skills.h:44
SK_ORATORY
@ SK_ORATORY
Definition: skills.h:31
SK_WATER_MAGIC
@ SK_WATER_MAGIC
Definition: skills.h:61