コード例 #1
0
ファイル: Stephen.php プロジェクト: sinfocol/gwf3
 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     $b = chr(2);
     # bold
     switch ($word) {
         case 'seattle':
             return $this->reply("I'm happy I'm out of there. Delaware is way more awesome.");
         case 'shadowrun':
             return $this->reply("So you are a Runner? Good for you.");
         case 'cyberware':
             return $this->reply("Cyberware? Its awesome. Just remember that enemy spells hurt you a lot with too much cyberware :(");
         case 'magic':
             return $this->reply("Magic sucks. Use cyberware :)");
         case 'hire':
             return $this->reply("Can't hire me. I like my job here, much better than back in Renraku.");
         case 'blackmarket':
             return $this->reply("Shhh! If my boss Andrew hears us he will fire me!");
         case 'bounty':
             return $this->reply("There's no bounty on me, go away!");
         case 'alchemy':
             return $this->reply("Are you from medieval times? There's no such thing as changing stone to gold!");
         case 'invite':
             return $this->reply("A party? It's not in an elevator, so I won't come.");
         case 'renraku':
             return $this->reply("Don't remind me of that, have been bad times.");
         case 'malois':
             return $this->reply("Hmm.. I heard this name before, but I don't remember...");
         case 'bribe':
             if (count($args) === 0) {
                 $this->reply("Please specify an amount to bribe Stephen");
                 return false;
             } else {
                 if (!$player->hasNuyen($args[0])) {
                     return $this->reply("Don't try to fool me, you don't have enough ny");
                 } else {
                     $player->pay($args[0]);
                     return $this->reply("Thanks, but I don't have anything for you.");
                 }
             }
         case 'yes':
             return $this->reply("Yes what? \"Yes sir!\" it is");
         case 'no':
             return $this->reply("...");
         case 'negotiation':
             return $this->reply("That won't work on me.");
         case 'hello':
             return $this->reply("Hello, I'm Stephen.");
         default:
             return $this->reply("I do not know anything about {$word}.");
     }
 }
コード例 #2
0
ファイル: SR_ClanHQ.php プロジェクト: sinfocol/gwf3
 private function onBuyMembers(SR_Player $player, SR_Clan $clan, array $args)
 {
     $dadd = self::ADD_MEMBERS;
     $dcost = Shadowfunc::displayNuyen(self::COST_MEMBERS);
     if (count($args) !== 2 || $args[1] !== self::CONFIRM_PHRASE) {
         return $player->msg('5170', array($clan->displayMaxMembercount(), $dadd, $dcost, self::CONFIRM_PHRASE));
         // 			$player->message(sprintf(
         // 				'Your clan currently can have a maximum of %s members. Raising this maximum by %s would cost you %s. Please type #manage buystorage %s to confirm.',
         // 				$clan->getMaxMembercount(), $dadd, $dcost, self::CONFIRM_PHRASE
         // 			));
         return true;
     }
     if ($clan->getMaxMembercount() >= SR_Clan::MAX_MEMBERCOUNT) {
         $player->msg('5171', array($clan->getMembercount(), $clan->displayMaxMembercount()));
         // 			$player->message(sprintf('Your clan has already reached the maximum of %s/%s storage.', $clan->displayStorage(), $clan->displayMaxStorage()));
         return false;
     }
     if (false === $player->hasNuyen(self::COST_MEMBERS)) {
         $player->msg('1063', array($dcost, $player->displayNuyen()));
         // 			$player->message(sprintf('It would cost %s to raise your max members by %s, but you only got %s.',
         // 				$dcost, $dadd, $player->displayNuyen()
         // 			));
         return false;
     }
     if (false === $player->giveNuyen(-self::COST_MEMBERS)) {
         $player->message('DB ERROR 2');
         return false;
     }
     if (false === $clan->addMembercount(self::ADD_MEMBERS)) {
         $player->message('DB ERROR 2');
         return false;
     }
     $player->msg('5172', array($dcost, $clan->getMembercount(), $clan->displayMaxMembercount()));
     // 		$player->message(sprintf(
     // 			'You paid %s and your clan has now of %s/%s members.',
     // 			$dcost, $clan->getMembercount(), $clan->getMaxMembercount()
     // 		));
     return SR_ClanHistory::onAddMembers($clan, $player);
 }
コード例 #3
0
ファイル: Ninja.php プロジェクト: sinfocol/gwf3
 private function teachNinja(SR_Player $player, $price)
 {
     $p = Shadowfunc::displayNuyen($price);
     if ($player->hasSkill('ninja')) {
         $this->rply('enough');
         // 			$this->reply('Thank you, but you already donated enough :)');
     } elseif ($player->hasNuyen($price)) {
         $player->pay($price);
         $player->levelupFieldTo('ninja', 0);
         // 			$player->updateField('ninja', 0);
         $this->rply('come');
         $player->message($this->langNPC('teaching'));
         // 			$this->reply("Thank you my friend. Come with me...");
         // 			$player->message('The monk teaches you the Ninja Skill. This will improve attack and damage for ninja weapons.');
         $player->modify();
     } else {
         $this->rply('sry', array($p));
         // 			$this->reply("I am sorry, but learning the ninja skill cost $p.");
     }
 }