Line 94 CreateItemOnObject(REVENANT_HIMSELF_RES, REVENANT_KEY_TAG,1);
I've tried all the variations of the line I can think of so is it my tags, resources, or do I need to list the revenant as an object
//--------------------------------------------------------------------------------------------------
/*
Plot script for "find_key" quest for Revenant.
*/
//--------------------------------------------------------------------------------------------------
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "plt_find_key"
// Constants
//--------------------------------------------------------------------------------------------------
// tags
const string REVENANT_KEY_TAG = "revenant_key";
const string REVENANT_HIMSELF = "my_ruins_revenant";
const string REVENANT_SCROLL_TAG = "summoning_manuscript";
// resources
const resource REVENANT_KEY_RES = R"revenant_key.uti";
const resource REVENANT_HIMSELF_RES = R"my_ruins_revenant.utc";
const resource REVENANT_SCROLL_RES = R"summoning_manuscript.uti";
// Functions
//--------------------------------------------------------------------------------------------------
void AddCreatureExperience(int nXp, object oCreature=OBJECT_SELF)
{
float fXp = IntToFloat(GetExperience(oCreature) + nXp);
SetCreatureProperty(oCreature, PROPERTY_SIMPLE_EXPERIENCE, fXp);
}
// Main
//--------------------------------------------------------------------------------------------------
int StartingConditional()
{
int bResult;
// deconstruct event
event evCurrent = GetCurrentEvent();
int nEventType = GetEventType(evCurrent);
int nPlotFlag = GetEventInteger(evCurrent, 1);
// common variables
object oHero = GetHero();
// Handle Events
//----------------------------------------------------------------------------------------------
switch(nEventType)
{
// Set Plot Event: Main flags only
//------------------------------------------------------------------------------------------
case EVENT_TYPE_SET_PLOT:
{
int nNewValue = GetEventInteger(evCurrent, 2); // Value about to be assigned
int nOldValue = GetEventInteger(evCurrent, 3); // Value currently assigned
switch(nPlotFlag)
{
case REVENANT_QUEST_ACCEPT:
{
// open the subplots: one for each item
WR_SetPlotFlag(PLT_FIND_KEY, REVENANT_QUEST_ACCEPT, TRUE);
// create ring item – don’t need on this plot
// CreateItemOnObject(REVENANT_KEY_RES, oHero);
// drop the plot giver flag: object 0 is the conversation's owner
object oConversationOwner = GetEventObject(evCurrent, 0);
SetPlotGiver(oConversationOwner, FALSE);
break;
}
case REVENANT_QUEST_COMPLETE:
{
// open the subplots: one for each item
WR_SetPlotFlag(PLT_FIND_KEY, REVENANT_QUEST_COMPLETE, TRUE);
break;
}
case REVENANT_QUEST_GIVE_KEY:
{
// open the subplots: one for each item
WR_SetPlotFlag(PLT_FIND_KEY, REVENANT_QUEST_GIVE_KEY, TRUE);
// remove key item and add to Revenant
***** RemoveItemsByTag(GetHero(), REVENANT_KEY_TAG);
Line 94 CreateItemOnObject(REVENANT_HIMSELF_RES, REVENANT_KEY_TAG,1);
*****
// reward player
// AddCreatureMoney(5000, oHero);
AddCreatureExperience(1000, oHero);
break;
}
case REVENANT_QUEST_REWARD:
{
// open the subplots: one for each item
WR_SetPlotFlag(PLT_FIND_KEY, REVENANT_QUEST_REWARD, TRUE);
// reward player
// AddCreatureMoney(5000, oHero);
AddCreatureExperience(1000, oHero);
break;
}
}
break;
}
// Get Plot Event: Defined flags only
//------------------------------------------------------------------------------------------
case EVENT_TYPE_GET_PLOT:
{
switch(nPlotFlag)
{
case FOUND_KEY: // Defined Flag in plot fired when item is acquired
{
bResult = IsObjectValid(GetItemPossessedBy(oHero, REVENANT_KEY_TAG));
break;
// if sub-plot has been completed the player has item
if(WR_GetPlotFlag(PLT_FIND_KEY, FOUND_KEY))
{
bResult = TRUE;
}
break;
}
case FOUND_SCROLL: // Defined Flag in plot fired when item is acquired
{
bResult = IsObjectValid(GetItemPossessedBy(oHero, REVENANT_SCROLL_TAG));
break;
// if sub-plot has been completed the player has item
if(WR_GetPlotFlag(PLT_FIND_KEY, FOUND_SCROLL))
{
bResult = TRUE;
}
break;
}
}
break;
}
}
return bResult;
}
Modifié par Sonmeister, 24 mai 2010 - 04:37 .





Retour en haut






