HERE
is a simple var script!
this script changes value of a var when npc dies.
Add your_script_name.fos to server/script.cfg
Add your_script_name inside mapper to npc > script
add _MuholInit iside mapper to npc > function
#include "_macros.fos"
void _MuholInit( Critter& npc, bool firstTime )
{
npc.StatBase[ ST_AI_ID ] = 55; // AI OF NPC FROM _ai.fos /server/scripts ( set to vic defensive )
npc.StatBase[ ST_TEAM_ID ] = 0; // TEAM FROM _teams.fos ... set to plyer?
npc.StatBase[ ST_DIALOG_ID ] = 30000; // DIALOG
npc.ModeBase[ MODE_NO_PVP ] = 0;
npc.SetEvent( CRITTER_EVENT_DEAD, "_MuholDead" ); // if event is CRITTER_EVENT_DEAD ( if critter dies) initites void _MuholDead
}
void _MuholDead( Critter& npc, Critter@ killer )
{if (killer.IsPlayer())
{
GameVar@ var = GetLocalVar( LVAR_muhol_quest, killer.Id ); // gets local var(for individual player) ( I think global var is for all players
var = 1; // Sets the var from above to 1 ( In dialogue now you can demand the var value of 1
}
}