diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bindings/scripts/scripts/creature/mob_event_ai.cpp | 38 | 
1 files changed, 8 insertions, 30 deletions
| diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index 726bd1fb419..b302f1b3837 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -1377,11 +1377,11 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI      }  }; -CreatureAI* GetAI_Mob_EventAI(Creature *_Creature) +CreatureAI* GetAI_Mob_EventAI(Creature *pCreature)  {      //Select events by creature id      std::list<EventHolder> EventList; -    uint32 ID = _Creature->GetEntry(); +    uint32 ID = pCreature->GetEntry();      std::list<EventAI_Event>::iterator i; @@ -1394,33 +1394,11 @@ CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)              if ((*i).event_flags & EFLAG_DEBUG_ONLY)                  continue;  #endif -            if( _Creature->GetMap()->IsDungeon() ) +            if( pCreature->GetMap()->IsDungeon() )              { -                if( _Creature->GetMap()->IsHeroic() ) -                { -                    if( (*i).event_flags & EFLAG_HEROIC ) -                    { -                        EventList.push_back(EventHolder(*i)); -                        continue; -                    }else if( (*i).event_flags & EFLAG_NORMAL ) -                        continue; -                } -                else -                { -                    if( (*i).event_flags & EFLAG_NORMAL ) -                    { -                        EventList.push_back(EventHolder(*i)); -                        continue; -                    }else if( (*i).event_flags & EFLAG_HEROIC ) -                        continue; -                } - -                if (EAI_ErrorLevel > 1) -                { -                    error_db_log("SD2: Creature %u Event %u. Creature are in instance but neither EFLAG_NORMAL or EFLAG_HEROIC are set.", _Creature->GetEntry(), (*i).event_id); -                    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;              } @@ -1432,12 +1410,12 @@ CreatureAI* GetAI_Mob_EventAI(Creature *_Creature)      if (EventList.empty())      {          if (EAI_ErrorLevel > 1) -            error_db_log("SD2: Eventlist for Creature %u is empty but creature is using Mob_EventAI. Preventing EventAI on this creature.", _Creature->GetEntry()); +            error_db_log("SD2: Eventlist for Creature %u is empty but creature is using Mob_EventAI. Preventing EventAI on this creature.", pCreature->GetEntry());          return NULL;      } -    return new Mob_EventAI (_Creature, EventList); +    return new Mob_EventAI (pCreature, EventList);  }  void AddSC_mob_event() | 
