[DiscordArchive] Is ```player:GetQuest():GetName()``` correct, if I want to broadcast the player's current quest?
[DiscordArchive] Is ```player:GetQuest():GetName()``` correct, if I want to broadcast the player's current quest?
Archived author: adm • Posted: 2023-02-07T19:24:49.303000+00:00
Original source
not the quest's name
Archived author: Honey • Posted: 2023-02-07T19:30:34.051000+00:00
Original source
I'm not aware of a function to fetch the name. Can always do a query though
Archived author: adm • Posted: 2023-02-07T19:57:37.551000+00:00
Original source
okay, i made a query:
```
local questId = quest:GetId()
local questName = WorldDBQuery("SELECT LogTitle FROM quest_template WHERE ID = " .. questId):GetString(0)
SendWorldMessage("Quest Finished: " .. questName .. " by " .. player:GetName())
```
and it worked. Thanks for the idea.
Is there any way to make the quest name shown as a link, showing it's description when clicked?
Archived author: Honey • Posted: 2023-02-07T20:13:59.551000+00:00
Original source
I'm sure there is a way, but i don't know the syntax for that.
Archived author: Foe • Posted: 2023-02-07T20:14:18.067000+00:00
Original source
https://wowwiki-archive.fandom.com/wiki/QuestLink
[Embed: QuestLink]
← API types In essence, quest links are questStrings with additional formatting to make in-game text controls display them as clickable hyperlinks. |cff808080|Hquest:99:15|h[Arugal's Folly]|h|r Broken up in its components: "|cff808080" – Colorizes the link with a gray color The first two characters after pipe-c may be the alpha level, where ff i...
https://wowwiki-archive.fandom.com/wiki/QuestLink
Archived author: adm • Posted: 2023-02-07T20:32:54.735000+00:00
Original source
Thanks!
Archived author: adm • Posted: 2023-02-07T20:44:08.464000+00:00
Original source
Success.
```
local questId = quest:GetId()
local questName = WorldDBQuery("SELECT LogTitle FROM quest_template WHERE ID = " .. questId):GetString(0)
local questLevel = WorldDBQuery("SELECT QuestLevel FROM quest_template WHERE ID = " .. questId):GetString(0)
```
And that goes in the message:
```|Hquest:"..quest:GetId()..":"..questLevel.."|h["..questName.."]|h```
Archived author: adm • Posted: 2023-02-07T20:44:34.079000+00:00
Original source
Thank you both!
Archived author: Foe • Posted: 2023-02-07T20:46:49.943000+00:00
Original source
You really shouldn't be running two queries for every single quest turn-in btw
Archived author: adm • Posted: 2023-02-07T20:54:25.575000+00:00
Original source
Is this better?
```
local result = WorldDBQuery("SELECT LogTitle, QuestLevel FROM quest_template WHERE ID = " .. questId)
local questName = result:GetString(0)
local questLevel = result:GetString(1)
```