feat(Core/Conditions): Add new Source Type Gossip Hello. (#25413)
Co-authored-by: sogladev <sogladev@gmail.com>
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "Battleground.h"
|
||||
#include "ConditionMgr.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "DatabaseEnv.h"
|
||||
@@ -150,6 +151,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
|
||||
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_NONE)
|
||||
return;
|
||||
|
||||
// Check GossipHello conditions - block gossip opening if conditions not met
|
||||
ConditionList gossipConditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_GOSSIP_HELLO, unit->GetEntry());
|
||||
if (!sConditionMgr->IsObjectMeetToConditions(_player, unit, gossipConditions))
|
||||
return;
|
||||
|
||||
// set faction visible if needed
|
||||
if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->GetFaction()))
|
||||
_player->GetReputationMgr().SetVisible(factionTemplateEntry);
|
||||
|
||||
Reference in New Issue
Block a user