Aller au contenu

Photo

a glacial burst spell that freezes upon failing saving throw


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
Antares

Antares
  • Members
  • 51 messages

the script freezes the creatures that get lower than 10 hit points. I'd like the spell worked like this: One saving throw

- if success: half damage, no other effect

- if fails: full damage, creature freezed.

 

I can handle the half damage part, but I cannot add the freezing effect only if the first saving throw fails.

can you? :)

 

Spoiler



#2
kevL

kevL
  • Members
  • 4 070 messages

try this

//::///////////////////////////////////////////////
//:: Burst of Glacial Wrath
//:: 'nx_s0_glacial'
//:: Copyright © 2007 Obsidian Entertainment
//:://////////////////////////////////////////////
/*
    Burst of Glacial Wrath
    Evocation Level: Sorceror/Wizard 9
    Components: V, S
    Range: Medium
    Area: Cone Shaped Burst
    Duration: See Text
    Saving Throw: Fortitude half Spell
    Resistance: Yes

    You create a burst of icy energy that flash-
    freezes any creatures within the spell's area.
    The spell deals 1d6 points of cold damager per
    caster level (maximum 25d6 points). Any living
    creature reduced to 10 hit points or lower is
    encased in ice for 1 round/ two caster levels
    (max 10 rounds). Creatures turned to ice in
    this fashion gain DR 10/fire and immunity to
    cold and electricity.

    NOTE: Numerous changes were made to this spell.
    This spell is now evocation only, rather than
    evocation/transmutation. Creatures turned to
    ice eventually thaw out. vulnurability to fire
    and hardness 10 is replaced with DR 10/fire.
    Negative hitpoints rules are ignored and reversed.
*/
//:://////////////////////////////////////////////
//:: Created By: Patrick Mills
//:: Created On: 12.14.06
//:: Modified Extensively By: Ryan Young
//:: Date: 1.25.07
//:://////////////////////////////////////////////
//:: AFW-OEI 07/10/2007: NX1 VFX
//:: Antares: use Save instead of <10hp for Freeze condition.
//:: kevL 2014 jun 8: refactored & tweaked.
//::    - use GetCurrentHitPoints() instead of bPlotImmortal
//::    - adjusted visuals a bit
//::    - use nwscript constants
//::    - integrate helper function.

//#include "nw_i0_spells"
#include "x0_i0_spells"
#include "x2_inc_spellhook"


// ___________
// ** MAIN ***
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


    object oCaster = OBJECT_SELF;
    int iCL = GetCasterLevel(oCaster);
    if (iCL > 25)
        iCL = 25;

    int iDur = iCL / 2;
    if (iDur > 10)
        iDur = 10;

    float fDur = RoundsToSeconds(iDur);
    fDur = ApplyMetamagicDurationMods(fDur);


    effect eDur = EffectVisualEffect(VFX_DUR_SPELL_GLACIAL_WRATH);

    effect eFrz = EffectPetrify();
    effect eCold = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100);
    effect eFire = EffectDamageImmunityDecrease(DAMAGE_TYPE_FIRE, 100);
    effect eElec = EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 100);
    effect eDR = EffectDamageReduction(10, 0, 0, DR_TYPE_NONE);

    eFrz = EffectLinkEffects(eFrz, eDur);
    eFrz = EffectLinkEffects(eFrz, eCold);
    eFrz = EffectLinkEffects(eFrz, eFire);
    eFrz = EffectLinkEffects(eFrz, eElec);
    eFrz = EffectLinkEffects(eFrz, eDR);


    effect eCone = EffectVisualEffect(VFX_DUR_CONE_ICE);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCone, oCaster, 3.f);

    effect eVis = EffectVisualEffect(VFX_HIT_SPELL_ICE);
    effect eDam;
    int iDam, iHP;
    float fDelay;

    location lTarget = GetSpellTargetLocation();
    object oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, RADIUS_SIZE_GINORMOUS, lTarget, FALSE);
    while (GetIsObjectValid(oTarget))
    {
        if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)
            && oTarget != oCaster)
        {
            SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_GLACIAL_WRATH));

            fDelay = GetDistanceBetween(oCaster, oTarget) / 10.f;

            if (!ResistSpell(oCaster, oTarget))
            {
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);

                iDam = d6(iCL);
                iDam = ApplyMetamagicVariableMods(iDam, 6 * iCL);

                if (MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_COLD, oCaster))
                    iDam /= 2;
                else
                    DelayCommand(fDelay + 0.1f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFrz, oTarget, fDur));

                iHP = GetCurrentHitPoints(oTarget);
                if (iDam >= iHP)
                    iDam = iHP - 1;

                eDam = EffectDamage(iDam, DAMAGE_TYPE_COLD);
                DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
            }
        }

        oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, RADIUS_SIZE_GINORMOUS, lTarget, FALSE);
    }
}

