Ignore:
Timestamp:
Jan 16, 2012 7:56:19 AM (4 months ago)
Author:
MELERIX
Message:

STABLE: Sync with BETA [8629]

Location:
trunk/L2J_DataPack
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/L2J_DataPack

  • trunk/L2J_DataPack/dist/game/data/scripts/ai/group_template/L2AttackableAIScript.java

    r8406 r8630  
    1717import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_ATTACK; 
    1818 
     19import java.util.List; 
     20 
     21import com.l2jserver.Config; 
    1922import com.l2jserver.gameserver.ai.CtrlEvent; 
    2023import com.l2jserver.gameserver.ai.CtrlIntention; 
     
    207210                        final L2MonsterInstance mob = (L2MonsterInstance)npc; 
    208211                        if (mob.getLeader() != null) 
    209                                 mob.getLeader().getMinionList().onMinionDie(mob, -1); 
     212                        { 
     213                                final int respawnTime = Config.MINIONS_RESPAWN_TIME.get(mob.getNpcId()) > 0 ? Config.MINIONS_RESPAWN_TIME.get(mob.getNpcId()) * 1000 : -1; 
     214                                mob.getLeader().getMinionList().onMinionDie(mob, respawnTime); 
     215                        } 
    210216 
    211217                        if (mob.hasMinions()) 
     
    221227                for (int level =1; level<100; level++) 
    222228                { 
    223                         L2NpcTemplate[] templates = NpcTable.getInstance().getAllOfLevel(level); 
    224                         if ((templates != null) && (templates.length > 0)) 
    225                         { 
    226                                 for (L2NpcTemplate t: templates) 
     229                        final List<L2NpcTemplate> templates = NpcTable.getInstance().getAllOfLevel(level); 
     230                        for (L2NpcTemplate t : templates) 
     231                        { 
     232                                try 
    227233                                { 
    228                                         try 
     234                                        if (L2Attackable.class.isAssignableFrom(Class.forName("com.l2jserver.gameserver.model.actor.instance."+t.getType()+"Instance"))) 
    229235                                        { 
    230                                                 if ( L2Attackable.class.isAssignableFrom(Class.forName("com.l2jserver.gameserver.model.actor.instance."+t.type+"Instance"))) 
    231                                                 { 
    232                                                         ai.addEventId(t.npcId, Quest.QuestEventType.ON_ATTACK); 
    233                                                         ai.addEventId(t.npcId, Quest.QuestEventType.ON_KILL); 
    234                                                         ai.addEventId(t.npcId, Quest.QuestEventType.ON_SPAWN); 
    235                                                         ai.addEventId(t.npcId, Quest.QuestEventType.ON_SKILL_SEE); 
    236                                                         ai.addEventId(t.npcId, Quest.QuestEventType.ON_FACTION_CALL); 
    237                                                         ai.addEventId(t.npcId, Quest.QuestEventType.ON_AGGRO_RANGE_ENTER); 
    238                                                 } 
    239                                         } 
    240                                         catch(ClassNotFoundException ex) 
    241                                         { 
    242                                                 _log.info("Class not found "+t.type+"Instance"); 
     236                                                ai.addEventId(t.getNpcId(), Quest.QuestEventType.ON_ATTACK); 
     237                                                ai.addEventId(t.getNpcId(), Quest.QuestEventType.ON_KILL); 
     238                                                ai.addEventId(t.getNpcId(), Quest.QuestEventType.ON_SPAWN); 
     239                                                ai.addEventId(t.getNpcId(), Quest.QuestEventType.ON_SKILL_SEE); 
     240                                                ai.addEventId(t.getNpcId(), Quest.QuestEventType.ON_FACTION_CALL); 
     241                                                ai.addEventId(t.getNpcId(), Quest.QuestEventType.ON_AGGRO_RANGE_ENTER); 
    243242                                        } 
    244243                                } 
     244                                catch(ClassNotFoundException ex) 
     245                                { 
     246                                        _log.info("Class not found "+t.getType()+"Instance"); 
     247                                } 
    245248                        } 
    246249                } 
Note: See TracChangeset for help on using the changeset viewer.