mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8936] Implement spell 48743
This commit is contained in:
parent
338375c16d
commit
b0a6993031
3 changed files with 41 additions and 2 deletions
|
|
@ -1685,8 +1685,16 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap)
|
|||
}
|
||||
break;
|
||||
case TARGET_ALL_FRIENDLY_UNITS_IN_AREA:
|
||||
// Death Pact (in fact selection by player selection)
|
||||
if (m_spellInfo->Id == 48743)
|
||||
{
|
||||
// checked in Spell::CheckCast
|
||||
if (m_caster->GetTypeId()==TYPEID_PLAYER)
|
||||
if (Unit* target = m_caster->GetMap()->GetPet(((Player*)m_caster)->GetSelection()))
|
||||
TagUnitMap.push_back(target);
|
||||
}
|
||||
// Wild Growth
|
||||
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellIconID == 2864)
|
||||
else if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellIconID == 2864)
|
||||
{
|
||||
Unit* target = m_targets.getUnitTarget();
|
||||
if(!target)
|
||||
|
|
@ -4299,6 +4307,34 @@ SpellCastResult Spell::CheckCast(bool strict)
|
|||
// for effects of spells that have only one target
|
||||
switch(m_spellInfo->Effect[i])
|
||||
{
|
||||
case SPELL_EFFECT_INSTAKILL:
|
||||
// Death Pact
|
||||
if(m_spellInfo->Id == 48743)
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return SPELL_FAILED_ERROR;
|
||||
|
||||
if (!((Player*)m_caster)->GetSelection())
|
||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||
Pet* target = m_caster->GetMap()->GetPet(((Player*)m_caster)->GetSelection());
|
||||
|
||||
// alive
|
||||
if (!target || target->isDead())
|
||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||
// undead
|
||||
if (target->GetCreatureType() != CREATURE_TYPE_UNDEAD)
|
||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||
// owned
|
||||
if (target->GetOwnerGUID() != m_caster->GetGUID())
|
||||
return SPELL_FAILED_BAD_IMPLICIT_TARGETS;
|
||||
|
||||
float dist = GetSpellRadius(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i]));
|
||||
if (!target->IsWithinDistInMap(m_caster,dist))
|
||||
return SPELL_FAILED_OUT_OF_RANGE;
|
||||
|
||||
// will set in target selection code
|
||||
}
|
||||
break;
|
||||
case SPELL_EFFECT_DUMMY:
|
||||
{
|
||||
if(m_spellInfo->SpellIconID == 1648) // Execute
|
||||
|
|
|
|||
|
|
@ -2676,6 +2676,9 @@ void Spell::EffectHeal( uint32 /*i*/ )
|
|||
|
||||
addhealth += damageAmount;
|
||||
}
|
||||
// Death Pact (percent heal)
|
||||
else if (m_spellInfo->Id==48743)
|
||||
addhealth = addhealth * m_caster->GetMaxHealth() / 100;
|
||||
// Swiftmend - consumes Regrowth or Rejuvenation
|
||||
else if (m_spellInfo->TargetAuraState == AURA_STATE_SWIFTMEND && unitTarget->HasAuraState(AURA_STATE_SWIFTMEND))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8935"
|
||||
#define REVISION_NR "8936"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue