Class restrictions script

The Script
//////////////////////////////////////////////////////////////////////////////// //////////////////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); } } }