Modified Bigby's

Forum for scripters of NWN material and third party applications.
Post Reply
hermyt
World Leader - LoT: Moonsea
Posts: 65
Joined: Fri Nov 21, 2003 9:41 pm
Contact:

Modified Bigby's

Post by hermyt »

Hmm, I noticed that bigby's equations are a bit muffed up from what they're supposed to be in pnp, mostly for grapple purposes, the bullrush equations seem to be all right, but the forceful hand is just supposed to do bullrushing every round, so I've done some code rewriting, both to fix the severly messed bioware equations for grapple, and to take into account that grapple from the hand is a round by round event as is the bullrush of the forceful hand. I've also added a few lines for constants for the expanded size modifier list thats in the CEP for colossal and gargantuan creatures.

On Orls request I'm posting these, they haven't been thoroughly bugtested, but the modifications aren't too big, regardless I'm posting them if someone wants to give them a try feel free.

Code: Select all

//::///////////////////////////////////////////////
//:: Bigby's Forceful Hand
//:: [x0_s0_bigby2]
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
    dazed vs strength check (+14 on strength check); Target knocked down.
    Target dazed down for 1 round per level of caster

*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: September 7, 2002
//:://////////////////////////////////////////////
//:: Last Updated By: Andrew Nobbs May 01, 2003

#include "x0_i0_spells"
#include "x2_i0_spells"
#include "x2_inc_spellhook"
int nSpellID = 460;
void BullRushCheck(object oTarget, object oCaster)
{
    //--------------------------------------------------------------------------
    // Check if the spell has expired (check also removes effects)
    //--------------------------------------------------------------------------
    if (GZGetDelayedSpellEffectsExpired(nSpellID,oTarget,oCaster))
    {
        return;
    }

    int nDuration = 1;
    int nCasterModifier = GetCasterAbilityModifier(OBJECT_SELF);
    int nCasterRoll;
    int nTargetRoll;
    nCasterRoll = d20(1) + 14;
    nTargetRoll = d20(1) + GetSizeModifier(oTarget) + GetAbilityModifier(ABILITY_STRENGTH);
    if (nCasterRoll >= nTargetRoll)
    {
        // Hold the target paralyzed

        effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
        effect eKnockdown = EffectDazed();
        effect eKnockdown2 = EffectKnockdown();
        effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
        //Link effects
        effect eLink = EffectLinkEffects(eKnockdown, eDur);
        eLink = EffectLinkEffects(eLink, eKnockdown2);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, oTarget, RoundsToSeconds(nDuration));
        // * Bull Rush succesful
        FloatingTextStrRefOnCreature(8966,OBJECT_SELF, FALSE);
    }
    else
    {
        FloatingTextStrRefOnCreature(8967,OBJECT_SELF, FALSE);
    }
    DelayCommand(6.0, BullRushCheck(oTarget, oCaster));
}
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())
    {
    // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        return;
    }

// End of Spell Cast Hook


    //Declare major variables
    object oTarget = GetSpellTargetObject();
    int nDuration = GetCasterLevel(OBJECT_SELF);
    int nMetaMagic = GetMetaMagicFeat();
    //Check for metamagic extend
    if (nMetaMagic == METAMAGIC_EXTEND) //Duration is +100%
    {
         nDuration = nDuration * 2;
    }
    if(!GetIsReactionTypeFriendly(oTarget))
    {
        // Apply the impact effect
        effect eImpact = EffectVisualEffect(VFX_IMP_BIGBYS_FORCEFUL_HAND);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget);
        //Fire cast spell at event for the specified target
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 460, TRUE));
        if(!MyResistSpell(OBJECT_SELF, oTarget))
        {
            effect eHand = EffectVisualEffect(VFX_DUR_BIGBYS_CRUSHING_HAND);
            ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eHand, oTarget, RoundsToSeconds(nDuration));
            BullRushCheck(oTarget, OBJECT_SELF);
        }
    }
}

Code: Select all

//::///////////////////////////////////////////////
//:: Bigby's Grasping Hand
//:: [x0_s0_bigby3]
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
    make an attack roll. If succesful target is held for 1 round/level


*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: September 7, 2002
//:://////////////////////////////////////////////
//:: VFX Pass By:

