Manual:Zone Manual/Appendices/Complete magical transfers macros listing

From DikuMUD Wiki
< Manual:Zone Manual‎ | Appendices
Revision as of 06:24, 15 November 2026 by Agent-mud (talk | contribs) (checked against the current code (wiki review 2026-11-15))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Complete magical transfers macros listing

A transfer gives the character who wears, wields or holds an object a bonus (or a penalty) for as long as the object is used: more strength, a better skill, faster attacks. The transfer macros are in vme/include/wmacros.h, which macros.h includes. Each one adds an affect to the object and sets UNIT_FL_MAGIC on it. The bonus works only while the object is equipped (worn, wielded or held), not while it is carried.

Macro What it changes Allowed values
STR_TRANSFER(amount) strength amount -7..+7
DEX_TRANSFER(amount) dexterity amount -7..+7
CON_TRANSFER(amount) constitution amount -7..+7
CHA_TRANSFER(amount) charisma amount -7..+7
BRA_TRANSFER(amount) brain amount -7..+7
MAG_TRANSFER(amount) magic ability amount -7..+7
DIV_TRANSFER(amount) divine ability amount -7..+7
HIT_TRANSFER(amount) the hit point ability amount -7..+7
SKILL_TRANSFER(skill, amount) one skill, SKI_... (see Skill definitions) amount -7..+7
WEAPON_TRANSFER(weapon, amount) one weapon skill or weapon group, WPN_... (see weapon definitions) amount -7..+7
SPELL_TRANSFER(spell, amount) one spell skill or spell group, SPL_... (see Spell definitions) amount -7..+7
SPEED_TRANSFER(delta) attack speed: a positive delta makes the wearer faster delta -8..+8
SLOW_TRANSFER(delta) attack speed, slower: give a negative delta delta -8..+8
CHAR_FLAG_TRANSFER(flags) sets CHAR_ flags on the wearer, e.g. CHAR_FLAG_TRANSFER(CHAR_HIDE) CHAR_ flags

vmc checks the -7..+7 amounts: an object bad with DEX_TRANSFER(9) stops the compile with FATAL: bad: Adjustment 9 outside -7..+7 in ID -8.; the header's comments still say -10..+10, which is out of date. The speed limit is not checked by vmc: the server ignores a delta outside -8..+8 and logs it.

A ring that adds 1 to strength, from the dragon station:

maskwa
names {"maskwa platinum ring", "platinum ring", "maskwa ring", "maskwa",
       "ring"}
title "a Maskwa ring"
descr "A Maskwa platinum ring is lying here."
type ITEM_WORN
manipulate {MANIPULATE_TAKE, MANIPULATE_WEAR_FINGER}
STR_TRANSFER(+1)
weight 1
cost 100 COPPER_PIECE
end

An object can have several transfers. All the macros look alike; this is SKILL_TRANSFER as wmacros.h defines it:

/* skill MUST be one of SKI_XXX, amount in -10 to +10 */
#define SKILL_TRANSFER(skill, amount) \
flags {UNIT_FL_MAGIC}        \
affect                       \
   id ID_SKILL_TRANSFER      \
   duration -1               \
   data[0] skill             \
   data[1] amount            \
   firstf  TIF_SKI_INC       \
   tickf   TIF_NONE          \
   lastf   TIF_SKI_DEC       \
   applyf  APF_SKILL_ADJ;

The other macros differ in the id, the data values and the functions named in firstf, lastf and applyf; vmc checks that these match, so use the macros rather than writing affect blocks by hand. wmacros.h also has CURSED_OBJECT, which makes an object impossible to remove once worn.

Previous: Liquid macros file
Next: Skill definitions in values.h