Here is the sample plot script from the job board demo module I created:
#include "utility_h"#include "wrappers_h"#include "plt_sj_job_board_rats"void AddCreatureExperience(int nXp, object oCreature=OBJECT_SELF){ // there is no modify for "base" values set to total of current + award float fXp = IntToFloat(GetExperience(oCreature)+ nXp); SetCreatureProperty(oCreature, PROPERTY_SIMPLE_EXPERIENCE, fXp, PROPERTY_VALUE_BASE);}int StartingConditional(){ int bResult; // deconstruct event event eCurrent = GetCurrentEvent(); int nType = GetEventType(eCurrent); int nFlag = GetEventInteger(eCurrent, 1); string sPlot = GetEventString(eCurrent, 0); //------------------------------------------------------------------------------ // Handle Event //------------------------------------------------------------------------------ switch(nType) { case EVENT_TYPE_SET_PLOT: { //---------------------------------------------------------------------- // Set Event (main flags only) //---------------------------------------------------------------------- // NOTE: The flag's value is only set AFTER this script finishes // the plot flag is the second value in the event's ints list int nNewValue = GetEventInteger(eCurrent, 2); int nOldValue = GetEventInteger(eCurrent, 3); switch(nFlag) { case SJ_JOB_BOARD_RATS_ACCEPTED: { // drop the "available" flag to remove from job board WR_SetPlotFlag(PLT_SJ_JOB_BOARD_RATS, SJ_JOB_BOARD_RATS_AVAILABLE, FALSE); // activate the rats (Team=240) UT_TeamAppears(240); bResult = TRUE; break; } case SJ_JOB_BOARD_RATS_REWARDED: { object oHero = GetHero(); // reward: 200cp and 200xp AddCreatureMoney(200, oHero); AddCreatureExperience(200, oHero); bResult = TRUE; break; } } break; } case EVENT_TYPE_GET_PLOT: { //---------------------------------------------------------------------- // Get Event (defined flags only) //---------------------------------------------------------------------- switch(nFlag) { // no defined flags } break; } } return bResult;}Note that you don't have to generate the reward through scripting I just didn't like the options in the reward 2DA and couldn't be bothered creating a new one.
Edited by Sunjammer, 28 March 2010 - 10:42 AM.