*enable EvantAI to summon gameobject

+tabs2spaces

--HG--
branch : trunk
This commit is contained in:
Rat
2009-04-15 21:21:41 +02:00
parent 4439ae690f
commit 09b4ef5f76
3 changed files with 18 additions and 3 deletions

View File

@@ -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)

View File

@@ -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;
}

View File

@@ -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