2025/12/04 Update
Added Intrinsic Armor builder's feat to prevent any Disarming. Added Intrinsic Weapon builder's feat to prevent Ruin Armor. GetEpicSorcerer() should allow racial hit dice casters. Enlarge / Reduce Person now stores object's original scale. Added prc_inc_size for the above changes. Updated PRC8 version. Reverted Vow of Poverty to use PRC event system. Reverted Forsaker to use PRC event system. Updated Spell Cancel NUI to not show "system" spells @Rakiov) Added notes on instanced Maze system. Organized notes.
This commit is contained in:
@@ -1,359 +1,249 @@
|
||||
/*
|
||||
sp_enred
|
||||
#include "prc_sp_func"
|
||||
#include "prc_add_spell_dc"
|
||||
#include "prc_effect_inc"
|
||||
#include "prc_inc_size"
|
||||
|
||||
Enlarge Person
|
||||
|
||||
Transmutation
|
||||
Level: Sor/Wiz 1, Strength 1
|
||||
Components: V, S, M
|
||||
Casting Time: 1 round
|
||||
Range: Close (25 ft. + 5 ft./2 levels)
|
||||
Target: One humanoid creature
|
||||
Duration: 1 min./level (D)
|
||||
Saving Throw: Fortitude negates
|
||||
Spell Resistance: Yes
|
||||
This spell causes instant growth of a humanoid creature, doubling its height and multiplying its weight by 8. This increase changes the creature<72>s size category to the next larger one. The target gains a +2 size bonus to Strength, a <20>2 size penalty to Dexterity (to a minimum of 1), and a <20>1 penalty on attack rolls and AC due to its increased size.
|
||||
A humanoid creature whose size increases to Large has a space of 10 feet and a natural reach of 10 feet. This spell does not change the target<65>s speed.
|
||||
If insufficient room is available for the desired growth, the creature attains the maximum possible size and may make a Strength check (using its increased Strength) to burst any enclosures in the process. If it fails, it is constrained without harm by the materials enclosing it<69> the spell cannot be used to crush a creature by increasing its size.
|
||||
All equipment worn or carried by a creature is similarly enlarged by the spell. Melee and projectile weapons affected by this spell deal more damage. Other magical properties are not affected by this spell. Any enlarged item that leaves an enlarged creature<72>s possession (including a projectile or thrown weapon) instantly returns to its normal size. This means that thrown weapons deal their normal damage, and projectiles deal damage based on the size of the weapon that fired them. Magical properties of enlarged items are not increased by this spell.
|
||||
Multiple magical effects that increase size do not stack,.
|
||||
Enlarge person counters and dispels reduce person.
|
||||
Enlarge person can be made permanent with a permanency spell.
|
||||
Material Component: A pinch of powdered iron.
|
||||
|
||||
Enlarge Person, Mass
|
||||
|
||||
Transmutation
|
||||
Level: Sor/Wiz 4
|
||||
Target: One humanoid creature/level, no two of which can be more than 30 ft. apart
|
||||
This spell functions like enlarge person, except that it affects multiple creatures.
|
||||
|
||||
Reduce Person
|
||||
|
||||
Transmutation
|
||||
Level: Sor/Wiz 1
|
||||
Components: V, S, M
|
||||
Casting Time: 1 round
|
||||
Range: Close (25 ft. + 5 ft./2 levels)
|
||||
Target: One humanoid creature
|
||||
Duration: 1 min./level (D)
|
||||
Saving Throw: Fortitude negates
|
||||
Spell Resistance: Yes
|
||||
This spell causes instant diminution of a humanoid creature, halving its height, length, and width and dividing its weight by 8. This decrease changes the creature<72>s size category to the next smaller one. The target gains a +2 size bonus to Dexterity, a <20>2 size penalty to Strength (to a minimum of 1), and a +1 bonus on attack rolls and AC due to its reduced size.
|
||||
A Small humanoid creature whose size decreases to Tiny has a space of 2-1/2 feet and a natural reach of 0 feet (meaning that it must enter an opponent<6E>s square to attack). A Large humanoid creature whose size decreases to Medium has a space of 5 feet and a natural reach of 5 feet. This spell doesn<73>t change the target<65>s speed.
|
||||
All equipment worn or carried by a creature is similarly reduced by the spell.
|
||||
Melee and projectile weapons deal less damage. Other magical properties are not affected by this spell. Any reduced item that leaves the reduced creature<72>s possession (including a projectile or thrown weapon) instantly returns to its normal size. This means that thrown weapons deal their normal damage (projectiles deal damage based on the size of the weapon that fired them).
|
||||
Multiple magical effects that reduce size do not stack.
|
||||
Reduce person counters and dispels enlarge person.
|
||||
Reduce person can be made permanent with a permanency spell.
|
||||
Material Component: A pinch of powdered iron.
|
||||
|
||||
Reduce Person, Mass
|
||||
|
||||
Transmutation
|
||||
Level: Sor/Wiz 4
|
||||
Target: One humanoid creature/level, no two of which can be more than 30 ft. apart
|
||||
This spell functions like reduce person, except that it affects multiple creatures.
|
||||
|
||||
By: Flaming_Sword
|
||||
Created: Sept 27, 2006
|
||||
Modified: Sept 27, 2006
|
||||
|
||||
Copied from psionics
|
||||
*/
|
||||
|
||||
#include "prc_sp_func"
|
||||
#include "prc_inc_function"
|
||||
#include "prc_add_spell_dc"
|
||||
|
||||
void ResetSize(object oTarget)
|
||||
{
|
||||
SetObjectVisualTransform(oTarget, OBJECT_VISUAL_TRANSFORM_SCALE, 1.0f);
|
||||
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if(sTag == "ARCANE_SIZE_INCREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease");
|
||||
}
|
||||
if (sTag == "ARCANE_SIZE_DECREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
|
||||
void DispelMonitor(object oCaster, object oTarget, int nSpellID, int nBeatsRemaining)
|
||||
{
|
||||
// Has the power ended since the last beat, or does the duration run out now
|
||||
if((--nBeatsRemaining == 0) ||
|
||||
PRCGetDelayedSpellEffectsExpired(nSpellID, oTarget, oCaster)
|
||||
)
|
||||
{
|
||||
if(DEBUG) DoDebug("sp_enred: Spell expired, clearing");
|
||||
|
||||
// Clear the marker
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease");
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if ((sTag == "ARCANE_SIZE_DECREASE") ||
|
||||
(sTag == "ARCANE_SIZE_INCREASE"))
|
||||
{
|
||||
if(DEBUG) DoDebug("sp_enred: Removing all effects.");
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
|
||||
DelayCommand(0.0f, ResetSize(oTarget));
|
||||
PRCRemoveEffectsFromSpell(oTarget, GetSpellId());
|
||||
|
||||
// Size has changed, evaluate PrC feats again
|
||||
EvalPRCFeats(oTarget);
|
||||
}
|
||||
else
|
||||
DelayCommand(6.0f, DispelMonitor(oCaster, oTarget, nSpellID, nBeatsRemaining));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare main variables.
|
||||
int nEvent = GetRunningEvent();
|
||||
object oCaster;
|
||||
switch(nEvent)
|
||||
{
|
||||
case EVENT_ONPLAYERREST_STARTED: oCaster = GetLastBeingRested(); break;
|
||||
|
||||
default:
|
||||
oCaster = OBJECT_SELF;
|
||||
}
|
||||
|
||||
if(nEvent == FALSE)
|
||||
{
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nSpellID = PRCGetSpellId();
|
||||
PRCSetSchool(GetSpellSchool(nSpellID));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nSaveDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
float fDuration = 60.0 * nCasterLevel; //modify if necessary
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2;
|
||||
|
||||
int bMass = ((nSpellID == SPELL_ENLARGE_PERSON_MASS) ||
|
||||
(nSpellID == SPELL_REDUCE_PERSON_MASS));
|
||||
|
||||
int bEnlarge = ((nSpellID == SPELL_ENLARGE_PERSON) ||
|
||||
(nSpellID == SPELL_ENLARGE_PERSON_MASS));
|
||||
|
||||
effect eLink;
|
||||
eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_SANCTUARY));
|
||||
eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
|
||||
if (bEnlarge)
|
||||
{
|
||||
eLink = EffectLinkEffects(eLink, EffectAttackDecrease(1));
|
||||
eLink = EffectLinkEffects(eLink, EffectAbilityDecrease(ABILITY_DEXTERITY, 2));
|
||||
eLink = EffectLinkEffects(eLink, EffectAbilityIncrease(ABILITY_STRENGTH, 2));
|
||||
eLink = EffectLinkEffects(eLink, EffectACDecrease(1));
|
||||
//eLink = EffectLinkEffects(eLink, EffectBonusFeat(FEAT_SIZE_INCREASE_1));
|
||||
eLink = TagEffect(eLink, "ARCANE_SIZE_INCREASE");
|
||||
}
|
||||
else
|
||||
{
|
||||
eLink = EffectLinkEffects(eLink, EffectAttackIncrease(1));
|
||||
eLink = EffectLinkEffects(eLink, EffectAbilityIncrease(ABILITY_DEXTERITY, 2));
|
||||
eLink = EffectLinkEffects(eLink, EffectAbilityDecrease(ABILITY_STRENGTH, 2));
|
||||
eLink = EffectLinkEffects(eLink, EffectACIncrease(1));
|
||||
//eLink = EffectLinkEffects(eLink, EffectBonusFeat(FEAT_SIZE_DECREASE_1));
|
||||
eLink = TagEffect(eLink, "ARCANE_SIZE_DECREASE");
|
||||
}
|
||||
|
||||
int nRacial, bApply, bRace;
|
||||
|
||||
AddEventScript(oTarget, EVENT_ONPLAYERREST_STARTED, "sp_enred", TRUE, FALSE);
|
||||
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2;
|
||||
location lTarget;
|
||||
if(bMass)
|
||||
{
|
||||
lTarget = PRCGetSpellTargetLocation();
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (PRCAmIAHumanoid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster))
|
||||
{
|
||||
if(bEnlarge)
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "ARCANE_SIZE_DECREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
DelayCommand(0.0f, ResetSize(oTarget));
|
||||
PRCRemoveEffectsFromSpell(oTarget, GetSpellId());
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be increased further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease", 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
SetObjectVisualTransform(oTarget, OBJECT_VISUAL_TRANSFORM_SCALE, 1.5);
|
||||
DelayCommand(fDuration, ResetSize(oTarget));
|
||||
DelayCommand(6.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
if(DEBUG) DoDebug("sp_enred: DispelMonitor started.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "ARCANE_SIZE_INCREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
DelayCommand(0.0f, ResetSize(oTarget));
|
||||
PRCRemoveEffectsFromSpell(oTarget, GetSpellId());
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease");
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be decreased further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction", 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
SetObjectVisualTransform(oTarget, OBJECT_VISUAL_TRANSFORM_SCALE, 0.5);
|
||||
DelayCommand(fDuration, ResetSize(oTarget));
|
||||
DelayCommand(6.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
if(DEBUG) DoDebug("sp_enred: DispelMonitor started.");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC))
|
||||
{
|
||||
if(bEnlarge) //:: Enlarge
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "ARCANE_SIZE_DECREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
DelayCommand(0.0f, ResetSize(oTarget));
|
||||
PRCRemoveEffectsFromSpell(oTarget, GetSpellId());
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be increased further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease", 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
SetObjectVisualTransform(oTarget, OBJECT_VISUAL_TRANSFORM_SCALE, 1.5);
|
||||
DelayCommand(fDuration, ResetSize(oTarget));
|
||||
DelayCommand(6.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
if(DEBUG) DoDebug("sp_enred: DispelMonitor started.");
|
||||
}
|
||||
}
|
||||
else //:: Reduce
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "ARCANE_SIZE_INCREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
DelayCommand(0.0f, ResetSize(oTarget));
|
||||
PRCRemoveEffectsFromSpell(oTarget, GetSpellId());
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeIncrease");
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be reduced further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction", 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
SetObjectVisualTransform(oTarget, OBJECT_VISUAL_TRANSFORM_SCALE, 1.5);
|
||||
DelayCommand(fDuration, ResetSize(oTarget));
|
||||
DelayCommand(6.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
if(DEBUG) DoDebug("sp_enred: DispelMonitor started.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!bMass) break;
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
|
||||
EvalPRCFeats(oTarget);
|
||||
|
||||
}
|
||||
else if(nEvent == EVENT_ONPLAYERREST_STARTED)
|
||||
{
|
||||
ResetSize(oCaster);
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
void DispelMonitor(object oCaster, object oTarget, int nSpellID, int nBeatsRemaining)
|
||||
{
|
||||
if((--nBeatsRemaining == 0) ||
|
||||
PRCGetDelayedSpellEffectsExpired(nSpellID, oTarget, oCaster)
|
||||
)
|
||||
{
|
||||
if(DEBUG) DoDebug("sp_enred: Spell expired, clearing");
|
||||
|
||||
// Clear the marker variables FIRST
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease");
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
|
||||
// Remove any size effects with the new tags
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "PRC_SIZE_INCREASE" || sTag == "PRC_SIZE_DECREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
|
||||
// Reset to ORIGINAL scale, not 1.0f
|
||||
float fOriginalSize = GetLocalFloat(oTarget, "PRC_ORIGINAL_SIZE");
|
||||
if(fOriginalSize == 0.0f) fOriginalSize = 1.0f; // fallback
|
||||
SetObjectVisualTransform(oTarget, OBJECT_VISUAL_TRANSFORM_SCALE, fOriginalSize);
|
||||
|
||||
// DON'T delete PRC_ORIGINAL_SIZE here - keep it for future casts
|
||||
|
||||
// Remove remaining spell effects
|
||||
PRCRemoveEffectsFromSpell(oTarget, nSpellID);
|
||||
|
||||
// Size has changed, evaluate PrC feats again
|
||||
EvalPRCFeats(oTarget);
|
||||
}
|
||||
else
|
||||
DelayCommand(1.0f, DispelMonitor(oCaster, oTarget, nSpellID, nBeatsRemaining));
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
//Declare main variables.
|
||||
int nEvent = GetRunningEvent();
|
||||
object oCaster;
|
||||
switch(nEvent)
|
||||
{
|
||||
case EVENT_ONPLAYERREST_FINISHED: oCaster = GetLastBeingRested(); break;
|
||||
|
||||
default:
|
||||
oCaster = OBJECT_SELF;
|
||||
}
|
||||
|
||||
if(nEvent == FALSE)
|
||||
{
|
||||
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
||||
int nSpellID = PRCGetSpellId();
|
||||
PRCSetSchool(GetSpellSchool(nSpellID));
|
||||
if (!X2PreSpellCastCode()) return;
|
||||
object oTarget = PRCGetSpellTargetObject();
|
||||
int nMetaMagic = PRCGetMetaMagicFeat();
|
||||
int nSaveDC = PRCGetSaveDC(oTarget, oCaster);
|
||||
int nPenetr = nCasterLevel + SPGetPenetr();
|
||||
float fDuration = 60.0 * nCasterLevel; //modify if necessary
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2;
|
||||
|
||||
int bMass = ((nSpellID == SPELL_ENLARGE_PERSON_MASS) ||
|
||||
(nSpellID == SPELL_REDUCE_PERSON_MASS));
|
||||
|
||||
int bEnlarge = ((nSpellID == SPELL_ENLARGE_PERSON) ||
|
||||
(nSpellID == SPELL_ENLARGE_PERSON_MASS));
|
||||
|
||||
AddEventScript(oTarget, EVENT_ONPLAYERREST_FINISHED, "sp_enred", TRUE, FALSE);
|
||||
|
||||
if(nMetaMagic & METAMAGIC_EXTEND) fDuration *= 2;
|
||||
location lTarget;
|
||||
if(bMass)
|
||||
{
|
||||
lTarget = PRCGetSpellTargetLocation();
|
||||
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
while(GetIsObjectValid(oTarget))
|
||||
{
|
||||
if (PRCAmIAHumanoid(oTarget))
|
||||
{
|
||||
if(spellsIsTarget(oTarget, SPELL_TARGET_ALLALLIES, oCaster)) //:: Allied Branch
|
||||
{
|
||||
if(bEnlarge)
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "PRC_SIZE_DECREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
effect eReset = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, TRUE, 0);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eReset, oTarget);
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0); // 0 beats for immediate cleanup
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be increased further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease", 1);
|
||||
effect eSize = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, TRUE, 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSize, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
DelayCommand(1.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
}
|
||||
}
|
||||
else // Reduce
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
// Remove opposing size effect
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "PRC_SIZE_INCREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
effect eReset = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, TRUE, 0);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eReset, oTarget);
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease");
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be decreased further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction", 1);
|
||||
effect eSize = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, FALSE, 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSize, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
DelayCommand(1.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(!PRCMySavingThrow(SAVING_THROW_FORT, oTarget, nSaveDC))
|
||||
{
|
||||
// Same logic as above for hostile targets
|
||||
if(bEnlarge)
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
// Remove opposing size effect (same as above)
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "PRC_SIZE_DECREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
effect eReset = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, TRUE, 0);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eReset, oTarget);
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Compression_SizeReduction");
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be increased further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease", 1);
|
||||
effect eSize = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, TRUE, 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSize, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
DelayCommand(1.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
}
|
||||
}
|
||||
else // Reduce
|
||||
{
|
||||
if(GetLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease"))
|
||||
{
|
||||
// Remove opposing size effect (same as above)
|
||||
effect eEffect = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eEffect))
|
||||
{
|
||||
string sTag = GetEffectTag(eEffect);
|
||||
if (sTag == "PRC_SIZE_INCREASE")
|
||||
{
|
||||
RemoveEffect(oTarget, eEffect);
|
||||
effect eReset = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, TRUE, 0);
|
||||
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eReset, oTarget);
|
||||
DeleteLocalInt(oTarget, "PRC_Power_Expansion_SizeIncrease");
|
||||
DispelMonitor(oCaster, oTarget, nSpellID, 0);
|
||||
}
|
||||
eEffect = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
else if(GetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction"))
|
||||
{
|
||||
FloatingTextStringOnCreature("This creature's size cannot be reduced further.", oTarget);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oTarget, "PRC_Power_Compression_SizeReduction", 1);
|
||||
effect eSize = EffectSizeChange(oTarget, OBJECT_TYPE_CREATURE, FALSE, 1);
|
||||
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eSize, oTarget, fDuration, TRUE, nSpellID, nCasterLevel);
|
||||
DelayCommand(1.0f, DispelMonitor(oCaster, oTarget, nSpellID, FloatToInt(fDuration) / 6));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!bMass) break;
|
||||
oTarget = MyNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_COLOSSAL, lTarget, TRUE, OBJECT_TYPE_CREATURE);
|
||||
}
|
||||
|
||||
EvalPRCFeats(oTarget);
|
||||
|
||||
}
|
||||
else if(nEvent == EVENT_ONPLAYERREST_FINISHED)
|
||||
{
|
||||
// Reset size on rest - this is where we fully clean up
|
||||
float fOriginalSize = GetLocalFloat(oCaster, "PRC_ORIGINAL_SIZE");
|
||||
if(fOriginalSize == 0.0f) fOriginalSize = 1.0f;
|
||||
SetObjectVisualTransform(oCaster, OBJECT_VISUAL_TRANSFORM_SCALE, fOriginalSize);
|
||||
|
||||
// Clear ALL size state variables including original size
|
||||
DeleteLocalInt(oCaster, "PRC_Power_Expansion_SizeIncrease");
|
||||
DeleteLocalInt(oCaster, "PRC_Power_Compression_SizeReduction");
|
||||
DeleteLocalFloat(oCaster, "PRC_ORIGINAL_SIZE");
|
||||
}
|
||||
|
||||
PRCSetSchool();
|
||||
}
|
||||
140
nwn/nwnprc/trunk/spells/x2_s3_ruinarmor.nss
Normal file
140
nwn/nwnprc/trunk/spells/x2_s3_ruinarmor.nss
Normal file
@@ -0,0 +1,140 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: OnHit: Ruin Armor (Bebilith Ability)
|
||||
//:: x2_s3_ruinarmor
|
||||
//:: Copyright (c) 2003 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
A bebilith claw can catch and tear an opponent's
|
||||
armor. If there is both armor and shield,
|
||||
it is randomly determined which item removed
|
||||
|
||||
By default, the armor and shield just get
|
||||
unequipped, however by setting
|
||||
MODULE_SWITCH_ENABLE_BEBILITH_RUIN_ARMOR
|
||||
to true via x2_inc_switches::SetModuleSwitch,
|
||||
the armor gets actually destroyed
|
||||
|
||||
Chance to destroy armor is Bebilith BAB + StrengthMod + 8
|
||||
vs Disciple + Item AC value
|
||||
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Georg Zoeller
|
||||
//:: Created On: 2003-08-26
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Updated By: Jaysyn
|
||||
//:: Updated On: 2025-12-03 23:21:14
|
||||
//::
|
||||
//:: Checks for "Intrinsic Armor" that can't
|
||||
//:: be ruined.
|
||||
//:: Shields can actually be effected now.
|
||||
//::
|
||||
//:://////////////////////////////////////////////
|
||||
#include "prc_feat_const"
|
||||
#include "x2_inc_switches"
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
object oItem; // The item casting triggering this spellscript
|
||||
object oSpellTarget; // On a weapon: The one being hit. On an armor: The one hitting the armor
|
||||
object oSpellOrigin; // On a weapon: The one wielding the weapon. On an armor: The one wearing an armor
|
||||
|
||||
// fill the variables
|
||||
oSpellOrigin = OBJECT_SELF;
|
||||
oSpellTarget = GetSpellTargetObject();
|
||||
oItem = GetSpellCastItem();
|
||||
|
||||
int bNoRend = GetHasFeat(FEAT_INTRINSIC_ARMOR, oSpellTarget);
|
||||
|
||||
//Note that there needs to be no signal event in that scirpt, because this is not a spell ...
|
||||
|
||||
if(bNoRend)
|
||||
{
|
||||
SendMessageToPC(oSpellOrigin, "This creatures armor cannot be ruined.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetIsObjectValid(oItem))
|
||||
{
|
||||
object oArmor = GetItemInSlot(INVENTORY_SLOT_CHEST, oSpellTarget);
|
||||
object oShield = GetItemInSlot(INVENTORY_SLOT_LEFTHAND, oSpellTarget);
|
||||
object oDestroy;
|
||||
int nType = GetBaseItemType(oShield);
|
||||
// we actually have a shield here
|
||||
if (nType == BASE_ITEM_LARGESHIELD || nType == BASE_ITEM_SMALLSHIELD || nType == BASE_ITEM_TOWERSHIELD)
|
||||
{
|
||||
//SpeakString("Shield")
|
||||
}
|
||||
else
|
||||
{
|
||||
oShield = OBJECT_INVALID;
|
||||
}
|
||||
int bShield = FALSE;
|
||||
// Determine which item
|
||||
if (oArmor != OBJECT_INVALID && oShield != OBJECT_INVALID)
|
||||
{
|
||||
if (d4()< 2)
|
||||
{
|
||||
oDestroy = oArmor;
|
||||
}
|
||||
else
|
||||
{
|
||||
oDestroy = oShield;
|
||||
bShield = TRUE;
|
||||
}
|
||||
}
|
||||
else if (oShield == OBJECT_INVALID)
|
||||
{
|
||||
oDestroy = oArmor;
|
||||
}
|
||||
else if (oArmor == OBJECT_INVALID)
|
||||
{
|
||||
oDestroy = oShield;
|
||||
bShield = TRUE;
|
||||
}
|
||||
|
||||
if (oDestroy != OBJECT_INVALID)
|
||||
{
|
||||
int nDC = GetBaseAttackBonus(oSpellOrigin) + GetAbilityModifier(ABILITY_STRENGTH,oSpellOrigin) + 8 - GetItemACValue(oItem);
|
||||
if (nDC > 0)
|
||||
{
|
||||
if (!GetIsSkillSuccessful(oSpellTarget, SKILL_DISCIPLINE, nDC) )
|
||||
{
|
||||
|
||||
if (GetModuleSwitchValue(MODULE_SWITCH_ENABLE_BEBILITH_RUIN_ARMOR))
|
||||
{
|
||||
DestroyObject(oDestroy);
|
||||
if (!bShield)
|
||||
{
|
||||
FloatingTextStrRefOnCreature(84428, oSpellTarget,FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatingTextStrRefOnCreature(84430, oSpellTarget,FALSE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GetLocalInt(oDestroy,"X2_L_BEB_RUINED") == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
CopyItem(oDestroy, oSpellTarget,TRUE);
|
||||
SetLocalInt(oDestroy,"X2_L_BEB_RUINED",1);
|
||||
DestroyObject(oDestroy);
|
||||
if (!bShield)
|
||||
{
|
||||
FloatingTextStrRefOnCreature(84426, oSpellTarget,FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
FloatingTextStrRefOnCreature(84429, oSpellTarget,FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user