Player Resource Consortium

 

Author Topic: Calculate nonability monster stat  (Read 12649 times)

0 Members and 1 Guest are viewing this topic.

August 08, 2011, 06:02:53 AM
Reply #15

to allow the toolset more choice in the "item properties" tab (adding other numerical values to the standard ones), one has only to edit the .2da that corresponds to those values or there is a script to be changed as well?

I don't think the engine will use it unless it's an integer.
HEATSTROKE


August 08, 2011, 03:54:00 PM
Reply #16
  • Sr. Associate
  • ****
  • Posts: 271
  • Karma: +0/-0
  • Gender: Male
    • View Profile

so it's not possible to make, like, +10 damage reduction?
My first PrC+Q module (and 1st mod ever): Revamped OC

http://neverwinter.nexusmods.com/mods/163


August 10, 2011, 06:34:55 AM
Reply #17
  • Sr. Associate
  • ****
  • Posts: 271
  • Karma: +0/-0
  • Gender: Male
    • View Profile

thanks everyone :D

I cannot understand how to make a successful hit deal a certain number of ability damage rather than hit point damage. the key is understanding onhit ability drain, I guess, but I can only choose save DC, not actual quantity.
My first PrC+Q module (and 1st mod ever): Revamped OC

http://neverwinter.nexusmods.com/mods/163


August 10, 2011, 05:22:02 PM
Reply #18

so it's not possible to make, like, +10 damage reduction?

Yes it is, but the 2DA should already have that value.
HEATSTROKE


August 10, 2011, 05:36:39 PM
Reply #19

thanks everyone :D

I cannot understand how to make a successful hit deal a certain number of ability damage rather than hit point damage. the key is understanding onhit ability drain, I guess, but I can only choose save DC, not actual quantity.

You have to make the entire special attack scripted thru the OnHit Cast Spell Unique ability.  Here is how I did it for my PW.

1.) Make the creature slam item.  Give it the appropriate Monster Damage, a +1 to hit (from the incorporeal DR) & On Hit Cast Spell: Unique Power (OnHit)

2.) Give it a tag.  Something like DR_WRAITH_TOUCH.  Has to be 16 characters or less for this to work.

3.) Copy this script & save it as dr_wraith_touch.nss.  This *has* to be the same as whatever you used for your item's tag. 

Code: [Select]
//::
//:: A pnp version of the Dread Wraith's CON draining touch.
//::
//:: Modified by: DM Heatstroke 01-04-11
//::

#include "NW_I0_SPELLS"
#include "nw_i0_plot"

//:: Setup CON Damage
void DoConDamage(object oTarget, object oCaster)
{  effect eVis = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);
    int nDam = d8();
    effect eCon = EffectAbilityDecrease(ABILITY_CONSTITUTION, nDam);
    eCon = ExtraordinaryEffect(eCon);

    //:: Setup oCaster's healing
    effect eDrain = EffectTemporaryHitpoints(5);
    eDrain = ExtraordinaryEffect(eDrain);
    effect eDrainVis = EffectVisualEffect(VFX_IMP_HEALING_L);

    //:: Will stat loss kill them?
    int bKillEm = FALSE;
    if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES
        || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT )
        bKillEm = TRUE;

    //:: Get the save DC for oCaster's special attack
    int nCreCHAMod = GetAbilityModifier(ABILITY_CHARISMA, oCaster);
    int nCreHD = GetHitDice (oCaster);
    int nTouchDC = (10 + (nCreHD/2) + nCreCHAMod);

    //:: Roll a save
    if ( !MySavingThrow(SAVING_THROW_FORT, oTarget, nTouchDC, SAVING_THROW_TYPE_NONE, oCaster) )
    {   //:: If they fail the save & they have less than a 3 CON, kill them
        int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION);
        if ( ( nCon - nDam ) < 3 && bPNPStats )
        {

            effect eVis3 = EffectVisualEffect(VFX_IMP_DEATH);
            effect eHP2 = EffectDamage( 9999, DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY);
            effect eDeath2 = EffectDeath();
            ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis3,oTarget);   //:: Apply VFX
            ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath2,oTarget); //:: Kill Em
            ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP2,oTarget);    //:: Make sure they are dead!

        }
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);            //:: Apply VFX
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eCon, oTarget, 8640.0);  //:: 24 "Athas Reborn" hours -DMH
        ApplyEffectToObject(DURATION_TYPE_PERMANENT, eDrain, oCaster);        //:: Heal up
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eDrainVis, oCaster);       //:: Apply moar VFX
    }
}

void main()
{
    object oTarget = GetSpellTargetObject();
    object oCaster = OBJECT_SELF;

    if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) )
    {
        SendMessageToPC(oTarget,"Immune to ability drain.");
        return;
    }

    DelayCommand(0.1,DoConDamage(oTarget,oCaster));

}

4.) Compile the script.  Test out your creature.
« Last Edit: August 10, 2011, 07:02:00 PM by DM Heatstroke »
HEATSTROKE


August 11, 2011, 03:56:05 AM
Reply #20
  • Sr. Associate
  • ****
  • Posts: 271
  • Karma: +0/-0
  • Gender: Male
    • View Profile

thanks DM: this can be used for any stat?

wait, what do I have to give a name to?
My first PrC+Q module (and 1st mod ever): Revamped OC

http://neverwinter.nexusmods.com/mods/163


August 11, 2011, 06:00:29 AM
Reply #21

thanks DM: this can be used for any stat?

Yes, with some modification.

wait, what do I have to give a name to?

The item's tag & the script's filename have to be the same.
« Last Edit: August 11, 2011, 07:32:34 AM by DM Heatstroke »
HEATSTROKE


August 11, 2011, 08:32:26 AM
Reply #22
  • Sr. Associate
  • ****
  • Posts: 271
  • Karma: +0/-0
  • Gender: Male
    • View Profile

I figured that out after a bit, sorry :D and thanks again!
modification, of course, all CON references must change to like STR, WIS etc. with your script one can kill also with strength damage?
My first PrC+Q module (and 1st mod ever): Revamped OC

http://neverwinter.nexusmods.com/mods/163


August 11, 2011, 09:11:00 AM
Reply #23

I figured that out after a bit, sorry :D and thanks again!
modification, of course, all CON references must change to like STR, WIS etc. with your script one can kill also with strength damage?

That is the idea, yes.
HEATSTROKE