diff options
author | QAston <none@none> | 2009-04-14 19:09:08 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-04-14 19:09:08 +0200 |
commit | 6c44316d8e7d94bb28beafe32c649d46cf9240f4 (patch) | |
tree | b0242b7793698e20c90ff3ef9346dfd6072e3525 | |
parent | ecbaf6483d453e0d80ab0b24f27232fbda1a3c4c (diff) |
*Correct positivity of some spells
--HG--
branch : trunk
-rw-r--r-- | sql/updates/2687_world.sql | 4 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 24 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 18 |
3 files changed, 32 insertions, 14 deletions
diff --git a/sql/updates/2687_world.sql b/sql/updates/2687_world.sql new file mode 100644 index 00000000000..a36a0ddf117 --- /dev/null +++ b/sql/updates/2687_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_proc_event` WHERE `entry` IN (44545, 44543); +INSERT INTO `spell_proc_event` VALUES +(44545, 0x00, 3, 1049120, 4096, 0, 65536, 0x0000000, 0.000000, 15.000000, 0), +(44543, 0x00, 3, 1049120, 4096, 0, 65536, 0x0000000, 0.000000, 7.000000, 0), diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 3c427706d19..5479ea7f7c2 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -426,24 +426,22 @@ m_auraSlot(MAX_AURAS), m_auraLevel(1), m_procCharges(0), m_stackAmount(1),m_aura // Aura is positive when it is casted by friend and at least one aura is positive // or when it is casted by enemy and at least one aura is negative bool swap=false; - if (!caster || caster==target) - m_positive=IsPositiveSpell(m_spellProto->Id); + if (!caster || caster==target) // caster == target - 1 negative effect is enough for aura to be negative + m_positive = false; else - { m_positive = !caster->IsHostileTo(m_target); - for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) + for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) + { + if (!(1<<i & GetEffectMask())) + continue; + if (m_positive == IsPositiveEffect(GetId(), i)) { - if (!(1<<i & GetEffectMask())) - continue; - if (m_positive == IsPositiveEffect(GetId(), i)) - { - swap = true; - break; - } + swap = true; + break; } - if (!swap) - m_positive=!m_positive; } + if (!swap) + m_positive=!m_positive; } Aura::~Aura() diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index c5c70b0d92f..af8a04740f8 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -676,7 +676,23 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) { case SPELLMOD_COST: // dependent from bas point sign (negative -> positive) if(spellproto->CalculateSimpleValue(effIndex) > 0) - return false; + { + if (!deep) + { + bool negative = true; + for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i) + { + if (i != effIndex) + if (IsPositiveEffect(spellId, i, true)) + { + negative = false; + break; + } + } + if (negative) + return false; + } + } break; default: break; |