Author Topic: Chance at Free Cast Spell?  (Read 328 times)

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Chance at Free Cast Spell?
« on: October 16, 2012, 10:11:41 pm »


                I've never delved into the spell scripts and now I'm having a good time doing so, hence the burst of questions around the topic.

 I'm wondering how I can add a 10% chance that a spell will be a free cast. For example, if I can cast Acid Splash 3 times, and I'm successful at receiveing a 'free cast' then I'll still be able to cast Acis Splash three more times.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Chance at Free Cast Spell?
« Reply #1 on: October 16, 2012, 10:50:23 pm »


               Hmm that is tricky. Very interesting idea.

My suggestion is to look into spell hooking for setting up the system.
In the spell hook I would, I would check for the 10% chance each time a spell is cast for the first time (per rest), and if successful record it on the PC.

In the rest event I would add a garbage collection function that clears data like this from the PC.

The other thing I would look into is how to restore spell uses. I'm not positive how this is done. Don't know if it can be done (elegantly) without NWNX.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Chance at Free Cast Spell?
« Reply #2 on: October 16, 2012, 10:52:51 pm »


               Just had an idea... you could provide a free spell feat, that can be used to cast any free spell... that would work. I'm not sure how much that would change the "spell casting" aspect of it, but you would be able to do this with feats as Feats are easy to "refresh" the uses of, and you could count the uses with data on the PC. AND I think you could find a way to use one feat for any spell. It would take some creativity, but I'm sure it could be done.
               
               

               
            

Legacy_Buddywarrior

  • Hero Member
  • *****
  • Posts: 512
  • Karma: +0/-0
Chance at Free Cast Spell?
« Reply #3 on: October 16, 2012, 11:21:59 pm »


               If I could find where the script subtracts the spell total by 1, I may be able to trick it at that location instead.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Chance at Free Cast Spell?
« Reply #4 on: October 17, 2012, 01:36:52 am »


               I believe that is hard coded.