aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp12
-rw-r--r--src/game/Unit.cpp11
-rw-r--r--src/game/Unit.h1
-rw-r--r--src/shared/Database/DBCStructure.h8
-rw-r--r--src/shared/Database/DBCfmt.cpp2
-rw-r--r--src/shared/revision_nr.h2
6 files changed, 30 insertions, 6 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index f1cf7e6a907..add65b0cdab 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3488,6 +3488,12 @@ uint8 Spell::CanCast(bool strict)
if(m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraStateNot)))
return SPELL_FAILED_CASTER_AURASTATE;
+ // Caster aura req check if need
+ if(m_spellInfo->casterAuraSpell && !m_caster->isAuraPresent(m_spellInfo->casterAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->excludeCasterAuraSpell && m_caster->isAuraPresent(m_spellInfo->excludeCasterAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+
// cancel autorepeat spells if cast start when moving
// (not wand currently autorepeat cast delayed to moving stop anyway in spell update code)
if( m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->isMoving() )
@@ -3506,6 +3512,12 @@ uint8 Spell::CanCast(bool strict)
if(m_spellInfo->TargetAuraStateNot && target->HasAuraState(AuraState(m_spellInfo->TargetAuraStateNot)))
return SPELL_FAILED_TARGET_AURASTATE;
+ // Target aura req check if need
+ if(m_spellInfo->targetAuraSpell && !target->isAuraPresent(m_spellInfo->targetAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->excludeTargetAuraSpell && target->isAuraPresent(m_spellInfo->excludeTargetAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+
if(target != m_caster)
{
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 40d867a2574..694003fbc97 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4012,6 +4012,17 @@ Aura* Unit::GetAura(uint32 spellId, uint32 effindex)
return NULL;
}
+bool Unit::isAuraPresent(uint32 spellId)
+{
+ for (int i=0; i<3; ++i)
+ {
+ AuraMap::iterator iter = m_Auras.find(spellEffectPair(spellId, i));
+ if (iter != m_Auras.end())
+ return true;
+ }
+ return false;
+}
+
void Unit::AddDynObject(DynamicObject* dynObj)
{
m_dynObjGUIDs.push_back(dynObj->GetGUID());
diff --git a/src/game/Unit.h b/src/game/Unit.h
index 5da9a484ae1..b015f166a8b 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1312,6 +1312,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint8 GetVisibleAurasCount() { return m_visibleAuras.size(); }
Aura* GetAura(uint32 spellId, uint32 effindex);
+ bool isAuraPresent(uint32 spellId);
AuraMap & GetAuras() { return m_Auras; }
AuraMap const& GetAuras() const { return m_Auras; }
AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h
index e26e9d2baad..5890f5c48f5 100644
--- a/src/shared/Database/DBCStructure.h
+++ b/src/shared/Database/DBCStructure.h
@@ -1088,10 +1088,10 @@ struct SpellEntry
uint32 TargetAuraState; // 18 m_targetAuraState
uint32 CasterAuraStateNot; // 19 m_excludeCasterAuraState
uint32 TargetAuraStateNot; // 20 m_excludeTargetAuraState
- //uint32 casterAuraSpell; // 21 m_casterAuraSpell not used
- //uint32 targetAuraSpell; // 22 m_targetAuraSpell not used
- //uint32 excludeCasterAuraSpell; // 23 m_excludeCasterAuraSpell not used
- //uint32 excludeTargetAuraSpell; // 24 m_excludeTargetAuraSpell not used
+ uint32 casterAuraSpell; // 21 m_casterAuraSpell
+ uint32 targetAuraSpell; // 22 m_targetAuraSpell
+ uint32 excludeCasterAuraSpell; // 23 m_excludeCasterAuraSpell
+ uint32 excludeTargetAuraSpell; // 24 m_excludeTargetAuraSpell
uint32 CastingTimeIndex; // 25 m_castingTimeIndex
uint32 RecoveryTime; // 26 m_recoveryTime
uint32 CategoryRecoveryTime; // 27 m_categoryRecoveryTime
diff --git a/src/shared/Database/DBCfmt.cpp b/src/shared/Database/DBCfmt.cpp
index 6cf475c4938..fffe3f98124 100644
--- a/src/shared/Database/DBCfmt.cpp
+++ b/src/shared/Database/DBCfmt.cpp
@@ -72,7 +72,7 @@ const char SkillLineAbilityfmt[]="niiiixxiiiiixx";
const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const char SpellCastTimefmt[]="nixx";
const char SpellDurationfmt[]="niii";
-const char SpellEntryfmt[]="niiiiiiiiixiiiiiiiiiixxxxiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiix";
+const char SpellEntryfmt[]="niiiiiiiiixiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiix";
const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx";
const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiixx";
const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h
index 8da13cd24d0..839c6d8681a 100644
--- a/src/shared/revision_nr.h
+++ b/src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "7010"
+ #define REVISION_NR "7011"
#endif // __REVISION_NR_H__