SmartAI/Fixup
* fix AI for npc texts that use target placeholders
This commit is contained in:
parent
d22d062cce
commit
6f6adc127e
7 changed files with 13 additions and 1 deletions
|
|
@ -718,13 +718,19 @@ class SmartAction
|
|||
$this->param[10] = $this->param[1] + $this->param[2] / pow(10, floor(log10($this->param[2] ?: 1.0) + 1)); // i know string concatenation is a thing. don't @ me!
|
||||
break;
|
||||
case self::ACTION_TALK: // 1 -> any target
|
||||
$talkTarget = $this->param[2];
|
||||
case self::ACTION_SIMPLE_TALK: // 84 -> any target
|
||||
$playerSrc = false;
|
||||
if ($npcId = $this->smartAI->getTarget()->getTalkSource($playerSrc))
|
||||
{
|
||||
if ($quotes = $this->smartAI->getQuote($npcId, $this->param[0], $npcSrc))
|
||||
{
|
||||
foreach ($quotes as ['text' => $text])
|
||||
$this->param[10] .= sprintf($text, $playerSrc ? Lang::main('thePlayer') : $npcSrc);
|
||||
{
|
||||
$talkTarget = ($talkTarget ?? true) ? Lang::game('target') : $npcSrc;
|
||||
$this->param[10] .= sprintf($text, $playerSrc ? Lang::main('thePlayer') : $npcSrc, $talkTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
trigger_error('SmartAI::action - could not determine talk source for action #'.$this->type);
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ $lang = array(
|
|||
'school' => "Magieart",
|
||||
'type' => "Art: ",
|
||||
'valueDelim' => " - ", // " bis "
|
||||
'target' => "<Ziel>",
|
||||
|
||||
'pvp' => "PvP",
|
||||
'honorPoints' => "Ehrenpunkte",
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ $lang = array(
|
|||
'school' => "School",
|
||||
'type' => "Type: ",
|
||||
'valueDelim' => " to ",
|
||||
'target' => "<target>",
|
||||
|
||||
'pvp' => "PvP", // PVP
|
||||
'honorPoints' => "Honor Points", // HONOR_POINTS
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ $lang = array(
|
|||
'school' => "Escuela",
|
||||
'type' => "Tipo: ",
|
||||
'valueDelim' => " - ",
|
||||
'target' => "<objetivo>",
|
||||
|
||||
'pvp' => "JcJ",
|
||||
'honorPoints' => "Puntos de Honor",
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ $lang = array(
|
|||
'school' => "École",
|
||||
'type' => "Type : ",
|
||||
'valueDelim' => " - ",
|
||||
'target' => "<cible>",
|
||||
|
||||
'pvp' => "JcJ",
|
||||
'honorPoints' => "Points d'honneur",
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ $lang = array(
|
|||
'school' => "Школа",
|
||||
'type' => "Тип: ",
|
||||
'valueDelim' => " - ",
|
||||
'target' => "<цель>",
|
||||
|
||||
'pvp' => "PvP",
|
||||
'honorPoints' => "Очки Чести",
|
||||
|
|
|
|||
|
|
@ -383,6 +383,7 @@ $lang = array(
|
|||
'school' => "类型",
|
||||
'type' => "类型:",
|
||||
'valueDelim' => "到",
|
||||
'target' => "<目标>",
|
||||
|
||||
'pvp' => "PvP",
|
||||
'honorPoints' => "荣誉点数",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue