2025/11/20 Update
Updated epic swashbucker tlk. Added notes on Martial Study. Updated Shadow Servant to scale with Shadow Master level, per PnP. Made Disciple of Baalzebul's CHA boost intrinsic. Swarm of Arrows is an Eldritch Knight epic bonus feat. Epic eldritch theurge is 11th level, not 21st level. Updated Shadowdancer weapon proficiencies. WP: Scythe was a usable feat for Warblade. Gaseous Form added to iprp_spells. Set Favoured Soul's Regen X Wounds spells to the correct spell level. Updated Twinfiend to not suck. Tweaked GetMaxPossibleHP for Undead & Constructs. Updated PRCIsFlying() for newer CEP2 wings. More fixes and updated for NUI levelup menu. (@Rakiov) Added support for de-leveling AMS classes (@Rakiov) Zakya Rakshasa have a claw & bite attack. Added check to end grapples after target death. Removed debug message in GetHighestSpellAvailableByDescriptor() Monsters won't summon uncontrolled undead. Added Signal Event to Luminous Armor. Corrected Signal Event on Shield of Faith.
This commit is contained in:
@@ -37,6 +37,8 @@
|
||||
/* Function prototypes */
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
void CheckIfDeleveled(object oPC);
|
||||
void UpdateLastKnownLevels(object oPC);
|
||||
void CheckSpellbooks(object oPC);
|
||||
void CheckPsionics(object oPC);
|
||||
void CheckInvocations(object oPC);
|
||||
@@ -71,9 +73,72 @@ void main()
|
||||
eTest = GetNextEffect(oPC);
|
||||
}
|
||||
|
||||
CheckIfDeleveled(oPC);
|
||||
|
||||
DelayCommand(0.0f, CheckSpellbooks(oPC));
|
||||
}
|
||||
|
||||
void CheckIfDeleveled(object oPC)
|
||||
{
|
||||
int lastKnownLevel = GetPersistantLocalInt(oPC, "PCLastKnownLevel");
|
||||
int currentLevel = GetHitDice(oPC);
|
||||
if (lastKnownLevel > 0 && currentLevel < lastKnownLevel)
|
||||
{
|
||||
if (DEBUG) DoDebug("The player has de-leveled, checking spells!");
|
||||
json changedClassList = JsonArray();
|
||||
int i;
|
||||
for (i = 1; i <= 8; i++)
|
||||
{
|
||||
int storedClass = GetPersistantLocalInt(oPC, "PCLastKnownClass" + IntToString(i));
|
||||
if (storedClass && storedClass != CLASS_TYPE_INVALID)
|
||||
{
|
||||
int storedLevel = GetPersistantLocalInt(oPC, "PCLastKnownClass" + IntToString(i) + "Levels");
|
||||
int nClass = GetClassByPosition(i, oPC);
|
||||
int currentClassLevels = (GetIsArcaneClass(nClass, oPC) || GetIsDivineClass(nClass, oPC))
|
||||
? GetPrCAdjustedClassLevel(nClass, oPC) : GetLevelByClass(nClass, oPC);
|
||||
if (nClass == CLASS_TYPE_INVALID
|
||||
|| (nClass == storedClass && storedLevel != currentClassLevels))
|
||||
{
|
||||
DoDebug("Class " + IntToString(storedClass) + " lost levels!");
|
||||
changedClassList = JsonArrayInsert(changedClassList, JsonInt(storedClass));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (i = lastKnownLevel; i > currentLevel; i--)
|
||||
{
|
||||
int totalChangedClasses = JsonGetLength(changedClassList);
|
||||
|
||||
int j;
|
||||
for (j = 0; j < totalChangedClasses; j++)
|
||||
{
|
||||
int nClass = JsonGetInt(JsonArrayGet(changedClassList, j));
|
||||
DelayCommand(0.0f, CallSpellUnlevelScript(oPC, nClass, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
DoDebug("Setting last known player level to " + IntToString(currentLevel));
|
||||
UpdateLastKnownLevels(oPC);
|
||||
}
|
||||
|
||||
void UpdateLastKnownLevels(object oPC)
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i <= 8; i++)
|
||||
{
|
||||
int nClass = GetClassByPosition(i, oPC);
|
||||
int classLevel = (GetIsArcaneClass(nClass, oPC) || GetIsDivineClass(nClass, oPC))
|
||||
? GetPrCAdjustedClassLevel(nClass, oPC) : GetLevelByClass(nClass, oPC);
|
||||
|
||||
SetPersistantLocalInt(oPC, "PCLastKnownClass" + IntToString(i), nClass);
|
||||
SetPersistantLocalInt(oPC, "PCLastKnownClass" + IntToString(i) + "Levels", classLevel);
|
||||
}
|
||||
|
||||
int currentLevel = GetHitDice(oPC);
|
||||
SetPersistantLocalInt(oPC, "PCLastKnownLevel", currentLevel);
|
||||
}
|
||||
|
||||
// Handle new spellbooks
|
||||
|
||||
void CheckSpellbooks(object oPC)
|
||||
@@ -125,8 +190,8 @@ void CheckSpellbooks(object oPC)
|
||||
CheckMissingSpells(oPC, CLASS_TYPE_ARCHIVIST, 0, 9);
|
||||
CheckMissingSpells(oPC, CLASS_TYPE_BEGUILER, 0, 9);
|
||||
CheckMissingSpells(oPC, CLASS_TYPE_HARPER, 1, 3);
|
||||
CheckMissingSpells(oPC, CLASS_TYPE_CELEBRANT_SHARESS, 1, 4);
|
||||
//CheckMissingSpells(oPC, CLASS_TYPE_ASSASSIN, 1, 4);
|
||||
CheckMissingSpells(oPC, CLASS_TYPE_CELEBRANT_SHARESS, 1, 4);
|
||||
//CheckMissingSpells(oPC, CLASS_TYPE_ASSASSIN, 1, 4);
|
||||
|
||||
// Check psionics
|
||||
DelayCommand(0.0f, CheckPsionics(oPC));
|
||||
|
||||
Reference in New Issue
Block a user