Core: Code cleanup (here and there)
This commit is contained in:
@@ -791,7 +791,7 @@ uint32 Unit::DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDam
|
||||
victim->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_DIRECT_DAMAGE, spellProto ? spellProto->Id : 0);
|
||||
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER)
|
||||
victim->AddThreat(this, (float)damage, damageSchoolMask, spellProto);
|
||||
victim->AddThreat(this, float(damage), damageSchoolMask, spellProto);
|
||||
else // victim is a player
|
||||
{
|
||||
// random durability for items (HIT TAKEN)
|
||||
@@ -892,12 +892,12 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags
|
||||
CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastSpell(Unit* victim, SpellInfo const *spellInfo, bool triggered, Item *castItem/*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, uint64 originalCaster /*= 0*/)
|
||||
void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item *castItem/*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, uint64 originalCaster /*= 0*/)
|
||||
{
|
||||
CastSpell(victim, spellInfo, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastSpell(Unit* Victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
if (!spellInfo)
|
||||
{
|
||||
@@ -910,7 +910,7 @@ void Unit::CastSpell(Unit* Victim, SpellInfo const* spellInfo, TriggerCastFlags
|
||||
originalCaster=owner->GetGUID();
|
||||
|
||||
SpellCastTargets targets;
|
||||
targets.SetUnitTarget(Victim);
|
||||
targets.SetUnitTarget(victim);
|
||||
|
||||
if (castItem)
|
||||
sLog->outStaticDebug("WORLD: cast Item spellId - %i", spellInfo->Id);
|
||||
@@ -943,7 +943,7 @@ void Unit::CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit*
|
||||
CastCustomSpell(spellId, values, target, triggered, castItem, triggeredByAura, originalCaster);
|
||||
}
|
||||
|
||||
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* Victim, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit* victim, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, uint64 originalCaster)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!spellInfo)
|
||||
@@ -953,7 +953,7 @@ void Unit::CastCustomSpell(uint32 spellId, CustomSpellValues const& value, Unit*
|
||||
}
|
||||
|
||||
SpellCastTargets targets;
|
||||
targets.SetUnitTarget(Victim);
|
||||
targets.SetUnitTarget(victim);
|
||||
|
||||
if (!originalCaster && triggeredByAura)
|
||||
originalCaster = triggeredByAura->GetCasterGUID();
|
||||
@@ -2303,7 +2303,7 @@ int32 Unit::GetMechanicResistChance(const SpellInfo *spell)
|
||||
int32 resist_mech = 0;
|
||||
for (uint8 eff = 0; eff < MAX_SPELL_EFFECTS; ++eff)
|
||||
{
|
||||
if (spell->Effects[eff].Effect == 0)
|
||||
if (!spell->Effects[eff].IsEffect())
|
||||
break;
|
||||
int32 effect_mech = spell->GetEffectMechanic(eff);
|
||||
if (effect_mech)
|
||||
@@ -5741,20 +5741,17 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
{
|
||||
switch (dummySpell->Id)
|
||||
{
|
||||
case 11119: basepoints0 = int32(0.08f * damage); break;
|
||||
case 11120: basepoints0 = int32(0.16f * damage); break;
|
||||
case 12846: basepoints0 = int32(0.24f * damage); break;
|
||||
case 12847: basepoints0 = int32(0.32f * damage); break;
|
||||
case 12848: basepoints0 = int32(0.40f * damage); break;
|
||||
case 11119: basepoints0 = int32(0.04f * damage); break;
|
||||
case 11120: basepoints0 = int32(0.08f * damage); break;
|
||||
case 12846: basepoints0 = int32(0.12f * damage); break;
|
||||
case 12847: basepoints0 = int32(0.16f * damage); break;
|
||||
case 12848: basepoints0 = int32(0.20f * damage); break;
|
||||
default:
|
||||
sLog->outError("Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2 damage tick
|
||||
basepoints0 /= 2;
|
||||
triggered_spell_id = 12654;
|
||||
// Add remaining ticks to damage done
|
||||
basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
break;
|
||||
}
|
||||
@@ -6592,19 +6589,18 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
|
||||
switch (dummySpell->Id)
|
||||
{
|
||||
case 34477: // Misdirection
|
||||
{
|
||||
triggered_spell_id = 35079; // 4 sec buff on self
|
||||
target = this;
|
||||
return true;
|
||||
}
|
||||
case 57870: // Glyph of Mend Pet
|
||||
{
|
||||
victim->CastSpell(victim, 57894, true, NULL, NULL, GetGUID());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Misdirection
|
||||
if (dummySpell->Id == 34477)
|
||||
{
|
||||
triggered_spell_id = 35079; // 4 sec buff on self
|
||||
target = this;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PALADIN:
|
||||
@@ -8137,7 +8133,10 @@ bool Unit::HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, Sp
|
||||
CastCustomSpell(this, 70845, &basepoints0, NULL, NULL, true);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@@ -14210,7 +14209,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
|
||||
continue;
|
||||
|
||||
// Triggered spells not triggering additional spells
|
||||
bool triggered= !(spellProto->AttributesEx3 & SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED) ?
|
||||
bool triggered = !(spellProto->AttributesEx3 & SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED) ?
|
||||
(procExtra & PROC_EX_INTERNAL_TRIGGERED && !(procFlag & PROC_FLAG_DONE_TRAP_ACTIVATION)) : false;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
|
||||
Reference in New Issue
Block a user