- Index: src/ascent-shared/Database/DBCStores.h
- ===================================================================
- --- src/ascent-shared/Database/DBCStores.h (revision 3757)
- +++ src/ascent-shared/Database/DBCStores.h (working copy)
- -353,6 +353,15 @@
- uint32 EffectSpellGroupRelation_high[3]; //!!! this is not contained in client dbc but server must have it
- uint32 ThreatForSpell;
- bool can_be_dispelled; //!!! CUSTOM
- +
- + //Spell Coefficient
- + float casttime_coef; //!!! CUSTOM, faster spell bonus calculation
- + uint32 spell_coef_flags; //!!! CUSTOM, store flags for spell coefficient calculations
- + float fixed_dddhcoef; //!!! CUSTOM, fixed DD-DH coefficient for some spells
- + float fixed_hotdotcoef; //!!! CUSTOM, fixed HOT-DOT coefficient for some spells
- + float Dspell_coef_override; //!!! CUSTOM, overrides any spell coefficient calculation and use this value in DD&DH
- + float OTspell_coef_override; //!!! CUSTOM, overrides any spell coefficient calculation and use this value in HOT&DOT
- +
- };
- struct ItemExtendedCostEntry
- Index: src/ascent-world/Object.cpp
- ===================================================================
- --- src/ascent-world/Object.cpp (revision 3757)
- +++ src/ascent-world/Object.cpp (working copy)
- -2182,7 +2182,7 @@
- {
- Unit* caster = static_cast< Unit* >( this );
- caster->RemoveAurasByInterruptFlag( AURA_INTERRUPT_ON_START_ATTACK );
- - res += caster->GetSpellDmgBonus( pVictim, spellInfo, ( int )res );
- + res += caster->GetSpellDmgBonus( pVictim, spellInfo, ( int )res, false);
- //==========================================================================================
- //==============================Post +SpellDamage Bonus Modifications=======================
- //==========================================================================================
- Index: src/ascent-world/Spell.cpp
- ===================================================================
- --- src/ascent-world/Spell.cpp (revision 3757)
- +++ src/ascent-world/Spell.cpp (working copy)
- -4000,22 +4000,13 @@
- //Make it critical
- bool critical = false;
- int32 bonus = 0;
- - float healdoneaffectperc = 0;
- + float healdoneaffectperc = 1.0f;
- if( u_caster != NULL )
- {
- - SpellCastTime *sd = dbcSpellCastTime.LookupEntry(m_spellInfo->CastingTimeIndex);
- - // affect the plus damage by duration
- - float castaff = float(GetCastTime(sd));
- - if(castaff > 3500)
- - castaff = 3500;
- - else if(castaff < 1500)
- - castaff = 1500;
- -
- - healdoneaffectperc = castaff / 3500.0f;
- //Downranking
- - /*if( m_spellInfo->baseLevel > 0 && m_spellInfo->maxLevel > 0 && p_caster)
- + if(p_caster && p_caster->IsPlayer() && m_spellInfo->baseLevel > 0 && m_spellInfo->maxLevel > 0)
- {
- float downrank1 = 1.0f;
- if (m_spellInfo->baseLevel < 20)
- -4024,11 +4015,33 @@
- if (downrank2 >= 1 || downrank2 < 0)
- downrank2 = 1.0f;
- healdoneaffectperc *= downrank1 * downrank2;
- - }*/
- + }
- - //caster sided bonus
- - bonus += u_caster->HealDoneMod[m_spellInfo->School] + (amount*u_caster->HealDonePctMod[m_spellInfo->School])/100;
- + //Spells Not affected by Bonus Healing
- + if(m_spellInfo->NameHash == SPELL_HASH_SEAL_OF_LIGHT) //Seal of Light
- + healdoneaffectperc = 0.0f;
- + //Basic bonus
- + bonus += u_caster->HealDoneMod[m_spellInfo->School];
- + bonus += unitTarget->HealTakenMod[m_spellInfo->School];
- +
- + //Bonus from Intellect & Spirit
- + if( p_caster != NULL )
- + {
- + bonus += float2int32(p_caster->SpellHealDoneByInt[m_spellInfo->School] * p_caster->GetUInt32Value(UNIT_FIELD_STAT3));
- + bonus += float2int32(p_caster->SpellHealDoneBySpr[m_spellInfo->School] * p_caster->GetUInt32Value(UNIT_FIELD_STAT4));
- + }
- +
- + //Spell Coefficient
- + if( m_spellInfo->Dspell_coef_override >= 0 ) //In case we have forced coefficients
- + bonus = float2int32( float( bonus ) * m_spellInfo->Dspell_coef_override );
- + else
- + {
- + //Bonus to DH part
- + if( m_spellInfo->fixed_dddhcoef >= 0 )
- + bonus = float2int32( float( bonus ) * m_spellInfo->fixed_dddhcoef );
- + }
- +
- if(m_spellInfo->SpellGroupType)
- {
- int penalty_pct = 0;
- -4046,12 +4059,11 @@
- printf("!!!!!HEAL : spell dmg bonus(p=24) mod flat %d , spell dmg bonus(p=24) pct %d , spell dmg bonus %d, spell group %u\n",spell_flat_modifers,spell_pct_modifers,bonus,m_spellInfo->SpellGroupType);
- #endif
- }
- -// amount += float2int32(u_caster->HealDoneMod[m_spellInfo->School] * healdoneaffectperc);
- -// amount += (amount*u_caster->HealDonePctMod[m_spellInfo->School])/100;
- - bonus += unitTarget->HealTakenMod[m_spellInfo->School];//amt of health that u RECIVE, not heal
- - bonus += float2int32(unitTarget->HealTakenPctMod[m_spellInfo->School]*amount);
- + amount += float2int32( float( bonus ) * healdoneaffectperc ); //apply downranking on final value ?
- + amount += amount*u_caster->HealDonePctMod[m_spellInfo->School]/100;
- + amount += float2int32( float( amount ) * unitTarget->HealTakenPctMod[m_spellInfo->School] );
- float spellCrit = u_caster->spellcritperc + u_caster->SpellCritChanceSchool[m_spellInfo->School];
- SM_FFValue(u_caster->SM_CriticalChance, &spellCrit, m_spellInfo->SpellGroupType);
- -4079,14 +4091,6 @@
- }
- - if( p_caster != NULL )
- - {
- - bonus += float2int32( p_caster->SpellHealDoneByInt[m_spellInfo->School] * p_caster->GetUInt32Value( UNIT_FIELD_STAT3 ) );
- - bonus += float2int32( p_caster->SpellHealDoneBySpr[m_spellInfo->School] * p_caster->GetUInt32Value( UNIT_FIELD_STAT4 ) );
- - }
- -
- - amount += float2int32( float( bonus ) * healdoneaffectperc ); //apply downranking on final value ?
- -
- if( amount < 0 )
- amount = 0;
- -4108,8 +4112,11 @@
- unitTarget->ModUInt32Value(UNIT_FIELD_HEALTH, amount);
- if (p_caster)
- + {
- p_caster->m_casted_amount[m_spellInfo->School]=amount;
- + p_caster->HandleProc(PROC_ON_CAST_SPECIFIC_SPELL | PROC_ON_CAST_SPELL,unitTarget, m_spellInfo);
- + }
- int doneTarget = 0;
- // add threat
- Index: src/ascent-world/Spell.h
- ===================================================================
- --- src/ascent-world/Spell.h (revision 3757)
- +++ src/ascent-world/Spell.h (working copy)
- -974,6 +974,15 @@
- SPELL_FLAG_IS_EXPIREING_ON_PET = 0x00000800, //when pet is summoned
- };
- +enum SpellCoefficientsFlags
- +{
- + SPELL_FLAG_IS_DOT_OR_HOT_SPELL = 0x00000001, //Damage over Time or Healing over Time Spells
- + SPELL_FLAG_IS_DD_OR_DH_SPELL = 0x00000002, //Direct Damage or Direct Healing Spells
- + SPELL_FLAG_IS_DD_DH_DOT_SPELL = SPELL_FLAG_IS_DOT_OR_HOT_SPELL | SPELL_FLAG_IS_DD_OR_DH_SPELL, //DoT+(DD|DH) Spells
- + SPELL_FLAG_AOE_SPELL = 0x00000004, //AoE Spells
- + SPELL_FLAG_ADITIONAL_EFFECT = 0x00000008, //Spells with aditional effect not DD or DoT or HoT
- +};
- +
- ASCENT_INLINE bool CanAgroHash(uint32 spellhashname)
- {
- if (spellhashname == 4287212498UL) //hunter's mark
- Index: src/ascent-world/SpellAuras.cpp
- ===================================================================
- --- src/ascent-world/SpellAuras.cpp (revision 3757)
- +++ src/ascent-world/SpellAuras.cpp (working copy)
- -1184,11 +1184,10 @@
- {
- if( GetSpellProto() && GetSpellProto()->NameHash == SPELL_HASH_IGNITE ) //static damage for Ignite. Need to be reworked when "static DoTs" will be implemented
- bonus_damage=0;
- - else bonus_damage = (float)c->GetSpellDmgBonus(m_target,m_spellProto,amount);
- + else bonus_damage = (float)c->GetSpellDmgBonus(m_target,m_spellProto,amount,true);
- float ticks= float((amp) ? GetDuration()/amp : 0);
- float fbonus = float(bonus);
- fbonus += (ticks) ? bonus_damage/ticks : 0;
- - fbonus *= float(GetDuration()) / 15000.0f;
- bonus = float2int32(fbonus);
- }
- else bonus = 0;
- -2102,15 +2101,30 @@
- {
- bonus += float2int32( static_cast< Player* >( c )->SpellHealDoneByInt[m_spellProto->School] * static_cast< Player* >( c )->GetUInt32Value( UNIT_FIELD_STAT3 ) );
- bonus += float2int32( static_cast< Player* >( c )->SpellHealDoneBySpr[m_spellProto->School] * static_cast< Player* >( c )->GetUInt32Value( UNIT_FIELD_STAT4 ) );
- - bonus += c->HealDoneMod[GetSpellProto()->School];
- + bonus += c->HealDoneMod[GetSpellProto()->School] + m_target->HealTakenMod[m_spellProto->School];
- //Druid Tree of Life form. it should work not like this, but it's better then nothing.
- if( static_cast< Player* >( c )->IsInFeralForm() && static_cast< Player* >( c )->GetShapeShift() == FORM_TREE)
- bonus += float2int32( 0.25f * static_cast< Player* >( c )->GetUInt32Value( UNIT_FIELD_STAT4 ) );
- - }
- - if( c != NULL )
- - {
- - bonus += m_target->HealTakenMod[m_spellProto->School] + (amount * c->HealDonePctMod[m_spellProto->School]) / 100;
- + //Spell Coefficient
- + if( m_spellProto->OTspell_coef_override >= 0 ) //In case we have forced coefficients
- + bonus = float2int32( float( bonus ) * m_spellProto->OTspell_coef_override );
- + else
- + {
- + //Bonus to HoT part
- + if( m_spellProto->fixed_hotdotcoef >= 0 )
- + {
- + bonus = float2int32( float( bonus ) * m_spellProto->fixed_hotdotcoef );
- + //we did most calculations in world.cpp, but talents that increase DoT spells duration
- + //must be included now.
- + if( c->IsPlayer() )
- + {
- + int durmod = 0;
- + SM_FIValue(c->SM_FDur, &durmod, m_spellProto->SpellGroupType);
- + bonus += float2int32( float( bonus * durmod ) / 15000.0f );
- + }
- + }
- + }
- }
- if( c != NULL && m_spellProto->SpellGroupType )
- -2132,14 +2146,13 @@
- }
- int amp = m_spellProto->EffectAmplitude[mod->i];
- - if( amp > 0 )
- + if( !amp )
- amp = static_cast< EventableObject* >( this )->event_GetEventPeriod( EVENT_AURA_PERIODIC_HEAL );
- if( GetDuration() )
- {
- int ticks = ( amp > 0 ) ? GetDuration() / amp : 0;
- bonus = ( ticks > 0 ) ? bonus / ticks : 0;
- - bonus = float2int32( float( bonus * GetDuration() / 15000.0f ) );
- }
- else
- bonus = 0;
- -3970,8 +3983,22 @@
- if(m_target->SchoolImmunityList[GetSpellProto()->School])
- return;
- - //zack: latest new is that this spell uses spell damage bonus only and not healing bonus
- - amount += m_caster->GetSpellDmgBonus(m_target,GetSpellProto(),amount)*50/100;
- + int amp = m_spellProto->EffectAmplitude[mod->i];
- + if( !amp )
- + amp = static_cast< EventableObject* >( this )->event_GetEventPeriod( EVENT_AURA_PERIODIC_LEECH );
- +
- + int bonus = 0;
- +
- + if(GetDuration())
- + {
- + float fbonus = float( m_caster->GetSpellDmgBonus(m_target,GetSpellProto(),amount,true) ) * 0.5f;
- + if(fbonus < 0) fbonus = 0.0f;
- + float ticks= float((amp) ? GetDuration()/amp : 0);
- + fbonus = (ticks) ? fbonus/ticks : 0;
- + bonus = float2int32(fbonus);
- + }
- +
- + amount += bonus;
- uint32 Amount = (uint32)min( amount, m_target->GetUInt32Value( UNIT_FIELD_HEALTH ) );
- uint32 newHealth = m_caster->GetUInt32Value(UNIT_FIELD_HEALTH) + Amount ;
- -4575,8 +4602,24 @@
- if( apply )
- {
- SetPositive();
- + int32 val = mod->m_amount;
- + Player * plr = static_cast< Player* >( GetUnitCaster() );
- + if( plr )
- + {
- + //This will fix talents that affects damage absorved.
- + int flat = 0;
- + SM_FIValue( plr->SM_FSPELL_VALUE, &flat, GetSpellProto()->SpellGroupType );
- + val += float2int32( float( val * flat ) / 100.0f );
- +
- + //For spells Affected by Bonus Healing we use Dspell_coef_override.
- + if( GetSpellProto()->Dspell_coef_override >= 0 )
- + val += float2int32( float( plr->HealDoneMod[GetSpellProto()->School] ) * GetSpellProto()->Dspell_coef_override );
- + //For spells Affected by Bonus Damage we use OTspell_coef_override.
- + else if( GetSpellProto()->OTspell_coef_override >= 0 )
- + val += float2int32( float( plr->GetDamageDoneMod( GetSpellProto()->School ) ) * GetSpellProto()->OTspell_coef_override );
- + }
- ab = new Absorb;
- - ab->amt = mod->m_amount;
- + ab->amt = val;
- ab->spellid = GetSpellId();
- ab->caster = m_casterGuid;
- for(uint32 x=0;x<7;x++)
- Index: src/ascent-world/Unit.cpp
- ===================================================================
- --- src/ascent-world/Unit.cpp (revision 3757)
- +++ src/ascent-world/Unit.cpp (working copy)
- -3812,7 +3812,7 @@
- pLastSpell = pSpell->m_spellInfo;
- }
- -int32 Unit::GetSpellDmgBonus(Unit *pVictim, SpellEntry *spellInfo,int32 base_dmg)
- +int32 Unit::GetSpellDmgBonus(Unit *pVictim, SpellEntry *spellInfo,int32 base_dmg, bool isdot)
- {
- int32 plus_damage = 0;
- Unit* caster = this;
- -3836,21 +3836,37 @@
- //==============================+Spell Damage Bonus Modifications===========================
- //==========================================================================================
- //------------------------------by cast duration--------------------------------------------
- - SpellCastTime *sd = dbcSpellCastTime.LookupEntry(spellInfo->CastingTimeIndex);
- - float castaff = float(GetCastTime(sd));
- - if(castaff < 1500) castaff = 1500;
- + float dmgdoneaffectperc = 1.0f;
- + if( spellInfo->Dspell_coef_override >= 0 && !isdot )
- + plus_damage = float2int32( float( plus_damage ) * spellInfo->Dspell_coef_override );
- + else if( spellInfo->OTspell_coef_override >= 0 && isdot )
- + plus_damage = float2int32( float( plus_damage ) * spellInfo->OTspell_coef_override );
- else
- - if(castaff > 7000) castaff = 7000;
- -
- - float dmgdoneaffectperc = castaff / 3500;
- -
- + {
- + //Bonus to DD part
- + if( spellInfo->fixed_dddhcoef >= 0 && !isdot )
- + plus_damage = float2int32( float( plus_damage ) * spellInfo->fixed_dddhcoef );
- + //Bonus to DoT part
- + else if( spellInfo->fixed_hotdotcoef >= 0 && isdot )
- + {
- + plus_damage = float2int32( float( plus_damage ) * spellInfo->fixed_hotdotcoef );
- + if( caster->IsPlayer() )
- + {
- + int durmod = 0;
- + SM_FIValue(caster->SM_FDur, &durmod, spellInfo->SpellGroupType);
- + plus_damage += float2int32( float( plus_damage * durmod ) / 15000.0f );
- + }
- + }
- + //In case we dont fit in previous cases do old thing
- + else
- + {
- + plus_damage = float2int32( float( plus_damage ) * spellInfo->casttime_coef );
- + float td = float( GetDuration( dbcSpellDuration.LookupEntry( spellInfo->DurationIndex ) ));
- + if( spellInfo->NameHash == SPELL_HASH_MOONFIRE || spellInfo->NameHash == SPELL_HASH_IMMOLATE || spellInfo->NameHash == SPELL_HASH_ICE_LANCE || spellInfo->NameHash == SPELL_HASH_PYROBLAST )
- + plus_damage = float2int32( float( plus_damage ) * float( 1.0f - ( ( td / 15000.0f ) / ( ( td / 15000.0f ) + dmgdoneaffectperc ) ) ) );
- + }
- + }
- //------------------------------by downranking----------------------------------------------
- - //DOT-DD (Moonfire-Immolate-IceLance-Pyroblast)(Hack Fix)
- -
- - float td = float( GetDuration( dbcSpellDuration.LookupEntry( spellInfo->DurationIndex ) ));
- - if( spellInfo->NameHash == SPELL_HASH_MOONFIRE || spellInfo->NameHash == SPELL_HASH_IMMOLATE || spellInfo->NameHash == SPELL_HASH_ICE_LANCE || spellInfo->NameHash == SPELL_HASH_PYROBLAST )
- - dmgdoneaffectperc *= float( 1.0f - ( ( td / 15000.0f ) / ( ( td / 15000.0f ) + dmgdoneaffectperc ) ) );
- -
- if(spellInfo->baseLevel > 0 && spellInfo->maxLevel > 0)
- {
- float downrank1 = 1.0f;
- -3865,6 +3881,7 @@
- //==============================Bonus Adding To Main Damage=================================
- //==========================================================================================
- int32 bonus_damage = float2int32(plus_damage * dmgdoneaffectperc);
- +
- //bonus_damage +=pVictim->DamageTakenMod[school]; Bad copy-past i guess :P
- if(spellInfo->SpellGroupType)
- {
- Index: src/ascent-world/Unit.h
- ===================================================================
- --- src/ascent-world/Unit.h (revision 3757)
- +++ src/ascent-world/Unit.h (working copy)
- -810,7 +810,7 @@
- void InterruptSpell();
- //caller is the caster
- - int32 GetSpellDmgBonus(Unit *pVictim, SpellEntry *spellInfo,int32 base_dmg);
- + int32 GetSpellDmgBonus(Unit *pVictim, SpellEntry *spellInfo,int32 base_dmg, bool isdot);
- Unit* create_guardian(uint32 guardian_entry,uint32 duration,float angle);//guardians are temporary spawn that will inherit master faction and will folow them. Apart from that they have their own mind
- Index: src/ascent-world/World.cpp
- ===================================================================
- --- src/ascent-world/World.cpp (revision 3757)
- +++ src/ascent-world/World.cpp (working copy)
- -643,6 +643,12 @@
- sp->proc_interval = 0;//trigger at each event
- sp->c_is_flags = 0;
- + sp->spell_coef_flags = 0;
- + sp->Dspell_coef_override = -1;
- + sp->OTspell_coef_override = -1;
- + sp->casttime_coef = 0;
- + sp->fixed_dddhcoef = -1;
- + sp->fixed_hotdotcoef = -1;
- talentSpellIterator = talentSpells.find(sp->Id);
- if(talentSpellIterator == talentSpells.end())
- -1516,6 +1522,293 @@
- //if(sp->Id==11267 || sp->Id==11289 || sp->Id==6409)
- // printf("!!!!!!! name %s , id %u , hash %u \n",nametext,sp->Id, namehash);
- }
- +
- +/////////////////////////////////////////////////////////////////
- +//SPELL COEFFICIENT SETTINGS START
- +/////////////////////////////////////////////////////////////////
- +
- + for(uint32 x=0; x < cnt; x++)
- + {
- + // SpellID
- + uint32 spellid = dbc.getRecord(x).getUInt(0);
- + // get spellentry
- + SpellEntry * sp = dbcSpell.LookupEntry(spellid);
- +
- + //Setting Cast Time Coefficient
- + SpellCastTime *sd = dbcSpellCastTime.LookupEntry(sp->CastingTimeIndex);
- + float castaff = float(GetCastTime(sd));
- + if(castaff < 1500) castaff = 1500;
- + else
- + if(castaff > 7000) castaff = 7000;
- +
- + sp->casttime_coef = castaff / 3500;
- +
- + SpellEntry * spz;
- + bool spcheck = false;
- +
- + //Flag for DoT and HoT
- + for( uint8 i = 0 ; i < 3 ; i++ )
- + {
- + if (sp->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_DAMAGE ||
- + sp->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_HEAL ||
- + sp->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_LEECH )
- + {
- + sp->spell_coef_flags |= SPELL_FLAG_IS_DOT_OR_HOT_SPELL;
- + break;
- + }
- + }
- +
- + //Flag for DD or DH
- + for( uint8 i = 0 ; i < 3 ; i++ )
- + {
- + if ( sp->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_TRIGGER_SPELL && sp->EffectTriggerSpell[i] )
- + {
- + spz = dbcSpell.LookupEntry( sp->EffectTriggerSpell[i] );
- + if( spz &&
- + spz->Effect[i] == SPELL_EFFECT_SCHOOL_DAMAGE ||
- + spz->Effect[i] == SPELL_EFFECT_HEAL
- + )
- + spcheck = true;
- + }
- + if (sp->Effect[i] == SPELL_EFFECT_SCHOOL_DAMAGE ||
- + sp->Effect[i] == SPELL_EFFECT_HEAL ||
- + spcheck
- + )
- + {
- + sp->spell_coef_flags |= SPELL_FLAG_IS_DD_OR_DH_SPELL;
- + break;
- + }
- + }
- +
- + for(uint8 i = 0 ; i < 3; i++)
- + {
- + switch (sp->EffectImplicitTargetA[i])
- + {
- + //AoE
- + case EFF_TARGET_ALL_TARGETABLE_AROUND_LOCATION_IN_RADIUS:
- + case EFF_TARGET_ALL_ENEMY_IN_AREA:
- + case EFF_TARGET_ALL_ENEMY_IN_AREA_INSTANT:
- + case EFF_TARGET_ALL_PARTY_AROUND_CASTER:
- + case EFF_TARGET_ALL_ENEMIES_AROUND_CASTER:
- + case EFF_TARGET_IN_FRONT_OF_CASTER:
- + case EFF_TARGET_ALL_ENEMY_IN_AREA_CHANNELED:
- + case EFF_TARGET_ALL_PARTY_IN_AREA_CHANNELED:
- + case EFF_TARGET_ALL_FRIENDLY_IN_AREA:
- + case EFF_TARGET_ALL_TARGETABLE_AROUND_LOCATION_IN_RADIUS_OVER_TIME:
- + case EFF_TARGET_ALL_PARTY:
- + case EFF_TARGET_LOCATION_INFRONT_CASTER:
- + case EFF_TARGET_BEHIND_TARGET_LOCATION:
- + case EFF_TARGET_LOCATION_INFRONT_CASTER_AT_RANGE:
- + {
- + sp->spell_coef_flags |= SPELL_FLAG_AOE_SPELL;
- + break;
- + }
- + }
- + }
- +
- + for(uint8 i = 0 ; i < 3 ; i++)
- + {
- + switch (sp->EffectImplicitTargetB[i])
- + {
- + //AoE
- + case EFF_TARGET_ALL_TARGETABLE_AROUND_LOCATION_IN_RADIUS:
- + case EFF_TARGET_ALL_ENEMY_IN_AREA:
- + case EFF_TARGET_ALL_ENEMY_IN_AREA_INSTANT:
- + case EFF_TARGET_ALL_PARTY_AROUND_CASTER:
- + case EFF_TARGET_ALL_ENEMIES_AROUND_CASTER:
- + case EFF_TARGET_IN_FRONT_OF_CASTER:
- + case EFF_TARGET_ALL_ENEMY_IN_AREA_CHANNELED:
- + case EFF_TARGET_ALL_PARTY_IN_AREA_CHANNELED:
- + case EFF_TARGET_ALL_FRIENDLY_IN_AREA:
- + case EFF_TARGET_ALL_TARGETABLE_AROUND_LOCATION_IN_RADIUS_OVER_TIME:
- + case EFF_TARGET_ALL_PARTY:
- + case EFF_TARGET_LOCATION_INFRONT_CASTER:
- + case EFF_TARGET_BEHIND_TARGET_LOCATION:
- + case EFF_TARGET_LOCATION_INFRONT_CASTER_AT_RANGE:
- + {
- + sp->spell_coef_flags |= SPELL_FLAG_AOE_SPELL;
- + break;
- + }
- + }
- + }
- +
- + //Special Cases
- + //Holy Light & Flash of Light
- + if(sp->NameHash == SPELL_HASH_HOLY_LIGHT ||
- + sp->NameHash == SPELL_HASH_FLASH_OF_LIGHT)
- + sp->spell_coef_flags |= SPELL_FLAG_IS_DD_OR_DH_SPELL;
- +
- + //Additional Effect (not healing or damaging)
- + for( uint8 i = 0 ; i < 3 ; i++ )
- + {
- + if(sp->Effect[i] == 0)
- + continue;
- +
- + switch (sp->Effect[i])
- + {
- + case SPELL_EFFECT_SCHOOL_DAMAGE:
- + case SPELL_EFFECT_ENVIRONMENTAL_DAMAGE:
- + case SPELL_EFFECT_HEALTH_LEECH:
- + case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
- + case SPELL_EFFECT_ADD_EXTRA_ATTACKS:
- + case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
- + case SPELL_EFFECT_POWER_BURN:
- + case SPELL_EFFECT_ATTACK:
- + case SPELL_EFFECT_HEAL:
- + case SPELL_EFFECT_HEALTH_FUNNEL:
- + case SPELL_EFFECT_HEAL_MAX_HEALTH:
- + case SPELL_EFFECT_DUMMY:
- + continue;
- + }
- +
- + switch (sp->EffectApplyAuraName[i])
- + {
- + case SPELL_AURA_PERIODIC_DAMAGE:
- + case SPELL_AURA_PROC_TRIGGER_DAMAGE:
- + case SPELL_AURA_PERIODIC_DAMAGE_PERCENT:
- + case SPELL_AURA_POWER_BURN:
- + case SPELL_AURA_PERIODIC_HEAL:
- + case SPELL_AURA_MOD_INCREASE_HEALTH:
- + case SPELL_AURA_PERIODIC_HEALTH_FUNNEL:
- + case SPELL_AURA_DUMMY:
- + continue;
- + }
- +
- + sp->spell_coef_flags |= SPELL_FLAG_ADITIONAL_EFFECT;
- + break;
- +
- + }
- +
- + //Calculating fixed coeficients
- + //Channeled spells
- + if( sp->ChannelInterruptFlags != 0 )
- + {
- + float Duration = float( GetDuration( dbcSpellDuration.LookupEntry( sp->DurationIndex ) ));
- + if(Duration < 1500) Duration = 1500;
- + else if(Duration > 7000) Duration = 7000;
- + sp->fixed_hotdotcoef = (Duration / 3500.0f);
- +
- + if( sp->spell_coef_flags & SPELL_FLAG_ADITIONAL_EFFECT )
- + sp->fixed_hotdotcoef *= 0.95f;
- + if( sp->spell_coef_flags & SPELL_FLAG_AOE_SPELL )
- + sp->fixed_hotdotcoef *= 0.5f;
- + }
- +
- + //Standard spells
- + else if( (sp->spell_coef_flags & SPELL_FLAG_IS_DD_OR_DH_SPELL) && !(sp->spell_coef_flags & SPELL_FLAG_IS_DOT_OR_HOT_SPELL) )
- + {
- + sp->fixed_dddhcoef = sp->casttime_coef;
- + if( sp->spell_coef_flags & SPELL_FLAG_ADITIONAL_EFFECT )
- + sp->fixed_dddhcoef *= 0.95f;
- + if( sp->spell_coef_flags & SPELL_FLAG_AOE_SPELL )
- + sp->fixed_dddhcoef *= 0.5f;
- + }
- +
- + //Over-time spells
- + else if( !(sp->spell_coef_flags & SPELL_FLAG_IS_DD_OR_DH_SPELL) && (sp->spell_coef_flags & SPELL_FLAG_IS_DOT_OR_HOT_SPELL) )
- + {
- + float Duration = float( GetDuration( dbcSpellDuration.LookupEntry( sp->DurationIndex ) ));
- + sp->fixed_hotdotcoef = (Duration / 15000.0f);
- +
- + if( sp->spell_coef_flags & SPELL_FLAG_ADITIONAL_EFFECT )
- + sp->fixed_hotdotcoef *= 0.95f;
- + if( sp->spell_coef_flags & SPELL_FLAG_AOE_SPELL )
- + sp->fixed_hotdotcoef *= 0.5f;
- +
- + }
- +
- + //Combined standard and over-time spells
- + else if( sp->spell_coef_flags & SPELL_FLAG_IS_DD_DH_DOT_SPELL )
- + {
- + float Duration = float( GetDuration( dbcSpellDuration.LookupEntry( sp->DurationIndex ) ));
- + float Portion_to_Over_Time = (Duration / 15000.0f) / ((Duration / 15000.0f) + sp->casttime_coef );
- + float Portion_to_Standard = 1.0f - Portion_to_Over_Time;
- +
- + sp->fixed_dddhcoef = sp->casttime_coef * Portion_to_Standard;
- + sp->fixed_hotdotcoef = (Duration / 15000.0f) * Portion_to_Over_Time;
- +
- + if( sp->spell_coef_flags & SPELL_FLAG_ADITIONAL_EFFECT )
- + {
- + sp->fixed_dddhcoef *= 0.95f;
- + sp->fixed_hotdotcoef *= 0.95f;
- + }
- + if( sp->spell_coef_flags & SPELL_FLAG_AOE_SPELL )
- + {
- + sp->fixed_dddhcoef *= 0.5f;
- + sp->fixed_hotdotcoef *= 0.5f;
- + }
- + }
- + }
- +
- + //Settings for special cases
- + QueryResult * resultx = WorldDatabase.Query("SELECT * FROM spell_coef_override");
- + if( resultx != NULL )
- + {
- + do
- + {
- + Field * f;
- + f = resultx->Fetch();
- + SpellEntry * sp = dbcSpell.LookupEntry( f[0].GetUInt32() );
- + sp->Dspell_coef_override = f[2].GetFloat();
- + sp->OTspell_coef_override = f[3].GetFloat();
- + } while( resultx->NextRow() );
- + }
- +
- + //Fully loaded coefficients, we must share channeled coefficient to its triggered spells
- + for(uint32 x=0; x < cnt; x++)
- + {
- + // SpellID
- + uint32 spellid = dbc.getRecord(x).getUInt(0);
- + // get spellentry
- + SpellEntry * sp = dbcSpell.LookupEntry(spellid);
- + SpellEntry * spz;
- +
- + //Case SPELL_AURA_PERIODIC_TRIGGER_SPELL
- + for( uint8 i = 0 ; i < 3 ; i++ )
- + {
- + if ( sp->EffectApplyAuraName[i] == SPELL_AURA_PERIODIC_TRIGGER_SPELL )
- + {
- + spz = dbcSpell.LookupEntry( sp->EffectTriggerSpell[i] );
- + if( spz != NULL )
- + {
- + if( sp->Dspell_coef_override >= 0 )
- + spz->Dspell_coef_override = sp->Dspell_coef_override;
- + else
- + {
- + //we must set bonus per tick on triggered spells now (i.e. Arcane Missiles)
- + if( sp->ChannelInterruptFlags != 0 )
- + {
- + float Duration = float( GetDuration( dbcSpellDuration.LookupEntry( sp->DurationIndex ) ));
- + float amp = float(sp->EffectAmplitude[i]);
- + sp->fixed_dddhcoef = sp->fixed_hotdotcoef * amp / Duration;
- + }
- + spz->fixed_dddhcoef = sp->fixed_dddhcoef;
- + }
- +
- + if( sp->OTspell_coef_override >= 0 )
- + spz->OTspell_coef_override = sp->OTspell_coef_override;
- + else
- + {
- + //we must set bonus per tick on triggered spells now (i.e. Arcane Missiles)
- + if( sp->ChannelInterruptFlags != 0 )
- + {
- + float Duration = float( GetDuration( dbcSpellDuration.LookupEntry( sp->DurationIndex ) ));
- + float amp = float(sp->EffectAmplitude[i]);
- + sp->fixed_hotdotcoef *= amp / Duration;
- + }
- + spz->fixed_hotdotcoef = sp->fixed_hotdotcoef;
- + }
- + break;
- + }
- + }
- + }
- + }
- +
- +/////////////////////////////////////////////////////////////////
- +//SPELL COEFFICIENT SETTINGS END
- +/////////////////////////////////////////////////////////////////
- +
- +
- //this is so lame : shamanistic rage triggers a new spell which borrows it's stats from parent spell :S
- SpellEntry* parentsp = dbcSpell.LookupEntryForced( 30823 );
- SpellEntry* triggersp = dbcSpell.LookupEntryForced( 30824 );