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:
Andrew
2026-07-14 19:53:14 -03:00
committed by GitHub
parent c38705154a
commit d0d970b8f6
52 changed files with 305 additions and 417 deletions

View File

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