All pastes #406662 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-03-22 16:20 UTC
rendered paste body
alias unsetdm {
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  .msg %dmchan 2Nobody 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 {
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  /unset %dmstart
  /unset %dmrun
  /unset %hp*
  /unset %food*
  /unset %spec* 
  /unset %dmp*
  /unset %dhp*
  /unset %whp*
  /unset %ghp*
  /unset %turn
  /unset %dmchan
}
alias switchturn {
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  msg %dmchan 2 $1 has not made an action in 30 seconds, it is now $2 $+ 's turn.
  set %turn $2
}

on *:TEXT:!dm:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if (%dmstart) && (!%dmrun) {
    if ($nick == %dmp1) {
      .notice $nick 2You may not fight yourself.
      /halt
    }
    /unset %dmstart

    .msg $chan 2 $nick Has joined The dm against %dmp1
    /set %dmp2 $nick
    .msg $chan 2The fighters in this DM are %dmp1 and %dmp2
    .msg $chan 2Both fighters will recieve 220 2sharks which heal 20 and start with the maximum of 399 2HP
    /unset %dmstart
    /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 %firstp $rand(1,2)
    if (%firstp == 1) {
      /set %turn %dmp1 
      .msg $chan 2 %dmp1 gets the first attack!
      /unset %firstp
    }
    if (%firstp == 2) {
      /set %turn %dmp2
      .msg $chan 2 %dmp2 gets the first attack!
      /unset %firstp
    }
  }
  elseif (!%dmrun) {
    .msg $chan 2 $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 2Sorry, there is already a Dm running, please wait for that one to end.
  }
  if (%dmrun) {
    /.timerdm off
  }
}
on *:TEXT:!stopdm:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if ($nick == %dmp1) || ($nick == %dmp2) || ($nick isop %dmchan) || ($nick == Locke) {
    if (%dmstart) {
      msg $chan 2The Dm invitation has been closed by $nick $+ .
    }
    elseif (%dmrun) {
      msg $chan 2The Dm between %dmp1 and %dmp2 has been ended by $nick $+ .
    }
    else {
      .notice $nick 2There is no Dm to stop.
    }
    timerdm off
    stopdm
  }
}
on *:TEXT:!dmcommands:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  .notice $nick 2!Whip Will attack your opponent with your whip.  It will also decrease your Special Energy by 25%. The max hit is 35.
  .notice $nick 2!Dds Will attack your opponent twice with a dds. It will also decrease your Special Energy by 25%. The max hit on each of the attacks is 25.
  .notice $nick 2!Gmaul Will attack your opponent three times with a granite maul. The max hit on each of the attacks is 20.
  .notice $nick 2!Eat Will eat a shark and increase your health by 100%. 
  .notice $nick 2!Spec Will check your special energy bar.
  .notice $nick 2!Food Will check the amount of food you have left.
  .notice $nick 2!Stopdm will stop the Dm if you are a deathmatch player or an op in the channel.
}
on *:TEXT:!spec*:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if ($nick == %dmp1) {
    .notice $nick 2You have %spec [ $+ [ %dmp1 ] ] $+ % special energy left.
  }
  elseif ($nick == %dmp2) { 
    .notice $nick 2You have %spec [ $+ [ %dmp2 ] ] $+ % special energy left.
  }
  else {
    .notice $nick 2You are not fighting in this Dm.
  }
}
on *:TEXT:!food*:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if ($nick == %dmp1) {
    .notice $nick 2You have %food [ $+ [ %dmp1 ] ] sharks left.
  }
  elseif ($nick == %dmp2) { 
    .notice $nick 2You have %food [ $+ [ %dmp2 ] ] sharks left.
  }
  else {
    .notice $nick 2You are not fighting in this Dm.
  }
}
on *:TEXT:!eat*:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick 2You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick 2It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp2 %dmp1
          if (%food [ $+ [ %dmp1 ] ] > 0) {
            set %hp [ $+ [ %dmp1 ] ] $calc(%hp [ $+ [ %dmp1 ] ] + 20)
            if (%hp [ $+ [ %dmp1 ] ] > 99) {
              set %hp [ $+ [ %dmp1 ] ] 99
            }
            dec %food [ $+ [ %dmp1 ] ] 1
            if (%spec [ $+ [ %dmp1 ] ] < 100) {
              inc %spec [ $+ [ %dmp1 ] ] 5
            }
            msg $chan 2 $nick has eaten a shark. You now have 3 $+ %hp [ $+ [ %dmp1 ] ] 2hp.
            .notice $nick 2You have %food [ $+ [ %dmp1 ] ] sharks left. 
            msg $chan 2It is now %dmp2 $+ 's turn.
            set %turn %dmp2
          } 
          else { 
            .notice $nick 2Sorry, you have no food left to eat.
            set %turn %dmp2
            msg $chan  2It is now %dmp2 $+ 's turn.
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp1 %dmp2
          if (%food [ $+ [ %dmp2 ] ] > 0) {
            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 2 $nick has eaten a shark. You now have 3 $+ %hp [ $+ [ %dmp2 ] ] 2hp.
            .notice $nick 2You have %food [ $+ [ %dmp2 ] ] sharks left.
            msg $chan 2It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          } 
          else { 
            .notice $nick 2Sorry, you have no food left to eat.
            set %turn %dmp1
            msg $chan  2It is now %dmp1 $+ 's turn.
          }
        }
      }
    }
  }
}
on *:TEXT:!whip*:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick 2You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick 2It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp2 %dmp1
          set %whp2 $rand(0,35)
          if (%whp2 < %hp [ $+ [ %dmp2 ] ]) {
            dec %hp [ $+ [ %dmp2 ] ] %whp2
            msg $chan 2 %dmp1 has hit %dmp2 with their whip and has done4 %whp2 2damage. %dmp2 has3 %hp [ $+ [ %dmp2 ] ] 2hp left.
            if (%spec [ $+ [ %dmp1 ] ] < 100) {
              inc %spec [ $+ [ %dmp1 ] ] 5
            }
            msg $chan 2It 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 2 %dmp1 has hit a4 %whp2 2with their whip leaving %dmp2 with3 %hp [ $+ [ %dmp2 ] ] 2hp. Congratulations %dmp1 $+ , you won the Dm!
            stopdm
            Halt
          } 
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp1 %dmp2
          set %whp1 $rand(0,35)
          if (%whp1 < %hp [ $+ [ %dmp1 ] ]) {
            dec %hp [ $+ [ %dmp1 ] ] %whp1
            msg $chan 2 %dmp2 has hit %dmp1 with their whip and has done 4 $+ %whp1 2damage. %dmp1 has 3 $+ %hp [ $+ [ %dmp1 ] ] 2hp left.
            if (%spec [ $+ [ %dmp2 ] ] < 100) {
              inc %spec [ $+ [ %dmp2 ] ] 5
            }
            msg $chan 2 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 2 %dmp2 has hit a4 %whp1 2with their whip leaving %dmp1 with3 %hp [ $+ [ %dmp1 ] ] 2hp. Congratulations %dmp2 $+ , you won the Dm!
            stopdm
            Halt
          }
        }
      }
    }
  }
  else {
    .notice $nick 2A DM is not running and thus you may not attack your opponent.
  }
}
on *:TEXT:!dds*:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick 2You are not fighting in this Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick 2It is not your turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp2 %dmp1
          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 2You now have %spec [ $+ [ %dmp1 ] ] $+ % of your spec bar left.
              msg $chan 2 %dmp1 has hit %dmp2 with their dds and has done 4 %dhp1p2 2and 4 %dhp2p2 2damage. %dmp2 has3 %hp [ $+ [ %dmp2 ] ] 2hp left.
              if (%spec [ $+ [ %dmp1 ] ] < 100) {
                inc %spec [ $+ [ %dmp1 ] ] 5
              }
              msg $chan 2It 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 2 %dmp1 has hit a4 %dhp1p2 and4 %dhp2p2 2on %dmp2 leaving %dmp2 with3 %hp [ $+ [ %dmp2 ] ] 2hp. Congratulations %dmp1 $+ , you won the Dm!
              stopdm
              Halt
            } 
          }
          else { 
            .notice $nick 2You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp1 ] ] $+ % of your spec energy left.
            msg $chan 2It is now %dmp2 $+ 's turn.
            set %turn %dmp2
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp1 %dmp2
          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 2You now have %spec [ $+ [ %dmp2 ] ] $+ % of your spec bar left.
              msg $chan 2 %dmp2 has hit %dmp1 with their dds and has done 4 $+ %dhp1p1 2 and 4 %dhp2p1 2damage. %dmp1 has 3 $+ %hp [ $+ [ %dmp1 ] ] 2hp left.
              if (%spec [ $+ [ %dmp2 ] ] < 100) {
                inc %spec [ $+ [ %dmp2 ] ] 5
              }
              msg $chan 2It 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 2 %dmp2 has hit a4 %dhp1p1  and4 %dhp2p1 2on %dmp1 leaving %dmp1 with3 %hp [ $+ [ %dmp1 ] ] 2hp. Congratulations %dmp2 $+ , you won the Dm!
              stopdm
              Halt
            }
          }
          else {
            .notice $nick 2You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp2 ] ] $+ % of your spec energy left.
            msg $chan 2It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          }
        }
      }
    }
  }
  else {
    .notice $nick 2A DM is not running and thus you may not attack your opponent.
  }
}
on *:TEXT:!gmaul*:#:{
  if (%dm.script [ $+ [ $chan ] ] == OFF) { Halt }
  if (%dmrun) {
    if ($nick != %dmp1) && ($nick != %dmp2) {
      .notice $nick 14You are not fighting in this4 Dm.
    }
    else {
      if ($nick != %turn) {
        .notice $nick 14It is not 4your14 turn.
      }
      else {
        if ($nick == %dmp1) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp2 %dmp1
          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 14You now have4 %spec [ $+ [ %dmp1 ] ] $+ % 14of your spec bar left.
              msg $chan 4 %dmp1 14has hit4 %dmp2 with their 4granite maul14 and has done4 %ghp1p2 $+ , %ghp2p2 14 and4 %ghp3p2 14damage leaving4 %dmp2 14with4 %hp [ $+ [ %dmp2 ] ] 14hp.
              if (%spec [ $+ [ %dmp1 ] ] < 100) {
                inc %spec [ $+ [ %dmp1 ] ] 5
              }
              msg $chan 14It is now4 %dmp2 $+ 's 14turn.
              set %turn %dmp2
              unset %ghp1p2
              unset %ghp2p2
              unset %ghp3p2
              halt
            }
            if ($calc(%ghp1p2 + %ghp2p2 + %ghp3p2) >= %hp [ $+ [ %dmp2 ] ]) {
              set %ghpcv1 $rand(1,3)
              if (%ghpcv1 = 1) { 
                set %ghp1p2 $floor($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp2p2 $ceil($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp3p2 0
              }
              if (%ghpcv1 = 2) {
                set %ghp1p2 $floor($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp3p2 $ceil($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp2p2 0
              }
              if (%ghpcv1 = 3) {
                set %ghp3p2 $floor($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp2p2 $ceil($calc($($+(%,hp,$(%dmp2,2)),2)/2))
                set %ghp1p2 0
              }
              dec %hp [ $+ [ %dmp2 ] ] %ghp3p2
              dec %hp [ $+ [ %dmp2 ] ] %ghp2p2
              dec %hp [ $+ [ %dmp2 ] ] %ghp1p2
              msg $chan 4 %dmp1 14has hit4 %dmp2 14with their 4granite maul 14and has done4 %ghp1p2 $+ , 14 %ghp2p2 4 and4 %ghp3p2 14damage.4 %dmp2 14has4 %hp [ $+ [ %dmp2 ] ] 14hp left. Congratulations 4 %dmp1 $+ 14, you won the 4Dm!
              stopdm
              Halt
            } 
          }
          else { 
            .notice $nick 14You do not have enough4 spec energy14 to do that. You have %spec [ $+ [ %dmp1 ] ] $+ % of your spec energy left.
            msg $chan 14It is now4 %dmp2 $+ 's 14turn.
            set %turn %dmp2
          }
        }
        if ($nick == %dmp2) {
          .timerdmlimit off
          .timerdmlimit 1 30 switchturn %dmp1 %dmp2
          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 2You now have %spec [ $+ [ %dmp2 ] ] $+ % of your spec bar left.
              msg $chan 4 %dmp2 14has hit 4 %dmp1 14with their 4granite maul14 and has done4 %ghp1p1 $+ , 14 %ghp2p1 14and4 %ghp3p1 14damage.4 %dmp1 has14 %hp [ $+ [ %dmp1 ] ] 14hp left.
              if (%spec [ $+ [ %dmp2 ] ] < 100) {
                inc %spec [ $+ [ %dmp2 ] ] 5
              }
              msg $chan 14It is now 4 %dmp1 $+ 's turn.
              set %turn %dmp1
              unset %ghp1p1
              unset %ghp2p1
              unset %ghp3p1
              halt
            }
            if ($calc(%ghp1p1 + %ghp2p1 + %ghp3p1) >= %hp [ $+ [ %dmp1 ] ]) {
              set %ghpcv2 $rand(1,3)
              if (%ghpcv2 = 1) { 
                set %ghp1p1 $floor($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp2p1 $ceil($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp3p1 0
              }
              if (%ghpcv2 = 2) {
                set %ghp1p1 $floor($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp3p1 $ceil($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp2p1 0
              }
              if (%ghpcv2 = 3) {
                set %ghp3p1 $floor($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp2p1 $ceil($calc($($+(%,hp,$(%dmp1,2)),2)/2))
                set %ghp1p1 0
              }
              dec %hp [ $+ [ %dmp1 ] ] %ghp3p1
              dec %hp [ $+ [ %dmp1 ] ] %ghp2p1
              dec %hp [ $+ [ %dmp1 ] ] %ghp1p1
              msg $chan 2 %dmp2 has hit %dmp1 with their granite maul and has done4 %ghp1p1 $+ , 4 %ghp2p1  and4 %ghp3p1 2damage. %dmp1 has3 %hp [ $+ [ %dmp1 ] ] 2hp left. Congratulations %dmp2 $+ , you won the Dm!
              stopdm
              Halt
            }
          }
          else {
            .notice $nick 2You do not have enough spec energy to do that. You have %spec [ $+ [ %dmp2 ] ] $+ % of your spec energy left.
            msg $chan 2It is now %dmp1 $+ 's turn.
            set %turn %dmp1
          }
        }
      }
    }
  }
  else {
    .notice $nick 2A DM is not running and thus you may not attack your opponent.
  }
}