当前位置: 首页>>代码示例>>PHP>>正文


PHP Shadowfunc::randLoot方法代码示例

本文整理汇总了PHP中Shadowfunc::randLoot方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::randLoot方法的具体用法?PHP Shadowfunc::randLoot怎么用?PHP Shadowfunc::randLoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Shadowfunc的用法示例。


在下文中一共展示了Shadowfunc::randLoot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (count($args) !== 2) {
         $bot->reply(Shadowhelp::getHelp($player, 'gmloot'));
         return false;
     }
     $target = Shadowrun4::getPlayerByShortName($args[0]);
     if ($target === -1) {
         $player->message('The username is ambigious.');
         return false;
     }
     if ($target === false) {
         $player->message('The player is not in memory or unknown.');
         return false;
     }
     if (false === $target->isCreated()) {
         $bot->reply(sprintf('The player %s has not started a game yet.', $args[0]));
         return false;
     }
     if (Common::isNumeric($args[1])) {
         $target->giveItems(Shadowfunc::randLoot($target, $args[1]), 'gmloot');
     } else {
     }
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:26,代码来源:gmloot.php

示例2: onItemUse

 public function onItemUse(SR_Player $player, array $args)
 {
     $player->message(sprintf('You open your present ... '));
     $this->useAmount($player, 1);
     $items = array();
     while (count($items) === 0) {
         $items = Shadowfunc::randLoot($player, 99999);
     }
     $player->giveItems($items, 'present');
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:11,代码来源:Present.php

示例3: on_search

 public function on_search(SR_Player $player, array $args)
 {
     $key = $this->getTempKey();
     $attemp = $player->getTemp($key, 0);
     if ($attemp >= $this->getSearchMaxAttemps()) {
         $player->msg('1148');
         // 			$player->message('Not again.');
         return;
     }
     $attemp++;
     $player->setTemp($key, $attemp);
     $loot = array_merge(Shadowfunc::randLoot($player, $this->getSearchLevel(), array(), $this->getSearchChanceNone()), $this->getSearchLoot($player));
     if (count($loot) > 0) {
         $player->msg('5185', array($this->getName()));
         // 			$player->message(sprintf('You search the %s...', $this->getName()));
         $player->giveItems($loot, 'searching ' . $this->getName());
     } else {
         $player->msg('5186', array($this->getName()));
         // 			$player->message(sprintf('You search the %s... But find nothing.', $this->getName()));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:21,代码来源:SR_SearchRoom.php

示例4: gotKilledByHuman

 public function gotKilledByHuman(SR_Player $player)
 {
     if ($this->isNPCDropping($player->getParty())) {
         $player = $player->getParty()->getKiller($player);
         $items = array_merge(Shadowfunc::randLoot($player, (int) $this->getBase('level'), $this->getNPCHighChanceDrops()), $this->generateNPCLoot($player));
         $player->giveItems($items, 'looting ' . $this->getName());
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:SR_NPCBase.php


注:本文中的Shadowfunc::randLoot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。