Exemple #1
0
 private function onElevate(SR_Player $player, $n = 0, $btn = 'up')
 {
     if (false === ($floor = $this->getElevatorFloorN($n))) {
         $player->message('This floor does not exist.');
         return false;
     }
     if (false === $this->hasElevatorPermN($player, $n)) {
         $player->msg('1135');
         // 			$player->message('Somehow the elevator is blocking this floor for you.');
         return false;
     }
     if ($floor->getName() === $this->getName()) {
         $player->msg('1136');
         // 			$player->message('You push the button but you are on the very same floor already.');
         return false;
     }
     $eta = $this->getElevatorTime();
     $player->getParty()->ntice('5177', array($btn, Shadowfunc::displayETA($eta)));
     if (false === $this->teleportInside($player, $floor->getName(), $eta)) {
         $player->message('Error!');
         return false;
     }
     // 		$message = 'Your party pushes the '.$btn.' button and the elevator starts to move. '.Shadowfunc::displayETA($eta);
     // 		return $player->getParty()->notice($message);
     return true;
 }