Aller au contenu

Photo

Removing Sneak Attack Immunity from Monsters


  • Veuillez vous connecter pour répondre
8 réponses à ce sujet

#1
lluewhyn

lluewhyn
  • Members
  • 17 messages

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?



#2
Shadooow

Shadooow
  • Members
  • 4 471 messages

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



#3
MagicalMaster

MagicalMaster
  • Members
  • 2 003 messages

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.



#4
_Guile

_Guile
  • Members
  • 685 messages

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...



#5
MagicalMaster

MagicalMaster
  • Members
  • 2 003 messages

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


  • Shadooow aime ceci

#6
WhiZard

WhiZard
  • Members
  • 1 204 messages

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.



#7
MagicalMaster

MagicalMaster
  • Members
  • 2 003 messages

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.



#8
lluewhyn

lluewhyn
  • Members
  • 17 messages

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);
}



#9
MagicalMaster

MagicalMaster
  • Members
  • 2 003 messages

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);
        }