Puking Cantrip (RESOLVED)

I made a fun cantrip…

I call it the “Puke Cantrip”

Caster Level(s): Bard 0, Wizard / Sorcerer 0
Innate Level: 0
School: Evocation
Descriptor(s):
Component(s): Verbal, Somatic
Range: Personal
Area of Effect / Target: creature
Duration: Instantaneous
Additional Counter Spells:
Save: yes vs Fortitude
Spell Resistance: yes

This spell causes the person or creature affected to bend over and vomit. The person/creature gets a saving throw vs Fortitude. If a successful save is made the spell fails. This is a basic cantrip used by apprentices for pranking fellow apprentices, but can also be used to interrupt a caster from casting a spell.

Here is the script:

#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;

    effect ePuke = EffectVisualEffect(VFX_COM_CHUNK_YELLOW_SMALL);
    string sPukeTalk = "BBBLLLLAAAARRRRGGGGHHHHH!!!!";
    string sPukeApology = "Ugh, why do I feel so sick!";

    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //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) )
        {
            //Set damage effect
            effect eBad = EffectAttackDecrease(1*nCasterLevel);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBad, oTarget, RoundsToSeconds(10));


 ClearAllActions();
        AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
        AssignCommand(OBJECT_SELF, ActionSpeakString(sPukeTalk));
        DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePuke, OBJECT_SELF, 1.0));
        DelayCommand(5.0, ActionSpeakString(sPukeApology));
       }
      }
}

I took some of the scripting from the “Flare” cantrip and blended it with a script I have on an NPC that would puke when talked too because he is drunk (I got that script years ago). I thought it would be a fun cantrip.

It compiles. Problem is…the creature is targeted but my caster pukes and says the words above. I think on one trial one of the creatures actually puked.

Can someone help fix this script. I also need it to make the target:

  • pause for a round if he fails his save vs fortitude
  • and get the dazed effect after he fails
  • make sure the target is the one puking (not the caster)
  • and range??

almost got this

Usure if this would work, but I would try to maybe change this in the code:

AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
        AssignCommand(OBJECT_SELF, ActionSpeakString(sPukeTalk));
        DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePuke, OBJECT_SELF, 1.0));

to this:

AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
        AssignCommand(oTarget, ActionSpeakString(sPukeTalk));
        DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePuke, oTarget, 1.0));

I haven’t looked that deeply into the code but…well, maybe try it, I don’t know.

Perfect it works…makes the person targeted to puke…and say:
“BBBLLLLAAAARRRRGGGGHHHHH!!!”

BUT the target does not say the: "“Ugh, why do I feel so sick!” the caster does. It is suppose to be the traget that says that too.

Also, will this work on a PC if it is used on them too? I would like to target a buddy playing…lol

BUT the target does not say the: "“Ugh, why do I feel so sick!” the caster does. It is suppose to be the traget that says that too.

Try change

DelayCommand(5.0, ActionSpeakString(sPukeApology));

to this perhaps:

DelayCommand(5.0, AssignCommand(oTarget, ActionSpeakString(sPukeApology)));
1 Like

I have no idea. I never play multiplayer.

1 Like

Worked thanks.

Sometimes on enemies the words don’t show up just the puke effect. Maybe because they are triggered into combat? Regardless…it is fine. Thanks again.

I’m looking to make three cantrips maybe 3 orisons (cleric cantrips) to release together.

So far I have this one cantrip.

My next one is the “Bee Sting”. Just does one point of damage. Simple apprentice prank. just need to find a vfx that looks like a bee flying at the opponent (like a sling shot bullet). If anyone knows a good vfx similar to that.

Sorry to bother you again andgalf

Is it possible for you to make the person puking to be sick to effect the target’s strength and constitution to be reduced 1 point for 1d4 rounds. To simulate being sick. But only 1d4 rounds because it is a cantrip should not be longer.

I used the “Flare” spell effect -1 on AC…but then what would be the point of using flare if it is the same effect as puke?

here is the current spell:


#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;

    effect ePuke = EffectVisualEffect(VFX_COM_CHUNK_YELLOW_SMALL);
    string sPukeTalk = "BBBLLLLAAAARRRRGGGGHHHHH!!!!";
    string sPukeApology = "Ugh, why do I feel so sick!";

    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //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) )
        {
            //Set damage effect
            effect eBad = EffectAttackDecrease(1*nCasterLevel);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBad, oTarget, RoundsToSeconds(10));


 ClearAllActions();
       AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
        AssignCommand(oTarget, ActionSpeakString(sPukeTalk));
        DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePuke, oTarget, 1.0));
        DelayCommand(5.0, AssignCommand(oTarget, ActionSpeakString(sPukeApology)));
    }
  }
}

