Core/SmartAI: Various fixes and extensions for smart scripts:
Port From (https://github.com/TrinityCore/TrinityCore/commit/a32d5cfa1762ae1158ee2f40b4c9b36e5b41913a)
This commit is contained in:
@@ -1909,14 +1909,6 @@ namespace Game.Entities
|
||||
return searcher.GetTarget();
|
||||
}
|
||||
|
||||
public Player SelectNearestPlayer(float distance)
|
||||
{
|
||||
var checker = new NearestPlayerInObjectRangeCheck(this, distance);
|
||||
var searcher = new PlayerLastSearcher(this, checker);
|
||||
Cell.VisitAllObjects(this, searcher, distance);
|
||||
return searcher.GetTarget();
|
||||
}
|
||||
|
||||
public void SendAIReaction(AiReaction reactionType)
|
||||
{
|
||||
AIReaction packet = new AIReaction();
|
||||
|
||||
@@ -569,6 +569,11 @@ namespace Game.Entities
|
||||
SetLootState(LootState.JustDeactivated);
|
||||
return;
|
||||
}
|
||||
|
||||
// Call AI Reset (required for example in SmartAI to clear one time events)
|
||||
if (GetAI() != null)
|
||||
GetAI().Reset();
|
||||
|
||||
// respawn timer
|
||||
uint poolid = GetSpawnId() != 0 ? Global.PoolMgr.IsPartOfAPool<GameObject>(GetSpawnId()) : 0;
|
||||
if (poolid != 0)
|
||||
@@ -1305,7 +1310,7 @@ namespace Game.Entities
|
||||
if (Global.ScriptMgr.OnGossipHello(playerUser, this))
|
||||
return;
|
||||
|
||||
if (GetAI().GossipHello(playerUser, true))
|
||||
if (GetAI().GossipHello(playerUser, false))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1544,6 +1544,14 @@ namespace Game.Entities
|
||||
return searcher.GetTarget();
|
||||
}
|
||||
|
||||
public Player SelectNearestPlayer(float distance)
|
||||
{
|
||||
var checker = new NearestPlayerInObjectRangeCheck(this, distance);
|
||||
var searcher = new PlayerLastSearcher(this, checker);
|
||||
Cell.VisitAllObjects(this, searcher, distance);
|
||||
return searcher.GetTarget();
|
||||
}
|
||||
|
||||
public void GetGameObjectListWithEntryInGrid(List<GameObject> gameobjectList, uint entry = 0, float maxSearchRange = 250.0f)
|
||||
{
|
||||
var check = new AllGameObjectsWithEntryInRange(this, entry, maxSearchRange);
|
||||
|
||||
@@ -3147,7 +3147,7 @@ namespace Game.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
bool IsValidAssistTarget(Unit target)
|
||||
public bool IsValidAssistTarget(Unit target)
|
||||
{
|
||||
return _IsValidAssistTarget(target, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user