Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/arcemu-shared/Database/DBCStores.cpp
- ===================================================================
- --- src/arcemu-shared/Database/DBCStores.cpp (revision 4203)
- +++ src/arcemu-shared/Database/DBCStores.cpp (working copy)
- @@ -65,6 +65,7 @@
- SERVER_DECL DBCStorage<skilllinespell> dbcSkillLineSpell;
- SERVER_DECL DBCStorage<skilllineentry> dbcSkillLine;
- SERVER_DECL DBCStorage<SpellCastTime> dbcSpellCastTime;
- +SERVER_DECL DBCStorage<SpellDifficultyEntry> dbcSpellDifficultyEntry;
- SERVER_DECL DBCStorage<SpellDuration> dbcSpellDuration;
- SERVER_DECL DBCStorage<SpellEntry> dbcSpell;
- SERVER_DECL DBCStorage<SpellRadius> dbcSpellRadius;
- @@ -272,7 +273,7 @@
- "x" //Added in 3.1
- "xxx" // unk 3.2.0, float!
- "x" // unk 3.2.0
- - "x"
- + "i"
- ;
- @@ -291,7 +292,6 @@
- const char* auctionhousedbcFormat = "uuuuxxxxxxxxxxxxxxxxx";
- const char* factiondbcFormat = "uiuuuuuuuuiiiiuuuuulxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
- -
- const char* dbctaxinodeFormat = "uufffxxxxxxxxxxxxxxxxxuu";
- const char* dbctaxipathFormat = "uuuu";
- const char* dbctaxipathnodeFormat = "uuuufffuuxx";
- @@ -331,6 +331,7 @@
- const char* scalingstatvaluesformat = "uuuuuuuuuuuuuuuuuuxxxxxx";
- const char* itemlimitcategoryformat = "usxxxxxxxxxxxxxxxxuu";
- const char* spellshapeshiftformformat = "uxxxxxxxxxxxxxxxxxxuuxuuuxxuuuuuuuu";
- +const char* spelldifficultyentryformat = "niiii";
- const char* questxpformat = "uxuuuuuuuux";
- const char* wmoareaformat = "uiiixxxxxuuxxxxxxxxxxxxxxxxx";
- @@ -369,6 +370,7 @@
- LOAD_DBC("DBC/Talent.dbc", talententryFormat, true, dbcTalent, false);
- LOAD_DBC("DBC/TalentTab.dbc", talenttabentryFormat, true, dbcTalentTab, false);
- LOAD_DBC("DBC/SpellCastTimes.dbc", spellcasttimeFormat, true, dbcSpellCastTime, false);
- + LOAD_DBC("DBC/SpellDifficulty.dbc", spelldifficultyentryformat, true, dbcSpellDifficultyEntry, false);
- LOAD_DBC("DBC/SpellRadius.dbc", spellradiusFormat, true, dbcSpellRadius, false);
- LOAD_DBC("DBC/SpellRange.dbc", spellrangeFormat, true, dbcSpellRange, false);
- LOAD_DBC("DBC/SpellRuneCost.dbc", SpellRuneCostFormat, true, dbcSpellRuneCost, false);
- Index: src/arcemu-shared/Database/DBCStores.h
- ===================================================================
- --- src/arcemu-shared/Database/DBCStores.h (revision 4203)
- +++ src/arcemu-shared/Database/DBCStores.h (working copy)
- @@ -773,7 +773,7 @@
- // uint32 UnKnown; //231
- // uint32 UnKnown; //232
- // uint32 SpellDescriptionVariable; //233 References SpellDescriptionVariables.dbc
- -// uint32 SpellDifficultyID; //234 References SpellDifficulty.dbc
- + uint32 SpellDifficultyID; //234 References SpellDifficulty.dbc
- /// CUSTOM: these fields are used for the modifications made in the world.cpp
- uint32 DiminishStatus; //
- @@ -1018,6 +1018,14 @@
- // uint32 unk2;
- };
- +#define MAP_DIFFICULTY 4
- +
- +struct SpellDifficultyEntry
- +{
- + uint32 ID;
- + uint32 SpellId[MAP_DIFFICULTY];
- +};
- +
- struct SpellRadius
- {
- uint32 ID;
- @@ -1744,6 +1752,7 @@
- extern SERVER_DECL DBCStorage<ItemSetEntry> dbcItemSet;
- extern SERVER_DECL DBCStorage<Lock> dbcLock;
- extern SERVER_DECL DBCStorage<SpellEntry> dbcSpell;
- +extern SERVER_DECL DBCStorage<SpellDifficultyEntry> dbcSpellDifficultyEntry;
- extern SERVER_DECL DBCStorage<SpellDuration> dbcSpellDuration;
- extern SERVER_DECL DBCStorage<SpellRange> dbcSpellRange;
- extern SERVER_DECL DBCStorage<SpellShapeshiftForm> dbcSpellShapeshiftForm;
- Index: src/arcemu-world/Spell.cpp
- ===================================================================
- --- src/arcemu-world/Spell.cpp (revision 4203)
- +++ src/arcemu-world/Spell.cpp (working copy)
- @@ -154,8 +154,20 @@
- Spell::Spell(Object* Caster, SpellEntry *info, bool triggered, Aura* aur)
- {
- - Arcemu::Util::ARCEMU_ASSERT( Caster != NULL && info != NULL );
- + Arcemu::Util::ARCEMU_ASSERT( Caster != NULL && info != NULL );
- + Arcemu::Util::ARCEMU_ASSERT( info==dbcSpell.LookupEntry(info->Id) && "`info` must be pointer to dbcSpell element" );
- + Instance* pInstance = NULL;
- + if (info->SpellDifficultyID && Caster->GetTypeId() != TYPEID_PLAYER && Caster->IsInWorld() && IS_PERSISTENT_INSTANCE(pInstance))
- + {
- + if (SpellEntry *spellEntry = GetSpellEntryByDifficulty(info->SpellDifficultyID, pInstance->m_difficulty))
- + m_spellInfo = spellEntry;
- + else
- + m_spellInfo = info;
- + }
- + else
- + m_spellInfo = info;
- +
- Caster->m_pendingSpells.insert(this);
- m_overrideBasePoints = false;
- m_overridenBasePoints[0] = 0xFFFFFFFF;
- Index: src/arcemu-world/SpellMgr.cpp
- ===================================================================
- --- src/arcemu-world/SpellMgr.cpp (revision 4203)
- +++ src/arcemu-world/SpellMgr.cpp (working copy)
- @@ -76,6 +76,22 @@
- }
- }
- +SpellEntry* GetSpellEntryByDifficulty(uint32 id, uint32 difficulty)
- +{
- + SpellDifficultyEntry* spellDiff = dbcSpellDifficultyEntry.LookupEntry(id);
- + Instance* pInstance = NULL;
- +
- + if (!spellDiff)
- + return NULL;
- +
- + difficulty = pInstance->m_difficulty;
- + if (!spellDiff->SpellId[difficulty])
- + return NULL;
- +
- + SpellEntry* spellDifficulty = dbcSpell.LookupEntry(spellDiff->SpellId[difficulty]);
- + return spellDifficulty;
- +}
- +
- Spell* SpellFactoryMgr::NewSpell(Object* Caster, SpellEntry *info, bool triggered, Aura* aur)
- {
- if( info->SpellFactoryFunc == NULL )
- Index: src/arcemu-world/SpellMgr.h
- ===================================================================
- --- src/arcemu-world/SpellMgr.h (revision 4203)
- +++ src/arcemu-world/SpellMgr.h (working copy)
- @@ -38,6 +38,8 @@
- typedef Spell *(*spell_factory_function)(Object* Caster, SpellEntry *info, bool triggered, Aura* aur);
- typedef Aura *(*aura_factory_function)(SpellEntry *proto, int32 duration, Object* caster, Unit *target, bool temporary, Item* i_caster);
- +SpellEntry* GetSpellEntryByDifficulty(uint32 id, uint32 difficulty);
- +
- class SERVER_DECL SpellFactoryMgr: public Singleton < SpellFactoryMgr >
- {
- public:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement