[7863] Implement for EVENT_T_SPAWNED map/zone/subzone only event conditions.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Alex 2009-05-21 05:24:25 +04:00 committed by VladimirMangos
parent 0f928164e0
commit bde5402b40
5 changed files with 65 additions and 9 deletions

View file

@ -283,6 +283,23 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
if (temp.ooc_los.repeatMax < temp.ooc_los.repeatMin)
sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
break;
case EVENT_T_SPAWNED:
switch(temp.spawned.condition)
{
case SPAWNED_EVENT_ALWAY:
break;
case SPAWNED_EVENT_MAP:
if(!sMapStore.LookupEntry(temp.spawned.conditionValue1))
sLog.outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'map specific' but with not existed map (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
break;
case SPAWNED_EVENT_ZONE:
if(!GetAreaEntryByAreaID(temp.spawned.conditionValue1))
sLog.outErrorDb("CreatureEventAI: Creature %u are using spawned event(%u) with param1 = %u 'area specific' but with not existed area (%u) in param2. Event will never repeat.", temp.creature_id, i, temp.spawned.condition, temp.spawned.conditionValue1);
default:
sLog.outErrorDb("CreatureEventAI: Creature %u are using invalid spawned event %u mode (%u) in param1", temp.creature_id, i, temp.spawned.condition);
break;
}
break;
case EVENT_T_FRIENDLY_HP:
if (temp.friendly_hp.repeatMax < temp.friendly_hp.repeatMin)
sLog.outErrorDb("CreatureEventAI: Creature %u are using repeatable event(%u) with param4 < param3 (RepeatMax < RepeatMin). Event will never repeat.", temp.creature_id, i);
@ -327,7 +344,6 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
case EVENT_T_AGGRO:
case EVENT_T_DEATH:
case EVENT_T_EVADE:
case EVENT_T_SPAWNED:
case EVENT_T_REACHED_HOME:
{
if (temp.event_flags & EFLAG_REPEATABLE)