Dynamic Creature/Go spawning

Port From (https://github.com/TrinityCore/TrinityCore/commit/03b125e6d1947258316c931499746696a95aded2)
This commit is contained in:
hondacrx
2020-08-23 21:52:32 -04:00
parent 8fc9c45d50
commit 15ae7a7c66
45 changed files with 3925 additions and 1963 deletions
+25
View File
@@ -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)