//:://///////////////////////////////////////////// //:: Custom User Defined Event //:: FileName //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* */ //::////////////////////////////////////////////// //:: Created By: //:: Created On: //::////////////////////////////////////////////// #include "NW_I0_GENERIC" void main() { ExecuteScript("prc_npc_userdef", OBJECT_SELF); int nRandom; object oObject; int nUser = GetUserDefinedEventNumber(); if(nUser == 1001) //HEARTBEAT { if (!IsInConversation(OBJECT_SELF)&&!GetIsInCombat(OBJECT_SELF)&& GetLocalObject(OBJECT_SELF,"oWulgar_ore")!=OBJECT_SELF) { // check to see if he's going to a new bit of ore if (Random(8)==1) { int nRandom=Random(6); oObject=GetObjectByTag("jw_ore_object",nRandom); if (GetIsObjectValid(oObject)) { SetLocalObject(OBJECT_SELF,"oWulgar_ore",oObject); ActionMoveToObject(oObject); } // finish the moving part } // now do what happens if he is not moving to a new bit of ore else { DoPlaceableObjectAction(GetLocalObject(OBJECT_SELF,"oWulgar_ore"),PLACEABLE_ACTION_BASH); PlaySound("as_cv_minepick1"); // AssignCommand(GetLocalObject(OBJECT_SELF,"oWulgar_ore"),DelayCommand(1.3,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_SPARKS_PARRY),OBJECT_SELF))); } } } else if(nUser == 1002) // PERCEIVE { oObject=GetLastPerceived(); if (GetIsObjectValid(oObject)&&GetIsPC(oObject)&&GetObjectSeen(oObject)&&GetLocalInt(oObject, "Dlg_Init_" + GetTag(OBJECT_SELF)) == FALSE ) { ClearAllActions(); SetLocalObject(OBJECT_SELF,"oWulgar_ore",OBJECT_SELF); ActionMoveToObject(oObject,1,0.2); ActionDoCommand(AssignCommand(oObject, ClearAllActions())); ActionStartConversation(oObject); DelayCommand(5.0,SetLocalObject(OBJECT_SELF,"oWulgar_ore",GetObjectByTag("jw_ore_object"))); } } else if(nUser == 1003) // END OF COMBAT { } else if(nUser == 1004) // ON DIALOGUE { } else if(nUser == 1005) // ATTACKED { } else if(nUser == 1006) // DAMAGED { } else if(nUser == 1007) // DEATH { //DelayCommand(5.0,SignalEvent(GetObjectByTag("jw_dog_door"),EventUserDefined(100))); SignalEvent(GetObjectByTag("jw_dog_door"),EventUserDefined(100)); } else if(nUser == 1008) // DISTURBED { } }