Author Topic: Henchman Spellcasting  (Read 253 times)

Legacy_eucletes

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Henchman Spellcasting
« on: June 04, 2013, 11:43:37 pm »


               Hi All,

I have a area in the game where I would like to prevent all spells from being cast this includes the PC and the henchman. For the PC the spellhook works fine, but I can't figure out how to suppress the henchman. I'm hoping there is a simply command.

Regards
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Henchman Spellcasting
« Reply #1 on: June 05, 2013, 03:13:53 am »


               All spells cast by default AI go through bkTalentFilter() found in x0_inc_generic.  There the standard procedure is if the spell should not be cast, the AI would not cast it and decrement its uses (so that the spell won't infinitely pop up when the AI selects a new talent).  You could use this procedure by checking to see if the caster is a henchman and he is using a talent whose type is TALENT_TYPE_SPELL.
               
               

               
            

Legacy_ShadowM

  • Hero Member
  • *****
  • Posts: 1373
  • Karma: +0/-0
Henchman Spellcasting
« Reply #2 on: June 05, 2013, 05:01:42 am »


               A final note: All of the above only applies if it is a PC casting the spell. If you want it to also apply for NPCs, you must set a local integer called X2_L_WILD_MAGIC to TRUE on all of the areas (not the module itself) where you want the spellhook system to also affect spells cast by NPCs, including henchmen! Note that, if you set the variables directly in the Tollset, which you might as well, you can't use the value TRUE. Just use the value 1 instead.
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Henchman Spellcasting
« Reply #3 on: June 05, 2013, 05:18:12 am »


               A simple fix would be to apply Spell Failure (100%) to all objects that entered the area (OnEnter), and remove it OnExit...
               
               

               
            

Legacy_eucletes

  • Newbie
  • *
  • Posts: 24
  • Karma: +0/-0
Henchman Spellcasting
« Reply #4 on: June 05, 2013, 08:21:01 pm »


               Thank you all. I now have an area where henchman and NPC cannot cast spells :-)