diff --git a/includes/smartAI.class.php b/includes/smartAI.class.php index 6c056553..aa108785 100644 --- a/includes/smartAI.class.php +++ b/includes/smartAI.class.php @@ -208,10 +208,10 @@ class SmartAI SELECT ct.CreatureID, ct.GroupID, ct.ID, ct.`Type`, ct.TextRange AS `range`, - IFNULL(bct.`Language`, ct.`Language`) AS lang, - IFNULL(NULLIF(bct.MaleText, ""), IFNULL(NULLIF(bct.FemaleText, ""), IFNULL(ct.`Text`, ""))) AS text_loc0, - {IFNULL(NULLIF(bctl.MaleText, ""), IFNULL(NULLIF(bctl.FemaleText, ""), IFNULL(ctl.Text, ""))) AS text_loc?d,} - IF(bct.SoundId > 0, bct.SoundId, ct.Sound) AS soundId + IFNULL(bct.`LanguageID`, ct.`Language`) AS lang, + IFNULL(NULLIF(bct.Text, ""), IFNULL(NULLIF(bct.Text1, ""), IFNULL(ct.`Text`, ""))) AS text_loc0, + {IFNULL(NULLIF(bctl.Text, ""), IFNULL(NULLIF(bctl.Text1, ""), IFNULL(ctl.Text, ""))) AS text_loc?d,} + IF(bct.SoundEntriesID > 0, bct.SoundEntriesID, ct.Sound) AS soundId FROM creature_text ct {LEFT JOIN diff --git a/pages/npc.php b/pages/npc.php index d18ddfd0..412f104f 100644 --- a/pages/npc.php +++ b/pages/npc.php @@ -993,10 +993,10 @@ class NpcPage extends GenericPage SELECT ct.GroupID AS ARRAY_KEY, ct.ID as ARRAY_KEY2, ct.`Type`, ct.TextRange AS `range`, - IFNULL(bct.`Language`, ct.`Language`) AS lang, - IFNULL(NULLIF(bct.MaleText, ""), IFNULL(NULLIF(bct.FemaleText, ""), IFNULL(ct.`Text`, ""))) AS text_loc0, - {IFNULL(NULLIF(bctl.MaleText, ""), IFNULL(NULLIF(bctl.FemaleText, ""), IFNULL(ctl.Text, ""))) AS text_loc?d,} - IF(bct.SoundId > 0, bct.SoundId, ct.Sound) AS soundId + IFNULL(bct.`LanguageID`, ct.`Language`) AS lang, + IFNULL(NULLIF(bct.Text, ""), IFNULL(NULLIF(bct.Text1, ""), IFNULL(ct.`Text`, ""))) AS text_loc0, + {IFNULL(NULLIF(bctl.Text, ""), IFNULL(NULLIF(bctl.Text1, ""), IFNULL(ctl.Text, ""))) AS text_loc?d,} + IF(bct.SoundEntriesID > 0, bct.SoundEntriesID, ct.Sound) AS soundId FROM creature_text ct {LEFT JOIN diff --git a/pages/sound.php b/pages/sound.php index db843225..f6102c11 100644 --- a/pages/sound.php +++ b/pages/sound.php @@ -287,7 +287,7 @@ class SoundPage extends GenericPage $ssActionLists = DB::World()->selectCol('SELECT entryorguid FROM smart_scripts WHERE action_type = 4 AND action_param1 = ?d AND source_type = 9', $this->typeId); $smartScripts = DB::World()->selectCol($ssQuery, $this->typeId, $ssActionLists ?: DBSIMPLE_SKIP, $ssActionLists, $ssActionLists, $ssActionLists, $ssActionLists, $ssActionLists, $ssActionLists, $ssActionLists, $ssActionLists); - $creatureIds = DB::World()->selectCol('SELECT ct.CreatureID FROM creature_text ct LEFT JOIN broadcast_text bct ON bct.ID = ct.BroadCastTextId WHERE bct.SoundId = ?d OR ct.Sound = ?d', $this->typeId, $this->typeId); + $creatureIds = DB::World()->selectCol('SELECT ct.CreatureID FROM creature_text ct LEFT JOIN broadcast_text bct ON bct.ID = ct.BroadCastTextId WHERE bct.SoundEntriesID = ?d OR ct.Sound = ?d', $this->typeId, $this->typeId); foreach ($smartScripts as $source => $ids) { switch($source)