2025/07/31 Update

Reverted Luminous Armor.
Updated NUI spellcast menu (@Alhooness).
Fixed Inlindl School.
Tweaked prc_2da_cache creature.
Fixed Celebrant of Sharess spellcasting.
Found a few more functions to remove Assassin from.
Added GetTotalShieldACBonus().
Made magic staves medium weapons again, so that small creatures can use them.
Added feat constants for Charge & Grapple.
Devil's Eye should be Extendable.
Setup talents for Combat maneuvers.
Updated PRC8 manual.
This commit is contained in:
Jaysyn904
2025-07-31 07:35:50 -04:00
parent 2181120567
commit 98e0b02799
41 changed files with 1953 additions and 1800 deletions

View File

@@ -242,7 +242,7 @@ void SetupLookupStage(object oMod, int n)
case 11: SetLkupStage(n, oMod, CLASS_TYPE_DRAGON_SHAMAN, "cls_inv_drgshm"); break;
case 12: SetLkupStage(n, oMod, CLASS_TYPE_WARLOCK, "cls_inv_warlok"); break;
case 13: SetLkupStage(n, oMod, CLASS_TYPE_ARCHIVIST, "cls_spell_archv"); break;
case 14: SetLkupStage(n, oMod, CLASS_TYPE_ASSASSIN, "cls_spell_asasin"); break;
//case 14: SetLkupStage(n, oMod, CLASS_TYPE_ASSASSIN, "cls_spell_asasin"); break;
case 15: SetLkupStage(n, oMod, CLASS_TYPE_BARD, "cls_spell_bard"); break;
case 16: SetLkupStage(n, oMod, CLASS_TYPE_BEGUILER, "cls_spell_beguil"); break;
case 17: SetLkupStage(n, oMod, CLASS_TYPE_DREAD_NECROMANCER, "cls_spell_dnecro"); break;
@@ -528,7 +528,7 @@ int SpellToSpellbookID(int nSpell)
int nOutSpellID = GetLocalInt(oWP, /*"PRC_GetRowFromSpellID_" + */IntToString(nSpell));
if(nOutSpellID == 0)
nOutSpellID = -1;
//if(DEBUG) DoDebug("SpellToSpellbookID(" + IntToString(nSpell) + ", " + sFile + ") = " + IntToString(nOutSpellID));
if(DEBUG) DoDebug("inc_lookup >> SpellToSpellbookID: (nSpell: " + IntToString(nSpell) + ") = nOutSpellID: " + IntToString(nOutSpellID));
return nOutSpellID;
}

View File

