Jump to content

Home

OnDeath Script


Tomb King

Recommended Posts

I used it in the tk102 birthday mod. Here is an example of what I did (you'll find the files in the d3_czerka.mod module if you want to look at them). The d3_keyb.utc has the following ScriptSpawn:

 

#include "k_inc_generic"
#include "k_inc_debug"

void main()
{
   GN_SetSpawnInCondition(SW_FLAG_EVENT_ON_DEATH);            //OPTIONAL BEHAVIOR - Fire User Defined Event 1007
   GN_SetDayNightPresence (AMBIENT_PRESENCE_ALWAYS_PRESENT);
   GN_SetListeningPatterns();                 
   GN_WalkWayPoints();
}

 

and then in the ScriptUserDefine field I attached the actions to be performed when the npc dies - in this case give an access pass to the PC:

void main() 
{
int nUser = GetUserDefinedEventNumber();
if (nUser != 1007) return;  
object oPC = GetPCSpeaker();
CreateItemOnObject("d3_access", oPC);   
}
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...