[12741] Ported ACTION_T_SUMMON_UNIQUE from mangos-zero, updated descriptions

This commit is contained in:
sanctum32 2013-12-13 17:04:23 +02:00 committed by Antz
parent ad4fb2d31d
commit 2daeb8b63d
8 changed files with 1541 additions and 1706 deletions

View file

@ -960,6 +960,48 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32
m_throwAIEventMask = action.setThrowMask.eventTypeMask;
break;
}
case ACTION_T_SUMMON_UNIQUE:
{
Creature* pCreature = NULL;
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_creature, action.summon_unique.creatureId, true, false, 100, true);
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(pCreature, u_check);
Cell::VisitGridObjects(m_creature, searcher, 100);
WorldObject* pSpawn = NULL;
pSpawn = pCreature;
if (!pSpawn)
{
Unit* target = GetTargetByType(action.summon_unique.target, pActionInvoker, pAIEventSender, reportTargetError);
if (!target && reportTargetError)
sLog.outErrorEventAI("Event %u - NULL target for ACTION_T_SUMMON_UNIQUE(%u), target-type %u", EventId, action.type, action.summon_unique.target);
CreatureEventAI_Summon_Map::const_iterator i = sEventAIMgr.GetCreatureEventAISummonMap().find(action.summon_unique.spawnId);
if (i == sEventAIMgr.GetCreatureEventAISummonMap().end())
{
sLog.outErrorEventAI("Failed to spawn creature %u. Summon map index %u does not exist. EventID %d. CreatureID %d", action.summon_unique.creatureId, action.summon_unique.spawnId, EventId, m_creature->GetEntry());
return;
}
Creature* pCreature = NULL;
if ((*i).second.SpawnTimeSecs)
pCreature = m_creature->SummonCreature(action.summon_unique.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OOC_OR_DEAD_DESPAWN, (*i).second.SpawnTimeSecs);
else
pCreature = m_creature->SummonCreature(action.summon_unique.creatureId, (*i).second.position_x, (*i).second.position_y, (*i).second.position_z, (*i).second.orientation, TEMPSUMMON_TIMED_OOC_DESPAWN, 0);
if (!pCreature)
sLog.outErrorEventAI("Failed to spawn creature %u. EventId %d.Creature %d", action.summon_unique.creatureId, EventId, m_creature->GetEntry());
else if (action.summon_unique.target != TARGET_T_SELF && target)
pCreature->AI()->AttackStart(target);
break;
}
if (pSpawn)
{
return;
}
}
case ACTION_T_EMOTE_TARGET:
{
Unit* pCreature = m_creature->GetMap()->GetCreature(ObjectGuid(HIGHGUID_UNIT, action.emoteTarget.targetGuid));

View file

@ -117,7 +117,8 @@ enum EventAI_ActionType
ACTION_T_CHANCED_TEXT = 44, // Chance to display the text, TextId1, optionally TextId2. If more than just -TextId1 is defined, randomize. Negative values.
ACTION_T_THROW_AI_EVENT = 45, // EventType, Radius, unused
ACTION_T_SET_THROW_MASK = 46, // EventTypeMask, unused, unused
ACTION_T_EMOTE_TARGET = 47, // EmoteId, TargetGuid
ACTION_T_SUMMON_UNIQUE = 47, // CreatureId, Target, SpawnId
ACTION_T_EMOTE_TARGET = 48, // EmoteId, TargetGuid
ACTION_T_END,
};
@ -398,7 +399,14 @@ struct CreatureEventAI_Action
uint32 unused1;
uint32 unused2;
} setThrowMask;
// ACTION_T_EMOTE_TARGET = 47
// ACTION_T_SUMMON_UNIQUE = 47
struct
{
uint32 creatureId;
uint32 target;
uint32 spawnId;
} summon_unique;
// ACTION_T_EMOTE_TARGET = 48
struct
{
uint32 emoteId;

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12740"
#define REVISION_NR "12741"
#endif // __REVISION_NR_H__

View file

@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_12712_01_characters_characters"
#define REVISION_DB_MANGOS "required_12738_01_mangos_spell_template"
#define REVISION_DB_MANGOS "required_12741_01_mangos"
#define REVISION_DB_REALMD "required_c12484_02_realmd_account_access"
#endif // __REVISION_SQL_H__