Пример #1
0
 public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL)
 {
     echo "HERE\n";
     $temp = 'QT_LILLY';
     switch ($word) {
         default:
             $t = $player->getTemp($temp, 0);
             $player->setTemp($temp, $t + 1);
             echo "HERE {$t}\n";
             switch ($t) {
                 case 0:
                     $npc->reply($this->lang('sr1'));
                     $npc->reply($this->lang('sr2'));
                     return false;
                 case 1:
                     $npc->reply($this->lang('sr3'));
                     $npc->reply($this->lang('sr4'));
                     return false;
                 case 2:
                     $npc->reply($this->lang('sr5'));
                     $npc->reply($this->lang('sr6'));
                 default:
                     return $npc->reply($this->lang('confirm'));
             }
         case 'confirm':
             return $npc->reply($this->lang('confirm'));
         case 'yes':
             return $npc->reply($this->lang('yes'));
         case 'no':
             return $npc->reply($this->lang('no'));
     }
 }
Пример #2
0
 private function calcNegPrice(SR_Player $player)
 {
     $price = 10000;
     $try = $player->getTemp(self::TEMP_WORDN);
     $price -= $try * 1000;
     return $price;
 }
Пример #3
0
 /**
  * Filter Store Items through availability.
  * @param SR_Player $player
  */
 public function getStoreItemsB(SR_Player $player)
 {
     $key = $this->getStoreItemsKey();
     if ($player->hasTemp($key)) {
         return $player->getTemp($key);
     }
     $rep = Common::clamp($player->get('reputation'), 0, 25) * 0.5;
     $items = $this->getStoreItems($player);
     if (!is_array($items)) {
         return array();
     }
     $back = array();
     $unique = false;
     foreach ($items as $i => $data) {
         $avail = isset($data[1]) ? $data[1] : 100.0;
         $avail += $rep;
         if (Shadowfunc::dicePercent($avail)) {
             $back[] = $data;
         } else {
             $unique = true;
         }
     }
     if ($unique === true) {
         $player->setTemp($key, $back);
     }
     return $back;
 }
Пример #4
0
 private static function getShoutWait(SR_Player $player)
 {
     $range = self::MAX_DELAY - self::MIN_DELAY;
     $tpl = $range / self::MAX_LEVEL;
     $level = Common::clamp($player->getBase('level'), 0, self::MAX_LEVEL);
     $delay = self::MIN_DELAY + $tpl * (self::MAX_LEVEL - $level);
     $last = $player->hasTemp(self::TEMP_KEY) ? $player->getTemp(self::TEMP_KEY) : 0;
     $next = $last + $delay;
     return $next - time();
 }
Пример #5
0
 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     $t = 'Redmond_Soldier_Hire';
     $price = 400 - Common::clamp($player->get('negotiation'), 0, 10) * 10;
     $time = 600 * $player->get('charisma') * 60;
     $b = chr(2);
     switch ($word) {
         case 'renraku':
             $msg = "I like their {$b}hardware{$b}, but they have too much influence to the market.";
             break;
         case 'hardware':
             $msg = "Yeah... Hardware and stuff. You don't know Renraku? Are you a crackhead?";
             break;
         case 'shadowrun':
             $msg = "You need to {$b}hire{$b} a runner?";
             break;
         case 'gizmore':
             $msg = "If you are here for a special quest, I can only say I have no idea. Is there a city full of you?";
             break;
         case 'hire':
             if ($player->getTemp($t)) {
                 $msg = "What do you say, chummer?";
             } else {
                 $msg = "I will follow you for a while for... Let's say... {$price} bucks.";
                 $player->setTemp($t, 1);
             }
             break;
         case 'yes':
             if ($player->hasTemp($t)) {
                 $msg = $this->onHire($player, $price, $time);
                 $player->unsetTemp($t);
             } else {
                 $msg = "Yes! Have a seat.";
             }
             break;
         case 'no':
             if ($player->getTemp($t)) {
                 $player->unsetTemp($t);
             }
             $msg = "Then not.";
             break;
         default:
             $msg = "What's up, chummer?";
             break;
     }
     $this->reply($msg);
 }
