void ReportAlignment(object oTarget)
{
    int iLawChaos = GetLawChaosValue(oTarget);
    int iGoodEvil = GetGoodEvilValue(oTarget);

    string sLawChaos = " (Neutral)";
    string sGoodEvil = " (Neutral)";

    if (iLawChaos <= 30) sLawChaos = " (Chaotic)";
    if (iLawChaos >= 70) sLawChaos = " (Lawful)";
    if (iGoodEvil <= 30) sGoodEvil = " (Evil)";
    if (iGoodEvil >= 70) sGoodEvil = " (Good)";

    string sLawChaosFeedback = IntToString(iLawChaos) + sLawChaos;
    string sGoodEvilFeedback = IntToString(iGoodEvil) + sGoodEvil;

    string sAlignFeedback = "Your alignment = " + sLawChaosFeedback + ", " + sGoodEvilFeedback;
    SetCustomToken(115, sAlignFeedback);
    FloatingTextStringOnCreature(sAlignFeedback, oTarget);
}

void SetAlignment(object oTarget, int iLawfulChaotic, int iGoodEvil)
{
    // start by Neutralizing both scales
        AdjustAlignment(oTarget, ALIGNMENT_NEUTRAL, 50);

    // set Lawful / Chaotic scale
    if (iLawfulChaotic == ALIGNMENT_LAWFUL)
        AdjustAlignment(oTarget, ALIGNMENT_LAWFUL, 85);
    else if (iLawfulChaotic == ALIGNMENT_CHAOTIC)
        AdjustAlignment(oTarget, ALIGNMENT_CHAOTIC, 85);

    // set Good / Evil scale
    if (iGoodEvil == ALIGNMENT_GOOD)
        AdjustAlignment(oTarget, ALIGNMENT_GOOD, 85);
    else if (iGoodEvil == ALIGNMENT_EVIL)
        AdjustAlignment(oTarget, ALIGNMENT_EVIL, 85);

    // feedback to the PC on the current values
    ReportAlignment(oTarget);

    //int iGoodEvil = GetGoodEvilValue(oTarget);
    //int iLawChaos = GetLawChaosValue(oTarget);
    //FloatingTextStringOnCreature("Good/Evil=" + IntToString(iGoodEvil) + ", Law/Chaos=" + IntToString(iLawChaos), oTarget);
}


