AdjustAlignment(object, int, int, int)

Adjusts the alignment of a creature.

void AdjustAlignment(
    object oSubject,
    int nAlignment,
    int nShift,
    int bAllPartyMembers = TRUE



Target to have alignment adjusted.




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


TRUE (whole party) or FALSE (oSubject only) (Default: TRUE)


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.


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.

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

If bAllPartyMembers is TRUE, characters in a party with a PC who is the target of AdjustAlignment will also have their alignments adjusted. The specifed PC (oSubject) receives the full adjustment to their alignment, while members of the PC's party receive a 20% adjustment to their alignment, rounded up (hence a minimum of 1 point). If you wish to avoid this and ONLY change oSubject's alignment, set bAllPartyMembers (added in version 1.69) to FALSE. 

Adjust alignment does not affect DMs.

Known Bugs

An alignment adjustment for the PC does not affect the PC's associates even when bAllPartyMembers is TRUE. However an alignment adjustment specified for an associate does affect it's PC master.



See Also

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

 author: Charles Feduke, editor: Grimlar, Mistress additional contributors: Jemoney, Tom Cassiotis, Xachaffery Vermillion, Martin Jorgensen, Mikel Rice, Grimlar, Lilac Soul, Cereborn