Author Topic: Change battle music for a specific battle-and reverting it  (Read 348 times)

Legacy_Dark_Ansem

  • Full Member
  • ***
  • Posts: 148
  • Karma: +0/-0


               how would you do it? specific boss battle music, then one returns to default module battle theme? 
               
               

               
            

Legacy_Failed.Bard

  • Hero Member
  • *****
  • Posts: 1409
  • Karma: +0/-0
Change battle music for a specific battle-and reverting it
« Reply #1 on: May 29, 2012, 04:32:59 pm »


               I'd likely do something like this:

// Call this before the battle with the boss starts.
void main()
{
object oArea = GetArea (OBJECT_SELF);
int nBattle = MusicBackgroundGetBattleTrack (oArea);
// Store it on the area for reverting later.
SetLocalInt (oArea, "NORMAL_BATTLE_TRACK", nBattle);

int nTrack = 1; // Track number to use here.
MusicBattleChange (oArea, nTrack);
}

// Call this routine from the bosses OnDeath script, or just copy those three lines into it.
void RevertMusic ()
{
object oArea = GetArea (OBJECT_SELF);
int nTrack = GetLocalInt (oArea, "NORMAL_BATTLE_TRACK");
MusicBattleChange (oArea, nTrack);

               
               

               
            

Legacy_Dark_Ansem

  • Full Member
  • ***
  • Posts: 148
  • Karma: +0/-0
Change battle music for a specific battle-and reverting it
« Reply #2 on: May 29, 2012, 04:43:05 pm »


               there is a waypoint where the boss spawns, could that be useful?
               
               

               
            

Legacy_Leurnid

  • Sr. Member
  • ****
  • Posts: 473
  • Karma: +0/-0
Change battle music for a specific battle-and reverting it
« Reply #3 on: May 31, 2012, 08:37:48 am »


               Assuming the boss is spawned just prior to the fight, F.B's script added to the On-Spawn of the boss would work.

...or, you could paint a big trigger in the room or vicinity of the boss with the On-Enter set to F.B's script, and the second script snippet could be both the boss' on-death, and the trigger's on-exit, and then add a routine to the boss' on-death to destroy the trigger?
               
               

               
            

Legacy_Dark_Ansem

  • Full Member
  • ***
  • Posts: 148
  • Karma: +0/-0
Change battle music for a specific battle-and reverting it
« Reply #4 on: May 31, 2012, 09:11:55 am »


               where should I add FB script?