aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/VC71/71ScriptDev2.vcproj5
-rw-r--r--src/bindings/scripts/VC80/80ScriptDev2.vcproj3
-rw-r--r--src/bindings/scripts/VC90/90ScriptDev2.vcproj4
-rw-r--r--src/game/Player.cpp2
-rw-r--r--src/game/Player.h5
-rw-r--r--src/game/Spell.cpp61
-rw-r--r--src/game/SpellAuraDefines.h2
-rw-r--r--src/game/SpellAuras.cpp22
-rw-r--r--src/game/SpellAuras.h1
9 files changed, 78 insertions, 27 deletions
diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
index 3c5a2c0fa46..ab270b84c58 100644
--- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj
@@ -1970,7 +1970,10 @@
</File>
</Filter>
<Filter
- Name="Borean Tundra">
+ Name="Borean Tundra">
+ <File
+ RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp"
+ >
</Filter>
<Filter
Name="Howling Fjord">
diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
index 39a817899d0..e86433b3bc6 100644
--- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj
@@ -1080,6 +1080,9 @@
</Filter>
<Filter
Name="Borean Tundra">
+ <File
+ RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp"
+ >
</Filter>
<Filter
Name="Howling Fjord">
diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
index 49668b76f48..f4aededb72c 100644
--- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj
+++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj
@@ -750,6 +750,10 @@
<Filter
Name="Borean Tundra"
>
+ <File
+ RelativePath="..\scripts\zone\borean_tundra\borean_tundra.cpp"
+ >
+ </File>
</Filter>
<Filter
Name="Howling Fjord"
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index c3d3ce1b7d4..ee4cf8cc165 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -2491,7 +2491,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE ); // must be set
// cleanup player flags (will be re-applied if need at aura load), to avoid have ghost flag without ghost aura, for example.
- RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST);
+ RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK | PLAYER_FLAGS_DND | PLAYER_FLAGS_GM | PLAYER_FLAGS_GHOST | PLAYER_ALLOW_ONLY_ABILITY);
RemoveStandFlags(UNIT_STAND_FLAGS_ALL); // one form stealth modified bytes
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP | UNIT_BYTE2_FLAG_SANCTUARY);
diff --git a/src/game/Player.h b/src/game/Player.h
index 3e9a7e2553c..eeac9ca53f0 100644
--- a/src/game/Player.h
+++ b/src/game/Player.h
@@ -400,9 +400,8 @@ enum PlayerFlags
PLAYER_FLAGS_UNK21 = 0x00100000,
PLAYER_FLAGS_UNK22 = 0x00200000,
PLAYER_FLAGS_UNK23 = 0x00400000,
- PLAYER_FLAGS_UNK24 = 0x00800000, // disabled all abilitys on tab except autoattack
- PLAYER_FLAGS_UNK25 = 0x01000000, // disabled all melee ability on tab include autoattack
-
+ PLAYER_ALLOW_ONLY_ABILITY = 0x00800000, // used by bladestorm and killing spree
+ PLAYER_FLAGS_UNK25 = 0x01000000 // disabled all melee ability on tab include autoattack
};
// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1<<bit_index) without (-1)
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index aa91ff65ff6..77d8d06db1d 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -3554,6 +3554,9 @@ uint8 Spell::CanCast(bool strict)
// check cooldowns to prevent cheating
if(m_caster->GetTypeId()==TYPEID_PLAYER && ((Player*)m_caster)->HasSpellCooldown(m_spellInfo->Id))
{
+ //can cast triggered (by aura only?) spells while have this flag
+ if (!m_IsTriggeredSpell && ((Player*)m_caster)->HasFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY))
+ return SPELL_FAILED_SPELL_IN_PROGRESS;
if(m_triggeredByAuraSpell)
return SPELL_FAILED_DONT_REPORT;
else
@@ -3591,17 +3594,34 @@ uint8 Spell::CanCast(bool strict)
}
}
- // caster state requirements
- if(m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraState)))
- return SPELL_FAILED_CASTER_AURASTATE;
- if(m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraStateNot)))
- return SPELL_FAILED_CASTER_AURASTATE;
+ bool reqAuraState=true;
+ Unit::AuraList const& stateAuras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
+ for(Unit::AuraList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j)
+ {
+ if((*j)->isAffectedOnSpell(m_spellInfo))
+ {
+ reqAuraState=false;
+ break;
+ }
+ }
+
+ if (reqAuraState)
+ {
+ // caster state requirements
+ if(m_spellInfo->CasterAuraState && !m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraState)))
+ return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->CasterAuraStateNot && m_caster->HasAuraState(AuraState(m_spellInfo->CasterAuraStateNot)))
+ return SPELL_FAILED_CASTER_AURASTATE;
+
+ if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->excludeCasterAuraSpell && m_caster->HasAura(m_spellInfo->excludeCasterAuraSpell))
+ return SPELL_FAILED_CASTER_AURASTATE;
+
+ if(m_caster->isInCombat() && IsNonCombatSpell(m_spellInfo))
+ return SPELL_FAILED_AFFECTING_COMBAT;
+ }
- // Caster aura req check if need
- if(m_spellInfo->casterAuraSpell && !m_caster->HasAura(m_spellInfo->casterAuraSpell))
- return SPELL_FAILED_CASTER_AURASTATE;
- if(m_spellInfo->excludeCasterAuraSpell && m_caster->HasAura(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)
@@ -3617,20 +3637,23 @@ uint8 Spell::CanCast(bool strict)
if(target)
{
- // target state requirements (not allowed state), apply to self also
- if(m_spellInfo->TargetAuraStateNot && target->HasAuraState(AuraState(m_spellInfo->TargetAuraStateNot)))
- return SPELL_FAILED_TARGET_AURASTATE;
+ if (reqAuraState)
+ {
+ // target state requirements (not allowed state), apply to self also
+ 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->HasAura(m_spellInfo->targetAuraSpell))
- return SPELL_FAILED_CASTER_AURASTATE;
- if(m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell))
- return SPELL_FAILED_CASTER_AURASTATE;
+ if(m_spellInfo->targetAuraSpell && !target->HasAura(m_spellInfo->targetAuraSpell))
+ return SPELL_FAILED_TARGET_AURASTATE;
+
+ if(m_spellInfo->excludeTargetAuraSpell && target->HasAura(m_spellInfo->excludeTargetAuraSpell))
+ return SPELL_FAILED_TARGET_AURASTATE;
+ }
if(target != m_caster)
{
// target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds
- if(m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState)))
+ if(reqAuraState && m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState)))
return SPELL_FAILED_TARGET_AURASTATE;
// Not allow casting on flying player
diff --git a/src/game/SpellAuraDefines.h b/src/game/SpellAuraDefines.h
index 96ca0ae19c9..80cf5dcbcdf 100644
--- a/src/game/SpellAuraDefines.h
+++ b/src/game/SpellAuraDefines.h
@@ -306,7 +306,7 @@ enum AuraType
SPELL_AURA_259 = 259,
SPELL_AURA_SCREEN_EFFECT = 260,
SPELL_AURA_PHASE = 261,
- SPELL_AURA_262 = 262,
+ SPELL_AURA_ABILITY_IGNORE_AURASTATE = 262,
SPELL_AURA_ALLOW_ONLY_ABILITY = 263,
SPELL_AURA_264 = 264,
SPELL_AURA_265 = 265,
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 5bab1316d4f..ef9b9847ba0 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -316,8 +316,8 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNULL, //259 corrupt healing over time spell
&Aura::HandleNoImmediateEffect, //260 SPELL_AURA_SCREEN_EFFECT (miscvalue = id in ScreenEffect.dbc) not required any code
&Aura::HandlePhase, //261 SPELL_AURA_PHASE undetactable invisibility? implemented in Unit::isVisibleForOrDetect
- &Aura::HandleNULL, //262
- &Aura::HandleNULL, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask
+ &Aura::HandleNoImmediateEffect, //262 SPELL_AURA_ABILITY_IGNORE_AURASTATE implemented in spell::cancast
+ &Aura::HandleAuraAllowOnlyAbility, //263 SPELL_AURA_ALLOW_ONLY_ABILITY player can use only abilities set in SpellClassMask
&Aura::HandleNULL, //264 unused
&Aura::HandleNULL, //265 unused
&Aura::HandleNULL, //266 unused
@@ -4967,6 +4967,23 @@ void Aura::HandleNoReagentUseAura(bool Apply, bool Real)
/*** OTHERS ***/
/*********************************************************/
+void Aura::HandleAuraAllowOnlyAbility(bool apply, bool Real)
+{
+ if(!Real)
+ return;
+
+ if(!apply && m_target->HasAuraType(SPELL_AURA_ALLOW_ONLY_ABILITY))
+ return;
+
+ if(m_target->GetTypeId()==TYPEID_PLAYER)
+ {
+ if (apply)
+ m_target->SetFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
+ else
+ m_target->RemoveFlag(PLAYER_FLAGS, PLAYER_ALLOW_ONLY_ABILITY);
+ }
+}
+
void Aura::HandleShapeshiftBoosts(bool apply)
{
uint32 spellId = 0;
@@ -6538,3 +6555,4 @@ void Aura::HandlePhase(bool apply, bool Real)
if(m_target->GetVisibility()!=VISIBILITY_OFF)
m_target->SetVisibility(m_target->GetVisibility());
}
+
diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h
index ba8f0db4080..e3f4e6ac6b0 100644
--- a/src/game/SpellAuras.h
+++ b/src/game/SpellAuras.h
@@ -305,6 +305,7 @@ class TRINITY_DLL_SPEC Aura
Unit* GetTriggerTarget() const;
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
+ void HandleAuraAllowOnlyAbility(bool apply, bool Real);
void HandleShapeshiftBoosts(bool apply);
// Allow Apply Aura Handler to modify and access m_AuraDRGroup