All pastes #483754 Raw Edit

Untitled

public text v1 · immutable
·published 2007-05-11 21:33 UTC
rendered paste body
on *:TEXT:*:#:{
  if ($1 == !dm) {
    if (($readini(duels.ini,$chan,$nick)) || ($readini(duels.ini,$chan,prime) == $nick)) notice $nick sorry you're already either in a duel or waiting to join one..
    else {
      if (!$ini(duels.ini,$chan)) {
        msg $chan $nick has initiated the dm script... anyone brave enough to challenge $nick $+ ? if so type !dm
        writeini duels.ini $chan prime $nick
        $+(.timer,$chan) 1 20 check_duel $chan
      }
      else {
        if (!$readini(duels.ini,$chan,duel)) {
          if ((!$istok($readini(duels.ini,$chan,ohahaha),$nick,58)) && ($readini(duels.ini,$chan,prime) != $nick)) {
            writeini duels.ini $chan ohahaha $readini(duels.ini,$chan,ohahaha) $+ $nick $+ :
            msg $chan $nick has joined the waiting list to join the current dm.
            writeini duels.ini $chan $calc($ini(duels.ini,$chan,0) + 1) $nick
          }
          else .notice $nick please don't spam the !dm command...
        }
        else msg $chan sorry $nick there is a\no dm in progress.
      }
    }
  }
  if ($1 == !slash) {
    if ($readini(duels.ini,$chan,duel)) swing_duel $chan $nick
  }
  if ($1 == !dds) {
    if ($readini(duels.ini,$chan,duel)) dds_duel $chan $nick
  }
  if ($1 == !gmaul) {
    if ($readini(duels.ini,$chan,duel)) gmaul_duel $chan $nick
  }
  if ($1 == !eat) {
    if ($readini(duels.ini,$chan,duel)) eat_duel $chan $nick
  }
  if ($1 == !stopdm) {
    if (($nick isop $chan) || ($nick ishop $chan)) endgame $chan !@#$^& $nick
    else {
      if (($nick isin $readini(duels.ini,$chan,duel)) || ($timer($chan).secs)) { endgame $chan !@#$^& $nick }
      else notice $nick you much be in a game or there must be a game about to start for you to do that.
    }
  }
  if ($1 == !spec) {
    if ($readini(duels.ini,$chan,$+(spec,.,$nick))) notice $nick you have $v1 spec left.
    else notice $nick you're not playing at the moment.
  }
}
alias check_duel {
  remini duels.ini $1 ohahaha
  if ($ini(duels.ini,$1,0) >= 2) {
    var %a = $rand(1,$ini(duels.ini,$1,0))
    while ($readini(duels.ini,$1,$ini(duels.ini,$1,%a)) == $readini(duels.ini,$1,prime)) %a = $rand(1,$ini(duels.ini,$1,0))
    var %duel = $readini(duels.ini,$1,$ini(duels.ini,$1,%a)) $+ ~ $+ $readini(duels.ini,$1,prime)
    remini duels.ini $1
    writeini duels.ini $1 $gettok(%duel,2,126) 99
    writeini duels.ini $1 $gettok(%duel,1,126) 99
    writeini duels.ini $1 duel %duel
    startgame $1 
  }
  else {
    msg $1 removing the game file, not enough players..
    endgame $1
  }
}
alias endgame {
  if ($timer($1)) $+(timer,$1) off
  remini duels.ini $1 ohahaha
  if (!$2) remini duels.ini $1
  else {
    if ($2 == !@#$^&) msg $1 Game was ended by $3
    else {
      var %hs1 = $readini(duels.ini,alltime,$2), %hs2 = $readini(duels.ini,alltime,$3), %n1 = $2, %n2 = $3, %dmchan = $1
      tokenize 32 %hs1
      if (!$1-) { writeini duels.ini alltime %n1 0 0 | tokenize 32 0 0 }
      writeini duels.ini alltime %n1 $calc($1 + 1) $2
      tokenize 32 %hs2
      if (!$1-) { writeini duels.ini alltime %n2 0 0 | tokenize 32 0 0 }
      echo -a 2-2 $1-
      writeini duels.ini alltime %n2 $1 $calc($2 + 1)
      tokenize 32 $readini(duels.ini,alltime,%n1)
      msg %dmchan %n1 won the dm, %n1 $+ 's stats, Wins: $1 Loses: $2 Total: $calc($1 + $2)
      remini duels.ini %dmchan
      halt
    }
    remini duels.ini $1
  }
}
alias startgame {
  tokenize 126 $+($readini(duels.ini,$1,duel),~,$1)
  writeini duels.ini $3 $+($3,.,turn) $r(1,2)
  writeini duels.ini $3 $+(food,.,$1) 20
  writeini duels.ini $3 $+(food,.,$2) 20
  writeini duels.ini $3 $+(spec,.,$1) 10
  writeini duels.ini $3 $+(spec,.,$2) 10
  msg $3 Players this round: $1 vs $2
  msg $3 Dm has started.. gave both fighters 99 hp and 20 sharks (heals 20). (max hit is 37)
  msg $3 OOhOooOoh $($+($,$readini(duels.ini,$3,$+($3,.,turn))),2) attacks first!
}
alias eat_duel {
  tokenize 126 $+($readini(duels.ini,$1,duel),~,$1,~,$2)
  var %hitter = $($+($,$readini(duels.ini,$3,$+($3,.,turn))),2)
  if ($4 == %hitter) {
    var %next = $iif($readini(duels.ini,$3,$+($3,.,turn)) == 2,1,2)
    if ($readini(duels.ini,$3,$+(food,.,%hitter)) >= 1) {
      var %prev = $readini(duels.ini,$3,$4), %new = $iif($calc(%prev + 20) >= 99,$v2,$v1)
      writeini duels.ini $3 $4 %new
      writeini duels.ini $3 $+(food,.,$4) $calc($readini(duels.ini,$3,$+(food,.,$4)) - 1)
      .notice $4 You have $readini(duels.ini,$3,$+(food,.,$4)) sharks left. old hp: %prev current: %new
      writeini duels.ini $3 $+($3,.,turn) %next
      msg $3 it's now $($+($,%next),2) $+ 's turn.      
    }
    else .notice $4 you have no food...
  }
  else .notice $4 its not your turn.
}
alias swing_duel {
  tokenize 126 $+($readini(duels.ini,$1,duel),~,$1,~,$2)
  var %hitter = $($+($,$readini(duels.ini,$3,$+($3,.,turn))),2)
  if ($4 == %hitter) {
    var %next = $iif($readini(duels.ini,$3,$+($3,.,turn)) == 2,1,2)
    var %hit = $iif($r(0,37) >= $readini(duels.ini,$3,$($+($,%next),2)),$v2,$v1)
    writeini duels.ini $3 $($+($,%next),2) $iif($calc($readini(duels.ini,$3,$($+($,%next),2)) - %hit) < 0,0,$v1)
    msg $3 %hitter did a $+($chr(3),05,$chr(123),%hit,$chr(125),$chr(3)) on $($+($,%next),2) leaving $($+($,%next),2) with 4 $+ $readini(duels.ini,$3,$($+($,%next),2))) $+  hp.
    if ($readini(duels.ini,$3,$($+($,%next),2)) == 0) endgame $3 $4 $($+($,%next),2)
    else {
      writeini duels.ini $3 $+($3,.,turn) %next
      msg $3 it's now $($+($,%next),2) $+ 's turn.
    }
  }
  .else notice $4 its not your turn.
}
alias dds_duel {
  tokenize 126 $+($readini(duels.ini,$1,duel),~,$1,~,$2)
  var %hitter = $($+($,$readini(duels.ini,$3,$+($3,.,turn))),2)
  if ($4 == %hitter) {
    var %next = $iif($readini(duels.ini,$3,$+($3,.,turn)) == 2,1,2)
    if ($readini(duels.ini,$3,$+(spec,.,%hitter)) < 2.5) {
      notice %hitter you don't have enough special energy to do that. $v1 $+ /10
      writeini duels.ini $3 $+($3,.,turn) %next
      msg $3 it's now $($+($,%next),2) $+ 's turn.
      halt
    }
    var %left = $readini(duels.ini,$3,$+(spec,.,%hitter))
    writeini duels.ini $3 $+(spec,.,%hitter) $calc(%left - 2.5)
    notice %hitter you have $calc(%left - 2.5) $+ /10 special energy left.
    var %hittedlife = $readini(duels.ini,$3,$($+($,%next),2))
    var %hit1 = $iif($r(0,35) >= %hittedlife,$v2,$v1)
    dec %hittedlife %hit1
    var %hit2 = $iif($r(0,35) >= %hittedlife,$v2,$v1)
    dec %hittedlife %hit2 
    writeini duels.ini $3 $($+($,%next),2) %hittedlife
    msg $3 %hitter did a $+($chr(3),05,$chr(123),%hit1,$chr(125),$chr(3)) && $+($chr(3),05,$chr(123),%hit2,$chr(125),$chr(3)) on $($+($,%next),2) leaving $($+($,%next),2) with 4 $+ %hittedlife $+  hp.
    if ($readini(duels.ini,$3,$($+($,%next),2)) == 0) endgame $3 $4 $($+($,%next),2)
    else {
      writeini duels.ini $3 $+($3,.,turn) %next
      msg $3 it's now $($+($,%next),2) $+ 's turn.
    }
  }
  else notice $4 its not your turn.
}
alias gmaul_duel {
  tokenize 126 $+($readini(duels.ini,$1,duel),~,$1,~,$2)
  var %hitter = $($+($,$readini(duels.ini,$3,$+($3,.,turn))),2)
  if ($4 == %hitter) {
    var %next = $iif($readini(duels.ini,$3,$+($3,.,turn)) == 2,1,2)
    if ($readini(duels.ini,$3,$+(spec,.,%hitter)) < 10) {
      notice %hitter you don't have enough special energy to do that. $v1 $+ /10
      writeini duels.ini $3 $+($3,.,turn) %next
      msg $3 it's now $($+($,%next),2) $+ 's turn.
      halt
    }
    writeini duels.ini $3 $+(spec,.,%hitter) 0
    notice %hitter you have 0/10 special energy left.
    var %hittedlife = $readini(duels.ini,$3,$($+($,%next),2))
    var %hit1 = $iif($r(0,30) >= %hittedlife,$v2,$v1)
    dec %hittedlife %hit1
    var %hit2 = $iif($r(0,30) >= %hittedlife,$v2,$v1)
    dec %hittedlife %hit2
    var %hit3 = $iif($r(0,30) >= %hittedlife,$v2,$v1)
    dec %hittedlife %hit3
    writeini duels.ini $3 $($+($,%next),2) %hittedlife
    msg $3 %hitter did a $+($chr(3),05,$chr(123),%hit1,$chr(125),$chr(3)) && $+($chr(3),05,$chr(123),%hit2,$chr(125),$chr(3)) && $+($chr(3),05,$chr(123),%hit3,$chr(125),$chr(3)) on $($+($,%next),2) leaving $($+($,%next),2) with 4 $+ %hittedlife $+  hp.
    if ($readini(duels.ini,$3,$($+($,%next),2)) == 0) endgame $3 $4 $($+($,%next),2)
    else {
      writeini duels.ini $3 $+($3,.,turn) %next
      msg $3 it's now $($+($,%next),2) $+ 's turn.
    }
  }
  else notice $4 its not your turn.
}