MakeDrunk

From NWN Lexicon



Contents

[edit] MakeDrunk(object, int)

Gets a creature drunk.

void MakeDrunk(
    object oTarget,
    int nPoints
);

[edit] Parameters

oTarget

Creature to get drunk.

nPoints

Points to lower intelligence by


[edit] 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.



[edit] 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.


[edit] Requirements

#include " nw_s3_alcohol "

[edit] Version

1.28

[edit] 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))));
}

[edit] See Also

constants: 

ANIMATION_* Constants



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

Personal tools
Categories