*Fix Ferocious Bite energy to dmg conversion

*Remove duplicated AP coefficients for Hammer of Wrath and Avengers Shield
*Correctly do effectaddcombopoints for spells which take them.
*Do not proc spelleffects on player login.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-06-24 15:58:44 +02:00
parent 329b020af4
commit 33b2917bb7
8 changed files with 46 additions and 36 deletions
-2
View File
@@ -1433,8 +1433,6 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
( 61346, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Nature's Grace
( 61356, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x000002A8, 0x00000002, 0, 0, 90), -- Invigorating Earthsiege Diamond Passive
( 61618, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 45), -- Tentacles
( 61846, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Aspect of the Dragonhawk (Rank 1)
( 61847, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Aspect of the Dragonhawk (Rank 2)
( 61848, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0, 0, 0), -- Aspect of the Dragonhawk
( 62147, 0x00, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Icy Touch Defense Increase
( 62459, 0x00, 15, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Chains of Ice Frost Rune Refresh (Rank 3)
+19 -4
View File
@@ -18624,17 +18624,19 @@ void Player::SendComboPoints()
}
}
void Player::AddComboPoints(Unit* target, int8 count)
void Player::AddComboPoints(Unit* target, int8 count, Spell * spell)
{
if(!count)
return;
int8 * comboPoints = spell ? &spell->m_comboPointGain : &m_comboPoints;
// without combo points lost (duration checked in aura)
RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
if(target->GetGUID() == m_comboTarget)
{
m_comboPoints += count;
*comboPoints += count;
}
else
{
@@ -18643,13 +18645,26 @@ void Player::AddComboPoints(Unit* target, int8 count)
target2->RemoveComboPointHolder(GetGUIDLow());
m_comboTarget = target->GetGUID();
m_comboPoints = count;
*comboPoints = count;
target->AddComboPointHolder(GetGUIDLow());
}
if (*comboPoints > 5) *comboPoints = 5;
else if (*comboPoints < 0) *comboPoints = 0;
if (!spell)
SendComboPoints();
}
void Player::GainSpellComboPoints(int8 count)
{
if(!count)
return;
m_comboPoints += count;
if (m_comboPoints > 5) m_comboPoints = 5;
if (m_comboPoints < 0) m_comboPoints = 0;
else if (m_comboPoints < 0) m_comboPoints = 0;
SendComboPoints();
}
+2 -1
View File
@@ -1292,7 +1292,8 @@ class TRINITY_DLL_SPEC Player : public Unit
uint8 GetComboPoints() { return m_comboPoints; }
const uint64& GetComboTarget() const { return m_comboTarget; }
void AddComboPoints(Unit* target, int8 count);
void AddComboPoints(Unit* target, int8 count, Spell * spell = NULL);
void GainSpellComboPoints(int8 count);
void ClearComboPoints();
void SendComboPoints();
+12 -9
View File
@@ -363,6 +363,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
m_referencedFromCurrentSpell = false;
m_executedCurrently = false;
m_needComboPoints = NeedsComboPoints(m_spellInfo);
m_comboPointGain = 0;
m_delayStart = 0;
m_delayAtDamageCount = 0;
@@ -2730,7 +2731,13 @@ void Spell::cast(bool skipCheck)
((Player*)m_caster)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CAST_SPELL, m_spellInfo->Id);
}
// this is related to combo points so must be done before takepower
if(!m_IsTriggeredSpell)
{
// Powers have to be taken before SendSpellGo
TakePower();
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
}
// are there any spells need to be triggered after hit?
// handle SPELL_AURA_ADD_TARGET_TRIGGER auras
Unit::AuraEffectList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
@@ -2748,17 +2755,9 @@ void Spell::cast(bool skipCheck)
}
}
// this is related to combo points so must be done before takepower
if(m_customAttr & SPELL_ATTR_CU_DIRECT_DAMAGE)
CalculateDamageDoneForAllTargets();
if(!m_IsTriggeredSpell)
{
// Powers have to be taken before SendSpellGo
TakePower();
TakeReagents(); // we must remove reagents before HandleEffects to allow place crafted item in same slot
}
// CAST SPELL
SendSpellCooldown();
//SendCastResult(castResult);
@@ -2972,6 +2971,10 @@ void Spell::_handle_finish_phase()
if (m_needComboPoints)
((Player*)m_caster)->ClearComboPoints();
// Real add combo points from effects
if (m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->GainSpellComboPoints(m_comboPointGain);
// spell log
if(m_needSpellLog)
SendLogExecute();
+1
View File
@@ -438,6 +438,7 @@ class Spell
uint32 m_glyphIndex;
uint32 m_preCastSpell;
SpellCastTargets m_targets;
int8 m_comboPointGain;
UsedSpellMods m_appliedMods;
+3 -2
View File
@@ -2497,8 +2497,9 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount)
((Player*)m_target)->RemoveAmmo(); // not use ammo and not allow use
return;
case 52916: // Honor Among Thieves
if (Unit * target = ObjectAccessor::GetUnit(*m_target, m_target->GetUInt64Value(UNIT_FIELD_TARGET)))
m_target->CastSpell(target, 51699, true);
if(m_target->GetTypeId()==TYPEID_PLAYER)
if (Unit * target = ObjectAccessor::GetUnit(*m_target,((Player*)m_target)->GetComboTarget()))
m_target->CastSpell(target, 51699, true);
return;
}
+6 -18
View File
@@ -517,9 +517,9 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
// converts each extra point of energy into ($f1+$AP/410) additional damage
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
float multiple = ap / 410 + m_spellInfo->DmgMultiplier[effect_idx];
damage += int32(m_caster->GetPower(POWER_ENERGY) * multiple);
int32 energy = -(m_caster->ModifyPower(POWER_ENERGY, -30));
damage += int32(energy * multiple);
damage += int32(((Player*)m_caster)->GetComboPoints() * ap * 7 / 100);
m_caster->SetPower(POWER_ENERGY,0);
}
// Rake
else if(m_spellInfo->SpellFamilyFlags[0] & 0x1000)
@@ -660,20 +660,8 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
}
case SPELLFAMILY_PALADIN:
{
// Avenger's Shield ($m1+0.07*$SPH+0.07*$AP)
if(m_spellInfo->SpellFamilyFlags[0] & 0x4000)
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
damage += int32(ap * 0.07f);
}
// Hammer of Wrath ($m1+0.15*$SPH+0.15*$AP)
else if(m_spellInfo->SpellFamilyFlags[1] & 0x00000080)
{
float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK);
damage += int32(ap * 0.15f);
}
// Hammer of the Righteous
else if(m_spellInfo->SpellFamilyFlags[1]&0x00040000)
if(m_spellInfo->SpellFamilyFlags[1]&0x00040000)
{
// Add main hand dps * effect[2] amount
float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2;
@@ -4310,7 +4298,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
if(m_spellInfo->SpellFamilyFlags[0] & 0x2000000)
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget, 1);
((Player*)m_caster)->AddComboPoints(unitTarget, 1, this);
}
// Fan of Knives
else if(m_spellInfo->SpellFamilyFlags[1] & 0x40000)
@@ -4388,7 +4376,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
if(m_spellInfo->SpellFamilyFlags.IsEqual(0,0x00000400))
{
if(m_caster->GetTypeId()==TYPEID_PLAYER)
((Player*)m_caster)->AddComboPoints(unitTarget,1);
((Player*)m_caster)->AddComboPoints(unitTarget,1, this);
}
break;
}
@@ -5505,7 +5493,7 @@ void Spell::EffectAddComboPoints(uint32 /*i*/)
if(damage <= 0)
return;
((Player*)m_caster)->AddComboPoints(unitTarget, damage);
((Player*)m_caster)->AddComboPoints(unitTarget, damage, this);
}
void Spell::EffectDuel(uint32 i)
+3
View File
@@ -12501,6 +12501,9 @@ uint32 createProcExtendMask(SpellNonMeleeDamage *damageInfo, SpellMissInfo missC
void Unit::ProcDamageAndSpellFor( bool isVictim, Unit * pTarget, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, SpellEntry const * procSpell, uint32 damage , SpellEntry const * procAura)
{
// Player is loaded now - do not allow passive spell casts to proc
if (GetTypeId() == TYPEID_PLAYER && ((Player*)this)->GetSession()->PlayerLoading())
return;
// For melee/ranged based attack need update skills and set some Aura states
if (procFlag & MELEE_BASED_TRIGGER_MASK)
{