/////:://///////////////////////////////////////////// //:: Default On Blocked //:: NW_C2_DEFAULTE //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* This will cause blocked creatures to open or smash down doors depending on int and str. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Nov 23, 2001 //::////////////////////////////////////////////// #include "NW_I0_GENERIC" void main() { object oDoor = GetBlockingDoor(); object oTarget=GetTarget(); //debug //SpeakString("I am blocked"); //AssignCommand(oDoor,SpeakString("I am the door")); if((GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)&&(GetObjectType(oDoor)==OBJECT_TYPE_DOOR)) { // SpeakString("I have the int"); if( GetLocked( oDoor)) { //SpeakString("It is locked"); if(GetIsObjectValid(GetItemPossessedBy( OBJECT_SELF, GetLockKeyTag( oDoor)))) { //SpeakString("I have the key and I'm trying to open it"); SetLocked(oDoor, 0); ClearAllActions(); ActionOpenDoor(oDoor); if (GetIsObjectValid(oTarget)&&!GetIsFighting(OBJECT_SELF)) { ActionMoveToObject(oTarget); } //AssignCommand(oDoor,ActionOpenDoor(oDoor)); //ActionOpenDoor(oDoor); } else { //SpeakString("I dont have the key it needs"); } } else { //SpeakString("It's *not* locked and I'm trying to open it"); ClearAllActions(); ActionOpenDoor(oDoor); if (GetIsObjectValid(oTarget)&&!GetIsFighting(OBJECT_SELF)) { ActionMoveToObject(oTarget); } // AssignCommand(oDoor,ActionOpenDoor(oDoor)); //ActionOpenDoor(oDoor); } } }