Use spell_bonus_data table for store custom damage/healing bonus coefficients

Big thanks ApoC for help create table.
Fixed bonuses for stacked periodic
Warning need test all coefficients for correct bonus amount.
TODO:
 use this table for absorb bonus calculation
 use this table for melee spells AP bonuses
 use chain multipler in final damage/heal amount

Signed-off-by: DiSlord <dislord@nomail.com>
This commit is contained in:
DiSlord 2009-01-28 02:23:16 +03:00
parent 6d9a099a19
commit 4ecfbcc2f5
13 changed files with 711 additions and 402 deletions

View file

@ -834,7 +834,7 @@ void SpellMgr::LoadSpellProcEvents()
bar.step();
uint16 entry = fields[0].GetUInt16();
uint32 entry = fields[0].GetUInt32();
const SpellEntry *spell = sSpellStore.LookupEntry(entry);
if (!spell)
@ -878,6 +878,50 @@ void SpellMgr::LoadSpellProcEvents()
sLog.outString( ">> Loaded %u extra spell proc event conditions", count );
}
void SpellMgr::LoadSpellBonusess()
{
mSpellBonusMap.clear(); // need for reload case
uint32 count = 0;
// 0 1 2 3
QueryResult *result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus FROM spell_bonus_data");
if( !result )
{
barGoLink bar( 1 );
bar.step();
sLog.outString();
sLog.outString( ">> Loaded %u spell bonus data", count);
return;
}
barGoLink bar( result->GetRowCount() );
do
{
Field *fields = result->Fetch();
bar.step();
uint32 entry = fields[0].GetUInt32();
const SpellEntry *spell = sSpellStore.LookupEntry(entry);
if (!spell)
{
sLog.outErrorDb("Spell %u listed in `spell_bonus_data` does not exist", entry);
continue;
}
SpellBonusEntry sbe;
sbe.direct_damage = fields[1].GetFloat();
sbe.dot_damage = fields[2].GetFloat();
sbe.ap_bonus = fields[3].GetFloat();
mSpellBonusMap[entry] = sbe;
} while( result->NextRow() );
delete result;
sLog.outString();
sLog.outString( ">> Loaded %u extra spell bonus data", count);
}
bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const * spellProcEvent, uint32 EventProcFlag, SpellEntry const * procSpell, uint32 procFlags, uint32 procExtra, bool active)
{
// No extra req need