From ea544affc3ac292374a369997b8acaeb70bebc0f Mon Sep 17 00:00:00 2001
From: Someone <someone@somenet.org>
Date: Thu, 7 Apr 2011 15:00:22 +0200
Subject: [PATCH] update

---
 ChangeLog.txt |  0
 README        |  0
 bot.v3.1.2.pl | 70 +++++++++++++++++++++++++--------------------------
 events.txt    |  0
 irpgdbtool    |  0
 5 files changed, 35 insertions(+), 35 deletions(-)
 mode change 100644 => 100755 ChangeLog.txt
 mode change 100644 => 100755 README
 mode change 100644 => 100755 bot.v3.1.2.pl
 mode change 100644 => 100755 events.txt
 mode change 100644 => 100755 irpgdbtool

diff --git a/ChangeLog.txt b/ChangeLog.txt
old mode 100644
new mode 100755
diff --git a/README b/README
old mode 100644
new mode 100755
diff --git a/bot.v3.1.2.pl b/bot.v3.1.2.pl
old mode 100644
new mode 100755
index 1ba6315..0571286
--- a/bot.v3.1.2.pl
+++ b/bot.v3.1.2.pl
@@ -1,4 +1,4 @@
-#!/usr/local/bin/perl
+##!/usr/local/bin/perl
 # irpg bot v3.1.2 by jotun, jotun@idlerpg.net, et al. See http://idlerpg.net/
 #
 # Some code within this file was written by authors other than myself. As such,
@@ -180,40 +180,6 @@ if (! -e $opts{dbfile}) {
     print "OK, wrote you into $opts{dbfile}.\n";
 }
 
-# this is almost silly...
-if ($opts{checkupdates}) {
-    print "Checking for updates...\n\n";
-    my $tempsock = IO::Socket::INET->new(PeerAddr=>"jotun.ultrazone.org:80",
-                                         Timeout => 15);
-    if ($tempsock) {
-        print $tempsock "GET /g7/version.php?version=$version HTTP/1.1\r\n".
-                        "Host: jotun.ultrazone.org:80\r\n\r\n";
-        my($line,$newversion);
-        while ($line=<$tempsock>) {
-            chomp($line);
-            next() unless $line;
-            if ($line =~ /^Current version : (\S+)/) {
-                if ($version ne $1) {
-                    print "There is an update available! Changes include:\n";
-                    $newversion=1;
-                }
-                else {
-                    print "You are running the latest version (v$1).\n";
-                    close($tempsock);
-                    last();
-                }
-            }
-            elsif ($newversion && $line =~ /^(  -? .+)/) { print "$1\n"; }
-            elsif ($newversion && $line =~ /^URL: (.+)/) {
-                print "\nGet the newest version from $1!\n";
-                close($tempsock);
-                last();
-            }
-        }
-    }
-    else { print debug("Could not connect to update server.")."\n"; }
-}
-
 print "\n".debug("Becoming a daemon...")."\n";
 daemonize();
 
@@ -604,6 +570,9 @@ sub parse {
                 else {
                     $rps{$arg[4]}{isadmin}=1;
                     privmsg("Account $arg[4] is now a bot admin.",$usernick, 1);
+		    if ($opts{voiceonlogin}) {
+                       sts("MODE $opts{botchan} +o :$usernick");
+                    }
                 }
             }
             elsif ($arg[3] eq "deladmin") {
@@ -624,6 +593,9 @@ sub parse {
                     $rps{$arg[4]}{isadmin}=0;
                     privmsg("Account $arg[4] is no longer a bot admin.",
                             $usernick, 1);
+                    if ($opts{voiceonlogin}) {
+                       sts("MODE $opts{botchan} -o :$usernick");
+                    }
                 }
             }
             elsif ($arg[3] eq "hog") {
@@ -994,6 +966,10 @@ sub parse {
                     else {
                         if ($opts{voiceonlogin}) {
                             sts("MODE $opts{botchan} +v :$usernick");
+			    if($rps{$arg[4]}{isadmin} > 0){
+                               sts("MODE $opts{botchan} +o :$usernick");
+			    }
+
                         }
                         $rps{$arg[4]}{online} = 1;
                         $rps{$arg[4]}{nick} = $usernick;
@@ -1297,6 +1273,18 @@ sub challenge_opp { # pit argument player against random player
                      "added to $u\'s clock."));
         $rps{$u}{next} += $gain;
         chanmsg("$u reaches next level in ".duration($rps{$u}{next}).".");
+	#interrogation
+        debug("interrogation");
+        my $csfactor = $rps{$opp}{alignment} eq "g" ? 50 :
+                       $rps{$opp}{alignment} eq "e" ? 20 :
+                       35;
+        if (rand($csfactor) < 1) {
+            $gain = int(((5 + int(rand(20)))/100) * $rps{$opp}{next});
+            chanmsg(clog("$opp has captured and interrogated $u! ".
+                         duration($gain)." is removed from $opp\'s clock."));
+            $rps{$opp}{next} -= $gain;
+            chanmsg("$opp reaches next level in ".duration($rps{$opp}{next}).".");
+        }
     }
 }
 
@@ -2136,6 +2124,18 @@ sub collision_fight {
                      "added to $u\'s clock."));
         $rps{$u}{next} += $gain;
         chanmsg("$u reaches next level in ".duration($rps{$u}{next}).".");
+	#interrogation
+        debug("interrogation");
+        my $csfactor = $rps{$opp}{alignment} eq "g" ? 50 :
+                       $rps{$opp}{alignment} eq "e" ? 20 :
+                       35;
+        if (rand($csfactor) < 1) {
+            $gain = int(((5 + int(rand(20)))/100) * $rps{$opp}{next});
+            chanmsg(clog("$opp has captured and interrogated $u! ".
+                         duration($gain)." is removed from $opp\'s clock."));
+            $rps{$opp}{next} -= $gain;
+            chanmsg("$opp reaches next level in ".duration($rps{$opp}{next}).".");
+        }
     }
 }
 
diff --git a/events.txt b/events.txt
old mode 100644
new mode 100755
diff --git a/irpgdbtool b/irpgdbtool
old mode 100644
new mode 100755
-- 
2.43.0