Author Topic: WillSave - explanation needed  (Read 357 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
WillSave - explanation needed
« on: March 28, 2012, 10:18:01 pm »


               I'm playing with the WillSave, but my understanding seams off.  What does the 20 represent? oTarget's Will or what oTarget needs to beat. 




   if (WillSave(oTarget, [b]20[/b], SAVING_THROW_TYPE_MIND_SPELLS ))
      {
           // Creature failed the roll against 20, SMITE IT!
      }
   else
      {
          // Creature doesn't get harmed.
      }



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
WillSave - explanation needed
« Reply #1 on: March 28, 2012, 10:28:50 pm »


               

Buddywarrior wrote...

I'm playing with the WillSave, but my understanding seams off.  What does the 20 represent? oTarget's Will or what oTarget needs to beat. 




   if (WillSave(oTarget, [b]20[/b], SAVING_THROW_TYPE_MIND_SPELLS ))
      {
           // Creature failed the roll against 20, SMITE IT!
      }
   else
      {
          // Creature doesn't get harmed.
      }




20 is the save DC.  If this saving throw returns 1 (success vs. DC 20) or 2 (mind spell immunity)  then the creature does not get harmed.  If the saving throw returns 0 (failure vs. DC 20) then the script is commented to then do the smite.
               
               

               


                     Modifié par WhiZard, 28 mars 2012 - 09:30 .
                     
                  


            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
WillSave - explanation needed
« Reply #2 on: March 28, 2012, 10:43:34 pm »


               So 20 is what the target needs to beat? ((Roll 20 or better and you're saved)) or the spell has to beat a 20? .. Perhaps this is no longer a scripting question anymore and more of me not understanding the term Save and who posseses the Save. Thanks for the assistance WhiZard.
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
WillSave - explanation needed
« Reply #3 on: March 28, 2012, 10:56:44 pm »


               

Buddywarrior wrote...

So 20 is what the target needs to beat? ((Roll 20 or better and you're saved)) or the spell has to beat a 20? .. Perhaps this is no longer a scripting question anymore and more of me not understanding the term Save and who posseses the Save. Thanks for the assistance WhiZard.


oTarget will make a saving throw of 1d20 + modifiers vs. a DC of 20.  The second object that can be defined (the fourth parameter which by default is OBJECT_SELF) is the creature he is making the saving throw against.  In a spell script the one casting the spell is OBJECT_SELF.  Thus if the caster is evil and oTarget has protection from evil he will automatically succeed the will save.  If the caster is good and oTarget just has protection from evil, then oTarget will have to beat the DC of 20 (or roll a natural 20) in order for the bad things not to happen.

What is even more confusing is that BioWare also has a MySavingThrow() function defined in a spell include that purposefully turns automatic success by immunity into automatic failure.  The intent is that those who are immune will have their immunity block the effects anyway, and when this happens an immunity message is sent to the player.  Unfortunately, many time there are some effects that are not blocked by the immunity which is rolled against in the saving throw.
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
WillSave - explanation needed
« Reply #4 on: March 28, 2012, 11:13:55 pm »


               

WhiZard wrote...

Buddywarrior wrote...

So 20 is what the target needs to beat? ((Roll 20 or better and you're saved)) or the spell has to beat a 20? .. Perhaps this is no longer a scripting question anymore and more of me not understanding the term Save and who posseses the Save. Thanks for the assistance WhiZard.


oTarget will make a saving throw of 1d20 + modifiers vs. a DC of 20.  The second object that can be defined (the fourth parameter which by default is OBJECT_SELF) is the creature he is making the saving throw against.  In a spell script the one casting the spell is OBJECT_SELF.  Thus if the caster is evil and oTarget has protection from evil he will automatically succeed the will save.  If the caster is good and oTarget just has protection from evil, then oTarget will have to beat the DC of 20 (or roll a natural 20) in order for the bad things not to happen.

What is even more confusing is that BioWare also has a MySavingThrow() function defined in a spell include that purposefully turns automatic success by immunity into automatic failure.  The intent is that those who are immune will have their immunity block the effects anyway, and when this happens an immunity message is sent to the player.  Unfortunately, many time there are some effects that are not blocked by the immunity which is rolled against in the saving throw.


Perfect. Thank you for taking the time to explain that. Makes sense now. Thanks again!