I’m sure it’s possible, but I don’t think I’ll be able to do that. Or…ok, maybe but…as you well know by now I don’t have NWN:EE, so it’s too much work for me to get into scripting details like that as I can never test things. If I were to do things like this on my own for my own module I would really have to go down headache-lane and try stuff, probably asking quite a few questions myself to those that are the masters of scripting on this forum. Still, if you moved on to NWN2 then I know I could be of much more help since then I could also test things on my end, and I’m much more familiar with that game’s quirks and what’s possible or not.

Maybe try Lilac’s Script generator to give you ideas to try.

ok…thanks bud. I know you are NWN2. But I thought you might still know. You have done pretty good so far in helping me. :slight_smile:

I’ll try with something…but I can’t promise anything.

1 Like

Ok, so here’s something to try. I have no idea if this works at all. It should reduce the constitution to 1 (I hope) for 60 seconds. It’s a start. Maybe you can fiddle with it to more produce what you need…
I’m not good at scripting things like this. It compiles in NWN2 at least.

#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;

    effect ePuke = EffectVisualEffect(VFX_COM_CHUNK_YELLOW_SMALL);
    string sPukeTalk = "BBBLLLLAAAARRRRGGGGHHHHH!!!!";
    string sPukeApology = "Ugh, why do I feel so sick!";

    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //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) )
        {
            //Set damage effect
            effect eBad = EffectAttackDecrease(1*nCasterLevel);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBad, oTarget, RoundsToSeconds(10));

			int nConstitution = GetAbilityScore(oTarget,ABILITY_CONSTITUTION);
			//int nLowerContitution = nConstitution - nConstitution  1;
			effect eConstitution = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConstitution -1);
			ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eConstitution, oTarget, 60.0f);

 			ClearAllActions();
       		AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
        	AssignCommand(oTarget, ActionSpeakString(sPukeTalk));
        	DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePuke, oTarget, 1.0));
        	DelayCommand(5.0, AssignCommand(oTarget, ActionSpeakString(sPukeApology)));
    	}
  }
}

I have no idea how to apply the reducing effect to 1d4 rounds. Since the function requires that you write in seconds how long…well, I’m too dumb to come up with a solution for that.

EDIT: Ok, maybe I’m not too dumb after all… Try with this perhaps (I’m sure there’s a more effective way to script this but I’m not a good scripter):

#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;

    effect ePuke = EffectVisualEffect(VFX_COM_CHUNK_YELLOW_SMALL);
    string sPukeTalk = "BBBLLLLAAAARRRRGGGGHHHHH!!!!";
    string sPukeApology = "Ugh, why do I feel so sick!";

    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //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) )
        {
            //Set damage effect
            effect eBad = EffectAttackDecrease(1*nCasterLevel);
            //Apply the VFX impact and damage effect
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBad, oTarget, RoundsToSeconds(10));

			int nConstitution = GetAbilityScore(oTarget,ABILITY_CONSTITUTION);
			
			effect eConstitution = EffectAbilityDecrease(ABILITY_CONSTITUTION, nConstitution -1);
			
			int nDiceRoll = d4();
			
			if(nDiceRoll== 1)
			{
				ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eConstitution, oTarget, 6.0f);
			}
			else if(nDiceRoll==2)
			{
				ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eConstitution, oTarget, 12.0f);
			}
			else if(nDiceRoll==3)
			{
				ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eConstitution, oTarget, 18.0f);
			}
			else if(nDiceRoll==4)
			{
				ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eConstitution, oTarget, 24.0f);
			}
			
 			ClearAllActions();
       		AssignCommand(oTarget, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE));
        	AssignCommand(oTarget, ActionSpeakString(sPukeTalk));
        	DelayCommand(2.0,ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePuke, oTarget, 1.0));
        	DelayCommand(5.0, AssignCommand(oTarget, ActionSpeakString(sPukeApology)));
    	}
  }
}

Yup, works as scripted. Thanks once AGAIN for lending me your talent…and the community who will gain from a new spell :slight_smile:

Thanks bud

Glad that it worked.