AgonyAunt / Sigil-City-of-Doors-PW

2 stars 4 forks source link

Improve Curse of Despair & Dread Seizure #377

Closed spbrockmann closed 6 years ago

spbrockmann commented 6 years ago

These are underwhelming...

Their current results (live now) : http://nwn2.wikia.com/wiki/Curse_of_Despair & http://nwn2.wikia.com/wiki/Dread_Seizure

spbrockmann commented 6 years ago

Try 5 for Curse of Despair.

//:: Warlock Lesser Invocation: Curse of Despair
//:: nw_s0_icursedes.nss
//:: Copyright (c) 2005 Obsidian Entertainment Inc.
//::////////////////////////////////////////////////
//:: Created By: Brock Heinz
//:: Created On: 08/12/05
//::////////////////////////////////////////////////
/*
        5.7.2.4 Curse of Despair
        Complete Arcane, pg. 132
        Spell Level:    4
        Class:      Misc

        This is the equivalent to the Bestow Curse spell (4th level wizard). 
        But even if the target makes their save, 
        they still suffer a -1 penalty to hit for 10 rounds.

*/
// RPGplayer1 02/04/2009: Made SpellCastAt event pass proper caster, so that caster drops invisibility as he should
/*
rapsam2003 03/16/2018: Remove save against NPCs
    and Hexer feats reduce the AC of the target.
*/

#include "NW_I0_SPELLS"    
#include "x2_inc_spellhook" 
#include "srcalc"

void main()
{
    if (!X2PreSpellCastCode())
    {
        // If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
        return;
    }

    int nMod = 3; // Default mod is 3, a successful save reduces it to 1 
    object oCaster = OBJECT_SELF;
    object oTarget = GetSpellTargetObject();
    effect eCurse;
    effect eACReduce;
    int nACDebuff = 0;
    int nRoundsLeft = 9; // rapsam2003: Used to track numbers of rounds to have Eldritch Blast dice increased by 1d6

    // rapsam2003: For Curse of Despair, these feats
    // reduce the AC of the enemy.
    if (GetHasFeat(2901, OBJECT_SELF))
        nACDebuff = 3;
    else if (GetHasFeat(2900, OBJECT_SELF))
        nACDebuff = 2;
    else if (GetHasFeat(2908, OBJECT_SELF))
        nACDebuff = 1;

    if (GetHasFeat(2907, OBJECT_SELF)) 
        nMod = 5;
    else if (GetHasFeat(2902, OBJECT_SELF)) 
        nMod = 4;

    float fDuration = 0.0f;
    int nDurType = DURATION_TYPE_PERMANENT;

    if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
    {
        //Signal spell cast at event
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_BESTOW_CURSE));

         //Make SR Check
         if (!DoWarlockMyResistSpell(OBJECT_SELF, oTarget) || GetHasFeat(2907, OBJECT_SELF))
         {          
            // rapsam2003: No save if target is not PC
            if (GetIsPC(oTarget) && MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC()))
            {
                nMod = 1;
                eCurse  =   EffectAttackDecrease(nMod);
                fDuration = RoundsToSeconds(10);
                nDurType = DURATION_TYPE_TEMPORARY;
            }           
            else
            {
                eCurse = EffectCurse(nMod, nMod, nMod, nMod, nMod, nMod);

                if (nACDebuff > 0)
                {
                    eACReduce = EffectACDecrease(nACDebuff);
                    eCurse =    EffectLinkEffects(eACReduce, eCurse);
                }
            }

            effect eVis     = EffectVisualEffect(VFX_HIT_SPELL_NECROMANCY);
            //Make sure that curse is of type supernatural not magical
            eCurse = SupernaturalEffect(eCurse);

            //Apply Effect and VFX
            ApplyEffectToObject(nDurType, eCurse, oTarget, fDuration);
            ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
            SendMessageToPC(oCaster, "The curse causes the affected enemy's armor to be slightly less effective."); 
        }
    }
}
spbrockmann commented 6 years ago

See http://s13.zetaboards.com/nwn2planescape/topic/9129250/1/#new for reference to possible theme shift, as a consequence of this change.

spbrockmann commented 6 years ago

Try 3 for Dread Seizure.

//::///////////////////////////////////////////////
//:: Dread Seizure
//:: nx_s0_dreadseizure.nss
//:: Copyright (c) 2007 Obsidian Entertainment
//:://////////////////////////////////////////////
/*
    Dread Seizure
    Lesser, 4th

    You speak a word that sends wracking pain through
    the limbs of a single target creature within
    60ft.  Though these seizures are not powerful
    enough to immobilize the creature, they do
    reduce its movement speed by 30%.  The target
    also takes a -3 penalty to all attacks it makes.
    These effects last for 3 rounds; a successful 
    Fortitude save negates the effects.
*/
//:://////////////////////////////////////////////
//:: Created By: Ryan Young
//:: Created On: 1.22.2007
//:://////////////////////////////////////////////
/*
rapsam2003 03/16/2018: Remove save against NPCs
    and Hexer feats increase the miss chance 
    of the target.
*/

