All pastes #514141 Raw Edit

Stuff

public text v1 · immutable
#514141 ·published 2007-05-27 15:58 UTC
rendered paste body
alias unsetdm {
  msg %dmchan Nobody has decided to DM %dmp1 within 30 seconds, the DM invitation is now closed.
  unset %dmp1 $nick
  unset %dmstart 1
  unset %dmchan $chan
}
alias stopdm {
  .timerdm* off
  unset %dm*
  unset %hp*
  unset %food*
  unset %spec*
  unset %dmp*
  unset %dhp*
  unset %whp*
  unset %ghp*
  unset %amp*
  unset %ahp*
  unset %cbp*
  unset %dhu*
  unset %froze*
  unset %runes*
  unset %turn
}
alias switchturn {
  msg %dmchan $1 has not made an action in 60 seconds, it is now $2 $+ 's turn.
  set %turn $2
  if (%froze [ $+ [ %dmp1 ] ]) {
    dec %froze [ $+ [ %dmp1 ] ]
    $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])

  }
  if (%froze [ $+ [ %dmp2 ] ]) {
    dec %froze [ $+ [ %dmp2 ] ]
    $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
  }
}
alias dmwinner {
  if ($read(dmloser.txt, s, $1) != $null) {
    var %dmloser = $read(dmloser.txt, s, $1)
    write -s $+ $1 dmloser.txt $1 $calc($remove(%dmloser,$1) + 1)
  }
  else {
    write dmloser.txt $1 1
  }
  if ($read(dmwinner.txt, s, $2) != $null) {
    var %dmwinner = $read(dmwinner.txt, s, $2)
    write -s $+ $2 dmwinner.txt $2 $calc($remove(%dmwinner,$2) + 1)
  }
  else {
    write dmwinner.txt $2 1
  }
  msg %dmchan $+ $2 $+ 's rankings are: Wins: $iif($read(dmwinner.txt, s, $2) != $null, $read(dmwinner.txt, s, $2), 0) Losses: $iif($read(dmloser.txt, s, $2) != $null, $read(dmloser.txt, s, $2), 0) Total games played: $calc($read(dmloser.txt, s, $2) + $read(dmwinner.txt, s, $2)) Winning Percentage: $round($calc($read(dmwinner.txt, s, $2) / $calc($read(dmloser.txt, s, $2) + $read(dmwinner.txt, s, $2)) * 100),2) $+  $+ $chr(37) $+ .
}
on *:TEXT:!dmstats*:#:{
  if ($2) {
    msg $chan $+ $2 $+ 's rankings are: Wins: $iif($read(dmwinner.txt, s, $2) != $null, $read(dmwinner.txt, s, $2), 0) Losses: $iif($read(dmloser.txt, s, $2) != $null, $read(dmloser.txt, s, $2), 0) Total games played: $calc($read(dmloser.txt, s, $2) + $read(dmwinner.txt, s, $2)) Winning Percentage: $round($calc($read(dmwinner.txt, s, $2) / $calc($read(dmloser.txt, s, $2) + $read(dmwinner.txt, s, $2)) * 100),2) $+  $+ $chr(37) $+ .
  }
  else {
    msg $chan $+ $nick $+ 's rankings are: Wins: $iif($read(dmwinner.txt, s, $nick) != $null, $read(dmwinner.txt, s, $nick), 0) Losses: $iif($read(dmloser.txt, s, $nick) != $null, $read(dmloser.txt, s, $nick), 0) Total games played: $calc($read(dmloser.txt, s, $nick) + $read(dmwinner.txt, s, $nick)) Winning Percentage: $round($calc($read(dmwinner.txt, s, $nick) / $calc($read(dmloser.txt, s, $nick) + $read(dmwinner.txt, s, $nick)) * 100),2) $+  $+ $chr(37) $+ .
  }
}
on $*:TEXT:/^[!@]Dm(on|off)/Si:#:{
  if ($address($nick,4) == $address($me,4)) {
    if ($right($1,2) == on) && (!%dmon) {
      .notice $nick Death Matches have already been enabled.
      halt
    }
    if ($right($1,3) == off) && (%dmon) {
      .notice $nick Death Matches have already been disabled.
      halt
    }
    if ($right($1,2) == on) {
      unset %dmon
    }
    if ($right($1,3) == off) {
      set %dmon False
    }
    .notice $nick Death Matches have been $iif(%dmon != False,en,dis) $+ abled.
    amsg Death Matches have been $iif(%dmon != False,en,dis) $+ abled by my owner. $iif($3,( $+ $2- $+ )) Pm $nick $+ , or visit $chan to voice objections.
  }
}
on $*:TEXT:/^[!@]dm(commands|cmds|help)/Si:#:{
  var %dmcmds = $iif($left($1,1) == !,.notice $nick,msg $nick)
  if ($right($1,-3) == help) {
    if (!$2) {
      %dmcmds !dmhelp <command> Will give you a description of the command.
    }
    else {
      goto $right($2,-1)
    }
  }
  else {
    :whip
    %dmcmds !Whip Will attack your opponent with your whip. The max hit is 35.
    $iif($right($1,-3) == help,halt)
    :dds
    %dmcmds !Dds Will attack your opponent twice with your dds. It will also decrease your Special Energy by 25%. The max hit on each of the attacks is 25.
    $iif($right($1,-3) == help,halt)
    :gmaul
    %dmcmds !Gmaul Will attack your opponent three times with your granite maul. It will also decrease your Special Energy by 100%. The max hit on each of the attacks is 20.
    $iif($right($1,-3) == help,halt)
    :cbow
    %dmcmds !Cbow Will attack your opponent with your crystal bow. The max hit is 30.
    $iif($right($1,-3) == help,halt)
    :msb
    %dmcmds !Msb Will attack your opponent twice with your mage short bow. It will also decrease your special energy by 50%. The max hit on each of the attacks is 20.
    $iif($right($1,-3) == help,halt)
    :eat
    %dmcmds !Eat Will eat a shark and increase your health by 20.
    $iif($right($1,-3) == help,halt)
    :spec
    %dmcmds !Spec Will check your special energy bar.
    $iif($right($1,-3) == help,halt)
    :food
    %dmcmds !Food Will check the amount of food you have left.
    $iif($right($1,-3) == help,halt)
    :stopdm
    %dmcmds !Stopdm will stop the Dm if you are a deathmatch player or an op in the channel.
    $iif($right($1,-3) == help,halt)
    :ancient
    %dmcmds !Ancient (ice,blood) (burst,blitz) Will attack your opponent with an ancient magic attack, ice will freeze, blood will take part of their Hp and give it to you, burst is less powerful than blitz. Burst will take away 1 cast, while blitz will take away 2.
    $iif($right($1,-3) == help,halt)
    :dh
    %dmcmds !Dh Will attack your opponent with the dharok barrows armour. This armour will have a higher max hit and damage the lower your hp is. This is a one time only attack, as the armour degrades to nothing after the attack.
    $iif($right($1,-3) == help,halt)
  }
}
on $*:TEXT:/^[!@]dm(un|de)?(disable|revoke|ignore)/Si:#:{
  if ($2) {
    if ($address($me,4) == $address($nick,4) || ($nick isop $2)) {
      if ($mid($1,4,2) !isin unde) {
        if ($2 isin %ignoredm) {
          .notice $nick Death Matches were already disabled for $2 $+ .
          halt
        }
        set %ignoredm %ignoredm $2
        .notice $nick Death Matches have been disabled for $2 $+ .
      }
      else {
        if ($2 !isin %ignoredm) {
          .notice $nick Death Matches were not disabled for $2 $+ .
          halt
        }
        set %ignoredm $remove(%ignoredm,$2)
        .notice $nick Death Matches have been enabled for $2 $+ .
      }
    }
  }
}
on $*:TEXT:/^[!@]dmcheck/Si:#:{
  if ($iif($2,$2,$chan) isin %ignoredm) {
    $iif($right($1,1) == !,.notice $nick,msg $chan) $+ $iif($2,$2,$chan) has been ignored for dm's.
  }
  else {
    $iif($right($1,1) == !,.notice $nick,msg $chan) $+ $iif($2,$2,$chan) has not been ignored for dm's.
  }
}
on $*:TEXT:/^[!@]dm(.*)?/Si:#:{
  if ($chan !isin %ignoredm) {
    if (%dmon != False) {
      if (%dmstart) && (!%dmrun) {
        if ($nick == %dmp1) {
          .notice $nick You may not fight yourself.
          halt
        }
        if (%dmchallenge) {
          if ($nick == %dmchallenge) {
            goto dm
          }
          else {
            .notice $nick Sorry, %dmp1 has challenged %dmchallenge to a dm. Please wait for their dm to finish.
          }
        }
        else {
          if ($nick ison %dmchan) {
            :dm
            unset %dmstart
            msg $chan $+ $nick has joined the dm against %dmp1 $+ .
            set %dmp2 $nick
            msg $chan The fighters in this Dm are %dmp1 and %dmp2 $+ .
            msg $chan Both fighters will recieve 20 sharks which heal 20 and start with the maximum of 99 HP.
            .timerdmlimit 1 60 switchturn %dmp1 %dmp2
            .timerdm off
            set %dmp2 $nick
            set %dmrun 1
            set %hp [ $+ [ %dmp1 ] ] 99
            set %hp [ $+ [ %dmp2 ] ] 99
            set %food [ $+ [ %dmp1 ] ] 20
            set %food [ $+ [ %dmp2 ] ] 20
            set %spec [ $+ [ %dmp1 ] ] 100
            set %spec [ $+ [ %dmp2 ] ] 100
            set %runes [ $+ [ %dmp1 ] ] 5
            set %runes [ $+ [ %dmp2 ] ] 5
            set %turn $iif($rand(1,2) == 1,%dmp1,%dmp2)
            msg $chan $+ $iif(%turn == %dmp1,%dmp1,%dmp2) gets the first attack!
          }
          else {
            .notice $nick Sorry, %dmp1 has started a dm on %dmchan $+ . Please join %dmchan to dm them.
          }
        }
      }
      elseif (!%dmrun) {
        if ($2) {
          if ($2 ison $chan) {
            if ($2 == $nick) {
              .notice $nick $+ You cannot challenge yourself to a dm.
              halt
            }
            set %dmchallenge $2
            msg $chan $+ $nick Has challenged %dmchallenge to a Dm! $2 $+ , type !dm to accept the challenge.
          }
          else {
            .notice $nick $+ $2 must be on this channel to dm them.
          }
        }
        else {
          msg $chan $+ $nick Has initiated a Dm! Type !dm to fight them.
        }
        set %dmp1 $nick
        set %dmstart 1
        set %dmchan $chan
        .timerDm 1 30 unsetdm
      }
      else {
        .notice $nick Sorry, there is already a Dm running, please wait for that one to end.
      }
      if (%dmrun) {
        .timerdm off
      }
    }
  }
  else {
    .notice $nick Death Matches have been revoked for $chan $+ .
  }
}
on $*:TEXT:/^[!@](stop|end)dm/Si:#:{
  if ($nick == %dmp1) || ($nick == %dmp2) || ($nick isop %dmchan) || ($address($nick,4) == $address($me,4)) {
    if (%dmstart) {
      msg $chan The Dm invitation has been closed by $nick $+ .
    }
    elseif (%dmrun) {
      msg $chan The Dm between %dmp1 and %dmp2 has been ended by $nick $+ .
    }
    else {
      .notice $nick There is no Dm to stop.
      halt
    }
    .timerdm off
    stopdm
  }
}
on $*:TEXT:/^[!@]degrade(d)?/Si:#:{
  if ($nick == %dmp1) {
    if (%dhu [ $+ [ %dmp1 ] ]) {
      .notice $Nick Your Dharoks are degraded fully. You may not use them for another attack.
    }
    else {
      .notice $Nick Your Dharoks are not degraded.
    }
  }
  elseif ($nick == %dmp2) {
    if (%dhu [ $+ [ %dmp2 ] ]) {
      .notice $Nick Your Dharoks are degraded fully. You may not use them for another attack.
    }
    else {
      .notice $Nick Your Dharoks are not degraded.
    }
  }
  else {
    .notice $nick You are not fighting in this Dm.
  }
}
on *:TEXT:!froze*:#:{
  if ($nick == %dmp1) {
    if (%froze [ $+ [ %dmp1 ] ]) {
      .notice $Nick You are frozen for %froze [ $+ [ %dmp1 ] ] more turns.
    }
    else {
      .notice $nick You are not frozen.
    }
  }
  elseif ($nick == %dmp2) {
    if (%froze [ $+ [ %dmp2 ] ]) {
      .notice $nick You are frozen for %froze [ $+ [ %dmp2 ] ] more turns.
    }
    else {
      .notice $nick You are not frozen.
    }
  }
  else {
    .notice $nick You are not fighting in this Dm.
  }
}
on *:TEXT:!spec*:#:{
  if ($nick == %dmp1) {
    .notice $nick You have %spec [ $+ [ %dmp1 ] ] $+ % special energy left.
  }
  elseif ($nick == %dmp2) {
    .notice $nick You have %spec [ $+ [ %dmp2 ] ] $+ % special energy left.
  }
  else {
    .notice $nick You are not fighting in this Dm.
  }
}
on *:TEXT:!food*:#:{
  if ($nick == %dmp1) {
    .notice $nick You have %food [ $+ [ %dmp1 ] ] sharks left.
  }
  elseif ($nick == %dmp2) {
    .notice $nick You have %food [ $+ [ %dmp2 ] ] sharks left.
  }
  else {
    .notice $nick You are not fighting in this Dm.
  }
}
on $*:TEXT:/^[!@](eat|shark)/Si:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          if (%food [ $+ [ %dmp1 ] ] > 0) {
            set %hp [ $+ [ %dmp1 ] ] $calc(%hp [ $+ [ %dmp1 ] ] + 20)
            dec %froze [ $+ [ %dmp1 ] ]
            $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
            if (%hp [ $+ [ %dmp1 ] ] > 99) {
              set %hp [ $+ [ %dmp1 ] ] 99
            }
            dec %food [ $+ [ %dmp1 ] ] 1
            if (%spec [ $+ [ %dmp1 ] ] < 100) {
              inc %spec [ $+ [ %dmp1 ] ] 5
            }
            msg $chan $+ $nick has eaten a shark. %dmp1 now have $+ %hp [ $+ [ %dmp1 ] ] hp.
            .notice $nick You have %food [ $+ [ %dmp1 ] ] sharks left.
            msg $chan It is now %dmp2 $+ 's turn.
            set %turn %dmp2
          }
          else {
            .notice $nick Sorry, you have no food left to eat.
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          if (%food [ $+ [ %dmp2 ] ] > 0) {
            dec %froze [ $+ [ %dmp2 ] ]
            $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
            inc %hp [ $+ [ %dmp2 ] ] 20
            if (%hp [ $+ [ %dmp2 ] ] > 99) {
              set %hp [ $+ [ %dmp2 ] ] 99
            }
            dec %food [ $+ [ %dmp2 ] ] 1
            if (%spec [ $+ [ %dmp2 ] ] < 100) {
              inc %spec [ $+ [ %dmp2 ] ] 5
            }
            msg $chan $+ $nick has eaten a shark. %dmp1 now have $+ %hp [ $+ [ %dmp2 ] ] hp.
            .notice $nick You have %food [ $+ [ %dmp2 ] ] sharks left.
            msg $chan It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          }
          else {
            .notice $nick Sorry, you have no food left to eat.
            set %turn %dmp1
            msg $chan  It is now %dmp1 $+ 's turn.
          }
        }
      }
    }
  }
}
on *:TEXT:!whip*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          if (%froze [ $+ [ %dmp1 ] ]) {
            dec %froze [ $+ [ %dmp1 ] ]
            $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
            msg $chan It is now %dmp2 $+ 's turn.
            .notice $nick You have been frozen and may not attack with your whip.
            set %turn %dmp2
            halt
          }
          else {
            set %whp2 $rand(0,35)
            if (%whp2 < %hp [ $+ [ %dmp2 ] ]) {
              dec %hp [ $+ [ %dmp2 ] ] %whp2
              msg $chan $+ %dmp1 has hit %dmp2 with their whip and has done %whp2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left.
              if (%spec [ $+ [ %dmp1 ] ] < 100) {
                inc %spec [ $+ [ %dmp1 ] ] 5
              }
              msg $chan It is now %dmp2 $+ 's turn.
              set %turn %dmp2
              unset %whp2
              halt
            }
            if (%whp2 >= %hp [ $+ [ %dmp2 ] ]) {
              set %whp2 %hp [ $+ [ %dmp2 ] ]
              dec %hp [ $+ [ %dmp2 ] ] %whp2 
              msg $chan $+ %dmp1 has hit a %whp2 with their whip leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp. Congratulations %dmp1 $+ , you won the Dm!
              dmwinner %dmp2 %dmp1
              stopdm
              Halt
            }
          }
        }       
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          if (%froze [ $+ [ %dmp2 ] ]) {
            dec %froze [ $+ [ %dmp2 ] ]
            $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
            msg $chan It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          }
          else {
            set %whp1 $rand(0,35)
            if (%whp1 < %hp [ $+ [ %dmp1 ] ]) {
              dec %hp [ $+ [ %dmp1 ] ] %whp1
              msg $chan $+ %dmp2 has hit %dmp1 with their whip and has done $+ %whp1 damage. %dmp1 has $+ %hp [ $+ [ %dmp1 ] ] hp left.
              if (%spec [ $+ [ %dmp2 ] ] < 100) {
                inc %spec [ $+ [ %dmp2 ] ] 5
              }
              msg $chan It is now %dmp1 $+ 's turn.
              set %turn %dmp1
              unset %whp1
              halt
            }
            if (%whp1 >= %hp [ $+ [ %dmp1 ] ]) {
              set %whp1 %hp [ $+ [ %dmp1 ] ]
              dec %hp [ $+ [ %dmp1 ] ] %whp1
              msg $chan $+ %dmp2 has hit a %whp1 with their whip leaving %dmp1 with %hp [ $+ [ %dmp1 ] ] hp. Congratulations %dmp2 $+ , you won the Dm!
              dmwinner %dmp1 %dmp2
              stopdm
              Halt
            }
          }
        }
      }
    }
  }
}
on *:TEXT:!dds*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          if (%froze [ $+ [ %dmp1 ] ]) {
            dec %froze [ $+ [ %dmp1 ] ]
            $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
            msg $chan It is now %dmp2 $+ 's turn.
            .notice $nick You have been frozen and may not attack with your dds.
            set %turn %dmp2
            halt
          }
          else {
            if (%spec [ $+ [ %dmp1 ] ] >= 25) {
              set %dhp1p2 $rand(0,25)
              set %dhp2p2 $rand(0,25)
              if ($calc(%dhp1p2 + %dhp2p2) < %hp [ $+ [ %dmp2 ] ]) {
                dec %hp [ $+ [ %dmp2 ] ] %dhp1p2
                dec %hp [ $+ [ %dmp2 ] ] %dhp2p2
                dec %spec [ $+ [ %dmp1 ] ] 25
                .notice $nick You now have %spec [ $+ [ %dmp1 ] ] $+ % of your spec bar left.
                msg $chan %dmp1 has hit %dmp2 with their dds and has done %dhp1p2 and %dhp2p2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left.
                if (%spec [ $+ [ %dmp1 ] ] < 100) {
                  inc %spec [ $+ [ %dmp1 ] ] 5
                }
                msg $chan It is now %dmp2 $+ 's turn.
                set %turn %dmp2
                unset %dhp1p2
                unset %dhp2p2
                halt
              }
              if ($calc(%dhp1p2 + %dhp2p2) >= %hp [ $+ [ %dmp2 ] ]) {
                set %dhp1p2 $floor($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %dhp2p2 $ceil($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                dec %hp [ $+ [ %dmp2 ] ] %dhp1p2
                dec %hp [ $+ [ %dmp2 ] ] %dhp2p2
                msg $chan %dmp1 has hit a %dhp1p2 and %dhp2p2 on %dmp2 leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp. Congratulations %dmp1 $+ , you won the Dm!
                dmwinner %dmp2 %dmp1
                stopdm
                Halt
              }
            }
            else {
              .notice $nick You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp1 ] ] $+ % of your spec energy left.
              msg $chan It is now %dmp2 $+ 's turn.
              set %turn %dmp2
            }
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          if (%froze [ $+ [ %dmp2 ] ]) {
            dec %froze [ $+ [ %dmp2 ] ]
            $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
            msg $chan It is now %dmp1 $+ 's turn.
            .notice $nick You have been frozen and may not attack with your dds.
            set %turn %dmp1
          }
          else {
            if (%spec [ $+ [ %dmp2 ] ] >= 25) {
              set %dhp1p1 $rand(0,25)
              set %dhp2p1 $rand(0,25)
              if ($calc(%dhp1p1 + %dhp2p1) < %hp [ $+ [ %dmp1 ] ]) {
                dec %hp [ $+ [ %dmp1 ] ] %dhp2p1
                dec %hp [ $+ [ %dmp1 ] ] %dhp1p1
                dec %spec [ $+ [ %dmp2 ] ] 25
                .notice $nick You now have %spec [ $+ [ %dmp2 ] ] $+ % of your spec bar left.
                msg $chan %dmp2 has hit %dmp1 with their dds and has done $+ %dhp1p1 and %dhp2p1 damage. %dmp1 has $+ %hp [ $+ [ %dmp1 ] ] hp left.
                if (%spec [ $+ [ %dmp2 ] ] < 100) {
                  inc %spec [ $+ [ %dmp2 ] ] 5
                }
                msg $chan It is now %dmp1 $+ 's turn.
                set %turn %dmp1
                unset %dhp1p1
                unset %dhp2p1
                halt
              }
              if ($calc(%dhp1p1 + %dhp2p1) >= %hp [ $+ [ %dmp1 ] ]) {
                set %dhp1p1 $floor($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %dhp2p1 $ceil($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                dec %hp [ $+ [ %dmp1 ] ] %dhp1p1
                dec %hp [ $+ [ %dmp1 ] ] %dhp2p1
                msg $chan %dmp2 has hit a %dhp1p1 and %dhp2p1 on %dmp1 leaving %dmp1 with %hp [ $+ [ %dmp1 ] ] hp. Congratulations %dmp2 $+ , you won the Dm!
                dmwinner %dmp1 %dmp2
                stopdm
                Halt
              }
            }
            else {
              .notice $nick You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp2 ] ] $+ % of your spec energy left.
              msg $chan It is now %dmp1 $+ 's turn.
              set %turn %dmp1
            }
          }
        }
      }
    }
  } 
}
on *:TEXT:!gmaul*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          if (%froze [ $+ [ %dmp1 ] ]) {
            dec %froze [ $+ [ %dmp1 ] ]
            $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
            msg $chan It is now %dmp2 $+ 's turn.
            .notice $nick You have been frozen and may not attack with your gmaul.
            set %turn %dmp2
            halt
          }
          else {
            if (%spec [ $+ [ %dmp1 ] ] >= 100) {
              set %ghp1p2 $rand(0,20)
              set %ghp2p2 $rand(0,20)
              set %ghp3p2 $rand(0,20)
              if ($calc(%ghp1p2 + %ghp2p2 + %ghp3p2) < %hp [ $+ [ %dmp2 ] ]) {
                dec %hp [ $+ [ %dmp2 ] ] %ghp1p2
                dec %hp [ $+ [ %dmp2 ] ] %ghp2p2
                dec %hp [ $+ [ %dmp2 ] ] %ghp3p2
                dec %spec [ $+ [ %dmp1 ] ] 100
                .notice $nick You now have %spec [ $+ [ %dmp1 ] ] $+ % of your spec bar left.
                msg $chan %dmp1 has hit %dmp2 with their granite maul and has done %ghp1p2 $+ , %ghp2p2 and %ghp3p2 damage leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp.
                if (%spec [ $+ [ %dmp1 ] ] < 100) {
                  inc %spec [ $+ [ %dmp1 ] ] 5
                }
                msg $chan It is now %dmp2 $+ 's turn.
                set %turn %dmp2
                unset %ghp1p2
                unset %ghp2p2
                unset %ghp3p2
                halt
              }
              if ($calc(%ghp1p2 + %ghp2p2 + %ghp3p2) >= %hp [ $+ [ %dmp2 ] ]) {
                dec %hp [ $+ [ %dmp2 ] ] %ghp1p2
                set %ghp3p2 $floor($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp2p2 $ceil($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                dec %hp [ $+ [ %dmp2 ] ] %ghp3p2
                dec %hp [ $+ [ %dmp2 ] ] %ghp2p2
                msg $chan %dmp1 has hit %dmp2 with their granite maul and has done %ghp1p2 $+ , %ghp2p2 and %ghp3p2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left. Congratulations %dmp1 $+ , you won the Dm!
                dmwinner %dmp2 %dmp1
                stopdm
                Halt
              }
            }
            else {
              .notice $nick You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp1 ] ] $+ % of your spec energy left.
              msg $chan It is now %dmp2 $+ 's turn.
              set %turn %dmp2
            }
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          if (%froze [ $+ [ %dmp2 ] ]) {
            dec %froze [ $+ [ %dmp2 ] ]
            $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
            msg $chan It is now %dmp1 $+ 's turn.
            .notice $nick You have been frozen and may not attack with your gmaul.
            set %turn %dmp1
            halt
          }
          else {
            if (%spec [ $+ [ %dmp2 ] ] >= 100) {
              set %ghp1p1 $rand(0,20)
              set %ghp2p1 $rand(0,20)
              set %ghp3p1 $rand(0,20)
              if ($calc(%ghp1p1 + %ghp2p1 + %ghp3p1) < %hp [ $+ [ %dmp1 ] ]) {
                dec %hp [ $+ [ %dmp1 ] ] %ghp1p1
                dec %hp [ $+ [ %dmp1 ] ] %ghp2p1
                dec %hp [ $+ [ %dmp1 ] ] %ghp3p1
                dec %spec [ $+ [ %dmp2 ] ] 100
                .notice $nick You now have %spec [ $+ [ %dmp2 ] ] $+ % of your spec bar left.
                msg $chan %dmp2 has hit %dmp1 with their granite maul and has done %ghp1p1 $+ , %ghp2p1 and %ghp3p1 damage. %dmp1 has %hp [ $+ [ %dmp1 ] ] hp left.
                if (%spec [ $+ [ %dmp2 ] ] < 100) {
                  inc %spec [ $+ [ %dmp2 ] ] 5
                }
                msg $chan It is now %dmp1 $+ 's turn.
                set %turn %dmp1
                unset %ghp1p1
                unset %ghp2p1
                unset %ghp3p1
                halt
              }
              if ($calc(%ghp1p1 + %ghp2p1 + %ghp3p1) >= %hp [ $+ [ %dmp1 ] ]) {
                dec %hp [ $+ [ %dmp1 ] ] %ghp1p1
                set %ghp3p1 $floor($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp2p1 $ceil($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                dec %hp [ $+ [ %dmp1 ] ] %ghp3p1
                dec %hp [ $+ [ %dmp1 ] ] %ghp2p1
                msg $chan %dmp2 has hit %dmp1 with their granite maul and has done %ghp1p1 $+ , %ghp2p1 and %ghp3p1 damage. %dmp1 has %hp [ $+ [ %dmp1 ] ] hp left. Congratulations %dmp2 $+ , you won the Dm!
                dmwinner %dmp1 %dmp2
                stopdm
                Halt
              }
            }
            else {
              .notice $nick You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp2 ] ] $+ % of your spec energy left.
              msg $chan It is now %dmp1 $+ 's turn.
              set %turn %dmp1
            }
          }
        }
      }
    }
  }
}
on *:TEXT:!cbow*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          set %cbp2 $rand(0,25)
          dec %froze [ $+ [ %dmp1 ] ] 1
          $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
          if (%cbp2 < %hp [ $+ [ %dmp2 ] ]) {
            dec %hp [ $+ [ %dmp2 ] ] %cbp2
            msg $chan %dmp1 has hit %dmp2 with their crystal bow and has done %cbp2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left.
            if (%spec [ $+ [ %dmp1 ] ] < 100) {
              inc %spec [ $+ [ %dmp1 ] ] 5
            }
            msg $chan It is now %dmp2 $+ 's turn.
            set %turn %dmp2
            unset %cbp2
            halt
          }
          if (%cbp2 >= %hp [ $+ [ %dmp2 ] ]) {
            set %cbp2 %hp [ $+ [ %dmp2 ] ]
            dec %hp [ $+ [ %dmp2 ] ] %cbp2 
            msg $chan %dmp1 has hit a %cbp2 with their crystal bow leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp. Congratulations %dmp1 $+ , you won the Dm!
            dmwinner %dmp2 %dmp1
            stopdm
            Halt
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          set %cbp1 $rand(0,30)
          dec %froze [ $+ [ %dmp2 ] ] 1
          $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
          if (%cbp1 < %hp [ $+ [ %dmp1 ] ]) {
            dec %hp [ $+ [ %dmp1 ] ] %cbp1
            msg $chan %dmp2 has hit %dmp1 with their crystal bow and has done $+ %cbp1 damage. %dmp1 has $+ %hp [ $+ [ %dmp1 ] ] hp left.
            if (%spec [ $+ [ %dmp2 ] ] < 100) {
              inc %spec [ $+ [ %dmp2 ] ] 5
            }
            msg $chan It is now %dmp1 $+ 's turn.
            set %turn %dmp1
            unset %cbp1
            halt
          }
          if (%cbp1 >= %hp [ $+ [ %dmp1 ] ]) {
            set %cbp1 %hp [ $+ [ %dmp1 ] ]
            dec %hp [ $+ [ %dmp1 ] ] %cbp1
            msg $chan %dmp2 has hit a %cbp1 with their crystal bow leaving %dmp1 with %hp [ $+ [ %dmp1 ] ] hp. Congratulations %dmp2 $+ , you won the Dm!
            dmwinner %dmp1 %dmp2
            stopdm
            Halt
          }
        }
      }
    }
  }
}
on *:TEXT:!msb*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          dec %froze [ $+ [ %dmp1 ] ]
          $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
          if (%spec [ $+ [ %dmp1 ] ] >= 50) {
            set %msp1p2 $rand(0,20)
            set %msp2p2 $rand(0,20)
            if ($calc(%msp1p2 + %msp2p2) < %hp [ $+ [ %dmp2 ] ]) {
              dec %hp [ $+ [ %dmp2 ] ] %msp1p2
              dec %hp [ $+ [ %dmp2 ] ] %msp2p2
              dec %spec [ $+ [ %dmp1 ] ] 50
              .notice $nick You now have %spec [ $+ [ %dmp1 ] ] $+ % of your spec bar left.
              msg $chan %dmp1 has hit %dmp2 with their mage short bow and has done %msp1p2 and %msp2p2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left.
              if (%spec [ $+ [ %dmp1 ] ] < 100) {
                inc %spec [ $+ [ %dmp1 ] ] 5
              }
              msg $chan It is now %dmp2 $+ 's turn.
              set %turn %dmp2
              unset %msp1p2
              unset %msp2p2
              halt
            }
            if ($calc(%msp1p2 + %msp2p2) >= %hp [ $+ [ %dmp2 ] ]) {
              set %msp1p2 $floor($calc($($+(%,hp,$(%dmp2,2)),2)/2))
              set %msp2p2 $ceil($calc($($+(%,hp,$(%dmp2,2)),2)/2))
              dec %hp [ $+ [ %dmp2 ] ] %msp1p2
              dec %hp [ $+ [ %dmp2 ] ] %msp2p2
              msg $chan %dmp1 has hit a %msp1p2 and %msp2p2 on %dmp2 leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp. Congratulations %dmp1 $+ , you won the Dm!
              dmwinner %dmp2 %dmp1
              stopdm
              Halt
            }
          }
          else {
            .notice $nick You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp1 ] ] $+ % of your spec energy left.
            msg $chan It is now %dmp2 $+ 's turn.
            set %turn %dmp2
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          dec %froze [ $+ [ %dmp2 ] ]
          $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
          if (%spec [ $+ [ %dmp2 ] ] >= 25) {
            set %msp1p1 $rand(0,20)
            set %msp2p1 $rand(0,20)
            if ($calc(%msp1p1 + %msp2p1) < %hp [ $+ [ %dmp1 ] ]) {
              dec %hp [ $+ [ %dmp1 ] ] %msp2p1
              dec %hp [ $+ [ %dmp1 ] ] %msp1p1
              dec %spec [ $+ [ %dmp2 ] ] 50
              .notice $nick You now have %spec [ $+ [ %dmp2 ] ] $+ % of your spec bar left.
              msg $chan %dmp2 has hit %dmp1 with their mage short bow and has done $+ %msp1p1 and %msp2p1 damage. %dmp1 has $+ %hp [ $+ [ %dmp1 ] ] hp left.
              if (%spec [ $+ [ %dmp2 ] ] < 100) {
                inc %spec [ $+ [ %dmp2 ] ] 5
              }
              msg $chan It is now %dmp1 $+ 's turn.
              set %turn %dmp1
              unset %msp1p1
              unset %msp2p1
              halt
            }
            if ($calc(%msp1p1 + %msp2p1) >= %hp [ $+ [ %dmp1 ] ]) {
              set %msp1p1 $floor($calc($($+(%,hp,$(%dmp1,2)),2)/2))
              set %msp2p1 $ceil($calc($($+(%,hp,$(%dmp1,2)),2)/2))
              dec %hp [ $+ [ %dmp1 ] ] %msp1p1
              dec %hp [ $+ [ %dmp1 ] ] %msp2p1
              msg $chan %dmp2 has hit a %msp1p1 and %msp2p1 on %dmp1 leaving %dmp1 with %hp [ $+ [ %dmp1 ] ] hp. Congratulations %dmp2 $+ , you won the Dm!
              dmwinner %dmp1 %dmp2
              stopdm
              Halt
            }
          }
          else {
            .notice $nick You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp2 ] ] $+ % of your spec energy left.
            msg $chan It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          }
        }
      }
    }
  }
}
on *:TEXT:!ancient*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if (!$2) || (!$3) {
          .notice $nick Please specify a valid command.
          halt
        }
        else {
          if ($3 != blitz) && ($3 != burst) {
            .notice $nick Please specify a valid command.
            halt
          }
          if ($2 != blood) && ($2 != ice) {
            .notice $nick Please specify a valid command.
            halt
          }
          else {
            if ($nick == %dmp1) {
              if (%runes [ $+ [ %dmp1 ] ] < 1) {
                .notice $nick You do not have any runes left.
                set %turn %dmp2
                msg $chan It is now %dmp2 $+ 's turn.
                halt
              }
              .timerdmlimit off
              .timerdmlimit 1 60 switchturn %dmp2 %dmp1
              dec %froze [ $+ [ %dmp1 ] ]
              $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
              if ($3 == blitz) {
                if (%runes [ $+ [ %dmp1 ] ] < 2) {
                  .notice $nick You do not have enough runes to cast that spell.
                }
                else {
                  dec %runes [ $+ [ %dmp1 ] ] 2
                  set %ahp2 $rand(0,25)
                  if ($2 == ice) {
                    set %froze [ $+ [ %dmp2 ] ] 2
                    .notice %dmp2 You have been frozen for %froze [ $+ [ %dmp2 ] ] turns. You may only attack with range or mage attacks.
                  }
                  if ($2 == blood) {
                    set %hp [ $+ [ %dmp1 ] ] $calc(%hp [ $+ [ %dmp1 ] ] + $floor($calc(%ahp2 / 4)))
                    if (%hp [ $+ [ %dmp1 ] ] > 99) {
                      set %hp [ $+ [ %dmp1 ] ] 99
                    }
                    .notice $nick You now have %hp [ $+ [ %dmp1 ] ] hp.
                  }
                }
              }
              if ($3 == burst) {
                dec %runes [ $+ [ %dmp1 ] ]
                set %ahp2 $rand(0,15)
                if ($2 == ice) {
                  set %froze [ $+ [ %dmp2 ] ] 1
                  .notice %dmp2 You have been frozen for %froze [ $+ [ %dmp2 ] ] turns. You may only attack with range or mage attacks.
                }
                if ($2 == blood) {
                  set %hp [ $+ [ %dmp1 ] ] $calc(%hp [ $+ [ %dmp1 ] ] + $floor($calc(%ahp2 / 4)))
                  if (%hp [ $+ [ %dmp1 ] ] > 99) {
                    set %hp [ $+ [ %dmp1 ] ] 99
                  }
                  .notice $nick You now have %hp [ $+ [ %dmp1 ] ] hp.
                }
              }
              if (%ahp2 < %hp [ $+ [ %dmp2 ] ]) {
                dec %hp [ $+ [ %dmp2 ] ] %ahp2
                msg %dmchan %dmp1 has cast an ancient attack on %dmp2 and has done %ahp2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left.
                .notice $nick You have %runes [ $+ [ %dmp1 ] ] casts left.
                if (%spec [ $+ [ %dmp1 ] ] < 100) {
                  inc %spec [ $+ [ %dmp1 ] ] 5
                }
                msg $chan It is now %dmp2 $+ 's turn.
                set %turn %dmp2
                unset %ahp2
                halt
              }
              if (%ahp2 => %hp [ $+ [ %dmp2 ] ]) {
                set %ahp2 %hp [ $+ [ %dmp2 ] ]
                dec %hp [ $+ [ %dmp2 ] ] %ahp2 
                msg %dmchan %dmp1 has cast an ancient attack on %dmp2 and has done %ahp2 damage leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp. Congratulations %dmp1 $+ , you won the Dm!
                dmwinner %dmp2 %dmp1
                stopdm
                halt
              }
            }
            if ($nick == %dmp2) {
              if (%runes [ $+ [ %dmp2 ] ] < 1) {
                .notice $nick You do not have any runes left.
                set %turn %dmp2
                msg $chan It is now %dmp1 $+ 's turn.
                halt
              }
              .timerdmlimit off
              .timerdmlimit 1 60 switchturn %dmp1 %dmp2
              dec %froze [ $+ [ %dmp2 ] ]
              $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
              if ($3 == blitz) {
                if (%runes [ $+ [ %dmp2 ] ] < 2) {
                  .notice $nick You do not have enough runes to cast that spell.
                }
                else {
                  dec %runes [ $+ [ %dmp2 ] ] 2
                  set %ahp1 $rand(0,25)
                  if ($2 == ice) {
                    set %froze [ $+ [ %dmp1 ] ] 2
                    .notice %dmp1 You have been frozen for %froze [ $+ [ %dmp1 ] ] turns. You may only attack with range or mage attacks.
                  }
                  if ($2 == blood) {
                    set %hp [ $+ [ %dmp2 ] ] $calc(%hp [ $+ [ %dmp2 ] ] + $floor($calc(%ahp1 / 4)))
                    if (%hp [ $+ [ %dmp2 ] ] > 99) {
                      set %hp [ $+ [ %dmp2 ] ] 99
                    }
                    .notice $nick You now have %hp [ $+ [ %dmp2 ] ] hp.
                  }
                }
              }
              if ($3 == burst) {
                dec %runes [ $+ [ %dmp2 ] ]
                set %ahp1 $rand(0,15)
                if ($2 == ice) {
                  set %froze [ $+ [ %dmp1 ] ] 1
                  .notice %dmp1 You have been frozen for %froze [ $+ [ %dmp1 ] ] turns. You may only attack with range or mage attacks.
                }
                if ($2 == blood) {
                  set %hp [ $+ [ %dmp2 ] ] $calc(%hp [ $+ [ %dmp2 ] ] + $floor($calc(%ahp1 / 4)))
                  if (%hp [ $+ [ %dmp2 ] ] > 99) {
                    set %hp [ $+ [ %dmp2 ] ] 99
                  }
                  .notice $nick You now have %hp [ $+ [ %dmp2 ] ] hp.
                }
              }
              if (%ahp1 < %hp [ $+ [ %dmp1 ] ]) {
                dec %hp [ $+ [ %dmp1 ] ] %ahp1
                msg %dmchan %dmp2 has cast an ancient attack on %dmp1 and has done %ahp1 damage. %dmp1 has %hp [ $+ [ %dmp1 ] ] hp left.
                .notice $nick You have %runes [ $+ [ %dmp2 ] ] casts left.
                if (%spec [ $+ [ %dmp1 ] ] < 100) {
                  inc %spec [ $+ [ %dmp1 ] ] 5
                }
                msg $chan It is now %dmp1 $+ 's turn.
                set %turn %dmp1
                unset %ahp1
                halt
              }
              if (%ahp1 => %hp [ $+ [ %dmp1 ] ]) {
                set %ahp1 %hp [ $+ [ %dmp1 ] ]
                dec %hp [ $+ [ %dmp1 ] ] %ahp1 
                msg %dmchan %dmp2 has cast an ancient attack on %dmp1 and has done %ahp1 damage leaving %dmp1 with %hp [ $+ [ %dmp1 ] ] hp. Congratulations %dmp2 $+ , you won the Dm!
                dmwinner %dmp2 %dmp1
                stopdm
                halt
              }
            }
          }
        }
      }
    }
  }
}
on *:TEXT:!dh*:#:{
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp2 %dmp1
          if (%froze [ $+ [ %dmp1 ] ]) {
            dec %froze [ $+ [ %dmp1 ] ]
            $iif(%froze [ $+ [ %dmp1 ] ] <= 0, unset %froze [ $+ [ %dmp1 ] ])
            msg $chan It is now %dmp2 $+ 's turn.
            .notice $nick You have been frozen and may not attack with your dharoks.
            set %turn %dmp2
            halt
          }
          else {
            if (%dhu [ $+ [ %dmp1 ] ]) {
              msg $chan It is now %dmp2 $+ 's turn.
              .notice $nick You have used your dharoks before, and may not fight in fully degraded armour.
              set %turn %dmp2
              halt
            }
            else {
              set %dhp2 $rand(0,$floor($calc($calc(100 - %hp [ $+ [ %dmp1 ] ] ) / 3 * $rand($calc( 1 / 2 ),2))))
              if (%dhp2 < %hp [ $+ [ %dmp2 ] ]) {
                dec %hp [ $+ [ %dmp2 ] ] %dhp2
                msg $chan %dmp1 has hit %dmp2 with their dharoks and has done %dhp2 damage. %dmp2 has %hp [ $+ [ %dmp2 ] ] hp left.
                if (%spec [ $+ [ %dmp1 ] ] < 100) {
                  inc %spec [ $+ [ %dmp1 ] ] 5
                }
                msg $chan It is now %dmp2 $+ 's turn.
                set %turn %dmp2
                set %dhu [ $+ [ %dmp1 ] ] 1
                unset %dhp2
                halt
              }
              if (%dhp2 >= %hp [ $+ [ %dmp2 ] ]) {
                set %dhp2 %hp [ $+ [ %dmp2 ] ]
                dec %hp [ $+ [ %dmp2 ] ] %dhp2 
                msg $chan %dmp1 has hit a %dhp2 with their dharoks leaving %dmp2 with %hp [ $+ [ %dmp2 ] ] hp. Congratulations %dmp1 $+ , you won the Dm!
                dmwinner %dmp2 %dmp1
                stopdm
                Halt
              }
            }
          }       
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 60 switchturn %dmp1 %dmp2
          if (%froze [ $+ [ %dmp2 ] ]) {
            dec %froze [ $+ [ %dmp2 ] ]
            $iif(%froze [ $+ [ %dmp2 ] ] <= 0, unset %froze [ $+ [ %dmp2 ] ])
            .notice $nick You have been frozen and may not attack with your dharoks.
            msg $chan It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          }
          else {
            if (%dhu [ $+ [ %dmp2 ] ]) {
              msg $chan It is now %dmp1 $+ 's turn.
              .notice $nick You have used your dharoks before, and may not fight in fully degraded armour.
              set %turn %dmp1
              halt
            }
            set %dhp1 $rand(0,$floor($calc($calc(100 - %hp [ $+ [ %dmp2 ] ] ) / 3 * $rand($calc(1 / 2),2))))
            if (%dhp1 < %hp [ $+ [ %dmp1 ] ]) {
              dec %hp [ $+ [ %dmp1 ] ] %dhp1
              msg $chan %dmp2 has hit %dmp1 with their dharoks and has done $+ %dhp1 damage. %dmp1 has $+ %hp [ $+ [ %dmp1 ] ] hp left.
              if (%spec [ $+ [ %dmp2 ] ] < 100) {
                inc %spec [ $+ [ %dmp2 ] ] 5
              }
              msg $chan It is now %dmp1 $+ 's turn.
              set %turn %dmp1
              set %dhu [ $+ [ %dmp2 ] ] 1
              unset %dhp1
              halt
            }
            if (%dhp1 >= %hp [ $+ [ %dmp1 ] ]) {
              set %dhp1 %hp [ $+ [ %dmp1 ] ]
              dec %hp [ $+ [ %dmp1 ] ] %dhp1
              msg $chan %dmp2 has hit a %dhp1 with their dharoks leaving %dmp1 with %hp [ $+ [ %dmp1 ] ] hp. Congratulations %dmp2 $+ , you won the Dm!
              dmwinner %dmp1 %dmp2
              stopdm
              Halt
            }
          }
        }
      }
    }
  }
}