Core/Auras: Implemented aura SPELL_AURA_OVERRIDE_SPELLS (293), base patch by Heisenberg, research by TOM_RUS

Closes issue #4969.

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-11-30 21:32:00 +01:00
parent 782731f7e8
commit 445dc511f3
6 changed files with 47 additions and 2 deletions

View File

@@ -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)

View File

@@ -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;

View File

@@ -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

View File

@@ -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";

View File

@@ -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))

View File

@@ -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;
};