SmartAI/Fixup

* fix AI for npc texts that use target placeholders
This commit is contained in:
Sarjuuk 2025-12-14 18:11:02 +01:00
parent d22d062cce
commit 6f6adc127e
7 changed files with 13 additions and 1 deletions

View file

@ -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);

View file

@ -383,6 +383,7 @@ $lang = array(
'school' => "Magieart",
'type' => "Art: ",
'valueDelim' => " - ", // " bis "
'target' => "<Ziel>",
'pvp' => "PvP",
'honorPoints' => "Ehrenpunkte",

View file

@ -383,6 +383,7 @@ $lang = array(
'school' => "School",
'type' => "Type: ",
'valueDelim' => " to ",
'target' => "<target>",
'pvp' => "PvP", // PVP
'honorPoints' => "Honor Points", // HONOR_POINTS

View file

@ -383,6 +383,7 @@ $lang = array(
'school' => "Escuela",
'type' => "Tipo: ",
'valueDelim' => " - ",
'target' => "<objetivo>",
'pvp' => "JcJ",
'honorPoints' => "Puntos de Honor",

View file

@ -383,6 +383,7 @@ $lang = array(
'school' => "École",
'type' => "Type : ",
'valueDelim' => " - ",
'target' => "<cible>",
'pvp' => "JcJ",
'honorPoints' => "Points d'honneur",

View file

@ -383,6 +383,7 @@ $lang = array(
'school' => "Школа",
'type' => "Тип: ",
'valueDelim' => " - ",
'target' => "<цель>",
'pvp' => "PvP",
'honorPoints' => "Очки Чести",

View file

@ -383,6 +383,7 @@ $lang = array(
'school' => "类型",
'type' => "类型:",
'valueDelim' => "",
'target' => "<目标>",
'pvp' => "PvP",
'honorPoints' => "荣誉点数",