Exemple #1
0
 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');
 }
Exemple #2
0
 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));
 }
Exemple #3
0
 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')));
 }
Exemple #4
0
 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'));
 }
Exemple #5
0
 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));
 }
Exemple #6
0
 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;
 }
 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;
 }
Exemple #8
0
 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');
 }
Exemple #9
0
 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()));
     }
 }
Exemple #10
0
 public function onAccept(SR_Player $player)
 {
     $player->giveItems(array(SR_Item::createByName('RenrakuPackage')), 'Mr.Johnson');
 }
Exemple #11
0
 public function accept(SR_Player $player)
 {
     $player->giveItems(array(SR_Item::createByName('Package')));
     return parent::accept($player);
 }