aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2010-01-10 13:48:57 +0100
committerQAston <none@none>2010-01-10 13:48:57 +0100
commitf9c4030f59a84773046dfec8cef3cf82b4f9ed27 (patch)
tree89a417d5bb7e70b18b88faa3f2ce5204e90b60b4
parenteea50de960f0035cd54e985dc119870aa215732b (diff)
*Implement attribute SPELL_ATTR_NEGATIVE_1
*Remove unneeded hacks from SpellMgr::_isPositiveSpell *Missing ! in prev commit. --HG-- branch : trunk
-rw-r--r--src/game/SharedDefines.h2
-rw-r--r--src/game/SpellEffects.cpp2
-rw-r--r--src/game/SpellMgr.cpp59
3 files changed, 7 insertions, 56 deletions
diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h
index d08ad736819..e915dd2ec9c 100644
--- a/src/game/SharedDefines.h
+++ b/src/game/SharedDefines.h
@@ -254,7 +254,7 @@ const uint32 ItemQualityColors[MAX_ITEM_QUALITY] = {
#define SPELL_ATTR_CASTABLE_WHILE_DEAD 0x00800000 // 23 castable while dead?
#define SPELL_ATTR_CASTABLE_WHILE_MOUNTED 0x01000000 // 24 castable while mounted
#define SPELL_ATTR_DISABLED_WHILE_ACTIVE 0x02000000 // 25 Activate and start cooldown after aura fade or remove summoned creature or go
-#define SPELL_ATTR_UNK26 0x04000000 // 26 Aura
+#define SPELL_ATTR_NEGATIVE_1 0x04000000 // 26 Many negative spells have this attr
#define SPELL_ATTR_CASTABLE_WHILE_SITTING 0x08000000 // 27 castable while sitting
#define SPELL_ATTR_CANT_USED_IN_COMBAT 0x10000000 // 28 Cannot be used in combat
#define SPELL_ATTR_UNAFFECTED_BY_INVULNERABILITY 0x20000000 // 29 unaffected by invulnerability (hmm possible not...)
diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp
index cb8cda60536..1526ce6f40c 100644
--- a/src/game/SpellEffects.cpp
+++ b/src/game/SpellEffects.cpp
@@ -7176,7 +7176,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
if ((1<<aura->GetSpellProto()->Dispel) & dispelMask)
{
// Need check for passive? this
- if (aura->IsPositive(unitTarget) || aura->IsPassive() || aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_NOT_STEALABLE)
+ if (!aura->IsPositive(unitTarget) || aura->IsPassive() || aura->GetSpellProto()->AttributesEx4 & SPELL_ATTR_EX4_NOT_STEALABLE)
continue;
bool dispel_charges = aura->GetSpellProto()->AttributesEx7 & SPELL_ATTR_EX7_DISPEL_CHARGES;
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 3534a9da14e..879e030a614 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -733,6 +733,7 @@ bool IsPositiveTarget(uint32 targetA, uint32 targetB)
// non-positive targets
switch(targetA)
{
+ case TARGET_UNIT_NEARBY_ENEMY:
case TARGET_UNIT_TARGET_ENEMY:
case TARGET_UNIT_AREA_ENEMY_SRC:
case TARGET_UNIT_AREA_ENEMY_DST:
@@ -754,20 +755,16 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
SpellEntry const *spellproto = sSpellStore.LookupEntry(spellId);
if (!spellproto) return false;
+ // not found a single positive spell with this attribute
+ if (spellproto->Attributes & SPELL_ATTR_NEGATIVE_1)
+ return false;
+
switch(spellId)
{
- case 1852: // Silenced (GM)
- case 46392: // Focused Assault
- case 46393: // Brutal Assault
//case 37675: // Chaos Blast removed from mangos
- case 41519: // Mark of Stormrage
- case 34877: // Custodian of Time
case 34700: // Allergic Reaction
- case 31719: // Suspension
case 61987: // Avenging Wrath Marker
case 50524: // Runic Power Feed
- case 52671: // Arcing Burn
- case 59834: // Arcing Burn
return false;
case 12042: // Arcane Power
return true;
@@ -813,24 +810,6 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
{
switch(spellproto->EffectApplyAuraName[effIndex])
{
- case SPELL_AURA_DUMMY:
- {
- // dummy aura can be positive or negative dependent from casted spell
- switch(spellproto->Id)
- {
- case 13139: // net-o-matic special effect
- case 23445: // evil twin
- case 35679: // Protectorate Demolitionist
- case 38637: // Nether Exhaustion (red)
- case 38638: // Nether Exhaustion (green)
- case 38639: // Nether Exhaustion (blue)
- case 11196: // Recently Bandaged
- case 44689: // Relay Race Accept Hidden Debuff - DND
- return false;
- default:
- break;
- }
- } break;
case SPELL_AURA_MOD_DAMAGE_DONE: // dependent from bas point sign (negative -> negative)
case SPELL_AURA_MOD_STAT:
case SPELL_AURA_MOD_SKILL:
@@ -878,10 +857,6 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
case SPELL_AURA_MOD_STUN: //have positive and negative spells, we can't sort its correctly at this moment.
if(effIndex==0 && spellproto->Effect[1]==0 && spellproto->Effect[2]==0)
return false; // but all single stun aura spells is negative
-
- // Petrification
- if(spellproto->Id == 17624)
- return false;
break;
case SPELL_AURA_MOD_PACIFY_SILENCE:
if(spellproto->Id == 24740) // Wisp Costume
@@ -907,26 +882,6 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
if(spellproto->Attributes & 0x4000000 && effIndex==0)
return false;
break;
- case SPELL_AURA_TRANSFORM:
- // some spells negative
- switch(spellproto->Id)
- {
- case 36897: // Transporter Malfunction (race mutation to horde)
- case 36899: // Transporter Malfunction (race mutation to alliance)
- return false;
- }
- break;
- case SPELL_AURA_MOD_SCALE:
- // some spells negative
- switch(spellproto->Id)
- {
- case 36900: // Soul Split: Evil!
- case 36901: // Soul Split: Good
- case 36893: // Transporter Malfunction (decrease size case)
- case 36895: // Transporter Malfunction (increase size case)
- return false;
- }
- break;
case SPELL_AURA_MECHANIC_IMMUNITY:
{
// non-positive immunities
@@ -971,10 +926,6 @@ bool SpellMgr::_isPositiveEffect(uint32 spellId, uint32 effIndex, bool deep) con
break;
}
} break;
- case SPELL_AURA_FORCE_REACTION:
- if(spellproto->Id==42792) // Recently Dropped Flag (prevent cancel)
- return false;
- break;
default:
break;
}