예제 #1
0
 private function onTrollReward(SR_NPC $npc, SR_Player $player)
 {
     $max = $player->isRunner() ? Shadowcmd_lvlup::MAX_VAL_ATTRIBUTE_RUNNER : Shadowcmd_lvlup::MAX_VAL_ATTRIBUTE;
     $base = $player->getBase('magic');
     if ($base >= $max) {
         $ny = 5000;
         $player->giveNuyen($ny);
         return $player->message($this->lang('reward_ny', array($ny)));
         // 			return $player->message('Larry hands you another 5000 nuyen!');
     }
     $player->message($this->lang('reward1'));
     // 		$player->message('Larry leads you to a shamane: "This is our shamane, Srando, he can help you."');
     $race = $player->getRace();
     if ($race === 'Ork' || $race === 'Troll') {
         $player->message($this->lang('reward2', array($race)));
         // 			$player->message('The shamane says: "You are a strong '.$race.'. You just need to calm down sometime."');
         $player->message($this->lang('reward3'));
         // 			$player->message('You are starting to argue, but the shamane continues: "If you calm you have more time to strengthen yourself. Focus yourself, and the path is clear."');
         $player->message($this->lang('reward4'));
         // 			$player->message('The shamane touches your head: "Your mind is now clear from anything. You can focus yourself from now on."');
         $player->message($this->lang('reward5'));
         // 			$player->message('Your character is now allowed to learn magic and spells.');
     } else {
         $player->message($this->lang('reward5'));
         // 			$player->message('The shamane mumbles some magic spells and raises your base value for magic by 1.');
     }
     $player->alterField('magic', 1);
     $player->modify();
     return true;
 }
예제 #2
0
 public function onHireB(SR_Player $player, $price, $time)
 {
     $p = $player->getParty();
     $player->giveNuyen(-$price);
     $npc = $this->spawn($p);
     $npc->onHireC($player, $time);
 }
예제 #3
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));
 }
예제 #4
0
 public function getNPCLoot(SR_Player $player)
 {
     $nuyen = 1200;
     $key = 'SEATTLE_ARENA_N';
     $player->setConst($key, $player->getConst($key) + 1);
     $player->msg('5125', array(Shadowfunc::displayNuyen($nuyen)));
     // 		$player->message("The fight is over. The director hands you $nuyen Nuyen.");
     $player->giveNuyen($nuyen);
     return array();
 }
예제 #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));
 }
예제 #6
0
 public function onQuestSolve(SR_Player $player)
 {
     $nuyen = 1000;
     $xp = 5;
     $player->message($this->lang('thx1'));
     $player->message($this->lang('thx2'));
     $player->message($this->lang('thx3', array($nuyen, $xp)));
     // 		$player->message(sprintf('Mr.Johnson looks not really happy...'));
     // 		$player->message(sprintf('"Here chummer, take this as reward.", Mr.Johnson says, "But our client did a mistake when ordering my service...".'));
     // 		$player->message(sprintf('He hands you %s Nuyen and you also gain %s XP.', $nuyen, $xp));
     $player->giveNuyen($nuyen);
     $player->giveXP($xp);
 }
예제 #7
0
파일: Priest.php 프로젝트: sinfocol/gwf3
 private function onPraySins(SR_Player $player, $price)
 {
     $nuyen = $player->getNuyen();
     $dp = Shadowfunc::displayNuyen($price);
     $dn = Shadowfunc::displayNuyen($nuyen);
     if ($price > $nuyen) {
         return $this->rply('cost', array($dp, $dn));
         // 			return $this->reply(sprintf('My son, it would cost %s to forgive your sins, but you have only %s.', $dp, $dn));
     }
     $player->giveNuyen(-$price);
     $dl = Shadowfunc::displayNuyen($nuyen - $price);
     $player->message($this->langNPC('pay', array($dp, $dl)));
     // 		$player->message("You pay the price of {$dp} and have {$dl} left.");
     $player->alterField('bad_karma', -1);
     $badkarma = $player->getBase('bad_karma');
     return $this->rply('thx', array($badkarma));
     // 		return $this->reply("Thank you my son. You now have only {$badkarma} bad karma left.");
 }
예제 #8
0
파일: AresMan.php 프로젝트: sinfocol/gwf3
 private function buyPermission(SR_Player $player)
 {
     if ($player->hasConst("SEATTLE_BM", 1)) {
         return $player->message($this->langNPC('already'));
         // 			$player->message("You already have permission to enter the blackmarket in Seattle.");
         // 			return ;
     }
     $nuyen = $player->getNuyen();
     if ($nuyen < $this->price) {
         return $player->message($this->langNPC('poor', array($this->price, $nuyen)));
         // 			$player->message("The salesman is shaking his head...\"No!\", he says, \"I want $this->price, not $nuyen\".");
         // 			return;
     }
     $player->giveNuyen(-$this->price);
     $player->message($this->langNPC('give', array($this->price)));
     // 		$player->message("You give $this->price Nuyen to the salesman...");
     $player->setConst("SEATTLE_BM", 1);
     return $this->rply('purchase');
     // 		$this->reply('Ok, here is your permission to enter the blackmarket. And you don\'t know me!');
 }
예제 #9
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);
 }
예제 #10
0
파일: SR_Bounty.php 프로젝트: sinfocol/gwf3
 public static function onKilledByHuman(SR_Player $killer, SR_Player $victim)
 {
     $b = chr(2);
     $where = 'sr4bo_victim=' . $victim->getUID();
     $bounty = self::table(__CLASS__)->selectAll('sr4bo_id, sr4bo_bounty', $where, '');
     $sum = 0;
     foreach ($bounty as $data) {
         $b = $data['sr4bo_bounty'];
         //			SR_BountyHistory::onKilled($killer, $victim, $data['sr4bo_id']);
         $sum += $b;
     }
     $victim->updateField('bounty', 0);
     $killer->giveNuyen($sum);
     $killer->increase('sr4pl_bounty_done', $sum);
     self::table(__CLASS__)->deleteWhere($where);
     $killer->msg('5034', array(Shadowfunc::displayNuyen($sum)));
     // 		$killer->message(sprintf("You collected a {$b}bounty{$b}: %s.", Shadowfunc::displayNuyen($sum)));
 }
예제 #11
0
 public function getNPCLoot(SR_Player $player)
 {
     if ($this->arena_ny > 0) {
         $ny = $this->arena_ny;
         $player->msg('5125', array(Shadowfunc::displayNuyen($ny)));
         // 			$player->message(sprintf('You get a reward of %s for killing the enemy.', Shadowfunc::displayNuyen($ny)));
         $player->giveNuyen($ny);
     }
     if ($this->arena_key === NULL) {
         return array();
     }
     list($bit, $key) = explode(':', $this->arena_key);
     $bits = (int) SR_PlayerVar::getVal($player, $key, 0);
     $bits |= $bit;
     SR_PlayerVar::setVal($player, $key, $bits);
     return array();
 }