Merge pull request #6869 from Vincent-Michael/bloodthirst
Core/Spells: Fix Bloodthirst heal
This commit is contained in:
@@ -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:
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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,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
|
||||||
|
|||||||
@@ -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,19 +429,24 @@ 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);
|
PrepareSpellScript(spell_warr_bloodthirst_heal_SpellScript);
|
||||||
|
|
||||||
void HandleHeal(SpellEffIndex /* effIndex */)
|
void HandleHeal(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
if (GetTriggeringSpell())
|
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(SPELL_BLOODTHIRST_DAMAGE))
|
||||||
SetHitHeal(CalculatePctN(GetCaster()->GetMaxHealth(),GetTriggeringSpell()->Effects[EFFECT_1].CalcValue()));
|
SetHitHeal(GetCaster()->CountPctFromMaxHealth(spellInfo->Effects[EFFECT_1].CalcValue(GetCaster())));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register()
|
void Register()
|
||||||
@@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user