From 934c72e446e5460dcfba45c8b3ab65afd3ce0900 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Tue, 29 Apr 2014 22:12:54 +0200 Subject: [PATCH] NPCs: get quotes from broadcast_text if possible --- pages/npc.php | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/pages/npc.php b/pages/npc.php index b2cb69e2..d83f3b89 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -323,7 +323,27 @@ if (!$smarty->loadCache($cacheKeyPage, $pageData)) // Quotes $quotes = []; - if ($texts = DB::Aowow()->select('SELECT ct.*, ct.groupid AS ARRAY_KEY, ct.id as ARRAY_KEY2, lct.text_loc2, lct.text_loc3, lct.text_loc6, lct.text_loc8 FROM creature_text ct LEFT JOIN locales_creature_text lct ON ct.entry = lct.entry AND ct.groupid = lct.groupid AND ct.id = lct.id WHERE ct.entry = ?d', $_id)) + $quoteQuery = ' + SELECT + ct.groupid AS ARRAY_KEY, ct.id as ARRAY_KEY2, ct.`type`, + IFNULL(bct.`Language`, ct.`language`) AS lang, + IFNULL(bct.MaleText, IFNULL(bct.FemaleText, ct.`text`)) AS text_loc0, + IFNULL(lbct.MaleText_loc2, IFNULL(lbct.FemaleText_loc2, lct.text_loc2)) AS text_loc2, + IFNULL(lbct.MaleText_loc3, IFNULL(lbct.FemaleText_loc3, lct.text_loc3)) AS text_loc3, + IFNULL(lbct.MaleText_loc6, IFNULL(lbct.FemaleText_loc6, lct.text_loc6)) AS text_loc6, + IFNULL(lbct.MaleText_loc8, IFNULL(lbct.FemaleText_loc8, lct.text_loc8)) AS text_loc8 + FROM + creature_text ct + LEFT JOIN + locales_creature_text lct ON ct.entry = lct.entry AND ct.groupid = lct.groupid AND ct.id = lct.id + LEFT JOIN + broadcast_text bct ON ct.BroadcastTextId = bct.ID + LEFT JOIN + locales_broadcast_text lbct ON ct.BroadcastTextId = lbct.ID + WHERE + ct.entry = ?d'; + + if ($texts = DB::Aowow()->select($quoteQuery, $_id)) { $nQuotes = 0; foreach ($texts as $text)