Fatal Dimensions - MavEtJu's rom coding part

User snippets

Addaffect

Who needs this?

Everybody who wants to put spell-affects on objects which are permanent.

Usage

none > set affect
Syntax: set aff <obj> add <loc> <#mod> [<obj|aff|imm|res|vuln> <flags>]
Syntax: set aff <obj> del <aff#>
Where:
loc none str dex int wis con sex class level age height weight mana hp move gold exp ac hitroll damroll saving-para saving-rod saving-petri saving-breath saving-spell spell
mod: a number
flags for aff blind invisible detect_evil detect_invis detect_magic detect_hidden detect_good sanctuary faerie_fire infrared curse poison protect_evil protect_good sneak hide sleep charm flying pass_door haste calm plague weaken dark_vision berserk swim regeneration slow
flags for imm summon charm magic weapon bash pierce slash fire cold lightning acid poison negative holy energy mental disease drowning light sound wood silver iron
flags for res summon charm magic weapon bash pierce slash fire cold lightning acid poison negative holy energy mental disease drowning light sound wood silver iron
flags for vuln summon charm magic weapon bash pierce slash fire cold lightning acid poison negative holy energy mental disease drowning light sound wood silver iron

none > set affect flag add none 0 aff flying
none > set affect flag add str 2
none > stat obj flag
Name(s): orange flag
[...]
Values: 0 0 0 0 0
Extra description keywords: 'orange flag'
Removable affect str by 2, level 0.
Removable affect none by 0, level 0. Adds flying affect.

none > set affect flag del 1
none > stat obj flag
Name(s): orange flag
[...]
Values: 0 0 0 0 0
Extra description keywords: 'orange flag'
Removable affect str by 2, level 0.

Warning

When removing affects, make sure they’re removable (i.e. not from the object itself but from enchantments, this function and so on). I’ve solved it by modifying the stat obj command so that it displays the difference between static affects, from the object itself versus removable affects, from enchantments.

none > stat obj sword
Name(s): sword Peppin
[...]
Damage noun is slash.
Weapons flags: frost sharp vorpal
Removable affect str by 2, level 50. 
Static affect none by 0, level 50. Adds extra anti_class object flag.
Static affect damroll by 3, level 50. 
Static affect hitroll by 3, level 50. 

So the first affect (strengh) is removable, the rest isn’t.

Where to find it?