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

    r7691 r8630  
    2424import com.l2jserver.gameserver.instancemanager.ZoneManager; 
    2525import com.l2jserver.gameserver.model.L2Spawn; 
     26import com.l2jserver.gameserver.model.Location; 
    2627import com.l2jserver.gameserver.model.actor.L2Character; 
    2728import com.l2jserver.gameserver.model.actor.L2Npc; 
     
    3738{ 
    3839        final private static String qn = "SeedOfAnnihilation"; 
    39         private static final Map<Integer, int[]> _teleportZones = new FastMap<Integer, int[]>(); 
     40        private static final Map<Integer, Location> _teleportZones = new FastMap<>(); 
    4041        private static final int ANNIHILATION_FURNACE = 18928; 
     42 
    4143        // Strength, Agility, Wisdom 
    42         private static final int[] ZONE_BUFFS = { 0, 6443, 6444, 6442 }; 
    43         private static final int[][] ZONE_BUFFS_LIST = { {1,2,3},{1,3,2},{2,1,3},{2,3,1},{3,2,1},{3,1,2} }; 
     44        private static final int[] ZONE_BUFFS = 
     45        { 
     46                0, 6443, 6444, 6442 
     47        }; 
     48         
     49        private static final int[][] ZONE_BUFFS_LIST = 
     50        { 
     51                { 
     52                        1, 2, 3 
     53                }, 
     54                { 
     55                        1, 3, 2 
     56                }, 
     57                { 
     58                        2, 1, 3 
     59                }, 
     60                { 
     61                        2, 3, 1 
     62                }, 
     63                { 
     64                        3, 2, 1 
     65                }, 
     66                { 
     67                        3, 1, 2 
     68                } 
     69        }; 
    4470         
    4571        // 0: Bistakon, 1: Reptilikon, 2: Cokrakon 
    46         private SeedRegion[] _regionsData = new SeedRegion[3]; 
     72        private final SeedRegion[] _regionsData = new SeedRegion[3]; 
    4773        private Long _seedsNextStatusChange; 
    4874         
     
    6793        static 
    6894        { 
    69                 _teleportZones.put(60002, new int[]{ -213175, 182648, -10992 }); 
    70                 _teleportZones.put(60003, new int[]{ -181217, 186711, -10528 }); 
    71                 _teleportZones.put(60004, new int[]{ -180211, 182984, -15152 }); 
    72                 _teleportZones.put(60005, new int[]{ -179275, 186802, -10720 }); 
     95                _teleportZones.put(60002, new Location(-213175, 182648, -10992)); 
     96                _teleportZones.put(60003, new Location(-181217, 186711, -10528)); 
     97                _teleportZones.put(60004, new Location(-180211, 182984, -15152)); 
     98                _teleportZones.put(60005, new Location(-179275, 186802, -10720)); 
    7399        } 
    74100         
     
    76102        { 
    77103                // Bistakon data 
    78                 _regionsData[0] = new SeedRegion(new int[]{ 22750, 22751, 22752, 22753 }, 
    79                                 new int[][]{ { 22746, 22746, 22746 }, { 22747, 22747, 22747 }, 
    80                                 { 22748, 22748, 22748 }, { 22749, 22749, 22749 } }, 60006, 
    81                                 new int[][]{ {-180450,185507,-10544,11632},{-180005,185489,-10544,11632} }); 
     104                _regionsData[0] = new SeedRegion(new int[] 
     105                { 
     106                        22750, 22751, 22752, 22753 
     107                }, new int[][] 
     108                { 
     109                        { 
     110                                22746, 22746, 22746 
     111                        }, 
     112                        { 
     113                                22747, 22747, 22747 
     114                        }, 
     115                        { 
     116                                22748, 22748, 22748 
     117                        }, 
     118                        { 
     119                                22749, 22749, 22749 
     120                        } 
     121                }, 60006, new int[][] 
     122                { 
     123                        { 
     124                                -180450, 185507, -10544, 11632 
     125                        }, 
     126                        { 
     127                                -180005, 185489, -10544, 11632 
     128                        } 
     129                }); 
    82130                 
    83131                // Reptilikon data 
    84                 _regionsData[1] = new SeedRegion(new int[]{ 22757, 22758, 22759 }, 
    85                                 new int[][]{ { 22754, 22755, 22756 } }, 60007, 
    86                                 new int[][]{ {-179600,186998,-10704,11632},{-179295,186444,-10704,11632} }); 
     132                _regionsData[1] = new SeedRegion(new int[] 
     133                { 
     134                        22757, 22758, 22759 
     135                }, new int[][] 
     136                { 
     137                        { 
     138                                22754, 22755, 22756 
     139                        } 
     140                }, 60007, new int[][] 
     141                { 
     142                        { 
     143                                -179600, 186998, -10704, 11632 
     144                        }, 
     145                        { 
     146                                -179295, 186444, -10704, 11632 
     147                        } 
     148                }); 
    87149                 
    88150                // Cokrakon data 
    89                 _regionsData[2] = new SeedRegion(new int[]{ 22763, 22764, 22765 }, 
    90                                 new int[][]{ { 22760, 22760, 22761 }, { 22760, 22760, 22762 }, 
    91                                 { 22761, 22761, 22760 }, { 22761, 22761, 22762 }, { 22762, 22762, 22760 }, 
    92                                 { 22762, 22762, 22761 } }, 60008, 
    93                                 new int[][]{ {-180971,186361,-10528,11632},{-180758,186739,-10528,11632} }); 
     151                _regionsData[2] = new SeedRegion(new int[] 
     152                { 
     153                        22763, 22764, 22765 
     154                }, new int[][] 
     155                { 
     156                        { 
     157                                22760, 22760, 22761 
     158                        }, 
     159                        { 
     160                                22760, 22760, 22762 
     161                        }, 
     162                        { 
     163                                22761, 22761, 22760 
     164                        }, 
     165                        { 
     166                                22761, 22761, 22762 
     167                        }, 
     168                        { 
     169                                22762, 22762, 22760 
     170                        }, 
     171                        { 
     172                                22762, 22762, 22761 
     173                        } 
     174                }, 60008, new int[][] 
     175                { 
     176                        { 
     177                                -180971, 186361, -10528, 11632 
     178                        }, 
     179                        { 
     180                                -180758, 186739, -10528, 11632 
     181                        } 
     182                }); 
     183                 
    94184                int buffsNow = 0; 
    95185                String var = loadGlobalQuestVar("SeedNextStatusChange"); 
     
    126216                super(questId, name, descr); 
    127217                loadSeedRegionData(); 
    128                 for(int i : _teleportZones.keySet()) 
     218                for (int i : _teleportZones.keySet()) 
    129219                        addEnterZoneId(i); 
    130                 for(int i = 0; i < _regionsData.length; i++) 
    131                         for(int j = 0; j < _regionsData[i].elite_mob_ids.length; j++) 
     220                for (int i = 0; i < _regionsData.length; i++) 
     221                        for (int j = 0; j < _regionsData[i].elite_mob_ids.length; j++) 
    132222                                addSpawnId(_regionsData[i].elite_mob_ids[j]); 
    133223                addStartNpc(32739); 
     
    139229        private void startEffectZonesControl() 
    140230        { 
    141                 for(int i = 0; i < _regionsData.length; i++) 
    142                 { 
    143                         for(int j = 0; j < _regionsData[i].af_spawns.length; j++) 
     231                for (int i = 0; i < _regionsData.length; i++) 
     232                { 
     233                        for (int j = 0; j < _regionsData[i].af_spawns.length; j++) 
    144234                        { 
    145235                                _regionsData[i].af_npcs[j] = addSpawn(ANNIHILATION_FURNACE, _regionsData[i].af_spawns[j][0], _regionsData[i].af_spawns[j][1], _regionsData[i].af_spawns[j][2], _regionsData[i].af_spawns[j][3], false, 0); 
     
    157247                        if (spawn == null) 
    158248                                continue; 
    159                         for(int i = 0; i < _regionsData.length; i++) 
     249                        for (int i = 0; i < _regionsData.length; i++) 
    160250                        { 
    161251                                if (Util.contains(_regionsData[i].elite_mob_ids, spawn.getNpcid())) 
     
    178268        public String onSpawn(L2Npc npc) 
    179269        { 
    180                 for(int i = 0; i < _regionsData.length; i++) 
     270                for (int i = 0; i < _regionsData.length; i++) 
    181271                { 
    182272                        if (Util.contains(_regionsData[i].elite_mob_ids, npc.getNpcId())) 
    183                                 spawnGroupOfMinion((L2MonsterInstance)npc, _regionsData[i].minion_lists[Rnd.get(_regionsData[i].minion_lists.length)]); 
     273                                spawnGroupOfMinion((L2MonsterInstance) npc, _regionsData[i].minion_lists[Rnd.get(_regionsData[i].minion_lists.length)]); 
    184274                } 
    185275                return super.onSpawn(npc); 
     
    187277         
    188278        @Override 
    189         public String onAdvEvent (String event, L2Npc npc, L2PcInstance player) 
     279        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) 
    190280        { 
    191281                if (event.equalsIgnoreCase("ChangeSeedsStatus")) 
     
    195285                        _seedsNextStatusChange = getNextSeedsStatusChangeTime(); 
    196286                        saveGlobalQuestVar("SeedNextStatusChange", String.valueOf(_seedsNextStatusChange)); 
    197                         for(int i = 0; i < _regionsData.length; i++) 
     287                        for (int i = 0; i < _regionsData.length; i++) 
    198288                        { 
    199289                                _regionsData[i].activeBuff = ZONE_BUFFS_LIST[buffsNow][i]; 
    200290                                 
    201                                 for(L2Npc af : _regionsData[i].af_npcs) 
     291                                for (L2Npc af : _regionsData[i].af_npcs) 
    202292                                        af.setDisplayEffect(_regionsData[i].activeBuff); 
    203293                                 
     
    224314         
    225315        @Override 
    226         public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet) 
    227         { 
    228                 return super.onKill(npc,killer,isPet); 
     316        public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) 
     317        { 
     318                return super.onKill(npc, killer, isPet); 
    229319        } 
    230320         
     
    234324                if (_teleportZones.containsKey(zone.getId())) 
    235325                { 
    236                         int[] teleLoc = _teleportZones.get(zone.getId()); 
    237                         character.teleToLocation(teleLoc[0],teleLoc[1],teleLoc[2]); 
     326                        Location teleLoc = _teleportZones.get(zone.getId()); 
     327                        character.teleToLocation(teleLoc, false); 
    238328                } 
    239329                return super.onEnterZone(character, zone); 
     
    242332        public static void main(String[] args) 
    243333        { 
    244                 new SeedOfAnnihilation(-1,qn,"ai"); 
     334                new SeedOfAnnihilation(-1, qn, "ai"); 
    245335        } 
    246336} 
Note: See TracChangeset for help on using the changeset viewer.