2025/09/06 Update
Fixed VFX for Prismatic Sphere. Fixed Bonded Summoner's familiar past 10th class lvl. Removed old goad item. Capped Inscribe Rune CL at 20th. Updated Psychic Rogue's power list. Fixed goad's icon size in baseitems.2da Added WotC Mind's Eye Web Enhancement PDFs to notes. Added PnP Animal Companion notes.
This commit is contained in:
@@ -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 (){}
|
@@ -1477,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;
|
||||
@@ -1499,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;
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user