Пример #1
0
 public function onEnter(SR_Player $player)
 {
     $p = $player->getParty();
     if ($p->getMin('level', true) < 1) {
         $this->partyMessage($player, 'afraid', array(1));
         // 			$p->notice('You are too afraid to go in there. (Each party member needs a minimum level of 1)');
         return true;
     }
     foreach ($p->getMembers() as $member) {
         $member instanceof SR_Player;
         if ($member->isHuman()) {
             $quest = SR_Quest::getQuest($member, 'Renraku_I');
             $quest instanceof Quest_Renraku_I;
             if (false === $quest->checkOrk($player)) {
                 $this->partyMessage($player, 'angryork');
                 // 					$p->notice('A big angry Ork shouts to you: "You not welcome here!" - The Ork attacks you with a tbs-pocket-knife.');
                 SR_NPC::createEnemyParty('Redmond_Ork')->fight($p, true);
                 return true;
             }
         }
     }
     parent::onEnter($player);
     // 		$p->pushAction(SR_Party::ACTION_INSIDE);
     $b = chr(2);
     $c = Shadowrun4::SR_SHORTCUT;
     $this->partyMessage($player, 'enter1');
     $this->partyMessage($player, 'enter2');
     // 		$p->notice('The guys in there stare quiet at their drinks when you enter the Trolls\' Inn.');
     // 		$p->notice('You see a barkeeper, a suspicious person in a dark corner, a soldier and some guests, mostly orks and trolls. One of the guests greets and beckons you.');
     $this->partyHelpMessage($player, 'help');
     // 		$p->help("Use {$b}{$c}ttb{$b}(arkeeper), {$b}{$c}ttg{$b}(uest), {$b}{$c}ttj{$b}(ohnson) and {$b}{$c}tts{$b}(oldier) to talk to the persons.");
     return true;
 }
Пример #2
0
 private function bribingTheGuard(SR_Player $player, $word, array $args)
 {
     $b = chr(2);
     $price = rand(2000, 8000);
     $price = Shadowfunc::calcBuyPrice($price, $player);
     if (!isset($args[0])) {
         $this->reply('Every person has it\'s <price> parameter.');
         $player->help('Use #talk bribe <amt> to try to bribe the guard.');
         return true;
     }
     $amt = (int) $args[0];
     if ($amt < $price) {
         $this->reply("{$b}Security !!!!{$b}");
         $p = $player->getParty();
         $p->pushAction(SR_Party::ACTION_OUTSIDE, 'Prison_Block2');
         $ep = SR_NPC::createEnemyParty('Prison_Ward', 'Prison_Ward', 'Prison_Ward', 'Prison_Guard', 'Prison_Guard');
         $p->fight($ep, true);
     } else {
         if (!$player->hasNuyen($amt)) {
             $this->reply('The idea of a bribe is usually that you can pay it ...');
         } else {
             $party = $player->getParty();
             $this->reply('Every bride has her pride ...');
             $this->reply('Ok buddy ... He is in cell 5, do quick, i will release the alarm as late as possible. Good luck ... ');
             $player->giveNuyen(-$amt);
             $party->pushAction(SR_Party::ACTION_OUTSIDE, 'PrisonB2_Exit');
         }
     }
     return true;
 }
Пример #3
0
 public function onEnter(SR_Player $player)
 {
     $party = $player->getParty();
     $dice = rand(0, 6);
     if ($dice < 2) {
         $this->partyMessage($player, 'lucky');
         // 			$party->notice('You silently search the door and windows for an entrance. You were lucky and sneak in...');
         $this->teleportInside($player, 'Hideout_Exit');
     } else {
         if ($dice < 4) {
             $this->partyMessage($player, 'noluck');
             // 			$party->notice('You silently search the door and windows for an entrance. You have no luck, everything\'s closed.');
         } else {
             if ($dice < 6) {
                 $this->partyMessage($player, 'fight2');
                 // 			$party->notice('You silently search the door and windows for an entrance. Two punks notice you and attack!');
                 SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk')->fight($party, true);
             } else {
                 $this->partyMessage($player, 'fight4');
                 // 			$party->notice('You take a look through the doors keyhole. A party of four punks opens the door and surprises you.');
                 SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk', 'Redmond_Pinkhead', 'Redmond_Lamer')->fight($party, true);
             }
         }
     }
 }
