Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into ShatteredWorld
# Conflicts: # src/server/scripts/EasternKingdoms/Gilneas/chapter1.cpp # src/server/scripts/Kalimdor/LostCityOfTheTolvir/boss_lockmaw_and_augh.cpp # src/server/scripts/Kalimdor/LostCityOfTheTolvir/instance_lost_city_of_the_tolvir.cpp # src/server/scripts/Kalimdor/LostCityOfTheTolvir/lost_city_of_the_tolvir.h # src/server/scripts/Spells/spell_quest.cpp
This commit is contained in:
commit
3e4451cab7
39 files changed
+608
-158
No files matched your search
@@ -2662,9 +2662,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
|
||||
diminishLevel = unit->GetDiminishing(diminishGroup);
|
||||
DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered);
|
||||
// Increase Diminishing on unit, current informations for actually casts will use values above
|
||||
if ((type == DRTYPE_PLAYER &&
|
||||
(unit->GetCharmerOrOwnerPlayerOrPlayerItself() || (unit->GetTypeId() == TYPEID_UNIT && unit->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) ||
|
||||
type == DRTYPE_ALL)
|
||||
if (type == DRTYPE_ALL || (type == DRTYPE_PLAYER && unit->IsAffectedByDiminishingReturns()))
|
||||
unit->IncrDiminishing(m_spellInfo, triggered);
|
||||
}
|
||||
|
||||
@@ -3259,11 +3257,9 @@ void Spell::_cast(bool skipCheck)
|
||||
// skip check if done already (for instant cast spells for example)
|
||||
if (!skipCheck)
|
||||
{
|
||||
uint32 param1 = 0, param2 = 0;
|
||||
SpellCastResult castResult = CheckCast(false, ¶m1, ¶m2);
|
||||
if (castResult != SPELL_CAST_OK)
|
||||
auto cleanupSpell = [this, modOwner](SpellCastResult res, uint32* p1 = nullptr, uint32* p2 = nullptr)
|
||||
{
|
||||
SendCastResult(castResult, ¶m1, ¶m2);
|
||||
SendCastResult(res, p1, p2);
|
||||
SendInterrupted(0);
|
||||
|
||||
if (modOwner)
|
||||
@@ -3271,6 +3267,13 @@ void Spell::_cast(bool skipCheck)
|
||||
|
||||
finish(false);
|
||||
SetExecutedCurrently(false);
|
||||
};
|
||||
|
||||
uint32 param1 = 0, param2 = 0;
|
||||
SpellCastResult castResult = CheckCast(false, ¶m1, ¶m2);
|
||||
if (castResult != SPELL_CAST_OK)
|
||||
{
|
||||
cleanupSpell(castResult, ¶m1, ¶m2);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3286,18 +3289,39 @@ void Spell::_cast(bool skipCheck)
|
||||
{
|
||||
// Spell will be cast after completing the trade. Silently ignore at this place
|
||||
my_trade->SetSpell(m_spellInfo->Id, m_CastItem);
|
||||
SendCastResult(SPELL_FAILED_DONT_REPORT);
|
||||
SendInterrupted(0);
|
||||
|
||||
modOwner->SetSpellModTakingSpell(this, false);
|
||||
|
||||
finish(false);
|
||||
SetExecutedCurrently(false);
|
||||
cleanupSpell(SPELL_FAILED_DONT_REPORT);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// check diminishing returns (again, only after finish cast bar, tested on retail)
|
||||
if (Unit* target = m_targets.GetUnitTarget())
|
||||
{
|
||||
uint8 aura_effmask = 0;
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (m_spellInfo->Effects[i].IsUnitOwnedAuraEffect())
|
||||
aura_effmask |= 1 << i;
|
||||
|
||||
if (aura_effmask)
|
||||
{
|
||||
bool const triggered = m_triggeredByAuraSpell != nullptr;
|
||||
if (DiminishingGroup diminishGroup = m_spellInfo->GetDiminishingReturnsGroupForSpell(triggered))
|
||||
{
|
||||
DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered);
|
||||
if (type == DRTYPE_ALL || (type == DRTYPE_PLAYER && target->IsAffectedByDiminishingReturns()))
|
||||
{
|
||||
Unit* caster = m_originalCaster ? m_originalCaster : m_caster;
|
||||
if (target->HasStrongerAuraWithDR(m_spellInfo, caster, triggered))
|
||||
{
|
||||
cleanupSpell(SPELL_FAILED_AURA_BOUNCED);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if the spell allows the creature to turn while casting, then adjust server-side orientation to face the target now
|
||||
|
||||
Reference in new issue
Block a user