示例#1
0
 public function msg($key, $args = NULL)
 {
     if ($key === '5086') {
         $player = Shadowrun4::getPlayerByName(array_shift($args));
         $this->setChatPartner($player);
         $word = array_shift($args);
         return $this->onNPCWhisper($player, $word, $args);
     }
     if ($key === '') {
     }
 }
示例#2
0
 /**
  * @param SR_Player $player
  * @param string $name
  * @return SR_Player
  */
 public static function getPlayerInLocation(SR_Player $player, $name)
 {
     if (false === ($back = Shadowrun4::getPlayerByName($name))) {
         return false;
     }
     # Same party
     if ($back->getPartyID() === $player->getPartyID()) {
         return $back;
     }
     if (self::sharesLocation($player, $back)) {
         return $back;
     }
     return false;
 }
示例#3
0
 public function onPayOwner(SR_Player $buyer, $amt)
 {
     $price = $this->getVar('sr4ba_price') * $amt;
     $pname = $this->getVar('sr4ba_pname');
     if (false === ($seller = Shadowrun4::getPlayerByName($pname))) {
         if (false === ($seller = SR_Player::getByLongName($pname))) {
             return false;
         }
     }
     if (false === $seller->giveBankNuyen($price)) {
         return false;
     }
     $iname = $this->getVar('sr4ba_iname');
     $seller->msg('5035', array(Shadowfunc::displayNuyen($price), $amt, $iname, $buyer->getName()));
     // 		$seller->message(sprintf('%s have been booked to your bank account for selling %s %s to %s.', Shadowfunc::displayNuyen($price), $amt, $iname, $buyer->getName()));
     return true;
 }
示例#4
0
文件: gmload.php 项目: sinfocol/gwf3
 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (count($args) !== 1) {
         $bot->reply(Shadowhelp::getHelp($player, 'gmload'));
         return false;
     }
     if (false !== ($target = Shadowrun4::getPlayerByName($args[0]))) {
         $bot->reply(sprintf('The player %s is already in memory.', $args[0]));
         return false;
     }
     if (false === ($target = Shadowrun4::loadPlayerByName($args[0]))) {
         $bot->reply(sprintf('The player %s is unknown.', $args[0]));
         return false;
     }
     Shadowrun4::addPlayer($target);
     $bot->reply(sprintf('The player %s has been loaded into memory.', $args[0]));
     return true;
 }
示例#5
0
文件: ban.php 项目: sinfocol/gwf3
 protected static function onBan(SR_Player $player, array $args, $bool)
 {
     // 		$bot = Shadowrap::instance($player);
     if (count($args) > 1) {
         self::reply($player, Shadowhelp::getHelp($player, $bool === true ? 'ban' : 'unban'));
         // 			$bot->reply(Shadowhelp::getHelp($player, $bool===true?'ban':'unban'));
         return false;
     }
     $p = $player->getParty();
     if (count($args) === 0) {
         $p->banAll($bool);
         $key = $bool === true ? '5065' : '5066';
         return self::rply($player, $key);
         // 			if ($bool === true)
         // 			{
         // 				$msg = 'Your party does not accept new members anymore.';
         // 			}
         // 			else
         // 			{
         // 				$msg = 'Your party does accept new members again.';
         // 			}
         // 			$bot->reply($msg);
         // 			return true;
     }
     if (false === ($target = Shadowrun4::getPlayerByName($args[0]))) {
         self::rply($player, '1017');
         // 			$bot->reply('This player is unknown or not in memory.');
         return false;
     }
     $args = array($target->getName());
     $key = $bool === true ? '5067' : '5068';
     if ($bool === true) {
         $p->ban($target);
         // 			$bot->reply(sprintf('%s has been banned from the party.', $target->getName()));
     } else {
         $p->unban($target);
         // 			$bot->reply(sprintf('%s may now join your party again.', $target->getName()));
     }
     // 		return true;
     return self::rply($player, $key, $args);
 }
示例#6
0
 public static function getPlayer($param)
 {
     return Shadowrun4::getPlayerByName($param);
 }
示例#7
0
 /**
  * @return SR_Player
  */
 public function getHijackTarget($last = false)
 {
     return Shadowrun4::getPlayerByName($this->getHijackTargetName($last));
 }