At the end of this I have a defined flag to check if the player took all 7 items. If the player took all seven items it should return a true value. Problem is that it isn't.
Initially I wanted it on a trigger near the exit. In a perfect world when players entered this trigger it would check the defined flag and if it returned true it would spawn the big bad. Trigger didn't work. So then I tried it as an on click event on a placeable. That didn't work. Finally I just tested it on a conditional line of dialog and that didn't work either.
For some reason this defined flag won't return a true value no matter what. I know for certain all the main flags are set, can anyone figure this out?
//::///////////////////////////////////////////////
//:: Plot Events Template
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
Plot events
*/
//:://////////////////////////////////////////////
//:: Created By: Yaron
//:: Created On: July 21st, 2006
//:://////////////////////////////////////////////
#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "PLT_GEARING_UP"
int StartingConditional()
{
event eParms = GetCurrentEvent(); // Contains all input parameters
int nType = GetEventType(eParms); // GET or SET call
string strPlot = GetEventString(eParms, 0); // Plot GUID
int nFlag = GetEventInteger(eParms, 1); // The bit flag # being affected
object oParty = GetEventCreator(eParms); // The owner of the plot table for this script
object oConversationOwner = GetEventObject(eParms, 0); // Owner on the conversation, if any
int nResult = FALSE; // used to return value for DEFINED GET events
object oPC = GetHero();
plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info
if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
{
int nValue = GetEventInteger(eParms, 2); // On SET call, the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
int nOldValue = GetEventInteger(eParms, 3); // On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
// IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
switch(nFlag)
{
case TOOK_PAINT:
{
object oFirst = GetObjectByTag("paint_1");
object oSecond = GetObjectByTag("paint_2");
object oThird = GetObjectByTag("paint_3");
object oFourth = GetObjectByTag("paint_4");
SetObjectActive(oFirst, 1);
SetObjectActive(oSecond, 1);
SetObjectActive(oThird, 1);
SetObjectActive(oFourth, 1);
break;
}
case TOOK_2HANDER:
{
object oFirst = GetObjectByTag("2hander_1");
object oSecond = GetObjectByTag("2hander_2");
object oThird = GetObjectByTag("2hander_3");
SetObjectActive(oFirst, 1);
SetObjectActive(oSecond, 1);
SetObjectActive(oThird, 1);
break;
}
case TOOK_DAGGER1:
{
object oFirst = GetObjectByTag("dagger1_1");
object oSecond = GetObjectByTag("dagger1_2");
SetObjectActive(oFirst, 1);
SetObjectActive(oSecond, 1);
break;
}
case TOOK_DAGGER2:
{
object oFirst = GetObjectByTag("dagger2");
SetObjectActive(oFirst, 1);
break;
}
case TOOK_BOW:
{
object oFirst = GetObjectByTag("bow_1");
object oSecond = GetObjectByTag("bow_2");
object oThird = GetObjectByTag("bow_3");
object oFourth = GetObjectByTag("bow_4");
SetObjectActive(oFirst, 1);
SetObjectActive(oSecond, 1);
SetObjectActive(oThird, 1);
SetObjectActive(oFourth, 1);
break;
}
case TOOK_HELM1:
{
object oFirst = GetObjectByTag("helm1_1");
object oSecond = GetObjectByTag("helm1_2");
object oThird = GetObjectByTag("helm1_3");
SetObjectActive(oFirst, 1);
SetObjectActive(oSecond, 1);
SetObjectActive(oThird, 1);
break;
}
case TOOK_HELM2:
{
object oFirst = GetObjectByTag("helm2_1");
object oSecond = GetObjectByTag("helm2_2");
SetObjectActive(oFirst, 1);
SetObjectActive(oSecond, 1);
break;
}
case SPAWNED_MONSTER:
{
object oMonster = GetObjectByTag("ash_wraith");
SetObjectActive (oMonster, 1);
UT_Talk (oMonster, oPC, R"armory_monster.dlg");
break;
}
case DEFEATED_MONSTER:
{
object oAyla = GetObjectByTag("party_ayla");
UT_Talk (oAyla, oPC, R"armory_done_ayla.dlg");
break;
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{
switch(nFlag)
{
case ALL_7_ITEMS_RECEIVED:
{ int nPaint = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_PAINT);
int n2Hander = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_2HANDER) ;
int nDagger1 = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_DAGGER1) ;
int nDagger2 = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_DAGGER2) ;
int nBow = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_BOW) ;
int nHelm1 = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_HELM1) ;
int nHelm2 = WR_GetPlotFlag("PLT_GEARING_UP", TOOK_HELM2);
// check if all main flags have been raised
if((nPaint == TRUE) && (n2Hander == TRUE) && (nDagger1 == TRUE)
&& (nDagger2 == TRUE) && (nBow == TRUE) && (nHelm1 == TRUE)
&& (nHelm2 == TRUE))
{
nResult = TRUE;
}
break;
}
}
}
plot_OutputDefinedFlag(eParms, nResult);
return nResult;





Retour en haut






