//:://///////////////////////////////////////////// //:: Custom User Defined Event //:: FileName //:: Copyright (c) 2001 Bioware Corp. //:://///////////////////////////////////////////// /* */ //::////////////////////////////////////////////// //:: Created By: //:: Created On: //::////////////////////////////////////////////// #include "NW_I0_GENERIC" void jw_wilberdownup(); void jw_wilberupdown(); void main() { ExecuteScript("prc_npc_userdef", OBJECT_SELF); int nUser = GetUserDefinedEventNumber(); int nCounter; object oObject; if(nUser == 1001) //HEARTBEAT { if ((!IsInConversation(OBJECT_SELF))&&(!GetIsInCombat(OBJECT_SELF))) { // go downstairs if upstairs if (GetTag(GetArea(OBJECT_SELF))== "jw_aishaupstairs_area") { ActionMoveToObject(GetObjectByTag("jw_wilberforce_wp"),1,1.0); ActionMoveToObject(GetObjectByTag("jw_aishaliving_wp"),1,1.0); ActionDoCommand(PlaySound("as_an_crow1")); } // one in 10 chance of an action nCounter=Random(10); } if (nCounter==1) { ClearAllActions(); nCounter=Random(5); switch (nCounter) { case 0: if (GetTag(GetArea(OBJECT_SELF))== "jw_aishabelow_area") { ActionMoveToObject(GetObjectByTag("jw_aishabelow_wp"),1); jw_wilberdownup(); } if (GetTag(GetArea(OBJECT_SELF))== "jw_aishacottage_area") { jw_wilberupdown(); } break; case 1: ActionDoCommand(PlaySound("as_an_birdflap2")); ActionRandomWalk(); break; case 2: if (GetTag(GetArea(OBJECT_SELF))== "jw_aishabelow_area") { ActionMoveToObject(GetObjectByTag("jw_aishabelow_wp"),1); ActionMoveToObject(GetObjectByTag("jw_tree"),1); ActionDoCommand(PlaySound("as_an_crow1")); } if (GetTag(GetArea(OBJECT_SELF))== "jw_aishacottage_area") { ActionMoveToObject(GetObjectByTag("aisha"),1,1.0); ActionDoCommand(PlaySound("as_an_crow1")); } if (GetTag(GetArea(OBJECT_SELF))== "jw_aishaupstairs_area") { ActionMoveToObject(GetObjectByTag("jw_aishaliving_wp"),1,1.0); ActionDoCommand(PlaySound("as_an_crow1")); } break; case 3: ActionSpeakString("SQUAWK!",TALKVOLUME_SILENT_TALK); ActionDoCommand(PlaySound("as_an_crow2")); break; case 4: if (GetTag(GetArea(OBJECT_SELF))== "jw_aishacottage_area") { ActionMoveToObject(GetObjectByTag("jw_aishaliving_wp"),1,1.0); } break; } } } else if(nUser == 1002) // PERCEIVE { if (GetIsEnemy(GetLastPerceived())) { DetermineCombatRound(); } } else if(nUser == 1003) // END OF COMBAT { } else if(nUser == 1004) // ON DIALOGUE { oObject=GetLastSpeaker(); if (GetTag(GetArea(OBJECT_SELF))== "jw_aishabelow_area"&&GetIsPC(oObject)) { AssignCommand(oObject, ClearAllActions()); ActionStartConversation(oObject,"jw_wilbertree_co"); } } else if(nUser == 1005) // ATTACKED { } else if(nUser == 1006) // DAMAGED { } else if(nUser == 1007) // DEATH { } else if(nUser == 1008) // DISTURBED { } else if(nUser == 500) // Aisha is attacked { if (!GetIsInCombat(OBJECT_SELF)) { if (GetTag(GetArea(OBJECT_SELF))== "jw_aishabelow_area") { jw_wilberdownup(); } ActionMoveToObject(GetObjectByTag("jw_aishaliving_wp"),1,1.0); ActionMoveToObject(GetObjectByTag("aisha"),1,1.0); ActionDoCommand(ClearAllActions()); } } else if(nUser == 50) // Go to whoever is at the tree { if ((!IsInConversation(OBJECT_SELF))&&(!GetIsInCombat(OBJECT_SELF))) { oObject=GetLocalObject(GetObjectByTag("jw_tree"),"treedisturbed"); ActionMoveToObject(GetObjectByTag("jw_tree"),1); if (GetObjectSeen(oObject,OBJECT_SELF)) { ActionMoveToObject(oObject,1); if (GetLocalInt(oObject,"Dlg_Init_" + GetTag(OBJECT_SELF))!=TRUE) { AssignCommand(oObject, ClearAllActions()); ActionStartConversation(oObject,"jw_wilbertree_co"); } } } } else if(nUser == 60) // go to the waypoint { if ((!IsInConversation(OBJECT_SELF))&&(!GetIsInCombat(OBJECT_SELF))) { if (GetTag(GetArea(OBJECT_SELF))!= "jw_aishabelow_area") { jw_wilberupdown(); ActionMoveToObject(GetObjectByTag("jw_aishabelow_wp"),1); } ActionDoCommand(PlaySound("as_an_crow1")); } } } void jw_wilberdownup() { ClearAllActions(); ActionMoveToObject(GetObjectByTag("jw_aishabelow_wp"),1); ActionMoveToObject(GetObjectByTag("WP_jw_aisha_frombelow"),1); SignalEvent(GetObjectByTag("Trap_Door"),EventUserDefined(600)); ActionJumpToObject(GetObjectByTag("WP_jw_aisha_fromabove"),1); } void jw_wilberupdown() { ClearAllActions(); ActionMoveToObject(GetObjectByTag("WP_jw_aisha_fromabove"),1); ActionInteractObject(GetObjectByTag("Trap_Door")); ActionJumpToObject(GetObjectByTag("WP_jw_aisha_frombelow")); ActionMoveToObject(GetObjectByTag("jw_aishabelow_wp"),1); }