From d0d970b8f63715c330a88e8c38be560b62c8a84b Mon Sep 17 00:00:00 2001 From: Andrew <47818697+Nyeriah@users.noreply.github.com> Date: Tue, 14 Jul 2026 19:53:14 -0300 Subject: [PATCH] feat(Core/DB/Scripts): add creature_text_options engine for data-driven talk conditions (#25188) Co-authored-by: Claude Opus 4.6 (1M context) Co-authored-by: Ludwig --- .../creature_text_options.sql | 114 ++++++++++++++++++ .../Database/Implementation/WorldDatabase.cpp | 1 + .../Database/Implementation/WorldDatabase.h | 1 + .../game/Entities/Creature/Creature.cpp | 15 +++ src/server/game/Entities/Creature/Creature.h | 4 + src/server/game/Texts/CreatureTextMgr.cpp | 78 ++++++++++++ src/server/game/Texts/CreatureTextMgr.h | 13 ++ src/server/game/World/World.cpp | 3 + .../MoltenCore/boss_majordomo_executus.cpp | 3 +- .../MoltenCore/boss_ragnaros.cpp | 3 +- .../EasternKingdoms/Karazhan/boss_moroes.cpp | 12 +- .../SunwellPlateau/boss_brutallus.cpp | 3 +- .../SunwellPlateau/boss_felmyst.cpp | 3 +- .../SunwellPlateau/boss_kalecgos.cpp | 3 +- .../BattleForMountHyjal/boss_anetheron.cpp | 19 +-- .../BattleForMountHyjal/boss_azgalor.cpp | 21 +--- .../BattleForMountHyjal/boss_kazrogal.cpp | 16 +-- .../boss_rage_winterchill.cpp | 19 +-- .../AzjolNerub/AzjolNerub/boss_anubarak.cpp | 9 +- .../boss_krikthir_the_gatewatcher.cpp | 12 +- .../boss_baltharus_the_warborn.cpp | 7 +- .../RubySanctum/boss_general_zarithrian.cpp | 7 +- .../RubySanctum/boss_halion.cpp | 13 +- .../RubySanctum/boss_saviana_ragefire.cpp | 9 +- .../Northrend/DraktharonKeep/boss_novos.cpp | 8 +- .../DraktharonKeep/boss_tharon_ja.cpp | 9 +- .../DraktharonKeep/boss_trollgore.cpp | 9 +- .../Northrend/Gundrak/boss_gal_darah.cpp | 11 +- .../Northrend/Gundrak/boss_moorabi.cpp | 7 +- .../Northrend/Gundrak/boss_slad_ran.cpp | 10 +- .../IcecrownCitadel/boss_the_lich_king.cpp | 9 +- .../Northrend/Naxxramas/boss_razuvious.cpp | 3 +- .../Nexus/Nexus/boss_keristrasza.cpp | 9 +- .../Nexus/Nexus/boss_magus_telestra.cpp | 9 +- .../Northrend/Nexus/Nexus/boss_ormorok.cpp | 9 +- .../Outland/BlackTemple/boss_bloodboil.cpp | 13 +- .../Outland/BlackTemple/boss_illidan.cpp | 14 +-- .../BlackTemple/boss_illidari_council.cpp | 7 +- .../BlackTemple/boss_mother_shahraz.cpp | 15 +-- .../BlackTemple/boss_reliquary_of_souls.cpp | 39 +----- .../BlackTemple/boss_teron_gorefiend.cpp | 15 +-- .../BlackTemple/boss_warlord_najentus.cpp | 17 +-- .../boss_fathomlord_karathress.cpp | 13 +- .../boss_hydross_the_unstable.cpp | 15 +-- .../SerpentShrine/boss_lady_vashj.cpp | 12 +- .../boss_leotheras_the_blind.cpp | 3 - .../boss_morogrim_tidewalker.cpp | 16 +-- .../scripts/Outland/GruulsLair/boss_gruul.cpp | 15 +-- .../GruulsLair/boss_high_king_maulgar.cpp | 16 +-- .../MagtheridonsLair/boss_magtheridon.cpp | 13 +- .../TempestKeep/Eye/boss_astromancer.cpp | 5 +- .../TempestKeep/Eye/boss_void_reaver.cpp | 13 +- 52 files changed, 305 insertions(+), 417 deletions(-) create mode 100644 data/sql/updates/pending_db_world/creature_text_options.sql diff --git a/data/sql/updates/pending_db_world/creature_text_options.sql b/data/sql/updates/pending_db_world/creature_text_options.sql new file mode 100644 index 000000000..efe07af1c --- /dev/null +++ b/data/sql/updates/pending_db_world/creature_text_options.sql @@ -0,0 +1,114 @@ +-- Reusable option sets for creature text groups +CREATE TABLE IF NOT EXISTS `creature_text_option_sets` ( + `SetID` TINYINT UNSIGNED NOT NULL, + `Cooldown` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Group cooldown in ms before it can fire again', + `TriggerChance` TINYINT UNSIGNED NOT NULL DEFAULT 100 COMMENT '0-100 pct chance to fire at all', + `PlayerOnly` TINYINT UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Only fire if target is a player', + `comment` VARCHAR(255) DEFAULT '', + PRIMARY KEY (`SetID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +DELETE FROM `creature_text_option_sets`; +INSERT INTO `creature_text_option_sets` (`SetID`, `Cooldown`, `TriggerChance`, `PlayerOnly`, `comment`) VALUES +(1, 6000, 100, 0, 'Standard kill yell: 6s cooldown'), +(2, 6000, 100, 1, 'Player-only kill yell: 6s cooldown'), +(3, 5000, 100, 1, 'Short cooldown player-only kill yell: 5s cooldown'), +(4, 0, 30, 0, 'Chance-based: 30% trigger, no cooldown'), +(5, 5000, 100, 0, 'Standard kill yell: 5s cooldown'), +(6, 0, 25, 1, 'Chance-based: 25% trigger, player-only'), +(7, 0, 50, 1, 'Chance-based: 50% trigger, player-only'); + +-- Assign option sets to creature text groups +CREATE TABLE IF NOT EXISTS `creature_text_options` ( + `CreatureID` INT UNSIGNED NOT NULL, + `GroupID` TINYINT UNSIGNED NOT NULL, + `OptionSetID` TINYINT UNSIGNED NOT NULL, + PRIMARY KEY (`CreatureID`, `GroupID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +DELETE FROM `creature_text_options`; +INSERT INTO `creature_text_options` (`CreatureID`, `GroupID`, `OptionSetID`) VALUES +-- Black Temple +(22887, 2, 3), -- High Warlord Najentus SAY_SLAY +(22871, 2, 2), -- Teron Gorefiend SAY_SLAY +(22917, 1, 1), -- Illidan Stormrage SAY_ILLIDAN_KILL +(22947, 3, 1), -- Mother Shahraz SAY_SLAY +(22949, 3, 1), -- Gathios the Shatterer SAY_COUNCIL_SLAY +(22950, 3, 1), -- High Nethermancer Zerevor SAY_COUNCIL_SLAY +(22951, 3, 1), -- Lady Malande SAY_COUNCIL_SLAY +(22952, 3, 1), -- Veras Darkshadow SAY_COUNCIL_SLAY + +-- Azjol-Nerub +(28684, 1, 1), -- Krik'thir the Gatewatcher SAY_SLAY +(29120, 1, 1), -- Anub'arak SAY_SLAY + +-- Drak'Tharon Keep +(26631, 1, 1), -- Novos the Summoner SAY_KILL +(26632, 1, 1), -- The Prophet Tharon'ja SAY_KILL +(26630, 1, 1), -- Trollgore SAY_KILL + +-- Gundrak +(29306, 1, 1), -- Gal'darah SAY_SLAY +(29305, 1, 1), -- Moorabi SAY_SLAY +(29304, 1, 1), -- Slad'ran SAY_SLAY + +-- The Nexus +(26723, 1, 1), -- Keristrasza SAY_SLAY +(26731, 1, 1), -- Grand Magus Telestra SAY_KILL +(26794, 5, 1), -- Ormorok the Tree-Shaper SAY_KILL + +-- Ruby Sanctum +(39863, 6, 2), -- Halion SAY_KILL +(39751, 2, 1), -- Baltharus the Warborn SAY_KILL +(39746, 1, 1), -- General Zarithrian SAY_KILL +(39747, 3, 1), -- Saviana Ragefire SAY_KILL + +-- Icecrown Citadel +(36597, 10, 3), -- The Lich King SAY_LK_KILL + +-- Naxxramas +(16061, 1, 4), -- Instructor Razuvious SAY_SLAY + +-- Karazhan +(15687, 2, 3), -- Moroes SAY_KILL + +-- Battle for Mount Hyjal +(17888, 0, 2), -- Kazrogal SAY_ONSLAY +(17842, 1, 2), -- Azgalor SAY_ONSLAY +(17767, 1, 2), -- Rage Winterchill SAY_ONSLAY +(17808, 1, 2), -- Anetheron SAY_ONSLAY + +-- Serpentshrine Cavern +(21212, 6, 1), -- Lady Vashj SAY_SLAY +(21216, 2, 1), -- Hydross the Unstable SAY_CLEAN_SLAY +(21216, 5, 1), -- Hydross the Unstable SAY_CORRUPT_SLAY +(21214, 5, 1), -- Fathom-Lord Karathress SAY_SLAY +(21213, 3, 1), -- Morogrim Tidewalker SAY_SLAY + +-- Gruul's Lair +(19044, 3, 5), -- Gruul the Dragonkiller SAY_SLAY +(18831, 3, 5), -- High King Maulgar SAY_SLAY + +-- Magtheridon's Lair +(17257, 2, 5), -- Magtheridon SAY_SLAY + +-- Tempest Keep: The Eye +(19516, 1, 5), -- Void Reaver SAY_SLAY + +-- Black Temple (additional) +(22948, 1, 1), -- Gurtogg Bloodboil SAY_SLAY +(23418, 2, 1), -- Essence of Suffering SUFF_SAY_SLAY +(23419, 1, 1), -- Essence of Desire DESI_SAY_SLAY +(23420, 1, 1), -- Essence of Anger ANGER_SAY_SLAY + +-- Molten Core +(12018, 2, 6), -- Majordomo Executus SAY_SLAY +(11502, 9, 6), -- Ragnaros SAY_KILL + +-- Sunwell Plateau +(24882, 6, 7), -- Brutallus YELL_KILL +(25038, 1, 7), -- Felmyst YELL_KILL +(24850, 1, 7), -- Kalecgos SAY_EVIL_SLAY + +-- Tempest Keep: The Eye (additional) +(18805, 2, 7); -- High Astromancer Solarian SAY_KILL diff --git a/src/server/database/Database/Implementation/WorldDatabase.cpp b/src/server/database/Database/Implementation/WorldDatabase.cpp index dfe7b047d..11b8a613b 100644 --- a/src/server/database/Database/Implementation/WorldDatabase.cpp +++ b/src/server/database/Database/Implementation/WorldDatabase.cpp @@ -27,6 +27,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PrepareStatement(WORLD_DEL_CRELINKED_RESPAWN, "DELETE FROM linked_respawn WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(WORLD_REP_CREATURE_LINKED_RESPAWN, "REPLACE INTO linked_respawn (guid, linkedGuid) VALUES (?, ?)", CONNECTION_ASYNC); PrepareStatement(WORLD_SEL_CREATURE_TEXT, "SELECT CreatureID, GroupID, ID, Text, Type, Language, Probability, Emote, Duration, Sound, BroadcastTextId, TextRange FROM creature_text", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_TEXT_OPTIONS, "SELECT o.CreatureID, o.GroupID, s.Cooldown, s.TriggerChance, s.PlayerOnly FROM creature_text_options o JOIN creature_text_option_sets s ON o.OptionSetID = s.SetID", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_SMART_SCRIPTS, "SELECT entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, event_param6, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o FROM smart_scripts ORDER BY entryorguid, source_type, id, link", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_SMARTAI_WP, "SELECT entry, pointid, position_x, position_y, position_z, orientation, delay FROM waypoints ORDER BY entry, pointid", CONNECTION_SYNCH); PrepareStatement(WORLD_DEL_GAMEOBJECT, "DELETE FROM gameobject WHERE guid = ?", CONNECTION_ASYNC); diff --git a/src/server/database/Database/Implementation/WorldDatabase.h b/src/server/database/Database/Implementation/WorldDatabase.h index 6874a81d4..c82fd1652 100644 --- a/src/server/database/Database/Implementation/WorldDatabase.h +++ b/src/server/database/Database/Implementation/WorldDatabase.h @@ -32,6 +32,7 @@ enum WorldDatabaseStatements : uint32 WORLD_DEL_CRELINKED_RESPAWN, WORLD_REP_CREATURE_LINKED_RESPAWN, WORLD_SEL_CREATURE_TEXT, + WORLD_SEL_CREATURE_TEXT_OPTIONS, WORLD_SEL_SMART_SCRIPTS, WORLD_SEL_SMARTAI_WP, WORLD_DEL_GAMEOBJECT, diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 60acd2781..58c4336e8 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -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; diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index b492bd6c8..6b14d82f2 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -411,6 +411,9 @@ public: void SetTextRepeatId(uint8 textGroup, uint8 id); void ClearTextRepeatGroup(uint8 textGroup); + bool IsTextOnCooldown(uint8 textGroup) const; + void SetTextCooldown(uint8 textGroup, uint32 cooldownMs); + bool IsFreeToMove(); static constexpr uint32 MOVE_CIRCLE_CHECK_INTERVAL = 3000; static constexpr uint32 MOVE_BACKWARDS_CHECK_INTERVAL = 2000; @@ -548,6 +551,7 @@ private: ObjectGuid _spellFocusTarget; ///> Saved target during spell focus for restoration CreatureTextRepeatGroup m_textRepeat; + std::unordered_map m_textCooldowns; // groupID -> expiry time (s) bool _isMissingSwimmingFlagOutOfCombat; diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 501bea861..7ecb8153f 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -21,9 +21,11 @@ #include "Chat.h" #include "Common.h" #include "DatabaseEnv.h" +#include "GameTime.h" #include "GridNotifiers.h" #include "MiscPackets.h" #include "ObjectMgr.h" +#include "Random.h" class CreatureTextBuilder { @@ -196,6 +198,62 @@ void CreatureTextMgr::LoadCreatureTextLocales() LOG_INFO("server.loading", " "); } +void CreatureTextMgr::LoadCreatureTextOptions() +{ + uint32 oldMSTime = getMSTime(); + + mTextOptionsMap.clear(); + + WorldDatabasePreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_CREATURE_TEXT_OPTIONS); + PreparedQueryResult result = WorldDatabase.Query(stmt); + + if (!result) + { + LOG_WARN("server.loading", ">> Loaded 0 creature text options. DB table `creature_text_options` is empty."); + LOG_INFO("server.loading", " "); + return; + } + + uint32 count = 0; + + do + { + Field* fields = result->Fetch(); + uint32 creatureId = fields[0].Get(); + uint8 groupId = fields[1].Get(); + + CreatureTextOptions options; + options.cooldown = fields[2].Get(); + options.triggerChance = fields[3].Get(); + options.playerOnly = fields[4].Get(); + + if (options.triggerChance > 100) + { + LOG_ERROR("sql.sql", "CreatureTextMgr: Entry {}, Group {} in table `creature_text_options` has TriggerChance {} > 100. Setting to 100.", creatureId, groupId, options.triggerChance); + options.triggerChance = 100; + } + + mTextOptionsMap[creatureId][groupId] = options; + ++count; + } while (result->NextRow()); + + LOG_INFO("server.loading", ">> Loaded {} Creature Text Options in {} ms", count, GetMSTimeDiffToNow(oldMSTime)); + LOG_INFO("server.loading", " "); +} + +CreatureTextOptions const* CreatureTextMgr::GetTextOptions(uint32 entry, uint8 group) const +{ + auto entryItr = mTextOptionsMap.find(entry); + if (entryItr == mTextOptionsMap.end()) + return nullptr; + + auto groupItr = entryItr->second.find(group); + if (groupItr == entryItr->second.end()) + return nullptr; + + return &groupItr->second; +} + uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject const* target /*= nullptr*/, ChatMsg msgType /*= CHAT_MSG_ADDON*/, Language language /*= LANG_ADDON*/, CreatureTextRange range /*= TEXT_RANGE_NORMAL*/, uint32 sound /*= 0*/, TeamId teamId /*= TEAM_NEUTRAL*/, bool gmOnly /*= false*/, Player* srcPlr /*= nullptr*/) { if (!source) @@ -218,6 +276,21 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject } CreatureTextGroup const& textGroupContainer = itr->second; //has all texts in the group + + // Check creature_text_options for this group + CreatureTextOptions const* options = GetTextOptions(source->GetEntry(), textGroup); + if (options) + { + if (options->playerOnly && (!target || !target->IsPlayer())) + return 0; + + if (options->triggerChance < 100 && !roll_chance_i(options->triggerChance)) + return 0; + + if (options->cooldown > 0 && source->IsTextOnCooldown(textGroup)) + return 0; + } + CreatureTextRepeatIds repeatGroup = source->GetTextRepeatGroup(textGroup);//has all textIDs from the group that were already said CreatureTextGroup tempGroup;//will use this to talk after sorting repeatGroup @@ -265,6 +338,11 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject } source->SetTextRepeatId(textGroup, iter->id); + + // Set cooldown if creature_text_options specifies one + if (options && options->cooldown > 0) + source->SetTextCooldown(textGroup, options->cooldown); + return iter->duration; } diff --git a/src/server/game/Texts/CreatureTextMgr.h b/src/server/game/Texts/CreatureTextMgr.h index 37a393496..22ca7dbee 100644 --- a/src/server/game/Texts/CreatureTextMgr.h +++ b/src/server/game/Texts/CreatureTextMgr.h @@ -71,10 +71,20 @@ struct CreatureTextId uint32 textId; }; +struct CreatureTextOptions +{ + uint32 cooldown; // ms before this group can fire again + uint8 triggerChance; // 0-100 chance to fire at all + bool playerOnly; // only fire if target is a player +}; + typedef std::vector CreatureTextGroup; // texts in a group typedef std::unordered_map CreatureTextHolder; // groups for a creature by groupid typedef std::unordered_map CreatureTextMap; // all creatures by entry +typedef std::unordered_map CreatureTextOptionsMap; // options per group +typedef std::unordered_map CreatureTextOptionsContainer; // per creature entry + typedef std::map LocaleCreatureTextMap; class CreatureTextMgr @@ -87,7 +97,9 @@ public: ~CreatureTextMgr() { } void LoadCreatureTexts(); void LoadCreatureTextLocales(); + void LoadCreatureTextOptions(); CreatureTextMap const& GetTextMap() const { return mTextMap; } + CreatureTextOptions const* GetTextOptions(uint32 entry, uint8 group) const; void SendSound(Creature* source, uint32 sound, ChatMsg msgType, WorldObject const* target, CreatureTextRange range, TeamId teamId, bool gmOnly); void SendEmote(Unit* source, uint32 emote); @@ -105,6 +117,7 @@ private: CreatureTextMap mTextMap; LocaleCreatureTextMap mLocaleTextMap; + CreatureTextOptionsContainer mTextOptionsMap; }; #define sCreatureTextMgr CreatureTextMgr::instance() diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index c416a6080..c12ff71b8 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -869,6 +869,9 @@ void World::SetInitialWorldSettings() LOG_INFO("server.loading", "Loading Creature Texts..."); sCreatureTextMgr->LoadCreatureTexts(); + LOG_INFO("server.loading", "Loading Creature Text Options..."); + sCreatureTextMgr->LoadCreatureTextOptions(); + LOG_INFO("server.loading", "Loading Creature Text Locales..."); sCreatureTextMgr->LoadCreatureTextLocales(); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp index bb563de0a..ea9267357 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_majordomo_executus.cpp @@ -219,8 +219,7 @@ struct boss_majordomo : public BossAI void KilledUnit(Unit* victim) override { - if (roll_chance_i(25) && victim->IsPlayer()) - Talk(SAY_SLAY); + Talk(SAY_SLAY, victim); } void JustEngagedWith(Unit* /*attacker*/) override diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp index 6538947e3..73eab62c6 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/MoltenCore/boss_ragnaros.cpp @@ -209,8 +209,7 @@ struct boss_ragnaros : public BossAI void KilledUnit(Unit* victim) override { - if (roll_chance_i(25) && victim->IsPlayer()) - Talk(SAY_KILL); + Talk(SAY_KILL, victim); } void AttackStart(Unit* target) override diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp index 168037e7a..97bd59505 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_moroes.cpp @@ -117,7 +117,6 @@ struct boss_moroes : public BossAI { BossAI::Reset(); DoCastSelf(SPELL_DUAL_WIELD, true); - _recentlySpoken = false; _vanished = false; me->SetImmuneToAll(false); me->SetReactState(REACT_AGGRESSIVE); @@ -170,15 +169,7 @@ struct boss_moroes : public BossAI void KilledUnit(Unit* victim) override { - if (!_recentlySpoken && victim->IsPlayer()) - { - Talk(SAY_KILL); - _recentlySpoken = true; - scheduler.Schedule(5s, [this](TaskContext) - { - _recentlySpoken = false; - }); - } + Talk(SAY_KILL, victim); } void JustDied(Unit* killer) override @@ -243,7 +234,6 @@ struct boss_moroes : public BossAI private: EventMap _events2; uint8 _activeGuests; - bool _recentlySpoken; bool _vanished; }; diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp index 0e55c9d1d..5e8570136 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_brutallus.cpp @@ -104,8 +104,7 @@ struct boss_brutallus : public BossAI void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && roll_chance_i(50)) - Talk(YELL_KILL); + Talk(YELL_KILL, victim); } void JustDied(Unit* killer) override diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp index 6aee91f41..d3ce0fa71 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_felmyst.cpp @@ -186,8 +186,7 @@ struct boss_felmyst : public BossAI void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && roll_chance_i(50)) - Talk(YELL_KILL); + Talk(YELL_KILL, victim); } void SpellHitTarget(Unit* target, const SpellInfo* spell) override diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index c23569e4e..1249a90d7 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -260,8 +260,7 @@ struct boss_kalecgos : public BossAI void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && roll_chance_i(50)) - Talk(SAY_EVIL_SLAY); + Talk(SAY_EVIL_SLAY, victim); } private: diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp index 0ac933683..0e0e923ef 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp @@ -47,10 +47,7 @@ enum Texts struct boss_anetheron : public BossAI { public: - boss_anetheron(Creature* creature) : BossAI(creature, DATA_ANETHERON) - { - _recentlySpoken = false; - } + boss_anetheron(Creature* creature) : BossAI(creature, DATA_ANETHERON) { } void JustEngagedWith(Unit * who) override { @@ -114,16 +111,8 @@ public: void KilledUnit(Unit* victim) override { - if (!_recentlySpoken && victim->IsPlayer() && me->IsAlive()) - { - Talk(SAY_ONSLAY); - _recentlySpoken = true; - - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); - } + if (me->IsAlive()) + Talk(SAY_ONSLAY, victim); } void JustDied(Unit * killer) override @@ -132,8 +121,6 @@ public: BossAI::JustDied(killer); } -private: - bool _recentlySpoken; }; class spell_anetheron_sleep : public SpellScript diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp index 22024068e..abbd9374d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_azgalor.cpp @@ -44,10 +44,7 @@ enum Texts struct boss_azgalor : public BossAI { public: - boss_azgalor(Creature* creature) : BossAI(creature, DATA_AZGALOR) - { - _recentlySpoken = false; - } + boss_azgalor(Creature* creature) : BossAI(creature, DATA_AZGALOR) { } void JustEngagedWith(Unit * who) override { @@ -85,18 +82,10 @@ public: me->GetMotionMaster()->MoveWaypoint(HORDE_BOSS_PATH, false); } - void KilledUnit(Unit * victim) override + void KilledUnit(Unit* victim) override { - if (!_recentlySpoken && victim->IsPlayer() && me->IsAlive()) - { - Talk(SAY_ONSLAY); - _recentlySpoken = true; - - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); - } + if (me->IsAlive()) + Talk(SAY_ONSLAY, victim); } void JustDied(Unit * killer) override @@ -111,8 +100,6 @@ public: BossAI::JustDied(killer); } -private: - bool _recentlySpoken; }; class spell_azgalor_doom : public SpellScript diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp index 889ccc178..42cfb545d 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_kazrogal.cpp @@ -52,7 +52,6 @@ public: void Reset() override { - _recentlySpoken = false; _markCounter = 0; BossAI::Reset(); } @@ -104,18 +103,10 @@ public: me->GetMotionMaster()->MoveWaypoint(HORDE_BOSS_PATH, false); } - void KilledUnit(Unit * victim) override + void KilledUnit(Unit* victim) override { - if (!_recentlySpoken && victim->IsPlayer() && me->IsAlive()) - { - Talk(SAY_ONSLAY); - _recentlySpoken = true; - - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); - } + if (me->IsAlive()) + Talk(SAY_ONSLAY, victim); } void JustDied(Unit * killer) override @@ -125,7 +116,6 @@ public: } private: - bool _recentlySpoken; uint8 _markCounter; }; diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp index 2bdf44abf..9e2a8a26c 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_rage_winterchill.cpp @@ -47,10 +47,7 @@ enum Misc struct boss_rage_winterchill : public BossAI { public: - boss_rage_winterchill(Creature* creature) : BossAI(creature, DATA_WINTERCHILL) - { - _recentlySpoken = false; - } + boss_rage_winterchill(Creature* creature) : BossAI(creature, DATA_WINTERCHILL) { } void JustEngagedWith(Unit* who) override { @@ -117,16 +114,8 @@ public: void KilledUnit(Unit* victim) override { - if (!_recentlySpoken && victim->IsPlayer() && me->IsAlive()) - { - Talk(SAY_ONSLAY); - _recentlySpoken = true; - - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); - } + if (me->IsAlive()) + Talk(SAY_ONSLAY, victim); } void JustDied(Unit* killer) override @@ -135,8 +124,6 @@ public: BossAI::JustDied(killer); } -private: - bool _recentlySpoken; }; void AddSC_boss_rage_winterchill() diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 640bb9c98..4d06c331d 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -69,8 +69,7 @@ enum Events EVENT_SUMMON_GUARDIAN = 8, EVENT_SUMMON_VENOMANCER = 9, EVENT_SUMMON_DARTER = 10, - EVENT_SUMMON_ASSASSINS = 11, - EVENT_KILL_TALK = 12 + EVENT_SUMMON_ASSASSINS = 11 }; enum CreatureIds @@ -262,11 +261,7 @@ struct boss_anub_arak : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_SLAY); } void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index be33fad5a..90e24370f 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -58,7 +58,6 @@ public: boss_krik_thirAI(Creature* creature) : BossAI(creature, DATA_KRIKTHIR) { _initTalk = false; - _canTalk = true; _minionInCombat = false; } @@ -79,7 +78,6 @@ public: }); }); - _canTalk = true; _minionInCombat = false; _firstCall = true; _minionsEngaged = 0; @@ -236,14 +234,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (_canTalk) - { - _canTalk = false; - Talk(SAY_SLAY); - me->m_Events.AddEventAtOffset([&] { - _canTalk = true; - }, 6s); - } + Talk(SAY_SLAY); } void SummonedCreatureDies(Creature* summon, Unit*) override @@ -253,7 +244,6 @@ public: private: bool _initTalk; - bool _canTalk; bool _minionInCombat; uint8 _minionsEngaged; bool _firstCall; diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp index 5a8cc49b1..802aced27 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_baltharus_the_warborn.cpp @@ -66,7 +66,6 @@ enum Events EVENT_CHECK_HEALTH1 = 4, EVENT_CHECK_HEALTH2 = 5, EVENT_CHECK_HEALTH3 = 6, - EVENT_KILL_TALK = 7, EVENT_SUMMON_CLONE = 8, EVENT_XERESTRASZA_EVENT_0 = 1, @@ -191,11 +190,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void JustSummoned(Creature* summon) override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp index faf314e6f..fe0ea6de9 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_general_zarithrian.cpp @@ -47,7 +47,6 @@ enum Misc EVENT_INTIDMDATING_ROAR = 2, EVENT_SUMMON_ADDS1 = 3, EVENT_SUMMON_ADDS2 = 4, - EVENT_KILL_TALK = 5, // Onyx Flamecaller EVENT_BLAST_NOVA = 6, @@ -136,11 +135,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp index 5a53b1bdd..d289520f6 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp @@ -131,7 +131,6 @@ enum Events EVENT_FIERY_COMBUSTION = 5, EVENT_TAIL_LASH = 6, EVENT_CHECK_HEALTH = 7, - EVENT_KILL_TALK = 8, EVENT_TRIGGER_BERSERK = 9, EVENT_HALION_VISIBILITY = 10, @@ -310,11 +309,7 @@ public: void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && !events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL, victim); } void JustDied(Unit* killer) override @@ -477,11 +472,7 @@ public: void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && !_events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - _events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL, victim); } void JustDied(Unit* killer) override diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp index 2bebd1502..7792dfeb1 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_saviana_ragefire.cpp @@ -46,8 +46,7 @@ enum Events EVENT_CONFLAGRATION = 4, EVENT_LAND_GROUND = 5, EVENT_AIR_MOVEMENT = 6, - EVENT_LAND_BACK = 7, - EVENT_KILL_TALK = 8 + EVENT_LAND_BACK = 7 }; enum Misc @@ -121,11 +120,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp index 36f8b555c..dd1842cd6 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_novos.cpp @@ -56,8 +56,6 @@ enum Misc NPC_CRYSTAL_HANDLER = 26627, NPC_SUMMON_CRYSTAL_HANDLER_TARGET = 27583, - EVENT_KILL_TALK = 1, - ROOM_RIGHT = 0, ROOM_LEFT = 1, ROOM_STAIRS = 2 @@ -206,11 +204,7 @@ struct boss_novos : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void JustSummoned(Creature* summon) override diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp index 1a240ce15..43fc5e74d 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_tharon_ja.cpp @@ -60,8 +60,7 @@ enum Misc EVENT_SPELL_LIGHTNING_BREATH = 5, EVENT_SPELL_POISON_CLOUD = 6, EVENT_TURN_FLESH_REAL = 9, - EVENT_TURN_BONES_REAL = 10, - EVENT_KILL_TALK = 11 + EVENT_TURN_BONES_REAL = 10 }; class boss_tharon_ja : public CreatureScript @@ -106,11 +105,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void DoAction(int32 param) override diff --git a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp index 8380f1caa..6d71ac5cd 100644 --- a/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp +++ b/src/server/scripts/Northrend/DraktharonKeep/boss_trollgore.cpp @@ -55,8 +55,7 @@ enum Events EVENT_SPELL_CRUSH = 2, EVENT_SPELL_CONSUME = 3, EVENT_SPELL_CORPSE_EXPLODE = 4, - EVENT_SPAWN_INVADERS = 5, - EVENT_KILL_TALK = 6 + EVENT_SPAWN_INVADERS = 5 }; class boss_trollgore : public CreatureScript @@ -102,11 +101,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void JustSummoned(Creature* summon) override diff --git a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp index f44da0ccb..8f4af9474 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_gal_darah.cpp @@ -47,11 +47,6 @@ enum Yells SAY_IMPALE = 5 }; -enum Events -{ - EVENT_KILL_TALK = 1 -}; - struct boss_gal_darah : public BossAI { boss_gal_darah(Creature* creature) : BossAI(creature, DATA_GAL_DARAH) { } @@ -160,11 +155,7 @@ struct boss_gal_darah : public BossAI void KilledUnit(Unit*) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_SLAY); } private: diff --git a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp index 2d405fe5d..d369dc0f6 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_moorabi.cpp @@ -55,7 +55,6 @@ enum Events EVENT_NUMBLING_SHOUT = 2, EVENT_DETERMINED_STAB = 3, EVENT_TRANSFORMATION = 4, - EVENT_KILL_TALK = 5, EVENT_PHANTOM = 10 }; @@ -125,11 +124,7 @@ public: void KilledUnit(Unit*) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_SLAY); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp index 2d8b6ad56..2d3eaf0b0 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_slad_ran.cpp @@ -49,9 +49,7 @@ enum Misc MAX_VIPER = 2, MAX_CONSTRICTOR = 3, - MAX_SUMMONS = 5, - - EVENT_KILL_TALK = 1 + MAX_SUMMONS = 5 }; const Position SpawnLoc[] = @@ -137,11 +135,7 @@ public: void KilledUnit(Unit*) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_SLAY); } private: diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index b27e9008b..05c6838d6 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -638,7 +638,6 @@ public: uint32 _necroticPlagueStack; uint32 _vileSpiritExplosions; uint16 _positionCheckTimer; - uint32 _lastTalkTimeKill; uint32 _lastTalkTimeBuff; bool _bFrostmournePhase; bool _bFordringMustFallYell; @@ -649,7 +648,6 @@ public: _necroticPlagueStack = 0; _vileSpiritExplosions = 0; _positionCheckTimer = 5000; - _lastTalkTimeKill = 0; _lastTalkTimeBuff = 0; _bFrostmournePhase = false; _bFordringMustFallYell = false; @@ -721,11 +719,8 @@ public: void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && !me->IsInEvadeMode() && _phase != PHASE_OUTRO && _lastTalkTimeKill + 5 < GameTime::GetGameTime().count()) - { - _lastTalkTimeKill = GameTime::GetGameTime().count(); - Talk(SAY_LK_KILL); - } + if (!me->IsInEvadeMode() && _phase != PHASE_OUTRO) + Talk(SAY_LK_KILL, victim); } void DoAction(int32 action) override diff --git a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp index d6fbd906a..f0e7cf6a6 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_razuvious.cpp @@ -205,8 +205,7 @@ public: void KilledUnit(Unit* who) override { - if (roll_chance_i(30)) - Talk(SAY_SLAY); + Talk(SAY_SLAY); if (who->IsPlayer()) instance->StorePersistentData(PERSISTENT_DATA_IMMORTAL_FAIL, 1); diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp index 23cd3f12a..e6e92f8ce 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_keristrasza.cpp @@ -51,8 +51,7 @@ enum Events EVENT_CRYSTAL_CHAINS = 2, EVENT_TAIL_SWEEP = 3, EVENT_HEALTH_CHECK = 4, - EVENT_ACHIEVEMENT_CHECK = 5, - EVENT_KILL_TALK = 6 + EVENT_ACHIEVEMENT_CHECK = 5 }; struct boss_keristrasza : public BossAI @@ -89,11 +88,7 @@ struct boss_keristrasza : public BossAI void KilledUnit(Unit*) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_SLAY); } void SetData(uint32 type, uint32) override diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp index cb8705696..a410d7212 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_magus_telestra.cpp @@ -76,8 +76,7 @@ enum Events EVENT_MAGUS_HEALTH2 = 5, EVENT_MAGUS_FAIL_ACHIEVEMENT = 6, EVENT_MAGUS_MERGED = 7, - EVENT_MAGUS_RELOCATE = 8, - EVENT_KILL_TALK = 9 + EVENT_MAGUS_RELOCATE = 8 }; struct boss_magus_telestra : public BossAI @@ -131,11 +130,7 @@ struct boss_magus_telestra : public BossAI void KilledUnit(Unit*) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void JustSummoned(Creature* summon) override diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index 397f68f44..65b0a8440 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -49,8 +49,7 @@ enum Events EVENT_ORMOROK_SPELL_REFLECTION = 3, EVENT_ORMOROK_SUMMON = 4, EVENT_ORMOROK_HEALTH = 5, - EVENT_ORMOROK_SUMMON_SPIKES = 6, - EVENT_KILL_TALK = 7 + EVENT_ORMOROK_SUMMON_SPIKES = 6 }; enum Misc @@ -93,11 +92,7 @@ struct boss_ormorok : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_KILL); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_KILL); } void JustSummoned(Creature* summon) override diff --git a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp index 6e667c6b9..7fec8c37e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_bloodboil.cpp @@ -66,12 +66,11 @@ enum Misc struct boss_gurtogg_bloodboil : public BossAI { - boss_gurtogg_bloodboil(Creature* creature) : BossAI(creature, DATA_GURTOGG_BLOODBOIL), _recentlySpoken(false) { } + boss_gurtogg_bloodboil(Creature* creature) : BossAI(creature, DATA_GURTOGG_BLOODBOIL) { } void Reset() override { BossAI::Reset(); - _recentlySpoken = false; } void JustEngagedWith(Unit* who) override @@ -145,13 +144,7 @@ struct boss_gurtogg_bloodboil : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - me->m_Events.AddEventAtOffset([&] { - _recentlySpoken = false; - }, 6s); - } + Talk(SAY_SLAY); } void JustSummoned(Creature* summon) override @@ -171,8 +164,6 @@ struct boss_gurtogg_bloodboil : public BossAI return me->GetHomePosition().GetExactDist2d(me) > 105.0f; } -private: - bool _recentlySpoken; }; class spell_gurtogg_bloodboil : public SpellScript diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp index 2e0cfe9f0..8a79fd4bb 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp @@ -196,7 +196,7 @@ public: struct boss_illidan_stormrage : public BossAI { - boss_illidan_stormrage(Creature* creature) : BossAI(creature, DATA_ILLIDAN_STORMRAGE), _canTalk(true), _dying(false), _inCutscene(false), beamPosId(0) { } + boss_illidan_stormrage(Creature* creature) : BossAI(creature, DATA_ILLIDAN_STORMRAGE), _dying(false), _inCutscene(false), beamPosId(0) { } void Reset() override { @@ -204,7 +204,6 @@ struct boss_illidan_stormrage : public BossAI me->m_Events.CancelEventGroup(GROUP_BERSERK); me->m_Events.CancelEventGroup(GROUP_PHASE_FLYING); me->m_Events.CancelEventGroup(GROUP_DEMON_FORM); - _canTalk = true; _dying = false; _inCutscene = false; beamPosId = urand(0, MAX_EYE_BEAM_POS - 1); @@ -652,15 +651,7 @@ struct boss_illidan_stormrage : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (_canTalk) - { - Talk(SAY_ILLIDAN_KILL); - _canTalk = false; - - me->m_Events.AddEventAtOffset([&] { - _canTalk = true; - }, 6s); // 3590ms - } + Talk(SAY_ILLIDAN_KILL); } void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType damagetype, SpellSchoolMask damageSchoolMask) override @@ -689,7 +680,6 @@ struct boss_illidan_stormrage : public BossAI } private: - bool _canTalk; bool _dying; bool _inCutscene; uint8 beamPosId; diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp index 31c16831a..73f6504b6 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_illidari_council.cpp @@ -98,7 +98,6 @@ enum Misc EVENT_SPELL_VANISH_OUT = 31, EVENT_SPELL_ENRAGE = 32, - EVENT_KILL_TALK = 100 }; class VerasEnvenom : public BasicEvent @@ -262,11 +261,7 @@ struct boss_illidari_council_memberAI : public ScriptedAI void KilledUnit(Unit*) override { - if (!events.HasTimeUntilEvent(EVENT_KILL_TALK)) - { - Talk(SAY_COUNCIL_SLAY); - events.ScheduleEvent(EVENT_KILL_TALK, 6s); - } + Talk(SAY_COUNCIL_SLAY); } void JustDied(Unit*) override diff --git a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp index 5cfb86a64..40024dc6e 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_mother_shahraz.cpp @@ -64,13 +64,12 @@ enum Misc struct boss_mother_shahraz : public BossAI { - boss_mother_shahraz(Creature* creature) : BossAI(creature, DATA_MOTHER_SHAHRAZ), _canTalk(true) { } + boss_mother_shahraz(Creature* creature) : BossAI(creature, DATA_MOTHER_SHAHRAZ) { } void Reset() override { _Reset(); me->m_Events.CancelEventGroup(GROUP_ENRAGE); - _canTalk = true; ScheduleHealthCheckEvent(10, [&] { Talk(SAY_EMOTE_FRENZY); @@ -113,15 +112,7 @@ struct boss_mother_shahraz : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (_canTalk) - { - Talk(SAY_SLAY); - _canTalk = false; - - ScheduleUniqueTimedEvent(6s, [&] { - _canTalk = true; - }, 1); - } + Talk(SAY_SLAY); } void JustDied(Unit* killer) override @@ -131,8 +122,6 @@ struct boss_mother_shahraz : public BossAI Talk(SAY_DEATH); } - private: - bool _canTalk; }; class spell_mother_shahraz_random_periodic_aura : public AuraScript diff --git a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp index 0827a0e63..f4e9d95bd 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_reliquary_of_souls.cpp @@ -263,11 +263,10 @@ public: struct boss_essence_of_sufferingAI : public ScriptedAI { - boss_essence_of_sufferingAI(Creature* creature) : ScriptedAI(creature), _recentlySpoken(false) { } + boss_essence_of_sufferingAI(Creature* creature) : ScriptedAI(creature) { } void Reset() override { - _recentlySpoken = false; scheduler.CancelAll(); } @@ -311,13 +310,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SUFF_SAY_SLAY); - me->m_Events.AddEventAtOffset([&] { - _recentlySpoken = false; - }, 6s); - } + Talk(SUFF_SAY_SLAY); } void JustEngagedWith(Unit* /*who*/) override @@ -354,8 +347,6 @@ public: DoMeleeAttackIfReady(); } - private: - bool _recentlySpoken; }; }; @@ -371,11 +362,10 @@ public: struct boss_essence_of_desireAI : public ScriptedAI { - boss_essence_of_desireAI(Creature* creature) : ScriptedAI(creature), _recentlySpoken(false) { } + boss_essence_of_desireAI(Creature* creature) : ScriptedAI(creature) { } void Reset() override { - _recentlySpoken = false; scheduler.CancelAll(); } @@ -418,13 +408,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(DESI_SAY_SLAY); - me->m_Events.AddEventAtOffset([&] { - _recentlySpoken = false; - }, 6s); - } + Talk(DESI_SAY_SLAY); } void JustEngagedWith(Unit* /*who*/) override @@ -467,8 +451,6 @@ public: DoMeleeAttackIfReady(); } - private: - bool _recentlySpoken; }; }; @@ -484,13 +466,12 @@ public: struct boss_essence_of_angerAI : public ScriptedAI { - boss_essence_of_angerAI(Creature* creature) : ScriptedAI(creature), _recentlySpoken(false) { } + boss_essence_of_angerAI(Creature* creature) : ScriptedAI(creature) { } ObjectGuid targetGUID; void Reset() override { - _recentlySpoken = false; targetGUID.Clear(); scheduler.CancelAll(); } @@ -507,13 +488,7 @@ public: void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(ANGER_SAY_SLAY); - me->m_Events.AddEventAtOffset([&] { - _recentlySpoken = false; - }, 6s); - } + Talk(ANGER_SAY_SLAY); } void JustDied(Unit* /*killer*/) override @@ -563,8 +538,6 @@ public: DoMeleeAttackIfReady(); } - private: - bool _recentlySpoken; }; }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp index 2cd31e17e..b944ca351 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_teron_gorefiend.cpp @@ -77,7 +77,6 @@ struct boss_teron_gorefiend : public BossAI { boss_teron_gorefiend(Creature* creature) : BossAI(creature, DATA_TERON_GOREFIEND) { - _recentlySpoken = false; _intro = false; } @@ -127,18 +126,9 @@ struct boss_teron_gorefiend : public BossAI BossAI::JustEngagedWith(who); } - void KilledUnit(Unit* victim) override + void KilledUnit(Unit* victim) override { - if (!_recentlySpoken && victim->IsPlayer()) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - - ScheduleUniqueTimedEvent(6s, [&] - { - _recentlySpoken = false; - }, 1); - } + Talk(SAY_SLAY, victim); } void SetData(uint32 type, uint32 id) override @@ -175,7 +165,6 @@ struct boss_teron_gorefiend : public BossAI } private: - bool _recentlySpoken; bool _intro; }; diff --git a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp index 2791c7f04..f817fed19 100644 --- a/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp +++ b/src/server/scripts/Outland/BlackTemple/boss_warlord_najentus.cpp @@ -46,7 +46,6 @@ enum Spells enum Events { - EVENT_TALK_CHECK = 1, EVENT_ENRAGE = 2 }; @@ -57,7 +56,7 @@ enum Misc struct boss_najentus : public BossAI { - boss_najentus(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS), _canTalk(true) { } + boss_najentus(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS) { } void Reset() override { @@ -68,8 +67,6 @@ struct boss_najentus : public BossAI void JustEngagedWith(Unit* who) override { - _canTalk = true; - BossAI::JustEngagedWith(who); Talk(SAY_AGGRO); DoCastSelf(SPELL_REMOVE_SPINES); @@ -108,15 +105,7 @@ struct boss_najentus : public BossAI void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && _canTalk) - { - Talk(SAY_SLAY); - _canTalk = false; - ScheduleUniqueTimedEvent(5s, [&] - { - _canTalk = true; - }, EVENT_TALK_CHECK); - } + Talk(SAY_SLAY, victim); } void JustDied(Unit* killer) override @@ -126,8 +115,6 @@ struct boss_najentus : public BossAI Talk(SAY_DEATH); } -private: - bool _canTalk; }; class spell_najentus_needle_spine : public SpellScript diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp index 353e357cf..36f0d3c4b 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp @@ -92,7 +92,6 @@ struct boss_fathomlord_karathress : public BossAI void Reset() override { BossAI::Reset(); - _recentlySpoken = false; ScheduleHealthCheckEvent(75, [&]{ instance->DoForAllMinions(DATA_FATHOM_LORD_KARATHRESS, [&](Creature* fathomguard) { @@ -117,15 +116,7 @@ struct boss_fathomlord_karathress : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - } - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); + Talk(SAY_SLAY); } void JustDied(Unit* killer) override @@ -182,8 +173,6 @@ struct boss_fathomlord_karathress : public BossAI }); } } -private: - bool _recentlySpoken; }; struct LeechingThrowSelector diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp index d24ca089c..d289b8e17 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp @@ -87,12 +87,11 @@ enum WaterElementalPathIds struct boss_hydross_the_unstable : public BossAI { - boss_hydross_the_unstable(Creature* creature) : BossAI(creature, DATA_HYDROSS_THE_UNSTABLE), _recentlySpoken(false) { } + boss_hydross_the_unstable(Creature* creature) : BossAI(creature, DATA_HYDROSS_THE_UNSTABLE) { } void Reset() override { _Reset(); - _recentlySpoken = false; SummonTaintedElementalOOC(); } @@ -249,15 +248,7 @@ struct boss_hydross_the_unstable : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(me->HasAura(SPELL_CORRUPTION) ? SAY_CORRUPT_SLAY : SAY_CLEAN_SLAY); - _recentlySpoken = true; - } - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); + Talk(me->HasAura(SPELL_CORRUPTION) ? SAY_CORRUPT_SLAY : SAY_CLEAN_SLAY); } void JustSummoned(Creature* summon) override @@ -291,8 +282,6 @@ struct boss_hydross_the_unstable : public BossAI Talk(me->HasAura(SPELL_CORRUPTION) ? SAY_CORRUPT_DEATH : SAY_CLEAN_DEATH); BossAI::JustDied(killer); } -private: - bool _recentlySpoken; }; class spell_hydross_cleansing_field_aura : public AuraScript diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp index 265572584..8851ee068 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp @@ -78,7 +78,6 @@ struct boss_lady_vashj : public BossAI void Reset() override { _count = 0; - _recentlySpoken = false; _batTimer = 20s; _playerAngle = 0.0f; BossAI::Reset(); @@ -94,15 +93,7 @@ struct boss_lady_vashj : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - } - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); + Talk(SAY_SLAY); } void JustDied(Unit* killer) override @@ -258,7 +249,6 @@ struct boss_lady_vashj : public BossAI private: float _playerAngle; - bool _recentlySpoken; bool _intro; int32 _count; std::chrono::seconds _batTimer; diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp index be599ef83..1b94f747b 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp @@ -83,7 +83,6 @@ struct boss_leotheras_the_blind : public BossAI DoCastSelf(SPELL_CLEAR_CONSUMING_MADNESS, true); DoCastSelf(SPELL_DUAL_WIELD, true); me->SetReactState(REACT_PASSIVE); - _recentlySpoken = false; ScheduleHealthCheckEvent(15, [&]{ me->RemoveAurasDueToSpell(SPELL_WHIRLWIND); @@ -242,8 +241,6 @@ struct boss_leotheras_the_blind : public BossAI me->setAttackTimer(BASE_ATTACK, 2000); } } -private: - bool _recentlySpoken; }; struct npc_inner_demon : public ScriptedAI diff --git a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp index a923b81a9..240dc4444 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp @@ -60,21 +60,11 @@ struct boss_morogrim_tidewalker : public BossAI void Reset() override { BossAI::Reset(); - _recentlySpoken = false; } - void KilledUnit(Unit*) override + void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - } - - scheduler.Schedule(6s, [this](TaskContext) - { - _recentlySpoken = false; - }); + Talk(SAY_SLAY); } void JustSummoned(Creature* summon) override @@ -131,8 +121,6 @@ struct boss_morogrim_tidewalker : public BossAI context.Repeat(45s, 60s); }); } -private: - bool _recentlySpoken; }; class spell_morogrim_tidewalker_watery_grave : public SpellScript diff --git a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp index 9c0dfcd9c..0dd93ac90 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_gruul.cpp @@ -67,7 +67,6 @@ struct boss_gruul : public BossAI void Reset() override { _Reset(); - _recentlySpoken = false; _caveInTimer = 29s; } @@ -119,18 +118,9 @@ struct boss_gruul : public BossAI }); } - void KilledUnit(Unit* /*who*/) override + void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - } - - scheduler.Schedule(5s, [this](TaskContext) - { - _recentlySpoken = false; - }); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) override @@ -154,7 +144,6 @@ struct boss_gruul : public BossAI private: std::chrono::milliseconds _caveInTimer; - bool _recentlySpoken; }; struct npc_invisible_tractor_beam_source : public NullCreatureAI diff --git a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp index ac24a919d..57c4895e1 100644 --- a/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp +++ b/src/server/scripts/Outland/GruulsLair/boss_high_king_maulgar.cpp @@ -69,7 +69,6 @@ struct boss_high_king_maulgar : public BossAI void Reset() override { _Reset(); - _recentlySpoken = false; me->SetLootMode(0); ScheduleHealthCheckEvent(50, [&]{ Talk(SAY_ENRAGE); @@ -87,18 +86,9 @@ struct boss_high_king_maulgar : public BossAI }); } - void KilledUnit(Unit* /*victim*/) override + void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - } - - scheduler.Schedule(5s, [this](TaskContext) - { - _recentlySpoken = false; - }); + Talk(SAY_SLAY); } void JustDied(Unit* /*killer*/) override @@ -158,8 +148,6 @@ struct boss_high_king_maulgar : public BossAI DoMeleeAttackIfReady(); } -private: - bool _recentlySpoken; }; struct boss_olm_the_summoner : public ScriptedAI diff --git a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp index edb20d541..f97519f04 100644 --- a/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp @@ -80,7 +80,6 @@ struct boss_magtheridon : public BossAI BossAI::Reset(); _currentPhase = 0; _castingQuake = false; - _recentlySpoken = false; _magReleased = false; _interruptScheduler.CancelAll(); scheduler.Schedule(90s, [this](TaskContext context) @@ -123,16 +122,7 @@ struct boss_magtheridon : public BossAI void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - } - - scheduler.Schedule(5s, [this](TaskContext /*context*/) - { - _recentlySpoken = false; - }); + Talk(SAY_SLAY); } void JustDied(Unit* killer) override @@ -244,7 +234,6 @@ struct boss_magtheridon : public BossAI private: bool _castingQuake; - bool _recentlySpoken; bool _magReleased; uint8 _currentPhase; TaskScheduler _interruptScheduler; diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp index 54235dda0..8e82904e3 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_astromancer.cpp @@ -104,10 +104,7 @@ struct boss_high_astromancer_solarian : public BossAI void KilledUnit(Unit* victim) override { - if (victim->IsPlayer() && roll_chance_i(50)) - { - Talk(SAY_KILL); - } + Talk(SAY_KILL, victim); } void JustDied(Unit* killer) override diff --git a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp index 3c4582d46..6b47324c8 100644 --- a/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp +++ b/src/server/scripts/Outland/TempestKeep/Eye/boss_void_reaver.cpp @@ -52,20 +52,11 @@ struct boss_void_reaver : public BossAI void Reset() override { BossAI::Reset(); - _recentlySpoken = false; } void KilledUnit(Unit* /*victim*/) override { - if (!_recentlySpoken) - { - Talk(SAY_SLAY); - _recentlySpoken = true; - scheduler.Schedule(5s, [this](TaskContext) - { - _recentlySpoken = false; - }); - } + Talk(SAY_SLAY); } void JustDied(Unit* killer) override @@ -102,8 +93,6 @@ struct boss_void_reaver : public BossAI }); } - private: - bool _recentlySpoken; }; void AddSC_boss_void_reaver()