@@ -559,7 +559,7 @@ int bKnowsAllClassSpells(int nClass)
{
//case CLASS_TYPE_WIZARD:
case CLASS_TYPE_ARCHIVIST:
case CLASS_TYPE_ASSASSIN:
//case CLASS_TYPE_ASSASSIN:
case CLASS_TYPE_BARD:
case CLASS_TYPE_CELEBRANT_SHARESS:
case CLASS_TYPE_CULTIST_SHATTERED_PEAK:
@@ -850,7 +850,7 @@ void SetupSpells(object oPC, int nClass)
int nAbility = GetAbilityScoreForClass(nClass, oPC);
int nSpellbookType = GetSpellbookTypeForClass(nClass);
if(DEBUG) DoDebug("SetupSpells\n"
if(DEBUG) DoDebug("SetupSpells()\n"
+ "nClass = " + IntToString(nClass) + "\n"
+ "nSpellslotLevel = " + IntToString(nLevel) + "\n"
+ "nAbility = " + IntToString(nAbility) + "\n"
@@ -1178,7 +1178,7 @@ void CastSpontaneousSpell(int nClass, int bInstantSpell = FALSE)
else if(GetLocalInt(OBJECT_SELF, "PRC_metamagic_state") == 1)
SetLocalInt(OBJECT_SELF, "MetamagicFeatAdjust", 0);
}
if (DEBUG) DoDebug("CastSpontaneousSpell(): nSpellLevel is: "+IntToString(nSpellLevel)+".");
CheckSpontSlots(nClass, nSpellID, nSpellLevel);
if(GetLocalInt(OBJECT_SELF, "NSB_Cast"))
ActionDoCommand(CheckSpontSlots(nClass, nSpellID, nSpellLevel, TRUE));
@@ -1330,6 +1330,8 @@ void NewSpellbookSpell(int nClass, int nSpellbookType, int nMetamagic = METAMAGI
string sFile = GetFileForClass(nClass);
int nSpellLevel = StringToInt(Get2DACache(sFile, "Level", nSpellbookID));
if (DEBUG) DoDebug("inc_newspellbook >> NewSpellbookSpell(): nSpellbookType is: "+IntToString(nSpellbookType)+".");
// Make sure the caster has uses of this spell remaining
// 2009-9-20: Add metamagic feat abilities. -N-S
@@ -1371,13 +1373,14 @@ void NewSpellbookSpell(int nClass, int nSpellbookType, int nMetamagic = METAMAGI
else if(nSpellLevel > 9)//now test the spell level
{
nMetamagic = METAMAGIC_NONE;
ActionDoCommand(SendMessageToPC(oPC, "Modified spell level is to high! Casting spell without metamagic"));
ActionDoCommand(SendMessageToPC(oPC, "Modified spell level is too high! Casting spell without metamagic"));
nSpellLevel = nSpellSlotLevel;
}
else if(GetLocalInt(oPC, "PRC_metamagic_state") == 1)
SetLocalInt(oPC, "MetamagicFeatAdjust", 0);
}
if (DEBUG) DoDebug("inc_newspellbook >> NewSpellbookSpell(): nSpellLevel is: "+IntToString(nSpellLevel)+".");
CheckSpontSlots(nClass, nSpellID, nSpellLevel);
if(GetLocalInt(oPC, "NSB_Cast"))
ActionDoCommand(CheckSpontSlots(nClass, nSpellID, nSpellLevel, TRUE));
@@ -1460,7 +1463,7 @@ void CheckPrepSlots(int nClass, int nSpellID, int nSpellbookID, int bIsAction =
{
DeleteLocalInt(OBJECT_SELF, "NSB_Cast");
int nCount = persistant_array_get_int(OBJECT_SELF, "NewSpellbookMem_" + IntToString(nClass), nSpellbookID);
if(DEBUG) DoDebug("NewSpellbookSpell: NewSpellbookMem_" + IntToString(nClass) + "[" + IntToString(nSpellbookID) + "] = " + IntToString(nCount));
if(DEBUG) DoDebug("NewSpellbookSpell >> CheckPrepSlots: NewSpellbookMem_" + IntToString(nClass) + "[SpellbookID: " + IntToString(nSpellbookID) + "] = " + IntToString(nCount));
if(nCount < 1)
{
string sSpellName = GetStringByStrRef(StringToInt(Get2DACache("spells", "Name", nSpellID)));
@@ -1486,7 +1489,7 @@ void CheckSpontSlots(int nClass, int nSpellID, int nSpellSlotLevel, int bIsActio
{
DeleteLocalInt(OBJECT_SELF, "NSB_Cast");
int nCount = persistant_array_get_int(OBJECT_SELF, "NewSpellbookMem_" + IntToString(nClass), nSpellSlotLevel);
if(DEBUG) DoDebug("NewSpellbookSpell: NewSpellbookMem_" + IntToString(nClass) + "[" + IntToString(nSpellSlotLevel) + "] = " + IntToString(nCount));
if(DEBUG) DoDebug("NewSpellbookSpell >> CheckSpontSlots: NewSpellbookMem_" + IntToString(nClass) + "[SpellSlotLevel: " + IntToString(nSpellSlotLevel) + "] = " + IntToString(nCount));
if(nCount < 1)
{
// "You have no castings of spells of level " + IntToString(nSpellLevel) + " remaining"

View File

@@ -513,6 +513,8 @@ int PRCGetSpellSaveDC(int nSpellID = -1, int nSchool = -1, object oCaster = OBJE
if(nClass == CLASS_TYPE_BARD)
nDC += StringToInt(Get2DACache("Spells", "Bard", nSpellID));
else if(nClass == CLASS_TYPE_ASSASSIN)
nDC += StringToInt(Get2DACache("Spells", "Assassin", nSpellID));
else if(nClass == CLASS_TYPE_CLERIC || nClass == CLASS_TYPE_UR_PRIEST || nClass == CLASS_TYPE_OCULAR)
nDC += StringToInt(Get2DACache("Spells", "Cleric", nSpellID));
else if(nClass == CLASS_TYPE_DRUID)

View File

@@ -3933,6 +3933,8 @@ const int FEAT_OPPORTUNISTIC_PIETY_HEAL = 5358;
const int FEAT_OPPORTUNISTIC_PIETY_TURN = 5359;
// Combat Maneuver Feats
const int FEAT_CM_CHARGE = 2823;
const int FEAT_CM_GRAPPLE = 3414;
const int FEAT_CURLING_WAVE_STRIKE = 2809;
const int FEAT_SIDESTEP_CHARGE = 3505;
const int FEAT_POWERFUL_CHARGE = 3506;

View File

@@ -1148,8 +1148,8 @@ int GetArcanePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
if(GetHasFeat(FEAT_DIABOLIST_SPELLCASTING_ASSASSIN, oCaster))
nArcane += GetLevelByClass(CLASS_TYPE_DIABOLIST, oCaster);
if(GetHasFeat(FEAT_DHEART_SPELLCASTING_ASSASSIN, oCaster))
nArcane += GetLevelByClass(CLASS_TYPE_DRAGONHEART_MAGE, oCaster);
//if(GetHasFeat(FEAT_DHEART_SPELLCASTING_ASSASSIN, oCaster))
//nArcane += GetLevelByClass(CLASS_TYPE_DRAGONHEART_MAGE, oCaster);
if(GetHasFeat(FEAT_EKNIGHT_SPELLCASTING_ASSASSIN, oCaster))
nArcane += GetLevelByClass(CLASS_TYPE_ELDRITCH_KNIGHT, oCaster);

View File

@@ -605,7 +605,7 @@ int PRCGetHasSpell(int nRealSpellID, object oCreature = OBJECT_SELF)
if(nSpellbookType == SPELLBOOK_TYPE_PREPARED)
{
nCount = persistant_array_get_int(oCreature, "NewSpellbookMem_" + IntToString(nClass), j);
if(DEBUG) DoDebug("PRCGetHasSpell: NewSpellbookMem_" + IntToString(nClass) + "[" + IntToString(j) + "] = " + IntToString(nCount));
if(DEBUG) DoDebug("prc_inc_core >> PRCGetHasSpell: NewSpellbookMem_" + IntToString(nClass) + "[" + IntToString(j) + "] = " + IntToString(nCount));
if(nCount > 0)
{
nUses += nCount;
@@ -615,7 +615,7 @@ int PRCGetHasSpell(int nRealSpellID, object oCreature = OBJECT_SELF)
{
nSpellLevel = StringToInt(Get2DACache(sFile, "Level", j));
nCount = persistant_array_get_int(oCreature, "NewSpellbookMem_" + IntToString(nClass), nSpellLevel);
if(DEBUG) DoDebug("PRCGetHasSpell: NewSpellbookMem_" + IntToString(nClass) + "[" + IntToString(j) + "] = " + IntToString(nCount));
if(DEBUG) DoDebug("prc_inc_core >> PRCGetHasSpell: NewSpellbookMem_" + IntToString(nClass) + "[" + IntToString(j) + "] = " + IntToString(nCount));
if(nCount > 0)
{
nUses += nCount;

View File

@@ -795,7 +795,7 @@ int GetWeaponSize(object oWeapon)
case BASE_ITEM_GREATAXE:
case BASE_ITEM_HEAVYFLAIL:
case BASE_ITEM_QUARTERSTAFF:
case BASE_ITEM_MAGICSTAFF:
//case BASE_ITEM_MAGICSTAFF:
case BASE_ITEM_SCYTHE:
case BASE_ITEM_SHORTSPEAR:
case BASE_ITEM_ELVEN_COURTBLADE:
@@ -832,7 +832,7 @@ int PRCLargeWeaponCheck(int iBaseType, int nSize)
case BASE_ITEM_GREATAXE:
case BASE_ITEM_HEAVYFLAIL:
case BASE_ITEM_QUARTERSTAFF:
case BASE_ITEM_MAGICSTAFF:
//case BASE_ITEM_MAGICSTAFF:
case BASE_ITEM_SCYTHE:
case BASE_ITEM_SHORTSPEAR:
case BASE_ITEM_ELVEN_COURTBLADE:

View File

@@ -108,7 +108,7 @@ void SetupCharacterData(object oPC)
case CLASS_TYPE_ALIENIST: sScript = "prc_alienist"; break;
case CLASS_TYPE_ARCANE_DUELIST: sScript = "prc_arcduel"; break;
case CLASS_TYPE_ARCHIVIST: sScript = "prc_archivist"; iData |= 0x01; break;
case CLASS_TYPE_ASSASSIN: iData |= 0x03; break;
case CLASS_TYPE_ASSASSIN: break;
case CLASS_TYPE_BAELNORN: sScript = "prc_baelnorn"; break;
case CLASS_TYPE_BARD: iData |= 0x07; break;
case CLASS_TYPE_BATTLESMITH: sScript = "prc_battlesmith"; break;
@@ -121,7 +121,7 @@ void SetupCharacterData(object oPC)
case CLASS_TYPE_BLIGHTLORD: sScript = "prc_blightlord"; break;
case CLASS_TYPE_BLOODCLAW_MASTER: sScript = "tob_bloodclaw"; break;
case CLASS_TYPE_BONDED_SUMMONNER: sScript = "prc_bondedsumm"; break;
case CLASS_TYPE_CELEBRANT_SHARESS: iData |= 0x03; break;
case CLASS_TYPE_CELEBRANT_SHARESS: iData |= 0x07; break;
case CLASS_TYPE_CHILD_OF_NIGHT: sScript = "shd_childnight"; break;
case CLASS_TYPE_COC: sScript = "prc_coc"; break;
case CLASS_TYPE_COMBAT_MEDIC: sScript = "prc_cbtmed"; break;

View File

@@ -20,6 +20,9 @@
/* Function prototypes */
//////////////////////////////////////////////////
//:: Calculates total Shield AC bonuses from all sources
int GetTotalShieldACBonus(object oCreature);
//:: Handles psuedo-Foritifcation
void DoFortification(object oPC = OBJECT_SELF, int nFortification = 25);
@@ -2223,6 +2226,78 @@ int GetControlledCelestialTotalHD(object oPC = OBJECT_SELF)
return nTotalHD;
}
//:: Calculates total Shield AC bonuses from all sources
int GetTotalShieldACBonus(object oCreature)
{
int nShieldBonus = 0;
object oItem;
// Check left hand for shield
oItem = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oCreature);
if (GetIsObjectValid(oItem))
{
int nBaseItem = GetBaseItemType(oItem);
if (nBaseItem == BASE_ITEM_SMALLSHIELD ||
nBaseItem == BASE_ITEM_LARGESHIELD ||
nBaseItem == BASE_ITEM_TOWERSHIELD)
{
nShieldBonus += GetItemACValue(oItem);
if(DEBUG) DoDebug("prc_inc_spells >> GetTotalShieldACBonus: Found Shield AC, bonus = " + IntToString(nShieldBonus)+".");
}
}
// Check creature weapon slots for shield AC bonus
oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oCreature);
if (GetIsObjectValid(oItem))
nShieldBonus += GetItemACValue(oItem);
oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oCreature);
if (GetIsObjectValid(oItem))
nShieldBonus += GetItemACValue(oItem);
oItem = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oCreature);
if (GetIsObjectValid(oItem))
nShieldBonus += GetItemACValue(oItem);
// Add shield AC bonuses from magical effects
effect eEffect = GetFirstEffect(oCreature);
while (GetIsEffectValid(eEffect))
{
int nACType = GetEffectInteger(eEffect, 0);
int nACAmount = GetEffectInteger(eEffect, 1);
if(GetEffectType(eEffect) == EFFECT_TYPE_AC_INCREASE && nACType == AC_SHIELD_ENCHANTMENT_BONUS)
{
if(DEBUG) DoDebug("prc_inc_spells >> GetTotalShieldACBonus: Found Shield AC effect, bonus = " + IntToString(nACAmount)+".");
nShieldBonus += nACAmount;
}
eEffect = GetNextEffect(oCreature);
}
return nShieldBonus;
}
// Add shield AC bonuses from magical effects
/* effect eEffect = GetFirstEffect(oCreature);
while (GetIsEffectValid(eEffect))
{
if (GetEffectType(eEffect) == EFFECT_TYPE_AC_INCREASE &&
GetEffectInteger(eEffect, 1) == AC_SHIELD_ENCHANTMENT_BONUS)
{
int nMod = GetEffectInteger(eEffect, 0);
int nType = GetEffectInteger(eEffect, 1);
nShieldBonus += GetEffectInteger(eEffect, 0);
string s = "Found AC effect: bonus = " + IntToString(nMod) + ", type = " + IntToString(nType);
SendMessageToPC(GetFirstPC(), s);
}
eEffect = GetNextEffect(oCreature);
}
return nShieldBonus;
}*/
//
//:: Handles psuedo-Foritifcation
void DoFortification(object oPC = OBJECT_SELF, int nFortification = 25)
{
@@ -2275,7 +2350,7 @@ void DoFortification(object oPC = OBJECT_SELF, int nFortification = 25)
IPSafeAddItemProperty(oHide, ItemPropertyImmunityMisc(IP_CONST_IMMUNITYMISC_BACKSTAB));
}
}
//
// wrapper for DecrementRemainingSpellUses, works for newspellbook 'fake' spells too
// should also find and decrement metamagics for newspellbooks

View File

@@ -782,7 +782,7 @@ int IsClassAllowedToUseLevelUpNUI(int nClass)
return TRUE;
if (nClass == CLASS_TYPE_ARCHIVIST)
return TRUE;
return TRUE;
return FALSE;
}

View File

@@ -387,8 +387,7 @@ int IsClassAllowedToUseNUISpellbook(object oPlayer, int nClass)
return TRUE;
// Arcane Spont
if (nClass == CLASS_TYPE_ASSASSIN
|| nClass == CLASS_TYPE_BEGUILER
if (nClass == CLASS_TYPE_BEGUILER
|| nClass == CLASS_TYPE_CELEBRANT_SHARESS
|| nClass == CLASS_TYPE_DREAD_NECROMANCER
|| nClass == CLASS_TYPE_DUSKBLADE
@@ -506,8 +505,7 @@ int CanClassUseMetamagicFeats(int nClass)
// I don't want to spend the time looping through each class's
// feat 2da so this is the list of all classes that are allowed to use the
// Spellbook NUI and can use Metamagic
return (nClass == CLASS_TYPE_ASSASSIN
|| nClass == CLASS_TYPE_BARD
return (nClass == CLASS_TYPE_BARD
|| nClass == CLASS_TYPE_SORCERER
|| nClass == CLASS_TYPE_BEGUILER
|| nClass == CLASS_TYPE_DREAD_NECROMANCER
@@ -527,7 +525,6 @@ int CanClassUseSuddenMetamagicFeats(int nClass)
// Spellbook NUI and can use Sudden Metamagic
return (nClass == CLASS_TYPE_SHADOWLORD
|| nClass == CLASS_TYPE_ARCHIVIST
|| nClass == CLASS_TYPE_ASSASSIN
|| nClass == CLASS_TYPE_BARD
|| nClass == CLASS_TYPE_BEGUILER
|| nClass == CLASS_TYPE_DREAD_NECROMANCER