MakeDrunk(object, int)

Gets a creature drunk.

void MakeDrunk(
    object oTarget,
    int nPoints
);

Parameters

oTarget

Creature to get drunk.

nPoints

Points to lower intelligence by


Description

Has oTarget play one of two animations (ANIMATION_LOOPING_PAUSE_DRUNK or ANIMATION_LOOPING_TALK_LAUGHING) and lowers his / her intelligence by nPoints for 60 seconds.



Remarks

nw_s3_alcohol.nss: 20

Only creatures have intelligence and can do these animations, so this will only work on creatures (obviously). However, not all creatures have all animations, so the animation bit might not work for all creatures. Should work for all NPC-type creatures.


Requirements

#include "nw_s3_alcohol"

Version

1.28

Example

//version 1.28 source, in nw_s3_alcohol
void MakeDrunk(object oTarget, int nPoints)
{
    if (Random(100) + 1 < 40)
        AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING));
    else
        AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK));

    effect eDumb = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nPoints);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDumb, oTarget, 60.0);
 //   AssignCommand(oTarget, SpeakString(IntToString(GetAbilityScore(oTarget,ABILITY_INTELLIGENCE))));
}

See Also

categories: Action on Object Functions | Effects Functions
constants: ANIMATION_* Constants


 author: Lilac Soul, additional contributor(s): Lilac Soul