//////::///////////////////////////////////////////////// //:: Custom User Defined Event //:: FileName //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// //// //::///////////////////////////////////////////////// //:: Created By: //:: Created On: //::////////////////////////////////////////////// #include "JW_HOMELIFE" //#include "NW_I0_GENERIC" //void jw_woken(); //void jw_sleep(); //void jw_wake(); //void jw_general(); //void jw_cook(); ///void jw_endcook(); void main() { ExecuteScript("prc_npc_userdef", OBJECT_SELF); int nUser = GetUserDefinedEventNumber(); object oObject; int nCounter; if(nUser == 1001) //HEARTBEAT { int nTime=GetTimeHour(); SetLocalInt(OBJECT_SELF,"jw_time",nTime); if ((!IsInConversation(OBJECT_SELF))&&(!GetIsInCombat(OBJECT_SELF))&&(GetMaxHitPoints(OBJECT_SELF)>(GetCurrentHitPoints(OBJECT_SELF)*2))) { ActionRest(); } else { if ((!IsInConversation(OBJECT_SELF))&&(!GetIsInCombat(OBJECT_SELF))) { Homelife(); } } // one in 20 chance of summoning wilberforce int nCounter=Random(20); if (nCounter==1) {SignalEvent(GetObjectByTag("jw_wilberforce"),EventUserDefined(500));} } else if(nUser == 1002) // PERCEIVE { if (GetIsEnemy(GetLastPerceived())) { DetermineCombatRound(); } } else if(nUser == 1003) // END OF COMBAT { } else if(nUser == 1004) // ON DIALOGUE { int nMatch = GetListenPatternNumber(); object oShouter = GetLastSpeaker(); if ((!IsInConversation(OBJECT_SELF))&&(!GetIsInCombat(OBJECT_SELF))) { if ((nMatch == 20)&&(GetTag(oShouter)=="jw_wilberforce")) { SpeakString("Oh Wilberforce, be quiet"); } } } else if(nUser == 1005) // ATTACKED { SignalEvent(GetObjectByTag("jw_wilberforce"),EventUserDefined(500)); } else if(nUser == 1006) // DAMAGED { SignalEvent(GetObjectByTag("jw_wilberforce"),EventUserDefined(500)); } else if(nUser == 1007) // DEATH { } else if(nUser == 1008) // DISTURBED { } }