2025/09/14 Update

Updated readme
Updated PRC8 includes
This commit is contained in:
Jaysyn904
2025-09-14 13:48:12 -04:00
parent 5be8398033
commit cc110a9dd3
15 changed files with 240 additions and 89 deletions

View File

@@ -1,19 +1,16 @@
# Default Module Template
# Siege of Shadowdale EE [PRC8]
Repository for the development of the PRC8 version of .....
Repository for the development of the PRC8 version of Siege of Shadowdale EE.
[Discussion Thread on Discord](https://discord.gg/ca2ru3KxYd)
## Requirements
1.) [Nasher](https://github.com/squattingmonk/nasher), installed in your system path.
2.) [Original module resources]()
2.) [Original module resources](https://neverwintervault.org/project/nwnee/module/siege-shadowdale-enhanced-edition)
3.) [PRC8](https://gitea.raptio.us/Jaysyn/PRC8/releases)
3.) [CEP3](https://neverwintervault.org/project/nwnee/hakpak/combined/cep-3-community-expansion-pack)
4.) [CEP2](https://neverwintervault.org/cep)
## Instructions

View File

@@ -20,6 +20,8 @@ Add class to GetCasterLvl() in prc_inc_spells
Add Practiced Spellcaster feat to feat.2da and to PracticedSpellcasting() in prc_inc_castlvl
Run the assemble_spellbooks.bat file
Make the prc_* scripts in newspellbook. The filenames can be found under the spell entries for the class in spells.2da.
Update the fileends for all relevant files in inc_switch_setup
Delete prc_data in the \database\ folder before testing new spells.
Spont:
Make cls_spgn_*.2da
@@ -41,6 +43,8 @@ Add class to prc_amagsys_gain if(CheckMissingSpells(oPC, CLASS_TYPE_SORCERER, Mi
Add class to ExecuteScript("prc_amagsys_gain", oPC) list in EvalPRCFeats in prc_inc_function
Run the assemble_spellbooks.bat file
Make the prc_* scripts in newspellbook
Update the fileends for all relevant files in inc_switch_setup
Delete prc_data in the \database\ folder before testing new spells.
prc_classes.2da entry:
Label - name for the class

View File

@@ -221,9 +221,9 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_cls_spcr_bard", 144);
SetPRCSwitch("PRC_FILE_END_cls_spcr_beguil", 142);
SetPRCSwitch("PRC_FILE_END_cls_spcr_blkgrd", 47);
SetPRCSwitch("PRC_FILE_END_cls_spcr_dnecro", 137);
SetPRCSwitch("PRC_FILE_END_cls_spcr_dnecro", 138);
SetPRCSwitch("PRC_FILE_END_cls_spcr_duskbl", 69);
SetPRCSwitch("PRC_FILE_END_cls_spcr_favsol", 290);
SetPRCSwitch("PRC_FILE_END_cls_spcr_favsol", 300);
SetPRCSwitch("PRC_FILE_END_cls_spcr_harper", 35);
SetPRCSwitch("PRC_FILE_END_cls_spcr_healer", 77);
SetPRCSwitch("PRC_FILE_END_cls_spcr_hexbl", 73);
@@ -251,9 +251,9 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_cls_spell_bard", 169);
SetPRCSwitch("PRC_FILE_END_cls_spell_beguil", 119);
SetPRCSwitch("PRC_FILE_END_cls_spell_blkgrd", 163);
SetPRCSwitch("PRC_FILE_END_cls_spell_dnecro", 134);
SetPRCSwitch("PRC_FILE_END_cls_spell_dnecro", 135);
SetPRCSwitch("PRC_FILE_END_cls_spell_duskbl", 84);
SetPRCSwitch("PRC_FILE_END_cls_spell_favsol", 363);
SetPRCSwitch("PRC_FILE_END_cls_spell_favsol", 373);
SetPRCSwitch("PRC_FILE_END_cls_spell_harper", 21);
SetPRCSwitch("PRC_FILE_END_cls_spell_healer", 271);
SetPRCSwitch("PRC_FILE_END_cls_spell_hexbl", 79);
@@ -267,7 +267,7 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_cls_spell_sod", 110);
SetPRCSwitch("PRC_FILE_END_cls_spell_sohei", 131);
SetPRCSwitch("PRC_FILE_END_cls_spell_sol", 114);
SetPRCSwitch("PRC_FILE_END_cls_spell_sorc", 541);
SetPRCSwitch("PRC_FILE_END_cls_spell_sorc", 550);
SetPRCSwitch("PRC_FILE_END_cls_spell_suel", 160);
SetPRCSwitch("PRC_FILE_END_cls_spell_templ", 95);
SetPRCSwitch("PRC_FILE_END_cls_spell_tfshad", 70);
@@ -355,7 +355,7 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_des_crft_poison", 100);
SetPRCSwitch("PRC_FILE_END_des_crft_props", 27);
SetPRCSwitch("PRC_FILE_END_des_crft_scroll", 3999);
SetPRCSwitch("PRC_FILE_END_des_crft_spells", 19348);
SetPRCSwitch("PRC_FILE_END_des_crft_spells", 20000);
SetPRCSwitch("PRC_FILE_END_des_crft_weapon", 29);
SetPRCSwitch("PRC_FILE_END_des_cutconvdur", 26);
SetPRCSwitch("PRC_FILE_END_des_feat2item", 1000);
@@ -423,7 +423,7 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_iprp_damvulcost", 7);
SetPRCSwitch("PRC_FILE_END_iprp_decvalue1", 9);
SetPRCSwitch("PRC_FILE_END_iprp_decvalue2", 9);
SetPRCSwitch("PRC_FILE_END_iprp_feats", 24819);
SetPRCSwitch("PRC_FILE_END_iprp_feats", 26999);
SetPRCSwitch("PRC_FILE_END_iprp_immuncost", 7);
SetPRCSwitch("PRC_FILE_END_iprp_immunity", 9);
SetPRCSwitch("PRC_FILE_END_iprp_incvalue1", 9);
@@ -458,11 +458,11 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_iprp_soakcost", 50);
SetPRCSwitch("PRC_FILE_END_iprp_speed_dec", 9);
SetPRCSwitch("PRC_FILE_END_iprp_speed_enh", 9);
SetPRCSwitch("PRC_FILE_END_iprp_spellcost", 243);
SetPRCSwitch("PRC_FILE_END_iprp_spellcost", 298);
SetPRCSwitch("PRC_FILE_END_iprp_spellcstr", 42);
SetPRCSwitch("PRC_FILE_END_iprp_spelllvcost", 9);
SetPRCSwitch("PRC_FILE_END_iprp_spelllvlimm", 9);
SetPRCSwitch("PRC_FILE_END_iprp_spells", 1456);
SetPRCSwitch("PRC_FILE_END_iprp_spells", 1552);
SetPRCSwitch("PRC_FILE_END_iprp_spellshl", 7);
SetPRCSwitch("PRC_FILE_END_iprp_srcost", 99);
SetPRCSwitch("PRC_FILE_END_iprp_staminacost", -1);
@@ -492,9 +492,9 @@ void SetDefaultFileEnds()
SetPRCSwitch("PRC_FILE_END_itmwizwands", 38);
SetPRCSwitch("PRC_FILE_END_keymap", 70);
SetPRCSwitch("PRC_FILE_END_lightcolor", 32);
SetPRCSwitch("PRC_FILE_END_loadhints", 88);
SetPRCSwitch("PRC_FILE_END_loadhints", 101);
SetPRCSwitch("PRC_FILE_END_loadscreens", 259);
SetPRCSwitch("PRC_FILE_END_masterfeats", 113);
SetPRCSwitch("PRC_FILE_END_masterfeats", 125);
SetPRCSwitch("PRC_FILE_END_materialcomp", 200);
SetPRCSwitch("PRC_FILE_END_metamagic", 6);
SetPRCSwitch("PRC_FILE_END_namefilter", 3);

View File

@@ -78,7 +78,7 @@ void PRCRemoveSpellEffects(int nSpell_ID, object oCaster, object oTarget);
/**
* Target is immune to gaze attacks
*
* @return the Dazzle effect
* @return the Gaze Immunity effect
*/
effect EffectGazeImmune();

View File

@@ -400,5 +400,4 @@ int GetBestAvailableSpell(object oTarget)
if(nBestSpell == 99999) nBestSpell = GetBestL1Spell(oTarget, nBestSpell);
if(nBestSpell == 99999) nBestSpell = GetBestL0Spell(oTarget, nBestSpell);
return nBestSpell;
}
}

View File

@@ -3859,7 +3859,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_ARCHIVIST, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_ARCHIVIST, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_ARCHIVIST, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -4193,7 +4196,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_CLERIC, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_CLERIC, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_CLERIC, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -4309,9 +4315,12 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
/* if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_DRUID, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster); */
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_DRUID, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_DRUID, oCaster))
/* if(GetHasFeat(FEAT_BFZ_SPELLCASTING_DRUID, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_BFZ, oCaster + 1) / 2 */
// if(GetHasFeat(FEAT_BRIMSTONE_SPEAKER_SPELLCASTING_DRUID, oCaster))
@@ -4421,7 +4430,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_FAVOURED_SOUL, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_FAVOURED_SOUL, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_FAVOURED_SOUL, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -4534,7 +4546,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster); */
/* if(GetHasFeat(FEAT_BFZ_SPELLCASTING_HEALER, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2; */
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2; */
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_HEALER, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BRIMSTONE_SPEAKER_SPELLCASTING_HEALER, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BRIMSTONE_SPEAKER, oCaster) + 1) / 2;
@@ -4641,7 +4656,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_JUSTICEWW, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_JOWAW, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_JUSTICEWW, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -4742,6 +4760,9 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
if(GetHasFeat(FEAT_SWIFT_WING_SPELLCASTING_KNIGHT_CHALICE, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_KOTC, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
/* if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_KNIGHT_CHALICE, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
@@ -4849,6 +4870,9 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
if(GetHasFeat(FEAT_SWIFT_WING_SPELLCASTING_KNIGHT_MIDDLECIRCLE, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_KOTMC, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
/* if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_KNIGHT_MIDDLECIRCLE, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
@@ -4962,6 +4986,9 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
if(GetHasFeat(FEAT_SWIFT_WING_SPELLCASTING_NENTYAR_HUNTER, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_NENTYAR_HUNTER, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
/* if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_NENTYAR_HUNTER, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster); */
@@ -5164,6 +5191,9 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
if(GetHasFeat(FEAT_SWIFT_WING_SPELLCASTING_PALADIN, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_PALADIN, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
/* if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_PALADIN, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
@@ -5272,7 +5302,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_RANGER, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_RANGER, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_RANGER, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -5385,7 +5418,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_OASHAMAN, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_OASHAMAN, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_OASHAMAN, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -5599,7 +5635,10 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_SOHEI, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_SOHEI, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
if(GetHasFeat(FEAT_BFZ_SPELLCASTING_SOHEI, oCaster))
nDivine += (GetLevelByClass(CLASS_TYPE_BFZ, oCaster) + 1) / 2;
@@ -5704,6 +5743,9 @@ int GetDivinePRCLevels(object oCaster, int nCastingClass = CLASS_TYPE_INVALID)
if(GetHasFeat(FEAT_SWIFT_WING_SPELLCASTING_SOL, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_SWIFT_WING, oCaster);
if(GetHasFeat(FEAT_VERDANT_LORD_SPELLCASTING_SOL, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_VERDANT_LORD, oCaster);
/* if(GetHasFeat(FEAT_TENEBROUS_APOSTATE_SPELLCASTING_SOL, oCaster))
nDivine += GetLevelByClass(CLASS_TYPE_TENEBROUS_APOSTATE, oCaster);

View File

@@ -410,6 +410,8 @@ int PRCGetSpellLevelForClass(int nSpell, int nClass)
sSpellLevel = Get2DACache("spells", "Cleric", nSpell);
else if (nClass == CLASS_TYPE_BARD)
sSpellLevel = Get2DACache("spells", "Bard", nSpell);
else if (nClass == CLASS_TYPE_ASSASSIN)
sSpellLevel = Get2DACache("spells", "Assassin", nSpell);
else if (nClass == CLASS_TYPE_CULTIST_SHATTERED_PEAK)
sSpellLevel = Get2DACache("spells", "Cultist", nSpell);
else if (nClass == CLASS_TYPE_NENTYAR_HUNTER)

View File

@@ -109,7 +109,7 @@ void SetupCharacterData(object oPC)
case CLASS_TYPE_ARCANE_DUELIST: sScript = "prc_arcduel"; break;
case CLASS_TYPE_ARCHIVIST: sScript = "prc_archivist"; iData |= 0x01; break;
case CLASS_TYPE_ASSASSIN: break;
//case CLASS_TYPE_BAELNORN: sScript = "prc_baelnorn"; break;
//case CLASS_TYPE_BAELNORN: sScript = "prc_baelnorn"; break;
case CLASS_TYPE_BARD: iData |= 0x07; break;
case CLASS_TYPE_BATTLESMITH: sScript = "prc_battlesmith"; break;
case CLASS_TYPE_BEGUILER: iData |= 0x03; break;

View File

@@ -97,10 +97,38 @@ struct SizeModifiers
int dexSkillMod;
};
//:: Returns ability mod for score
int GetAbilityModFromValue(int nAbilityValue)
{
int nMod = (nAbilityValue - 10) / 2;
// Adjust if below 10 and odd
if (nAbilityValue < 10 && (nAbilityValue % 2) != 0)
{
nMod = nMod - 1;
}
return nMod;
}
//::---------------------------------------------|
//:: JSON functions |
//::---------------------------------------------|
//:: Returns the Constitution value from a GFF creature UTC
int json_GetCONValue(json jCreature)
{
int nCon = 0; // default if missing
// Check if the Con field exists
if (GffGetFieldExists(jCreature, "Con"))
{
nCon = JsonGetInt(GffGetByte(jCreature, "Con"));
}
return nCon;
}
//:: Returns the integer value of a VarTable entry named sVarName, or 0 if not found.
int json_GetLocalIntFromVarTable(json jCreature, string sVarName)
{
@@ -141,12 +169,12 @@ int json_GetLocalIntFromVarTable(json jCreature, string sVarName)
return 0;
}
//:: Returns the total Hit Dice from a JSON creature GFF.
int json_GetCreatureHD(json jGff)
//:: Returns the total Hit Dice from a JSON'd creature GFF.
int json_GetCreatureHD(json jCreature)
{
int nHD = 0;
json jClasses = GffGetList(jGff, "ClassList");
json jClasses = GffGetList(jCreature, "ClassList");
if (jClasses == JsonNull())
return 0;
@@ -170,6 +198,30 @@ int json_GetCreatureHD(json jGff)
return nHD;
}
json json_RecalcMaxHP(json jCreature, int iHitDieValue)
{
int iHD = json_GetCreatureHD(jCreature);
int iCON = json_GetCONValue(jCreature);
int iMod = GetAbilityModFromValue(iCON);
int nConBonusHP = iMod * iHD;
int iNewMaxHP = (iHitDieValue * iHD); /* nConBonusHP */
//jCreature = GffReplaceShort(jCreature, "MaxHitPoints", iNewMaxHP);
jCreature = GffReplaceShort(jCreature, "CurrentHitPoints", iNewMaxHP);
jCreature = GffReplaceShort(jCreature, "HitPoints", iNewMaxHP);
/* SendMessageToPC(GetFirstPC(), "HD = " + IntToString(iHD));
SendMessageToPC(GetFirstPC(), "HitDieValue = " + IntToString(iHitDieValue));
SendMessageToPC(GetFirstPC(), "CON = " + IntToString(iCON));
SendMessageToPC(GetFirstPC(), "Mod = " + IntToString(iMod));
SendMessageToPC(GetFirstPC(), "New HP = " + IntToString(iNewMaxHP)); */
return jCreature;
}
//:: Reads ABILITY_TO_INCREASE from creature's VarTable and applies stat boosts based on increased HD
json json_ApplyAbilityBoostFromHD(json jCreature, int nOriginalHD, int nModifierCap)
{
@@ -180,7 +232,7 @@ json json_ApplyAbilityBoostFromHD(json jCreature, int nOriginalHD, int nModifier
int nAbilityToIncrease = json_GetLocalIntFromVarTable(jCreature, "ABILITY_TO_INCREASE");
if (nAbilityToIncrease < 0 || nAbilityToIncrease > 5)
{
if(DEBUG) DoDebug("json_ApplyAbilityBoostFromHD: Invalid ABILITY_TO_INCREASE value: " + IntToString(nAbilityToIncrease));
DoDebug("json_ApplyAbilityBoostFromHD: Invalid ABILITY_TO_INCREASE value: " + IntToString(nAbilityToIncrease));
return jCreature; // Invalid ability index
}
@@ -188,7 +240,7 @@ json json_ApplyAbilityBoostFromHD(json jCreature, int nOriginalHD, int nModifier
json jClassList = GffGetList(jCreature, "ClassList");
if (jClassList == JsonNull())
{
if(DEBUG) DoDebug("json_ApplyAbilityBoostFromHD: Failed to get ClassList");
DoDebug("json_ApplyAbilityBoostFromHD: Failed to get ClassList");
return jCreature;
}
@@ -211,7 +263,7 @@ json json_ApplyAbilityBoostFromHD(json jCreature, int nOriginalHD, int nModifier
if (nCurrentTotalHD <= 0)
{
if(DEBUG) DoDebug("json_ApplyAbilityBoostFromHD: No valid Hit Dice found");
DoDebug("json_ApplyAbilityBoostFromHD: No valid Hit Dice found");
return jCreature;
}
@@ -273,7 +325,7 @@ json json_ApplyAbilityBoostFromHD(json jCreature, int nOriginalHD, int nModifier
return jCreature;
}
//:: Adjust a skill by its ID (more efficient than name lookup)
//:: Adjust a skill by its ID
json json_AdjustCreatureSkillByID(json jCreature, int nSkillID, int nMod)
{
// Get the SkillList
@@ -470,7 +522,7 @@ int json_GetArraySize(json jArray)
return iSize;
}
//:: Directly modifies oCreature's Base Natural AC if iNewAC is higher.
//:: Directly updates oCreature's Base Natural AC if iNewAC is higher.
//::
json json_UpdateBaseAC(json jCreature, int iNewAC)
{
@@ -493,6 +545,26 @@ json json_UpdateBaseAC(json jCreature, int iNewAC)
}
}
//:: Increases jCreature's Natural AC by iAddAC.
//::
json json_IncreaseBaseAC(json jCreature, int iAddAC)
{
json jBaseAC = GffGetByte(jCreature, "NaturalAC");
if (jBaseAC == JsonNull())
{
return JsonNull();
}
else
{
int nBaseAC = JsonGetInt(jBaseAC); // convert JSON number -> int
int nNewAC = nBaseAC + iAddAC;
jCreature = GffReplaceByte(jCreature, "NaturalAC", nNewAC);
return jCreature;
}
}
//:: Directly modifies jCreature's Challenge Rating.
//:: This is useful for most XP calculations.
json json_UpdateCR(json jCreature, int nBaseCR, int nCRMod)
@@ -510,8 +582,7 @@ json json_UpdateCR(json jCreature, int nBaseCR, int nCRMod)
//:: Directly modifies ability scores in a creature's JSON GFF.
//::
json json_UpdateTemplateStats(json jCreature, int iModStr = 0, int iModDex = 0, int iModCon = 0,
int iModInt = 0, int iModWis = 0, int iModCha = 0)
json json_UpdateTemplateStats(json jCreature, int iModStr = 0, int iModDex = 0, int iModCon = 0, int iModInt = 0, int iModWis = 0, int iModCha = 0)
{
int iCurrent;
@@ -745,6 +816,37 @@ json json_AdjustCreatureSize(json jCreature, int nSizeDelta)
return jCreature;
}
//:: Changes jCreature's creature type.
json JsonModifyRacialType(json jCreature, int nNewRacialType)
{
if(DEBUG)DoDebug("prc_inc_function >> JsonModifyRacialType: Entering function");
// Retrieve the RacialType field
json jRacialTypeField = JsonObjectGet(jCreature, "Race");
if (JsonGetType(jRacialTypeField) == JSON_TYPE_NULL)
{
DoDebug("prc_inc_function >> JsonModifyRacialType: JsonGetType error 1: " + JsonGetError(jRacialTypeField));
//SpeakString("JsonGetType error 1: " + JsonGetError(jRacialTypeField));
return JsonNull();
}
// Retrieve the value to modify
json jRacialTypeValue = JsonObjectGet(jRacialTypeField, "value");
if (JsonGetType(jRacialTypeValue) != JSON_TYPE_INTEGER)
{
DoDebug("prc_inc_function >> JsonModifyRacialType: JsonGetType error 2: " + JsonGetError(jRacialTypeValue));
//SpeakString("JsonGetType error 2: " + JsonGetError(jRacialTypeValue));
return JsonNull();
}
jCreature = GffReplaceByte(jCreature, "Race", nNewRacialType);
// Return the new creature object
return jCreature;
}
//:: Test void
//:: void main (){}

View File

@@ -430,8 +430,8 @@ string GetMaterialName( int iMaterialType, int bLowerCase = FALSE)
case IP_MATERIAL_ROPE_GIANT_HAIR: sName = IP_MATERIAL_NAME_ROPE_GIANT_HAIR; break;
case IP_MATERIAL_OBSIDIAN: sName = IP_MATERIAL_NAME_OBSIDIAN; break;
case IP_MATERIAL_BAMBOO: sName = IP_MATERIAL_NAME_BAMBOO; break;
case IP_MATERIAL_POTTERY: sName = IP_MATERIAL_NAME_POTTERY; break;
case IP_MATERIAL_GLASSTEEL: sName = IP_MATERIAL_NAME_GLASSTEEL; break;
case IP_MATERIAL_POTTERY: sName = IP_MATERIAL_NAME_POTTERY; break;
case IP_MATERIAL_GLASSTEEL: sName = IP_MATERIAL_NAME_GLASSTEEL; break;
case IP_MATERIAL_HERB: sName = IP_MATERIAL_NAME_HERB; break;
default: return "";

View File

@@ -1539,8 +1539,8 @@ int GetRemainingSpellChoices(int nClass, int circleLevel, object oPC=OBJECT_SELF
// default logic for spont casters
totalSpellsKnown = GetSpellKnownMaxCount(casterLevel, circleLevel, nClass, oPC);
// Favoured Soul has more 0 choices than there are spells for some reason
if (nClass == CLASS_TYPE_FAVOURED_SOUL && circleLevel == 0 && totalSpellsKnown > 6)
totalSpellsKnown = 6;
if (nClass == CLASS_TYPE_FAVOURED_SOUL && circleLevel == 0 && totalSpellsKnown > 7)
totalSpellsKnown = 7;
// logic for spont casters
json selectedCircle = JsonObjectGet(chosenSpells, IntToString(circleLevel));

View File

@@ -180,6 +180,24 @@ void RunImpactScript(object oPC, int nSpellID, int nEventType)
DeleteLocalInt(oPC, PRC_SPELLID_OVERRIDE);
}
//Returns true if the spell is one of the repair spells
int IsRepair(int nSpellID)
{
return ((nSpellID >= SPELL_REPAIR_MINOR_DAMAGE) && (nSpellID <= SPELL_REPAIR_CRITICAL_DAMAGE));
}
//Returns true if the spell is one of the mass repair spells
int IsMassRepair(int nSpellID)
{
return ((nSpellID >= SPELL_MASS_REPAIR_LIGHT_DAMAGE) && (nSpellID <= SPELL_MASS_REPAIR_CRITICAL_DAMAGE));
}
//Returns true if the spell is one of the mass inflict damage spells
int IsMassInflictDamage(int nSpellID)
{
return ((nSpellID >= SPELL_MASS_INFLICT_LIGHT_DAMAGE) && (nSpellID <= SPELL_MASS_INFLICT_CRITICAL_DAMAGE));
}
//Returns true if the spell is one of the cure spells
int IsCure(int nSpellID)
{

View File

@@ -1359,8 +1359,27 @@ const int SPELL_SUMMON_NATURES_ALLY_9_ARANEA = 17085;
const int SPELL_CHASING_PERFECTION = 2479;
//:: Spell Compendium Spells
const int SPELL_SPIRIT_WORM = 17248;
const int SPELL_FORCE_MISSILES = 2480;
const int SPELL_FORCE_MISSILES = 2480;
const int SPELL_REPAIR_MINOR_DAMAGE = 17094;
const int SPELL_REPAIR_LIGHT_DAMAGE = 17095;
const int SPELL_REPAIR_MODERATE_DAMAGE = 17096;
const int SPELL_REPAIR_SERIOUS_DAMAGE = 17097;
const int SPELL_REPAIR_CRITICAL_DAMAGE = 17098;
const int SPELL_INFLICT_LIGHT_DAMAGE = 17100;
const int SPELL_INFLICT_MODERATE_DAMAGE = 17101;
const int SPELL_INFLICT_SERIOUS_DAMAGE = 17102;
const int SPELL_INFLICT_CRITICAL_DAMAGE = 17103;
const int SPELL_SPIRIT_WORM = 17248;
//:: Races of Eberron
const int SPELL_MASS_REPAIR_LIGHT_DAMAGE = 17105;
const int SPELL_MASS_REPAIR_MODERATE_DAMAGE = 17106;
const int SPELL_MASS_REPAIR_SERIOUS_DAMAGE = 17107;
const int SPELL_MASS_REPAIR_CRITICAL_DAMAGE = 17108;
const int SPELL_MASS_INFLICT_LIGHT_DAMAGE = 17110;
const int SPELL_MASS_INFLICT_MODERATE_DAMAGE = 17111;
const int SPELL_MASS_INFLICT_SERIOUS_DAMAGE = 17112;
const int SPELL_MASS_INFLICT_CRITICAL_DAMAGE = 17113;
//:: Masters of the Wild Spells
const int SPELL_FORESTFOLD = 17090;

View File

@@ -529,6 +529,7 @@ object CICraftScribeScroll(object oCreator, int nSpellID)
case CLASS_TYPE_WIZARD:
case CLASS_TYPE_SORCERER: sClass = "Wiz_Sorc"; break;
case CLASS_TYPE_CLERIC:
case CLASS_TYPE_OCULAR:
case CLASS_TYPE_UR_PRIEST: sClass = "Cleric"; break;
case CLASS_TYPE_PALADIN: sClass = "Paladin"; break;
case CLASS_TYPE_DRUID:
@@ -1476,6 +1477,10 @@ int InscribeRune(object oTarget = OBJECT_INVALID, object oCaster = OBJECT_INVALI
if(!GetIsObjectValid(oTarget)) oTarget = PRCGetSpellTargetObject();
int nCaster = GetAlternativeCasterLevel(oCaster, PRCGetCasterLevel(oCaster));
//:: [TO DO] make Inscribe Epic Rune.
if(nCaster > 20) nCaster = 20;
int nDC = PRCGetSaveDC(oTarget, oCaster);
if(!nSpell) nSpell = PRCGetSpellId();
int nSpellLevel = 0;
@@ -1498,6 +1503,7 @@ int InscribeRune(object oTarget = OBJECT_INVALID, object oCaster = OBJECT_INVALI
// Minimum level.
if (nSpellLevel == 0) nSpellLevel = 1;
// This will be modified with Runecaster code later.
int nCharges = 1;
if (GetLocalInt(oCaster, "RuneCharges")) nCharges = nCount;

View File

@@ -24,6 +24,7 @@
#include "x0_i0_position"
#include "X0_INC_HENAI"
#include "x3_inc_skin"
#include "prc_racial_const"
/*
@@ -638,7 +639,7 @@ int HorseGetMountTail(object oHorse);
// FILE: x3_inc_horse FUNCTION: HorseGetMountFailureMessage()
// This is a companion function to HorseGetCanBeMounted. If you need a text
// message that explains why the horse cannot be mounted.
string HorseGetMountFailureMessage(object oTarget,object oRider=OBJECT_INVALID);
string HorseGetMountFailureMessage(object oHorse,object oRider=OBJECT_INVALID);
// FILE: x3_inc_horse FUNCTION: HorseAddHorseMenu()
@@ -1050,6 +1051,8 @@ void HORSE_SupportOriginalSpeed(object oRider)
} // check to see if matches conditions
eSearch=GetNextEffect(oRider);
} // cycle through effects
} // HORSE_SupportOriginalSpeed()
@@ -2733,47 +2736,6 @@ object HorseSummonPaladinMount(int bPHBDuration=FALSE)
return oMount;
} // HorseSummonPaladinMount()
object HorseSummonPhantomSteed(int nCasterLvl, int nDuration)
{ // PURPOSE: Summon Phantom Steed
object oSummoner=OBJECT_SELF;
object oMount;
location lLoc;
int nDespawnTime;
int nCurrentTime;
int nMountNum=1;
string sResRef=HORSE_PALADIN_PREFIX;
effect eVFX;
oMount=HorseGetPaladinMount(oSummoner);
if (!GetIsObjectValid(oMount) && GetObjectType(oSummoner) == OBJECT_TYPE_CREATURE)
{ // okay to summon - only one mount at a time
if ((GetIsPC(oSummoner) || GetIsDM(oSummoner))&&!GetHasFeat(FEAT_HORSE_MENU,oSummoner)) HorseAddHorseMenu(oSummoner);
if (nCasterLvl < 11) nMountNum = 2;
else if (nCasterLvl > 10 && nCasterLvl < 15) nMountNum = 3;
else if (nCasterLvl > 14 && nCasterLvl < 25) nMountNum = 4;
else if (nCasterLvl > 24 && nCasterLvl < 30) nMountNum = 5;
else if (nCasterLvl > 29 && nCasterLvl < 35) nMountNum = 6;
else if (nCasterLvl > 34 && nCasterLvl < 40) nMountNum = 7;
else if (nCasterLvl > 39) nMountNum = 8;
lLoc=HORSE_SupportGetMountLocation(oSummoner,oSummoner);
oMount=HorseCreateHorse(sResRef+IntToString(nMountNum),lLoc,oSummoner);
if (!GetIsObjectValid(oMount)) oMount=HorseCreateHorse(sResRef+IntToString(nMountNum),GetLocation(oSummoner),oSummoner);
if (GetIsObjectValid(oMount))
{ // oMount created
eVFX=EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVFX,oMount,3.0);
eVFX=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_2);
if (nMountNum>3) eVFX=EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT,eVFX,GetLocation(oMount));
nCurrentTime=HORSE_SupportAbsoluteMinute();
nDespawnTime=(nDuration*60)+nCurrentTime;
SetLocalInt(oSummoner,"nX3_PALADIN_UNSUMMON",nDespawnTime);
if (GetLocalInt(GetModule(),"X3_ENABLE_MOUNT_DB")&&GetIsPC(oSummoner)) SetLocalInt(oSummoner,"bX3_STORE_MOUNT_INFO",TRUE);
SetLocalObject(oSummoner,"oX3PaladinMount",oMount);
} // oMount created
} // okay to summon - only one paladin mount at a time
else { oMount=OBJECT_INVALID; }
return oMount;
} // HorseSummonPaladinMount()
void HorseUnsummonPaladinMount()
{ // PURPOSE: Unsummon Paladin Mount