IF
  Die()
THEN
  RESPONSE #100
    Shout(66)
END

IF
  Global("BPCHARM","LOCALS",1)
  !StateCheck(Myself,STATE_CHARMED)
THEN
  RESPONSE #100
    SetGlobal("BPCHARM","LOCALS",0)
    ClearActions(Myself)
    Continue()
END

IF
  OR(2)
    !Allegiance(Myself,EVILCUTOFF)
    !Detect([GOODCUTOFF])
THEN
  RESPONSE #100
END

IF
  LevelGT(Myself,17)
  OR(2)
    Class(Myself,BARD)
    Class(Myself,BARD_ALL)
  Global("BP_PlayMySong","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("BP_PlayMySong","LOCALS",1)
    ReallyForceSpell(Myself,NPC_ENHANCEDSONG)
END

IF
  Kit(Myself,SKALD)
  Global("BP_PlayMySong","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("BP_PlayMySong","LOCALS",1)
    ReallyForceSpell(Myself,NPC_SKALDSONG)
END

IF
  Kit(Myself,JESTER)
  Global("BP_PlayMySong","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("BP_PlayMySong","LOCALS",1)
    ReallyForceSpell(Myself,NPC_JESTERSONG)
END

IF
  OR(2)
    Class(Myself,BARD)
    Class(Myself,BARD_ALL)
  Global("BP_PlayMySong","LOCALS",0)
THEN
  RESPONSE #100
    SetGlobal("BP_PlayMySong","LOCALS",1)
    ReallyForceSpell(Myself,NPC_BARDSONG)
END

IF
  OR(3)
    NumCreatureLT([EVILCUTOFF],3)
    HPPercentLT(Myself,45)
    GlobalTimerExpired("SONG","LOCALS")
  Global("SING","LOCALS",1)
THEN
  RESPONSE #100
    SetGlobalTimer("SONG","LOCALS",0)
    SetGlobal("SING","LOCALS",0)
    ClearActions(Myself)
END

IF
  Global("SING","LOCALS",1)
  !Range([EVILCUTOFF],20)
THEN
  RESPONSE #100
    MoveToObject([EVILCUTOFF])
END

IF
  Global("SING","LOCALS",1)
  OR(2)
    Range(NearestEnemyOf(Myself),5)
    AttackedBy([GOODCUTOFF],RANGED)
THEN
  RESPONSE #100
    RunAwayFrom(NearestEnemyOf(Myself),15)
END

IF
  Global("SING","LOCALS",1)
  Delay(6)
THEN
  RESPONSE #100
    DisplayStringHead(Myself,11798)  // ~Bard Song~
END

IF
  Global("SING","LOCALS",1)
THEN
  RESPONSE #100
END

IF
  ActionListEmpty()
  NumCreatureGT([EVILCUTOFF],3)
  !Range(NearestEnemyOf(Myself),10)
  ModalState(NONE)
  HPPercentGT(Myself,65)
  Global("SING","LOCALS",0)
  !GlobalTimerNotExpired("SONG","LOCALS")
THEN
  RESPONSE #90
    DisplayStringHead(Myself,11798)  // ~Bard Song~
    SetGlobalTimer("SONG","LOCALS",FIVE_ROUNDS)
    SetGlobal("SING","LOCALS",1)
    SmallWait(10)
    BattleSong()
  RESPONSE #10
    SetGlobalTimer("SONG","LOCALS",10)
END

IF
  ActionListEmpty()
  NumCreatureGT([EVILCUTOFF],3)
  Range(NearestEnemyOf(Myself),10)
  ModalState(NONE)
  HPPercentGT(Myself,65)
  Global("SING","LOCALS",0)
  !GlobalTimerNotExpired("SONG","LOCALS")
THEN
  RESPONSE #70
    RunAwayFrom(NearestEnemyOf(Myself),45)
    DisplayStringHead(Myself,11798)  // ~Bard Song~
    SetGlobalTimer("SONG","LOCALS",FIVE_ROUNDS)
    SetGlobal("SING","LOCALS",1)
    SmallWait(10)
    BattleSong()
  RESPONSE #30
    SetGlobalTimer("SONG","LOCALS",10)
END

