aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Creature.cpp6
-rw-r--r--src/game/Creature.h2
-rw-r--r--src/game/CreatureEventAI.cpp6
-rw-r--r--src/game/CreatureEventAI.h1
-rw-r--r--src/game/CreatureEventAIMgr.cpp8
5 files changed, 19 insertions, 4 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 5b3f45b66dd..5d8df6de1de 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -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;
diff --git a/src/game/Creature.h b/src/game/Creature.h
index c1c1acb524c..4ac2ba3d3cd 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -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);
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp
index 72aae0aebf8..c50243b0fb3 100644
--- a/src/game/CreatureEventAI.cpp
+++ b/src/game/CreatureEventAI.cpp
@@ -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;
}
}
diff --git a/src/game/CreatureEventAI.h b/src/game/CreatureEventAI.h
index c6b103b3279..6c21f1abdce 100644
--- a/src/game/CreatureEventAI.h
+++ b/src/game/CreatureEventAI.h
@@ -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,
};
diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp
index 6e9947ffbd2..48c6082a4d4 100644
--- a/src/game/CreatureEventAIMgr.cpp
+++ b/src/game/CreatureEventAIMgr.cpp
@@ -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;