aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-03-03 00:51:51 +0100
committerShauren <shauren.trinity@gmail.com>2024-03-03 00:51:51 +0100
commitc2e36dea6c6af6139bf60454e9299447ec7d9897 (patch)
tree0699ab0196a47eb78b7c08149cc8d34008a3f1da /src
parent97d7ccd180f96a414f205396261907e1e87d491a (diff)
Core/Creatures: Implemented serverside checks for UNIT_FLAG2_INTERACT_WHILE_HOSTILE and UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT
* Also stop sending npc flags for hostile creatures
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp30
-rw-r--r--src/server/game/Entities/Creature/Creature.h4
-rw-r--r--src/server/game/Entities/Creature/enuminfo_CreatureData.cpp2
-rw-r--r--src/server/game/Entities/Object/Updates/ViewerDependentValues.h18
-rw-r--r--src/server/game/Entities/Player/Player.cpp14
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp34
-rw-r--r--src/server/game/Entities/Unit/Unit.h9
-rw-r--r--src/server/game/Entities/Unit/UnitDefines.h4
-rw-r--r--src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp6
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp7
-rw-r--r--src/server/game/Handlers/QuestHandler.cpp21
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sister_svalna.cpp2
12 files changed, 116 insertions, 35 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 68e3fa69839..a71b84bd9ab 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -567,6 +567,7 @@ bool Creature::InitEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
// TODO: migrate these in DB
_staticFlags.ApplyFlag(CREATURE_STATIC_FLAG_2_ALLOW_MOUNTED_COMBAT, (GetCreatureDifficulty()->TypeFlags & CREATURE_TYPE_FLAG_ALLOW_MOUNTED_COMBAT) != 0);
+ SetInteractionAllowedInCombat((GetCreatureDifficulty()->TypeFlags & CREATURE_TYPE_FLAG_ALLOW_INTERACTION_WHILE_IN_COMBAT) != 0);
SetTreatAsRaidUnit((GetCreatureDifficulty()->TypeFlags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) != 0);
return true;
@@ -2985,6 +2986,35 @@ void Creature::AllLootRemovedFromCorpse()
m_respawnTime = std::max<time_t>(m_corpseRemoveTime + m_respawnDelay, m_respawnTime);
}
+void Creature::SetInteractionAllowedWhileHostile(bool interactionAllowed)
+{
+ _staticFlags.ApplyFlag(CREATURE_STATIC_FLAG_5_INTERACT_WHILE_HOSTILE, interactionAllowed);
+ Unit::SetInteractionAllowedWhileHostile(interactionAllowed);
+}
+
+void Creature::SetInteractionAllowedInCombat(bool interactionAllowed)
+{
+ _staticFlags.ApplyFlag(CREATURE_STATIC_FLAG_3_ALLOW_INTERACTION_WHILE_IN_COMBAT, interactionAllowed);
+ Unit::SetInteractionAllowedInCombat(interactionAllowed);
+}
+
+void Creature::UpdateNearbyPlayersInteractions()
+{
+ Unit::UpdateNearbyPlayersInteractions();
+
+ // If as a result of npcflag updates we stop seeing UNIT_NPC_FLAG_QUESTGIVER then
+ // we must also send SMSG_QUEST_GIVER_STATUS_MULTIPLE because client will not request it automatically
+ if (IsQuestGiver())
+ {
+ auto sender = [&](Player const* receiver)
+ {
+ receiver->PlayerTalkClass->SendQuestGiverStatus(receiver->GetQuestDialogStatus(this), GetGUID());
+ };
+ Trinity::MessageDistDeliverer notifier(this, sender, GetVisibilityRange());
+ Cell::VisitWorldObjects(this, notifier, GetVisibilityRange());
+ }
+}
+
bool Creature::HasScalableLevels() const
{
return m_unitData->ContentTuningID != 0;
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 01a8bcfe477..723b58afeb4 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -183,6 +183,10 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
bool IsElite() const;
bool isWorldBoss() const;
+ void SetInteractionAllowedWhileHostile(bool interactionAllowed) override;
+ void SetInteractionAllowedInCombat(bool interactionAllowed) override;
+ void UpdateNearbyPlayersInteractions() override;
+
bool HasScalableLevels() const;
void ApplyLevelScaling();
uint8 GetLevelForTarget(WorldObject const* target) const override;
diff --git a/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp b/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
index c04e7cedd5b..643622e90ed 100644
--- a/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
+++ b/src/server/game/Entities/Creature/enuminfo_CreatureData.cpp
@@ -40,7 +40,7 @@ TC_API_EXPORT EnumText EnumUtils<CreatureFlagsExtra>::ToString(CreatureFlagsExtr
case CREATURE_FLAG_EXTRA_NO_XP: return { "CREATURE_FLAG_EXTRA_NO_XP", "CREATURE_FLAG_EXTRA_NO_XP", "creature kill does not provide XP" };
case CREATURE_FLAG_EXTRA_TRIGGER: return { "CREATURE_FLAG_EXTRA_TRIGGER", "CREATURE_FLAG_EXTRA_TRIGGER", "trigger creature" };
case CREATURE_FLAG_EXTRA_NO_TAUNT: return { "CREATURE_FLAG_EXTRA_NO_TAUNT", "CREATURE_FLAG_EXTRA_NO_TAUNT", "creature is immune to taunt auras and 'attack me' effects" };
- case CREATURE_FLAG_EXTRA_UNUSED_9: return { "CREATURE_FLAG_EXTRA_UNUSED_9", "CREATURE_FLAG_EXTRA_UNUSED_9", "creature won't update movement flags" };
+ case CREATURE_FLAG_EXTRA_UNUSED_9: return { "CREATURE_FLAG_EXTRA_UNUSED_9", "CREATURE_FLAG_EXTRA_UNUSED_9", "" };
case CREATURE_FLAG_EXTRA_GHOST_VISIBILITY: return { "CREATURE_FLAG_EXTRA_GHOST_VISIBILITY", "CREATURE_FLAG_EXTRA_GHOST_VISIBILITY", "creature will only be visible to dead players" };
case CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK: return { "CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK", "CREATURE_FLAG_EXTRA_USE_OFFHAND_ATTACK", "creature will use offhand attacks" };
case CREATURE_FLAG_EXTRA_NO_SELL_VENDOR: return { "CREATURE_FLAG_EXTRA_NO_SELL_VENDOR", "CREATURE_FLAG_EXTRA_NO_SELL_VENDOR", "players can't sell items to this vendor" };
diff --git a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
index b6c3c61bb6a..f6d7d1876b0 100644
--- a/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
+++ b/src/server/game/Entities/Object/Updates/ViewerDependentValues.h
@@ -326,15 +326,21 @@ public:
static value_type GetValue(UF::UnitData const* unitData, uint32 i, Unit const* unit, Player const* receiver)
{
value_type npcFlag = unitData->NpcFlags[i];
- if (i == 0)
+ if (npcFlag)
{
- if (Creature const* creature = unit->ToCreature())
+ if ((!unit->IsInteractionAllowedInCombat() && unit->IsInCombat())
+ || (!unit->IsInteractionAllowedWhileHostile() && unit->IsHostileTo(receiver)))
+ npcFlag = 0;
+ else if (Creature const* creature = unit->ToCreature())
{
- if (!receiver->CanSeeGossipOn(creature))
- npcFlag &= ~(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
+ if (i == 0)
+ {
+ if (!receiver->CanSeeGossipOn(creature))
+ npcFlag &= ~(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
- if (!receiver->CanSeeSpellClickOn(creature))
- npcFlag &= ~UNIT_NPC_FLAG_SPELLCLICK;
+ if (!receiver->CanSeeSpellClickOn(creature))
+ npcFlag &= ~UNIT_NPC_FLAG_SPELLCLICK;
+ }
}
}
return npcFlag;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 56ddc31a2b7..cbe9326ce91 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -1986,7 +1986,10 @@ Creature* Player::GetNPCIfCanInteractWith(ObjectGuid const& guid, NPCFlags npcFl
return nullptr;
// not unfriendly/hostile
- if (!creature->HasUnitFlag2(UNIT_FLAG2_INTERACT_WHILE_HOSTILE) && creature->GetReactionTo(this) <= REP_UNFRIENDLY)
+ if (!creature->IsInteractionAllowedWhileHostile() && creature->GetReactionTo(this) <= REP_UNFRIENDLY)
+ return nullptr;
+
+ if (creature->IsInCombat() && !creature->IsInteractionAllowedInCombat())
return nullptr;
// not too far, taken from CGGameUI::SetInteractTarget
@@ -16188,6 +16191,13 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object const* questgiver) const
}
case TYPEID_UNIT:
{
+ Creature const* questGiverCreature = questgiver->ToCreature();
+ if (!questGiverCreature->IsInteractionAllowedWhileHostile() && questGiverCreature->IsHostileTo(this))
+ return QuestGiverStatus::None;
+
+ if (!questGiverCreature->IsInteractionAllowedInCombat() && questGiverCreature->IsInCombat())
+ return QuestGiverStatus::None;
+
if (CreatureAI* ai = questgiver->ToCreature()->AI())
if (Optional<QuestGiverStatus> questStatus = ai->GetDialogStatus(this))
return *questStatus;
@@ -17341,7 +17351,7 @@ void Player::SendQuestGiverStatusMultiple(GuidUnorderedSet const& guids)
{
// need also pet quests case support
Creature* questgiver = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, *itr);
- if (!questgiver || questgiver->IsHostileTo(this))
+ if (!questgiver)
continue;
if (!questgiver->HasNpcFlag(UNIT_NPC_FLAG_QUESTGIVER))
continue;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 45252511720..8639c8e458b 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -8648,6 +8648,9 @@ void Unit::AtEnterCombat()
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::EnteringCombat);
Unit::ProcSkillsAndAuras(this, nullptr, PROC_FLAG_ENTER_COMBAT, PROC_FLAG_NONE, PROC_SPELL_TYPE_MASK_ALL, PROC_SPELL_PHASE_NONE, PROC_HIT_NONE, nullptr, nullptr, nullptr);
+
+ if (!IsInteractionAllowedInCombat())
+ UpdateNearbyPlayersInteractions();
}
void Unit::AtExitCombat()
@@ -8661,6 +8664,9 @@ void Unit::AtExitCombat()
}
RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::LeavingCombat);
+
+ if (!IsInteractionAllowedInCombat())
+ UpdateNearbyPlayersInteractions();
}
void Unit::AtTargetAttacked(Unit* target, bool canInitialAggro)
@@ -8699,6 +8705,34 @@ void Unit::UpdatePetCombatState()
RemoveUnitFlag(UNIT_FLAG_PET_IN_COMBAT);
}
+void Unit::SetInteractionAllowedWhileHostile(bool interactionAllowed)
+{
+ if (interactionAllowed)
+ SetUnitFlag2(UNIT_FLAG2_INTERACT_WHILE_HOSTILE);
+ else
+ RemoveUnitFlag2(UNIT_FLAG2_INTERACT_WHILE_HOSTILE);
+
+ UpdateNearbyPlayersInteractions();
+}
+
+void Unit::SetInteractionAllowedInCombat(bool interactionAllowed)
+{
+ if (interactionAllowed)
+ SetUnitFlag3(UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT);
+ else
+ RemoveUnitFlag3(UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT);
+
+ if (IsInCombat())
+ UpdateNearbyPlayersInteractions();
+}
+
+void Unit::UpdateNearbyPlayersInteractions()
+{
+ for (uint32 i = 0; i < m_unitData->NpcFlags.size(); ++i)
+ if (m_unitData->NpcFlags[i])
+ ForceUpdateFieldChange(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::NpcFlags, i));
+}
+
//======================================================================
DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) const
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 18eabd6f75f..47be2b81751 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1040,6 +1040,15 @@ class TC_GAME_API Unit : public WorldObject
void SetInCombatWith(Unit* enemy, bool addSecondUnitSuppressed = false) { if (enemy) m_combatManager.SetInCombatWith(enemy, addSecondUnitSuppressed); }
void ClearInCombat() { m_combatManager.EndAllCombat(); }
void UpdatePetCombatState();
+
+ bool IsInteractionAllowedWhileHostile() const { return HasUnitFlag2(UNIT_FLAG2_INTERACT_WHILE_HOSTILE); }
+ virtual void SetInteractionAllowedWhileHostile(bool interactionAllowed);
+
+ bool IsInteractionAllowedInCombat() const { return HasUnitFlag3(UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT); }
+ virtual void SetInteractionAllowedInCombat(bool interactionAllowed);
+
+ virtual void UpdateNearbyPlayersInteractions();
+
// Threat handling
bool IsThreatened() const;
bool IsThreatenedBy(Unit const* who) const { return who && m_threatManager.IsThreatenedBy(who, true); }
diff --git a/src/server/game/Entities/Unit/UnitDefines.h b/src/server/game/Entities/Unit/UnitDefines.h
index c675a39bd06..c65d0fb13d1 100644
--- a/src/server/game/Entities/Unit/UnitDefines.h
+++ b/src/server/game/Entities/Unit/UnitDefines.h
@@ -263,7 +263,7 @@ enum UnitFlags3 : uint32
UNIT_FLAG3_ALREADY_SKINNED = 0x00020000,
UNIT_FLAG3_SUPPRESS_ALL_NPC_SOUNDS = 0x00040000, // TITLE Suppress all NPC sounds DESCRIPTION Skips playing sounds on beginning and end of npc interaction for all npcs as long as npc with this flag is visible
UNIT_FLAG3_SUPPRESS_NPC_SOUNDS = 0x00080000, // TITLE Suppress NPC sounds DESCRIPTION Skips playing sounds on beginning and end of npc interaction
- UNIT_FLAG3_UNK20 = 0x00100000,
+ UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT = 0x00100000, // TITLE Allow Interaction While in Combat DESCRIPTION Allows using various NPC functions while in combat (vendor, gossip, questgiver)
UNIT_FLAG3_UNK21 = 0x00200000,
UNIT_FLAG3_DONT_FADE_OUT = 0x00400000,
UNIT_FLAG3_UNK23 = 0x00800000,
@@ -281,7 +281,7 @@ enum UnitFlags3 : uint32
UNIT_FLAG3_IGNORE_COMBAT | UNIT_FLAG3_SUPPRESS_NPC_FEEDBACK | UNIT_FLAG3_UNK10 | UNIT_FLAG3_UNK11 |
UNIT_FLAG3_UNK12 | /* UNIT_FLAG3_FAKE_DEAD | */ /* UNIT_FLAG3_NO_FACING_ON_INTERACT_AND_FAST_FACING_CHASE | */ /* UNIT_FLAG3_UNTARGETABLE_FROM_UI | */
/* UNIT_FLAG3_NO_FACING_ON_INTERACT_WHILE_FAKE_DEAD | */ UNIT_FLAG3_ALREADY_SKINNED | /* UNIT_FLAG3_SUPPRESS_ALL_NPC_SOUNDS | */ /* UNIT_FLAG3_SUPPRESS_NPC_SOUNDS | */
- UNIT_FLAG3_UNK20 | UNIT_FLAG3_UNK21 | /* UNIT_FLAG3_DONT_FADE_OUT | */ UNIT_FLAG3_UNK23 |
+ UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT | UNIT_FLAG3_UNK21 | /* UNIT_FLAG3_DONT_FADE_OUT | */ UNIT_FLAG3_UNK23 |
/* UNIT_FLAG3_FORCE_HIDE_NAMEPLATE | */ UNIT_FLAG3_UNK25 | UNIT_FLAG3_UNK26 | UNIT_FLAG3_UNK27 |
UNIT_FLAG3_UNK28 | UNIT_FLAG3_UNK29 | UNIT_FLAG3_UNK30 | UNIT_FLAG3_UNK31), // SKIP
UNIT_FLAG3_ALLOWED = (0xFFFFFFFF & ~UNIT_FLAG3_DISALLOWED) // SKIP
diff --git a/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp b/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp
index e904b8c1461..3979882e32c 100644
--- a/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp
+++ b/src/server/game/Entities/Unit/enuminfo_UnitDefines.cpp
@@ -309,7 +309,7 @@ TC_API_EXPORT EnumText EnumUtils<UnitFlags3>::ToString(UnitFlags3 value)
case UNIT_FLAG3_ALREADY_SKINNED: return { "UNIT_FLAG3_ALREADY_SKINNED", "UNIT_FLAG3_ALREADY_SKINNED", "" };
case UNIT_FLAG3_SUPPRESS_ALL_NPC_SOUNDS: return { "UNIT_FLAG3_SUPPRESS_ALL_NPC_SOUNDS", "Suppress all NPC sounds", "Skips playing sounds on beginning and end of npc interaction for all npcs as long as npc with this flag is visible" };
case UNIT_FLAG3_SUPPRESS_NPC_SOUNDS: return { "UNIT_FLAG3_SUPPRESS_NPC_SOUNDS", "Suppress NPC sounds", "Skips playing sounds on beginning and end of npc interaction" };
- case UNIT_FLAG3_UNK20: return { "UNIT_FLAG3_UNK20", "UNIT_FLAG3_UNK20", "" };
+ case UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT: return { "UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT", "Allow Interaction While in Combat", "Allows using various NPC functions while in combat (vendor, gossip, questgiver)" };
case UNIT_FLAG3_UNK21: return { "UNIT_FLAG3_UNK21", "UNIT_FLAG3_UNK21", "" };
case UNIT_FLAG3_DONT_FADE_OUT: return { "UNIT_FLAG3_DONT_FADE_OUT", "UNIT_FLAG3_DONT_FADE_OUT", "" };
case UNIT_FLAG3_UNK23: return { "UNIT_FLAG3_UNK23", "UNIT_FLAG3_UNK23", "" };
@@ -353,7 +353,7 @@ TC_API_EXPORT UnitFlags3 EnumUtils<UnitFlags3>::FromIndex(size_t index)
case 17: return UNIT_FLAG3_ALREADY_SKINNED;
case 18: return UNIT_FLAG3_SUPPRESS_ALL_NPC_SOUNDS;
case 19: return UNIT_FLAG3_SUPPRESS_NPC_SOUNDS;
- case 20: return UNIT_FLAG3_UNK20;
+ case 20: return UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT;
case 21: return UNIT_FLAG3_UNK21;
case 22: return UNIT_FLAG3_DONT_FADE_OUT;
case 23: return UNIT_FLAG3_UNK23;
@@ -394,7 +394,7 @@ TC_API_EXPORT size_t EnumUtils<UnitFlags3>::ToIndex(UnitFlags3 value)
case UNIT_FLAG3_ALREADY_SKINNED: return 17;
case UNIT_FLAG3_SUPPRESS_ALL_NPC_SOUNDS: return 18;
case UNIT_FLAG3_SUPPRESS_NPC_SOUNDS: return 19;
- case UNIT_FLAG3_UNK20: return 20;
+ case UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT: return 20;
case UNIT_FLAG3_UNK21: return 21;
case UNIT_FLAG3_DONT_FADE_OUT: return 22;
case UNIT_FLAG3_UNK23: return 23;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 53ea653ca73..b73b2977a69 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -1646,10 +1646,17 @@ void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cInfo, uint64* npcFl
*unitFlags2 = ChooseCreatureFlagSource(unit_flags2);
if (staticFlags.HasFlag(CREATURE_STATIC_FLAG_3_CANNOT_TURN))
*unitFlags2 |= UNIT_FLAG2_CANNOT_TURN;
+
+ if (staticFlags.HasFlag(CREATURE_STATIC_FLAG_5_INTERACT_WHILE_HOSTILE))
+ *unitFlags2 |= UNIT_FLAG2_INTERACT_WHILE_HOSTILE;
}
if (unitFlags3)
+ {
*unitFlags3 = ChooseCreatureFlagSource(unit_flags3);
+ if (staticFlags.HasFlag(CREATURE_STATIC_FLAG_3_ALLOW_INTERACTION_WHILE_IN_COMBAT))
+ *unitFlags3 |= UNIT_FLAG3_ALLOW_INTERACTION_WHILE_IN_COMBAT;
+ }
#undef ChooseCreatureFlagSource
}
diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp
index e98b85608aa..04b6792ba7f 100644
--- a/src/server/game/Handlers/QuestHandler.cpp
+++ b/src/server/game/Handlers/QuestHandler.cpp
@@ -40,7 +40,6 @@
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPackets::Quest::QuestGiverStatusQuery& packet)
{
- QuestGiverStatus questStatus = QuestGiverStatus::None;
Object* questGiver = ObjectAccessor::GetObjectByTypeMask(*_player, packet.QuestGiverGUID, TYPEMASK_UNIT | TYPEMASK_GAMEOBJECT);
if (!questGiver)
@@ -49,25 +48,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPackets::Quest::QuestG
return;
}
- switch (questGiver->GetTypeId())
- {
- case TYPEID_UNIT:
- {
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for npc {}", questGiver->GetGUID().ToString());
- if (!questGiver->ToCreature()->IsHostileTo(_player)) // do not show quest status to enemies
- questStatus = _player->GetQuestDialogStatus(questGiver);
- break;
- }
- case TYPEID_GAMEOBJECT:
- {
- TC_LOG_DEBUG("network", "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject {}", questGiver->GetGUID().ToString());
- questStatus = _player->GetQuestDialogStatus(questGiver);
- break;
- }
- default:
- TC_LOG_ERROR("network", "QuestGiver called for unexpected type {}", questGiver->GetTypeId());
- break;
- }
+ QuestGiverStatus questStatus = _player->GetQuestDialogStatus(questGiver);
//inform client about status of quest
_player->PlayerTalkClass->SendQuestGiverStatus(questStatus, packet.QuestGiverGUID);
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sister_svalna.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sister_svalna.cpp
index 2d7cfc810f1..075efea3abf 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sister_svalna.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sister_svalna.cpp
@@ -457,7 +457,7 @@ struct boss_sister_svalna : public BossAI
CastSpellExtraArgs args;
args.AddSpellBP0(1);
summon->CastSpell(target, VEHICLE_SPELL_RIDE_HARDCODED, args);
- summon->SetUnitFlag2(UNIT_FLAG2_INTERACT_WHILE_HOSTILE);
+ summon->SetInteractionAllowedWhileHostile(true);
}
break;
default: