Added Sanctified damage type. Added Holy damage type. Added Unholy damage type. Added Falling damage type. Added Ballistic damage type. Added Desiccation damage type. Fixed Major Missile's LABEL in spells.2da. Fixed Major Missile's LABEL in des_cft_spells.2da. Fixed Major Missile's LABEL in des_cft_scrolls.2da. Disabled incomplete PnP version of Shades spell. Astaroth's free crafting feats should drop off onRest, when expelling a vestige & when rebinding a vestige. Re-enabled caster level override variable clearing in GetInvokerLevel(). Change Piercing Cold's damagetype to Untyped. Constanted new damagetypes correctly for scripting (@lightbeard) Changed all force spells damagetype to force. Fixed issue with Initiators using Shadows Blade, Ironheart Aura and Shadow Trickster with dual-stances. Changed Eldritch Blast to Untyped damage. Fixed Path of Shadow screwing up caster levels. Changed Sanctify Martial strike to be Holy damage. Changed Vile Martial strike to be Vile damage. Updated Forsaker to work with Warforged "Armor". Added a SignalEvent() to Invisible Needle so it would break Invisibility when it should. Fixed equip exploit with Shou Disciple and monk weapons. Changed Saint template's Holy Touch to do Holy Damage. Changed Horrid Wilting to do Desiccation damage. Fixed Break Enchantment's targeting. Fixed the Command spell to obey mind immunity. Changed Damning Darkness to do Unholy damage. Change the Necrotic spells to do Vile damage. Made Persistent Blade more like PnP and made it dispellable.
80 lines
3.7 KiB
Plaintext
80 lines
3.7 KiB
Plaintext
#include "prc_inc_spells"
|
|
#include "prc_add_spell_dc"
|
|
#include "prc_inc_sp_tch"
|
|
|
|
void main()
|
|
{
|
|
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
|
if (!X2PreSpellCastCode()) return;
|
|
object oCaster = OBJECT_SELF;
|
|
effect eVis = EffectVisualEffect(VFX_IMP_MAGBLUE);
|
|
PRCSetSchool(SPELL_SCHOOL_EVOCATION);
|
|
int nSpellId = PRCGetSpellId();
|
|
object oTarget = PRCGetSpellTargetObject();
|
|
int nCasterLvl = PRCGetCasterLevel(oCaster);
|
|
int nPenetr = nCasterLvl + SPGetPenetr();
|
|
int nDice = nCasterLvl;
|
|
if (nDice > 10) nDice = 10;
|
|
|
|
int nAtk = PRCDoRangedTouchAttack(oTarget, TRUE, oCaster);
|
|
if(nAtk)
|
|
{
|
|
//Make SR Check
|
|
if (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl))
|
|
{
|
|
effect eMissile = EffectVisualEffect(VFX_IMP_MIRV);
|
|
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
|
{
|
|
//Fire cast spell at event for the specified target
|
|
PRCSignalSpellEvent(oTarget, TRUE, nSpellId);
|
|
|
|
//Roll damage for each target
|
|
int nDamage = PRCGetMetaMagicDamage(DAMAGE_TYPE_FORCE, nDice, 6);
|
|
nDamage += SpellDamagePerDice(oCaster, nDice);
|
|
// Succeeded on the save
|
|
if (PRCMySavingThrow(SAVING_THROW_FORT, oTarget, PRCGetSaveDC(oTarget, oCaster)))
|
|
nDamage = nDamage/2;
|
|
|
|
// Apply the damage and the damage visible effect to the target.
|
|
ApplyTouchAttackDamage(oCaster, oTarget, nAtk, nDamage, DAMAGE_TYPE_MAGICAL);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
|
|
}
|
|
}
|
|
}
|
|
else // If it misses, it becomes an AoE
|
|
{
|
|
location lTarget = PRCGetSpellTargetLocation();
|
|
oTarget = MyFirstObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
|
//Cycle through the targets within the spell shape until an invalid object is captured.
|
|
while (GetIsObjectValid(oTarget))
|
|
{
|
|
if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
|
|
{
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(oCaster, nSpellId));
|
|
//Get the distance between the explosion and the target to calculate delay
|
|
float fDelay = GetDistanceBetweenLocations(lTarget, GetLocation(oTarget))/20;
|
|
if (!PRCDoResistSpell(oCaster, oTarget, nCasterLvl, fDelay))
|
|
{
|
|
int nDamage = nDice * 2;
|
|
nDamage += SpellDamagePerDice(oCaster, nDice);
|
|
nDamage = PRCGetReflexAdjustedDamage(nDamage, oTarget, (PRCGetSaveDC(oTarget, oCaster)), SAVING_THROW_TYPE_SPELL);
|
|
if(nDamage > 0)
|
|
{
|
|
//Set the damage effect
|
|
effect eDam = PRCEffectDamage(oTarget, nDamage, DAMAGE_TYPE_MAGICAL);
|
|
// Apply effects to the currently selected target.
|
|
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
|
|
//This visual effect is applied to the target object not the location as above. This visual effect
|
|
//represents the flame that erupts on the target not on the ground.
|
|
DelayCommand(fDelay, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
|
|
}
|
|
}
|
|
}
|
|
//Select the next target within the spell shape.
|
|
oTarget = MyNextObjectInShape(SHAPE_SPHERE, FeetToMeters(10.0), lTarget, TRUE, OBJECT_TYPE_CREATURE | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
|
|
}
|
|
}
|
|
PRCSetSchool();
|
|
}
|