mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Merge pull request #381 from UltraNix/AcBuildFix
Buildfix for AzerothCore.
This commit is contained in:
@@ -2813,14 +2813,16 @@ namespace LuaUnit
|
|||||||
#elif AZEROTHCORE
|
#elif AZEROTHCORE
|
||||||
if (!spell)
|
if (!spell)
|
||||||
{
|
{
|
||||||
uint32 absorb = 0;
|
DamageInfo dmgInfo(unit, target, damage, nullptr, schoolmask, SPELL_DIRECT_DAMAGE);
|
||||||
uint32 resist = 0;
|
unit->CalcAbsorbResist(dmgInfo);
|
||||||
unit->CalcAbsorbResist(unit, target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
|
|
||||||
if (damage <= absorb + resist)
|
if (!dmgInfo.GetDamage())
|
||||||
damage = 0;
|
damage = 0;
|
||||||
else
|
else
|
||||||
damage -= absorb + resist;
|
damage = dmgInfo.GetDamage();
|
||||||
|
|
||||||
|
uint32 absorb = dmgInfo.GetAbsorb();
|
||||||
|
uint32 resist = dmgInfo.GetResist();
|
||||||
unit->DealDamageMods(target, damage, &absorb);
|
unit->DealDamageMods(target, damage, &absorb);
|
||||||
Unit::DealDamage(unit, target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
|
Unit::DealDamage(unit, target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
|
||||||
unit->SendAttackStateUpdate(HITINFO_AFFECTS_VICTIM, target, 0, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
|
unit->SendAttackStateUpdate(HITINFO_AFFECTS_VICTIM, target, 0, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
|
||||||
@@ -2834,7 +2836,7 @@ namespace LuaUnit
|
|||||||
if (!spellInfo)
|
if (!spellInfo)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
SpellNonMeleeDamage dmgInfo(unit, target, spell, spellInfo->GetSchoolMask());
|
SpellNonMeleeDamage dmgInfo(unit, target, spellInfo, spellInfo->GetSchoolMask());
|
||||||
Unit::DealDamageMods(dmgInfo.target, dmgInfo.damage, &dmgInfo.absorb);
|
Unit::DealDamageMods(dmgInfo.target, dmgInfo.damage, &dmgInfo.absorb);
|
||||||
unit->SendSpellNonMeleeDamageLog(&dmgInfo);
|
unit->SendSpellNonMeleeDamageLog(&dmgInfo);
|
||||||
unit->DealSpellDamage(&dmgInfo, true);
|
unit->DealSpellDamage(&dmgInfo, true);
|
||||||
@@ -2879,17 +2881,12 @@ namespace LuaUnit
|
|||||||
uint32 amount = Eluna::CHECKVAL<uint32>(L, 4);
|
uint32 amount = Eluna::CHECKVAL<uint32>(L, 4);
|
||||||
bool critical = Eluna::CHECKVAL<bool>(L, 5, false);
|
bool critical = Eluna::CHECKVAL<bool>(L, 5, false);
|
||||||
|
|
||||||
#ifdef TRINITY
|
#if defined TRINITY || AZEROTHCORE
|
||||||
if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell))
|
if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell))
|
||||||
{
|
{
|
||||||
HealInfo healInfo(unit, target, amount, info, info->GetSchoolMask());
|
HealInfo healInfo(unit, target, amount, info, info->GetSchoolMask());
|
||||||
unit->HealBySpell(healInfo, critical);
|
unit->HealBySpell(healInfo, critical);
|
||||||
}
|
}
|
||||||
#elif AZEROTHCORE
|
|
||||||
if (const SpellInfo* info = sSpellMgr->GetSpellInfo(spell))
|
|
||||||
{
|
|
||||||
unit->HealBySpell(target, info, amount, critical);
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
#ifdef CMANGOS
|
#ifdef CMANGOS
|
||||||
SpellEntry const* spellEntry = GetSpellStore()->LookupEntry<SpellEntry>(spell);
|
SpellEntry const* spellEntry = GetSpellStore()->LookupEntry<SpellEntry>(spell);
|
||||||
|
|||||||
Reference in New Issue
Block a user