本文整理汇总了PHP中SR_Player::giveItems方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::giveItems方法的具体用法?PHP SR_Player::giveItems怎么用?PHP SR_Player::giveItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::giveItems方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setOrk
public function setOrk(SR_Player $player)
{
$data = $this->getQuestData();
$data['ORK1'] = 1;
$this->saveQuestData($data);
$player->message($this->lang('orkmsg'));
// $player->message('The Ork dies. You grab his knife. It has "Renraku" as initials.');
$player->giveItems(array(SR_Item::createByName('Knife')), 'The Ork');
}
示例2: onQuestSolve
public function onQuestSolve(SR_Player $player)
{
$nuyen = 750;
$player->message($this->lang('hand_back', array($nuyen)));
// $player->message('Malois sneakily hands you '.$nuyen.' Nuyen and a piece of paper.');
$player->giveNuyen($nuyen);
$note = SR_Item::createByName('Note');
$player->giveItems(array($note));
}
示例3: onQuestSolve
public function onQuestSolve(SR_Player $player)
{
// $xp = 3;
// $ny = 450;
$player->message($this->lang('grats', array($this->getRewardNuyen(), $this->getRewardXP())));
// $player->message('The biker says: "Haha chummer, good job. Take this." - He hands you '.$ny.' nuyen and a BikerHelmet. You also gained '.$xp.' XP.');
// $player->giveXP($xp);
// $player->giveNuyen($ny);
$player->giveItems(array(SR_Item::createByName('BikerHelmet')));
}
示例4: onSparkleItem
private function onSparkleItem(SR_Player $player)
{
$items = array('Ring', 'Amulet', 'Earring', 'LO_Ring', 'Knife', 'Stiletto', 'TinfoilCap', 'TinfoilBelt', 'TinfoilSandals');
$iname = Shadowfunc::randomListItem($items);
if (false === ($item = SR_Item::createByName($iname))) {
$player->message('DB Error 4');
return false;
}
return $player->giveItems(array($item), $this->lang($player, 'from_lake'));
}
示例5: onQuestSolve
public function onQuestSolve(SR_Player $player)
{
$xp = 6;
$ny = 1000;
$player->message($this->lang('reward1', array($ny, $xp)));
// $player->message(sprintf('The barkeeper hands you %s Nuyen and smiles: "Good job. We surely will have more guests now.". You also gain %s XP.', $ny, $xp));
$player->giveNuyen($ny);
$player->giveXP($xp);
$player->message($this->lang('reward2'));
// $player->message(sprintf('Here, take this as a bonus reward. Guests forgot these items lately.'));
$player->giveItems(Shadowfunc::randLootNItems($player, 15, 2));
}
示例6: giveItem
public static function giveItem(SR_Player $player, SR_Player $target, $id, $amt = 1)
{
if ($amt < 1) {
$player->msg('1038');
// $player->message('Please give a positive amount of items.');
return false;
}
if (false === ($item = $player->getInvItem($id))) {
$player->msg('1029');
// $player->message('You don`t have that item.');
return false;
}
// if (false === $item->isItemTradeable())
// {
// $player->message('You are not allowed to trade this item.');
// return false;
// }
if ($item->isItemStackable()) {
if ($amt > $item->getAmount()) {
$player->msg('1040', array($item->getItemName()));
// $player->message(sprintf('You only have %d %s.', $item->getAmount(), $item->getName()));
return false;
}
$giveItem = SR_Item::createByName($item->getItemName(), $amt, true);
$item->useAmount($player, $amt);
} else {
if ($amt !== 1) {
$player->message('Currently you can only give one equipment at a time.');
return false;
}
$player->removeFromInventory($item);
$giveItem = $item;
}
$busymsg = $player->isFighting() ? Shadowfunc::displayBusy($player->busy(SR_Player::GIVE_TIME)) : '';
self::rply($player, '5115', array($amt, $giveItem->displayFullName($player), $target->getName(), $busymsg));
// $player->message(sprintf('You gave %d %s to %s.%s', $amt, $giveItem->getName(), $target->getName(), $busymsg));
$target->giveItems(array($giveItem), $player->getName());
// if ($target instanceof SR_TalkingNPC)
// {
// $target->onNPCGive($player, $items);
// }
return true;
}
示例7: onNPCQuestTalkB
public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
{
$need = $this->getNeededAmount();
$ny = $this->getRewardNuyen();
$dny = Shadowfunc::displayNuyen($ny);
switch ($word) {
case 'shadowrun':
$npc->reply("I have to securely inform some friends with some message.");
$npc->reply("Can you show a DataCrystal to all my friends?");
break;
case 'confirm':
$npc->reply("Just show them to all the Johnsons.");
break;
case 'yes':
$player->giveItems(array(SR_Item::createByName('DataCrystal')), 'Mr.Johnson');
$npc->reply("Just show them to all the Johnsons.");
break;
case 'no':
$npc->reply('ok');
break;
}
return true;
}
示例8: onHacked
public function onHacked(SR_Player $player, $hits)
{
$player->message('You managed to create a backup from a big data server.');
$player->giveItems(array(SR_Item::createByName('NySoftBackup')), 'hacking a computer');
}
示例9: looseItem
private function looseItem(SR_Player $killer)
{
Dog_Log::debug(sprintf('%s could loose an item!', $this->getName()));
$items = array_merge($this->sr4_equipment, $this->sr4_inventory);
foreach ($items as $i => $item) {
$item instanceof SR_Item;
if ($item instanceof SR_Mount || !$item->isItemDropable()) {
unset($items[$i]);
}
}
if (0 !== ($rand = rand(0, count($items)))) {
shuffle($items);
$item = array_pop($items);
$item instanceof SR_Item;
if ($item->isEquipped($this)) {
$this->unequip($item, false);
}
$this->removeFromInventory($item);
$killer->giveItems(array($item), 'killing ' . $this->getName());
$this->msg('5255', array($item->getAmount(), $item->getItemName()));
// $this->message(sprintf('You lost your %s.', $item->getItemName()));
}
}
示例10: onAccept
public function onAccept(SR_Player $player)
{
$player->giveItems(array(SR_Item::createByName('RenrakuPackage')), 'Mr.Johnson');
}
示例11: accept
public function accept(SR_Player $player)
{
$player->giveItems(array(SR_Item::createByName('Package')));
return parent::accept($player);
}