Пример #4
0
 public function onEnter(SR_Player $player)
 {
     if (parent::onEnter($player)) {
         SR_NPC::createEnemyParty('TrollHQ_ChiefCook')->fight($player->getParty());
     }
     return true;
 }
Пример #5
0
 public function onEnter(SR_Player $player)
 {
     $p = $player->getParty();
     # We know the mafia :)
     $quest = SR_Quest::getQuest($player, 'HiJack');
     if ($quest->isAccepted($player)) {
         return parent::onEnter($player);
     }
     # Check how many guards have been killed in total
     $killed = 0;
     foreach ($p->getMembers() as $member) {
         $member instanceof SR_Player;
         $killed += SR_PlayerVar::getVal($member, 'mgkills', 0);
     }
     if ($killed >= 6) {
         return parent::onEnter($player);
     }
     # Guarded!
     foreach ($p->getMembers() as $member) {
         $member instanceof SR_Player;
         $member->message($this->lang($member, 'guarded'));
     }
     $guards = array();
     for ($i = 0; $i < 6; $i++) {
         $guards[] = 'Vegas_MafiaGuard';
     }
     SR_NPC::createEnemyParty($guards)->fight($p);
     return false;
 }
Пример #6
0
 public function on_challenge(SR_Player $player, array $args)
 {
     # No fight with party:
     if ($player->isInParty()) {
         $player->msg('1099');
         // 			$player->message("You can't fight here when you are in a party. Use #part to leave your party.");
         return false;
     }
     # Get current enemy
     $key = 'SEATTLE_ARENA_N';
     if (!$player->hasConst($key)) {
         $player->setConst($key, 1);
     }
     $n = $player->getConst($key);
     # Possible flags/enemies in Arena:
     $enemies = array(array("Seattle_AToughGuy", $this->lang($player, 'e1')), array("Seattle_ASecOrk", $this->lang($player, 'e2')), array("Seattle_AToughTroll", $this->lang($player, 'e3')), array("Seattle_AMagician", $this->lang($player, 'e4')), array("Seattle_AElite", $this->lang($player, 'e5')));
     # No more fights:
     if ($n > count($enemies)) {
         // 			$player->message("Sorry. You fought all the enemies here. Try #fight <player> then :P");
         $player->msg('1098');
         return false;
     }
     $n--;
     $enemy = $enemies[$n];
     $player->msg('5141', array($enemy[1]));
     // 		$player->message("The Arena-Guy leads you to the locker room. After a few minutes you were guided into the arena and see your enemy: ".$enemy[1].". " );
     SR_NPC::createEnemyParty($enemy[0])->fight($player->getParty(), true);
     return true;
 }
Пример #7
0
 public function onEnter(SR_Player $player)
 {
     parent::onEnter($player);
     $party = $player->getParty();
     SR_NPC::createEnemyParty('Redmond_Ork')->fight($party, true);
     return true;
 }
Пример #8
0
 public function onEnter(SR_Player $player)
 {
     if (parent::onEnter($player)) {
         $party = $player->getParty();
         SR_NPC::createEnemyParty('Redmond_Cyberpunk', 'Redmond_Cyberpunk', 'Redmond_Cyberpunk')->fight($party, true);
     }
     return true;
 }
Пример #9
0
 public function onEnter(SR_Player $player)
 {
     parent::onEnter($player);
     if (!$player->hasTemp('OHQ_SR_ONCE')) {
         $player->setTemp('OHQ_SR_ONCE', 1);
         $party = $player->getParty();
         SR_NPC::createEnemyParty('OrkHQ_FatOrk')->fight($party, true);
     }
     return true;
 }
Пример #10
0
 public function onEnter(SR_Player $player)
 {
     if (!parent::onEnter($player)) {
         return false;
     }
     $party = $player->getParty();
     $this->partyMessage($player, 'suprise');
     // 		$party->notice(sprintf('Four depot guards surprise you and attack.'));
     SR_NPC::createEnemyParty('Harbor_DepotGuard', 'Harbor_DepotGuard', 'Harbor_DepotGuard', 'Harbor_DepotGuard')->fight($party, true);
     return true;
 }
