[color:green]on *:NOTICE:!rob *:?: {
if (($nick !ison #Battle) || ($2 !ison #Battle)) {
; $nick or $2 isn't on #battle, so do nothing
return
}
[/color] if (%rob [ $+ [ $nick ] ] == on) {
msg $nick You Have Already Robbed Someone!
return
}
if (%away [ $+ [ $nick ] ] == on) {
msg $nick You're away, no robbing when you're away!
return
}
if (%away [ $+ [ $2 ] ] == on) {
msg $nick $2 is away, you cannot rob someone who is away!
return
}
[color:red] if (%money [ $+ [ $2 ] ] < 1000) {
msg $nick $2 hasn't got enough money.
return
}[/color]
if (%rob [ $+ [ $nick ] ] != on) && (%account [ $+ [ $2 ] ] == on) {
msg $chan $nick Attempts To Rob $2
[color:blue] ; 20 % chance of success robbing $2
if ($rand(0,99) < 20) {
var %tthier-money = $round($calc(%money [ $+ [ $2 ] ] / 2),0)
msg $chan $nick SuccessFully Robs $2
msg $chan $nick Has Robbed $2 by %tthier-money Money From $2
inc %money [ $+ [ $nick ] ] %tthier-money
dec %money [ $+ [ $2 ] ] %tthier-money
}
else {
; this is the other 80% chance of not successfully robbing $2
; make him lose 10-20 health with a 10% chance
if (($rand(0,99) < 10) && ($rand(10,20)) {
msg $nick $2 saw you and hit you with a trout, you lose $v1 health
set -u300 %rob [ $+ [ $nick ] ] on
dec %health [ $+ [ $nick ] ] $v1
; you should check if $nick has still got health left :)
}
; OR 5% chance of having to pay 500 money back (or all his money)
else if ($rand(0,99) < 5) {
if ((%money [ $+ [ $nick ] ] < 500) || (500)) { }
dec %money [ $+ [ $nick ] ] $v1
inc %money [ $+ [ $2 ] ] $v1
msg $nick $2 saw you and took $v1 money from you!
set -u300 %rob [ $+ [ $nick ] ] on
}
; OR 15% chance of being unable to rob for 1 hour
else if ($rand(0,99) < 15) {
msg $nick $2 saw you and keeps watching you for 1 hour
set -u3600 %rob [ $+ [ $nick ] ] on
}[/color]
msg $chan $nick Has Failed To Rob $2 !
}
}
}