mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Chat: Added new TextRange personal to creature_text which sends the message to related target only (#27070)
* also updated creature_texts of Vigilant Quoram in Lightforged Intro zone as an example
This commit is contained in:
2
sql/updates/world/master/2021_10_16_01_world.sql
Normal file
2
sql/updates/world/master/2021_10_16_01_world.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `creature_text` SET `TextRange`=5 WHERE `CreatureID`=130986 AND `GroupID` BETWEEN 0 AND 5;
|
||||
@@ -112,7 +112,7 @@ void CreatureTextMgr::LoadCreatureTexts()
|
||||
}
|
||||
}
|
||||
|
||||
if (temp.TextRange > TEXT_RANGE_WORLD)
|
||||
if (temp.TextRange > TEXT_RANGE_PERSONAL)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has incorrect TextRange %u.", temp.creatureId, temp.groupId, temp.id, temp.TextRange);
|
||||
temp.TextRange = TEXT_RANGE_NORMAL;
|
||||
@@ -333,6 +333,12 @@ void CreatureTextMgr::SendNonChatPacket(WorldObject* source, WorldPacket const*
|
||||
player->SendDirectMessage(data);
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_PERSONAL:
|
||||
if (!whisperTarget || !whisperTarget->IsPlayer())
|
||||
return;
|
||||
|
||||
whisperTarget->ToPlayer()->SendDirectMessage(data);
|
||||
return;
|
||||
case TEXT_RANGE_NORMAL:
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -36,7 +36,8 @@ enum CreatureTextRange
|
||||
TEXT_RANGE_AREA = 1,
|
||||
TEXT_RANGE_ZONE = 2,
|
||||
TEXT_RANGE_MAP = 3,
|
||||
TEXT_RANGE_WORLD = 4
|
||||
TEXT_RANGE_WORLD = 4,
|
||||
TEXT_RANGE_PERSONAL = 5
|
||||
};
|
||||
|
||||
struct CreatureTextEntry
|
||||
|
||||
@@ -145,6 +145,12 @@ void CreatureTextMgr::SendChatPacket(WorldObject* source, Builder const& builder
|
||||
localizer(player);
|
||||
return;
|
||||
}
|
||||
case TEXT_RANGE_PERSONAL:
|
||||
if (!whisperTarget || !whisperTarget->IsPlayer())
|
||||
return;
|
||||
|
||||
localizer(whisperTarget->ToPlayer());
|
||||
return;
|
||||
case TEXT_RANGE_NORMAL:
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user