#include "x0_i0_spells"
#include "x2_i0_spells"
#include "x2_inc_spellhook"
int nSpellID = 461;
void GrappleCheck(object oTarget, object oCaster)
{
    //--------------------------------------------------------------------------
    // Check if the spell has expired (check also removes effects)
    //--------------------------------------------------------------------------
    if (GZGetDelayedSpellEffectsExpired(nSpellID,oTarget,oCaster))
    {
        return;
    }

    int nDuration = 1;
    int nCasterModifier = GetCasterAbilityModifier(OBJECT_SELF);
    int nCasterRoll;
    int nTargetRoll;
    nCasterRoll = d20(1) + nCasterModifier
                    + GetCasterLevel(OBJECT_SELF) + 10 + 4;
    nTargetRoll = d20(1) + GetSizeModifier(oTarget) + GetBaseAttackBonus(oTarget)
                    + GetAbilityModifier(ABILITY_STRENGTH);
    if (nCasterRoll >= nTargetRoll)
    {
        // Hold the target paralyzed
        effect eKnockdown = EffectParalyze();
        if (GetIsImmune(oTarget, EFFECT_TYPE_PARALYZE))
        {
            eKnockdown = EffectCutsceneImmobilize();
        }
        effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);
        effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
        effect eLink = EffectLinkEffects(eKnockdown, eDur);
        eLink = EffectLinkEffects(eVis, eLink);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
                            eLink, oTarget,
                            RoundsToSeconds(nDuration));
        FloatingTextStrRefOnCreature(2478, OBJECT_SELF);
    }
    else
    {
        FloatingTextStrRefOnCreature(83309, OBJECT_SELF);
    }
    DelayCommand(6.0, GrappleCheck(oTarget, oCaster));
}

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())
    {
    // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        return;
    }

// End of Spell Cast Hook


    //Declare major variables
    object oTarget = GetSpellTargetObject();
    int nDuration = GetCasterLevel(OBJECT_SELF);
    int nMetaMagic = GetMetaMagicFeat();
    effect eVis = EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED);

    //Check for metamagic extend
    if (nMetaMagic == METAMAGIC_EXTEND) //Duration is +100%
    {
         nDuration = nDuration * 2;
    }

    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //Fire cast spell at event for the specified target
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 461, TRUE));

        // Check spell resistance
        if(!MyResistSpell(OBJECT_SELF, oTarget))
        {
            // Check caster ability vs. target's AC

            int nCasterModifier = GetCasterAbilityModifier(OBJECT_SELF);
            int nCasterRoll = d20(1)
                + nCasterModifier
                + GetCasterLevel(OBJECT_SELF) + 10 + -1;

            int nTargetRoll = GetAC(oTarget);

            // * grapple HIT succesful,
            if (nCasterRoll >= nTargetRoll)
            {
                effect eHand = EffectVisualEffect(VFX_DUR_BIGBYS_GRASPING_HAND);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
                                            eHand, oTarget,
                                            RoundsToSeconds(nDuration));
                GrappleCheck(oTarget, OBJECT_SELF);/*
                // * now must make a GRAPPLE check to
                // * hold target for duration of spell
                // * check caster ability vs. target's size & strength
                nCasterRoll = d20(1) + nCasterModifier
                    + GetCasterLevel(OBJECT_SELF) + 10 +4;

                nTargetRoll = d20(1) + GetSizeModifier(oTarget)
                    + GetAbilityModifier(ABILITY_STRENGTH);

                if (nCasterRoll >= nTargetRoll)
                {
                    // Hold the target paralyzed
                    effect eKnockdown = EffectParalyze();
                    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
                    effect eHand = EffectVisualEffect(VFX_DUR_BIGBYS_GRASPING_HAND);
                    effect eLink = EffectLinkEffects(eKnockdown, eDur);
                    eLink = EffectLinkEffects(eHand, eLink);
                    eLink = EffectLinkEffects(eVis, eLink);
                    if (GetIsImmune(oTarget, EFFECT_TYPE_PARALYZE) == FALSE)
                    {
                        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
                                            eLink, oTarget,
                                            RoundsToSeconds(nDuration));

    //                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
    //                                        eVis, oTarget,RoundsToSeconds(nDuration));
                        FloatingTextStrRefOnCreature(2478, OBJECT_SELF);
                    }
                }
                else
                {
                    FloatingTextStrRefOnCreature(83309, OBJECT_SELF);
                }*/
            }
        }
    }
}

Code: Select all