Modifié par kevL, 08 juin 2014 - 03:48 .

  • Antares aime ceci

#3
kevL

kevL
  • Members
  • 4 070 messages

ah, now I sorta see why they set the Target immortal ...

 

could change it back i guess



#4
Antares

Antares
  • Members
  • 51 messages

oh, thank you! it worked! :) :)



#5
kevL

kevL
  • Members
  • 4 070 messages

do you want it changed back to use bImmortal?

 

The uh, problem with the way it is, using CurrentHitPoints, is that if a target has any kind of cold reduction then some potential damage by the spell is wasted ... here's the uh, fixed version :)

//::///////////////////////////////////////////////
//:: Burst of Glacial Wrath
//:: 'nx_s0_glacial'
//:: Copyright © 2007 Obsidian Entertainment
//:://////////////////////////////////////////////
/*
    Burst of Glacial Wrath
    Evocation Level: Sorceror/Wizard 9
    Components: V, S
    Range: Medium
    Area: Cone Shaped Burst
    Duration: See Text
    Saving Throw: Fortitude half Spell
    Resistance: Yes

    You create a burst of icy energy that flash-
    freezes any creatures within the spell's area.
    The spell deals 1d6 points of cold damager per
    caster level (maximum 25d6 points). Any living
    creature reduced to 10 hit points or lower is
    encased in ice for 1 round/ two caster levels
    (max 10 rounds). Creatures turned to ice in
    this fashion gain DR 10/fire and immunity to
    cold and electricity.

    NOTE: Numerous changes were made to this spell.
    This spell is now evocation only, rather than
    evocation/transmutation. Creatures turned to
    ice eventually thaw out. vulnurability to fire
    and hardness 10 is replaced with DR 10/fire.
    Negative hitpoints rules are ignored and reversed.
*/
//:://////////////////////////////////////////////
//:: Created By: Patrick Mills
//:: Created On: 12.14.06
//:: Modified Extensively By: Ryan Young
//:: Date: 1.25.07
//:://////////////////////////////////////////////
//:: AFW-OEI 07/10/2007: NX1 VFX
//:: Antares: use Save instead of <10hp for Freeze condition.
//:: kevL 2014 jun 8: refactored & tweaked.
//::    - 'corrected' the meta-maximize damage value
//::    - adjusted visuals a bit so caster doesn't repeatedly do a visual cone per target
//::    - use nwscript constants

//#include "nw_i0_spells"
#include "x0_i0_spells"
#include "x2_inc_spellhook"


//
void ApplyFreeze(int iDam, effect eFrz, object oTarget, float fDur, int bSave);


