Dynamic Creature/Go spawning
Port From (https://github.com/TrinityCore/TrinityCore/commit/03b125e6d1947258316c931499746696a95aded2)
This commit is contained in:
@@ -2010,6 +2010,31 @@ namespace Game.Maps
|
||||
bool _reqAlive;
|
||||
}
|
||||
|
||||
class AnyPlayerInPositionRangeCheck : ICheck<Player>
|
||||
{
|
||||
public AnyPlayerInPositionRangeCheck(Position pos, float range, bool reqAlive = true)
|
||||
{
|
||||
_pos = pos;
|
||||
_range = range;
|
||||
_reqAlive = reqAlive;
|
||||
}
|
||||
|
||||
public bool Invoke(Player u)
|
||||
{
|
||||
if (_reqAlive && !u.IsAlive())
|
||||
return false;
|
||||
|
||||
if (!u.IsWithinDist3d(_pos, _range))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Position _pos;
|
||||
float _range;
|
||||
bool _reqAlive;
|
||||
}
|
||||
|
||||
class NearestPlayerInObjectRangeCheck : ICheck<Player>
|
||||
{
|
||||
public NearestPlayerInObjectRangeCheck(WorldObject obj, float range)
|
||||
|
||||
Reference in New Issue
Block a user