Advertisement
GrandBulwark

Untitled

Feb 16th, 2015
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.49 KB | None | 0 0
  1. Scriptname WZONES_Bulwark_Armory extends ObjectReference
  2. ;Script Authors: GrandBulwark and Deapri
  3.  
  4. ;Version History
  5. ;2015.2 FINAL - Moved catch and renamed some properties to prevent breaking the script, removed unecessary check on the WzonesArmory Gval. That variable is determined by toggling Deapri's option in the previous script, so it will always be set prior to this script running. Script cleaned up and process explained in comments.
  6. ;2015.2 Beta - Added catch to prevent improper values from effecting the armory's distribution and a trace to tell on users who may have done so.
  7. ;1.6 - Added backpack Global
  8. ;1.5 - Complete Overhaul bringing a 400 line script down to what you see here. Going this way ensures that NO future work will need to be done to this script. All patches/addons that use the outfits I(GrandBulwark) made for WZones will automatically conform to the McM Toggle.
  9. ;1.4 - Declared two new Gvars to Implement failsafe for potentially missed outfits. It would have been better had we used that method to begin with for the entire thing but hey, wouldn't have learned as much. Commented out the Imperial and Stormcloak soldiers; we no longer need to swap their outfits.
  10. ;1.3 - Fixed missing Imperial Soldiers from the vanilla outfit toggle
  11. ;1.2 - Added Vspawners
  12. ;1.1 - Added missing Imperial Soldier
  13. ;1.0 - Initial Release
  14.  
  15. ;General Properties
  16. GlobalVariable Property WZonesArmory Auto ; Should not be altered or check for accuracy in this script. This value is set by the users choice in the McM menu; and it's configuration is handled there. We only use it as a check here.
  17. GlobalVariable Property WZonesArmoryModded Auto ; Should be set to 0 when Armory is on, 100 when off !SHOULD not be altered to any other parameter!
  18. GlobalVariable Property WZonesArmoryVanilla Auto ; Should be set to 100 when armory is on, 0 when off !SHOULD not be altered to any other parameter!
  19. GlobalVariable Property WZonesBackPacks Auto ; Should be set to 95 when the armory is on, 100 when off !COULD be set to other values but WILL be reset and trigger the catch so it's best left alone!
  20.  
  21. ;Dev Properties
  22. GlobalVariable Property WZonesArmoryTestChestChance Auto ; Should be set to 100 by all but developers
  23. GlobalVariable Property WZonesArmoryDebugMode Auto ; Should be set to 0 by all but developers and should not be configurable via any script.
  24. GlobalVariable Property WZonesArmoryBookGlobal Auto ; Used once in this script to completely disable the spawns of the Crafting Overwrite Book to thin out the test chest.
  25.  
  26. WZones_MCM Property sWZMCM Auto ; changed to sWZMCM due to property name conflict which was preventing the script from initializing.
  27.  
  28. State WZArmorySwitch ;State and Global Variable "WZonesArmory" are determined in the WZones_MCM script
  29. Event OnBeginState()
  30. If GetState() == "WZArmorySwitch" ;State is determined in the McM Script, as is the Gval "WZonesArmory"
  31. ;General User Options: The first thing we check for here is if our values have been altered. Setting a NO SPAWN chance via console to an INVALID value(Anything less that 100 or greater than 1) will result in naked NPCs. Players will NEVER see this step without altering the values in their console.
  32. If WZonesBackPacks.GetValueInt() != 100 && WZonesBackPacks.GetValueInt() != 95 || WZonesArmoryVanilla.GetValueInt() != 0 && WZonesArmoryVanilla.GetValueInt() != 100 || WZonesArmoryModded.GetValueInt() != 0 && WZonesArmoryModded.GetValueInt() != 100 ; Translates roughly to if any value is not what the script expects, reset then and scold the user while informing the authors in the logs
  33.  
  34. WZonesArmoryModded.SetValue(0) ; Sets the WARZONES armory spawn list's NO SPAWN chance to 0(Will Spawn)
  35. WZonesArmoryVanilla.SetValue(100); Sets the VANILLA armory spawn list's NO SPAWN chance to 100(Will NOT Spawn)
  36. WZonesBackPacks.SetValue(95) ; Sets the WARZONES Backpack spawn list's NO SPAWN chance to 95(5% chance to Spawn)
  37.  
  38. ;Messages and Debug telling the user, and us if they've messed anything up and how to fix it.
  39. Debug.MessageBox("Dear User, while we are delighted that you have a mind to alter your own game we must ask you to refrain from altering armory global values in the cosole. This can break the armory's distribution entirely and we frankly don't need any needless bug reports. Kill any WARZONES NPCs you've loaded recently, or reset your world cells to prevent naked NPCs. Thanks -Warzones 2015 team")
  40. Debug.Trace("WZONES ARMORY: Tampering with values detected inform user not to mess with Gvals regarding armory, distribution scripts reset. Ignore reports of naked NPCs.")
  41.  
  42. ;This check initiates it's functions if the user chose to turn the Armory OFF in McM.
  43. Elseif WZonesArmory.GetValueInt() == 0 ; User turned OFF the armory in MCM(0=OFF)
  44.  
  45. WZonesArmoryModded.SetValue(100) ; Sets the WARZONES armory spawn list's NO SPAWN chance to 100(Will NOT Spawn)
  46. WZonesArmoryVanilla.SetValue(0) ; Sets the VANILLA armory spawn list's NO SPAWN chance to 0(Will Spawn)
  47. WZonesBackPacks.SetValue(100) ; Sets the WARZONES Backpack spawn list's NO SPAWN chance to 100(Will NOT Spawn)
  48. Debug.MessageBox("WARZONES Armory OFF")
  49.  
  50. ;This check initiates it's functions if the user chose to turn the Armory ON in McM. It is also the game's default starting state before the script is run.
  51. Elseif WZonesArmory.GetValueInt() == 1 ; User turned ON the armory in MCM(1=ON)
  52.  
  53. WZonesArmoryModded.SetValue(0) ; Sets the WARZONES armory spawn list's NO SPAWN chance to 0(Will Spawn)
  54. WZonesArmoryVanilla.SetValue(100) ; Sets the VANILLA armory spawn list's NO SPAWN chance to 100(Will NOT Spawn)
  55. WZonesBackPacks.SetValue(95) ; Sets the WARZONES Backpack spawn list's NO SPAWN chance to 95(5% chance to Spawn)
  56. Debug.MessageBox("WARZONES Armory ON")
  57.  
  58. Else
  59. Endif
  60. ;Dev Use Only from here on
  61. If WZonesArmoryDebugMode.GetValueInt() == 1 ; WZonesArmoryDebugMode is not altered with any script. It must be set with console commands and is NOT intended for users.
  62.  
  63. ;First we turn the chest on and our books and backpacks off and warn anyone this is an invasive option intended to debug the armory only
  64. WZonesArmoryTestChestChance.SetValue(0) ; The chest will spawn one potential armor configuration based upon if the armory is on/off. If ON there should be 10 full sets of Warzones added armors. If off there should be 10 vanilla full sets of vanilla armor. Support items like weapons and loot will spawn regardless.
  65. WZonesArmoryBookGlobal.SetValue(100) ; The WARZONES armory book is disabled here to thin the test chests clutter
  66. WZonesBackPacks.SetValue(100) ; The WARZONES backpacks are also disabled to thin clutter.
  67. Debug.MessageBox("WZARMORY Toggle Test Chest is active; if you are NOT a developer STOP altering random Gvars in the console... Enter Set WZonesArmoryDebugMode to 0 in the console and then toggle the armory to your desired setting in McM.") ; Should never be seen if you are not a developer
  68.  
  69.  
  70. Elseif WzonesArmoryDebugMode.GetValueInt() != 1
  71.  
  72. WZonesArmoryTestChestChance.SetValue(100)
  73. ;We do not restore our book global here purposely both to show off the fancy McM option Deapri whipped up, and because this is dev use only
  74. ;here we stay silent so no one know there is a disabled option, we don't want them hunting for it as they might be a bit let down if they did find it.
  75.  
  76. Else
  77. Endif
  78. Else
  79. Endif
  80. EndEvent
  81. EndState
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement