I was confused when I came here. Now it's gotten worse.
I wanted to search the forum for Will save related topics. Now when I enter a search, NWN 1 is not included ?
The following is the script placed On Enter of a trigger.
void main()
{
object oTrig = GetObjectByTag("TrLucy02");
object oPC = GetEnteringObject();
object oGirl = GetObjectByTag("Lucy");
object oItem = GetItemPossessedBy(oPC,"ScrapofCloth");
string sSay = "Watch out! There's a trap!";
string sMesS = "The girl's singing pulls at your mind. You place the scraps of cloth in your ears.";
string sMesF = "You feel a strange sensation, in your mind.";
effect eSing = EffectVisualEffect(VFX_DUR_BARD_SONG);
int nSave = WillSave(oPC,10);
int nSaveB = WillSave(oPC,19);
if(GetIsPC(oPC))
{
AssignCommand(oGirl,ActionSpeakString(sSay,TALKVOLUME_TALK));
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_INSTANT,eSing,oGirl,10.0f));
if(GetIsObjectValid(oItem))
{
if(nSave > 0)
{
DelayCommand(4.0,SendMessageToPC(oPC,sMesS));
DestroyObject(oTrig,5.0);
SetLocalInt(oPC,"Lucy",1);
}
else
{
DelayCommand(4.0,SendMessageToPC(oPC,sMesF));
DestroyObject(oTrig,5.0);
SetLocalInt(oPC,"Lucy",2);
}
}
else
{
if(nSaveB > 0)
{
DelayCommand(4.0,SendMessageToPC(oPC,sMesS));
DestroyObject(oTrig,5.0);
SetLocalInt(oPC,"Lucy",1);
}
else
{
DelayCommand(4.0,SendMessageToPC(oPC,sMesF));
DestroyObject(oTrig,5.0);
SetLocalInt(oPC,"Lucy",2);
}
}
}
}
Build test resulted in the following
Will Save ran twice. first, PC Will Save success( 15- 1 = 14 vs DC 10). The second, Will Save failure ( 13 -1= 12 vs DC 19). Only the failure message was sent, and oGirl on Convo's Int was set to 2.