Exemple #1
0
 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (false === ($auris = $player->getInvItemByName('Auris'))) {
         return $npc->reply($this->lang('aww1'));
         // 			return $npc->reply('Oh, you don\'t have an Auris for me?');
     }
     if (!$this->rightInTime($player)) {
         return $npc->reply($this->lang('aww2'));
         // 			return $npc->reply('You got the Auris? :) ... Oh, it turned to stone already :(');
     }
     $auris->useAmount($player, 1);
     $player->message($this->lang('hand'));
     // 		$player->message('You hand the pot of fluid Auris to the gnome ...');
     $npc->reply($this->lang('thx1'));
     // 		$npc->reply('Wow. Thank you so very very much.');
     $npc->reply($this->lang('thx2'));
     // 		$npc->reply('You surely earned a special reward now ... Let me think ...');
     $npc->reply($this->lang('thx3'));
     // 		$npc->reply('Right ... I will teach you the teleportii spell. It is quite powerful!');
     $player->levelupSpell('teleportii');
     $player->message($this->lang('learned'));
     // 		$player->message('You learned a new spell: teleportii');
     $this->onSolve($player);
     return true;
 }
 public function onRoundtripShow(SR_Player $player, SR_TalkingNPC $johnson)
 {
     # Has crystal?
     if (false === ($crystal = $player->getInvItemByName('DataCrystal', false))) {
         return false;
     }
     # Is a johnson?
     $name = $johnson->getNPCClassName();
     if (!in_array($name, self::$JOHNSONS, true)) {
         echo "{$name} is NOT A JOHNSON!\n";
         return false;
     }
     # Already shown?
     $data = $this->getQuestData();
     if (in_array($name, $data, true)) {
         echo "ALREADY SHOWN TO A JOHNSON!\n";
         return false;
     }
     # Save it!
     $data[] = $name;
     $this->saveQuestData($data);
     $player->message(sprintf('You show Mr. Johnson the data crystal ...'));
     $johnson->reply('Thank you ... this was very important!');
     return true;
 }
Exemple #3
0
 public function onItemUse(SR_Player $player, array $args)
 {
     if (!$player->getInvItemByName('Lighter', false)) {
         $player->message('You don\'t have a lighter.');
         return false;
     }
     return true;
 }
 public function onQuestSolve(SR_Player $player)
 {
     $xp = $this->getRewardXP();
     $ny = $this->getRewardNuyen();
     $this->msg('solved', array(Shadowfunc::displayNuyen($ny), $xp));
     // 		$player->message(sprintf('The dwarf cheers and hands you %s. You also gained %s XP.', Shadowfunc::displayNuyen($ny), $xp));
     // 		$player->giveXP($xp);
     // 		$player->giveNuyen($ny);
     if (false !== ($scalps = $player->getInvItemByName('PunkScalp'))) {
         $scalps->deleteItem($player);
     }
     $quest1 = SR_Quest::getQuest($player, 'Redmond_AresDwarf_I');
     $quest1 instanceof Quest_Redmond_AresDwarf_I;
     if ($quest1->isDone($player)) {
         $this->onSolveDuo($player);
     }
 }
Exemple #5
0
 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (false == ($cards = $player->getInvItemByName('IDCard'))) {
         return;
     }
     if ($cards->getAmount() < 3) {
         return;
     }
     $cards->useAmount($player, 3);
     $player->message($this->lang('hand'));
     $npc->reply($this->lang('thx1'));
     $npc->reply($this->lang('thx2'));
     // 		$player->message('You hand 3 IDCards to Malois.');
     // 		$npc->reply('Thank you very much. Now we sneak into Renraku and find out what they did to us.');
     // 		$npc->reply('By the way... I remember you from the experiments there...');
     $this->onSolve($player);
 }
Exemple #6
0
 private function checkQuestHotelier(SR_NPC $npc, SR_Player $player)
 {
     $data = $this->getQuestData();
     if (isset($data['gave'])) {
         return false;
     }
     if (false === ($item = $player->getInvItemByName('Package'))) {
         return false;
     }
     if (false === $player->deleteFromInventory($item)) {
         return false;
     }
     $data['gave'] = 1;
     $this->saveQuestData($data);
     $player->message($this->lang('give1'));
     $npc->reply($this->lang('give2'));
     $player->message($this->lang('give3'));
     // 		$player->message('You give the package to the hotelier: "Here is a package for you from Mr.Johnson!"');
     // 		$npc->reply('Oh, Thank you. I am sure Mr.Johnson will reward you well.');
     // 		$player->message('The hotelier takes the package');
     return true;
 }
