34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
//::///////////////////////////////////////////////
 | 
						|
//:: Knock
 | 
						|
//:: NW_S0_Knock
 | 
						|
//:: Copyright (c) 2001 Bioware Corp.
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
/*
 | 
						|
    Opens doors not locked by magical means.
 | 
						|
*/
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Created By: Preston Watamaniuk
 | 
						|
//:: Created On: Nov 29, 2001
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Last Updated By: Preston Watamaniuk
 | 
						|
//:: VFX Pass By: Preston W, On: June 22, 2001
 | 
						|
#include "nw_i0_spells"
 | 
						|
 | 
						|
void main()
 | 
						|
{
 | 
						|
    object oTarget;
 | 
						|
    effect eVis = EffectVisualEffect(VFX_IMP_KNOCK);
 | 
						|
    oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 15.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
 | 
						|
    float fDelay;
 | 
						|
    while(GetIsObjectValid(oTarget))
 | 
						|
    {
 | 
						|
        fDelay = GetRandomDelay(0.5, 2.5);
 | 
						|
        if(!GetLocked(oTarget))
 | 
						|
        {
 | 
						|
            DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
 | 
						|
            AssignCommand(oTarget, ActionUnlockObject(oTarget));
 | 
						|
        }
 | 
						|
        oTarget = GetNextObjectInShape(SHAPE_SPHERE, 15.0, GetLocation(OBJECT_SELF), FALSE, OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE);
 | 
						|
    }
 | 
						|
}
 |