Author Topic: Script for adding damage to spells?  (Read 336 times)

Legacy_lluewhyn

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Script for adding damage to spells?
« on: July 16, 2015, 01:44:21 pm »


               

I'm wanting to add damage to spells similar to how 4E and 5E (Sorcerers) work. You'll get a bonus equal to your primary casting stat, and maybe I'll add a bonus based off the + of the weapon in their hand.


 


I can probably figure out how to do this for each individual spell, but that's a lot of custom scripts.


 


Is it possible to do this using the inc_spellhook? I'm basically curious if there's a way to determine if a spell is hostile and has an Instantaneous duration so I can modify all the spells at once. I don't really want extra damage being done to creatures by a Sleep spell and especially don't want creatures damaged by a Bull Strength spell. '<img'>


 


I know this would be a bit weird to get hit by a Fireball for 27 points of Fire damage and then hit for 6 more points of "Magic" damage, but whatever.


 


If not, I guess I can always resort to modifying the spell scripts individually.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Script for adding damage to spells?
« Reply #1 on: July 17, 2015, 08:58:06 pm »


               


I'm wanting to add damage to spells similar to how 4E and 5E (Sorcerers) work. You'll get a bonus equal to your primary casting stat, and maybe I'll add a bonus based off the + of the weapon in their hand.


 


I can probably figure out how to do this for each individual spell, but that's a lot of custom scripts.


 


Is it possible to do this using the inc_spellhook? I'm basically curious if there's a way to determine if a spell is hostile and has an Instantaneous duration so I can modify all the spells at once. I don't really want extra damage being done to creatures by a Sleep spell and especially don't want creatures damaged by a Bull Strength spell. '<img'>


 


I know this would be a bit weird to get hit by a Fireball for 27 points of Fire damage and then hit for 6 more points of "Magic" damage, but whatever.


 


If not, I guess I can always resort to modifying the spell scripts individually.




 


The damage is calculated out in full in each script.  You could try lowering the target's damage immunity for a short time, but that will not be a clean multiple.  Hostility can sort of be gotten by a 2da lookup (the script is actually what determines whether or not the spell is signaled as hostile).  Duration does not have any 2da information that parallels the script, so you might want to find the word "Instant" within a GetStringByResRef() of the spell description.