mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 07:48:02 +00:00
feat(Core/DB/Scripts): add creature_text_options engine for data-driven talk conditions (#25188)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
@@ -3817,6 +3817,21 @@ void Creature::ClearTextRepeatGroup(uint8 textGroup)
|
||||
groupItr->second.clear();
|
||||
}
|
||||
|
||||
bool Creature::IsTextOnCooldown(uint8 textGroup) const
|
||||
{
|
||||
auto itr = m_textCooldowns.find(textGroup);
|
||||
if (itr == m_textCooldowns.end())
|
||||
return false;
|
||||
|
||||
return GameTime::GetGameTime().count() < itr->second;
|
||||
}
|
||||
|
||||
void Creature::SetTextCooldown(uint8 textGroup, uint32 cooldownMs)
|
||||
{
|
||||
m_textCooldowns[textGroup] =
|
||||
GameTime::GetGameTime().count() + ((cooldownMs + 999) / 1000);
|
||||
}
|
||||
|
||||
void Creature::SetRespawnTime(uint32 respawn)
|
||||
{
|
||||
m_respawnTime = respawn ? GameTime::GetGameTime().count() + respawn : 0;
|
||||
|
||||
Reference in New Issue
Block a user