*Add spell_dbc table to store dbc entries not present in client
*Remove workaround from Demonic Circle code and use the sql table instead. --HG-- branch : trunk
This commit is contained in:
@@ -165,13 +165,17 @@ 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, const std::string * custom_entries = NULL, const std::string * idname = NULL)
|
||||
{
|
||||
// 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()))
|
||||
SqlDbc * sql = NULL;
|
||||
if (custom_entries)
|
||||
sql = new SqlDbc(&filename,custom_entries, idname,storage.GetFormat());
|
||||
|
||||
if(storage.Load(dbc_filename.c_str(), sql))
|
||||
{
|
||||
bar.step();
|
||||
for(uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||
@@ -198,6 +202,8 @@ inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList
|
||||
else
|
||||
errlist.push_back(dbc_filename);
|
||||
}
|
||||
if (sql)
|
||||
delete sql;
|
||||
}
|
||||
|
||||
void LoadDBCStores(const std::string& dataPath)
|
||||
@@ -316,7 +322,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineStore, dbcPath,"SkillLine.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineAbilityStore, dbcPath,"SkillLineAbility.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSoundEntriesStore, dbcPath,"SoundEntries.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellStore, dbcPath,"Spell.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellStore, dbcPath,"Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex);
|
||||
for(uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const * spell = sSpellStore.LookupEntry(i);
|
||||
|
||||
@@ -1336,7 +1336,7 @@ struct SpellEntry
|
||||
uint32 Category; // 1 m_category
|
||||
uint32 Dispel; // 2 m_dispelType
|
||||
uint32 Mechanic; // 3 m_mechanic
|
||||
uint32 Attributes; // 4 m_attribute
|
||||
uint32 Attributes; // 4 m_attributes
|
||||
uint32 AttributesEx; // 5 m_attributesEx
|
||||
uint32 AttributesEx2; // 6 m_attributesExB
|
||||
uint32 AttributesEx3; // 7 m_attributesExC
|
||||
|
||||
+3
-1
@@ -86,7 +86,9 @@ const char SkillLineAbilityfmt[]="niiiixxiiiiixx";
|
||||
const char SoundEntriesfmt[]="nxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
const char SpellCastTimefmt[]="nixx";
|
||||
const char SpellDurationfmt[]="niii";
|
||||
const char SpellEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixx";
|
||||
const char SpellEntryfmt[]="niiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiifxiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiffffffiiiiiiiiiiiiiiiiiiiiifffiiiiiiiiiiiiiiifffiiiiiiiiiiiiixssssssssssssssssxssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxiiiiiiiiiiixfffxxxiiiiixx";
|
||||
const std::string CustomSpellEntryfmt="pappppppppaaapaaaaaaaaaaapaaapapppppppaaaaapaapaaaaaaaaaaaaaaaaaappppppppppppppppppppppppppppppppppppppppppaaaaaapppppppppaaapppppppppaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaappppppppapppaaaaappaaa";
|
||||
const std::string CustomSpellEntryIndex = "Id";
|
||||
const char SpellFocusObjectfmt[]="nxxxxxxxxxxxxxxxxx";
|
||||
const char SpellItemEnchantmentfmt[]="nxiiiiiixxxiiissssssssssssssssxiiiixxx";
|
||||
const char SpellItemEnchantmentConditionfmt[]="nbbbbbxxxxxbbbbbbbbbbiiiiiXXXXX";
|
||||
|
||||
+11
-10
@@ -4468,9 +4468,6 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
|
||||
if(!Real && !changeAmount)
|
||||
return;
|
||||
|
||||
// For prevent double apply bonuses
|
||||
bool loading = (m_target->GetTypeId() == TYPEID_PLAYER && ((Player*)m_target)->GetSession()->PlayerLoading());
|
||||
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
SpellEntry const*spell = GetSpellProto();
|
||||
@@ -4496,17 +4493,14 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
|
||||
{
|
||||
// Demonic Circle
|
||||
case 48018:
|
||||
if (apply)
|
||||
// set to false at initial cast to enable button at next enable in periodic handler
|
||||
m_target->SendAuraVisualForSelf(false,62388);
|
||||
else
|
||||
if (!apply)
|
||||
{
|
||||
// Do not remove GO when aura is removed by stack
|
||||
// to prevent remove GO added by new spell
|
||||
// old one is already removed
|
||||
if (GetParentAura()->GetRemoveMode()!=AURA_REMOVE_BY_STACK)
|
||||
m_target->RemoveGameObject(spell->Id,true);
|
||||
m_target->SendAuraVisualForSelf(false,62388);
|
||||
m_target->RemoveAura(62388);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -6380,8 +6374,15 @@ void AuraEffect::PeriodicDummyTick()
|
||||
// Demonic Circle
|
||||
case 48018:
|
||||
if(GameObject* obj = m_target->GetGameObject(spell->Id))
|
||||
// We must take a range of teleport spell, not summon.
|
||||
m_target->SendAuraVisualForSelf(m_target->IsWithinDist(obj, GetSpellMaxRange(48020, true)), 62388, 1);
|
||||
{
|
||||
if (m_target->IsWithinDist(obj, GetSpellMaxRange(48020, true)))
|
||||
{
|
||||
if (!m_target->HasAura(62388))
|
||||
m_target->CastSpell(m_target, 62388, true);
|
||||
}
|
||||
else
|
||||
m_target->RemoveAura(62388);
|
||||
}
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -3666,25 +3666,6 @@ int32 Unit::GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_
|
||||
return modifier;
|
||||
}
|
||||
|
||||
void Unit::SendAuraVisualForSelf(bool apply, uint32 id, uint8 effmask)
|
||||
{
|
||||
WorldPacket data(SMSG_AURA_UPDATE);
|
||||
data.append(GetPackGUID());
|
||||
// use always free 64+ slots
|
||||
data << uint8(MAX_AURAS);
|
||||
if (!apply)
|
||||
{
|
||||
data << uint32(0);
|
||||
SendMessageToSet(&data, true);
|
||||
return;
|
||||
}
|
||||
data << uint32(id);
|
||||
data << uint8(AFLAG_CASTER | AFLAG_POSITIVE | effmask);
|
||||
data << uint8(getLevel());
|
||||
data << uint8(1);
|
||||
SendMessageToSet(&data, true);
|
||||
}
|
||||
|
||||
bool Unit::AddAura(Aura *Aur, bool handleEffects)
|
||||
{
|
||||
// aura doesn't apply effects-return
|
||||
@@ -4274,9 +4255,6 @@ bool Unit::HasAura(uint32 spellId, uint64 caster) const
|
||||
//Special case for non existing spell
|
||||
if (spellId==61988)
|
||||
return HasAura(61987, caster) || HasAura(25771, caster);
|
||||
// Demonic Circle - special aura for client
|
||||
else if (spellId==62388)
|
||||
return HasAura(48018, caster);
|
||||
|
||||
if (Aura * aur = GetAura(spellId, caster))
|
||||
return true;
|
||||
|
||||
@@ -1642,7 +1642,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
|
||||
}
|
||||
void SetVisibleAura(uint8 slot, Aura * aur){ m_visibleAuras[slot]=aur; }
|
||||
void RemoveVisibleAura(uint8 slot){ m_visibleAuras.erase(slot); }
|
||||
void SendAuraVisualForSelf(bool apply, uint32 id, uint8 effmask = 0);
|
||||
|
||||
AuraMap & GetAuras() { return m_Auras; }
|
||||
AuraMap const& GetAuras() const { return m_Auras; }
|
||||
|
||||
Reference in New Issue
Block a user