#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_rtb_plot1"
#include "rtb_script_constants"
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 KEY_INPOSSESSION:
{
UT_AddItemToInventory(THE_KEY);
CS_LoadCutscene(R"name_of_your_cutscene.cut");
break;
}
case KEY_RETURNED:
{
UT_RemoveItemFromInventory(THE_KEY);
/* Once the sword quest is done we want to open up a new area on the map for the player.
object oMapPinRoad = GetObjectByTag(DEMO_ROAD_MAP_PIN);
WR_SetWorldMapLocationStatus(oMapPinRoad, WM_LOCATION_ACTIVE); */
break;
}
}
}
else // EVENT_TYPE_GET_PLOT -> defined conditions only
{
switch(nFlag)
{
case DECLINED_QUEST:
{
//This is a "defined" plot flag. When the plot is checked
//to see whether the flag is true or false, its status is
//determined using the following code.
if (
WR_GetPlotFlag(PLT_RTB_PLOT1, SPOKEN_FATHER) &&
!WR_GetPlotFlag(PLT_RTB_PLOT1, QUEST_ACCEPTED)
)
{
return TRUE;
} else
{
return FALSE;
}
}
}
}
plot_OutputDefinedFlag(eParms, nResult);
return nResult;
}