-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit 59cf030
Showing
4,562 changed files
with
224,019 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
Binary file not shown.
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,43 @@ | ||
ScriptName Achievements_CompanionsAndEliteCrew Extends Quest | ||
|
||
;-- Variables --------------------------------------- | ||
|
||
;-- Properties -------------------------------------- | ||
Group RecruitedCountAchievement | ||
RefCollectionAlias Property RecruitedCompanionsAndEliteCrew Auto Const mandatory | ||
{ autofill } | ||
Int Property CountForAchievement = 10 Auto Const | ||
Int Property AchievementID_RecruitedCount = 38 Auto Const | ||
EndGroup | ||
|
||
Group RelationshipLevelAchievement | ||
ActorValue Property COM_AffinityLevel Auto Const mandatory | ||
{ autofill } | ||
Int Property AffinityLevelNeeded = 3 Auto Const | ||
Int Property AchievementID_MaxRelationshipLevelReached = 39 Auto Const | ||
EndGroup | ||
|
||
|
||
;-- Functions --------------------------------------- | ||
|
||
Function RecruitedCompanionOrEliteCrew(Actor RecruitedActor) | ||
RecruitedCompanionsAndEliteCrew.AddRef(RecruitedActor as ObjectReference) | ||
If RecruitedCompanionsAndEliteCrew.GetCount() >= CountForAchievement | ||
Game.AddAchievement(AchievementID_RecruitedCount) | ||
EndIf | ||
EndFunction | ||
|
||
Function AffinityLevelReached(Actor CompanionActor) | ||
If CompanionActor.GetValue(COM_AffinityLevel) >= AffinityLevelNeeded as Float | ||
Game.AddAchievement(AchievementID_MaxRelationshipLevelReached) | ||
EndIf | ||
EndFunction | ||
|
||
Bool Function Trace(ScriptObject CallingObject, String asTextToPrint, Int aiSeverity, String MainLogName, String SubLogName, Bool bShowNormalTrace, Bool bShowWarning, Bool bPrefixTraceWithLogNames) | ||
Return Debug.TraceLog(CallingObject, asTextToPrint, MainLogName, SubLogName, aiSeverity, bShowNormalTrace, bShowWarning, bPrefixTraceWithLogNames, True) | ||
EndFunction | ||
|
||
; Fixup hacks for debug-only function: warning | ||
Bool Function warning(ScriptObject CallingObject, String asTextToPrint, Int aiSeverity, String MainLogName, String SubLogName, Bool bShowNormalTrace, Bool bShowWarning, Bool bPrefixTraceWithLogNames) | ||
Return false | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
ScriptName Achievements_TrackedStatsScript Extends Quest Const | ||
{ Track player stats for awarding achievements } | ||
|
||
;-- Structs ----------------------------------------- | ||
Struct ChallengeAchievement | ||
challenge AchievementChallenge | ||
{ Challenge to trigger } | ||
Int AchievementNumber | ||
{ The achievement to unlock } | ||
EndStruct | ||
|
||
Struct StatsAchievement | ||
String statString | ||
{ Stat to use for achievement } | ||
Int statCount | ||
{ how many times required to get the achievement? } | ||
Int AchievementNumber | ||
{ The achievement to unlock } | ||
EndStruct | ||
|
||
|
||
;-- Variables --------------------------------------- | ||
|
||
;-- Properties -------------------------------------- | ||
achievements_trackedstatsscript:statsachievement[] Property StatsAchievements Auto Const mandatory | ||
{ All activity based achievements defined via tracked stat events } | ||
achievements_trackedstatsscript:challengeachievement[] Property ChallengeAchievements Auto Const mandatory | ||
{ All activity based achievements defined via Challenge forms } | ||
|
||
;-- Functions --------------------------------------- | ||
|
||
Function RegisterTrackedStats() | ||
Int I = 0 | ||
While I < StatsAchievements.Length | ||
achievements_trackedstatsscript:statsachievement theStatAchievement = StatsAchievements[I] | ||
Self.RegisterForTrackedStatsEvent(theStatAchievement.statString, theStatAchievement.statCount) | ||
I += 1 | ||
EndWhile | ||
Self.RegisterForChallengeEvents() | ||
Int index = 0 | ||
While index < ChallengeAchievements.Length | ||
ChallengeAchievements[index].AchievementChallenge.StartPlayerChallenge() | ||
index += 1 | ||
EndWhile | ||
EndFunction | ||
|
||
Event OnTrackedStatsEvent(String asStatFilter, Int aiStatValue) | ||
Int statsAchievementsIndex = StatsAchievements.findstruct("statString", asStatFilter, 0) | ||
While statsAchievementsIndex > -1 | ||
achievements_trackedstatsscript:statsachievement theStatAchievement = StatsAchievements[statsAchievementsIndex] | ||
If theStatAchievement.statCount <= aiStatValue | ||
Game.AddAchievement(theStatAchievement.AchievementNumber) | ||
EndIf | ||
statsAchievementsIndex = StatsAchievements.findstruct("statString", asStatFilter, statsAchievementsIndex + 1) | ||
EndWhile | ||
EndEvent | ||
|
||
Event OnChallengeCompleted(ObjectReference akOwner, challenge akChallenge) | ||
If akOwner == Game.GetPlayer() as ObjectReference | ||
Int index = ChallengeAchievements.findstruct("AchievementChallenge", akChallenge, 0) | ||
If index >= 0 | ||
Game.AddAchievement(ChallengeAchievements[index].AchievementNumber) | ||
EndIf | ||
EndIf | ||
EndEvent |
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,140 @@ | ||
ScriptName AchievementsScript Extends Quest conditional | ||
|
||
;-- Structs ----------------------------------------- | ||
Struct StatAchievement | ||
String StatName | ||
{ Name of the stat } | ||
Int Threshold | ||
{ If the stat is equal to or greater than this, unlock the achievement } | ||
Int AchievementNumber | ||
{ The achievement to unlock } | ||
EndStruct | ||
|
||
|
||
;-- Variables --------------------------------------- | ||
Bool bCraftedItemsAwarded | ||
Bool bFutureRetro | ||
Bool initialized | ||
Int nBobbleHead01 = 10 Const | ||
Int nBobbleHead02 = 20 Const | ||
Int nCraftedItems = 100 Const | ||
Int nCurrentChems | ||
Int nCurrentFood | ||
String sBobbleheadsCollectedStat = "Bobbleheads Collected" Const | ||
String sChemsCraftedStat = "Chems Crafted" Const | ||
String sFoodCookedStat = "Food Cooked" Const | ||
|
||
;-- Properties -------------------------------------- | ||
achievementsscript:statachievement[] Property StatAchievements Auto Const mandatory | ||
{ All the simple "stat is equal or larger than x" achivements - must be unique stats and not overlap with future retro or other achivements } | ||
String[] Property FutureRetroStats Auto Const mandatory | ||
{ All the stats that will trigger the future retro achivement - must be unique stats and not overlap with other achivements } | ||
Int Property nNumberOfCompanions Auto conditional hidden | ||
Int Property nGiantsKilled Auto conditional hidden | ||
|
||
;-- Functions --------------------------------------- | ||
|
||
Function InitializeQuest() | ||
If initialized | ||
Return | ||
EndIf | ||
Self.RegisterEvents() | ||
initialized = True | ||
EndFunction | ||
|
||
Function RegisterEvents() | ||
Int index = 0 | ||
While index < StatAchievements.Length | ||
achievementsscript:statachievement curAchivement = StatAchievements[index] | ||
Self.RegisterForTrackedStatsEvent(curAchivement.StatName, curAchivement.Threshold) | ||
index += 1 | ||
EndWhile | ||
index = 0 | ||
While index < FutureRetroStats.Length | ||
Self.RegisterForTrackedStatsEvent(FutureRetroStats[index], 1) | ||
index += 1 | ||
EndWhile | ||
Self.RegisterForTrackedStatsEvent(sChemsCraftedStat, 1) | ||
Self.RegisterForTrackedStatsEvent(sFoodCookedStat, 1) | ||
Self.RegisterForTrackedStatsEvent(sBobbleheadsCollectedStat, nBobbleHead01) | ||
EndFunction | ||
|
||
Function UnregisterFutureRetroEvents() | ||
Int index = 0 | ||
While index < FutureRetroStats.Length | ||
Self.UnregisterForTrackedStatsEvent(FutureRetroStats[index]) | ||
index += 1 | ||
EndWhile | ||
EndFunction | ||
|
||
Event OnTrackedStatsEvent(String statFilter, Int statValue) | ||
Bool handled = Self.HandleBasicStat(statFilter) | ||
handled = handled || Self.HandleRetroStat(statFilter) | ||
handled = handled || Self.HandleCraftedStat(statFilter, statValue) | ||
handled = handled || Self.HandleBobbleheadStat(statFilter, statValue) | ||
EndEvent | ||
|
||
Bool Function HandleBasicStat(String statFilter) | ||
Int achievementIndex = StatAchievements.findstruct("StatName", statFilter, 0) | ||
If achievementIndex >= 0 | ||
Game.AddAchievement(StatAchievements[achievementIndex].AchievementNumber) | ||
Return True | ||
Else | ||
Return False | ||
EndIf | ||
EndFunction | ||
|
||
Bool Function HandleRetroStat(String statFilter) | ||
Int achievementIndex = FutureRetroStats.find(statFilter, 0) | ||
If achievementIndex >= 0 | ||
If !bFutureRetro | ||
bFutureRetro = True | ||
Game.AddAchievement(35) | ||
Self.UnregisterFutureRetroEvents() | ||
EndIf | ||
Return True | ||
Else | ||
Return False | ||
EndIf | ||
EndFunction | ||
|
||
Bool Function HandleCraftedStat(String statFilter, Int statValue) | ||
If statFilter == sChemsCraftedStat | ||
nCurrentChems = statValue | ||
Self.UpdateCraftedAchievement(sChemsCraftedStat, nCurrentChems) | ||
Return True | ||
ElseIf statFilter == sFoodCookedStat | ||
nCurrentFood = statValue | ||
Self.UpdateCraftedAchievement(sFoodCookedStat, nCurrentFood) | ||
Return True | ||
Else | ||
Return False | ||
EndIf | ||
EndFunction | ||
|
||
Function UpdateCraftedAchievement(String statFilter, Int currentValue) | ||
If !bCraftedItemsAwarded | ||
If nCurrentChems + nCurrentFood >= nCraftedItems | ||
bCraftedItemsAwarded = True | ||
Game.AddAchievement(31) | ||
Self.UnregisterForTrackedStatsEvent(sChemsCraftedStat) | ||
Self.UnregisterForTrackedStatsEvent(sFoodCookedStat) | ||
Else | ||
Self.RegisterForTrackedStatsEvent(statFilter, currentValue + 1) | ||
EndIf | ||
EndIf | ||
EndFunction | ||
|
||
Bool Function HandleBobbleheadStat(String statFilter, Int statValue) | ||
If statFilter == sBobbleheadsCollectedStat | ||
Game.AddAchievement(44) | ||
If statValue >= nBobbleHead02 | ||
Game.AddAchievement(45) | ||
Else | ||
Self.RegisterForTrackedStatsEvent(sBobbleheadsCollectedStat, nBobbleHead02) | ||
EndIf | ||
Return True | ||
Else | ||
Return False | ||
EndIf | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ScriptName Action Extends Form Native hidden |
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,5 @@ | ||
ScriptName Activator Extends Form Native hidden | ||
|
||
;-- Functions --------------------------------------- | ||
|
||
Bool Function IsRadio() Native |
Oops, something went wrong.