Do not start combat music when brawling

This commit is contained in:
Eddoursul 2024-01-23 20:01:02 +01:00
parent b67a8ec4d7
commit d7abf2a3aa
4 changed files with 23 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View File

@ -2,6 +2,8 @@ Scriptname _00E_BrawlControl extends Quest Hidden
Function Brawl(Actor pTarget, Actor pTargetFriend = None)
_00E_PlayerFunctions.GetCombatMusicControl().IsStartingBrawling()
FavorBrawlEvent.SendStoryEvent(None, pTarget, pTargetFriend)
EndFunction

View File

@ -32,9 +32,28 @@ Function InitCombatMusic()
EndIf
EndFunction
function IsStartingBrawling()
bIsBrawling = true
RegisterForSingleUpdate(1.0)
endfunction
event OnUpdate()
bIsBrawling = false
endevent
Event OnCombatStateChange(string eventName, string bTargetIsPlayer, float fCombatState, Form sender)
if bTargetIsPlayer ; start combat or searching
if fCombatState as int == 1 ; combat
if bIsBrawling
bIsBrawling = false
if GetState() == ""
UnregisterForUpdate()
else
StopCombatMusic()
endif
return
endif
; start music
Actor sourceActor = sender as Actor
Int encounterLevel = sourceActor.GetLevel()
@ -205,6 +224,8 @@ Function RemoveCombatSoundtracks()
EndFunction
bool bIsBrawling = false
Keyword Property ActorTypeBoss Auto
GlobalVariable Property PlayerLevel Auto