diff options
author | QAston <none@none> | 2009-06-16 17:39:51 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-06-16 17:39:51 +0200 |
commit | 1105f47b34efe1b5a83ce031781399395e005ab7 (patch) | |
tree | 31dba0f3a764f9771a2ef7f600b9bbad4a292979 /src | |
parent | b2745bd33c4c634aee891ef8f637fe58052ae627 (diff) |
*Fix Flametongue Weapon.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Unit.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index a2f3a6ac79d..8c65360aa27 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6478,6 +6478,8 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger basepoints0 = int32(extra_attack_power/14.0f * GetAttackTime(BASE_ATTACK)/1000); triggered_spell_id = 25504; } + else + return false; // apply cooldown before cast to prevent processing itself if( cooldown ) @@ -6573,6 +6575,51 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger triggered_spell_id = 379; break; } + // Flametongue Weapon (Passive) + if (dummySpell->SpellFamilyFlags[0] & 0x200000) + { + if(GetTypeId()!=TYPEID_PLAYER) + return false; + + if(!castItem || !castItem->IsEquipped()) + return false; + + // firehit = dummySpell->EffectBasePoints[0] / ((4*19.25) * 1.3); + float fire_onhit = dummySpell->EffectBasePoints[0] / 100.0; + + float add_spellpower = SpellBaseDamageBonus(SPELL_SCHOOL_MASK_FIRE) + + SpellBaseDamageBonusForVictim(SPELL_SCHOOL_MASK_FIRE, pVictim); + + // 1.3speed = 5%, 2.6speed = 10%, 4.0 speed = 15%, so, 1.0speed = 3.84% + add_spellpower= add_spellpower / 100.0 * 3.84; + + // Enchant on Off-Hand and ready? + if ( castItem->GetSlot() == EQUIPMENT_SLOT_OFFHAND && isAttackReady(OFF_ATTACK)) + { + float BaseWeaponSpeed = GetAttackTime(OFF_ATTACK)/1000.0; + + // Value1: add the tooltip damage by swingspeed + Value2: add spelldmg by swingspeed + basepoints0 = int32( (fire_onhit * BaseWeaponSpeed) + (add_spellpower * BaseWeaponSpeed) ); + triggered_spell_id = 10444; + } + + // Enchant on Main-Hand and ready? + else if ( castItem->GetSlot() == EQUIPMENT_SLOT_MAINHAND && isAttackReady(BASE_ATTACK)) + { + float BaseWeaponSpeed = GetAttackTime(BASE_ATTACK)/1000.0; + + // Value1: add the tooltip damage by swingspeed + Value2: add spelldmg by swingspeed + basepoints0 = int32( (fire_onhit * BaseWeaponSpeed) + (add_spellpower * BaseWeaponSpeed) ); + triggered_spell_id = 10444; + } + + // If not ready, we should return, shouldn't we?! + else + return false; + + CastCustomSpell(pVictim,triggered_spell_id,&basepoints0,NULL,NULL,true,castItem,triggeredByAura); + return true; + } // Improved Water Shield if (dummySpell->SpellIconID == 2287) { |