Author Topic: Removing Sneak Attack Immunity from Monsters  (Read 463 times)

Legacy_lluewhyn

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« on: August 08, 2014, 11:30:37 pm »


               

I'm trying to make Sneak Attack similar to 4.0, where it's usable on anything. This is to make Rogues a little more powerful.


 


Rather then trying to make a whole ton of custom skins and creatures, I was trying to use the OnSpawn event to strip the Immunity to Sneak Attack from a creature's skin. I'm unsure how to properly do this.


 


I only see one effect constant that looks like what I'm needing, which is IMMUNITY_TYPE_SNEAK_ATTACK, but it doesn't say Item Property. Would I use RemoveEffect instead?


 


Any guidance?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #1 on: August 09, 2014, 12:12:25 am »


               

the sneak attack immunity is made as an itemproperty, usually on skin but could be any kind of item so what would you have to do is:


 


loop all equipped items


check for immunity property with sneak attack subtype


remove it


 


BUT that won't help you much since immunity to critical attacks is automatic immunity to sneak attack, the only way to disable it is with NWNX



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #2 on: August 09, 2014, 05:02:48 am »


               

Like Shadooow said, you'd also need to remove Critical Immunity for your dream to be true.  I approve of said dream, mind you, I think both immunities are stupid.



               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #3 on: August 11, 2014, 05:43:03 am »


               


Like Shadooow said, you'd also need to remove Critical Immunity for your dream to be true.  I approve of said dream, mind you, I think both immunities are stupid.




 


Agreed, both immunities was a huge mistake, they should have just made them separate...


 


Even the suggestion Shadow made would be rather intensive considering combat, might run into TMI...


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #4 on: August 11, 2014, 06:23:54 am »


               

Shadow was saying just remove the Sneak Attack immunity once time on Spawn or something, wouldn't affect combat.



               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #5 on: August 11, 2014, 04:33:07 pm »


               

I once tried to solve this by adding a damage increase effect to the OnPhysicalAttacked script of critical hit immune monsters if the target was in a state that made it susceptible to sneak attacks and the attacker was not already getting the damage increase bonus.  This failed because the total damage is calculated before the OnPhysicalAttack script is run making my damage increase effects not apply until after the desired flurry.  I guess one could make this work with applying damage vulnerability to the target, but then you would not know the damage in order to determine how much to apply, and it would affect all attackers, even if they do not have the sneak attack feats.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #6 on: August 11, 2014, 11:15:05 pm »


               

Alternatively, could use the OnDamaged event to make the player instantly apply extra damage if they possess sneaks and the monster is immune.  Main catch is something like Damage Reduction or Damage Resistance would impact twice and if you made the bonus damage something like Magic to bypass that then something with 50% physical immunity wouldn't reduce the magic damage.


 


So if you only have Immunity, can just deal extra damage.


 


If you only have resistance, can make it a resist type people don't possess.


 


If you have both, you're kind of hosed.



               
               

               
            

Legacy_lluewhyn

  • Newbie
  • *
  • Posts: 34
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #7 on: August 19, 2014, 03:02:28 am »


               

Ok, I think I actually want to remove Immunity to Critical Attack and Immunity to Sneak Attack both. I'm reading about using RemoveItemProperty on the NWN Lexicon to use a loop to remove it(example below). However, both effects seem to show up under ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS. How do I further specify which Immunity I'm talking about?


 


Also, it's been many years since I've posted scripts on the forum. Is there a code to show the script as a subset like */nwscript or something?


 


//Get the first itemproperty on the helmet
itemproperty ipLoop=GetFirstItemProperty(oItem);

 
//Loop for as long as the ipLoop variable is valid
while (GetIsItemPropertyValid(ipLoop))
{
//If ipLoop is a true seeing property, remove it
if (GetItemPropertyType(ipLoop)==ITEM_PROPERTY_TRUE_SEEING)
RemoveItemProperty(oItem, ipLoop);

 
//Next itemproperty on the list...

ipLoop=GetNextItemProperty(oItem);
}


               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
Removing Sneak Attack Immunity from Monsters
« Reply #8 on: August 19, 2014, 06:44:12 am »


               

Should be able to do SubType, I think -- here's some code for removing bonus feats.


 


Also, use [ code ] blah blah [ /code ] without the spaces.


 


itemproperty ipRemove = GetFirstItemProperty(oItem);
        while (GetIsItemPropertyValid(ipRemove))
        {
            if (GetItemPropertyType(ipRemove) == ITEM_PROPERTY_BONUS_FEAT && (GetItemPropertySubType(ipRemove) == IP_CONST_FEAT_AMBIDEXTROUS
              || GetItemPropertySubType(ipRemove) == IP_CONST_FEAT_TWO_WEAPON_FIGHTING))
            {
                RemoveItemProperty(oItem, ipRemove);
            }

            ipRemove = GetNextItemProperty(oItem);
        }