thanks everyone
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.
//::
//:: 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.