Remove Immunity

Is there an existing spell to remove an immunity (such as to paralysis, or knockdown?) If none exists, suggestion for how to create a spell/debuff to accomplish this?

I can think of a scripting which temporary removes immunities applied by items (actually I already published something like this), but immunities given by feats (such as the RDD’s immunity to fire)? No way I guess.

EDIT - erroneous RDD comment removed

Over and above item properties, it’s also possible to remove effects which confer immunity by script (though I can’t seem to find a comprehensive list of those).

I’m not sure there is a completely general solution - I seem to remember that some classes have innate immunities, for example, and creature special abilities might be problematic.

It would simplify matters if the OP were more specific.

Thanks for responding. Yes, I want it for those created by items (I created the problem I am trying to solve lol). Do you have a link to these scripts? Or can you post one here? (I have one that removes effects but not buffs)

This removes temporary the Immunity to Level/Attribute drain to apply a curse. (I guess the curse is much stronger than any immunity :slight_smile: )

void BypassItemProperties(object oCreature, int nSubType, int nType = ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS)
{
  object oItem;
  itemproperty p;

  int nSlot = NUM_INVENTORY_SLOTS;
  while (nSlot-- > 0)
    {
      oItem = GetItemInSlot(nSlot, oCreature);
      if (oItem != OBJECT_INVALID)
        {
          p = GetFirstItemProperty (oItem);
          while (GetIsItemPropertyValid (p))
            {
              if (GetItemPropertyType(p) == nType &&
                  GetItemPropertySubType(p) == nSubType  &&
                  GetItemPropertyDurationType(p) == DURATION_TYPE_PERMANENT)
                {
                  RemoveItemProperty(oItem, p);
                  DelayCommand(0.5, AddItemProperty (DURATION_TYPE_PERMANENT, p, oItem));
                }
            p = GetNextItemProperty(oItem);
          }
        }
    }
}

void main()
{
  if (GetLocalInt(OBJECT_SELF, "DoItOnce") == 1) return;
  SetLocalInt (OBJECT_SELF, "DoItOnce", 1);

  object oPC = GetLastOpenedBy();
  effect e = SupernaturalEffect (EffectCurse(4, 4, 4, 4, 4, 4));
  effect v = EffectVisualEffect(VFX_IMP_REDUCE_ABILITY_SCORE);

  ApplyEffectToObject (DURATION_TYPE_INSTANT, v, oPC);
  BypassItemProperties (oPC, IP_CONST_IMMUNITYMISC_LEVEL_ABIL_DRAIN);
  DelayCommand (0.2, ApplyEffectToObject (DURATION_TYPE_PERMANENT, e, oPC));
  AddJournalQuestEntry("BfTemple", 2, GetLastOpenedBy());
}

Red Dragon Disciple fire immunity is tied to having the feat and doesn’t involve the creature skin. In fact it overrides any immunity lowering which is just a bit dumb and probably needs fixing.

NWN patch 35 has a way to bypass immunities (when applying a negative effect) that might be worth holding out for @adam_ii323 or if you run a server you can use NWNX to bypass immunities. Note plot flag also stops most of them and immortality flag stops several.

Yes, you’re right, of course. I misread RDD as Red Dragon for some reason.

Thanks. I need to remove 2 so an buffed hold person spell can work; Immunity to paralysis, and since it’s a mind affecting spell, immunity to mind affecting spells…lol (both conferred by armor). I will try substituting those 2 where level drain is listed. Thanks to all who replied, will try this out and update if it works.

Great idea, but I want them to have the immunity, but also someone to be able to counter it in real time ( I love a rock paper scissors scrum…lol). So the script or some kind of single action temporary response, is exactly what I am looking for (I’ll attach the spell Mmat provided to a limited use ‘relic’ and add change the duration to temporary).