示例#1
0
文件: chatter.php 项目: sinfocol/gwf3
 public static function onChatResponse(SR_RealNPC $npc, array $args)
 {
     echo $npc->getClassName() . '->' . __FUNCTION__ . "\n";
     $player = $npc->getChatPartner();
     $quest = $npc->getNPCQuest($player);
     $tree = $player->getChatTree($npc, $quest);
     $word = isset($args[0]) ? $args[0] : 'default';
     if (false === ($message = self::hasChatTree($npc, $player, $word, $tree))) {
         return $npc->onNPCTalk($player, $word, $args);
     }
     $npc->ai_reply($message);
     self::parseScriptMessage($message);
 }