Jump to content

Event Type Campaign Item Acquired


LadyHonor

Recommended Posts

I am using the script that came in the demo module to send the event that the player has picked up the item. it works fine when I want it to find one item, but I need it for three. this is the script. could someone please tell me how to edit it for three items instead of one?

 

 

#include "utility_h" #include "events_h" #include "plt_lh_alistair_quest"

void main() {

event ev = GetCurrentEvent();

int nEventType = GetEventType(ev);

string sDebug;

object oPC = GetHero();

object oParty = GetParty(oPC);

int nEventHandled = FALSE;

 

switch(nEventType)

{

 

case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:

{

object oItem = GetEventObject(ev, 0);

 

if (GetTag(oItem) == "plt_lh_artifact")

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_1, TRUE);

}

else if (GetTag(oItem) == "lh_artifact_2")

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_2, TRUE);

}

else if (GetTag(oItem) == "lh_artifact_3")

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_3, TRUE);

}

}

} }

 

sorry if it looks horrid. doing this with a cell phone.

Link to comment
Share on other sites

I found a solution to my problem by looking at the script for the juggernaut armor quest, which wasn't listed in the ntb folder oddly enough. it was in the event scripts found under global on a script called genev_item_acquired. Anyway I modified it to work with my plots. here is the finished product in case someone else one day has this are problem.

 

#include "utility_h" #include "events_h" #include "plot_h" #include "plt_lh_alistair_quest"

void main() { event ev = GetCurrentEvent(); int nEventType = GetEventType(ev);

switch(nEventType) {

 

case EVENT_TYPE_CAMPAIGN_ITEM_ACQUIRED:

{

object oItem = GetEventObject(ev, 0);

 

if (GetTag(oItem) == "plt_lh_artifact" || GetTag(oItem) == "lh_artifact_2" || GetTag(oItem) == "lh_artifact_3")

{

if (GetTag(oItem) == "plt_lh_artifact")

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_1, TRUE);

}

 

if (GetTag(oItem) == "lh_artifact_2")

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_2, TRUE);

}

 

if (GetTag(oItem) == "lh_artifact_3")

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_3, TRUE);

}

//Track Items

int bItem1 = WR_GetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_1);

int bItem2 = WR_GetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_2);

int bItem3 = WR_GetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ITEM_FOUND_3);

int nRecovered = bItem1 + bItem2 + bItem3;

 

if (nRecovered == 1)

{

//if the helm is the first item, and the plot hasn't been started - give a

//different journal entry

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ARTIFACT_1, TRUE, TRUE);

}

//LogTrace(LOG_CHANNEL_TEMP, "THIS WAS ITEM # 1");

}

else if (nRecovered == 2)

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_ARTIFACT_2, TRUE, TRUE);

//LogTrace(LOG_CHANNEL_TEMP, "THIS WAS ITEM # 2");

}

else if (nRecovered == 3)

{

WR_SetPlotFlag(PLT_LH_ALISTAIR_QUEST, LH_ALISTAIR_RETURN_TO_BELUMIR, TRUE, TRUE);

//LogTrace(LOG_CHANNEL_TEMP, "THIS WAS ITEM # 3");

}

else

{

//LogTrace(LOG_CHANNEL_TEMP, "This WAS ITEM# :" + IntToString(nRecovered));

}

}

break;

} } }

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...