%skillAffectAdd()

Aliases%skillAffectAdd( )
Parameterscharacter @target, mixed @skill, string @location, integer @modifier, integer @duration [, mixed @flags ]

    Applies the affect described by @skill to the given @target. The @skill
may either be the name of the skill ("detect invisible") or it may be the
ID of the skill. The @location describes what type of stat the affect
modifies. The following locations are recognized:

abilities hurtStealth savePrayer
ac immune saveRod
age intelligence saveSpell
charisma level sex
class mana skill
constitution manaRegen spell
damage manaUpkeep strength
damroll material striking
dexterity moves susceptable
eatSpell movesRegen thac0
experience movesUpkeep thaco
gold pairedWeapon timer
height rent visible
hitroll resistant weaponSpell
hits saveAll weight
hitsRegen saveBreath wisdom
hitsUpkeep saveParalyze
hurtArcana savePetrify NONE

The @modifier denotes the amount by which to modify the given location.
For instance the @location might be set to strength and the @modifier set
to 2 which would increase the target's strength by 2 points for the given
@duration. The @duration parameter should be set to the number of in game
hours (ticks) that the affect should last. The final, optional parameter,
@flags can be set to the name of a boolean affect, or alternatively to an
array whose values are names of boolean affects. The following boolean
affect names are recognized:

anti magic feeble mind mana shield
bash feign death move impaired
blindness fiery vortex poison
charm fists of fury protection from evil
chill touch fly regenerate
curse follow sanctuary
deadly poison glamorie sense life
death's door half hp regen shide
detect evil half mana regen shocking grasp
detect invisibility half move regen sickness
detect magic hide silence
dominated infravision sleep
double hp regen insanity snare
double mana regen invisibility sneak
double move regen invulnerability water breath
fear lich touch water walk

Sometimes you will only want to have a boolean affect like "fly" or
"infravision". In these case you can set the @location value to NONE, and
the modifier to 0. Note that this function only applies affects defined by
the traditional internal affect system.

Example 1:
--------------------------------------------------------------------------

//
// Affect the @target with "bless" spell which provides +1 to hitroll
// and enables them to "detect evil" for 6 hours (ticks).
//

%skillAffectAdd( @target, bless, hitroll, 1, 6, "detect evil" )


Example 2:
--------------------------------------------------------------------------

//
// Affect the @target with "bless" spell which provides ability to "sense
// life", "detect evil", "detect magic", "detect invisibility", and
// "infravision" for 10 hours (ticks).
//

@bits->1 = "sense life"
@bits->2 = "detect evil"
@bits->3 = "detect invisibility"
@bits->4 = "detect magic"
@bits->5 = "infravision"

%skillAffectAdd( @target, "bless", NONE, 0, 10, @bits )