All pastes #390258 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-03-11 09:03 UTC
rendered paste body
alias -l dm {
  return $hget(dm $+ $1 $+ . [ $+ [ $chan ] ],$2)
}
alias -l player {
  return $hget(dmsettings. [ $+ [ $chan ] ],player $+ $1 $+ )
}
on $*:TEXT:/[!@.](dm|deathmatch)+/Si:#ss-bot: {
  if ($hget(dmsettings. [ $+ [ $chan ] ],Player1) == $nick || $hget(dmsettings. [ $+ [ $chan ] ],Player2) == $nick) {
    notice $nick 12Your already in the game.
    halt
  } 
  if ($hget(dmsettings. [ $+ [ $chan ] ],Status) == ON2) {
    notice $nick 12There is already a DM.
    halt
  }
  if ($hget(dmsettings. [ $+ [ $chan ] ],Status) == ON) {

    hadd -m dmsettings. [ $+ [ $chan ] ] Player2 $nick
    hadd -m dmsettings. [ $+ [ $chan ] ] Status ON2
    hadd -m dmhp. [ $+ [ $chan ] ] Player2 99
    hadd -m dmturn. [ $+ [ $chan ] ] Turn 1
    hadd -m dmshark. [ $+ [ $chan ] ] Player2 15
    hadd -m dmspec. [ $+ [ $chan ] ] Player2 4
    hadd -m dmspec. [ $+ [ $chan ] ] Player1 4
    msg $chan 12The Fight is.4 $readini(pdm.ini,$chan,Player1) 12Vs.4 $readini(pdm.ini,$chan,Player2)
    msg $chan 12`dmcommands For DM4 Commands12.
    notice $hget(dmsettings. [ $+ [ $chan ] ],Player2) 12You have4 99 12Hit Points and4 20 12Shark that heal4 20 12Health each.
    halt
  }  
  if (!$hget(dmsettings. [ $+ [ $chan ] ],Status)) {

    hadd -m dmsettings. [ $+ [ $chan ] ] Player1 $nick
    hadd -m dmsettings. [ $+ [ $chan ] ] Status ON
    hadd -m dmhp. [ $+ [ $chan ] ] Player1 99
    hadd -m dmshark. [ $+ [ $chan ] ] Player1 15
    msg $chan 12 $+ $dm(settings,player1) has initiated the DM Command. Type 4!dm12 to fight $readini(pdm.ini,$chan,Player1) $+ .
    notice $dm(settings,player1) 12You have4 99 12Hit Points and4 15 12Shark that heal4 20 12Health each.
    halt
  }
}
on *:TEXT:!whip:#: {
  if ($dm(settings,status) == $null) {
    notice $nick 12There is no DM on. Type4 !DM 12To start one.
    halt
  }
  if ($dm(settings,status) == ON) {
    notice $nick 12You need someone to attack....
    halt
  }
  if (($dm(settings,status) == ON2) && ($dm(turn,turn) == 1) && ($player(1) == $nick)) {
    var %dmwhip. [ $+ [ $chan ] ] = $rand(1,37)
    hadd -m dmhp. [ $+ [ $chan ] ] Player2 $calc( $dm(hp,player2) - %dmwhip. [ $+ [ $chan ] ] )
    if ($dm(hp,player2) <= 0) {
      msg $chan 12 $+ $player(1) swings at $player(2) hitting a %dmwhip. [ $+ [ $chan ] ] $+ . Leaving him with4 0 12Hitpoints.
      timer 1 3 msg $chan 12 $+ $player(1) has won!
      hfree -w dm*. [ $+ [ $chan ] ]
      halt
    }
    else {
      msg $chan 12 $+ $player(1) swings at $player(2) hitting a %dmwhip. [ $+ [ $chan ] ] $+ . Leaving him with4r $dm(hp,player2) 12Hitpoints.
      hadd -m dmturn. [ $+ [ $chan ] ] turn 2
      halt
    }
  }
  if (if (($dm(settings,status) == ON2) && ($dm(turn,turn) == 2) && ($player(2) == $nick)) {
    var %dmwhip. [ $+ [ $chan ] ] = $rand(1,37)
    hadd -m dmhp. [ $+ [ $chan ] ] Player1 $calc( $dm(hp,player1) - %dmwhip. [ $+ [ $chan ] ] )
    if ($dm(hp,player2) <= 0) {
      msg $chan 12 $+ $player(2) swings at $player(1) hitting a %dmwhip. [ $+ [ $chan ] ] $+ . Leaving him with4 0 12Hitpoints.
      timer 1 3 msg $chan 12 $+ $player(2) has won!
      hfree -w dm*. [ $+ [ $chan ] ]
      halt
    }
    else {
      msg $chan 12 $+ $player(2) swings at $player(1) hitting a %dmwhip. [ $+ [ $chan ] ] $+ . Leaving him with4r $dm(hp,player1) 12Hitpoints.
      hadd -m dmturn. [ $+ [ $chan ] ] turn 1
      halt
    }
  }

  else {
    notice $nick 12Its not your turn or your not in this round.
  }
}