Skip to content

Commit 6a0e389

Browse files
Merge AzerothCore 3.3.5 to ElunaAzerothcore [skip ci]
2 parents 17faac3 + 881fbbb commit 6a0e389

11 files changed

Lines changed: 165 additions & 62 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
-- DB update 2026_04_05_03 -> 2026_04_10_00
2+
3+
-- Edit Actionlists
4+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2840600) AND (`source_type` = 9) AND (`id` IN (0, 1, 2, 4, 5, 8, 9));
5+
INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
6+
(2840600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 54238, 0, 0, 0, 0, 0, 12, 12, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Cast \'Duel Aura Check 01\''),
7+
(2840600, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 11, 52991, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Cast \'Duel Flag\''),
8+
(2840600, 9, 2, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Say Line 0'),
9+
(2840600, 9, 4, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Say Line 1'),
10+
(2840600, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Say Line 2'),
11+
(2840600, 9, 8, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Set Event Phase 2'),
12+
(2840600, 9, 9, 0, 0, 0, 100, 0, 500, 500, 0, 0, 0, 0, 42, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Set Invincibility Hp 1%');
13+
14+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2840601) AND (`source_type` = 9) AND (`id` IN (7, 8));
15+
INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
16+
(2840601, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Enable Evade'),
17+
(2840601, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Despawn Instant');
18+
19+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2840602) AND (`source_type` = 9) AND (`id` IN (5, 6));
20+
INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
21+
(2840602, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Enable Evade'),
22+
(2840602, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Despawn Instant');
23+
24+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 2840611) AND (`source_type` = 9) AND (`id` IN (7, 8));
25+
INSERT INTO `smart_scripts` (`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`, `comment`) VALUES
26+
(2840611, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 0, 0, 117, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Enable Evade'),
27+
(2840611, 9, 8, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Death Knight Initiate - Actionlist - Despawn Instant');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- DB update 2026_04_10_00 -> 2026_04_10_01
2+
--
3+
UPDATE `creature_template_addon` SET `auras` = '70203' WHERE `entry` IN (37126, 38258);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- DB update 2026_04_10_01 -> 2026_04_10_02
2+
3+
-- Update Conditions (Death Knight Initiate)
4+
UPDATE `conditions` SET `SourceTypeOrReferenceId` = 20, `SourceGroup` = 0, `SourceEntry` = 28406 WHERE (`SourceTypeOrReferenceId` = 15) AND (`SourceGroup` = 9765) AND (`SourceEntry` = 0) AND (`SourceId` = 0) AND (`ElseGroup` = 0) AND (`ConditionTypeOrReference` IN (1, 47)) AND (`ConditionTarget` = 0) AND (`ConditionValue1` IN (12733, 54238)) AND (`ConditionValue2` IN (0, 8)) AND (`ConditionValue3` = 0);

src/server/game/Conditions/ConditionMgr.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, Con
974974
bool ConditionMgr::CanHaveSourceGroupSet(ConditionSourceType sourceType) const
975975
{
976976
return (sourceType == CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE ||
977-
sourceType == CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION || sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL ||
977+
sourceType == CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION || sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_HELLO ||
978978
sourceType == CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET || sourceType == CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT || sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT || sourceType == CONDITION_SOURCE_TYPE_NPC_VENDOR || sourceType == CONDITION_SOURCE_TYPE_PLAYER_LOOT_TEMPLATE);
979979
}
980980

@@ -1808,9 +1808,15 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
18081808
return false;
18091809
}
18101810
break;
1811-
case CONDITION_SOURCE_TYPE_UNUSED_20:
1812-
LOG_ERROR("sql.sql", "CONDITION_SOURCE_TYPE_UNUSED_20 is not in use. SourceEntry = ({}), skipped", cond->SourceEntry);
1811+
case CONDITION_SOURCE_TYPE_GOSSIP_HELLO:
1812+
{
1813+
if (!sObjectMgr->GetCreatureTemplate(cond->SourceEntry))
1814+
{
1815+
LOG_ERROR("sql.sql", "CONDITION_SOURCE_TYPE_GOSSIP_HELLO: creature entry {} in `condition` table does not exist in `creature_template`, ignoring.", cond->SourceEntry);
1816+
return false;
1817+
}
18131818
break;
1819+
}
18141820
case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
18151821
case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT:
18161822
if (!sObjectMgr->GetCreatureTemplate(cond->SourceGroup))

src/server/game/Conditions/ConditionMgr.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ enum ConditionSourceType
142142
CONDITION_SOURCE_TYPE_SPELL = 17,
143143
CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT = 18,
144144
CONDITION_SOURCE_TYPE_QUEST_AVAILABLE = 19,
145-
CONDITION_SOURCE_TYPE_UNUSED_20 = 20, // placeholder
145+
CONDITION_SOURCE_TYPE_GOSSIP_HELLO = 20,
146146
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,
147147
CONDITION_SOURCE_TYPE_SMART_EVENT = 22,
148148
CONDITION_SOURCE_TYPE_NPC_VENDOR = 23,

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 48 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
#include "WorldPacket.h"
7575
#include <algorithm>
7676
#include <cmath>
77+
#include <limits>
7778

7879
float baseMoveSpeed[MAX_MOVE_TYPE] =
7980
{
@@ -910,6 +911,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, uint32 effectMask, Unit
910911
if (!spellInfo)
911912
return false;
912913

914+
if (spellInfo->HasAttribute(SPELL_ATTR0_NO_IMMUNITIES) && !HasSpiritOfRedemptionAura())
915+
return false;
916+
913917
bool immuneToAllEffects = true;
914918
bool hasCheckedEffect = false;
915919

@@ -940,8 +944,28 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, uint32 effectMask, Unit
940944

941945
if (!spellInfo->HasAttribute(SPELL_ATTR2_NO_SCHOOL_IMMUNITIES))
942946
{
943-
if (IsImmunedToSchool(spellInfo))
944-
return true;
947+
if (spellInfo->Id == 42292 || spellInfo->Id == 59752 || spellInfo->Id == 19574 || spellInfo->Id == 34471)
948+
return false;
949+
950+
SpellSchoolMask schoolMask = spellInfo->GetSchoolMask();
951+
if (schoolMask != SPELL_SCHOOL_MASK_NONE)
952+
{
953+
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
954+
for (auto const& [immunitySchoolMask, immunityAuraId] : schoolList)
955+
{
956+
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(immunityAuraId);
957+
if ((immunitySchoolMask & schoolMask) != schoolMask)
958+
continue;
959+
960+
if (IgnoresSchoolImmunityFromFriendlyCaster(caster, immunityAuraId, immuneSpellInfo))
961+
continue;
962+
963+
if (spellInfo->CanPierceImmuneAura(immuneSpellInfo))
964+
continue;
965+
966+
return true;
967+
}
968+
}
945969
}
946970

947971
return false;
@@ -9810,6 +9834,18 @@ uint32 Unit::GetDamageImmunityMask() const
98109834
return mask;
98119835
}
98129836

9837+
bool Unit::IgnoresSchoolImmunityFromFriendlyCaster(Unit const* caster, uint32 immunityAuraId, SpellInfo const* immunitySpellInfo) const
9838+
{
9839+
if (!caster || !caster->IsFriendlyTo(this))
9840+
return false;
9841+
9842+
if (immunitySpellInfo)
9843+
return !immunitySpellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS);
9844+
9845+
// Creature template immunities are loaded with a placeholder spell id.
9846+
return immunityAuraId == std::numeric_limits<uint32>::max();
9847+
}
9848+
98139849
bool Unit::IsImmunedToDamage(SpellSchoolMask schoolMask) const
98149850
{
98159851
if (schoolMask == SPELL_SCHOOL_MASK_NONE)
@@ -9847,7 +9883,7 @@ bool Unit::IsImmunedToDamage(Unit const* caster, SpellInfo const* spellInfo) con
98479883
for (auto const& [immunitySchoolMask, immunityAuraId] : container)
98489884
{
98499885
SpellInfo const* immuneAuraInfo = sSpellMgr->GetSpellInfo(immunityAuraId);
9850-
if (immuneAuraInfo && !immuneAuraInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) && caster && caster->IsFriendlyTo(this))
9886+
if (IgnoresSchoolImmunityFromFriendlyCaster(caster, immunityAuraId, immuneAuraInfo))
98519887
continue;
98529888

98539889
if (immuneAuraInfo && spellInfo->CanPierceImmuneAura(immuneAuraInfo))
@@ -9928,7 +9964,10 @@ bool Unit::IsImmunedToSchool(Spell const* spell) const
99289964
SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
99299965
for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
99309966
{
9931-
if ((itr->first & schoolMask) == schoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->second)))
9967+
SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
9968+
if ((itr->first & schoolMask) == schoolMask
9969+
&& !IgnoresSchoolImmunityFromFriendlyCaster(spell->GetCaster(), itr->second, immuneSpellInfo)
9970+
&& !spellInfo->CanPierceImmuneAura(immuneSpellInfo))
99329971
{
99339972
return true;
99349973
}
@@ -9966,7 +10005,7 @@ bool Unit::IsImmunedToAuraPeriodicTick(Unit const* caster, SpellInfo const* spel
996610005
for (auto const& [immunitySchoolMask, immunityAuraId] : container)
996710006
{
996810007
SpellInfo const* immuneAuraInfo = sSpellMgr->GetSpellInfo(immunityAuraId);
9969-
if (immuneAuraInfo && !immuneAuraInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS) && caster && caster->IsFriendlyTo(this))
10008+
if (IgnoresSchoolImmunityFromFriendlyCaster(caster, immunityAuraId, immuneAuraInfo))
997010009
continue;
997110010

997210011
schoolImmunityMask |= immunitySchoolMask;
@@ -10045,6 +10084,7 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
1004510084
if (!spellInfo->HasAttribute(SPELL_ATTR2_NO_SCHOOL_IMMUNITIES))
1004610085
{
1004710086
SpellSchoolMask spellSchoolMask = spellInfo->GetSchoolMask();
10087+
Unit const* spellCaster = spell ? spell->GetCaster() : nullptr;
1004810088
if (spell)
1004910089
{
1005010090
spellSchoolMask = spell->GetSpellSchoolMask();
@@ -10059,12 +10099,8 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
1005910099
if (!(itr->first & spellSchoolMask))
1006010100
continue;
1006110101

10062-
if (immuneSpellInfo && !immuneSpellInfo->HasAttribute(SPELL_ATTR1_IMMUNITY_TO_HOSTILE_AND_FRIENDLY_EFFECTS))
10063-
{
10064-
Unit const* spellCaster = spell ? spell->GetCaster() : nullptr;
10065-
if (spellCaster && spellCaster->IsFriendlyTo(this))
10066-
continue;
10067-
}
10102+
if (IgnoresSchoolImmunityFromFriendlyCaster(spellCaster, itr->second, immuneSpellInfo))
10103+
continue;
1006810104

1006910105
if (spellInfo->CanPierceImmuneAura(immuneSpellInfo))
1007010106
continue;
@@ -15109,7 +15145,7 @@ Aura* Unit::AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target)
1510915145
if (!spellInfo)
1511015146
return nullptr;
1511115147

15112-
if (target->IsImmunedToSpell(spellInfo))
15148+
if (target->IsImmunedToSpell(spellInfo, effMask, this))
1511315149
return nullptr;
1511415150

1511515151
for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i)

src/server/game/Entities/Unit/Unit.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,7 @@ class Unit : public WorldObject
16381638
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply, SpellImmuneBlockType blockType = SPELL_BLOCK_TYPE_ALL);
16391639
virtual bool IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell = nullptr);
16401640
bool IsImmunedToSpell(SpellInfo const* spellInfo, uint32 effectMask, Unit const* caster = nullptr);
1641+
bool IgnoresSchoolImmunityFromFriendlyCaster(Unit const* caster, uint32 immunityAuraId, SpellInfo const* immunitySpellInfo) const;
16411642
[[nodiscard]] bool IsImmunedToDamage(SpellSchoolMask schoolMask) const;
16421643
[[nodiscard]] bool IsImmunedToDamage(Unit const* caster, SpellInfo const* spellInfo) const;
16431644
[[nodiscard]] bool IsImmunedToSchool(SpellSchoolMask schoolMask) const;

src/server/game/Handlers/NPCHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
*/
1717

1818
#include "Battleground.h"
19+
#include "ConditionMgr.h"
1920
#include "BattlegroundMgr.h"
2021
#include "Creature.h"
2122
#include "DatabaseEnv.h"
@@ -153,6 +154,11 @@ void WorldSession::HandleGossipHelloOpcode(WorldPacket& recvData)
153154
if (unit->GetNpcFlags() == UNIT_NPC_FLAG_NONE)
154155
return;
155156

157+
// Check GossipHello conditions - block gossip opening if conditions not met
158+
ConditionList gossipConditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_GOSSIP_HELLO, unit->GetEntry());
159+
if (!sConditionMgr->IsObjectMeetToConditions(_player, unit, gossipConditions))
160+
return;
161+
156162
// set faction visible if needed
157163
if (FactionTemplateEntry const* factionTemplateEntry = sFactionTemplateStore.LookupEntry(unit->GetFaction()))
158164
_player->GetReputationMgr().SetVisible(factionTemplateEntry);

0 commit comments

Comments
 (0)