Here is the script I used. It comes at the end of a conversation. It turns the creatures hostile, and then removes the plot flags from the placeables and adds the spellresistance. I'm not sure why the spell resistance doesn't work. Everything else works fine.
#include "nw_i0_generic"
void main()
{
effect eVFX;
effect eEffect;
object oTarget;
object oSelf = OBJECT_SELF;
// Get the PC who is in this conversation.
object oPC = GetPCSpeaker();
// Make "sot_IngelBoss2" dislike the PC more.
oTarget = GetObjectByTag("sot_IngelBoss2");
ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
// Make "sot_ChlorBoss2" dislike the PC more.
oTarget = GetObjectByTag("sot_ChlorBoss2");
ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
// Make "sot_AbaziBoss2" dislike the PC more.
oTarget = GetObjectByTag("sot_AbaziBoss2");
ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
// Make "sot_CasarBoss2" dislike the PC more.
oTarget = GetObjectByTag("sot_CasarBoss2");
ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
// Make "sot_TchazBoss2" dislike the PC more.
oTarget = GetObjectByTag("sot_TchazBoss2");
ChangeToStandardFaction(oTarget, STANDARD_FACTION_HOSTILE);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
// Alter "sot_IngelStat".
oTarget = GetObjectByTag("sot_IngelStat");
SetPlotFlag(oTarget, FALSE);
eEffect = SupernaturalEffect(EffectSpellResistanceIncrease(50));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
// Alter "sot_ChlorStat".
oTarget = GetObjectByTag("sot_ChlorStat");
SetPlotFlag(oTarget, FALSE);
eEffect = SupernaturalEffect(EffectSpellResistanceIncrease(50));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
// Alter "sot_AbaziStat".
oTarget = GetObjectByTag("sot_AbaziStat");
SetPlotFlag(oTarget, FALSE);
eEffect = SupernaturalEffect(EffectSpellResistanceIncrease(50));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
// Alter "sot_CasarStat".
oTarget = GetObjectByTag("sot_CasarStat");
SetPlotFlag(oTarget, FALSE);
eEffect = SupernaturalEffect(EffectSpellResistanceIncrease(50));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
// Alter "sot_TchazStat".
oTarget = GetObjectByTag("sot_TchazStat");
SetPlotFlag(oTarget, FALSE);
eEffect = SupernaturalEffect(EffectSpellResistanceIncrease(50));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
// Destroy an object (not fully effective until this script ends).
eVFX = EffectVisualEffect(VFX_IMP_UNSUMMON);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oSelf);
DestroyObject(oSelf, 3.0);
}
I looked at your scripts, but I'm not sure where you got the GetPlaceableDefenses function. I couldn't find it, so I imagine it must need to include another script.
Mostly what I want is to remove the death spells being cast from scrolls. There are a few different death spells that work on placeables. Banshee, destruction, implosion, and harm, to name a few. I like to give help to pure mages, and not to fighters with one rogue level for umd.
I tried looking at the spell scripts, but I could not figure out how to fix them.
I'll see what I can do with your script sometime tomorrow. Thank you for your help.
Modifié par Sadira of Tyr, 28 novembre 2011 - 03:31 .