Alias variablereset {
unset %p1
unset %p2
unset %dm2
unset %dm
unset %hp1
unset %hp2
unset %spec1
unset %spec2
unset %firsthit
unset %whiphit
unset %kowhiphit
unset %dmturn
}
on *:TEXT:!dm:#Restraint:{ if (%p1 != $null) && (%p2 != $null) {
notice $nick ***[DM] There is already a dm in progress. | halt
}
elseif (%dm != on) && (%p1 == $null) {
msg $chan [DM] $nick has started a DeathMatch! Type !DM to challenge $nick $+ .
set %p1 $nick
set %dm on
}
elseif (%dm == on) && (%p2 == $null) {
if ($nick == %p1) { notice $nick You can't dm yourself! | Halt }
set %p2 $nick
msg $chan [DM] A DM has begun between %p1 and %p2 $+ !
set %hp1 99
set %hp2 99
set %spec1 100
set %spec2 100
set %dmturn1 %p1
set %dmturn2 %p2
set %firsthit $rand(1,2)
if (%firsthit == 1) { msg $chan [DM] %p1 goes first!
set %dmturn1 on
}
elseif (%firsthit == 2) { msg $chan [DM] %p2 goes first!
set %dmturn2 on
}
}
}
on *:TEXT:!whip:#:{ if (%dm == on) && (%dmturn1 == on) && ($nick == %p1) {
set %whiphit $rand(0,32)
set %kowhiphit %hp2
if (%whiphit => %hp2) {
dec %hp2 %kowhiphit
msg $chan [DM] %p1 hits a %kowhiphit on %p2 $+ ! %p2 has %hp2 health left.
msg $chan [DM] %p2 has been defeated by %p1 $+ ! %p1 wins!
variablereset
}
}
else {
set %whiphit $rand(0,32)
dec %hp2 %whiphit
msg $chan [DM] %p1 hits a %whiphit on %p2 $+ ! %p2 has %hp2 health left.
set %dmturn1 off
set %dmturn2 on
unset %whiphit
unset %kowhiphit
msg $chan [DM] It is now %p2 $+ 's turn.
}
elseif (%dm == on) && (%dmturn2 == on) && ($nick == %p2) {
set %whiphit $rand(0,32)
set %kowhiphit %hp1
if (whiphit => %hp1) {
dec %hp1 %kowhiphit
msg $chan [DM] %p2 hits a %kowhiphit on %p1 $+ ! %p1 has %hp1 health left!
msg $chan [DM] %p1 has been defeated by %p2 $+ ! %p2 wins!
variablereset
}
}
else {
set %whiphit $rand(0,32)
dec %hp1 %whiphit
msg $chan [DM] %p2 hits a %whiphit on %p1 $+ ! %p1 has %hp1 health left!
set %dmturn2 off
set %dmturn1 on
unset %whiphit
msg $chan [DM] It is now %p1 $+ 's turn!
}
}
on *:TEXT:!stopdm:#:{ If (%dm == on) {
msg $chan The Deathmatch between %p1 and %p2 has been halted.
variablereset
}
else { halt }
}
on *:PART:#:{ if ($nick == %p2) || ($nick == %p1) {
msg $chan The DeathMatch has ended due to a forfeit.
variablereset
}
else { halt }
}