Core/Spells:

* Fix bloodthirst Heal
* Move bloodthirst damage calculation in Spell script
* Fix some codestyle
This commit is contained in:
Vincent-Michael
2012-06-20 18:06:29 +02:00
parent ab3430762d
commit ef4d9dd4ae
4 changed files with 41 additions and 31 deletions
-6
View File
@@ -8865,12 +8865,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
CastSpell(this, 70721, true); CastSpell(this, 70721, true);
break; break;
} }
// Bloodthirst (($m/100)% of max health)
case 23880:
{
basepoints0 = int32(CountPctFromMaxHealth(triggerAmount));
break;
}
// Shamanistic Rage triggered spell // Shamanistic Rage triggered spell
case 30824: case 30824:
{ {
+1 -4
View File
@@ -365,11 +365,8 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
} }
case SPELLFAMILY_WARRIOR: case SPELLFAMILY_WARRIOR:
{ {
// Bloodthirst
if (m_spellInfo->SpellFamilyFlags[1] & 0x400)
ApplyPctF(damage, m_caster->GetTotalAttackPowerValue(BASE_ATTACK));
// Shield Slam // Shield Slam
else if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209) if (m_spellInfo->SpellFamilyFlags[1] & 0x200 && m_spellInfo->Category == 1209)
{ {
uint8 level = m_caster->getLevel(); uint8 level = m_caster->getLevel();
uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f)); uint32 block_value = m_caster->GetShieldBlockValue(uint32(float(level) * 24.5f), uint32(float(level) * 34.5f));
+1 -1
View File
@@ -1,4 +1,4 @@
/* /*
* Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
* *
* This program is free software; you can redistribute it and/or modify it * This program is free software; you can redistribute it and/or modify it
+39 -20
View File
@@ -397,7 +397,20 @@ class spell_warr_bloodthirst : public SpellScriptLoader
{ {
PrepareSpellScript(spell_warr_bloodthirst_SpellScript); PrepareSpellScript(spell_warr_bloodthirst_SpellScript);
void HandleDummy(SpellEffIndex /* effIndex */) void HandleDamage(SpellEffIndex /*effIndex*/)
{
int32 damage = GetEffectValue();
ApplyPctF(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));
if (Unit* target = GetHitUnit())
{
damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
}
SetHitDamage(damage);
}
void HandleDummy(SpellEffIndex /*effIndex*/)
{ {
int32 damage = GetEffectValue(); int32 damage = GetEffectValue();
GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL); GetCaster()->CastCustomSpell(GetCaster(), SPELL_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
@@ -405,6 +418,7 @@ class spell_warr_bloodthirst : public SpellScriptLoader
void Register() void Register()
{ {
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); OnEffectHit += SpellEffectFn(spell_warr_bloodthirst_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY);
} }
}; };
@@ -415,31 +429,36 @@ class spell_warr_bloodthirst : public SpellScriptLoader
} }
}; };
enum BloodthirstHeal
{
SPELL_BLOODTHIRST_DAMAGE = 23881,
};
class spell_warr_bloodthirst_heal : public SpellScriptLoader class spell_warr_bloodthirst_heal : public SpellScriptLoader
{ {
public: public:
spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { } spell_warr_bloodthirst_heal() : SpellScriptLoader("spell_warr_bloodthirst_heal") { }
class spell_warr_bloodthirst_heal_SpellScript : public SpellScript class spell_warr_bloodthirst_heal_SpellScript : public SpellScript
{
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
void HandleHeal(SpellEffIndex /* effIndex */)
{ {
if (GetTriggeringSpell()) PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
SetHitHeal(CalculatePctN(GetCaster()->GetMaxHealth(),GetTriggeringSpell()->Effects[EFFECT_1].CalcValue()));
}
void Register() void HandleHeal(SpellEffIndex /*effIndex*/)
{
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())));
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL);
}
};
SpellScript* GetSpellScript() const
{ {
OnEffectHitTarget += SpellEffectFn(spell_warr_bloodthirst_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); return new spell_warr_bloodthirst_heal_SpellScript();
} }
};
SpellScript* GetSpellScript() const
{
return new spell_warr_bloodthirst_heal_SpellScript();
}
}; };
enum Overpower enum Overpower
@@ -498,6 +517,6 @@ void AddSC_warrior_spell_scripts()
new spell_warr_execute(); new spell_warr_execute();
new spell_warr_concussion_blow(); new spell_warr_concussion_blow();
new spell_warr_bloodthirst(); new spell_warr_bloodthirst();
new spell_warr_overpower();
new spell_warr_bloodthirst_heal(); new spell_warr_bloodthirst_heal();
new spell_warr_overpower();
} }