painofdungeoneternal wrote...
There is a parameter to effectdeath to ignore death immunity. This is there BECAUSE it's done at the engine level. Without that we used to have to remove any protection, or apply physical damage to the target to end up killing them.
I'd have to see what script is doing the above feedback to really respond, but i can say that applying the effectdeath to a target with the parameter to ignore immunity set to false, will be handled at the engine level and the target will get a message about not being affected. I think you need to look closer at what you are applying to the target, perhaps also test with death ward in place as there could be an issue with the item as well.
There are spells which don't work like this though - which sidestep death immunity like level drains and drowning and the like ( or my dm kill button ), for which you have to use that new parameter to effect death, apply enough damage, or the target will ignore them.
Note that i've redone all the "my" functions as part of the CSL, they are pretty much rubbish overall. But you don't want to change how that works, it's supposed to be like that or the feedback is wrong.
Hi Pain,
I took a standard Amulet of Health and added the "Immunity: Miscellaneous: Death Magic" property. I then have the following script (used via a creature AI script, but any other object can be set up to test if you like) - I have kept all the debug code in place - NOTE: THIS SCRIPT HAS MY FIX IN IT, BUT you should be able to test the same script with it removed (if you see what I mean). If I don't have the GetIsImmune check in place, then the PC will die if they fail the saving throw even with the amulet on. Also EffectDeath should not be ignoring immunity by default as far as I can see.:
[nwscript]// HAG EVIL EYE (DEATH/MADNESS GAZE) x 3 / DAY
#include "X0_I0_SPELLS"
void main()
{
SendMessageToPC(GetFirstPC(FALSE), "HAG EYE FIRED");
if(GZCanNotUseGazeAttackCheck(OBJECT_SELF)){return;}
// DECLARE VARIABLES
location lSelf = GetLocation(OBJECT_SELF);
// LOCATE A SINGLE GAZED ENEMY TARGET
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 20.0, lSelf, TRUE);
while(oTarget != OBJECT_INVALID)
{
string sFMName = GetName(oTarget) + "_EYE"; // DIFFER FROM HORRIFIC SIGHT
if(GetIsEnemy(oTarget) && GetLocalInt(OBJECT_SELF, sFMName) == 0)
{
SetLocalInt(OBJECT_SELF, sFMName, 1);
SendMessageToPC(oTarget, "<<< HAG USES EVIL EYE ON " + GetStringUpperCase(GetName(oTarget)) + " >>>");
// IMMUNITY CHECK
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELLABILITY_GAZE_DEATH));
int Immune = 0; if(GetIsImmune(oTarget, IMMUNITY_TYPE_DEATH, OBJECT_SELF)){Immune = 1;}
//DEATH CHANCE FIRST
float fDelay = GetDistanceBetween(OBJECT_SELF, oTarget)/20;
if(!MySavingThrow(SAVING_THROW_WILL, oTarget, 20, SAVING_THROW_TYPE_DEATH, OBJECT_SELF, fDelay))
{
if(Immune == 1){SendMessageToPC(GetFirstPC(FALSE), "IMMUNE TO HAG EYE DEATH EFFECT");}
if(Immune == 0 && d100() < 26)
{
//Apply the VFX impact and effects
effect eGaze = EffectDeath();
effect eVis = EffectVisualEffect(VFX_IMP_DEATH);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eGaze, oTarget));
}
// IF SAVE DEATH, THEN MAD
else
{
SendMessageToPC(GetFirstPC(FALSE), "MADNESS");
effect eMadness = EffectCurse(0,3,0,3,3,3);
eMadness = SupernaturalEffect(eMadness);
effect eVis = EffectVisualEffect(VFX_IMP_CONFUSION_S);
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_PERMANENT, eMadness, oTarget));
}
}
}
// ONLY ONE VALID TARGET PER GAZE
else{oTarget = GetNextObjectInShape(SHAPE_SPHERE, 20.0, lSelf, TRUE);}
}
}[/nwscript]
My main concern, however, is that the function in question will return as if failing instead of giving an immune response. Therefore, to give the correct immune response (if the item immunity is also being ignored) needs to come before the check in most cases. In this case, the Hag's Eys effect has a secondary effect for those that do not die, so the coding is a little different.
EDIT: The GetIsImmune function can confirm the PC is immune, but the game fails to prevent the PC from dying with the default EffectDeath function applied to them if not checked for and prevented. Do you know where and how the NWN2 is now supposed to check for immunity? (I just reread your post and you said engine level.)
EDIT 2: I just did a test with the DEATH WARD spell and the PC still dies using this function as a saving test. The game does not appear to check for immunities (Death at any rate) and so a failed save is causing a death effect, even though the PC has immunity to death on them (item or spell) and the EffectDeath function is left at default not to ignore immunity.

Lance.
Modifié par Lance Botelle, 05 octobre 2011 - 10:26 .