Change x2_s3_paralyze to (changed code in bold):
#include "x2_i0_spells"
#include "x2_inc_switches"
#include "x0_i0_spells"
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();
if (GetIsObjectValid(oItem))
{
// you can not be deafened if you already can not hear.
if (!GetHasSpellEffect(GetSpellId(),oSpellTarget) )
{
int nDC = GetLocalInt(oSpellOrigin, X2_L_PARALYZE_MONSTER_SAVE_DC);
if (nDC == 0)
nDC = GetCasterLevel(oSpellOrigin)+10; ;
if (DoCubeParalyze(oSpellTarget, oSpellOrigin,nDC))
{
FloatingTextStrRefOnCreature(84609,oSpellTarget);
}
else
{
effect eSave = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eSave,oSpellTarget);
}
return;
}
}
}
This will enable the variable for all creatures that use a paralyze attack that references this script. Because the DC is carried into the function DoCubeParalysis - found in x2_i0_spells - from both the spellability script and the cube's HB script, it would be more prudent to perform the variable check within that function instead.
// * Gelatinous Cube Paralyze attack
int DoCubeParalyze(object oTarget, object oSource, int nSaveDC = 16)
{
if (GetIsImmune(oTarget,IMMUNITY_TYPE_PARALYSIS) )
{
return FALSE;
}
int nSaveDCOverride = GetLocalInt(oSource, X2_L_PARALYZE_MONSTER_SAVE_DC);
if (nSaveDCOverride > 0)
nSaveDC = nSaveDCOverride; if (FortitudeSave(oTarget, nSaveDC, SAVING_THROW_TYPE_POISON,oSource) == 0)
{
effect ePara = EffectParalyze();
effect eDur = EffectVisualEffect(VFX_DUR_PARALYZED);
ePara = EffectLinkEffects(eDur,ePara);
ePara = EffectLinkEffects(EffectVisualEffect(VFX_DUR_FREEZE_ANIMATION),ePara);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,ePara,oTarget,RoundsToSeconds(3+d3())); // not 3 d6, thats not fun
return TRUE;
}
else
{
effect eSave = EffectVisualEffect(VFX_IMP_FORTITUDE_SAVING_THROW_USE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eSave,oTarget);
}
return FALSE;
}
If you choose this option, you don't need to modify the other script, but you will need to compile both it and the HB script.
Modifié par Pstemarie, 21 novembre 2011 - 10:39 .