Core/Movement: Add LOS check for fleeingmovement target point.

Prevents fleeing or feared units from going to upper floor ignoring walls/ceilings with mmaps on(and usually get stucked).

Current implementation just randomly selects a distance and angle against the frighting unit, when in narrow circumstance such as underground caves, such targeting point would be at another floor.

Closes #11300
Ref #9475 (needs fixed confirmation)
This commit is contained in:
zengwf
2014-01-12 00:32:16 +00:00
committed by Duarte Duarte
parent 0eadb41ed1
commit 23acf75d3b
15 changed files with 42 additions and 27 deletions

View File

@@ -228,7 +228,7 @@ class boss_akilzon : public CreatureScript
case EVENT_STATIC_DISRUPTION:
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!target)
if (!target)
target = me->GetVictim();
if (target)
{
@@ -244,7 +244,7 @@ class boss_akilzon : public CreatureScript
case EVENT_GUST_OF_WIND:
{
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1);
if (!target)
if (!target)
target = me->GetVictim();
if (target)
DoCast(target, SPELL_GUST_OF_WIND);

View File

@@ -467,7 +467,7 @@ public:
CallDragon(DATA_TENEBRON);
break;
case EVENT_CALL_SHADRON:
CallDragon(DATA_SHADRON);
CallDragon(DATA_SHADRON);
break;
case EVENT_CALL_VESPERON:
CallDragon(DATA_VESPERON);

View File

@@ -195,8 +195,8 @@ public:
struct npc_crystal_spike_triggerAI : public ScriptedAI
{
npc_crystal_spike_triggerAI(Creature* creature) : ScriptedAI(creature)
{
npc_crystal_spike_triggerAI(Creature* creature) : ScriptedAI(creature)
{
_count = 0;
_despawntimer = 0;
}

View File

@@ -428,8 +428,8 @@ public:
struct npc_jennyAI : public ScriptedAI
{
npc_jennyAI(Creature* creature) : ScriptedAI(creature)
{
npc_jennyAI(Creature* creature) : ScriptedAI(creature)
{
setCrateNumber = false;
}

View File

@@ -1125,7 +1125,7 @@ public:
struct npc_oscillating_frequency_scanner_master_bunnyAI : public ScriptedAI
{
npc_oscillating_frequency_scanner_master_bunnyAI(Creature* creature) : ScriptedAI(creature)
npc_oscillating_frequency_scanner_master_bunnyAI(Creature* creature) : ScriptedAI(creature)
{
playerGuid = 0;
}

View File

@@ -54,7 +54,7 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript
uint64 ownerGuid = me->GetOwnerGUID();
if (!ownerGuid)
return;
// Find victim of Summon Gargoyle spell
std::list<Unit*> targets;
Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30.0f);