Exemple #7
0
 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (false === ($auris = $player->getInvItemByName('Auris'))) {
         return $npc->reply('Oh, you don\'t have more Auris for me?');
     }
     if (!$this->rightInTime($player)) {
         return $npc->reply('You got the Auris? :) ... Oh, it turned to stone already :(');
     }
     $have_before = $this->getAmount();
     $need = $this->getNeededAmount();
     $have = $this->giveQuesties($player, $npc, 'Auris', $have_before, $need);
     if ($have > $have_before) {
         $npc->reply('Thank you a lot, chummer.');
         $this->saveAmount($have);
     }
     if ($have >= $need) {
         $npc->reply('Wow ... You really earned a great reward now ... I will take my time and teach you the teleportiii spell!');
         $player->levelupSpell('teleportiii');
         return $this->onSolve($player);
     } else {
         return $npc->reply(sprintf('I still need %d fluid Auris for my experiments.', $need - $have));
     }
 }
Exemple #8
0
 public static function getCurrentCommands(SR_Player $player, $show_hidden = true, $boldify = false, $long_versions = true, $translate = false, $filter_hidden = false, $hidden_only = false)
 {
     if ($player->isOptionEnabled(SR_Player::DEAD)) {
         return array_merge(self::$CMDS_ALWAYS_CREATE, array('reset'));
     }
     if (false === $player->isCreated()) {
         return self::$CMDS_ALWAYS_CREATE;
     }
     if (false === ($party = $player->getParty())) {
         return array();
     }
     $action = $party->getAction();
     $leader = $player->isLeader();
     $commands = array();
     # Allways commands
     if (!$hidden_only) {
         $commands = array_merge($commands, self::$CMDS_ALWAYS);
     }
     # Always
     if ($show_hidden) {
         $commands = array_merge($commands, self::$CMDS_ALWAYS_CREATE);
     }
     # GM commands
     if ($show_hidden && $player->isGM()) {
         $commands = array_merge($commands, self::$CMDS_GM);
     }
     # Hidden commands
     if ($show_hidden) {
         $commands = array_merge($commands, self::$CMDS_ALWAYS_HIDDEN);
     }
     # Player actions
     if (!$hidden_only) {
         $commands = array_merge($commands, self::$CMDS[$action]);
         if (false !== ($scanner = $player->getInvItemByName('Scanner_v6', false))) {
             $commands[] = 'spy';
         }
         if ($player->getBase('alchemy') >= 0) {
             $commands[] = 'brew';
         }
     }
     # Leader actions
     if ($leader) {
         if ($show_hidden) {
             $commands = array_merge($commands, self::$CMDS_LEADER_ALWAYS);
         }
         if (!$hidden_only) {
             # Outside location?
             if (false !== ($location = $party->getLocationClass('outside'))) {
                 if ($location->isEnterAllowed($player)) {
                     # We can enter
                     $commands[] = 'enter';
                 }
             }
             # Action
             $commands = array_merge($commands, self::$CMDS_LEADER[$action]);
         }
     }
     # Location commands
     if (!$hidden_only) {
         if (false !== ($location = $party->getLocationClass('inside'))) {
             # Leader
             if ($leader === true) {
                 // 				$commands = array_merge($commands, self::shortcutArray($location->getLeaderCommands($player)));
                 $commands = array_merge($commands, $location->getLeaderCommands($player));
                 if ($location->isPVP()) {
                     $commands[] = 'fight';
                 }
             }
             # Talk
             $commands = array_merge($commands, $location->getNPCTalkCommands($player));
             # Special
             // 			$commands = array_merge($commands, self::shortcutArray($location->getCommands($player)));
             $commands = array_merge($commands, $location->getCommands($player));
         } elseif (false !== ($location = $party->getLocationClass('outside'))) {
             if ($location->isHijackable()) {
                 $commands[] = 'hijack';
             }
             //			if ($location->isPVP())
             //			{
             $commands[] = 'fight';
             //			}
         }
     }
     // 		if ($long_versions === false)
     // 		{
     // 			$commands = array_map(array(__CLASS__, 'shortcut'), $commands);
     // 		}
     // 		if ($long_versions === true)
     // 		{
     // 			$commands = array_map(array(__CLASS__, 'unshortcut'), $commands);
     // 		}
     ##############
     ### FORMAT ###
     ##############
     if ($filter_hidden) {
         $commands = array_values(array_diff($commands, self::$REALLY_HIDDEN));
     }
     if ($boldify) {
         // 			if ($long_versions === true)
         // 			{
         // 				$commands = array_map(array(__CLASS__, 'boldify_longs'), $commands);
         // 			}
         // 			else
         // 			{
         $commands = array_map(array(__CLASS__, 'boldify'), $commands);
         // 			}
     }
     # Shortcut
     if (!$long_versions) {
         $commands = array_map(array(__CLASS__, 'shortcut_bolded'), $commands);
     }
     # Translate
     if ($translate) {
         $commands = array_map(array(__CLASS__, 'translate_bolded'), $commands);
     }
     # \o/
     return $commands;
 }