-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
119 additions
and
69 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
Simple Prostitution/Scripts/Source/zzzmrt_sp_ddi_interface.psc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Scriptname zzzmrt_sp_ddi_interface extends Quest | ||
|
||
Form[] ddkeys | ||
Bool property bChecked = False Auto Hidden | ||
|
||
event OnEndState() | ||
Utility.Wait(5.0) ; Wait before entering active state to help avoid making function calls to scripts that may not have initialized yet. | ||
setVars() | ||
endevent | ||
|
||
Function setVars() | ||
int iIndex = 0 | ||
form restraintsKey = Game.GetFormFromFile(0x01775f, "Devious Devices - Integration.esm") | ||
if restraintsKey && restraintsKey.getType() == 45 | ||
iIndex += 1 | ||
else | ||
restraintsKey = None | ||
Debug.Trace("Simple Prostitution: [DD] Restraint key not found.") | ||
endif | ||
form chastityKey = Game.GetFormFromFile(0x008a4f, "Devious Devices - Integration.esm") | ||
if chastityKey && chastityKey.getType() == 45 | ||
iIndex += 1 | ||
else | ||
chastityKey = None | ||
Debug.Trace("Simple Prostitution: [DD] Chastity key not found.") | ||
endif | ||
form piercingKey = Game.GetFormFromFile(0x0409a4, "Devious Devices - Integration.esm") | ||
if piercingKey && piercingKey.getType() == 45 | ||
iIndex += 1 | ||
else | ||
piercingKey = None | ||
Debug.Trace("Simple Prostitution: [DD] Piercing key not found.") | ||
endif | ||
if iIndex > 0 | ||
ddkeys = utility.createFormArray(iIndex) | ||
While iIndex > 0 | ||
iIndex -= 1 | ||
if piercingKey && (ddkeys.find(piercingKey) < 0) | ||
ddkeys[iIndex] = piercingKey | ||
elseif chastityKey && (ddkeys.find(chastityKey) < 0) | ||
ddkeys[iIndex] = chastityKey | ||
elseif restraintsKey && (ddkeys.find(restraintsKey) < 0) | ||
ddkeys[iIndex] = restraintsKey | ||
endif | ||
endWhile | ||
Debug.Notification("Simple Prostitution: Devious Devices Integration detected.") | ||
endif | ||
endfunction | ||
|
||
Bool function GetIsInterfaceActive() | ||
if GetState() == "Installed" | ||
return true | ||
endif | ||
return false | ||
endfunction | ||
|
||
function PlayerLoadsGame(Bool bForce = False) | ||
Debug.trace("Simple Prostitution: PlayerLoadsGame() triggered for " + self) | ||
|
||
; Is the soft dependency installed and is our script in the right state? If not change state. | ||
if Game.IsPluginInstalled("Devious Devices - Integration.esm") | ||
if GetState() != "Installed" | ||
GoToState("Installed") | ||
elseif bForce | ||
setVars() | ||
endif | ||
else | ||
if GetState() != "" | ||
GoToState("") | ||
endif | ||
endif | ||
bChecked = True | ||
endfunction | ||
|
||
Int Function iAddRandomKeyToActor(ObjectReference akRef, Int aiNum = 1) | ||
return 0 | ||
endfunction | ||
|
||
state Installed | ||
Int Function iAddRandomKeyToActor(ObjectReference akRef, Int aiNum = 1) | ||
return zzzmrt_sp_int_ddi._iAddRandomKeyToActor(akRef, ddkeys, aiNum) | ||
endfunction | ||
endState |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Scriptname zzzmrt_sp_int_ddi Hidden | ||
|
||
|
||
Int function _iAddRandomKeyToActor(ObjectReference akRef, Form[] akeyArr, Int aiNum = 1) Global | ||
if (aiNum < 1) || (akeyArr.Length < 1) | ||
return 0 | ||
endif | ||
Int iResult = 0 | ||
Int iTotalKeys = akeyArr.Length | ||
Int[] KeyNum = utility.createIntArray(iTotalKeys, 0) | ||
Int jIndex | ||
Int iIndex = 0 | ||
while iIndex < aiNum | ||
jIndex = Utility.RandomInt(0, iTotalKeys - 1) | ||
KeyNum[jIndex] = KeyNum[jIndex] + 1 | ||
iIndex += 1 | ||
endWhile | ||
iIndex = iTotalKeys | ||
While iIndex > 0 | ||
iIndex -= 1 | ||
jIndex = KeyNum[iIndex] | ||
if akeyArr[iIndex] && jIndex > 0 | ||
akRef.Additem(akeyArr[iIndex], jIndex) | ||
iResult += jIndex | ||
endif | ||
EndWhile | ||
return iResult | ||
EndFunction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+255 Bytes
(110%)
Simple Prostitution/Scripts/zzzmrt_sp_player_qst_script.pex
Binary file not shown.
Binary file not shown.