2025/08/15 Updates

Updated for PRC8 updates.
This commit is contained in:
Jaysyn904
2025-08-15 14:47:26 -04:00
parent 039739c844
commit 7cabddf4b3
228 changed files with 938 additions and 1163 deletions

View File

@@ -23,30 +23,6 @@ void ReallyEquipItemInSlot(object oNPC, object oItem, int nSlot)
}
}
//:: Immunity to all gaze attacks
effect EffectGazeImmune()
{
effect eBlank;
effect eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_CHARM);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_CHARM);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_CONFUSION);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DAZE);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DEATH);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DESTROY_CHAOS);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DESTROY_EVIL);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DESTROY_GOOD);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DESTROY_LAW);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DOMINATE);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_DOOM);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_FEAR);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_PARALYSIS);
eReturn = EffectSpellImmunity(SPELLABILITY_GAZE_STUNNED);
eReturn = TagEffect(eReturn, "PRCGazeImmune");
return eReturn;
}
// Get the size of a JSON array
int GetJsonArraySize(json jArray)
{
@@ -71,104 +47,4 @@ int CheckForWeapon(object oCreature)
return FALSE;
}
}
//:: Directly modifies jCreature's Challenge Rating.
//:: This is useful for most XP calculations.
//::
json json_UpdateCR(json jCreature, int nBaseCR, int nCRMod)
{
int nNewCR;
//:: Add CRMod to current CR
nNewCR = nBaseCR + nCRMod;
//:: Modify Challenge Rating
jCreature = GffReplaceFloat(jCreature, "ChallengeRating", IntToFloat(nNewCR));
return jCreature;
}
//:: Directly modifies oCreature's ability scores.
//::
json json_UpdateStats(json jCreature, object oBaseCreature, int iModStr = 0, int iModDex = 0, int iModCon = 0, int iModInt = 0, int iModWis = 0, int iModCha = 0)
{
//:: Retrieve and modify ability scores
int iCurrentStr = GetAbilityScore(oBaseCreature, ABILITY_STRENGTH);
int iCurrentDex = GetAbilityScore(oBaseCreature, ABILITY_DEXTERITY);
int iCurrentCon = GetAbilityScore(oBaseCreature, ABILITY_CONSTITUTION);
int iCurrentInt = GetAbilityScore(oBaseCreature, ABILITY_INTELLIGENCE);
int iCurrentWis = GetAbilityScore(oBaseCreature, ABILITY_WISDOM);
int iCurrentCha = GetAbilityScore(oBaseCreature, ABILITY_CHARISMA);
jCreature = GffReplaceByte(jCreature, "Str", iCurrentStr + iModStr);
jCreature = GffReplaceByte(jCreature, "Dex", iCurrentDex + iModDex);
jCreature = GffReplaceByte(jCreature, "Con", iCurrentCon + iModCon);
jCreature = GffReplaceByte(jCreature, "Int", iCurrentInt + iModInt);
jCreature = GffReplaceByte(jCreature, "Wis", iCurrentWis + iModWis);
jCreature = GffReplaceByte(jCreature, "Cha", iCurrentCha + iModCha);
return jCreature;
}
//:: Directly modifies oCreature's Base Natural AC if iNewAC is higher.
//::
json json_UpdateBaseAC(json jCreature, int iNewAC)
{
//json jBaseAC = GffGetByte(jCreature, "Creature/value/NaturalAC/value");
json jBaseAC = GffGetByte(jCreature, "NaturalAC");
if (jBaseAC == JsonNull())
{
return JsonNull();
}
else if (JsonGetInt(jBaseAC) > iNewAC)
{
return jCreature;
}
else
{
jCreature = GffReplaceByte(jCreature, "NaturalAC", iNewAC);
return jCreature;
}
}
//:: Function to calculate the maximum possible hitpoints for oCreature
int GetMaxPossibleHP(object oCreature)
{
int nMaxHP = 0; // Stores the total maximum hitpoints
int i = 1; // Initialize position for class index
int nConb = GetAbilityModifier(ABILITY_CONSTITUTION, oCreature);
// Loop through each class position the creature may have, checking each class in turn
while (TRUE)
{
// Get the class ID at position i
int nClassID = GetClassByPosition(i, oCreature);
// If class is invalid (no more classes to check), break out of loop
if (nClassID == CLASS_TYPE_INVALID)
break;
// Get the number of levels in this class
int nClassLevels = GetLevelByClass(nClassID, oCreature);
// Get the row index of the class in classes.2da by using class ID as the row index
int nHitDie = StringToInt(Get2DAString("classes", "HitDie", nClassID));
// Add maximum HP for this class (Hit Die * number of levels in this class)
nMaxHP += nClassLevels * nHitDie;
// Move to the next class position
i++;
}
nMaxHP += nConb * GetHitDice(oCreature);
return nMaxHP;
}
//:: void main(){}