Author Topic: Problems with Feats using Spells  (Read 416 times)

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Problems with Feats using Spells
« on: July 09, 2013, 04:27:02 pm »


               I am posting this on behalf of the individual who is working on our hakpak, so I apologize if this is not as complete or has all the details needed at the moment. But basically, we have a problem adding custom feats (racial abilities for Drow, etc) via hak and the spells they are supposed to fire to are not working correctly - or working at all.
 
For example, we have a feat called Racial Ability: See Invisibility. Our understanding is the whole feat/spell thing works like this: create a feat entry 'Racial Ability: See Invisibility' in the feat.2da. In the feat.2da enter in the column 'SPELLID' the row ID from spells.2da of the spell you want to use for that feat. Alter target/user per day behavior in feat.2da.
 
So what we did for 'Racial Ability: See Invisibility' was to create a new feat and link it to the spells.2da ID 157 - which IS the spell that calls the See Invisibility script NW_S0_SeeInvis. But it does not work in-game - no spell is cast or VFX fires. In addition, we have another racial ability to cast the Darkness spell, but it only lasts for 1 round no matter the level of the PC using it.
 
Can anyone shed some light on what is needed from a custom content perspective (or scripting perspective, if the CC side is correct) to get these to work properly?
               
               

               
            

Legacy_Asymmetric

  • Sr. Member
  • ****
  • Posts: 289
  • Karma: +0/-0
Problems with Feats using Spells
« Reply #1 on: July 09, 2013, 05:59:31 pm »


               Associating the feat with the spell is not enough. You'll also need to associate the spell with the feat. You have put the row number of the newly created feat into the "FeatID" column of your spells.2da. For this reaseon, if you have multiple feats using the same spell you will have to clone those spells in the 2da.  For Example: The feats HARPER_INVISIBILITY and FEAT_PRESTIGE_INVISIBILITY_1 (= assassin invisibility) use different SpellIDs although those spells use the same script.

Now for the darkness lasting only one round: That is to be expected. The script for the spell (nw_s0_darkness) calls the function GetCasterLevel() to detemine the duration, which will be 1 (=  the innate caster level of the spell darkness). You'll have to adjust the script.
               
               

               


                     Modifié par Asymmetric, 09 juillet 2013 - 05:04 .
                     
                  


            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Problems with Feats using Spells
« Reply #2 on: July 09, 2013, 06:00:35 pm »


               One issue is the spell scripts may be looking for a caster level.  If said drow aren't sorcerers/wizards, they'll have a caster level of 0, which means a duration of 0 rounds.

I would suggest adding new lines to spells.2da for the desired spells.  Just copy the existing lines you want to use, renumber them, then edit the spell scripts.

For you edits, have the script check the spell ID, which will get the line number from spells.2da.  If it matches the new line number (which means the feat was used), assign the desired caster level in the script.
               
               

               
            

Legacy_K-T-A

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Problems with Feats using Spells
« Reply #3 on: July 11, 2013, 12:30:03 pm »


               Thank you for your answers. It turned out that I missed to associate the spell with the feat when I was moving .2da lines around. This has been solved now. Thanks!

KTA