//::///////////////////////////////////////////////
//:: Bigby's Crushing Hand
//:: [x0_s0_bigby5]
//:: Copyright (c) 2002 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Similar to Bigby's Grasping Hand.
    If Grapple succesful then will hold the opponent and do 2d6 + 12 points
    of damage EACH round for 1 round/level


   // Mark B's famous advice:
   // Note:  if the target is dead during one of these second-long heartbeats,
   // the DelayCommand doesn't get run again, and the whole package goes away.
   // Do NOT attempt to put more than two parameters on the delay command.  They
   // may all end up on the stack, and that's all bad.  60 x 2 = 120.

*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: September 7, 2002
//:://////////////////////////////////////////////
//:: VFX Pass By:

#include "x0_i0_spells"
#include "x2_inc_spellhook"
#include "x2_i0_spells"

int nSpellID = 463;
void RunHandImpact(object oTarget, object oCaster)
{

    //--------------------------------------------------------------------------
    // Check if the spell has expired (check also removes effects)
    //--------------------------------------------------------------------------
    if (GZGetDelayedSpellEffectsExpired(nSpellID,oTarget,oCaster))
    {
        return;
    }

    int nDam = MaximizeOrEmpower(6,2,GetMetaMagicFeat(), 12);
    effect eDam = EffectDamage(nDam, DAMAGE_TYPE_BLUDGEONING);
    effect eVis = EffectVisualEffect(VFX_IMP_ACID_L);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
    DelayCommand(6.0f,RunHandImpact(oTarget,oCaster));
}

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())
    {
        // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        return;
    }
    // End of Spell Cast Hook

    object oTarget = GetSpellTargetObject();

    //--------------------------------------------------------------------------
    // This spell no longer stacks. If there is one hand, that's enough
    //--------------------------------------------------------------------------
    if (GetHasSpellEffect(nSpellID,oTarget) ||  GetHasSpellEffect(462,oTarget)  )
    {
        FloatingTextStrRefOnCreature(100775,OBJECT_SELF,FALSE);
        return;
    }

    int nDuration = GetCasterLevel(OBJECT_SELF);
    int nMetaMagic = GetMetaMagicFeat();

    //Check for metamagic extend
    if (nMetaMagic == METAMAGIC_EXTEND) //Duration is +100%
    {
         nDuration = nDuration * 2;
    }

    if(!GetIsReactionTypeFriendly(oTarget))
    {
        //Fire cast spell at event for the specified target
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_BIGBYS_CRUSHING_HAND, TRUE));

        //SR
        if(!MyResistSpell(OBJECT_SELF, oTarget))
        {
            int nCasterModifier = GetCasterAbilityModifier(OBJECT_SELF);
            int nCasterRoll = d20(1)
                + nCasterModifier
                + GetCasterLevel(OBJECT_SELF) + 12 + -1;
            int nTargetRoll = GetAC(oTarget);

            // * grapple HIT succesful,
            if (nCasterRoll >= nTargetRoll)
            {
                // * now must make a GRAPPLE check
                // * hold target for duration of spell

                nCasterRoll = d20(1) + nCasterModifier
                    + GetCasterLevel(OBJECT_SELF) + 12 + 4;

                nTargetRoll = /*NEED GetBaseAttackBonus*/
                    d20(1) + GetBaseAttackBonus(oTarget) + GetSizeModifier(oTarget)
                    + GetAbilityModifier(ABILITY_STRENGTH);

                if (nCasterRoll >= nTargetRoll)
                {
                    effect eKnockdown = EffectParalyze();

                    // creatures immune to paralzation are still prevented from moving
                    if (GetIsImmune(oTarget, EFFECT_TYPE_PARALYZE))
                    {
                        eKnockdown = EffectCutsceneImmobilize();
                    }

                    effect eHand = EffectVisualEffect(VFX_DUR_BIGBYS_CRUSHING_HAND);
                    effect eLink = EffectLinkEffects(eKnockdown, eHand);
                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY,
                                        eLink, oTarget,
                                        RoundsToSeconds(nDuration));

                    object oSelf = OBJECT_SELF;
                    RunHandImpact(oTarget, oSelf);
                    FloatingTextStrRefOnCreature(2478, OBJECT_SELF);

                }
                else
                {
                    FloatingTextStrRefOnCreature(83309, OBJECT_SELF);
                }
            }
        }
    }
}


in x0_i0_spells

Code: Select all

