Core/Spells: Fix SPELL_AURA_PROC_ON_POWER_AMOUNT

Will re-implement the eclipse handling in spellscripts later
This commit is contained in:
roc13x committed 2017-05-04 21:16:50 +01:00
1 parent 1a5c7aed42
commit 7d6884dcb5
5 files changed
+34 -121

No files matched your search

-115
View File
@@ -5199,121 +5199,6 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType
SendAttackStateUpdate(&dmgInfo);
}
/*bool Unit::HandleAuraProcOnPowerAmount(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown)
{
// Get triggered aura spell info
SpellInfo const* auraSpellInfo = triggeredByAura->GetSpellInfo();
// Get effect index used for the proc
uint32 effIndex = triggeredByAura->GetEffIndex();
// Power amount required to proc the spell
int32 powerAmountRequired = triggeredByAura->GetAmount();
// Power type required to proc
Powers powerRequired = Powers(auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].MiscValue);
// Set trigger spell id, target, custom basepoints
uint32 trigger_spell_id = auraSpellInfo->Effects[triggeredByAura->GetEffIndex()].TriggerSpell;
Unit* target = NULL;
int32 basepoints0 = 0;
Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER
? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL;
// All ok. Check current trigger spell
SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(trigger_spell_id);
if (triggerEntry == NULL)
{
// Not cast unknown spell
// TC_LOG_ERROR("Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 in EffectTriggered[%d], not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
return false;
}
// not allow proc extra attack spell at extra attack
if (m_extraAttacks && triggerEntry->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS))
return false;
if (!powerRequired || !powerAmountRequired)
{
TC_LOG_ERROR("spells", "Unit::HandleAuraProcOnPowerAmount: Spell %u have 0 powerAmountRequired in EffectAmount[%d] or 0 powerRequired in EffectMiscValue, not handled custom case?", auraSpellInfo->Id, triggeredByAura->GetEffIndex());
return false;
}
if (GetPower(powerRequired) != powerAmountRequired)
return false;
// Custom requirements (not listed in procEx) Warning! damage dealing after this
// Custom triggered spells
switch (auraSpellInfo->SpellFamilyName)
{
case SPELLFAMILY_DRUID:
{
// Eclipse Mastery Driver Passive
if (auraSpellInfo->Id == 79577)
{
uint32 solarEclipseMarker = 67483;
uint32 lunarEclipseMarker = 67484;
switch (effIndex)
{
case 0:
{
if (HasAura(trigger_spell_id))
return false;
// Do not proc if proc spell isnt starfire and starsurge
if (procSpell->Id != 2912 && procSpell->Id != 78674)
return false;
if (HasAura(solarEclipseMarker))
{
RemoveAurasDueToSpell(solarEclipseMarker);
CastSpell(this, lunarEclipseMarker, true);
}
break;
}
case 1:
{
if (HasAura(trigger_spell_id))
return false;
// Do not proc if proc spell isnt wrath and starsurge
if (procSpell->Id != 5176 && procSpell->Id != 78674)
return false;
if (HasAura(lunarEclipseMarker))
{
RemoveAurasDueToSpell(lunarEclipseMarker);
CastSpell(this, solarEclipseMarker, true);
}
break;
}
}
}
break;
}
}
if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->GetSpellHistory()->HasCooldown(trigger_spell_id))
return false;
// try detect target manually if not set
if (target == NULL)
target = !(procFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS)) && triggerEntry && triggerEntry->IsPositive() ? this : victim;
if (basepoints0)
CastCustomSpell(target, trigger_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura);
else
CastSpell(target, trigger_spell_id, true, castItem, triggeredByAura);
if (cooldown && GetTypeId() == TYPEID_PLAYER)
ToPlayer()->GetSpellHistory()->AddCooldown(trigger_spell_id, 0, std::chrono::seconds(cooldown));
return true;
}*/
void Unit::setPowerType(Powers new_powertype)
{
if (getPowerType() == new_powertype)