Пример #11
0
 public function onEnter(SR_Player $player)
 {
     if (parent::onEnter($player)) {
         $val = SR_PlayerVar::getVal($player, 'THQFEORK', 0);
         if ($val == 0) {
             $p = $player->getParty();
             SR_NPC::createEnemyParty('TrollHQ_FemaleOrk', 'TrollHQ_FemaleOrk')->talk($p);
         }
     }
     return true;
 }
Пример #12
0
 public function onEnter(SR_Player $player)
 {
     $p = $player->getParty();
     foreach ($p->getMembers() as $member) {
         $member instanceof SR_Player;
         if (!$member->getInvItemByName('IDCardA')) {
             SR_NPC::createEnemyParty('Renraku_Guard', 'Renraku_Guard', 'Renraku_Guard')->talk($p, true);
             return true;
         }
     }
     return parent::onEnter($player);
 }
Пример #13
0
 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     $quest = SR_Quest::getQuest($player, 'Renraku_III');
     if ($quest->isInQuest($player)) {
         $p = $player->getParty();
         $p->notice('You confront Mr. Stoleymeyer with the illegal Renraku experiments...');
         $p->notice('"You are one of those bastards!", he shouts, "Tho shal not escape!" ... he calls for his minions...');
         $p->fight(SR_NPC::createEnemyParty('NySoft_Stolemeyer', 'Redmond_Lamer', 'TrollCellar_Imp', 'Seattle_Shaolin', 'Redmond_Ueberpunk', 'Prison_GrayOp', 'Delaware_Goth', 'Chicago_DarkRunner'));
         return true;
     }
     $b = chr(2);
     # bold
     switch ($word) {
         case 'seattle':
             return $this->reply("Why?");
         case 'shadowrun':
             return $this->reply("Go away.");
         case 'cyberware':
             return $this->reply("Stop talking.");
         case 'magic':
             return $this->reply("You are not worth talking about that.");
         case 'hire':
             return $this->reply("Hah!");
         case 'blackmarket':
             return $this->reply("You are wrong here.");
         case 'bounty':
             return $this->reply("I can arrange things, but not for you.");
         case 'alchemy':
             return $this->reply("...");
         case 'invite':
             return $this->reply("Please leave my office now.");
         case 'renraku':
             if ($quest->isDone($player)) {
                 return $this->onTalkToStolemeyer($player);
             } else {
                 return $this->reply("We have nothing todo with Renraku.");
             }
         case 'malois':
             return $this->reply("We have nothing todo with the Malois case.");
         case 'bribe':
             return $this->reply("I am not a bribeable person.");
         case 'yes':
             return $this->reply("You think so.");
         case 'no':
             return $this->reply("Go away!");
         case 'negotiation':
             return $this->reply("We don't negotiate. We are professionals.");
         case 'hello':
             return $this->reply("Hello?");
         default:
             return $this->reply("Yes?");
     }
 }
Пример #14
0
 public function onEnter(SR_Player $player)
 {
     if (parent::onEnter($player)) {
         if (!$player->hasConst('THQ_SC1')) {
             $this->partyMessage($player, 'cratures');
             // 				$player->getParty()->notice('Some of the creatures awake and attack!');
             $player->setConst('THQ_SC1', 1);
             SR_NPC::createEnemyParty('Delaware_Ork', 'Delaware_Troll', 'Delaware_Troll', 'Delaware_Ork')->fight($player->getParty());
         }
     }
     return true;
 }
Пример #15
0
 public function onEnter(SR_Player $player)
 {
     if (false === parent::onEnter($player)) {
         return false;
     }
     $party = $player->getParty();
     $this->partyMessage($player, 'attack');
     if (false === ($ep = SR_NPC::createEnemyParty('TrollCellar_CaveTroll', 'TrollCellar_Imp', 'TrollCellar_Imp', 'TrollCellar_Imp', 'TrollCellar_Imp'))) {
         return true;
     }
     $ep->fight($party);
     return true;
 }
