Due to my lack of coding experience, I was unable to figure out a way to customize the existing lockpicking script to satisfy the needs of my shard, so I decided to code my own. I feel that this script will allow GMs greater flexiblity with created locked objects, as well as give rogue and adventuring characters a greater incentive to gain lockpicking skill.
The "set up" portion tells how to use the script in the game and also gives some examples of what kind of success rates a lockpicker would have vs. certain locks. The code for changing the difficulty can be easily customized.
Version 1.02
-- Set the default pick rate to 35% success. After testing, 45% seemed to easy.
--Fixed a boolean bug that would let you pick anything, even if it was not type 8.
--added a better debugging system that can be "decommented" to balance the system.
Set up:
1. First an object is set to its locked object type. (8 for container, 13 for a door, 64 for a spawn container). Example: "'set type 8" and select the container.
2. In order to allow a lock to be pickable, the morex of the object must be set to 5. This allows the GM to create "unpickable" locks. Example: "'set morex 5" and select the container.
3. The diffaculty level is set by adjusting the morey. It is recommended to use a value between 1 and 1000. This value is used against the PCs lockpicking skill. (see formula below). Example: "'set morey 525" and select the container.
*-----------------------------------*
Formula
When a PC uses a lockpick on a lock, a "This lock is unpickable" is returned if the morex of the container is not set to 5.
If it is a pickable lock, the default success rate is 45% without skills and penalties. Skill divided by 10 is added to the success rate, while the difficulty of the lock (morey) is subtracted from the success rate. A random number between 1 and 100 is compared against the success rate. If it is greater, than the lock is picked.
If it is a failure there is a 40% chance the pick will break.
The "skillcheck" function is fired to check to increase the lockpicking skill regardless of sucess or failure.
Here is the mathematical formula:
If (Random 100) + (skills/10) - (morey/10) > (100-45), pick the lock.
Here is an example of success:
lockpick 100 Vs Morey 1000 lock == 45% pickrate
lockpick 50 vs Morey 1000 lock == 0% pickrate
lockpick 60 vs morey 1000 lock == 5% pickrate
lockpick 100 Vs Morey 500 lock == 95% pickrate
lockpick 75 Vs Morey 500 lock == 70% pickrate
lockpick 10 vs Morey 500 lock == 5% pickrate
lockpick 20 vs Morey 100 lock == 55% pickrate