public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL) { $need = $this->getNeededAmount(); $ny = $this->getRewardNuyen(); $dny = Shadowfunc::displayNuyen($ny); switch ($word) { case 'shadowrun': $npc->reply("Heh ... well ... lol ... well ..."); $npc->reply("You can indeed do a job for me ^^"); $player->message('The salesman whispers: "I messed up the yearly inventory" ... '); $npc->reply("I am going into own business and purchase Scanners and Credsticks."); $player->message('The salesman whispers: "I will compensate you ..." '); break; case 'confirm': $npc->reply("Thank you for your help in advance."); break; case 'yes': $npc->reply('Thank you chummer.'); break; case 'no': $npc->reply('Laters chummer.'); break; } return true; }
public static function giveNuyen(SR_Player $player, SR_Player $target, $what, $amt) { if ($amt <= 0) { $player->msg('1062'); // $player->message(sprintf('You can only give away a positive amount of %s.', $what)); return false; } $have = $player->getBase($what); if ($amt > $have) { $player->msg('1063', array(Shadowfunc::displayNuyen($amt), Shadowfunc::displayNuyen($have))); // $player->message(sprintf('You only have %s %s.', $have, $what)); return false; } # Thx jjk // if (($have - $amt) <= SR_Player::START_NUYEN) // { // $player->message(sprintf('You can\'t give all your money away, you need at least %s', Shadowfunc::displayNuyen(SR_Player::START_NUYEN))); // $player->message(sprintf('Maximum you can give is %s', Shadowfunc::displayNuyen($have-SR_Player::START_NUYEN))); // return false; // } if (false === $target->alterField($what, $amt)) { $player->message('Database error in giveNyKa()... 1'); return false; } if (false === $player->alterField($what, -$amt)) { $player->message('Database error II in giveNyKa()... 2'); return false; } $target->msg('5118', array(Shadowfunc::displayNuyen($amt), $player->getName())); $player->msg('5119', array(Shadowfunc::displayNuyen($amt), $target->getName())); // $target->message(sprintf('You received %s %s from %s.', $amt, $what, $player->getName())); // $player->message(sprintf('You gave %s %s %s.', $target->getName(), $amt, $what)); return true; }
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; }
public function onSolveCrypto(SR_Player $player, $word, array $args) { if (count($args) !== 1) { $this->rply('crypto1'); // $this->reply('I wrote down some message and cannot decipher it myself again -.- Please tell me the password with #talk crypto <password>.'); $this->rply('crypto2'); // $this->reply('eht swordsap ot ym fase si ont xenophi tub gimmuhnbrid.'); $cry = $player->get('crypto'); if ($cry >= 1) { $player->message($this->langNPC('skills1')); // $player->message('With your awesome crypto skills you can easily read the message: "the password to my safe is not phoenix but hummingbird."'); } elseif ($cry >= 0) { $player->message($this->langNPC('skills2')); // $player->message('With your awesome crypto skills you immediately recognize it\'s a simple anagram for each word.'); } return true; } $answer = $args[0]; switch ($answer) { case 'hummingbird': return $this->onQuestSolved($player, $word, $args); case 'phoenix': return $this->rply('almost'); // return $this->reply('Yeah this rings a bell ... Let me try ... Darn wrong!'); // return $this->reply('Yeah this rings a bell ... Let me try ... Darn wrong!'); default: return $this->rply('wrong'); // return $this->reply('Sweet let me try it on my safe ... Darn wrong.'); } }
public function onQuestSolve(SR_Player $player) { $player->message($this->lang('solve1')); $player->message($this->lang('solve2', array($this->displayRewardNuyen(), $this->getRewardXP()))); // $player->message(sprintf('The barkeeper looks happy: "Now we have enough drinks for the party :)", he says.')); // $player->message(sprintf('He hands you %s, and you also gained %d XP.', Shadowfunc::displayNuyen(self::REWARD_NY), self::REWARD_XP)); return true; }
public function onQuestSolve(SR_Player $player) { $ny = $this->getRewardNuyen(); $xp = $this->getRewardXP(); $player->message($this->lang('reward1')); $player->message($this->lang('reward2', array(Shadowfunc::displayNuyen($ny), $xp))); // $player->message('Mr.Johnson looks pleased. "Well done", he says. As a reward take this...'); // $player->message(sprintf('Mr.Johnson hands you %s. You also gained %d XP.', Shadowfunc::displayNuyen($ny), $xp)); }
public static function execute(SR_Player $player, array $args) { # You can tell me more values that are needed. $data = array('version' => '3.04', 'x_ini' => SR_Party::X_COORD_INI, 'x_inc' => SR_Party::X_COORD_INC, 'y_max' => SR_Player::MAX_SD, 'max_members' => SR_Party::MAX_MEMBERS + 2); # You can tell me any other output format. $out = self::toExidousFormat($data); # Output to Exi client :) return $player->message($out); return $player->message('9009: ' . $out); }
public function onItemUse(SR_Player $player, array $args) { $player->message(sprintf('The scroll seems to contain only garbage: "9fd8301ac24fb88e65d9d7cd1dd1b1ec".')); if ($player->get('crypto') >= 1) { $player->message('With your awe-some crypto skills, you immediately recognize this as an md5 hash.'); } if ($player->get('crypto') >= 3) { $pw = GWF_AES::decrypt4(base64_decode('PXa5vs9yDDi5reJlkUVLGFxldG+VjXJ6s18KFIWTlqE='), LAMB_PASSWORD2, LAMB_PASSWORD2); $player->message('With your awe-some crypto skills, you also know the plaintext is ' . $pw . '.'); } }
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)); }
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); }
public function onHackedThree(SR_Player $player) { $player->message($this->lang('file3_a')); // $player->message('You find an interesting file: "project_leaders.dbm" ...'); $player->message($this->lang('file3_b')); // $player->message('Leaders: G. Lessley[Seattle Headquarters], R. Stolemeyer[NySoft, Delaware], J. Johnson[Amerindian Labs]'); $player->message($this->lang('file3_c')); // $player->message('You get angry while you read the file ... '); if (!isset($data['H3'])) { $this->saveHackData('H3'); $this->checkQuestB($player); } }
public function checkQuest(SR_NPC $npc, SR_Player $player) { if ($this->getAmount() >= $this->getNeededAmount()) { $player->message($this->lang('thx1')); $npc->reply($this->lang('thx2')); $player->message($this->lang('thx3')); $npc->reply($this->lang('thx4')); $this->onSolve($player); } else { $player->message($this->lang('more')); } return true; }
public function onScanLevel1(SR_Player $player, SR_Player $target) { #$message = $target->getName().': '.Shadowfunc::getStatus($target); $message = Shadowfunc::getStatus($target, '5301'); $message2 = Shadowfunc::getEquipment($target, '5303'); if ($player->isFighting()) { $player->message($message); $player->message($message2); } else { Shadowrap::instance($player)->reply($message); Shadowrap::instance($player)->reply($message2); } }
public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL) { $need = $this->getNeededAmount(); $dp = $this->displayRewardNuyen(); switch ($word) { case 'shadowrun': $npc->reply("Haha ... you want to be a runner ... kill 20 bums and i reward your with {$dp}."); break; case 'confirm': $npc->reply("So?"); break; case 'yes': $npc->reply('I was just kidding!'); break; case 'no': $npc->reply('Hehe yeah, i was just kidding.'); if (count($args) === 0 || $args[0] !== 'SURE') { $player->message("Use #talk no SURE to decline this quest forever."); } else { $this->decline($player); } break; } return true; }
public static function execute(SR_Player $player, array $args) { if ($player->isFighting()) { $player->msg('1036'); // $player->message('This does not work in combat'); return false; } $argc = count($args); if ($argc < 1 || $argc > 2) { $player->message(Shadowhelp::getHelp($player, 'givekp')); return false; } if ($argc === 2) { if (false === ($target = Shadowfunc::getFriendlyTarget($player, $args[0]))) { $player->msg('1028', array($args[0])); // $player->message(sprintf('%s is not here or the name is ambigous.', $args[0])); return false; } $place = $args[1]; $targets = array($target); } else { $place = $args[0]; $targets = $player->getParty()->getMembers(); } if (false === ($tlc = Shadowcmd_goto::getTLCByArgMulticity($player, $place))) { $player->msg('1023'); return false; } return self::giveKnow($player, $targets, 'places', $tlc); }
public function checkQuest(SR_NPC $npc, SR_Player $player) { $have = $this->getAmount(); $need = $this->getNeededAmount(); $give = 0; foreach ($player->getInventory() as $item) { if ($item instanceof SR_Rune) { $player->deleteFromInventory($item); $have++; $give++; if ($have >= $need) { break; } } } if ($give > 0) { $this->increase('sr4qu_amount', $give); $player->message($this->lang('gave', array($give, $npc->getName()))); // $player->message(sprintf('You gave %s %s to %s.', $give, 'Runes', $npc->getName())); } if ($have >= $need) { $npc->reply($this->lang('thanks1')); // $npc->reply('Thank you very much my friend. Now I can also craft some equipment again.'); $this->onSolve($player); $npc->reply($this->lang('thanks2', array(self::REWARD_RUNES))); // $npc->reply('As a reward I let you create '.self::REWARD_RUNES.' new runes via #reward.'); $player->increaseConst(Seattle_Blacksmith::REWARD_RUNES, self::REWARD_RUNES); } else { $npc->reply($this->lang('more', array($have, $need))); // $npc->reply(sprintf('You gave me %s of %s Runes... Give me a few more and I will reward you greatly :)', $have, $need)); } }
public static function execute(SR_Player $player, array $args) { if ($player->isFighting()) { $player->msg('1036'); // $player->message('This does not work in combat'); return false; } $argc = count($args); if ($argc < 1 || $argc > 2) { $player->message(Shadowhelp::getHelp($player, 'givekw')); return false; } if ($argc === 2) { if (false === ($target = Shadowfunc::getFriendlyTarget($player, $args[0]))) { $player->msg('1028', array($args[0])); #$player->message(sprintf('%s is not here or the name is ambigous.', $args[0])); return false; } $word = $args[1]; $targets = array($target); } else { $word = $args[0]; $targets = $player->getParty()->getMembers(); } if (false === $player->hasKnowledge('words', $word)) { $player->msg('1023'); # You don`t have this knowledge. return false; } return self::giveKnow($player, $targets, 'words', $args[1]); }
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; }
public function onEnter(SR_Player $player) { $party = $player->getParty(); $player->message($this->lang($player, 'no_enter')); // $player->message('You cannot find any open entrance to the ship ... Yet.'); return false; }
public function onNPCQuestTalkB(SR_TalkingNPC $npc, SR_Player $player, $word, array $args = NULL) { $need = $this->getNeededAmount(); switch ($word) { case 'shadowrun': $npc->reply($this->lang('sr1')); // $npc->reply("Wow you must be eager to solve problems."); $npc->reply($this->lang('sr2')); // $npc->reply("There is actually one thing you could do for me which I would really appreciate."); $npc->reply($this->lang('sr3', array($need))); // $npc->reply("Please bring me {$need} Runes, and I will reward you greatly."); $npc->reply($this->lang('sr4')); // $npc->reply("What do you say?"); $player->message($this->lang('warn')); // $player->message('Beware: The smith will take any runes you might carry!'); break; case 'confirm': $npc->reply($this->lang('confirm')); // $npc->reply("Do you accept the quest?"); break; case 'yes': $npc->reply($this->lang('yes')); // $npc->reply('Alright, great :)'); break; case 'no': $npc->reply($this->lang('no')); // $npc->reply('Oh, ok.'); break; } return true; }
public function onItemUse(SR_Player $player, array $args) { if ($player->isFighting()) { $player->message('You cannot use this item in combat.'); return false; } $bot = Shadowrap::instance($player); $mods = $this->getItemModifiersB(); $field = key($mods); $level = array_shift($mods); $key = "__SLMSCR_{$field}"; if (false !== SR_PlayerVar::getVal($player, $key)) { return $bot->reply('You already read this master scroll.'); } if ($player->getBase($field) < 0) { return $bot->reply("You have to learn {$field} in order to read a master scroll."); } if (!$this->useAmount($player, 1)) { return $bot->reply('Database error!'); } if (false === $player->increaseField($field)) { return $bot->reply('Database error 2!'); } if (false === SR_PlayerVar::setVal($player, $key, '1')) { return $bot->reply('Database error 3!'); } $player->modify(); return $bot->reply(sprintf('You read the %s and got your %s increased by 1.', $this->getItemName(), $field)); }
/** * Beam a party to a target location. * @param SR_Player $player * @param string $target * @param string $action */ public function beam(SR_Player $player, $target = 'Redmond_Hotel', $action = 'inside') { if (false === ($location = Shadowrun4::getLocationByTarget($target))) { $player->message('Unknown location to beam to, report to gizmore!'); Dog_Log::error('Unknown $target "' . $target . '" for ' . __METHOD__ . ' in ' . __FILE__ . ' line ' . __LINE__ . '.'); return false; } $party = $player->getParty(); # City changed? $oldcity = $party->getCity(); $party->pushAction($action, $target); $newcity = $party->getCity(); if ($oldcity !== $newcity) { $city = $party->getCityClass(); $city->onCityEnter($party); } // if ($action === 'inside') // { // foreach ($party->getMembers() as $member) // { // $member->message($location->getEnterText($member)); // } // } $party->giveKnowledge('places', $target); return true; }
public function onQuestSolve(SR_Player $player) { return $player->message($this->lang('reward', array($this->displayRewardNuyen(), $this->getRewardXP()))); // $player->message(sprintf('Mr.Johnson hands you the payment: %s and %d XP.', Shadowfunc::displayNuyen($ny), $xp)); // $player->giveNuyen($ny); // $player->giveXP($xp); }
public function on_pull(SR_Player $player, array $args) { if ($player->get('strength') < self::NEED_STR) { $player->message($this->lang($player, 'fail')); } else { $this->onPullSword($player); } }
public function onKilled(SR_Player $player, $type) { $type--; $data = $this->getKillData(); $data[$type] += 1; $this->saveQuestData($data); return $player->message(sprintf('Now you killed %d/%d %s for the monks revenge quest.', $data[$type], self::$NEED[$type], self::$NAMES[$type])); }
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 resetTimer(SR_Player $player) { $time = Seattle::TIME_TO_DELAWARE + 60; $player->setConst('__AURIS_TIMEOUT', Shadowrun4::getTime() + $time); $player->message($this->lang('fluid', array(GWF_Time::humanDuration($time)))); // $player->message(sprintf("Your pot of Auris is fluid for %s.", GWF_Time::humanDuration($time))); return true; }
public function onQuestSolve(SR_Player $player) { $xp = $this->getRewardXP(); $nuyen = $this->getRewardNuyen(); $player->message($this->lang('reward', array(Shadowfunc::displayNuyen($nuyen), $xp))); // $player->message(sprintf('You hand Reginald his wifes bracelett. He cheers and hands you %s. You also gained %dXP.', Shadowfunc::displayNuyen($nuyen), $xp)); // $player->giveNuyen($nuyen); // $player->giveXP($xp); }
public function onScanLevel5(SR_Player $player, SR_Player $target) { $message = Shadowfunc::getSpells($target, '5307'); if ($player->isFighting()) { $player->message($message); } else { Shadowrap::instance($player)->reply($message); } }
public function setOrk(SR_Player $player) { $data = $this->getQuestData(); $data['ORK1'] = 1; $this->saveQuestData($data); $player->message($this->lang('orkmsg')); // $player->message('The Ork dies. You grab his knife. It has "Renraku" as initials.'); $player->giveItems(array(SR_Item::createByName('Knife')), 'The Ork'); }