Пример #16
0
 public function onCityExit(SR_Party $party)
 {
     parent::onCityExit($party);
     if (false !== ($malois = $party->getNPCMemberByClassname('PrisonB2_Malois'))) {
         $party->notice(sprintf('Malois says: "Thank you so very much ... I will have to be careful now ... I guess i cannot even go shopping in the Chicago_Store now."'));
         if (false !== $party->kickUser($malois)) {
             $party->setConst('RESCUED_MALOIS', 1);
         }
         $party->notice('"Not so fast!!" , A group of soldiers shout, "You are going nowhere!"');
         $party->notice('Malois flees as you back him up!');
         $party->fight(SR_NPC::createEnemyParty('Prison_GrayOp', 'Prison_GrayOp', 'Seattle_BlackOp'));
     }
 }
Пример #17
0
 private function onRandomCombat(SR_Player $player)
 {
     $party = $player->getParty();
     $mc = $party->getMemberCount();
     $this->partyMessage($player, 'dig1', array($player->getName()));
     $amt = rand($mc + 1, $mc + 3);
     $amt = Common::clamp($amt, 1, SR_Party::MAX_MEMBERS);
     $possible = array('Forest_Skeleton', 'Forest_Ghoul', 'Forest_Werewolf', 'Forest_ArchElve');
     $enemies = array();
     for ($i = 0; $i < $amt; $i++) {
         $enemies[] = Shadowfunc::randomListItem($possible);
     }
     $party->fight(SR_NPC::createEnemyParty($enemies));
 }
Пример #18
0
 private function onBanshee(SR_Player $player)
 {
     $p = $player->getParty();
     $this->partyMessage($player, 'dig2', array($player->getName()));
     $nbansh = $p->getMemberCount() + rand(1, 2);
     $nbansh = Common::clamp($nbansh, 1, 6);
     $enemies = array('Forest_BigBanshee');
     for ($i = 0; $i < $nbansh; $i++) {
         $enemies[] = 'Forest_Banshee';
     }
     shuffle($enemies);
     # Legitimate use of shuffle
     $p->fight(SR_NPC::createEnemyParty($enemies));
 }
Пример #19
0
 private function onImpAttack(SR_Player $player)
 {
     $party = $player->getParty();
     $mc = $party->getMemberCount();
     $min = Common::clamp($mc, 1, 4);
     $max = Common::clamp($mc * 2, $min, 8);
     $amt = rand($min, $max);
     $imps = array();
     for ($i = 0; $i < $amt; $i++) {
         $imps[] = 'TrollCellar_Imp';
     }
     SR_NPC::createEnemyParty($imps)->fight($party);
     return true;
 }
Пример #20
0
 public function on_wakeup(SR_Player $player, array $args)
 {
     if (!$player->hasTemp('HIDE_R2_ONCE')) {
         $player->setTemp('HIDE_R2_ONCE', 1);
         $party = $player->getParty();
         $this->partyMessage($player, 'wakeup');
         // 			$party->notice('You wake the three lamers kindly... As they realize what`s happening they attack.');
         SR_NPC::createEnemyParty('Redmond_Lamer', 'Redmond_Pinkhead', 'Redmond_Lamer')->fight($party, true);
     } else {
         $player->message($this->lang($player, 'no_wake'));
         // 			$player->message("There are no lamers to wake.");
     }
     return true;
 }
Пример #21
0
 public function onEnter(SR_Player $player)
 {
     if (!parent::onEnter($player)) {
         return false;
     }
     $party = $player->getParty();
     $orks = array();
     foreach ($party->getMembers() as $member) {
         $orks[] = 'Redmond_Ork';
     }
     $orks[] = 'Redmond_Ork';
     $orks[] = 'Redmond_OrkLeader';
     SR_NPC::createEnemyParty($orks)->fight($party, true);
     return true;
 }
