本文整理汇总了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;
}
示例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;
}
示例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()));
}
}
示例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());
}
}