As some of you know I did a “Puke Cantrip” on here a while back where some of you helped me. I am working on releasing some cantrips and orisons (cleric cantrips) to the vault. I have been working on some funny/fun cantrips. All apprentices loved playing pranks on each other
I have the Puke cantrip done
Others I plan to do are:
Fart (one here below)
Crap
Sting
Moan
etc…
I used the Puke cantrip for my fart cantrip as a a base script. I thought if I changed a few variables and constants and vfx effects and sounds I could do this…apparently not so…lol
I got the following error and honestly I do not know how to fix it. I even looked at the NWN wiki
Here is the full script:
//Fart Cantrip
#include "x0_i0_spells"
#include "x2_inc_spellhook"
void main()
{
//--------------------------------------------------------------------------
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
//--------------------------------------------------------------------------
if (!X2PreSpellCastCode())
{
return;
}
// End of Spell Cast Hook
//Setup for Spell
object oTarget = GetSpellTargetObject();
location lLocal = GetSpellTargetLocation();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
float fDelay = IntToFloat(nCasterLevel)*5;
AssignCommand (oTarget, PlaySound("Tb1a1__1"));
effect eFart = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
string sFartTalk = "FART!!";
string sFartApology = "Ugh, I think farted my brains out!";
if(!GetIsReactionTypeFriendly(oTarget))
{
string szLaughMale = "as_pl_ailingm5";
string szLaughFemale = "as_pl_ailingf3";
if (GetGender(oTarget) == GENDER_FEMALE)
{
PlaySound(szLaughFemale);
}
else
{
PlaySound(szLaughMale);
}
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 416));
//Make SR Check
if ((!MyResistSpell(OBJECT_SELF, oTarget)) && (MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC()) == FALSE) )
{
int nIntelligence = GetAbilityScore(oTarget,ABILITY_INTELLIGENCE);
effect eIntelligence = EffectAbilityDecrease(ABILITY_INTELLIGENCE, nIntelligence -1);
int nDiceRoll = d4();
if(nDiceRoll== 1)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, nIntelligence, oTarget, 6.0f);
}
else if(nDiceRoll==2)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, nIntelligence, oTarget, 12.0f);
}
else if(nDiceRoll==3)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, nIntelligence, oTarget, 18.0f);
}
else if(nDiceRoll==4)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, nIntelligence, oTarget, 24.0f);
}
ClearAllActions();
AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
AssignCommand(oTarget, ActionSpeakString(sFartTalk));
DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFart, oTarget, 1.0));
DelayCommand(5.0, AssignCommand(oTarget, ActionSpeakString(sFartApology)));
}
}
}
Now on the Puke cantrip I used Constitution so I thought if I just switch it to intelligence “I think I farted my brains out”…it would work…now why doesn’t it? Should be as easy as just changing the variable right? If you look I did…why is it not working?
Also, why can’t I use a vfx persistent effect? I know i can use EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
But what is the name of the persistent constant? I could not find one? I like one on the persistent 2da I found I want to use for the fart effect.