//:://///////////////////////////////////////////// //:: Find Traps //:: NW_S0_FindTrap //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Finds and removes all traps within 30m. */ //::////////////////////////////////////////////// //:: Created By: Preston Watamaniuk //:: Created On: Oct 29, 2001 //::////////////////////////////////////////////// // Modified Feb 2003 by Zanshin // WHAT THE FUCK WAS BIOWARE THINKING? // NO checks for trap DC, no checks for detectable or // disarmable. Jesus fuck! // Anyway, I give the caster d20 + his DC for // the spell vs. Detect DC and Disarm DC seperately. ///////////////////////////////////////////////// void main() { effect eVis = EffectVisualEffect(VFX_IMP_KNOCK); int nCnt = 1; object oTrap = GetNearestObject(OBJECT_TYPE_TRIGGER | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt); while(GetIsObjectValid(oTrap) && GetDistanceToObject(oTrap) <= 30.0) { if(GetIsTrapped(oTrap)) { int iDisarmDC=GetTrapDisarmDC(oTrap); int iSaveDC=GetSpellSaveDC(); int iDetectDC=GetTrapDetectDC(oTrap); if ((d20()+iSaveDC) > iDetectDC && GetTrapDetectable(oTrap)) SetTrapDetectedBy(oTrap, OBJECT_SELF); if ((d20()+iSaveDC) > iDisarmDC && GetTrapDisarmable(oTrap)) { ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTrap)); DelayCommand(2.0, SetTrapDisabled(oTrap)); } else SendMessageToPC(OBJECT_SELF,"Failed to Disarm"); } nCnt++; oTrap = GetNearestObject(OBJECT_TYPE_TRIGGER | OBJECT_TYPE_DOOR | OBJECT_TYPE_PLACEABLE, OBJECT_SELF, nCnt); } }