mirror of
https://github.com/tbamud/tbamud.git
synced 2026-03-30 08:57:20 +02:00
Add NPC skills, update medit menu
This commit is contained in:
parent
cc342ef45c
commit
ed8ee4aa5f
11 changed files with 375 additions and 178 deletions
15
src/utils.h
15
src/utils.h
|
|
@ -659,10 +659,17 @@ do \
|
|||
/** The type of quest ch is currently participating in. */
|
||||
#define GET_QUEST_TYPE(ch) (real_quest(GET_QUEST((ch))) != NOTHING ? aquest_table[real_quest(GET_QUEST((ch)))].type : AQ_UNDEFINED )
|
||||
|
||||
/** The current skill level of ch for skill i. */
|
||||
#define GET_SKILL(ch, i) CHECK_PLAYER_SPECIAL((ch), ((ch)->player_specials->saved.skills[i]))
|
||||
/** Copy the current skill level i of ch to pct. */
|
||||
#define SET_SKILL(ch, i, pct) do { CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.skills[i]) = pct; } while(0)
|
||||
/* Unified access macros for PC and NPC skills */
|
||||
#define GET_SKILL(ch, i) \
|
||||
(IS_NPC(ch) ? ((ch)->mob_specials.skills[(i)]) : ((ch)->player_specials->saved.skills[(i)]))
|
||||
|
||||
#define SET_SKILL(ch, i, pct) do { \
|
||||
if (IS_NPC(ch)) \
|
||||
(ch)->mob_specials.skills[(i)] = (pct); \
|
||||
else { \
|
||||
CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.skills[(i)]) = (pct); \
|
||||
} \
|
||||
} while (0)
|
||||
/** Per-skill next gain time (epoch seconds). Index with a valid skill number. **/
|
||||
#define GET_SKILL_NEXT_GAIN(ch, i) \
|
||||
(CHECK_PLAYER_SPECIAL((ch), (ch)->player_specials->saved.next_skill_gain[(i)]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue