Example #1
0
 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     $path = Shadowrun4::getShadowDir() . 'dog_module/Shadowlamb/shadowlamb_motd.txt';
     if (false === ($motd = @file_get_contents($path))) {
         $bot->reply('Can not read ' . $path);
     }
     return $bot->rply('5249', array($motd));
     // 		$bot->reply(sprintf('Message of the day: %s', $motd));
     // 		return true;
 }
Example #2
0
<?php

require_once Shadowrun4::getShadowDir() . 'city/Renraku/location/Elevator.php';
final class Renraku04_Elevator extends Renraku_Elevator
{
    public function getExitLocation()
    {
        return false;
    }
    public function onLeaveLocation(SR_Party $party)
    {
        $errors = '';
        foreach ($party->getMembers() as $member) {
            $member instanceof SR_Player;
            if (false === ($item = $member->getInvItemByName('ID4Card'))) {
                $errors .= sprintf(', %s', $member->getName());
            } else {
                $member->message($this->lang($member, 'usecard', array($item->getAmount())));
                // 				$member->message(sprintf('You use one of your %d ID4 cards...', $item->getAmount()));
                $item->useAmount($member, 1);
            }
        }
        if ($errors !== '') {
            $this->partyMessage($party->getLeader(), 'nocard', array(substr($errors, 2)));
            // 			$party->notice(sprintf('%s do(es) not have an ID4Card... You hear the alarm sound!', substr($errors, 2)));
            if (false !== ($city = $this->getCityClass())) {
                $city->setAlert($party, GWF_Time::ONE_HOUR * 2);
            }
        }
    }
}
Example #3
0
<?php

require_once Shadowrun4::getShadowDir() . 'city/Cave/location/Tunnel1.php';
final class Cave_Tunnel4 extends Cave_Tunnel1
{
}
Example #4
0
 public static function onLoadLanguage()
 {
     $dir = Shadowrun4::getShadowDir();
     self::$LANG_CMDS = new GWF_LangTrans($dir . 'lang/cmds/cmds');
     self::$LANG_COMMANDS = new GWF_LangTrans($dir . 'lang/commands/commands');
     return true;
 }
Example #5
0
 public static function execute(SR_Player $player, array $args)
 {
     require_once Shadowrun4::getShadowDir() . 'dog_module/Shadowlamb/Shadowcron.php';
     #Shadowcron::onCronjob();
 }
Example #6
0
 public function onLoadLanguage()
 {
     $cityname = $this->getName();
     $path = sprintf('%scity/%s/lang/%s', Shadowrun4::getShadowDir(), $cityname, strtolower($cityname));
     return $this->lang = new GWF_LangTrans($path);
 }
Example #7
0
 /**
  * Get a lang file for a location.
  * @param SR_Quest $quest
  * @return GWF_LangTrans
  */
 private static function getLangLocation(SR_Location $location)
 {
     // 		$locname = $location->getName();
     $locname = $location->getLangfileName();
     if (false === isset(self::$LANG_LOCATION[$locname])) {
         $llocname = strtolower(Common::substrFrom($locname, '_'));
         $path = sprintf('%scity/%s/lang/location/%s/%s', Shadowrun4::getShadowDir(), $location->getCity(), $llocname, $llocname);
         self::$LANG_LOCATION[$locname] = new GWF_LangTrans($path);
     }
     return self::$LANG_LOCATION[$locname];
 }
Example #8
0
<?php

require_once Shadowrun4::getShadowDir() . 'city/Forest/location/Clearing.php';
final class Forest_Skeleton extends SR_NPC
{
    public function getNPCLevel()
    {
        return 21;
    }
    public function getNPCPlayerName()
    {
        return 'Skeleton';
    }
    public function getNPCMeetPercent(SR_Party $party)
    {
        return 30.0;
    }
    public function getNPCEquipment()
    {
        return array('weapon' => 'LongSword', 'armor' => 'ChainMail', 'helmet' => 'ChainHelmet', 'shield' => 'SmallShield', 'boots' => 'ChainBoots');
    }
    public function getNPCModifiers()
    {
        return array('race' => 'human', 'gender' => 'male', 'melee' => rand(8, 10), 'ninja' => rand(5, 7), 'strength' => rand(8, 10), 'quickness' => rand(5, 7), 'distance' => rand(4, 8), 'sharpshooter' => rand(5, 12), 'nuyen' => 0, 'base_hp' => rand(30, 50));
    }
    public function getNPCLoot(SR_Player $player)
    {
        # Increase some temp counter
        $leader = $player->getParty()->getLeader();
        $kills = SR_PlayerVar::getVal($player, Forest_Clearing::SKELSKEY, '0');
        $kills++;
Example #9
0
<?php

require_once Shadowrun4::getShadowDir() . 'cmd/gm/gmd.php';
final class Shadowcmd_npc extends Shadowcmd_gmd
{
    public static function isCombatCommand()
    {
        return true;
    }
    public static $WHITELIST = array('u', 'ca', 'le', 'sell', 'buy', 'view', 'drop', 'eq', 'uq', 'x', 'fw', 'bw', '#', 'i', 'q', 'ks', 'a', 's', 'l');
    public static function execute(SR_Player $player, array $args)
    {
        if (count($args) < 1) {
            $player->message(Shadowhelp::getHelp($player, 'npc'));
            return false;
        }
        $party = $player->getParty();
        if (false === ($remote = $party->getMemberByArg(array_shift($args)))) {
            $player->msg('1064');
            // 			$player->message('This player is not in your party.');
            return false;
        }
        if ($remote->isHuman()) {
            $player->msg('1065');
            // 			$player->message('You can only remote control NPC.');
            return false;
        }
        if (!in_array($args[0], self::$WHITELIST, true)) {
            $player->msg('1066', array(implode(', ', self::$WHITELIST)));
            // 			$player->message(sprintf('Only the following remote commands are allowed: %s.', implode(', ', self::$WHITELIST)));
            return false;
Example #10
0
<?php

require_once Shadowrun4::getShadowDir() . 'city/Delaware/quest/Delaware_Exams5.php';
final class Quest_Chicago_Uni6 extends Quest_Delaware_Exams5
{
    public function getQuestName()
    {
        return 'MasterBachelor';
    }
    public function getNeededAmount()
    {
        return 3;
    }
    public function getQuestDescription()
    {
        return sprintf('Bring %d/%d fluid Auris to the Chicago University Gnome.', $this->getAmount(), $this->getNeededAmount());
    }
    public function getRewardXP()
    {
        return 3;
    }
    public function getRewardNuyen()
    {
        return 300;
    }
    public function checkQuest(SR_NPC $npc, SR_Player $player)
    {
        if (false === ($auris = $player->getInvItemByName('Auris'))) {
            return $npc->reply('Oh, you don\'t have more Auris for me?');
        }
        if (!$this->rightInTime($player)) {
Example #11
0
 private static function createItemDataFile()
 {
     $out = '<?php' . "\n\$lang = array(\n";
     $player = Shadowrun4::getDummyPlayer();
     $data = array();
     foreach (SR_Item::getAllItems() as $item) {
         $item instanceof SR_Item;
         $data[(int) $item->getItemUUID()] = $player->lang($item->displayPacked($player));
     }
     ksort($data);
     foreach ($data as $uuid => $type) {
         $out .= sprintf("'%d'=>'%s',\n", $uuid, $type);
     }
     $out .= ");\n?>\n";
     $outfile = Shadowrun4::getShadowDir() . 'data/itemdata/itemdata_en.php';
     @mkdir(dirname($outfile), 0700, true);
     file_put_contents($outfile, $out);
     return true;
 }