aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-08-18 18:47:20 +0200
committerQAston <none@none>2009-08-18 18:47:20 +0200
commitea986991874369f4b244676001f39767efdf4f32 (patch)
tree0aa455d75c6fca9f9d1305cbe2e07f5b82fcdd9e /src
parent84bb5022f5bec20c34940a09ba25054625130afb (diff)
*Fix a typo in xp bonus auras.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/DBCStores.cpp10
-rw-r--r--src/game/Player.cpp6
-rw-r--r--src/game/SpellAuras.cpp4
-rw-r--r--src/shared/Database/DBCFileLoader.cpp4
-rw-r--r--src/shared/Database/DBCFileLoader.h2
-rw-r--r--src/shared/Database/DBCStore.h4
6 files changed, 13 insertions, 17 deletions
diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp
index 42780870499..1ecc5ef8dd0 100644
--- a/src/game/DBCStores.cpp
+++ b/src/game/DBCStores.cpp
@@ -165,13 +165,13 @@ static bool LoadDBC_assert_print(uint32 fsize,uint32 rsize, const std::string& f
}
template<class T>
-inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename)
+inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList& errlist, DBCStorage<T>& storage, const std::string& dbc_path, const std::string& filename, uint32 customEntriesCount = 0)
{
// compatibility format and C++ structure sizes
assert(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()) == sizeof(T) || LoadDBC_assert_print(DBCFileLoader::GetFormatRecordSize(storage.GetFormat()),sizeof(T),filename));
std::string dbc_filename = dbc_path + filename;
- if(storage.Load(dbc_filename.c_str()))
+ if(storage.Load(dbc_filename.c_str()), customEntriesCount)
{
bar.step();
for(uint8 i = 0; i < MAX_LOCALE; ++i)
@@ -322,12 +322,6 @@ void LoadDBCStores(const std::string& dataPath)
SpellEntry const * spell = sSpellStore.LookupEntry(i);
if(spell && spell->Category)
sSpellCategoryStore[spell->Category].insert(i);
-
- /*// DBC not support uint64 fields but SpellEntry have SpellFamilyFlags mapped at 2 uint32 fields
- // uint32 field already converted to bigendian if need, but must be swapped for correct uint64 bigendian view
- #if TRINITY_ENDIAN == TRINITY_BIGENDIAN
- std::swap(*((uint32*)(&spell->SpellFamilyFlags)),*(((uint32*)(&spell->SpellFamilyFlags))+1));
- #endif*/
}
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index e081958cf38..333b5c426d9 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13175,7 +13175,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
// handle SPELL_AURA_MOD_XP_QUEST_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_QUEST_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
- XP = uint32(XP*(100.0f + (*i)->GetAmount() / 100.0f));
+ XP = uint32(XP*(1.0f + (*i)->GetAmount() / 100.0f));
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
GiveXP( XP , NULL );
@@ -20054,7 +20054,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
- itr_xp = uint32(itr_xp*(100.0f + (*i)->GetAmount() / 100.0f));
+ itr_xp = uint32(itr_xp*(1.0f + (*i)->GetAmount() / 100.0f));
pGroupGuy->GiveXP(itr_xp, pVictim);
if(Pet* pet = pGroupGuy->GetPet())
@@ -20088,7 +20088,7 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
- xp = uint32(xp*(100.0f + (*i)->GetAmount() / 100.0f));
+ xp = uint32(xp*(1.0f + (*i)->GetAmount() / 100.0f));
GiveXP(xp, pVictim);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 23ca4a676b7..349f1836977 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -99,7 +99,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, // 43 SPELL_AURA_PROC_TRIGGER_DAMAGE implemented in Unit::ProcDamageAndSpellFor
&Aura::HandleAuraTrackCreatures, // 44 SPELL_AURA_TRACK_CREATURES
&Aura::HandleAuraTrackResources, // 45 SPELL_AURA_TRACK_RESOURCES
- &Aura::HandleUnused, // 46 SPELL_AURA_46 (used in test spells 54054 and 54058, and spell 48050) (3.0.8a)
+ &Aura::HandleNULL, // 46 SPELL_AURA_46 (used in test spells 54054 and 54058, and spell 48050) (3.0.8a)
&Aura::HandleAuraModParryPercent, // 47 SPELL_AURA_MOD_PARRY_PERCENT
&Aura::HandleNULL, // 48 SPELL_AURA_48 spell Napalm (area damage spell with additional delayed damage effect)
&Aura::HandleAuraModDodgePercent, // 49 SPELL_AURA_MOD_DODGE_PERCENT
@@ -116,7 +116,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleAuraModPacifyAndSilence, // 60 SPELL_AURA_MOD_PACIFY_SILENCE
&Aura::HandleAuraModScale, // 61 SPELL_AURA_MOD_SCALE
&Aura::HandlePeriodicHealthFunnel, // 62 SPELL_AURA_PERIODIC_HEALTH_FUNNEL
- &Aura::HandleUnused, // 63 unused (3.0.8a) old SPELL_AURA_PERIODIC_MANA_FUNNEL
+ &Aura::HandleNULL, // 63 unused (3.0.8a) old SPELL_AURA_PERIODIC_MANA_FUNNEL
&Aura::HandlePeriodicManaLeech, // 64 SPELL_AURA_PERIODIC_MANA_LEECH
&Aura::HandleModCastingSpeed, // 65 SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK
&Aura::HandleFeignDeath, // 66 SPELL_AURA_FEIGN_DEATH
diff --git a/src/shared/Database/DBCFileLoader.cpp b/src/shared/Database/DBCFileLoader.cpp
index 23f602f5c93..dc968fbce3b 100644
--- a/src/shared/Database/DBCFileLoader.cpp
+++ b/src/shared/Database/DBCFileLoader.cpp
@@ -30,7 +30,7 @@ DBCFileLoader::DBCFileLoader()
fieldsOffset = NULL;
}
-bool DBCFileLoader::Load(const char *filename, const char *fmt)
+bool DBCFileLoader::Load(const char *filename, const char *fmt, uint32 customEntriesCount)
{
uint32 header;
@@ -55,6 +55,8 @@ bool DBCFileLoader::Load(const char *filename, const char *fmt)
EndianConvert(recordCount);
+ recordCount += customEntriesCount;
+
if(fread(&fieldCount,4,1,f)!=1) // Number of fields
return false;
diff --git a/src/shared/Database/DBCFileLoader.h b/src/shared/Database/DBCFileLoader.h
index 13562148dfc..ebdfef4523c 100644
--- a/src/shared/Database/DBCFileLoader.h
+++ b/src/shared/Database/DBCFileLoader.h
@@ -41,7 +41,7 @@ class DBCFileLoader
DBCFileLoader();
~DBCFileLoader();
- bool Load(const char *filename, const char *fmt);
+ bool Load(const char *filename, const char *fmt, uint32 customEntriesCount = 0);
class Record
{
diff --git a/src/shared/Database/DBCStore.h b/src/shared/Database/DBCStore.h
index 523d5c5a0b3..2906a93edbc 100644
--- a/src/shared/Database/DBCStore.h
+++ b/src/shared/Database/DBCStore.h
@@ -34,11 +34,11 @@ class DBCStorage
char const* GetFormat() const { return fmt; }
uint32 GetFieldCount() const { return fieldCount; }
- bool Load(char const* fn)
+ bool Load(char const* fn, uint32 customEntriesCount = 0)
{
DBCFileLoader dbc;
// Check if load was sucessful, only then continue
- if(!dbc.Load(fn, fmt))
+ if(!dbc.Load(fn, fmt, customEntriesCount))
return false;
fieldCount = dbc.GetCols();