Enlarge and Reduce Spells

Hi everyone…yup me again…lol

Been working like crazy on my module lately. I have appreciated so many of you helping me lately.

A while back Pstemarie made me some potions for my module that acted like Enlarge and Reduce Spells. They work perfectly.

Now I added the scripts to my spells 2da as the aforementioned spell names using the reference that the potions call on.

Some times the spells work…other times it does not…why? Also, when the spells are cast on another target they don’t work…only the few times the spells do work…they only work on the PC.

I would also like to make a “Mass Reduce and Mass Enlarge” spells

Here are the spells below:

sp_Enlarge


/*
Spell of Enlargement
*/

#include “x2_inc_switches”
#include “_gg_inc_funcs”

void main()
{
int nEvent =GetUserDefinedItemEventNumber();

if (nEvent ==  X2_ITEM_EVENT_ACTIVATE)
{
    object oTarget      = GetItemActivator();

    // Negates reduce
    if (GetLocalInt(oTarget, "GG_Reduced") == 1 )
    {
        gg_RemoveTaggedEffects(oTarget, "GG_Reduce");
        gg_ScaleObject(oTarget, 1.0);
        DeleteLocalInt(oTarget, "GG_Reduced");
        return;
    }
    else
    {
        // Remove previous enlarge effects - stacking is not good
        if (GetLocalInt(oTarget, "GG_Reduced") == 1 )
        {
            gg_RemoveTaggedEffects(oTarget, "GG_Enlarge");
            gg_ScaleObject(oTarget, 1.0);
        }

        // Set up effects and duration
        effect eHit  = EffectVisualEffect(VFX_IMP_HEAD_ODD);
        effect eStr  = EffectAbilityIncrease(ABILITY_STRENGTH, 2);
        effect eDex  = EffectAbilityDecrease(ABILITY_DEXTERITY, 2);
        effect eAtt  = EffectAttackDecrease(1);
        effect eAC   = EffectACDecrease(1, AC_DODGE_BONUS);
        effect eDur  = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
        effect eLink = EffectLinkEffects(eStr, eDex);
               eLink = EffectLinkEffects(eLink, eAtt);
               eLink = EffectLinkEffects(eLink, eAC);
               eLink = EffectLinkEffects(eLink, eDur);
               eLink = TagEffect(eLink, "GG_Enlarge");

        // Set duration
        float fDuration = HoursToSeconds(1);

        // Apply impact visual
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eHit, oTarget);

        // Apply effects
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration);
        gg_ScaleObject(oTarget, 1.5);

        SetLocalInt(oTarget, "GG_Enlarged", 1);

        // End scaling at spell end
        ExecuteScript("sp_Enlarge_h", oTarget);
    }
}

}


The spell it calls on listed in the above script:

"sp_Enlarge_h"


#include “_gg_inc_funcs”

void main()
{
DelayCommand(HoursToSeconds(1), gg_ScaleObject(OBJECT_SELF, 1.0));
DelayCommand(HoursToSeconds(1), DeleteLocalInt(OBJECT_SELF, “GG_Enlarged”));
}


sp_Reduce


/*
Spell of Reduce
*/

#include “x2_inc_switches”
#include “_gg_inc_funcs”

void main()
{
int nEvent =GetUserDefinedItemEventNumber();

if (nEvent ==  X2_ITEM_EVENT_ACTIVATE)
{
    object oTarget = GetItemActivator();

    // Negates reduce
    if (GetLocalInt(oTarget, "GG_Enlarged") == 1 )
    {
        gg_RemoveTaggedEffects(oTarget, "GG_Enlarge");
        gg_ScaleObject(oTarget, 1.0);
        DeleteLocalInt(oTarget, "GG_Enlarged");
        return;
    }
    else
    {
        // Remove previous reduce effects - stacking is not good
        if (GetLocalInt(oTarget, "GG_Reduced") == 1 )
        {
            gg_RemoveTaggedEffects(oTarget, "GG_Reduce");
            gg_ScaleObject(oTarget, 1.0);
        }

        // Set up effects and duration
        effect eHit    = EffectVisualEffect(VFX_IMP_HEAD_ODD);
        effect eStr    = EffectAbilityIncrease(ABILITY_DEXTERITY, 2);
        effect eDex    = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
        effect eAtt    = EffectAttackIncrease(1);
        effect eAC     = EffectACIncrease(1, AC_DODGE_BONUS);
        effect eDur    = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
        effect eLink   = EffectLinkEffects(eStr, eDex);
               eLink   = EffectLinkEffects(eLink, eAtt);
               eLink   = EffectLinkEffects(eLink, eAC);
               eLink   = EffectLinkEffects(eLink, eDur);
               eLink   = TagEffect(eLink, "GG_Reduce");

        // Set duration
        float fDuration = HoursToSeconds(1);

        // Apply impact visual
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eHit, oTarget);

        // Apply effects
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration);
        gg_ScaleObject(oTarget, 0.5);

        SetLocalInt(oTarget, "GG_Reduced", 1);

        // End scaling at spell end
        ExecuteScript("sp_Reduce_h", oTarget);
    }
}

}


