Skip to content

Commit f4166f6

Browse files
Merge branch 'master' into dbc_db
2 parents deed156 + 9ef4607 commit f4166f6

File tree

28 files changed

+156
-93
lines changed

28 files changed

+156
-93
lines changed

data/sql/updates/pending_db_world/rev_1774448216705690901.sql renamed to data/sql/updates/db_world/2026_04_05_01.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
-- DB update 2026_04_05_00 -> 2026_04_05_01
12
--
23
-- Alexstrasza the Life-Binder (Dragonblight) - Add Focusing Iris key menu_option. (Previously empty)
34
DELETE FROM `gossip_menu_option` WHERE `MenuID` = 10192;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- DB update 2026_04_05_01 -> 2026_04_05_02
2+
-- Fix quest The Dread Relic
3+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 22369) AND (`source_type` = 0);
4+
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
5+
(22369, 0, 0, 1, 54, 0, 100, 1, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dread Relic Thrall - On Just Summoned - Set Passive'),
6+
(22369, 0, 1, 0, 61, 0, 100, 1, 0, 0, 0, 0, 0, 0, 67, 1, 10000, 10000, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dread Relic Thrall - On Just Summoned - Create Timed Event'),
7+
(22369, 0, 2, 3, 59, 0, 100, 1, 1, 0, 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Dread Relic Thrall - Timed Event - Set Aggressive'),
8+
(22369, 0, 3, 0, 61, 0, 100, 1, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 'Dread Relic Thrall - Timed Event - Attack Summoner'),
9+
(22369, 0, 4, 0, 4, 0, 100, 4, 0, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 11, 22369, 10, 0, 0, 0, 0, 0, 0, 'Dread Relic Thrall - On Aggro - Set Data');
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
-- DB update 2026_04_05_02 -> 2026_04_05_03
2+
-- Primal Ooze (6557)
3+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 6557) AND (`source_type` = 0);
4+
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
5+
(6557, 0, 0, 0, 8, 0, 100, 512, 16031, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - On Spellhit 16031 (Releasing Corrupt Ooze) - Set Event Phase 2'),
6+
(6557, 0, 1, 0, 8, 0, 100, 513, 15702, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - On Spellhit 15702 (Filling Empty Jar) - Despawn'),
7+
(6557, 0, 2, 0, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 11, 14146, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - Between 0-30% Health - Cast Clone (No Repeat)'),
8+
(6557, 0, 3, 0, 2, 0, 100, 1, 0, 30, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - Between 0-30% Health - Say Line 0 (No Repeat)'),
9+
(6557, 0, 4, 5, 75, 2, 100, 513, 0, 10290, 3, 1000, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - Phase 2 - On Distance Creature 10290 within 3yd - Set Visibility Off'),
10+
(6557, 0, 5, 6, 61, 2, 100, 513, 0, 0, 0, 0, 0, 0, 12, 9621, 6, 20000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - Phase 2 (Link) - Summon Gargantuan Ooze'),
11+
(6557, 0, 6, 7, 61, 2, 100, 513, 0, 0, 0, 0, 0, 0, 11, 16032, 0, 0, 0, 0, 0, 9, 9621, 0, 10, 0, 0, 0, 0, 0, 'Primal Ooze - Phase 2 (Link) - Cast Merging Oozes on Gargantuan Ooze'),
12+
(6557, 0, 7, 0, 61, 2, 100, 513, 0, 0, 0, 0, 0, 0, 41, 50, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Primal Ooze - Phase 2 (Link) - Despawn In 50ms');
13+
14+
-- Captured Felwood Ooze (10290)
15+
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 10290) AND (`source_type` = 0);
16+
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
17+
(10290, 0, 0, 0, 54, 0, 100, 513, 0, 0, 0, 0, 0, 0, 29, 0, 0, 1, 0, 1, 0, 9, 6557, 0, 50, 0, 0, 0, 0, 0, 'Captured Felwood Ooze - On Just Summoned - Start Follow Closest Primal Ooze'),
18+
(10290, 0, 1, 2, 75, 0, 100, 513, 0, 6557, 3, 500, 0, 0, 47, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Felwood Ooze - Within 3yd of Primal Ooze - Set Visibility Off'),
19+
(10290, 0, 2, 0, 61, 0, 100, 513, 0, 0, 0, 0, 0, 0, 41, 500, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Captured Felwood Ooze - Within 3yd (Link) - Despawn In 500ms');

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,7 +2224,7 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
22242224

22252225
// Xinef: this should exclude self casts...
22262226
// Spells that don't have effectMechanics.
2227-
if (spellInfo->Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(UI64LIT(1) << spellInfo->Mechanic))
2227+
if (spellInfo->Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(1ULL << spellInfo->Mechanic))
22282228
return true;
22292229

22302230
// The above helper uses the creature_immunities table rather than a
@@ -2247,7 +2247,7 @@ bool Creature::IsImmunedToSpell(SpellInfo const* spellInfo, Spell const* spell)
22472247
bool Creature::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index, Unit const* caster /*= nullptr*/) const
22482248
{
22492249
// Xinef: this should exclude self casts...
2250-
if (spellInfo->Effects[index].Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(UI64LIT(1) << spellInfo->Effects[index].Mechanic))
2250+
if (spellInfo->Effects[index].Mechanic > MECHANIC_NONE && HasMechanicTemplateImmunity(1ULL << spellInfo->Effects[index].Mechanic))
22512251
return true;
22522252

22532253
if (GetCreatureTemplate()->type == CREATURE_TYPE_MECHANICAL && spellInfo->Effects[index].Effect == SPELL_EFFECT_HEAL)

src/server/game/Entities/Player/Player.cpp

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10389,24 +10389,39 @@ void Player::ContinueTaxiFlight()
1038910389

1039010390
TaxiPathNodeList const& nodeList = sTaxiPathNodesByPath[path];
1039110391

10392-
float bestDist = SIZE_OF_GRIDS * SIZE_OF_GRIDS; // xinef: large value
10393-
float currDist = 0.0f;
10392+
// Use triangle inequality to find the segment the player is on.
10393+
// When distPrev + distNext < distNodes, the player projects between
10394+
// the two nodes of the segment. Resume from the end node (i).
10395+
float distPrev;
10396+
float distNext =
10397+
(nodeList[0]->x - GetPositionX()) * (nodeList[0]->x - GetPositionX()) +
10398+
(nodeList[0]->y - GetPositionY()) * (nodeList[0]->y - GetPositionY()) +
10399+
(nodeList[0]->z - GetPositionZ()) * (nodeList[0]->z - GetPositionZ());
1039410400

10395-
// xinef: changed to -1, we dont want to catch last node
10396-
for (uint32 i = 0; i < nodeList.size() - 1; ++i)
10401+
for (uint32 i = 1; i < nodeList.size(); ++i)
1039710402
{
1039810403
TaxiPathNodeEntry const* node = nodeList[i];
10399-
TaxiPathNodeEntry const* nextNode = nodeList[i + 1];
10404+
TaxiPathNodeEntry const* prevNode = nodeList[i - 1];
1040010405

10401-
// xinef: skip nodes at another map, get last valid node on current map
10402-
if (nextNode->mapid != GetMapId() || node->mapid != GetMapId())
10406+
// skip nodes at another map
10407+
if (node->mapid != GetMapId())
1040310408
continue;
1040410409

10405-
currDist = (node->x - GetPositionX()) * (node->x - GetPositionX()) + (node->y - GetPositionY()) * (node->y - GetPositionY()) + (node->z - GetPositionZ()) * (node->z - GetPositionZ());
10406-
if (currDist < bestDist)
10410+
distPrev = distNext;
10411+
distNext =
10412+
(node->x - GetPositionX()) * (node->x - GetPositionX()) +
10413+
(node->y - GetPositionY()) * (node->y - GetPositionY()) +
10414+
(node->z - GetPositionZ()) * (node->z - GetPositionZ());
10415+
10416+
float distNodes =
10417+
(node->x - prevNode->x) * (node->x - prevNode->x) +
10418+
(node->y - prevNode->y) * (node->y - prevNode->y) +
10419+
(node->z - prevNode->z) * (node->z - prevNode->z);
10420+
10421+
if (distPrev + distNext < distNodes)
1040710422
{
1040810423
startNode = i;
10409-
bestDist = currDist;
10424+
break;
1041010425
}
1041110426
}
1041210427

src/server/game/Entities/Player/PlayerUpdates.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ void Player::UpdatePvPState()
14351435

14361436
if (pvpInfo.IsHostile) // in hostile area
14371437
{
1438-
if (IsInFlight()) // on taxi
1438+
if (IsInFlight() || !m_taxi.empty()) // on taxi or taxi pending resume after login
14391439
return;
14401440

14411441
if (!IsPvP() || pvpInfo.EndTimer != 0)

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ bool Unit::IsDamageReducedByArmor(SpellSchoolMask schoolMask, SpellInfo const* s
21942194
{
21952195
if (spellInfo->Effects[effIndex].ApplyAuraName == SPELL_AURA_PERIODIC_DAMAGE ||
21962196
spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_SCHOOL_DAMAGE)
2197-
if (spellInfo->GetEffectMechanicMask(effIndex) & (1 << MECHANIC_BLEED))
2197+
if (spellInfo->GetEffectMechanicMask(effIndex) & (1ULL << MECHANIC_BLEED))
21982198
return false;
21992199
}
22002200
}
@@ -5490,7 +5490,7 @@ void Unit::RemoveAurasWithFamily(SpellFamilyNames family, uint32 familyFlag1, ui
54905490
void Unit::RemoveMovementImpairingAuras(bool withRoot)
54915491
{
54925492
if (withRoot)
5493-
RemoveAurasWithMechanic(1 << MECHANIC_ROOT);
5493+
RemoveAurasWithMechanic(1ULL << MECHANIC_ROOT);
54945494

54955495
// Snares
54965496
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
@@ -5525,7 +5525,7 @@ void Unit::RemoveAurasWithMechanic(uint64 mechanic_mask, AuraRemoveMode removemo
55255525

55265526
void Unit::RemoveAurasByShapeShift()
55275527
{
5528-
uint64 mechanic_mask = (UI64LIT(1) << MECHANIC_SNARE) | (UI64LIT(1) << MECHANIC_ROOT);
5528+
uint64 mechanic_mask = (1ULL << MECHANIC_SNARE) | (1ULL << MECHANIC_ROOT);
55295529
for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
55305530
{
55315531
Aura const* aura = iter->second->GetBase();
@@ -6082,12 +6082,12 @@ bool Unit::HasAuraWithMechanic(uint64 mechanicMask) const
60826082
for (AuraApplicationMap::const_iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end(); ++iter)
60836083
{
60846084
SpellInfo const* spellInfo = iter->second->GetBase()->GetSpellInfo();
6085-
if (spellInfo->Mechanic && (mechanicMask & (UI64LIT(1) << spellInfo->Mechanic)))
6085+
if (spellInfo->Mechanic && (mechanicMask & (1ULL << spellInfo->Mechanic)))
60866086
return true;
60876087

60886088
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
60896089
if (iter->second->HasEffect(i) && spellInfo->Effects[i].Effect && spellInfo->Effects[i].Mechanic)
6090-
if (mechanicMask & (UI64LIT(1) << spellInfo->Effects[i].Mechanic))
6090+
if (mechanicMask & (1ULL << spellInfo->Effects[i].Mechanic))
60916091
return true;
60926092
}
60936093

@@ -8591,7 +8591,7 @@ float Unit::SpellPctDamageModsDone(Unit* victim, SpellInfo const* spellProto, Da
85918591

85928592
// Torment the weak
85938593
if (spellProto->SpellFamilyFlags[0] & 0x20600021 || spellProto->SpellFamilyFlags[1] & 0x9000)
8594-
if (victim->HasAuraWithMechanic((1 << MECHANIC_SNARE) | (1 << MECHANIC_SLOW_ATTACK)))
8594+
if (victim->HasAuraWithMechanic((1ULL << MECHANIC_SNARE) | (1ULL << MECHANIC_SLOW_ATTACK)))
85958595
if (AuraEffect* aurEff = GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_GENERIC, 3263, EFFECT_0))
85968596
AddPct(DoneTotalMod, aurEff->GetAmount());
85978597
break;
@@ -8910,7 +8910,7 @@ uint32 Unit::SpellDamageBonusTaken(Unit* caster, SpellInfo const* spellProto, ui
89108910
if (!caster || caster->GetGUID() != (*i)->GetCasterGUID())
89118911
continue;
89128912

8913-
if (mechanicMask & uint64(UI64LIT(1) << (*i)->GetMiscValue()))
8913+
if (mechanicMask & (1ULL << (*i)->GetMiscValue()))
89148914
{
89158915
if ((*i)->GetAmount() > 0)
89168916
{
@@ -9218,7 +9218,7 @@ float Unit::SpellTakenCritChance(Unit const* caster, SpellInfo const* spellProto
92189218
case SPELLFAMILY_MAGE:
92199219
// Glyph of Fire Blast
92209220
if (spellProto->SpellFamilyFlags[0] == 0x2 && spellProto->SpellIconID == 12)
9221-
if (HasAuraWithMechanic((1 << MECHANIC_STUN) | (1 << MECHANIC_KNOCKOUT)))
9221+
if (HasAuraWithMechanic((1ULL << MECHANIC_STUN) | (1ULL << MECHANIC_KNOCKOUT)))
92229222
if (AuraEffect const* aurEff = caster->GetAuraEffect(56369, EFFECT_0))
92239223
crit_chance += aurEff->GetAmount();
92249224
break;
@@ -10364,13 +10364,13 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
1036410364

1036510365
// Shred, Maul - "Effects which increase Bleed damage also increase Shred damage"
1036610366
if (spellProto->SpellFamilyName == SPELLFAMILY_DRUID && spellProto->SpellFamilyFlags[0] & 0x00008800)
10367-
mechanicMask |= (UI64LIT(1) << MECHANIC_BLEED);
10367+
mechanicMask |= (1ULL << MECHANIC_BLEED);
1036810368

1036910369
if (mechanicMask)
1037010370
{
1037110371
TakenTotalMod *= GetTotalAuraMultiplier(SPELL_AURA_MOD_MECHANIC_DAMAGE_TAKEN_PERCENT, [mechanicMask](AuraEffect const* aurEff) -> bool
1037210372
{
10373-
if (mechanicMask & uint64(UI64LIT(1) << (aurEff->GetMiscValue())))
10373+
if (mechanicMask & (1ULL << (aurEff->GetMiscValue())))
1037410374
return true;
1037510375
return false;
1037610376
});
@@ -11215,8 +11215,8 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
1121511215
if (Creature* creature = ToCreature())
1121611216
{
1121711217
// use creature helper which now consults creature_immunities table
11218-
if (creature->HasMechanicTemplateImmunity(UI64LIT(1) << MECHANIC_SNARE) ||
11219-
creature->HasMechanicTemplateImmunity(UI64LIT(1) << MECHANIC_DAZE))
11218+
if (creature->HasMechanicTemplateImmunity(1ULL << MECHANIC_SNARE) ||
11219+
creature->HasMechanicTemplateImmunity(1ULL << MECHANIC_DAZE))
1122011220
break;
1122111221
}
1122211222

@@ -11237,7 +11237,7 @@ void Unit::UpdateSpeed(UnitMoveType mtype, bool forced)
1123711237
if (creature
1123811238
&& !IsPet()
1123911239
&& !(IsControlledByPlayer() && IsVehicle())
11240-
&& !(creature->HasMechanicTemplateImmunity(UI64LIT(1) << MECHANIC_SNARE))
11240+
&& !(creature->HasMechanicTemplateImmunity(1ULL << MECHANIC_SNARE))
1124111241
&& !(creature->IsDungeonBoss()))
1124211242
{
1124311243
// 1.6% for each % under 30.
@@ -11493,12 +11493,12 @@ Unit* Creature::SelectVictim()
1149311493
return target;
1149411494
}
1149511495

11496-
// last case when creature must not go to evade mode:
11497-
// it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list
11498-
// Note: creature does not have targeted movement generator but has attacker in this case
11499-
for (AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
11500-
if ((*itr) && CanCreatureAttack(*itr) && !(*itr)->IsPlayer() && !(*itr)->ToCreature()->HasUnitTypeMask(UNIT_MASK_CONTROLLABLE_GUARDIAN))
11501-
return nullptr;
11496+
// Don't evade if another unit has us on their threat list — evading would
11497+
// end the bidirectional combat reference and remove us from their threat list,
11498+
// causing them to lose their target (e.g. an NPC fighting a guardian whose
11499+
// CanAIAttack rejects the NPC).
11500+
if (!m_threatManager.GetThreatenedByMeList().empty())
11501+
return nullptr;
1150211502

1150311503
if (GetVehicle())
1150411504
return nullptr;
@@ -11595,19 +11595,19 @@ int32 Unit::ModSpellDuration(SpellInfo const* spellProto, Unit const* target, in
1159511595
// xinef: also calculate self casts, spell can be reflected for example
1159611596
if (!positive)
1159711597
{
11598-
int32 mechanic = spellProto->GetSpellMechanicMaskByEffectMask(effectMask);
11598+
uint64 mechanic = spellProto->GetSpellMechanicMaskByEffectMask(effectMask);
1159911599

1160011600
int32 durationMod;
1160111601
int32 durationMod_always = 0;
1160211602
int32 durationMod_not_stack = 0;
1160311603

1160411604
for (uint8 i = 1; i <= MECHANIC_ENRAGED; ++i)
1160511605
{
11606-
if (!(mechanic & 1 << i))
11606+
if (!(mechanic & (1ULL << i)))
1160711607
continue;
1160811608

1160911609
// Xinef: spells affecting movement imparing effects should not reduce duration if disoriented mechanic is present
11610-
if (i == MECHANIC_SNARE && (mechanic & (1 << MECHANIC_DISORIENTED)))
11610+
if (i == MECHANIC_SNARE && (mechanic & (1ULL << MECHANIC_DISORIENTED)))
1161111611
continue;
1161211612

1161311613
// Find total mod value (negative bonus)

src/server/game/Groups/Group.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
14851485
AllowedLooterSet looters = item->GetAllowedLooters();
14861486
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
14871487
if (_item)
1488-
sScriptMgr->OnPlayerGroupRollRewardItem(player, _item, _item->GetCount(), NEED, roll);
1488+
sScriptMgr->OnPlayerGroupRollRewardItem(player, _item, item->count, NEED, roll);
14891489
player->UpdateLootAchievements(item, roll->getLoot());
14901490
}
14911491
else
@@ -1555,7 +1555,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
15551555
AllowedLooterSet looters = item->GetAllowedLooters();
15561556
Item* _item = player->StoreNewItem(dest, roll->itemid, true, item->randomPropertyId, looters);
15571557
if (_item)
1558-
sScriptMgr->OnPlayerGroupRollRewardItem(player, _item, _item->GetCount(), GREED, roll);
1558+
sScriptMgr->OnPlayerGroupRollRewardItem(player, _item, item->count, GREED, roll);
15591559
player->UpdateLootAchievements(item, roll->getLoot());
15601560
}
15611561
else

src/server/game/Loot/LootMgr.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,8 +441,26 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const
441441
return false;
442442

443443
// check quest requirements
444-
if (needs_quest && !pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && !player->HasQuestForItem(itemid))
445-
return false;
444+
if (!pProto->HasFlagCu(ITEM_FLAGS_CU_IGNORE_QUEST_STATUS))
445+
{
446+
if (needs_quest && !player->HasQuestForItem(itemid))
447+
return false;
448+
449+
// Hide quest starter items when quest is already started/rewarded,
450+
// when unique count is already reached, or when prerequisite is missing.
451+
if (pProto->StartQuest)
452+
{
453+
uint32 prevQuestId = 0;
454+
if (Quest const* startQuest = sObjectMgr->GetQuestTemplate(pProto->StartQuest))
455+
prevQuestId = startQuest->GetPrevQuestId();
456+
457+
if (player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE ||
458+
player->GetQuestRewardStatus(pProto->StartQuest) ||
459+
(pProto->MaxCount && player->HasItemCount(itemid, pProto->MaxCount, true)) ||
460+
(prevQuestId && !player->GetQuestRewardStatus(prevQuestId)))
461+
return false;
462+
}
463+
}
446464

447465
if (!sScriptMgr->OnAllowedForPlayerLootCheck(player, source))
448466
return false;

src/server/game/OutdoorPvP/OutdoorPvP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ bool OPvPCapturePoint::DelObject(uint32 type)
215215

216216
bool OPvPCapturePoint::DelCapturePoint()
217217
{
218-
sObjectMgr->DeleteGOData(m_capturePointSpawnId);
219-
m_capturePointSpawnId = 0;
220-
221218
if (_capturePoint)
222219
{
223220
_capturePoint->SetRespawnTime(0); // not save respawn time
224221
_capturePoint->Delete();
225222
}
226223

224+
sObjectMgr->DeleteGOData(m_capturePointSpawnId);
225+
m_capturePointSpawnId = 0;
226+
227227
return true;
228228
}
229229

0 commit comments

Comments
 (0)