Files
HeroesStone_PRC8/_removed/far_alcs.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

350 lines
14 KiB
Plaintext

#include "tk_hips_inc"
// ***Farchilde's Advanced Level Control System***
//************************************************************************************
//*****************written by Farchilde (email farchilde@yahoo.ca)*********************
//************************************************************************************
// introduction:
//-----
//this one script presents you with many options for controlling how players level
//up in your PW. With this you can prevent powergaming if desired by restricting
//the maximums of the four skills that lead to major imbalances by class,
//disallowing, or allowing both devastating critical and disarm, and the ability to
//simply disallow certain prestige classes based on level, or entirely, or you
//can include a combination of all of these if you wish for your world.
//-----
//***A special note*** this system automatically unequips any item equipped on the
//player which has any sort of skill bonus as a property. -do not- change this, as
//changing it would force low level players with skill bonus items to relevel everytime
//as they would forget to unequip the item in alot of cases. it does not remove items with
//ability bonuses though, as they way I see it, if you have +10 to attributes items in
//your module, you probably do not care about powergaming anyway.
//-----
// instructions:
//-----
//to install import the erf, and add the script "far_alcs" to your module's On Player
//Level Up event in module properties, by going edit / module properties then to the events
//tab. Set the setting as per the guide below, then go to the build tab and rebuild your
//module (be sure to check compile all scripts), then save your module.
//-----
//checking for skill stacking:
//-----
//to check for skill stacking for the purposes of powergaming I included the four
//skills that powergamers mainly focus on, discipline, spellcraft, tumble, and
//use magic device. I also included pick pocket as a bonus. This system, customizable
//by you, prevents the common practice of a player taking one level or rogue simply for
//use magic device or tumble, or two levels of bard for discipline and spellcraft, etc.
//It works by checking these five skills against the player's level in the classes specific
//to that skill each time they level up. You can set both the maximum level checked and the
//check DC as you will see below. You can also choose which of these four skills are checked.
//-----
//the player is forced to relevel on a -successful- skill check, remember that. it may
//seem odd but just think that a level one bard say should not pass a DC 40 use magic
//device check. if they fail the can relevel normally.
//-----
//this is the total percentage of the level a player has in the classes that have the
//skill being checked as a class skill. So for example a 20th level rogue and 20th level
//cleric would not be checked for use magic device, but a 10th level rogue and 20th level
//cleric and 10th level fighter would. set the percentage as high or as low as you wish.
//-----
const float pPc = 0.0;
//-----
//max DC of each skill check, to set higher or lower, simply change the number on
//the right hand side to the desired DC.
//-----
const int cUd = 0; //use magic device
const int cDc = 0; //discipline
const int cTm = 0; //tumble
const int cSp = 0; //spellcraft
const int cPp = 0; //pick pocket
//-----
//to disable each skill check entirely, simply set the number on the right hand side
//to zero.
//-----
const int dUd = 0; //use magic device
const int dDc = 0; //discipline
const int dTm = 0; //tumble
const int dSp = 0; //spellcraft
const int dPp = 0; //pick pocket
//-----
//to allow devastating critical, simply switch the number on the right hand side to
//zero.
//-----
const int dDv = 0;
//-----
//to allow disarm, simply switch the number on the right hand side to zero.
//-----
const int dDs = 0;
//-----
//to allow all presitge classes set the number on the right hand side to zero. to allow
//prestige classes of your choice, you -must keep this switch at 1 and set the switches
//below as instructed.
//-----
const int dPr = 0;
//-----
//prestige class control switches below, to set the maximum level for each
//class simply change the number on the right hand side of each line (Note
//if you want all prestige classes available, ses the switch above, for harper
//scout, set to 6). ***important, for demo purposes all prestige classes are disabled,
//stay within the range of one to 40 -do not- switch to zero***
//-----
const int nAr = 20; //arcane archer
const int nAs = 20; //assassin
const int nBg = 1; //blackguard
const int nHs = 6; //harper scout
const int nCt = 20; //champion of torm
const int nWm = 20; //weapon master
const int nDd = 20; //dwarven defender
const int nSd = 20; //shadowdancer
const int nSh = 20; //shifter
const int nPm = 20; //pale master
const int nRd = 20; //red dragon disciple
//-----
//************************************************************************************
//*********************do not alter -any- of these lines below************************
//************************************************************************************
float UseMagicDeviceClassCheck(object oPc){
int iTl=GetHitDice(oPc);
if(iTl==0)
return 0.0;
else{
int iUd=GetLevelByClass(CLASS_TYPE_BARD,oPc)+
GetLevelByClass(CLASS_TYPE_ROGUE,oPc)+
GetLevelByClass(CLASS_TYPE_ASSASSIN,oPc);
float fUd=IntToFloat(iUd)/IntToFloat(iTl);
return fUd;}}
float DisciplineClassCheck(object oPc){
int iTl=GetHitDice(oPc);
if(iTl==0)
return 0.0;
else{
int iDc=GetLevelByClass(CLASS_TYPE_BARBARIAN,oPc)+
GetLevelByClass(CLASS_TYPE_BARD,oPc)+
GetLevelByClass(CLASS_TYPE_FIGHTER,oPc)+
GetLevelByClass(CLASS_TYPE_MONK,oPc)+
GetLevelByClass(CLASS_TYPE_PALADIN,oPc)+
GetLevelByClass(CLASS_TYPE_RANGER,oPc)+
GetLevelByClass(CLASS_TYPE_BLACKGUARD,oPc)+
GetLevelByClass(CLASS_TYPE_HARPER,oPc)+
GetLevelByClass(CLASS_TYPE_DWARVENDEFENDER,oPc)+
GetLevelByClass(CLASS_TYPE_WEAPON_MASTER,oPc)+GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE,oPc)+
GetLevelByClass(CLASS_TYPE_DIVINECHAMPION,oPc);
float fDc=IntToFloat(iDc)/IntToFloat(iTl);
return fDc;}}
float TumbleClassCheck(object oPc){
int iTl=GetHitDice(oPc);
if(iTl==0)
return 0.0;
else{
int iTm=GetLevelByClass(CLASS_TYPE_BARD,oPc)+
GetLevelByClass(CLASS_TYPE_HARPER,oPc)+
GetLevelByClass(CLASS_TYPE_MONK,oPc)+
GetLevelByClass(CLASS_TYPE_ROGUE,oPc)+
GetLevelByClass(CLASS_TYPE_SHADOWDANCER,oPc);
float fTm=IntToFloat(iTm)/IntToFloat(iTl);
return fTm;}}
float SpellCraftClassCheck(object oPc){
int iTl=GetHitDice(oPc);if(iTl==0)
return 0.0;
else{
int iSp=GetLevelByClass(CLASS_TYPE_BARD,oPc)+
GetLevelByClass(CLASS_TYPE_CLERIC,oPc)+
GetLevelByClass(CLASS_TYPE_DRUID,oPc)+
GetLevelByClass(CLASS_TYPE_SORCERER,oPc)+
GetLevelByClass(CLASS_TYPE_WIZARD,oPc)+
GetLevelByClass(CLASS_TYPE_PALEMASTER,oPc)+
GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE,oPc);
float fSp=IntToFloat(iSp)/IntToFloat(iTl);
return fSp;}}
float PickPocketClassCheck(object oPc){
int iTl=GetHitDice(oPc);if(iTl==0)
return 0.0;
else{
int iPp=GetLevelByClass(CLASS_TYPE_BARD,oPc)+
GetLevelByClass(CLASS_TYPE_ROGUE,oPc)+
GetLevelByClass(CLASS_TYPE_ASSASSIN,oPc)+
GetLevelByClass(CLASS_TYPE_HARPER,oPc)+
GetLevelByClass(CLASS_TYPE_SHADOWDANCER,oPc);
float fPp=IntToFloat(iPp)/IntToFloat(iTl);
return fPp;}}
void main()
{
//TK_HiPS_OnFeatChange(GetPCLevellingUp());
object oPc=GetPCLevellingUp();
SetLocalInt(oPc,"mDv",1);
SetLocalInt(oPc,"mDs",1);
SetLocalInt(oPc,"mPr",1);
SetLocalInt(oPc,"mUd",1);
SetLocalInt(oPc,"mDc",1);
SetLocalInt(oPc,"mTm",1);
SetLocalInt(oPc,"mSp",1);
object oIm;
int nHd=GetHitDice(oPc)-1;
int nXp=GetXP(oPc);
int nSt;
for (nSt=0;nSt<NUM_INVENTORY_SLOTS;nSt++){
oIm=GetItemInSlot(nSt,oPc);
if(GetItemHasItemProperty(oIm,ITEM_PROPERTY_SKILL_BONUS))
AssignCommand(oPc,ActionUnequipItem(oIm));}
if((GetLocalInt(oPc,"mUd")==dUd)&&
GetHasSkill(SKILL_USE_MAGIC_DEVICE,oPc)&&
GetIsSkillSuccessful(oPc,SKILL_USE_MAGIC_DEVICE,cUd)&&
(UseMagicDeviceClassCheck(oPc)<=pPc)){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("The Use Magic Device skill is restricted from stacking in points, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mDc")==dDc)&&
GetHasSkill(SKILL_DISCIPLINE,oPc)&&
GetIsSkillSuccessful(oPc,SKILL_DISCIPLINE,cDc)&&
(DisciplineClassCheck(oPc)<=pPc)){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("The Discipline skill is restricted from stacking in points, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mTm")==dTm)&&
GetHasSkill(SKILL_TUMBLE,oPc)&&
GetIsSkillSuccessful(oPc,SKILL_TUMBLE,cTm)&&
(TumbleClassCheck(oPc)<=pPc)){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("The Tumble skill is restricted from stacking in points, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mSp")==dSp)&&
GetHasSkill(SKILL_SPELLCRAFT,oPc)&&
GetIsSkillSuccessful(oPc,SKILL_SPELLCRAFT,cSp)&&
(SpellCraftClassCheck(oPc)<=pPc)){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("The Spellcraft skill is restricted from stacking in points, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mPp")==dPp)&&
GetHasSkill(SKILL_PICK_POCKET,oPc)&&
GetIsSkillSuccessful(oPc,SKILL_PICK_POCKET,cPp)&&
(PickPocketClassCheck(oPc)<=pPc)){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("The Pick Pocket skill is restricted from stacking in points, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BASTARDSWORD,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_BATTLEAXE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_CLUB,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DAGGER,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DIREMACE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DOUBLEAXE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_DWAXE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_GREATAXE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_GREATSWORD,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HALBERD,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HANDAXE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYCROSSBOW,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_HEAVYFLAIL,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KAMA,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KATANA,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_KUKRI,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTCROSSBOW,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTFLAIL,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTHAMMER,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LIGHTMACE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LONGBOW,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_LONGSWORD,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_MORNINGSTAR,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_QUARTERSTAFF,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_RAPIER,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SCIMITAR,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SCYTHE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTBOW,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSPEAR,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHORTSWORD,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SHURIKEN,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SICKLE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_SLING,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_THROWINGAXE,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_TWOBLADEDSWORD,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_UNARMED,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WARHAMMER,oPc)||
GetLocalInt(oPc,"mDv")==dDv&&
GetHasFeat(FEAT_EPIC_DEVASTATING_CRITICAL_WHIP,oPc))){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("Devastating Critical is not allowed, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mDs")==dDs&&
GetHasFeat(FEAT_DISARM,oPc))){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("Disarm is not allowed, please relevel.",oPc);}
else if((GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER,oPc)==nAr||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_ASSASSIN,oPc)==nAs||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_BLACKGUARD,oPc)==nBg||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_HARPER,oPc)==nHs||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_SHADOWDANCER,oPc)==nSd||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_DIVINECHAMPION,oPc)==nCt||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_DWARVENDEFENDER,oPc)==nDd||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_PALEMASTER,oPc)==nPm||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE,oPc)==nRd||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_SHIFTER,oPc)==nSh||
GetLocalInt(oPc,"mPr")==dPr&&
GetLevelByClass(CLASS_TYPE_WEAPON_MASTER,oPc)==nWm)){
SetXP(oPc,((nHd*(nHd-1))/2)*1000);
DelayCommand(2.0,SetXP(oPc,nXp));
FloatingTextStringOnCreature("That prestige class is restricted, please relevel.",oPc);}
else FloatingTextStringOnCreature("",oPc);}
//************************************************************************************
//********************************end of script***************************************
//************************************************************************************