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


PHP SR_Player::giveItems方法代码示例

本文整理汇总了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');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:Renraku_I.php

示例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));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:Seattle_IDS.php

示例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')));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:Redmond_Ueberpunk.php

示例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'));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:10,代码来源:Lake.php

示例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));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:12,代码来源:Seattle_Barkeeper.php

示例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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:43,代码来源:give.php

示例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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:Chicago_OwlJohnsonRoundtrip.php

示例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');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:ServerRoom.php

示例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()));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:23,代码来源:SR_Player.php

示例10: onAccept

 public function onAccept(SR_Player $player)
 {
     $player->giveItems(array(SR_Item::createByName('RenrakuPackage')), 'Mr.Johnson');
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:4,代码来源:Seattle_GJohnson3.php

示例11: accept

 public function accept(SR_Player $player)
 {
     $player->giveItems(array(SR_Item::createByName('Package')));
     return parent::accept($player);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:Redmond_Johnson_3.php


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