aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <none@none>2010-11-30 21:32:00 +0100
committerShauren <none@none>2010-11-30 21:32:00 +0100
commit445dc511f3659fc23cd39dfa00c54d21e9920eef (patch)
tree0e93d93ec213880886adb39cecff99dd4b630ada /src
parent782731f7e8d116e7116642b64caaed5285e6102b (diff)
Core/Auras: Implemented aura SPELL_AURA_OVERRIDE_SPELLS (293), base patch by Heisenberg, research by TOM_RUS
Closes issue #4969. --HG-- branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.cpp5
-rwxr-xr-xsrc/server/game/DataStores/DBCStores.h1
-rwxr-xr-xsrc/server/game/DataStores/DBCStructure.h9
-rwxr-xr-xsrc/server/game/DataStores/DBCfmt.h1
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp32
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h1
6 files changed, 47 insertions, 2 deletions
diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp
index 490f9b1b18a..1f82f96dac6 100755
--- a/src/server/game/DataStores/DBCStores.cpp
+++ b/src/server/game/DataStores/DBCStores.cpp
@@ -128,6 +128,8 @@ MapDifficultyMap sMapDifficultyMap;
DBCStorage <MovieEntry> sMovieStore(MovieEntryfmt);
+DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore(OverrideSpellDatafmt);
+
DBCStorage <PvPDifficultyEntry> sPvPDifficultyStore(PvPDifficultyfmt);
DBCStorage <QuestSortEntry> sQuestSortStore(QuestSortEntryfmt);
@@ -244,7 +246,7 @@ void LoadDBCStores(const std::string& dataPath)
{
std::string dbcPath = dataPath+"dbc/";
- const uint32 DBCFilesCount = 89;
+ const uint32 DBCFilesCount = 90;
barGoLink bar(DBCFilesCount);
@@ -357,6 +359,7 @@ void LoadDBCStores(const std::string& dataPath)
sMapDifficultyStore.Clear();
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sMovieStore, dbcPath,"Movie.dbc");
+ LoadDBC(availableDbcLocales,bar,bad_dbc_files,sOverrideSpellDataStore, dbcPath,"OverrideSpellData.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sQuestSortStore, dbcPath,"QuestSort.dbc");
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sPvPDifficultyStore, dbcPath,"PvpDifficulty.dbc");
for (uint32 i = 0; i < sPvPDifficultyStore.GetNumRows(); ++i)
diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h
index ef6c22f626f..5d90e92d725 100755
--- a/src/server/game/DataStores/DBCStores.h
+++ b/src/server/game/DataStores/DBCStores.h
@@ -121,6 +121,7 @@ extern DBCStorage <MapEntry> sMapStore;
//extern DBCStorage <MapDifficultyEntry> sMapDifficultyStore; -- use GetMapDifficultyData insteed
extern MapDifficultyMap sMapDifficultyMap;
extern DBCStorage <MovieEntry> sMovieStore;
+extern DBCStorage <OverrideSpellDataEntry> sOverrideSpellDataStore;
extern DBCStorage <QuestSortEntry> sQuestSortStore;
extern DBCStorage <QuestXPEntry> sQuestXPStore;
extern DBCStorage <QuestFactionRewEntry> sQuestFactionRewardStore;
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index f8cf20dcf4a..bfc590259a1 100755
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -1230,6 +1230,15 @@ struct MovieEntry
//uint32 unk2; // 2 always 100
};
+#define MAX_OVERRIDE_SPELL 10
+
+struct OverrideSpellDataEntry
+{
+ uint32 id; // 0
+ uint32 spellId[MAX_OVERRIDE_SPELL]; // 1-10
+ //uint32 unk0; // 11
+};
+
struct PvPDifficultyEntry
{
//uint32 id; // 0 m_ID
diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h
index ec35349fe75..d3c9a011704 100755
--- a/src/server/game/DataStores/DBCfmt.h
+++ b/src/server/game/DataStores/DBCfmt.h
@@ -77,6 +77,7 @@ const char MailTemplateEntryfmt[]="nxxxxxxxxxxxxxxxxxssssssssssssssssx";
const char MapEntryfmt[]="nxixxssssssssssssssssxixxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixiffxiix";
const char MapDifficultyEntryfmt[]="diisxxxxxxxxxxxxxxxxiix";
const char MovieEntryfmt[]="nxx";
+const char OverrideSpellDatafmt[]="niiiiiiiiiix";
const char QuestSortEntryfmt[]="nxxxxxxxxxxxxxxxxx";
const char QuestXPfmt[]="niiiiiiiiii";
const char QuestFactionRewardfmt[]="niiiiiiiiii";
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index a877d7ea5e3..74bc857f7e2 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -345,7 +345,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleAuraModCritPct, //290 SPELL_AURA_MOD_CRIT_PCT
&AuraEffect::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
&AuraEffect::HandleAuraOpenStable, //292 SPELL_AURA_OPEN_STABLE
- &AuraEffect::HandleNULL, //293 auras which probably add set of abilities to their target based on it's miscvalue
+ &AuraEffect::HandleAuraOverrideSpells, //293 auras which probably add set of abilities to their target based on it's miscvalue
&AuraEffect::HandleNoImmediateEffect, //294 SPELL_AURA_PREVENT_REGENERATE_POWER implemented in Player::Regenerate(Powers power)
&AuraEffect::HandleNULL, //295 0 spells in 3.3.5
&AuraEffect::HandleAuraSetVehicle, //296 SPELL_AURA_SET_VEHICLE_ID sets vehicle on target
@@ -6461,6 +6461,36 @@ void AuraEffect::HandleAuraModFakeInebriation(AuraApplication const * aurApp, ui
target->UpdateObjectVisibility();
}
+void AuraEffect::HandleAuraOverrideSpells(AuraApplication const * aurApp, uint8 mode, bool apply) const
+{
+ if (!(mode & AURA_EFFECT_HANDLE_REAL))
+ return;
+
+ Player * target = aurApp->GetTarget()->ToPlayer();
+
+ if (!target || !target->IsInWorld())
+ return;
+
+ uint32 overrideId = uint32(GetMiscValue());
+
+ if (apply)
+ {
+ target->SetUInt32Value(PLAYER_FIELD_BYTES2, overrideId);
+ if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
+ for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
+ if (uint32 spellId = overrideSpells->spellId[i])
+ target->AddTemporarySpell(spellId);
+ }
+ else
+ {
+ target->SetUInt32Value(PLAYER_FIELD_BYTES2, 0);
+ if (OverrideSpellDataEntry const* overrideSpells = sOverrideSpellDataStore.LookupEntry(overrideId))
+ for (uint8 i = 0; i < MAX_OVERRIDE_SPELL; ++i)
+ if (uint32 spellId = overrideSpells->spellId[i])
+ target->RemoveTemporarySpell(spellId);
+ }
+}
+
void AuraEffect::HandleAuraSetVehicle(AuraApplication const * aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 3612d9ad6be..2807e621673 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -258,6 +258,7 @@ class AuraEffect
void HandleAuraConvertRune(AuraApplication const * aurApp, uint8 mode, bool apply) const;
void HandleAuraLinked(AuraApplication const * aurApp, uint8 mode, bool apply) const;
void HandleAuraOpenStable(AuraApplication const * aurApp, uint8 mode, bool apply) const;
+ void HandleAuraOverrideSpells(AuraApplication const * aurApp, uint8 mode, bool apply) const;
void HandleAuraSetVehicle(AuraApplication const * aurApp, uint8 mode, bool apply) const;
void HandleAuraModFakeInebriation(AuraApplication const * aurApp, uint8 mode, bool apply) const;
};