Beispiel #1
0
 public function onEnterLocation(SR_Party $party)
 {
     $player = $party->getLeader();
     if ('1' === SR_PlayerVar::getVal($player, self::SWORDKEY, '0')) {
         $numBansh = self::getNumBanshees($player);
         $this->partyMessage($player, 'magic1');
         $this->partyMessage($player, 'magic2');
         $this->partyMessage($player, 'magic3');
         $enemies = array('Forest_Mordak');
         for ($i = 0; $i < $numBansh; $i++) {
             $enemies[] = 'Forest_Banshee';
         }
         shuffle($enemies);
         # Legitimate use of shuffle!
         $party->fight(SR_NPC::createEnemyParty($enemies));
     }
 }
Beispiel #2
0
 public function onLeaveLocation(SR_Party $party)
 {
     $errors = '';
     foreach ($party->getMembers() as $member) {
         $member instanceof SR_Player;
         if (false === ($item = $member->getInvItemByName('ID4Card'))) {
             $errors .= sprintf(', %s', $member->getName());
         } else {
             $member->message($this->lang($member, 'usecard', array($item->getAmount())));
             // 				$member->message(sprintf('You use one of your %d ID4 cards...', $item->getAmount()));
             $item->useAmount($member, 1);
         }
     }
     if ($errors !== '') {
         $this->partyMessage($party->getLeader(), 'nocard', array(substr($errors, 2)));
         // 			$party->notice(sprintf('%s do(es) not have an ID4Card... You hear the alarm sound!', substr($errors, 2)));
         if (false !== ($city = $this->getCityClass())) {
             $city->setAlert($party, GWF_Time::ONE_HOUR * 2);
         }
     }
 }
Beispiel #3
0
 public function onCityEnter(SR_Party $party)
 {
     $party->getLeader()->unsetTemp('HIDE_R2_ONCE');
     return parent::onCityEnter($party);
 }
Beispiel #4
0
 private function onExplored(SR_Party $party)
 {
     $cityname = $this->getName();
     $leader = $party->getLeader();
     $total = 0;
     $possible = array();
     foreach ($this->locations as $l) {
         $l instanceof SR_Location;
         $n = $l->getName();
         if ($leader->hasKnowledge('places', $n)) {
             continue;
         }
         $perc = round($l->getFoundPercentage() * 100);
         if ($perc > 0) {
             $total += $perc;
             $possible[] = array($l, $perc);
         }
     }
     if (count($possible) === 0) {
         $party->ntice('5027', array($cityname));
         // 			$party->notice(sprintf('You explored %s again, but it seems you know every single corner of it.', $cityname));
         $party->pushAction(SR_Party::ACTION_OUTSIDE, $cityname, 0);
     } elseif (false === ($l = Shadowfunc::randomData($possible, $total, 500))) {
         $party->ntice('5028', array($cityname));
         // 			$party->notice(sprintf('You explored %s again, but could not find anything new.', $cityname));
         $party->pushAction(SR_Party::ACTION_OUTSIDE, $cityname, 0);
     } else {
         $l instanceof SR_Location;
         $n = $l->getName();
         $party->giveKnowledge('places', $n);
         $party->ntice('5029', array($n, $l->getFoundText($leader)));
         // 			$party->notice($l->getFoundText($leader));
         $leader->hlp('hlp_in_outside');
         // 			$leader->help('When you find locations, you are outside of them. Use #goto or #enter to enter them. You can #(exp)lore again to find more locations.');
         $party->pushAction(SR_Party::ACTION_OUTSIDE, $n);
     }
 }
Beispiel #5
0
 public static function isKillProtectedRealNPCParty(SR_Party $defenders)
 {
     $leader = $defenders->getLeader();
     if ($leader instanceof SR_RealNPC) {
         return $leader->isKillProtected();
     }
     return false;
 }
Beispiel #6
0
 public function onCityEnter(SR_Party $party)
 {
     $player = $party->getLeader();
     SR_PlayerVar::setVal($player, 'THQLVTRC', 0);
     return parent::onCityEnter($party);
 }
Beispiel #7
0
 public function getNPCMeetPercent(SR_Party $party)
 {
     $player = $party->getLeader();
     $quest = SR_Quest::getQuest($player, 'Seattle_Ranger');
     return $quest->getAmount() > 0 ? 70 : 0;
 }