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 made %player2 $+ 's troops run for their lives! 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 *2),$calc(%p2cav /10 *4)))) 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 %player1 made %player2 $+ 's troops run for their lives! 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 (%p2cav > %p1cav) { set %rand $rand(1,3) if (%rand == 1) { set %p2cav $calc((%p2cav) - $r($calc(%p1cav /5 *2),$calc(%p2cav /5 * 4)))) set %p1cav $calc((%p1cav) - $r($calc(%p1cav /20 *16),$calc(%p2cav /20 *19)))) msg $chan %player2 defended successfully, and sent %player1 $+ 's troops running! 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 %p2cav $calc((%p2cav) - $r($calc(%p1cav /10 *2),$calc(%p1cav /10 *4)))) set %p1cav 0 msg $chan %player2 defended successfully, and defeated all of %player1 $+ 's troops! 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 defended successfully, and sent %player1 $+ 's troops running! 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 } } } }