Relic Castle

Essentials has a weird quirk where capturing Pokémon won't play any victory music, instead the battle music keeps playing. I managed to fix this before but that was a long time ago and I don't remember how I did it, but whatever I try right now isn't working, even after I just replicated what I did before. The closest that I got was the victory ME overlapping the battle theme. I put the edits I did to the pbThrowSuccess code that I used before below, maybe it was just an older version of essentials I did this on so it doesn't work anymore? Any help would be greatly appreciated!

Ruby:
def pbThrowSuccess
    if !@battle.opponent
      @briefmessage=false
      pbMEPlay("Capture and Evolution")
      pbWait(160)
      pbMEPlay("Wild Victory")
      frames=(3.5*Graphics.frame_rate).to_i
      frames.times do
        pbGraphicsUpdate
        pbInputUpdate
        pbFrameUpdate
      end
    end
  end
Top