// ___________
// ** MAIN ***
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


    object oCaster = OBJECT_SELF;
    int iCL = GetCasterLevel(oCaster);
    if (iCL > 25)
        iCL = 25;

    int iDur = iCL / 2;
    if (iDur > 10)
        iDur = 10;

    float fDur = RoundsToSeconds(iDur);
    fDur = ApplyMetamagicDurationMods(fDur);


    effect eDur = EffectVisualEffect(VFX_DUR_SPELL_GLACIAL_WRATH);

    effect eFrz = EffectPetrify();
    effect eCold = EffectDamageImmunityIncrease(DAMAGE_TYPE_COLD, 100);
    effect eElec = EffectDamageImmunityIncrease(DAMAGE_TYPE_ELECTRICAL, 100);
    effect eFire = EffectDamageImmunityDecrease(DAMAGE_TYPE_FIRE, 100);
    effect eDR = EffectDamageReduction(10, 0, 0, DR_TYPE_NONE);

    eFrz = EffectLinkEffects(eFrz, eDur);
    eFrz = EffectLinkEffects(eFrz, eCold);
    eFrz = EffectLinkEffects(eFrz, eElec);
    eFrz = EffectLinkEffects(eFrz, eFire);
    eFrz = EffectLinkEffects(eFrz, eDR);

    effect eCone = EffectVisualEffect(VFX_DUR_CONE_ICE);
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCone, oCaster, 3.f);

    effect eVis = EffectVisualEffect(VFX_HIT_SPELL_ICE);

    effect eDam;
    int iDam, iHP, bSave;
    float fDelay;

    location lTarget = GetSpellTargetLocation();
    object oTarget = GetFirstObjectInShape(SHAPE_SPELLCONE, RADIUS_SIZE_GINORMOUS, lTarget, FALSE);
    while (GetIsObjectValid(oTarget))
    {
        if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, oCaster)
            && oTarget != oCaster)
        {
            SignalEvent(oTarget, EventSpellCastAt(oCaster, SPELL_GLACIAL_WRATH));

            fDelay = GetDistanceBetween(oCaster, oTarget) / 10.f;

            if (!ResistSpell(oCaster, oTarget))
            {
                ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);

                iDam = d6(iCL);
                iDam = ApplyMetamagicVariableMods(iDam, 6 * iCL);

                bSave = MySavingThrow(SAVING_THROW_FORT, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_COLD, oCaster);
                if (bSave)
                    iDam /= 2;

                DelayCommand(fDelay, ApplyFreeze(iDam, eFrz, oTarget, fDur, bSave));
            }
        }

        oTarget = GetNextObjectInShape(SHAPE_SPELLCONE, RADIUS_SIZE_GINORMOUS, lTarget, FALSE);
    }
}


//
void ApplyFreeze(int iDam, effect eFrz, object oTarget, float fDur, int bSave)
{
    int bImmortal = TRUE;
    if (!GetImmortal(oTarget))
    {
        bImmortal = FALSE;
        SetImmortal(oTarget, TRUE);
    }

    effect eDam = EffectDamage(iDam, DAMAGE_TYPE_COLD);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);

    SetImmortal(oTarget, bImmortal);

    if (!bSave)
        DelayCommand(0.1f, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFrz, oTarget, fDur));
}

i guess you're kinda getting to know how to tell the difference, eh


Modifié par kevL, 08 juin 2014 - 04:57 .


#6
Antares

Antares
  • Members
  • 51 messages

thank you again, got the update.

Most of the spells are unbalanced. Too strong or too weak.

Ever tried the 6 level Bigby's Forceful Hand? I can take down almost anything, even a Balor or Kaelyn's grandfather in mask of the betrayer. Much stronger than the  9 level bigby's hand.



#7
kevL

kevL
  • Members
  • 4 070 messages

is that the -10 hit prob.?  ( if so, i changed mine to -6 or so )

 

hm, guess I'm thinking of the Interposing Hand



#8
Antares

Antares
  • Members
  • 51 messages

is that the -10 hit prob.?  ( if so, i changed mine to -6 or so )

 

hm, guess I'm thinking of the Interposing Hand

 

the forceful hand: This spell will daze and knock down the target at the same time. If they are immune to one of the effects, the other one still takes place

Caster Roll: 1d20 + 14
Defender Roll: 1d20 + Strength Modifier + Size Modifier


#9
kevL

kevL
  • Members
  • 4 070 messages

huh.. I took a look, but it'd take a bit of time to make a fair judgment call

looks like "nTargetRoll" plus or minus is easily adaptable tho.