mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-01 22:56:39 +01:00
*Add new eventAI action 105 call assistance. Param1 = radius.
--HG-- branch : trunk
This commit is contained in:
@@ -1932,13 +1932,15 @@ Unit* Creature::SelectNearestTarget(float dist) const
|
||||
return target;
|
||||
}
|
||||
|
||||
void Creature::CallAssistance()
|
||||
void Creature::CallAssistance(float radius)
|
||||
{
|
||||
if( !m_AlreadyCallAssistance && getVictim() && !isPet() && !isCharmed())
|
||||
{
|
||||
SetNoCallAssistance(true);
|
||||
|
||||
float radius = sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
|
||||
if(!radius)
|
||||
radius = sWorld.getConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS);
|
||||
|
||||
if(radius > 0)
|
||||
{
|
||||
std::list<Creature*> assistList;
|
||||
|
||||
@@ -617,7 +617,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
|
||||
float GetAttackDistance(Unit const* pl) const;
|
||||
|
||||
Unit* SelectNearestTarget(float dist = 0) const;
|
||||
void CallAssistance();
|
||||
void CallAssistance(float radius = 0);
|
||||
void SetNoCallAssistance(bool val) { m_AlreadyCallAssistance = val; }
|
||||
bool CanAssistTo(const Unit* u, const Unit* enemy) const;
|
||||
void DoFleeToGetAssistance(float radius = 50);
|
||||
|
||||
@@ -998,8 +998,12 @@ void CreatureEventAI::ProcessAction(uint16 type, uint32 param1, uint32 param2, u
|
||||
{
|
||||
sLog.outErrorDb("TSCR: EventAI failed to spawn object %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case ACTION_T_CALL_ASSISTANCE:
|
||||
m_creature->SetNoCallAssistance(false);
|
||||
m_creature->CallAssistance(param1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@ enum EventAI_ActionType
|
||||
ACTION_T_SET_AGGRESSIVE = 102, //Apply
|
||||
ACTION_T_ATTACK_START_PULSE = 103, //Distance
|
||||
ACTION_T_SUMMON_GO = 104, //GameObjectID, DespawnTime in ms
|
||||
ACTION_T_CALL_ASSISTANCE = 105, //Radius
|
||||
|
||||
ACTION_T_END,
|
||||
};
|
||||
|
||||
@@ -650,6 +650,14 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
case ACTION_T_RANDOM_TEXTEMOTE:
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u currently unused ACTION type. Did you forget to update database?", i, j+1);
|
||||
break;
|
||||
|
||||
case ACTION_T_SET_ACTIVE:
|
||||
case ACTION_T_SET_AGGRESSIVE:
|
||||
case ACTION_T_ATTACK_START_PULSE:
|
||||
case ACTION_T_SUMMON_GO:
|
||||
case ACTION_T_CALL_ASSISTANCE:
|
||||
break;
|
||||
|
||||
default:
|
||||
sLog.outErrorDb("CreatureEventAI: Event %u Action %u have currently not checked at load action type (%u). Need check code update?", i, j+1, temp.action[j].type);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user