Author Topic: Immune to certain weapons types  (Read 312 times)

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
Immune to certain weapons types
« on: September 29, 2013, 07:58:52 pm »


                I’m not sure if this is in the right place. But maybe I’m
missing something, is there a way to make a creature immune to certain weapon
types such as slashing, bludgeoning, piercing? If so how would I go about doing
this?
               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Immune to certain weapons types
« Reply #1 on: September 29, 2013, 10:56:42 pm »


               Simplest way is to give them an item with 100% immunity to that damage type.  Or 50% or 25% or whatever you'd like.
               
               

               
            

Legacy_Squatting Monk

  • Hero Member
  • *****
  • Posts: 776
  • Karma: +0/-0
Immune to certain weapons types
« Reply #2 on: September 30, 2013, 01:01:20 am »


               You can apply damage immunities using EffectDamageImmunityIncrease(). For example, you could add this snippet in the creature's OnSpawn script to make it 50% immune to piercing and 50% vulnerable to bludgeoning:

// Create the effects to apply
effect eDamageImmunityIncrease = EffectDamageImmunityIncrease(DAMAGE_TYPE_PIERCING,    50);
effect eDamageImmunityDecrease = EffectDamageImmunityDecrease(DAMAGE_TYPE_BLUDGEONING, 50);

// Link the effects together.
effect eLink = EffectLinkEffects(eDamageImmunityIncrease, eDamageImmunityDecrease);

// Make the effect undispellable and apply it to the object.
ApplyEffectToObject(DURATION_TYPE_PERMANENT, SupernaturalEffect(eLink), OBJECT_SELF);

               
               

               


                     Modifié par Squatting Monk, 30 septembre 2013 - 12:02 .