#include "nw_i0_spells"
#include "x2_inc_spellhook" 
#include "nwn2_inc_metmag"

void main()
{
    /*
      Spellcast Hook Code
      Added 2003-07-07 by Georg Zoeller
      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

    effect eMissChance;
    object      oCaster         =   OBJECT_SELF;
    int         nMod                =   3;

    if (GetHasFeat(2907, oCaster)) 
        nMod = 5;
    else if (GetHasFeat(2903, oCaster)) 
        nMod = 4;

    object      oTarget         =   GetSpellTargetObject();
    effect      eAttackPenalty  =   EffectAttackDecrease(nMod);
    effect      eMovePenalty    =   EffectMovementSpeedDecrease(nMod*10);
    effect      eLink           =   EffectLinkEffects(eAttackPenalty, eMovePenalty);
    float       fDuration       =   RoundsToSeconds(nMod);
    int nMissChance = 0;

    //metamagic
    fDuration   =   ApplyMetamagicDurationMods(fDuration);

    // rapsam2003: For Dread Seizure, these feats
    // increase the miss chance.
    if (GetHasFeat(2901, oCaster))
        nMissChance = 15;
    else if (GetHasFeat(2900, oCaster))
        nMissChance = 10;
    else if (GetHasFeat(2908, oCaster))
        nMissChance = 5;

    if (nMissChance > 0)
    {
        eMissChance = EffectMissChance(nMissChance);
        eLink = EffectLinkEffects(eMissChance, eLink);
    }   

    if (GetIsObjectValid(oTarget))
    {
        if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster))
        {   
            if (GetIsPC(oTarget) && !MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC() /*+ nDCBonus*/))
            {
                SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration);
            }
        }
    }
}
spbrockmann commented 6 years ago

Try 2 for Baleful Geas.

//:://////////////////////////////////////////////
/*
   Baleful Geas - Dragon Magic
   scod_s_balefulgeas.nss
*/
//:://////////////////////////////////////////////
//:: Created By: Xndar
//:: Created On: July 1st, 2014
//:://////////////////////////////////////////////
/*
rapsam2003 03/26/2018: Remove save against NPCs and
    Hexer feats increase the strength of the target.
    Without Hexer feats, strength is decreased as
    normal.
*/

#include "x0_I0_SPELLS"    
#include "x2_inc_spellhook" 
#include "srcalc"

