Fixed Carrion Feeder pet talent
Removed useless code for Wolverine Bite --HG-- branch : trunk
This commit is contained in:
@@ -349,5 +349,22 @@ bool CannibalizeObjectCheck::operator()(Corpse* u)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CarrionFeederObjectCheck::operator()(Corpse* u)
|
||||
{
|
||||
// ignore bones
|
||||
if (u->GetType() == CORPSE_BONES)
|
||||
return false;
|
||||
|
||||
Player* owner = ObjectAccessor::FindPlayer(u->GetOwnerGUID());
|
||||
|
||||
if (!owner || i_funit->IsFriendlyTo(owner))
|
||||
return false;
|
||||
|
||||
if (i_funit->IsWithinDistInMap(u, i_range))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
template void ObjectUpdater::Visit<GameObject>(GameObjectMapType &);
|
||||
template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType &);
|
||||
|
||||
@@ -562,6 +562,32 @@ namespace Trinity
|
||||
float i_range;
|
||||
};
|
||||
|
||||
class CarrionFeederObjectCheck
|
||||
{
|
||||
public:
|
||||
CarrionFeederObjectCheck(Unit* funit, float range) : i_funit(funit), i_range(range) {}
|
||||
bool operator()(Player* u)
|
||||
{
|
||||
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight())
|
||||
return false;
|
||||
|
||||
return i_funit->IsWithinDistInMap(u, i_range);
|
||||
}
|
||||
bool operator()(Corpse* u);
|
||||
bool operator()(Creature* u)
|
||||
{
|
||||
if (i_funit->IsFriendlyTo(u) || u->isAlive() || u->isInFlight() ||
|
||||
(u->GetCreatureTypeMask() & CREATURE_TYPEMASK_MECHANICAL_OR_ELEMENTAL) != 0)
|
||||
return false;
|
||||
|
||||
return i_funit->IsWithinDistInMap(u, i_range);
|
||||
}
|
||||
template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
|
||||
private:
|
||||
Unit* const i_funit;
|
||||
float i_range;
|
||||
};
|
||||
|
||||
// WorldObject do classes
|
||||
|
||||
class RespawnDo
|
||||
|
||||
@@ -542,8 +542,13 @@ void Spell::SelectSpellTargets()
|
||||
switch(m_spellInfo->Id)
|
||||
{
|
||||
case 20577: // Cannibalize
|
||||
case 54044: // Carrion Feeder
|
||||
{
|
||||
WorldObject* result = FindCorpseUsing<Trinity::CannibalizeObjectCheck> ();
|
||||
WorldObject* result = NULL;
|
||||
if (m_spellInfo->Id == 20577)
|
||||
result = FindCorpseUsing<Trinity::CannibalizeObjectCheck>();
|
||||
else
|
||||
result = FindCorpseUsing<Trinity::CarrionFeederObjectCheck>();
|
||||
|
||||
if (result)
|
||||
{
|
||||
|
||||
@@ -715,10 +715,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
|
||||
damage += m_caster->ToPlayer()->GetAmmoDPS()*item->GetProto()->Delay*0.001f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else if (m_spellInfo->Id == 53508)
|
||||
damage *= m_caster->getLevel();
|
||||
break;
|
||||
}
|
||||
case SPELLFAMILY_PALADIN:
|
||||
|
||||
Reference in New Issue
Block a user