diff options
author | QAston <none@none> | 2009-03-08 13:24:05 +0100 |
---|---|---|
committer | QAston <none@none> | 2009-03-08 13:24:05 +0100 |
commit | 786fbdec571dbc2f48ce204338cf532aabfc0d2d (patch) | |
tree | 36de3661c37e5b6c5c77e0377c45dd76daa3f56f /src | |
parent | abdddf36ff16ab5be7080349c86217bb69a06ddf (diff) |
*Fix crash.
*Fix Guard Dog and Improved Cower -by pasdVn.
*Fix aura SPELL_AURA_OBS_MOD_ENERGY -by pasdVn.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/SpellAuraDefines.h | 2 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 46 | ||||
-rw-r--r-- | src/game/SpellAuras.h | 2 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 3 | ||||
-rw-r--r-- | src/game/Unit.cpp | 42 |
5 files changed, 48 insertions, 47 deletions
diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h index 7868bb8dcd1..2bea07d9a9b 100644 --- a/src/game/SpellAuraDefines.h +++ b/src/game/SpellAuraDefines.h @@ -65,7 +65,7 @@ enum AuraType SPELL_AURA_MOD_INVISIBILITY = 18, SPELL_AURA_MOD_INVISIBILITY_DETECTION = 19, SPELL_AURA_OBS_MOD_HEALTH = 20, //20,21 unofficial - SPELL_AURA_OBS_MOD_MANA = 21, + SPELL_AURA_OBS_MOD_ENERGY = 21, SPELL_AURA_MOD_RESISTANCE = 22, SPELL_AURA_PERIODIC_TRIGGER_SPELL = 23, SPELL_AURA_PERIODIC_ENERGIZE = 24, diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 1ce2c5142b4..24f04ea143f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -75,7 +75,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleInvisibility, // 18 SPELL_AURA_MOD_INVISIBILITY &Aura::HandleInvisibilityDetect, // 19 SPELL_AURA_MOD_INVISIBILITY_DETECTION &Aura::HandleAuraModTotalHealthPercentRegen, // 20 SPELL_AURA_OBS_MOD_HEALTH - &Aura::HandleAuraModTotalManaPercentRegen, // 21 SPELL_AURA_OBS_MOD_MANA + &Aura::HandleAuraModTotalEnergyPercentRegen, // 21 SPELL_AURA_OBS_MOD_ENERGY &Aura::HandleAuraModResistance, // 22 SPELL_AURA_MOD_RESISTANCE &Aura::HandlePeriodicTriggerSpell, // 23 SPELL_AURA_PERIODIC_TRIGGER_SPELL &Aura::HandlePeriodicEnergize, // 24 SPELL_AURA_PERIODIC_ENERGIZE @@ -4386,7 +4386,7 @@ void Aura::HandleAuraModTotalHealthPercentRegen(bool apply, bool Real) m_isPeriodic = apply; } -void Aura::HandleAuraModTotalManaPercentRegen(bool apply, bool Real) +void Aura::HandleAuraModTotalEnergyPercentRegen(bool apply, bool Real) { if(m_modifier.periodictime == 0) m_modifier.periodictime = 1000; @@ -5825,13 +5825,10 @@ void Aura::PeriodicTick() } break; } + case SPELL_AURA_OBS_MOD_ENERGY: case SPELL_AURA_PERIODIC_ENERGIZE: { // ignore non positive values (can be result apply spellmods to aura damage - uint32 pdamage = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0; - sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", - GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId()); - if(m_modifier.m_miscvalue < 0 || m_modifier.m_miscvalue >= MAX_POWERS) break; @@ -5840,9 +5837,16 @@ void Aura::PeriodicTick() if(m_target->GetMaxPower(power) == 0) break; + uint32 amount = m_modifier.m_amount < 0 ? 0 : m_modifier.m_amount; + uint32 pdamage; + // Replenishment (Judgements of the Wise) if (m_spellProto->SpellIconID == 3184 && m_spellProto->SpellVisual[0] == 12495) pdamage = 0.25f * m_target->GetMaxPower(POWER_MANA); + else if( m_modifier.m_auraname == SPELL_AURA_OBS_MOD_ENERGY ) + pdamage = uint32(m_target->GetMaxPower(power) * amount/100); + else + pdamage = amount; WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size data.append(m_target->GetPackGUID()); @@ -5854,36 +5858,10 @@ void Aura::PeriodicTick() data << (uint32)pdamage; m_target->SendMessageToSet(&data,true); - int32 gain = m_target->ModifyPower(power,pdamage); - - if(Unit* pCaster = GetCaster()) - m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto()); - break; - } - case SPELL_AURA_OBS_MOD_MANA: - { - // ignore non positive values (can be result apply spellmods to aura damage - uint32 amount = m_modifier.m_amount > 0 ? m_modifier.m_amount : 0; - - uint32 pdamage = uint32(m_target->GetMaxPower(POWER_MANA) * amount/100); - - sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u mana inflicted by %u", + sLog.outDetail("PeriodicTick: %u (TypeId: %u) energize %u (TypeId: %u) for %u dmg inflicted by %u", GUID_LOPART(GetCasterGUID()), GuidHigh2TypeId(GUID_HIPART(GetCasterGUID())), m_target->GetGUIDLow(), m_target->GetTypeId(), pdamage, GetId()); - if(m_target->GetMaxPower(POWER_MANA) == 0) - break; - - WorldPacket data(SMSG_PERIODICAURALOG, (21+16));// we guess size - data.append(m_target->GetPackGUID()); - data.appendPackGUID(GetCasterGUID()); - data << uint32(GetId()); - data << uint32(1); - data << uint32(m_modifier.m_auraname); - data << (uint32)0; // ? - data << (uint32)pdamage; - m_target->SendMessageToSet(&data,true); - - int32 gain = m_target->ModifyPower(POWER_MANA, pdamage); + int32 gain = m_target->ModifyPower(power,pdamage); if(Unit* pCaster = GetCaster()) m_target->getHostilRefManager().threatAssist(pCaster, float(gain) * 0.5f, GetSpellProto()); diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index dac13adf6d1..6079a275d0d 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -111,7 +111,7 @@ class TRINITY_DLL_SPEC Aura void HandleInvisibility(bool Apply, bool Real); void HandleInvisibilityDetect(bool Apply, bool Real); void HandleAuraModTotalHealthPercentRegen(bool Apply, bool Real); - void HandleAuraModTotalManaPercentRegen(bool Apply, bool Real); + void HandleAuraModTotalEnergyPercentRegen(bool Apply, bool Real); void HandleAuraModResistance(bool Apply, bool Real); void HandleAuraModRoot(bool Apply, bool Real); void HandleAuraModSilence(bool Apply, bool Real); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 8004890b747..a765415e71c 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1321,6 +1321,9 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2, bool // generic spells if(!spellInfo_1->SpellFamilyName) { + // hack for Incanter's Absorption + if (spellInfo_1->Id==44413 && spellInfo_2->Id==44413) + return false; if(!spellInfo_1->SpellIconID || spellInfo_1->SpellIconID == 1 || spellInfo_1->SpellIconID != spellInfo_2->SpellIconID) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index bf508cf48fb..2d216b8cfb9 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -2223,8 +2223,6 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe auraAbsorbMod = (*i)->GetModifier()->m_amount; } - RemainingDamage += auraAbsorbMod * TotalAbsorb / 100; - // Ignore absorb - add reduced amount again to damage RemainingDamage += auraAbsorbMod * TotalAbsorb / 100; @@ -2232,6 +2230,8 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe if (*absorb) { + bool found = false; + int32 spell_dmg=0; // Incanter's Absorption AuraList const& DummmyAuras = pVictim->GetAurasByType(SPELL_AURA_DUMMY); for(AuraList::const_iterator i = DummmyAuras.begin(); i != DummmyAuras.end(); ++i) @@ -2240,22 +2240,22 @@ void Unit::CalcAbsorbResist(Unit *pVictim,SpellSchoolMask schoolMask, DamageEffe if (spellmgr.GetFirstSpellInChain(spellInfo->Id) == 44394) { int32 total_dmg=0; - AuraList const& ignore = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE); - for(AuraList::const_iterator j = ignore.begin(); i != ignore.end(); ++i) + // Get total bonus from auras + spellEffectPair spair = spellEffectPair(44413, 0); + for(AuraMap::const_iterator itr = pVictim->GetAuras().lower_bound(spair); itr != pVictim->GetAuras().upper_bound(spair); ++itr) { - if ((*j)->GetId()!=44413) - continue; - total_dmg += (*j)->GetModifier()->m_miscvalue; + total_dmg += itr->second->GetModifier()->m_miscvalue; } - int32 spell_dmg = int32(*absorb * (*i)->GetModifier()->m_amount / 100); + spell_dmg = int32(*absorb * (*i)->GetModifier()->m_amount / 100); // Do not apply more auras if more than 5% hp if(total_dmg+spell_dmg > int32(GetMaxHealth() * 5 / 100)) break; - - pVictim->CastCustomSpell(pVictim, 44413, &spell_dmg, NULL, NULL, false); + found=true; break; } } + if (found) + pVictim->CastCustomSpell(pVictim, 44413, &spell_dmg, NULL, NULL, false); } } @@ -3766,7 +3766,7 @@ bool Unit::AddAura(Aura *Aur) case SPELL_AURA_OBS_MOD_HEALTH: case SPELL_AURA_PERIODIC_MANA_LEECH: case SPELL_AURA_PERIODIC_ENERGIZE: - case SPELL_AURA_OBS_MOD_MANA: + case SPELL_AURA_OBS_MOD_ENERGY: case SPELL_AURA_POWER_BURN_MANA: break; default: // not allow @@ -6487,6 +6487,26 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu return true; } } + break; + } + case SPELLFAMILY_PET: + { + // improved cower + if (dummySpell->SpellIconID == 958 && procSpell->SpellIconID == 958) + { + triggered_spell_id = dummySpell->Id == 53180 ? 54200 : 54201; + target = this; + break; + } + // guard dog + if (dummySpell->SpellIconID == 201 && procSpell->SpellIconID == 201) + { + triggered_spell_id = 54445; + target = this; + pVictim->AddThreat(this,procSpell->EffectBasePoints[0]*triggerAmount/100); + break; + } + break; } default: break; |