I knew it was possible and that is why I asked how.
I thought by providing the script in my first post I would get a more direct response.
I suppose I should have mentioned the module is hackless except for CEP. It will stay that way.
I suppose I should be more specific as well.
I want to disable all classes that have an alignment restriction of good or evil.
Harper / Assassin / Palemaster etc...
[/b]
[i]////////////////////////////////////////////////////////////////////////////////
//////////////////SET LIMITATAIONS//////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//Human Limitations: Set the Numbers to the Max classesfor Human.
int nHBarbarian =20; int nHBard = 20; int nHCleric = 20;
int nHDruid = 20; int nHFighter = 20; int nHMonk = 20;
int nHPaladin = 20; int nHRanger = 20; int nHRogue = 20;
int nHSorcerer = 20; int nHWizard = 20;
//Elven Limitations: Set the Numbers to the Max classes for Elves.
int nEBarbarian = 20; int nEBard = 20; int nECleric = 20;
int nEDruid = 20; int nEFighter = 20; int nEMonk = 20;
int nEPaladin = 20; int nERanger = 20; int nERogue = 20;
int nESorcerer = 20; int nEWizard = 20;
//Dwarven Limitations: Set the Numbers to the Max classes for Dwarves.
int nDBarbarian = 20; int nDBard = 20; int nDCleric = 20;
int nDDruid = 20; int nDFighter = 20; int nDMonk = 20;
int nDPaladin = 20; int nDRanger = 20; int nDRogue = 20;
int nDSorcerer = 20; int nDWizard = 20;
//Halfling Limitations: Set the Numbers to the Max classes for Halflings.
int nHLBarbarian = 20; int nHLBard = 20; int nHLCleric = 20;
int nHLDruid = 20; int nHLFighter = 20; int nHLMonk = 20;
int nHLPaladin = 20; int nHLRanger = 20; int nHLRogue = 20;
int nHLSorcerer = 20; int nHLWizard = 20;
//Gnome Limitations: Set the Numbers to the Max classes for Gnomes.
int nGBarbarian = 20; int nGBard = 20; int nGCleric = 20;
int nGDruid = 20; int nGFighter = 20; int nGMonk = 20;
int nGPaladin = 20; int nGRanger = 20; int nGRogue = 20;
int nGSorcerer = 20; int nGWizard = 20;
//HalfElven Limitations: Set the Numbers to the Max classes for HalfElves.
int nHEBarbarian = 20; int nHEBard = 20; int nHECleric = 20;
int nHEDruid = 20; int nHEFighter = 20; int nHEMonk = 20;
int nHEPaladin = 20; int nHERanger = 20; int nHERogue = 20;
int nHESorcerer = 20; int nHEWizard = 20;
//HalfOrc Limitations: Set the Numbers to the Max classes for HalfOrcs.
int nHOBarbarian = 20; int nHOBard = 20; int nHOCleric = 20;
int nHODruid = 20; int nHOFighter = 20; int nHOMonk = 20;
int nHOPaladin = 20; int nHORanger = 20; int nHORogue = 20;
int nHOSorcerer = 20; int nHOWizard = 20;
//SubRace Limitations: Set the Numbers to the Max classes for SubRaces.
int nSBarbarian = 20; int nSBard = 20; int nSCleric = 20;
int nSDruid = 20; int nSFighter = 20; int nSMonk = 20;
int nSPaladin = 20; int nSRanger = 20; int nSRogue = 20;
int nSSorcerer = 20; int nSWizard = 20;
//Good Aligned Limitations: Set the Numbers to the Max classes for the Good.
int nGOBarbarian = 20; int nGOBard = 20; int nGOCleric = 20;
int nGODruid = 20; int nGOFighter = 20; int nGOMonk = 20;
int nGOPaladin = 20; int nGORanger = 20; int nGORogue = 20;
int nGOSorcerer = 20; int nGOWizard = 20;
//Neutral Aligned Limitations: Set the Numbers to the Max classes for the Neutral.
int nNBarbarian = 20; int nNBard = 20; int nNCleric = 20;
int nNDruid = 20; int nNFighter = 20; int nNMonk = 20;
int nNPaladin = 20; int nNRanger = 20; int nNRogue = 20;
int nNSorcerer = 20; int nNWizard = 20;
//Evil Aligned Limitations: Set the Numbers to the Max classes for the Evil.
int nEVBarbarian = 20; int nEVBard = 20; int nEVCleric = 20;
int nEVDruid = 20; int nEVFighter = 20; int nEVMonk = 20;
int nEVPaladin = 20; int nEVRanger = 20; int nEVRogue = 20;
int nEVSorcerer = 20; int nEVWizard = 20;
//Chaotic Aligned Limitations: Set the Numbers to the Max classes for the Evil.
int nCBarbarian = 20; int nCBard = 20; int nCCleric = 20;
int nCDruid = 20; int nCFighter = 20; int nCMonk = 20;
int nCPaladin = 20; int nCRanger = 20; int nCRogue = 20;
int nCSorcerer = 20; int nCWizard = 20;
//Lawful Aligned Limitations: Set the Numbers to the Max classes for the Evil.
int nLBarbarian = 20; int nLBard = 20; int nLCleric = 20;
int nLDruid = 20; int nLFighter = 20; int nLMonk = 20;
int nLPaladin = 20; int nLRanger = 20; int nLRogue = 20;
int nLSorcerer = 20; int nLWizard = 20;
//Female Limitations: Set the Numbers to the Max classes for females.
int nFBarbarian = 20; int nFBard = 20; int nFCleric = 20;
int nFDruid = 20; int nFFighter = 20; int nFMonk = 20;
int nFPaladin = 20; int nFRanger = 20; int nFRogue = 20;
int nFSorcerer = 20; int nFWizard = 20;
//Male Limitations: Set the Numbers to the Max classes for the males.
int nMBarbarian = 20; int nMBard = 20; int nMCleric = 20;
int nMDruid = 20; int nMFighter = 20; int nMMonk = 20;
int nMPaladin = 20; int nMRanger = 20; int nMRogue = 20;
int nMSorcerer = 20; int nMWizard = 20;
////////////////////END LIMITATIONS/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
string sRace; string sclass;
void RedoLevel(object oPC)
{
int nLevel = GetHitDice(oPC);
int nXP = GetXP(oPC);
int nAlpha = nXP;
if (nXP < 200)
{
SetXP(oPC, 1);
}
while (GetHitDice(oPC) == nLevel)
{
nAlpha -= 200;
SetXP(oPC, nAlpha);
}
FloatingTextStringOnCreature(sRace + " cannot advance any further in that class, please relevel.", oPC, TRUE);
DelayCommand(3.0f, SetXP(oPC ,nXP));
}
////////////////////Start Main Code/////////////////////////////////////////////
void main()
{
object oPC = GetPCLevellingUp();
int nRace = GetRacialType(oPC);
int nAlignGE = GetAlignmentGoodEvil(oPC);
int nAlignLNC = GetAlignmentLawChaos(oPC);
//Human
if (nRace == RACIAL_TYPE_HUMAN)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nHBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nHBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nHCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nHDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nHFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nHMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nHPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nHRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nHRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nHSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nHWizard )
{
sRace = "Humans";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_ELF)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nEBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nEBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nECleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nEDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nEFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nEMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nEPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nERanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nERogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nESorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nEWizard )
{
sRace = "Elves";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_DWARF)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nDBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nDBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nDCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nDDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nDFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nDMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nDPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nDRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nDRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nDSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nDWizard )
{
sRace = "Dwarves";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_HALFLING)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nHLBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nHLBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nHLCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nHLDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nHLFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nHLMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nHLPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nHLRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nHLRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nHLSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nHLWizard )
{
sRace = "Halflings";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_GNOME)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nGBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nGBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nGCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nGDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nGFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nGMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nGPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nGRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nGRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nGSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nGWizard )
{
sRace = "Gnomes";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_HALFELF)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nHEBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nHEBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nHECleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nHEDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nHEFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nHEMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nHEPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nHERanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nHERogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nESorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nHEWizard )
{
sRace = "Half-Elves";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_HALFORC)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nHOBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nHOBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nHOCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nHODruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nHOFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nHOMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nHOPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nHORanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nHORogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nHOSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nHOWizard )
{
sRace = "Half-Orcs";
RedoLevel(oPC);
}
}
if (nRace == RACIAL_TYPE_INVALID)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nSBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nSBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nSCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nSDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nSFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nSMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nSPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nSRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nSRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nSSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nSWizard )
{
sRace = "Subraces";
RedoLevel(oPC);
}
}
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_GOOD)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nGOBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nGOBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nGOCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nGODruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nGOFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nGOMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nGOPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nGORanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nGORogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nGOSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nGOWizard )
{
sRace = "Good aligned characters";
RedoLevel(oPC);
}
}
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_NEUTRAL)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nNBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nNBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nNCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nNDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nNFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nNMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nNPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nNRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nNRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nNSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nNWizard )
{
sRace = "Neutral aligned characters";
RedoLevel(oPC);
}
}
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nEVBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nEVBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nEVCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nEVDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nEVFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nEVMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nEVPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nEVRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nEVRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nEVSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nEVWizard )
{
sRace = "Evil aligned characters";
RedoLevel(oPC);
}
}
if (GetAlignmentLawChaos(oPC) == ALIGNMENT_CHAOTIC)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nCBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nCBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nCCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nCDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nCFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nCMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nCPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nCRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nCRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nCSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nCWizard )
{
sRace = "Chaotic aligned characters";
RedoLevel(oPC);
}
}
if (GetAlignmentLawChaos(oPC) == ALIGNMENT_LAWFUL)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nLBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nLBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nLCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nLDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nLFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nLMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nLPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nLRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nLRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nLSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nLWizard )
{
sRace = "Chaotic aligned characters";
RedoLevel(oPC);
}
}
if (GetGender(oPC) == GENDER_FEMALE)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nFBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nFBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nFCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nFDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nFFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nFMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nFPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nFRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nFRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nFSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nFWizard )
{
sRace = "Female characters";
RedoLevel(oPC);
}
}
if (GetGender(oPC) == GENDER_MALE)
{
if (GetLevelByclass(class_TYPE_BARBARIAN, oPC) > nMBarbarian ||
GetLevelByclass(class_TYPE_BARD, oPC) > nMBard ||
GetLevelByclass(class_TYPE_CLERIC, oPC) > nMCleric ||
GetLevelByclass(class_TYPE_DRUID, oPC) > nMDruid ||
GetLevelByclass(class_TYPE_FIGHTER, oPC) > nMFighter ||
GetLevelByclass(class_TYPE_MONK, oPC) > nMMonk ||
GetLevelByclass(class_TYPE_PALADIN, oPC) > nMPaladin ||
GetLevelByclass(class_TYPE_RANGER, oPC) > nMRanger ||
GetLevelByclass(class_TYPE_ROGUE, oPC) > nMRogue ||
GetLevelByclass(class_TYPE_SORCERER, oPC) > nMSorcerer ||
GetLevelByclass(class_TYPE_WIZARD, oPC) > nMWizard )
{
sRace = "Male characters";
RedoLevel(oPC);
}
}
}[/i][b]
Yet hopefully more elegant, specific and up to lvl 40.
Oh and including presteige classes.