aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bindings/scripts/docs/EventAI.txt1
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.cpp19
-rw-r--r--src/bindings/scripts/scripts/creature/mob_event_ai.h1
3 files changed, 18 insertions, 3 deletions
diff --git a/src/bindings/scripts/docs/EventAI.txt b/src/bindings/scripts/docs/EventAI.txt
index 580f73ae75b..37064b63e8b 100644
--- a/src/bindings/scripts/docs/EventAI.txt
+++ b/src/bindings/scripts/docs/EventAI.txt
@@ -120,6 +120,7 @@ Params are always read from Param1, then Param2, then Param3.
36 ACTION_T_UPDATE_TEMPLATE TemplateId, Team Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true
37 ACTION_T_DIE No Params Kills the creature
38 ACTION_T_ZONE_COMBAT_PULSE No Params Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances.
+39 ACTION_T_SUMMON_GO GameObjectID, DespawnTime Summons object (param1). Despawns after param2. Spawns on top of current creature. DespawnTime is in ms.
* = Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2)
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
index 9c0bf637429..c25fa7c1eb8 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp
@@ -1000,6 +1000,20 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
DoZoneInCombat();
}
break;
+ case ACTION_T_SUMMON_GO:
+ {
+ GameObject* pObject = NULL;
+
+ float x,y,z,rx,ry,rz;
+ m_creature->GetPosition(x,y,z);
+ pObject = m_creature->SummonGameObject(param1, x, y, z, 0, 0, 0, 0, 0, param2);
+ if (!pObject)
+ {
+ if (EAI_ErrorLevel > 0)
+ error_db_log( "SD2: EventAI failed to spawn object %u. Spawn event %d is on creature %d", param1, EventId, m_creature->GetEntry());
+ }
+ }
+ break;
// TRINITY ONLY
case ACTION_T_SET_ACTIVE:
@@ -1396,9 +1410,8 @@ CreatureAI* GetAI_Mob_EventAI(Creature *pCreature)
#endif
if( pCreature->GetMap()->IsDungeon() )
{
- if ((pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_HEROIC) ||
- (!pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_NORMAL))
- EventList.push_back(EventHolder(*i));
+ if ((pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_HEROIC) || (!pCreature->GetMap()->IsHeroic() && (*i).event_flags & EFLAG_NORMAL))
+ EventList.push_back(EventHolder(*i));
continue;
}
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h
index aff54b824f4..7b00d9d7942 100644
--- a/src/bindings/scripts/scripts/creature/mob_event_ai.h
+++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h
@@ -76,6 +76,7 @@ enum Action_Types
ACTION_T_UPDATE_TEMPLATE = 36, //Entry, Team
ACTION_T_DIE = 37, //No Params
ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params
+ ACTION_T_SUMMON_GO = 39, //GameObjectID, DespawnTime in ms
ACTION_T_SET_ACTIVE = 101, //Apply
ACTION_T_SET_AGGRESSIVE = 102, //Apply