Пример #22
0
 private function onChallengeB(SR_Player $player, $bit, $name, $text, $nuyen)
 {
     $party = $player->getParty();
     if (false === ($ep = SR_NPC::createEnemyParty($name))) {
         $player->message('Database error!');
         return false;
     }
     $player->msg('5141', array($text));
     // 		$player->message(sprintf('You are guided into the arena and see your enemy: %s', $text));
     $e = $ep->getLeader();
     $e->setArenaKey($this->getArenaKey($player), $bit);
     $e->setArenaNuyen($nuyen);
     $ep->fight($party);
     return true;
 }
Пример #23
0
 public function onEnter(SR_Player $player)
 {
     if (false === parent::onEnter($player)) {
         return false;
     }
     if (0 === ($count = $this->getTrollCount($player))) {
         return true;
     }
     $party = $player->getParty();
     $trolls = array();
     for ($i = 0; $i < $count; $i++) {
         $trolls[] = 'Delaware_Troll';
     }
     SR_PlayerVar::setVal($player, 'THQLVTRC', 1);
     SR_NPC::createEnemyParty($trolls)->fight($party);
     return true;
 }
Пример #24
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));
     }
 }
Пример #25
0
 public function on_grab(SR_Player $player, array $args)
 {
     if ($player->getParty()->hasTemp('FORLAKGRB')) {
         $this->partyMessage($player, 'grab_twice');
         return true;
     } elseif (rand(0, 3) === 3) {
         $player->getParty()->setTemp('FORLAKGRB', 1);
         $this->partyMessage($player, 'grab2', array($player->getName()));
         $this->onSparkleItem($player);
     } else {
         $this->partyMessage($player, 'grab1', array($player->getName()));
     }
     $numSirenes = self::getNumSirenes($player);
     $enemies = array();
     for ($i = 0; $i < $numSirenes; $i++) {
         $enemies[] = 'Forest_Sirene';
     }
     $player->getParty()->fight(SR_NPC::createEnemyParty($enemies));
     return true;
 }
Пример #26
0
 public function onNPCTalk(SR_Player $player, $word, array $args)
 {
     $quest = SR_Quest::getQuest($player, 'Seattle_Johnson3');
     switch ($word) {
         case 'shadowrun':
             if ($quest->isInQuest($player)) {
                 $this->rply('fight1');
                 $this->rply('fight2');
                 // 					$this->reply('What? You want money for Mr.Johnson?! ... ');
                 // 					$this->reply('Well ... Give him that from me:');
                 SR_NPC::createEnemyParty('Seattle_BMGuy')->fight($player->getParty(), true);
                 return true;
             } else {
                 return $this->rply('sr');
                 // 					return $this->reply('Yeah, I have heard from you. I have nothing todo though.');
             }
         case 'magic':
             #return $this->reply('There is no magic in a good weapon.'); break;
         #return $this->reply('There is no magic in a good weapon.'); break;
         case 'renraku':
             #return $this->reply('You don\'t have trouble with renraku, do you?'); break;
         #return $this->reply('You don\'t have trouble with renraku, do you?'); break;
         case 'blackmarket':
             #return $this->reply('I\'d call it graymarket.'); break;
         #return $this->reply('I\'d call it graymarket.'); break;
         case 'negotiation':
             #return $this->reply('Yes, all want to negotiate nowadays.');
             return $this->rply($word);
         case 'malois':
         case 'yes':
         case 'no':
         case 'fakeid':
             return $this->bmguyFakesID($player, $word);
         default:
             return $this->rply('default');
             // 				return $this->reply('Come buy hot stuff!');
     }
 }
Пример #27
0
 private function enemyContact(SR_Party $party, $friendly = false)
 {
     $dice = $friendly ? 18 : 8;
     if (rand(1, $dice) !== 1) {
         return false;
     }
     $mc = $party->getMemberCount();
     $level = $party->getMax('level', true);
     $possible = array();
     $total = 0;
     foreach ($this->npcs as $npc) {
         $npc instanceof SR_NPC;
         if ($npc->getNPCLevel() <= $level && $npc->isNPCFriendly($party) === $friendly && $npc->canNPCMeet($party)) {
             $multi = $friendly === true ? 1 : 1;
             $percent = round($npc->getNPCMeetPercent($party) * $multi * 100);
             $total += $percent;
             $possible[] = array($npc->getNPCClassName(), $percent);
         }
     }
     $npcs = array();
     $x = 200;
     // 200% chance nothing
     do {
         $contact = false;
         if (false !== ($npc = Shadowfunc::randomData($possible, $total, $x * 100))) {
             $contact = true;
             $npcs[] = $npc;
             $x += 120 - Common::clamp($mc * 10, 0, 50);
         }
         if (count($npcs) >= $this->maxEnemies($party)) {
             break;
         }
     } while ($contact === true);
     if (count($npcs) === 0) {
         return false;
     }
     $ep = SR_NPC::createEnemyParty($npcs);
     if ($friendly === true) {
         $party->talk($ep, true);
     } else {
         $party->fight($ep, true);
     }
     return true;
 }
