Author Topic: BlankSave functions Help  (Read 323 times)

Legacy_modtyrant

  • Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
BlankSave functions Help
« on: May 04, 2013, 02:47:30 am »


               Hai!

I wanted to use the ReflexSave function to determine if a spell/ability deals damage or not. For example if the opposing save throw failed, that target will take damage. If the saving throw succeded, then the target takes no damage and avoids the spell/ability.

GetReflexAdjustedDamage, would mean that it only deals half damage, right? I want it to deal no damage when the saving throw is succesful.

Thanks!
               
               

               


                     Modifié par modtyrant, 04 mai 2013 - 01:51 .
                     
                  


            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
BlankSave functions Help
« Reply #1 on: May 04, 2013, 11:59:17 am »


               Just use the standard reflex save.  No need to play with the damage if it is an all or nothing.  Now if you wanted improved evasion to take half when the save is failed in addition to it being an all or nothing you would do something like this.

void main()
{
object oTarget = GetSpellTargetObject();
int nCasterLevel = GetCasterLevel(OBJECT_SELF);
if(nCasterLevel > 20) nCasterLevel = 20;
int nDam = d6(nCasterLevel);
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
// You can also use MyResistSpell
if(!ResistSpell(OBJECT_SELF, oTarget))
 {
 // You can also use MySavingThrow
 if(!ReflexSave(oTarget, GetSpellSaveDC()))
   {
   if(GetHasFeat(FEAT_IMPROVED_EVASION, oTarget)) nDam /= 2;
   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDam, DAMAGE_TYPE_FIRE), oTarget);
   }
 }
}
               
               

               
            

Legacy_modtyrant

  • Newbie
  • *
  • Posts: 26
  • Karma: +0/-0
BlankSave functions Help
« Reply #2 on: May 05, 2013, 01:25:08 am »


               Will this also work to negate any negative effects on a spell or ability if the save is successful. I want damage and negative effects to be in the same roll unless it has branching effects.

I am a noob at scripting. Terrible at formatting it, so the computer can read what's going on. I would also like to know how to make throwing saves in general because i will PROBABLY need to make custom scripted skills and then the regular skills are just there for the points value. It seems like that's the only way to make the skills i want, like acrobatics and other sorts.

I am being bombarded by instant messages, forgive any english mistakes. Thanks!