All pastes #548604 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-07 19:53 UTC
rendered paste body
on *:TEXT:!vd*:#: {
  if (%vd == 1) && (%vdplay !== 1) {
    if (!$4) { notice $nick Specify the troops please. | halt }
    if ($calc($2 + ($3 * 2) + ($4 * 4)) > 20000) { notice $nick You have spent too many points. Please see !vdrules to see how much you can spend. | halt }
    if (%play == 1) { notice $nick A game is already being played. | halt }
    if (%vd == 0) { notice $nick Violent Diplomacy is not currently on. Please contact Jcfc so he can turn it on. | halt }
    if ($calc($2 + ($3 * 2) + ($4 * 4)) <= 20000) {
      msg $chan $nick wants to play Violent Diplomacy! Type !vd [INFANTRY] [DRAGOONS] [CAVALRY] to play with him.
      set %vdplay 1
      set %p1inf $2
      set %p1drag $3
      set %p1cav $4
      set %player1 $nick
      halt
    }
  }
  if (%vdplay == 1) && (%vd == 1) {
    if (!$4) { notice $nick Specify the troops please. | halt }
    if ($calc($2 + ($3 * 2) + ($4 * 4)) > 20000) { notice $nick You have spent too many points. Please see !vdrules to see how much you can spend. | halt }
    if (%play == 1) { notice $nick A game is already being played. | halt }
    if (%vd == 0) { notice $nick Violent Diplomacy is not currently on. Please contact Jcfc so he can turn it on. | halt }
    if ($calc($2 + ($3 * 2) + ($4 * 4)) <= 20000) {
      set %vdplay 1
      set %p2inf $2
      set %p2drag $3
      set %p2cav $4
      set %player2 $nick
      msg $chan The game is on! %player1 vs. %player2 $+ .
      msg $chan It is %player1 $+ 's go first.
      set %turn 1
      halt
    }
    if (%vd == 0) { notice $nick Violent Diplomacy is not currently on. Please contact Jcfc so he can turn it on. | halt }
  }
}

on *:TEXT:!tell*:#:{
  if ($2 == cav) && (%p1cav == 0) && (%turn == 1) { notice %player1 You have no cavalry left to attack with! | halt }
  if ($3 == cav) && (%p2cav == 0) && (%turn == 1) { notice %player1 You opponent has no cavalry to attack! | halt }
  if ($2 == cav) && (%p2cav == 0) && (%turn == 2) { notice %player2 You have no cavalry left to attack with! | halt }
  if ($3 == cav) && (%p1cav == 0) && (%turn == 2) { notice %player2 You opponent has no cavalry to attack! | halt }
  if ($2 == cav) && ($3 == cav) && (%turn == 1) {
    if (%p1cav > %p2cav) {
      set %rand $rand(1,3)
      if (%rand == 1) {
        set %p1cav $calc((%p1cav) - $r($calc(%p2cav /5 *2),$calc(%p2cav /5*4))))      
        set %p2cav $calc((%p2cav) - $r($calc(%p2cav /20 *16),$calc(%p2cav /20 *19))))
        msg $chan %player1 defeated all of %player2 $+ 's cavalry!
        notice %player1 You have %p1inf infantry, %p1drag dragoons, and %p1cav cavalry remaining.
        notice %player2 You have %p2inf infantry, %p2drag dragoons, and %p2cav cavalry remaining.
        set %turn 2
        msg $chan It is now %player2 $+ 's turn.
        halt
      }
      if (%rand == 2) {
        set %p1cav $calc((%p1cav) - $r($calc(%p2cav /10 *6),$calc(%p2cav /5 *9))))      
        set %p2cav 0
        msg $chan %player1 defeated all of %player2 $+ 's cavalry!
        notice %player1 You have %p1inf infantry, %p1drag dragoons, and %p1cav cavalry remaining.
        notice %player2 You have %p2inf infantry, %p2drag dragoons, and %p2cav cavalry remaining.
        set %turn 2
        msg $chan It is now %player2 $+ 's turn.
        halt
      }
      if (%rand == 3) {
        set %p1cav $calc((%p1cav) - $r($calc(%p2cav /5 *2),$calc(%p2cav /5*4))))      
        set %p2cav $calc((%p2cav) - $r($calc(%p2cav /10 *6),$calc(%p2cav /10 *9))))
        msg $chan %player2 defeated all of %player1 $+ 's cavalry!
        notice %player1 You have %p1inf infantry, %p1drag dragoons, and %p1cav cavalry remaining.
        notice %player2 You have %p2inf infantry, %p2drag dragoons, and %p2cav cavalry remaining.
        set %turn 2
        msg $chan It is now %player2 $+ 's turn.
        halt
      }
    }
  }
}