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/SummonMinions.java

    r8406 r8630  
    1515package ai.group_template; 
    1616 
    17 import gnu.trove.TIntHashSet; 
    18 import gnu.trove.TIntObjectHashMap; 
     17import gnu.trove.map.hash.TIntObjectHashMap; 
     18import gnu.trove.set.hash.TIntHashSet; 
    1919import javolution.util.FastList; 
    2020import javolution.util.FastMap; 
     
    3131{ 
    3232        private static int HasSpawned; 
    33         private static TIntHashSet myTrackingSet = new TIntHashSet(); //Used to track instances of npcs 
    34         private FastMap<Integer, FastList<L2PcInstance>> _attackersList = new FastMap<Integer, FastList<L2PcInstance>>().shared(); 
     33        private static TIntHashSet myTrackingSet = new TIntHashSet(); // Used to track instances of npcs 
     34        private final FastMap<Integer, FastList<L2PcInstance>> _attackersList = new FastMap<Integer, FastList<L2PcInstance>>().shared(); 
    3535        private static final TIntObjectHashMap<int[]> MINIONS = new TIntObjectHashMap<int[]>(); 
    3636         
    3737        static 
    3838        { 
     39                //@formatter:off 
    3940                MINIONS.put(20767,new int[]{20768,20769,20770}); //Timak Orc Troop 
    4041                //MINIONS.put(22030,new Integer[]{22045,22047,22048}); //Ragna Orc Shaman 
     
    5556                MINIONS.put(22266,new int[]{18366,18366}); //Pythia 
    5657                MINIONS.put(22774,new int[]{22768,22768}); // Tanta Lizardman Summoner 
     58                //@formatter:on 
    5759        } 
    5860         
     
    6062        { 
    6163                super(questId, name, descr); 
    62                 int[] temp = 
    63                 { 
    64                                 20767,  21524, 21531, 21539, 22257, 22258, 22259, 22260, 22261, 22262, 22263, 22264, 22265, 22266, 22774 
    65                 }; 
    66                 this.registerMobs(temp, QuestEventType.ON_ATTACK, QuestEventType.ON_KILL); 
     64                registerMobs(MINIONS.keys(), QuestEventType.ON_ATTACK, QuestEventType.ON_KILL); 
    6765        } 
    6866         
     
    7472                if (MINIONS.containsKey(npcId)) 
    7573                { 
    76                         if (!myTrackingSet.contains(npcObjId)) //this allows to handle multiple instances of npc 
     74                        if (!myTrackingSet.contains(npcObjId)) // this allows to handle multiple instances of npc 
    7775                        { 
    7876                                synchronized (myTrackingSet) 
     
    8785                                switch (npcId) 
    8886                                { 
    89                                         case 22030: //mobs that summon minions only on certain hp 
     87                                        case 22030: // mobs that summon minions only on certain hp 
    9088                                        case 22032: 
    9189                                        case 22038: 
     
    9492                                                { 
    9593                                                        HasSpawned = 0; 
    96                                                         if (Rnd.get(100) < 33) //mobs that summon minions only on certain chance 
     94                                                        if (Rnd.get(100) < 33) // mobs that summon minions only on certain chance 
    9795                                                        { 
    9896                                                                int[] minions = MINIONS.get(npcId); 
     
    130128                                                                        FastList<L2PcInstance> player = new FastList<L2PcInstance>(); 
    131129                                                                        player.add(member); 
    132                                                                         _attackersList.put(npcObjId,player); 
     130                                                                        _attackersList.put(npcObjId, player); 
    133131                                                                } 
    134132                                                                else if (!_attackersList.get(npcObjId).contains(member)) 
     
    142140                                                                FastList<L2PcInstance> player = new FastList<L2PcInstance>(); 
    143141                                                                player.add(attacker); 
    144                                                                 _attackersList.put(npcObjId,player); 
     142                                                                _attackersList.put(npcObjId, player); 
    145143                                                        } 
    146144                                                        else if (!_attackersList.get(npcObjId).contains(attacker)) 
    147145                                                                _attackersList.get(npcObjId).add(attacker); 
    148146                                                } 
    149                                                 if ((attacker.getParty() != null && attacker.getParty().getMemberCount() > 2)||_attackersList.get(npcObjId).size() > 2) //Just to make sure.. 
     147                                                if ((attacker.getParty() != null && attacker.getParty().getMemberCount() > 2) || _attackersList.get(npcObjId).size() > 2) // Just to make sure.. 
    150148                                                { 
    151149                                                        HasSpawned = 0; 
     
    160158                                                break; 
    161159                                        } 
    162                                         default: //mobs without special conditions 
     160                                        default: // mobs without special conditions 
    163161                                        { 
    164162                                                HasSpawned = 0; 
Note: See TracChangeset for help on using the changeset viewer.