Difference between revisions of "Manual:Zone Manual/Appendices/Complete magical transfers macros listing"
(checked against the current code (wiki review 2026-11-15)) |
|||
| Line 1: | Line 1: | ||
==== Complete magical transfers macros listing ==== | ==== 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 [https://github.com/Seifert69/DikuMUD3/blob/master/vme/include/wmacros.h vme/include/wmacros.h], which ''macros.h'' includes. Each one adds an <code>affect</code> to the object and sets <code>UNIT_FL_MAGIC</code> on it. The bonus works only while the object is equipped (worn, wielded or held), not while it is carried. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | {| class="wikitable" | |
| − | + | ! Macro !! What it changes !! Allowed values | |
| − | + | |- | |
| − | + | | <code>STR_TRANSFER(amount)</code> || strength || amount -7..+7 | |
| − | + | |- | |
| − | + | | <code>DEX_TRANSFER(amount)</code> || dexterity || amount -7..+7 | |
| − | + | |- | |
| − | + | | <code>CON_TRANSFER(amount)</code> || constitution || amount -7..+7 | |
| − | + | |- | |
| − | + | | <code>CHA_TRANSFER(amount)</code> || charisma || amount -7..+7 | |
| − | + | |- | |
| − | + | | <code>BRA_TRANSFER(amount)</code> || brain || amount -7..+7 | |
| + | |- | ||
| + | | <code>MAG_TRANSFER(amount)</code> || magic ability || amount -7..+7 | ||
| + | |- | ||
| + | | <code>DIV_TRANSFER(amount)</code> || divine ability || amount -7..+7 | ||
| + | |- | ||
| + | | <code>HIT_TRANSFER(amount)</code> || the hit point ability || amount -7..+7 | ||
| + | |- | ||
| + | | <code>SKILL_TRANSFER(skill, amount)</code> || one skill, <code>SKI_...</code> (see [[Manual:Zone Manual/Appendices/Skill definitions in values.h|Skill definitions]]) || amount -7..+7 | ||
| + | |- | ||
| + | | <code>WEAPON_TRANSFER(weapon, amount)</code> || one weapon skill or weapon group, <code>WPN_...</code> (see [[Manual:Zone Manual/Appendices/weapon definitions in values.h|weapon definitions]]) || amount -7..+7 | ||
| + | |- | ||
| + | | <code>SPELL_TRANSFER(spell, amount)</code> || one spell skill or spell group, <code>SPL_...</code> (see [[Manual:Zone Manual/Appendices/Spell definitions in values.h|Spell definitions]]) || amount -7..+7 | ||
| + | |- | ||
| + | | <code>SPEED_TRANSFER(delta)</code> || attack speed: a positive delta makes the wearer faster || delta -8..+8 | ||
| + | |- | ||
| + | | <code>SLOW_TRANSFER(delta)</code> || attack speed, slower: give a negative delta || delta -8..+8 | ||
| + | |- | ||
| + | | <code>CHAR_FLAG_TRANSFER(flags)</code> || sets <code>CHAR_</code> flags on the wearer, e.g. <code>CHAR_FLAG_TRANSFER(CHAR_HIDE)</code> || <code>CHAR_</code> flags | ||
| + | |} | ||
| − | + | vmc checks the -7..+7 amounts: an object <code>bad</code> with <code>DEX_TRANSFER(9)</code> stops the compile with <code>FATAL: bad: Adjustment 9 outside -7..+7 in ID -8.</code>; 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: | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | <pre> | |
| − | + | 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 | ||
| + | </pre> | ||
| − | + | An object can have several transfers. All the macros look alike; this is <code>SKILL_TRANSFER</code> as ''wmacros.h'' defines it: | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | <pre> | |
| − | + | /* 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; | ||
| + | </pre> | ||
| − | + | The other macros differ in the <code>id</code>, the <code>data</code> values and the functions named in <code>firstf</code>, <code>lastf</code> and <code>applyf</code>; vmc checks that these match, so use the macros rather than writing <code>affect</code> blocks by hand. ''wmacros.h'' also has <code>CURSED_OBJECT</code>, which makes an object impossible to remove once worn. | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
<div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/Appendices/Liquid macros file|Previous: Liquid macros file]]</div> | <div style='padding-top: 30px; padding-bottom: 20px; text-align: left;float:left;width:50%;'>[[Manual:Zone_Manual/Appendices/Liquid macros file|Previous: Liquid macros file]]</div> | ||
<div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/Appendices/Skill definitions in values.h|Next: Skill definitions in values.h]]</div> | <div style='padding-top: 30px; padding-bottom: 20px; text-align: right;float:right;width:50%;'>[[Manual:Zone_Manual/Appendices/Skill definitions in values.h|Next: Skill definitions in values.h]]</div> | ||
Latest revision as of 06:24, 15 November 2026
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.