AdjustAlignment(object, int, int)

Adjusts the alignment of a creature.

void AdjustAlignment(
    object oSubject,
    int nAlignment,
    int nShift
);

Parameters

oSubject

Target to have alignment adjusted.

nAlignment

ALIGNMENT_*

nShift

The desired amount to shift the alignment (numeric range from -100 to 100).


Description

Adjust the alignment of a oSubject.
ALIGNMENT_LAWFUL, ALIGNMENT_CHAOTIC, ALIGNMENT_GOOD, ALIGNMENT_EVIL: alignment will be shifted in the direction specified.
ALIGNMENT_ALL: nShift will be added to oSubject's law/chaos and good/evil alignment values (thus adding/subtracting the same amount to both).
ALIGNMENT_NEUTRAL: nShift is applied to oSubject's law/chaos and good/evil alignment values in the direction which is towards neutrality.



Remarks

Alignment is not treated as a continuous scale running from 0 to 100, but in three bands running from 0 to 30, 31 to 69 and 70 to 100.

Whenever a call to AdjustAlignment takes you over one of these boundaries, your characters alignment is automatically placed at the middle of the new band, ie 15, 50 or 85.

If we look at a character (oSubject) with a good/evil alignment value of 71 who performs an act that moves their alignment towards evil we get the following behaviour... If the adjustment was a single point, their new alignment value would be 70, if the adjustment is more, two or even ten points, the new alignment would be 50.

However, if the alignment shift is sufficiently large, then the characters alignment will 'skip' a band. In the case given here, an alignment shift of 41 points or more would be sufficient to give the character an evil alignment, with a good/evil value of 15.

Example for ALIGNMENT_NEUTRAL: if oSubject has a law/chaos value of 10 (i.e. chaotic) and a good/evil value of 85 (i.e. good) then if nShift is 15, the law/chaos value will become (10+15)=25 and the good/evil value will become (85-15)=70.

Note, the ALIGNMENT_NEUTRAL shift will at most take the alignment value to 50 and not beyond (above or below).

Characters in a party with a PC who is the target of an AdjustAlignment will also have their alignments affected as well. The perpetrator of the act (oSubject) receives the full adjustment to their alignment. Party members of the target receive a 20% adjustment to their alignment rounded up, ie a minimum of 1 point.

Also note that current alignment of the party members has no effect on the 'knock on' adjustment. That is, if a Lawful Neutral party member performs a chaotic act, the alignment of Chaotic party members will be shifted towards chaotic as well.

Adjust alignment does not affect DMs.


Known Bugs

An alignment shift for the PC doesnt have a knock on effect on the associate. Although an alignment shift for an associate will have a knock on effect on the PC.


Version

1.61

See Also

functions: AdjustAlignmentOnAll | AdjustReputation | GetAlignmentGoodEvil | GetAlignmentLawChaos | GetReputation
categories: Alignment Functions
constants: ALIGNMENT_* Constants


 author: Charles Feduke, editor: Grimlar, additional contributor(s): Jemoney, Tom Cassiotis, Xachaffery Vermillion, Martin Jorgensen, Mikel Rice, Grimlar, Lilac Soul
 Send comments on this topic.