Пример #28
0
 public function onEnter(SR_Player $player)
 {
     $party = $player->getParty();
     SR_NPC::createEnemyParty('Renraku02_Security', 'Renraku02_Security', 'Renraku02_Security', 'Renraku02_Security')->fight($party);
     return true;
 }
Пример #29
0
 public function onEnter(SR_Player $player)
 {
     parent::onEnter($player);
     $player->getParty()->fight(SR_NPC::createEnemyParty('Forest_ZombieBear'));
     return true;
 }
Пример #30
0
 public static function execute(SR_Player $player, array $args)
 {
     $bot = Shadowrap::instance($player);
     if (count($args) !== 2) {
         $bot->reply(Shadowhelp::getHelp($player, 'gmt'));
         return false;
     }
     $target = Shadowrun4::getPlayerByShortName($args[0]);
     if ($target === -1) {
         $player->message('The username is ambigious.');
         return false;
     }
     if ($target === false) {
         $player->message('The player is not in memory or unknown.');
         return false;
     }
     if (false === $target->isCreated()) {
         $bot->reply(sprintf('The player %s has not started a game yet.', $args[0]));
         return false;
     }
     # Check for valid enemies.
     $npcnames = explode(',', $args[1]);
     foreach ($npcnames as $i => $npcname) {
         if (false === ($npc = Shadowrun4::getNPCByAbbrev($player, $npcname))) {
             $bot->reply(sprintf('Unknown NPC: %s.', $npcname));
             return false;
         }
         $npcnames[$i] = $npc->getNPCClassName();
     }
     # Prepare for action cases
     $p = $target->getParty();
     $a = $p->getAction();
     $ep = NULL;
     switch ($a) {
         case SR_Party::ACTION_TALK:
             $p->getEnemyParty()->popAction(true);
             # we pop the enemies talking
         # we pop the enemies talking
         case SR_Party::ACTION_SLEEP:
             $p->popAction(false);
             # and pop our own fallthrough
             break;
         case SR_Party::ACTION_FIGHT:
             $ep = $p->getEnemyParty();
             # Stack and re-init the fight :)
             break;
             # Nothing todo here
         # Nothing todo here
         case SR_Party::ACTION_INSIDE:
         case SR_Party::ACTION_OUTSIDE:
         case SR_Party::ACTION_EXPLORE:
         case SR_Party::ACTION_GOTO:
         case SR_Party::ACTION_HUNT:
             break;
             # Impossibru
         # Impossibru
         case SR_Party::ACTION_HIJACK:
         case SR_Party::ACTION_TRAVEL:
         case SR_Party::ACTION_DELETE:
         default:
             $bot->reply('Cannot #gmt because target action is ' . $a . '!');
             return false;
     }
     # Generate NPCs
     if (false === ($ep2 = SR_NPC::createEnemyParty($npcnames))) {
         $bot->reply('cannot create party! check logs');
         return false;
     }
     # Merge?
     if ($ep === NULL) {
         $ep = $ep2;
     } else {
         $ep->mergeParty($ep2);
     }
     # Delegate new actions
     if ($p->isFighting()) {
         # Already fighting
         $p->popAction(false);
         $p->fight($ep, true);
     } elseif ($ep->getLeader() instanceof SR_TalkingNPC) {
         # Init a talk
         $p->talk($ep, true);
     } else {
         # Init a fight
         $p->fight($ep, true);
     }
     # That's it!
     return $bot->reply('The party now encountered some enemies!');
 }