I am making the second set of cantrips and orisons
I just can’t get this spell to do the -1 penalty on dext. Anyone help?
// Sneeze Cantrip
// sp_sneeze_cant
#include "x0_i0_spells"
#include "x2_inc_spellhook"
// Define constants for the sneeze VFX, sound, and Dexterity penalty.
int nDexPenalty = 1; // Dexterity decrease.
float fDuration = RoundsToSeconds(2); // Duration of the effect (2 rounds).
void main()
{
// Get the target of the spell.
object oTarget = GetSpellTargetObject();
// Check if the target is valid.
if (GetIsObjectValid(oTarget))
{
// Make the target perform the sneeze animation (use laugh or other animation as proxy).
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING));
// Apply an instant visual effect for the sneeze (using VFX_IMP_NEGATIVE_ENERGY as a proxy).
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
// Make the target say something after sneezing.
string sSneezeTalk = "Achoo!";
AssignCommand(oTarget, ActionSpeakString(sSneezeTalk));
// Check for the Fortitude saving throw.
int nSaveResult = FortitudeSave(oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_SPELL);
// If the target fails the save, apply the Dexterity penalty first, followed by visual and sound effects.
if (nSaveResult == FALSE)
{
// Play a sound effect for the sneeze.
PlaySound("sneeze");
// Apply the Dexterity decrease for 2 rounds.
int nDexterity = GetAbilityScore(oTarget, ABILITY_DEXTERITY);
effect eDexterity = EffectAbilityDecrease(ABILITY_DEXTERITY, nDexterity - 1);
// Apply a secondary visual effect for the duration (use VFX_DUR_NEGATIVE_ENERGY for feedback).
eVis = EffectVisualEffect(84);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, fDuration);
}
else
{
// If the save is successful, have the target comment.
string sLaughTalk = "Ah...ah...whew...that was close, I almost sneezed!";
AssignCommand(oTarget, ActionSpeakString(sLaughTalk));
}
// Stop the sneeze animation after 3 seconds.
DelayCommand(3.0, AssignCommand(oTarget, ClearAllActions()));
}
}
Well because you not applying it. I see you applying a visual effect and that all. You defined it with eDexterity but did not put it on the target. Add another ApplyEffectToObject with eDexterity. Good luck Wow you also have it defined as the target Dex score - 1. Use nDexPenalty that you defined at the top.
// sp_sneeze_cant
#include "x0_i0_spells"
#include "x2_inc_spellhook"
// Define constants for the sneeze VFX, sound, and Dexterity penalty.
int nDexPenalty = 1; // Dexterity decrease.
float fDuration = RoundsToSeconds(2); // Duration of the effect (2 rounds).
void main()
{
// Get the target of the spell.
object oTarget = GetSpellTargetObject();
// Check if the target is valid.
if (GetIsObjectValid(oTarget))
{
// Make the target perform the sneeze animation (use laugh or other animation as proxy).
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_TALK_LAUGHING));
// Apply an instant visual effect for the sneeze (using VFX_IMP_NEGATIVE_ENERGY as a proxy).
effect eVis = EffectVisualEffect(VFX_IMP_NEGATIVE_ENERGY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
// Make the target say something after sneezing.
string sSneezeTalk = "Achoo!";
AssignCommand(oTarget, ActionSpeakString(sSneezeTalk));
// Check for the Fortitude saving throw.
int nSaveResult = FortitudeSave(oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_SPELL);
// If the target fails the save, apply the Dexterity penalty first, followed by visual and sound effects.
if (nSaveResult == FALSE)
{
// Play a sound effect for the sneeze.
PlaySound("sneeze");
// Apply the Dexterity decrease for 2 rounds.
// Not needed for example if the target had 13 dex you would do 12 dex damage.
// int nDexterity = GetAbilityScore(oTarget, ABILITY_DEXTERITY);
// Apply the dex penalty defined at the top for the time defined at the top
effect eDexterity = EffectAbilityDecrease(ABILITY_DEXTERITY, nDexPenalty);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eDexterity, oTarget, fDuration);
// Apply a secondary visual effect for the duration (use VFX_DUR_NEGATIVE_ENERGY for feedback).
eVis = EffectVisualEffect(84);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, fDuration);
}
else
{
// If the save is successful, have the target comment.
string sLaughTalk = "Ah...ah...whew...that was close, I almost sneezed!";
AssignCommand(oTarget, ActionSpeakString(sLaughTalk));
}
// Stop the sneeze animation after 3 seconds.
DelayCommand(3.0, AssignCommand(oTarget, ClearAllActions()));
}
}```
You have some kind of script that setting your little girl and monsters to 3 dexterity so the spell has no affect on them. Put down one of the henchmen and go in as a dm and use the scroll on the henchmen. Examine the creature and girl and you see somehow their stats have been modded on spawn.
I found it, it because they are set to immobile. Set the little girl to very slow and test again. Weird I do not remember immobile doing that to stats.