sp_Reduce_h


#include “_gg_inc_funcs”

void main()
{
DelayCommand(HoursToSeconds(1), gg_ScaleObject(OBJECT_SELF, 1.0));
DelayCommand(HoursToSeconds(1), DeleteLocalInt(OBJECT_SELF, “GG_Reduced”));
}

Any help on this would be much appreciated…also how can I factor in duration of rounds by level for these spells? Can someone be kind enough to make these spells work. They work perfectly always as a potion…but for some weird reason not as a spell.

Anyone?..can someone help me with these spells if you have them?

My base module has both spells in it.
LINK

Hey thanks bud :slight_smile:

Hey bud…I can’t find the scripts in your haks. Are you missing your scripts haks in that upload?

EDIT:

Nevermind…like you said they are in your “module” not in a ha. thanks bud. I will create an .erf to export them.

Hi Shadow,

I just opened your base mod and looked at the spells. You do not have your “is_” spells in that base mod. Could I ask a favour and have you create me a ha with all your spell scripts please.

Wow ShadowM…the stuff you have in that mod is mind blowing stuff…I never knew stuff like this was out there…just seriously wow…I would love to incorporate all that…

What’s weird is that your enlarge spell works in the starter mod you have, yet I could not see the spell in the toolset…I see no script titled what you have on your spell 2da matching it in the toolset.

Man that enlarge spell is very cool…

All the spells are ran through the hr_spells_router script using spell hooking system. Using a script for each spell is just inefficient. Search it with SPELL_ENLARGE_PERSON constant and you see the spell function. Open hr_inc_spells and search SP_Enlarge to see the meat of the spell. Custom EnlargePerson() effect is in hr_inc_effects

Ah crap…this is waaay beyond my capabilities. I can add a script to my module, but to tinker with and script a spell…no can do. I pulled what I thought was the enlarge spell (i don’t see the reduce spell) and the effects attached, but don’t ask me how I am to pull this off…lol
enlarge spell.txt (3.3 KB)
enlarge effects.txt (985 Bytes)

Is there a way you could simplify this for me to just add as each spell. I hate to push my luck…but could you do a “Mass Enlarge” and “Mass Reduce Spell” too. I would just love those.

Heck I love the other spells you have in there too…but I know that would be too much to ask. I would settle for the ones above.

Thanks for the vote and comment. If I get some time today then I see what I can do. I might have to just give a simple version of it because I think there a lot custom appearance.2da lines to support creature sizing.

1 Like

Dude you deserve 5 stars for that content…they are mind blowing. I tried to find the tga or dds for your hill giant reskin which is awesome…but could not see it in there. Also, dam all that stuff…wow…

And thanks if you can do those spells…would be cool if creatures could be targeted too…lol…hill giants running at you “reduced” would be hilarious…lol

I bet many in the community would love these spells too. The Enlarge and Reduce and Mass Enlarge and Mass Reduce. You should upload it to the vault…I’m almost sure many here would love to have them too. :slight_smile:

Hi ShadowM,

I tried using your scripts I copied but I can’t seem to get them to work :frowning: …wish I had scripting skills

Holy Cow…judging by the amount of views…this topic seems to interest the community…lol

Like I said it more complicated then just the script there a lot of custom appearance.2da that are needed to support it. I working on simple version right now and will post it later today on the vault. I see about the more complex version that affect actual size later. I found bug in the latest version of 13.00 that will be fixed and will come out with with version 13.25. Real life stuff is slowing this sorry.

1 Like

Sorry ShadowM,

Didn’t mean to make you feel pressured…I’m just excited you are doing this :slight_smile:

You mean a new patch for NWN:EE is coming out soon?

Should be on the front page, test it out
LINK

1 Like

See my comments under your upload…more testing to do :slight_smile: