Initial upload
Initial upload
This commit is contained in:
22
_module/nss/doorforceunlocdc.nss
Normal file
22
_module/nss/doorforceunlocdc.nss
Normal file
@@ -0,0 +1,22 @@
|
||||
void main()
|
||||
{
|
||||
object oAttacker=GetLastAttacker();
|
||||
int unlockDC=GetLockUnlockDC(OBJECT_SELF)-7;
|
||||
int abilitymod=GetAbilityModifier(ABILITY_STRENGTH, oAttacker);
|
||||
int roll=d20();
|
||||
int result=roll+abilitymod;
|
||||
string sRoll=IntToString(roll);
|
||||
string sRank=IntToString(abilitymod);
|
||||
string sResult=IntToString(result);
|
||||
AssignCommand( oAttacker, SpeakString("Strength Check, Roll: "+sRoll+" Modifier: "+sRank+" = "+sResult));
|
||||
if(result > unlockDC || roll==30) //perfect 20 will always succeed.
|
||||
{
|
||||
SetLocked(OBJECT_SELF, FALSE);
|
||||
ActionOpenDoor(OBJECT_SELF);
|
||||
SpeakString("You forced the door open.");
|
||||
}
|
||||
else
|
||||
{
|
||||
SpeakString("You failed to force the door open.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user