Пример #6
0
 public function on_search(SR_Player $player, array $args)
 {
     $key = $this->getTempKey();
     $attemp = $player->getTemp($key, 0);
     if ($attemp >= $this->getSearchMaxAttemps()) {
         $player->msg('1148');
         // 			$player->message('Not again.');
         return;
     }
     $attemp++;
     $player->setTemp($key, $attemp);
     $loot = array_merge(Shadowfunc::randLoot($player, $this->getSearchLevel(), array(), $this->getSearchChanceNone()), $this->getSearchLoot($player));
     if (count($loot) > 0) {
         $player->msg('5185', array($this->getName()));
         // 			$player->message(sprintf('You search the %s...', $this->getName()));
         $player->giveItems($loot, 'searching ' . $this->getName());
     } else {
         $player->msg('5186', array($this->getName()));
         // 			$player->message(sprintf('You search the %s... But find nothing.', $this->getName()));
     }
 }
Пример #7
0
 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('fireball', 4500 + $p), array('firebolt', 2500 + $p), array('firewall', 8500 + $p), array('flu', 2000 + $p), array('poison_dart', 4000 + $p), array('vulcano', 25000 + $p));
 }
Пример #8
0
 public function onDoctorTalk(Delaware_Doctor $npc, SR_Player $player, $word)
 {
     $price = $this->displayRewardNuyen();
     $key = 'DLW_DOC_HAND';
     if (false === $player->hasTemp($key)) {
         $player->setTemp($key, 1);
     }
     $temp = $player->getTemp($key);
     switch ($word) {
         case 'yes':
             switch ($temp) {
                 case 1:
                     return $npc->reply($this->lang('doc_yes'));
                     // 						return $npc->reply('Yes');
                 // 						return $npc->reply('Yes');
                 case 2:
                     $player->setTemp($key, 1);
                     return $npc->reply($this->lang('doc_haha'));
                     // 						return $npc->reply('Hahahah ^^');
                 // 						return $npc->reply('Hahahah ^^');
                 case 3:
                     return $this->onConvince($npc, $player);
             }
         case 'no':
             switch ($temp) {
                 case 1:
                     break;
                 case 2:
                     $player->setTemp($key, $temp + 1);
                     return $npc->reply($this->lang('doc_ok', array($price)));
                     // 						return $npc->reply("Okok ... I will do it for {$price}.");
                 // 						return $npc->reply("Okok ... I will do it for {$price}.");
                 case 3:
                     $player->setTemp($key, 1);
                     return $npc->reply($this->lang('doc_haha_ok'));
                     // 						return $npc->reply("Haha ok :)");
             }
         case 'hand':
             switch ($temp) {
                 case 1:
                     $player->setTemp($key, $temp + 1);
                 default:
                     return $npc->reply($this->lang('doc_oh'));
                     // 						return $npc->reply("Haha, the old dwarf sent you? That's funny.");
             }
     }
     return $npc->reply($this->lang('doc_mh'));
     // 		return $npc->reply('Pardon?');
 }
Пример #9
0
 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('magic', 1500 + $p), array('casting', 2500 + $p), array('orcas', 4000 + $p), array('berzerk', 4500 + $p), array('freeze', 4000 + $p), array('calm', 2000 + $p), array('heal', 3500 + $p), array('flu', 1000 + $p), array('poison_dart', 3000 + $p), array('firebolt', 2500 + $p), array('fireball', 5000 + $p), array('blow', 2500 + $p));
 }
Пример #10
0
 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('berzerk', 3500 + $p), array('blow', 2500 + $p), array('chameleon', 3500 + $p), array('freeze', 4500 + $p), array('goliath', 3500 + $p), array('hawkeye', 3500 + $p), array('turtle', 6500 + $p));
 }
Пример #11
0
 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Redmond_Teacher::TEMP_PISSED, 0) * 150;
     return array(array('magic', 1000 + $p), array('calm', 2000 + $p), array('goliath', 1000 + $p), array('hawkeye', 1000 + $p), array('hummingbird', 1500 + $p), array('turtle', 2500 + $p), array('firebolt', 1500 + $p));
 }
Пример #12
0
 public function getFields(SR_Player $player)
 {
     $p = $player->getTemp(Seattle_Shamane::TEMP_PISSED, 0) * 250;
     return array(array('calm', 2500 + $p), array('heal', 4500 + $p));
 }
Пример #13
0
 private function onNo(SR_Player $player)
 {
     $tmp = $player->getTemp(self::TMP_SCROLL, 0);
     if ($tmp === 0) {
         $this->reply('No, i get it.');
     } else {
         $this->onCheckNo($player);
     }
 }