Author Topic: RE: Charm and Dominate - Disable OnRest Dispel?  (Read 315 times)

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Charm and Dominate - Disable OnRest Dispel?
« on: March 09, 2013, 12:26:26 am »


               Is there any way to disable the automatic dispel for charm and dominate effects when the caster rests?

I'm trying to emulate pnp charm and dominate spell durations and don't want the effect dispelling when the rest event is called. I know setting the subtype to Supernatural can make the effect unremoveable by resting, but it needs to be dispellable...
               
               

               


                     Modifié par Pstemarie, 09 mars 2013 - 12:29 .
                     
                  


            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
RE: Charm and Dominate - Disable OnRest Dispel?
« Reply #1 on: March 09, 2013, 12:44:24 am »


               I think the best way to do this is to record an "expiration date" (local int) for the charm or dominate spell on the creature.  

After their rest you will need to reapply the spells (cheat cast) if the expiration date has not been met.

BUT - you will need to capture the dispel event on the creature as well. Execute a separate dispel check for wiping out the time stamp. Its a little clunky but in game you could get the situation where the spells are dispelled, while the expiration date is not removed. This would be like temporary sanity as the creature is free of the charm for a little bit before it comes back to cloud their thinking.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
RE: Charm and Dominate - Disable OnRest Dispel?
« Reply #2 on: March 09, 2013, 01:57:44 am »


               If you're using NWNX, nwnx_structs has a GetEffectDuration function. You can use it to reapply with the proper duration after rest. Frankly, though, I think just modding your dispel code to be able to strip Su effects for this particular instance is the easiest way to do this. You can either rely on a specified effect id if you're using NWNX, or on an effect creator, to filter it from other effects. An effect creator is specified by the object which defines the effect - that is, effect eCharm = ...; it doesn't matter what object applies it.

Funky
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
RE: Charm and Dominate - Disable OnRest Dispel?
« Reply #3 on: March 09, 2013, 03:14:09 am »


               I'm not using NWNX, but I think Funky's solution is the easiest to implement and doesn't really use any overhead. I've made the effects from the charm and dominate spells supernatural effects then added a loop to spellsDispelMagic that removes any effects created by those spells.