Manual:Zone Manual/The NPC Section/Suggested NPC exercises
Jump to navigation
Jump to search
Suggested NPC exercises
The DIL functions named here are described, with their arguments, in DIL functions for NPCs. Compile each exercise, then load the NPCs in the game and try them out.
- Using
teamwork@function, create a guard that helps all the other guards of your zone when they are attacked. - Add
rescue@functionto the guard from exercise 1, so that it rescues the other guards as well as helping them. - Using
shopkeepernew@function(withgive_shopfix@function, which every shopkeeper needs), make a shopkeeper who sells two kinds of food, makes five of each at a time, and buys only food. Be creative with the other arguments. - Turn the shopkeeper from exercise 3 into a wandering salesman. (Look at the
shophomeargument.) - Using
aggressive@function, create a dwarf that attacks any orc (RACE_ORC) that walks into the room. - Build the same NPC twice, once field by field with
MSET_ABILITY,MSET_WEAPONandMSET_SPELL, and once from a template inmacros.h. Compare the two withvmc -v.