diff options
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 19 | ||||
-rw-r--r-- | src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 | ||||
-rw-r--r-- | src/server/shared/DataStores/DBCStore.h | 6 |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d1ec8847467..85caa2c46d2 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -1938,6 +1938,25 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff RemainingDamage -= absorbed; } continue; + case 52284: // Will of the Necropolis + case 52285: + case 52286: + { + int32 remainingHp = (int32)pVictim->GetHealth() - RemainingDamage; + + // min pct of hp is stored in effect 0 of talent spell + uint32 rank = spellmgr.GetSpellRank(spellProto->Id); + SpellEntry const * talentProto = sSpellStore.LookupEntry(spellmgr.GetSpellWithRank(49189, rank)); + + int32 minHp = (float)pVictim->GetMaxHealth() * (float)SpellMgr::CalculateSpellEffectAmount(talentProto, 0, (*i)->GetCaster()) / 100.0f; + // Damage that would take you below [effect0] health or taken while you are at [effect0] + if (remainingHp < minHp) + { + uint32 absorbed = uint32(currentAbsorb * RemainingDamage * 0.01f); + RemainingDamage -= absorbed; + } + continue; + } case 48707: // Anti-Magic Shell (on self) { // damage absorbed by Anti-Magic Shell energizes the DK with additional runic power. diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 40a14f3a7d0..6d0605be39a 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -682,7 +682,7 @@ int32 AuraEffect::CalculateAmount(Unit * caster) } } // Hand of Salvation - else if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_PALADIN && m_spellProto->SpellFamilyFlags[0] & 0x00000100) + else if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_PALADIN && GetSpellProto()->SpellFamilyFlags[0] & 0x00000100) { //Glyph of Salvation if (caster->GetGUID() == GetBase()->GetUnitOwner()->GetGUID()) diff --git a/src/server/shared/DataStores/DBCStore.h b/src/server/shared/DataStores/DBCStore.h index a1a8413b6d6..22c77fadb27 100644 --- a/src/server/shared/DataStores/DBCStore.h +++ b/src/server/shared/DataStores/DBCStore.h @@ -85,14 +85,14 @@ class DBCStorage Field *fields = NULL; QueryResult_AutoPtr result = QueryResult_AutoPtr(NULL); // Load data from sql - if (false/*sql*/) + if (sql) { std::string query = "SELECT * FROM " + sql->sqlTableName; if (sql->indexPos >= 0) query +=" ORDER BY " + *sql->indexName + " DESC"; query += ";"; - /* + result = WorldDatabase.Query(query.c_str()); if (result) { @@ -108,7 +108,7 @@ class DBCStorage sLog.outError("Invalid index pos for dbc:'%s'", sql->sqlTableName.c_str()); return false; } - }*/ + } } char * sqlDataTable; fieldCount = dbc.GetCols(); |