aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVincent-Michael <Vincent_Michael@gmx.de>2014-06-16 22:17:27 +0200
committerVincent-Michael <Vincent_Michael@gmx.de>2014-06-16 22:17:27 +0200
commit97ccfdb625955d354d17e84f5833e5be3d847351 (patch)
tree0d77cd6a682e6fb1e4f8802e8e9a87fabc49180a /src
parent85e37db96a7454987d4ffc9be59462cfecf85e9a (diff)
parent24d834af17c2a9b22225f4381082acd2016c70ef (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/game/Spells/Auras/SpellAuraEffects.cpp
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp34
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp2
-rw-r--r--src/server/game/Spells/SpellEffects.cpp12
-rw-r--r--src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp14
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.cpp4
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.h2
9 files changed, 49 insertions, 27 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 95a241f62e2..4e9954116eb 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16591,7 +16591,7 @@ void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns c
}
}
-int32 Unit::GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool sameMiscValue /*= false*/) const
+int32 Unit::GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool checkMiscValue /*= false*/, int32 miscValue /*= 0*/) const
{
int32 val = 0;
SpellSpellGroupMapBounds spellGroup = sSpellMgr->GetSpellSpellGroupMapBounds(aurEff->GetSpellInfo()->GetFirstRankSpell()->Id);
@@ -16602,7 +16602,7 @@ int32 Unit::GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEf
AuraEffectList const& auraEffList = GetAuraEffectsByType(auraType);
for (AuraEffectList::const_iterator auraItr = auraEffList.begin(); auraItr != auraEffList.end(); ++auraItr)
{
- if (aurEff != (*auraItr) && (!sameMiscValue || aurEff->GetMiscValue() == (*auraItr)->GetMiscValue()) &&
+ if (aurEff != (*auraItr) && (!checkMiscValue || (*auraItr)->GetMiscValue() == miscValue) &&
sSpellMgr->IsSpellMemberOfSpellGroup((*auraItr)->GetSpellInfo()->Id, itr->second))
{
// absolute value only
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index a11360d3e02..8adccb25f84 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -2164,7 +2164,7 @@ class Unit : public WorldObject
time_t GetLastDamagedTime() const { return _lastDamagedTime; }
void SetLastDamagedTime(time_t val) { _lastDamagedTime = val; }
- int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool sameMiscValue = false) const;
+ int32 GetHighestExclusiveSameEffectSpellGroupValue(AuraEffect const* aurEff, AuraType auraType, bool checkMiscValue = false, int32 miscValue = 0) const;
bool IsHighestExclusiveAura(Aura const* aura, bool removeOtherAuraApplications = false);
protected:
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 94e7d9e5d64..fc87bf2cdab 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -553,7 +553,7 @@ enum SpellAttr7
SPELL_ATTR7_UNK13 = 0x00002000, // 13 Not set in 3.2.2a.
SPELL_ATTR7_UNK14 = 0x00004000, // 14 Only 52150 (Raise Dead - Pet) spell.
SPELL_ATTR7_UNK15 = 0x00008000, // 15 Exorcism. Usable on players? 100% crit chance on undead and demons?
- SPELL_ATTR7_UNK16 = 0x00010000, // 16 Druid spells (29166, 54833, 64372, 68285).
+ SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER = 0x00010000, // 16 These spells can replenish a powertype, which is not the current powertype.
SPELL_ATTR7_UNK17 = 0x00020000, // 17 Only 27965 (Suicide) spell.
SPELL_ATTR7_HAS_CHARGE_EFFECT = 0x00040000, // 18 Only spells that have Charge among effects.
SPELL_ATTR7_ZONE_TELEPORT = 0x00080000, // 19 Teleports to specific zones.
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index cf0c81cd319..9ad036a4e60 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3662,7 +3662,7 @@ void AuraEffect::HandleAuraModStat(AuraApplication const* aurApp, uint8 mode, bo
}
Unit* target = aurApp->GetTarget();
- int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_STAT, true);
+ int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_STAT, true, GetMiscValue());
if (abs(spellGroupVal) >= abs(GetAmount()))
return;
@@ -3790,6 +3790,22 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
return;
Unit* target = aurApp->GetTarget();
+ int32 spellGroupVal = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, true, -1);
+ if (abs(spellGroupVal) >= abs(GetAmount()))
+ return;
+
+ if (spellGroupVal)
+ {
+ for (int32 i = STAT_STRENGTH; i < MAX_STATS; i++)
+ {
+ if (GetMiscValue() == i || GetMiscValue() == -1) // affect the same stats
+ {
+ target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(spellGroupVal), !apply);
+ if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
+ target->ApplyStatPercentBuffMod(Stats(i), float(spellGroupVal), !apply);
+ }
+ }
+ }
// save current health state
float healthPct = target->GetHealthPct();
@@ -3799,6 +3815,17 @@ void AuraEffect::HandleModTotalPercentStat(AuraApplication const* aurApp, uint8
{
if (GetMiscValueB() & 1 << i || !GetMiscValueB()) // 0 is also used for all stats
{
+ int32 spellGroupVal2 = target->GetHighestExclusiveSameEffectSpellGroupValue(this, SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, true, i);
+ if (abs(spellGroupVal2) >= abs(GetAmount()))
+ continue;
+
+ if (spellGroupVal2)
+ {
+ target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(spellGroupVal2), !apply);
+ if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
+ target->ApplyStatPercentBuffMod(Stats(i), float(spellGroupVal2), !apply);
+ }
+
target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), TOTAL_PCT, float(GetAmount()), apply);
if (target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->IsPet())
target->ApplyStatPercentBuffMod(Stats(i), float(GetAmount()), apply);
@@ -5896,7 +5923,7 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
int32 dmg = damage;
-
+
if (!(GetSpellInfo()->AttributesEx4 & SPELL_ATTR4_FIXED_DAMAGE))
caster->ApplyResilience(target, &dmg);
damage = dmg;
@@ -6265,6 +6292,9 @@ void AuraEffect::HandlePeriodicEnergizeAuraTick(Unit* target, Unit* caster) cons
{
Powers powerType = Powers(GetMiscValue());
+ if (target->getPowerType() != powerType && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
+ return;
+
if (!target->IsAlive() || !target->GetMaxPower(powerType))
return;
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index d6b825e2749..472af90c9ed 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1542,7 +1542,7 @@ void Aura::HandleAuraSpecificPeriodics(AuraApplication const* aurApp, Unit* cast
break;
}
default:
- break;
+ break;
}
}
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index be184525599..9b11e3ff55a 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -1594,6 +1594,12 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
+ if (unitTarget->getPowerType() != power && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
+ return;
+
+ if (unitTarget->GetMaxPower(power) == 0)
+ return;
+
// Some level depends spells
int level_multiplier = 0;
int level_diff = 0;
@@ -1633,9 +1639,6 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
if (damage < 0 && power != POWER_ECLIPSE)
return;
- if (unitTarget->GetMaxPower(power) == 0)
- return;
-
m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power);
// Mad Alchemist's Potion
@@ -1700,6 +1703,9 @@ void Spell::EffectEnergizePct(SpellEffIndex effIndex)
Powers power = Powers(m_spellInfo->Effects[effIndex].MiscValue);
+ if (unitTarget->getPowerType() != power && !(m_spellInfo->AttributesEx7 & SPELL_ATTR7_CAN_RESTORE_SECONDARY_POWER))
+ return;
+
uint32 maxPower = unitTarget->GetMaxPower(power);
if (maxPower == 0)
return;
diff --git a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
index 9404694e706..6d03774ea8c 100644
--- a/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
+++ b/src/server/scripts/Northrend/ChamberOfAspects/RubySanctum/boss_halion.cpp
@@ -854,7 +854,6 @@ class npc_halion_controller : public CreatureScript
{
if (Creature* halion = ObjectAccessor::GetCreature(*me, _instance->GetData64(itr)))
{
- RemoveCorporeality(halion, itr == DATA_TWILIGHT_HALION);
halion->CastSpell(halion, GetSpell(_materialCorporealityValue, itr == DATA_TWILIGHT_HALION), true);
if (itr == DATA_TWILIGHT_HALION)
@@ -865,19 +864,6 @@ class npc_halion_controller : public CreatureScript
}
}
- void RemoveCorporeality(Creature* who, bool isTwilight = false)
- {
- for (uint8 i = 0; i < MAX_CORPOREALITY_STATE; i++)
- {
- uint32 spellID = (isTwilight ? _corporealityReference[i].twilightRealmSpell : _corporealityReference[i].materialRealmSpell);
- if (who->HasAura(spellID))
- {
- who->RemoveAurasDueToSpell(spellID);
- break;
- }
- }
- }
-
uint32 GetSpell(uint8 pctValue, bool isTwilight = false) const
{
CorporealityEntry entry = _corporealityReference[pctValue];
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp
index 691546ac2fc..d5ad7f15a04 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.cpp
+++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp
@@ -1139,7 +1139,7 @@ bool logChildren)
dataKind == DataIsGlobal ||
dataKind == DataIsStaticMember)
continue;
-
+
symbolDetails.top().HasChildren = true;
if (!logChildren)
@@ -1296,7 +1296,7 @@ DWORD_PTR WheatyExceptionReport::DereferenceUnsafePointer(DWORD_PTR address)
return *(PDWORD_PTR)address;
}
__except (EXCEPTION_EXECUTE_HANDLER)
- {
+ {
return DWORD_PTR(-1);
}
}
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.h b/src/server/shared/Debugging/WheatyExceptionReport.h
index e57ed3fb8f7..9137b91aac9 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.h
+++ b/src/server/shared/Debugging/WheatyExceptionReport.h
@@ -120,7 +120,7 @@ struct SymbolDetail
if (!formatted.empty())
formatted += " ";
formatted += Name;
- }
+ }
if (!Value.empty())
formatted += " = " + Value;
return formatted;