int GetSizeModifier(object oCreature)
{
    int nSize = GetCreatureSize(oCreature);
    int nModifier = 0;
    switch (nSize)
    {
    case CREATURE_SIZE_TINY: nModifier = -8;  break;
    case CREATURE_SIZE_SMALL: nModifier = -4; break;
    case CREATURE_SIZE_MEDIUM: nModifier = 0; break;
    case CREATURE_SIZE_LARGE: nModifier = 4;  break;
    case CREATURE_SIZE_HUGE: nModifier = 8;   break;
    case 20: nModifier = -16; break; //fine
    case 21: nModifier = -12; break; //diminutive
    case 22: nModifier = 12; break; //gargantuan
    case 23: nModifier = 16; break; //colossal
    }
    return nModifier;
}
The primary changes in this code are the rolls for the target, bioware's default wasn't giving the target creature his d20 roll as per grappling rules (pg 137 of 3e phb) and the size modifiers have been adjusted in the x0_i0_spells as well to take into account larger or smaller creatures bonuses. In some cases (grasping hand I believe) the target creature was not even receiving his attack bonus for his grapple roll, that and his d20 roll were giving bigby's spell a massive advantage.

As it is intended now it should last for the duration of the spell but be required to do grapple rolls vs the opponent on a round by round basis, this idea was swiped from the crushing hand code which was doing just that for stun purposes.

Hopefully these changes will institute a bit more balance to the spells, as having massive ancient dragons laid out by a bigby's seemed to be a bit odd for me and spurred me to check the equations for the code. Also checks have been instituted in each spell to test for paralysis immunity and to apply cutscene immobilize, this was instituted in crushing hand I believe but not in the grasping, immunity to paralysis should have no effect on a physical grappling situation, so that has been instituted as well.

HerMyT[/code]
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

Two questions:

1.) The grasping code had a code block commented out. It seemed obvious this was because you had moved the code to a function. I was just wondering if there was a reason you had kept the code around instead of deleting it.

2.)

Code: Select all

case 20: nModifier = -16; break; //fine 
    case 21: nModifier = -12; break; //diminutive 
    case 22: nModifier = 12; break; //gargantuan 
    case 23: nModifier = 16; break; //colossal 
I went ahead and made these const ints called CREATURE_SIZE_*. I was just wondering how you derived 20-23 as the correct numbers for these cases.

Thanks,
Doug :)
hermyt
World Leader - LoT: Moonsea
Posts: 65
Joined: Fri Nov 21, 2003 9:41 pm
Contact:

Post by hermyt »

Oftentimes when I'm modifying core code I'll leave the old code in there commented out in case I need it, or just for people to see what was changed, so no not any specific reason.

The constants are defined in nwscript I believe and without a modified version those constants do not exist, that is the generic constants file for all constants in nwn, however those other size categories do not exist in default nwn, they're added in by creaturesize.2da (I think it is) and because of that constant references won't identify them properly so those numbers are the appropriate number references to the proper 2da lines.

Also, I should post updated version of that code, I found a few bugs in it over the course of time having to do with stun effects and slightly too long of delays for bull rushing effects and the like, so while I've updated and fixed the versions that I use those posted ones will still suffer some of the same problems, when I have access to my system again I'll post updated versions.

HerMyT
dougnoel
Groundling
Posts: 86
Joined: Sat Jul 17, 2004 11:39 pm
Location: VA

Post by dougnoel »

I've held off on this for Avlis because 1.64 is supposed to include some fixes for Bigby's. Do you know of anything that they didn't fix?
Khaelindra
Groundling
Posts: 94
Joined: Wed Jan 21, 2004 5:48 am
Location: Deventer, the Netherlands

Post by Khaelindra »

dougnoel wrote:I've held off on this for Avlis because 1.64 is supposed to include some fixes for Bigby's. Do you know of anything that they didn't fix?
They didn't fix the level 6 spell.
Arandil
Noobie
Posts: 7
Joined: Fri Jun 18, 2004 9:55 am

Post by Arandil »

Whats the feedback been on Hala on the modified 6th level spell? Is it still useful without being unbalancing?

Arandil
Khaelindra
Groundling
Posts: 94
Joined: Wed Jan 21, 2004 5:48 am
Location: Deventer, the Netherlands

Post by Khaelindra »

Arandil wrote:Whats the feedback been on Hala on the modified 6th level spell? Is it still useful without being unbalancing?

Arandil
Yes, and yes. :)
Post Reply