コード例 #1
0
ファイル: Seattle_Archery.php プロジェクト: sinfocol/gwf3
 public function checkQuest(SR_NPC $npc, SR_Player $player)
 {
     if (!$this->isInQuest($player)) {
         return false;
     }
     if ($this->getAmount() >= $this->getNeededAmount()) {
         $npc->reply($this->lang('thanks'));
         // 			$npc->reply('Thank you very much!');
         $player->message($this->lang('reward'));
         // 			$player->message(sprintf('The elve cheers and hands out a glowing dark bow.'));
         $bow = SR_Item::createByName('DarkBow');
         $mod1 = SR_Rune::randModifier($player, 10);
         $mod2 = SR_Rune::randModifier($player, 10);
         $modifiers = SR_Rune::mergeModifiers($mod1, $mod2);
         $bow->addModifiers($modifiers);
         $player->giveItems(array($bow), $npc->getName());
         $this->onSolve($player);
         return true;
     } else {
         $npc->reply($this->lang('more', array($this->getAmount(), $this->getNeededAmount())));
         // 			$npc->reply(sprintf('I see you have punished %s of %s Angry Elves.', $this->getAmount(), $this->getNeededAmount()));
         return false;
     }
 }
コード例 #2
0
ファイル: Shadowfunc.php プロジェクト: sinfocol/gwf3
 private static function randLootStatItem(SR_Player $player, $level, SR_Item $item, array $chance)
 {
     for ($i = 0; $i < count($chance); $i++) {
         if (!self::dicePercent($chance[$i])) {
             break;
         }
         if (false === ($modifiers = SR_Rune::randModifier($player, $level))) {
             break;
         }
         $item->addModifiers($modifiers, false);
     }
     if ($i > 0) {
         $item->updateModifiers();
     }
 }
コード例 #3
0
ファイル: SR_Item.php プロジェクト: sinfocol/gwf3
 public static function canMergeModifiersLength(SR_item $item, SR_Rune $rune)
 {
     $string = $item->getItemName();
     $string .= '_ofxxxxxxx_' . $rune->displayModifiersB($item->getOwner());
     return strlen($string) <= 255;
 }
コード例 #4
0
ファイル: SR_Blacksmith.php プロジェクト: sinfocol/gwf3
 private function checkCombination(SR_Player $player, SR_Item $item, SR_Rune $rune)
 {
     if ($rune->isMixedRune()) {
         $player->msg('1161');
         // 			$player->message('The rune has mixed mount and equipment modifiers. You have to split it first.');
         return false;
     }
     $mr = $rune->isMountRune();
     if ($rune->isMountRune()) {
         if (!$item instanceof SR_Mount) {
             $player->msg('1162');
             // 				$player->message('This rune can only be applied to mounts.');
             return false;
         }
     } else {
         if (!$item->isItemStattable()) {
             $player->msg('1163');
             // 				$player->message('This rune can only be applied to equipment.');
             return false;
         }
     }
     return true;
 }