void main()
{

/* 
  Spellcast Hook Code 
  Added 2003-06-23 by GeorgZ
  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
    effect eDmgDecrease;
    object oCaster = OBJECT_SELF;
    object oTarget = GetSpellTargetObject();
    effect eGeas = EffectDominated();
    eGeas = GetScaledEffect(eGeas, oTarget);
    effect eDur = EffectVisualEffect(VFX_HIT_SPELL_INFLICT_6);
    effect eAdjust;
    int nStrAdjust = 0;

    //Link domination and persistant VFX
    effect eLink = EffectLinkEffects(eDur, eGeas);
    int nMetaMagic = GetMetaMagicFeat();
    int nCasterLevel = GetCasterLevel(OBJECT_SELF);
    int nDuration = 3 + nCasterLevel/2;

    // rapsam2003: By default, decrease the strength of the NPC.
    if (GetHasFeat(2907, OBJECT_SELF)) {
        nStrAdjust -= d4(3);
        nDuration = 3 + (nCasterLevel*2);
    }
    else if (GetHasFeat(2904, OBJECT_SELF)) {
        nStrAdjust -= d4(3);
        nDuration = 3 + nCasterLevel;
    }

    // rapsam2003: Hexer feats increase the strength of the NPC.
    if (GetHasFeat(2901, OBJECT_SELF))
    {
        nStrAdjust += d4(2);
    }
    else if (GetHasFeat(2900, OBJECT_SELF))
    {
        nStrAdjust += d4(1);
    }
    else if (GetHasFeat(2899, OBJECT_SELF))
    {
        nStrAdjust += 2;
    }

    if (nStrAdjust > 0)
        eAdjust = EffectAbilityIncrease(ABILITY_STRENGTH, nStrAdjust);
    else if (nStrAdjust < 0)
    {
        nStrAdjust = abs(nStrAdjust);
        eAdjust = EffectAbilityDecrease(ABILITY_STRENGTH, nStrAdjust);
    }

    nDuration = GetScaledDuration(nDuration, oTarget);
    //Fire cast spell at event for the specified target
    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 1374, FALSE));
    //Make sure the target is a monster
    if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
    {
        //Make SR Check
        if (GetHasFeat(2907, OBJECT_SELF) || !DoWarlockMyResistSpell(OBJECT_SELF, oTarget))
        {
            //Make a Will Save
            if (GetIsPC(oTarget) && !MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_MIND_SPELLS))
            {                    
                ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAdjust, oTarget);
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration));
                SendMessageToPC(oCaster, "The curse causes the dominated enemy to become stronger.");
            }
        }
    }
}
spbrockmann commented 6 years ago

Dropbox URL: https://www.dropbox.com/sh/e8peggsotzyi9cu/AACgNTPB17xDrPe-8P1ITs1pa?dl=0

spbrockmann commented 6 years ago

Try 2 for Baleful Polymorph

//:://////////////////////////////////////////////
/*
   Baleful Polymorph - Warlock Spell
   scod_s_balefulpoly.NSS
*/
//:://////////////////////////////////////////////
//:: Created By: Mimi Fearthegn
//:: Created On: Februrary 2nd, 2015
//:://////////////////////////////////////////////
/*
rapsam2003 03/26/2018: Remove save against NPCs and
    Hexer feats decrease the damage of the target.
*/

#include "x0_I0_SPELLS"    
#include "x2_inc_spellhook" 
#include "srcalc"

void main()
{

/* 
  Spellcast Hook Code 
  Added 2003-06-23 by GeorgZ
  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;
    }

    //Declare major variables
    int nSpell = GetSpellId();

    // constrain to allowed values
    if(nSpell<1680 || nSpell>1685)
        nSpell=1680 + Random(5); // set default as random (instead of cow)

    object oCaster = OBJECT_SELF;
    object oTarget = GetSpellTargetObject();
    effect eVis = EffectVisualEffect( VFX_DUR_POLYMORPH );
    effect ePoly;
    int nPoly = POLYMORPH_TYPE_CHICKEN;
    int nMetaMagic = GetMetaMagicFeat();
    effect  eCurse;
    int nMod = 3;
    int nDmgDecrease = 0;
    effect eDmgDecrease;
    effect eDmgDecreaseLink;
    effect eCurseLink;

    // rapsam2003: For Baleful Polymorph, these feats
    // decrease the damage of the NPC.
    if (GetHasFeat(2901, OBJECT_SELF))
        nDmgDecrease = 6;
    else if (GetHasFeat(2900, OBJECT_SELF))
        nDmgDecrease = 4;
    else if (GetHasFeat(2908, OBJECT_SELF))
        nDmgDecrease = 2;

    eDmgDecrease = EffectDamageDecrease(nDmgDecrease, DAMAGE_TYPE_SLASHING);
    eDmgDecreaseLink = EffectLinkEffects(eDmgDecrease, EffectDamageDecrease(nDmgDecrease, DAMAGE_TYPE_PIERCING));
    eDmgDecreaseLink = EffectLinkEffects(eDmgDecreaseLink, EffectDamageDecrease(nDmgDecrease, DAMAGE_TYPE_BLUDGEONING));

    int nDuration = PS_GetCasterLevel(OBJECT_SELF);
    //Enter Metamagic conditions
    if (nMetaMagic == METAMAGIC_EXTEND)
    {
        nDuration = nDuration *2; //Duration is +100%
    }

    //Determine Polymorph subradial type
    if(nSpell == 1681)
    {
        nPoly = 168; //Pig
    }
    else if (nSpell == 1682)
    {
        nPoly = 40; //Chicken
    }
    else if (nSpell == 1683)
    {
        nPoly = 177; //Weasel
    }
    else if (nSpell == 1684)
    {
        nPoly = 403; //Rabbit
    }
    else if (nSpell == 1685)
    {
        nPoly = 171; //Bat
    }
    ePoly = EffectPolymorph(nPoly);
    ePoly = EffectLinkEffects(ePoly, eVis);

    if (GetHasFeat(2907, OBJECT_SELF))
        nMod = 4;
    if (GetHasFeat(2905, OBJECT_SELF))
        nDuration = nDuration*2;
    eCurse = EffectCurse(0, 0, 0, nMod, nMod, nMod);

    eCurseLink = EffectLinkEffects(eCurse, eDmgDecreaseLink);

    //Fire cast spell at event for the specified target
    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, 1680, TRUE));

    //Apply the VFX impact and effects
    AssignCommand(oTarget, ClearAllActions()); // Prevents an exploit
    if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
    {
        // Make SR Check
        if (GetHasFeat(2907, OBJECT_SELF) || !DoWarlockMyResistSpell(OBJECT_SELF, oTarget))
        {
            // Make a Fort Save
            if (GetIsPC(oTarget) && !MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC()))
            {
                    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, ePoly, oTarget, TurnsToSeconds(nDuration));
                    // Make a Will Save
                    if (GetHasFeat(2905, OBJECT_SELF) || 
                        (GetIsPC(oTarget) && 
                        !MySavingThrow(SAVING_THROW_WILL, oTarget, GetSpellSaveDC()))) 
                    {
                        eCurse = SupernaturalEffect(eCurseLink);
                        ApplyEffectToObject(1, eCurseLink, oTarget, TurnsToSeconds(nDuration));
                        SendMessageToPC(oCaster, "The curse causes the affected enemy to be less effective in melee.");
                    }
            }
        }
    }
}
spbrockmann commented 6 years ago

Changes made: http://s13.zetaboards.com/nwn2planescape/single/?p=10043854&t=9129250