Scripts/Spells: Convert code from Spell::EffectDummy to spell scripts.

This commit is contained in:
Kandera
2012-02-18 12:12:49 +01:00
committed by QAston
parent d55c8c7cc4
commit c517806a23
24 changed files with 4446 additions and 2965 deletions
@@ -530,26 +530,24 @@ namespace Trinity
class RaiseDeadObjectCheck
{
public:
RaiseDeadObjectCheck(Unit* source, float range) : _source(source), i_range(range) {}
RaiseDeadObjectCheck(Unit* source, float range) : _source(source), _range(range) {}
bool operator()(Creature* u)
{
if (_source->GetTypeId() != TYPEID_PLAYER || !((Player*)_source)->isHonorOrXPTarget(u) ||
u->getDeathState() != CORPSE ||
u->getDeathState() != CORPSE ||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0 ||
(u->GetDisplayId() != u->GetNativeDisplayId()))
return false;
return _source->IsWithinDistInMap(u, i_range);
return _source->IsWithinDistInMap(u, _range);
}
bool operator()(Player* u)
{
if (_source == u || _source->GetTypeId() != TYPEID_PLAYER || !((Player*)_source)->isHonorOrXPTarget(u) ||
u->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST) || u->isInFlight() || !u->isDead() ||
(u->GetCreatureTypeMask() & (1 << (CREATURE_TYPE_HUMANOID-1))) == 0)
return false;
return _source->IsWithinDistInMap(u, i_range);
return _source->IsWithinDistInMap(u, _range);
}
bool operator()(Corpse* u)
@@ -557,12 +555,12 @@ namespace Trinity
if (_source->GetTypeId() != TYPEID_PLAYER || u->GetType() == CORPSE_BONES)
return false;
return _source->IsWithinDistInMap(u, i_range);
return _source->IsWithinDistInMap(u, _range);
}
template<class NOT_INTERESTED> bool operator()(NOT_INTERESTED*) { return false; }
private:
Unit* const _source;
float i_range;
float _range;
};
class ExplodeCorpseObjectCheck