|
Патчи на рассмотрении Рассматриваемые к принятию патчи |
|
Опции темы | Поиск в этой теме | Опции просмотра |
14.05.2010, 09:27 | #1 |
Новичок
Регистрация: 07.03.2010
Сообщений: 10
Сказал(а) спасибо: 2
Поблагодарили 0 раз(а) в 0 сообщениях
|
Fix auras of the same resistance
original post:
http://getmangos.com/community/showt...ame-resistance Код:
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b7cb5aa..1890261 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4470,11 +4502,21 @@ void Aura::HandleAuraModResistanceExclusive(bool apply, bool /*Real*/) { for(int8 x = SPELL_SCHOOL_NORMAL; x < MAX_SPELL_SCHOOL;x++) { + int32 oldMaxValue = 0; if(m_modifier.m_miscvalue & int32(1<<x)) { - m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, float(m_modifier.m_amount), apply); + // no same resistance auras stack together + Unit::AuraList const& REAuras = m_target->GetAurasByType(SPELL_AURA_MOD_RESISTANCE_EXCLUSIVE); + for (Unit::AuraList::const_iterator i = REAuras.begin(); i != REAuras.end(); ++i) + if (((*i)->GetMiscValue() & int32(1<<x)) && (*i)->GetSpellProto()->Id != GetSpellProto()->Id) + if (oldMaxValue < (*i)->GetModifier()->m_amount) + oldMaxValue = (*i)->GetModifier()->m_amount; + + float value = (m_modifier.m_amount > oldMaxValue) ? m_modifier.m_amount - oldMaxValue : 0.0f; + + m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_VALUE, value, apply); if(m_target->GetTypeId() == TYPEID_PLAYER) - m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, float(m_modifier.m_amount), apply); + m_target->ApplyResistanceBuffModsMod(SpellSchools(x), m_positive, value, apply); } } } |
|
|
Похожие темы | ||||
Тема | Автор | Раздел | Ответов | Последнее сообщение |
[10957] Implement auras SPELL_AURA_MOD_DISARM_OFFHAND (254) and SPELL_AURA_MOD_DISARM_RANGED (278). | newsbot | CMaNGOS Commits | 0 | 04.01.2011 05:48 |
[10917] Allow SPELL_AURA_MOD_PACIFY auras to affect creatures | newsbot | CMaNGOS Commits | 0 | 24.12.2010 16:50 |
[10446] Small fix for single target auras: remove caster only auras | newsbot | CMaNGOS Commits | 0 | 05.09.2010 08:00 |
[10312] Allow store in DB same spell auras from different casters. | newsbot | CMaNGOS Commits | 0 | 03.08.2010 03:10 |
Simplified way to retrieve talent auras. | Astellar | Патчи на рассмотрении | 2 | 17.06.2010 11:48 |