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/individual/Valakas.java

    r8406 r8630  
    3030import com.l2jserver.gameserver.model.L2Object; 
    3131import com.l2jserver.gameserver.model.L2Skill; 
     32import com.l2jserver.gameserver.model.StatsSet; 
    3233import com.l2jserver.gameserver.model.actor.L2Character; 
    3334import com.l2jserver.gameserver.model.actor.L2Npc; 
     
    4142import com.l2jserver.gameserver.network.serverpackets.SocialAction; 
    4243import com.l2jserver.gameserver.network.serverpackets.SpecialCamera; 
    43 import com.l2jserver.gameserver.templates.StatsSet; 
    4444import com.l2jserver.gameserver.util.Util; 
    4545import com.l2jserver.util.Rnd; 
     
    4747/** 
    4848 * Valakas AI 
    49  *  
    5049 * @author Kerberos 
    5150 */ 
     
    6867        private static final int VALAKAS = 29028; 
    6968         
    70         //Valakas Status Tracking : 
    71         private static final byte DORMANT = 0; //Valakas is spawned and no one has entered yet. Entry is unlocked 
    72         private static final byte WAITING = 1; //Valakas is spawend and someone has entered, triggering a 30 minute window for additional people to enter 
    73         //before he unleashes his attack. Entry is unlocked 
    74         private static final byte FIGHTING = 2; //Valakas is engaged in battle, annihilating his foes. Entry is locked 
    75         private static final byte DEAD = 3; //Valakas has been killed. Entry is locked 
     69        // Valakas Status Tracking : 
     70        private static final byte DORMANT = 0; // Valakas is spawned and no one has entered yet. Entry is unlocked 
     71        private static final byte WAITING = 1; // Valakas is spawend and someone has entered, triggering a 30 minute window for additional people to enter 
     72        // before he unleashes his attack. Entry is unlocked 
     73        private static final byte FIGHTING = 2; // Valakas is engaged in battle, annihilating his foes. Entry is locked 
     74        private static final byte DEAD = 3; // Valakas has been killed. Entry is locked 
    7675         
    7776        private static L2BossZone _Zone; 
     
    8382                int[] mob = 
    8483                { 
    85                                 VALAKAS 
     84                        VALAKAS 
    8685                }; 
    8786                registerMobs(mob); 
     
    101100                        long temp = (info.getLong("respawn_time") - System.currentTimeMillis()); 
    102101                        // if valakas is locked until a certain time, mark it so and start the unlock timer 
    103                         // the unlock time has not yet expired.  Mark valakas as currently locked. Setup a timer 
     102                        // the unlock time has not yet expired. Mark valakas as currently locked. Setup a timer 
    104103                        // to fire at the correct time (calculate the time between now and the unlock time, 
    105104                        // setup a timer to fire after that many msec) 
     
    127126                                                } 
    128127                                                catch (Throwable e) 
    129                                                 {} 
     128                                                { 
     129                                                } 
    130130                                        } 
    131131                                }, 100L); 
     
    158158                                        } 
    159159                                        catch (Throwable e) 
    160                                         {} 
     160                                        { 
     161                                        } 
    161162                                } 
    162163                        }, 100L); 
     
    198199                                                } 
    199200                                                catch (Throwable e) 
    200                                                 {} 
     201                                                { 
     202                                                } 
    201203                                        } 
    202204                                }, 1L); 
     
    276278                        { 
    277279                                startQuestTimer("1102", 1500, npc, null); 
    278                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1300,180,-5,3000,15000,0,-5,1,0)); 
     280                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 180, -5, 3000, 15000, 0, -5, 1, 0)); 
    279281                        } 
    280282                        else if (event.equalsIgnoreCase("1102")) 
    281283                        { 
    282284                                startQuestTimer("1103", 3300, npc, null); 
    283                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),500,180,-8,600,15000,0,60,1,0)); 
     285                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, 180, -8, 600, 15000, 0, 60, 1, 0)); 
    284286                        } 
    285287                        else if (event.equalsIgnoreCase("1103")) 
    286288                        { 
    287289                                startQuestTimer("1104", 2900, npc, null); 
    288                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),800,180,-8,2700,15000,0,30,1,0)); 
     290                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 800, 180, -8, 2700, 15000, 0, 30, 1, 0)); 
    289291                        } 
    290292                        else if (event.equalsIgnoreCase("1104")) 
    291293                        { 
    292294                                startQuestTimer("1105", 2700, npc, null); 
    293                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),200,250,70,0,15000,30,80,1,0)); 
     295                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 200, 250, 70, 0, 15000, 30, 80, 1, 0)); 
    294296                        } 
    295297                        else if (event.equalsIgnoreCase("1105")) 
    296298                        { 
    297299                                startQuestTimer("1106", 1, npc, null); 
    298                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1100,250,70,2500,15000,30,80,1,0)); 
     300                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 250, 70, 2500, 15000, 30, 80, 1, 0)); 
    299301                        } 
    300302                        else if (event.equalsIgnoreCase("1106")) 
    301303                        { 
    302304                                startQuestTimer("1107", 3200, npc, null); 
    303                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),700,150,30,0,15000,-10,60,1,0)); 
     305                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 700, 150, 30, 0, 15000, -10, 60, 1, 0)); 
    304306                        } 
    305307                        else if (event.equalsIgnoreCase("1107")) 
    306308                        { 
    307309                                startQuestTimer("1108", 1400, npc, null); 
    308                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1200,150,20,2900,15000,-10,30,1,0)); 
     310                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1200, 150, 20, 2900, 15000, -10, 30, 1, 0)); 
    309311                        } 
    310312                        else if (event.equalsIgnoreCase("1108")) 
    311313                        { 
    312314                                startQuestTimer("1109", 6700, npc, null); 
    313                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),750,170,15,3400,15000,10,-15,1,0)); 
     315                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, 15, 3400, 15000, 10, -15, 1, 0)); 
    314316                        } 
    315317                        else if (event.equalsIgnoreCase("1109")) 
    316318                        { 
    317319                                startQuestTimer("1110", 5700, npc, null); 
    318                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),750,170,-10,3400,15000,4000,-15,1,0)); 
     320                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 750, 170, -10, 3400, 15000, 4000, -15, 1, 0)); 
    319321                        } 
    320322                        else if (event.equalsIgnoreCase("1110")) 
    321323                        { 
    322                                 GrandBossManager.getInstance().setBossStatus(VALAKAS,FIGHTING); 
     324                                GrandBossManager.getInstance().setBossStatus(VALAKAS, FIGHTING); 
    323325                                startQuestTimer("1002", 60000, npc, null, true); 
    324326                                npc.setIsInvul(false); 
     
    328330                        { 
    329331                                startQuestTimer("1112", 3500, npc, null); 
    330                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1100,210,-5,3000,10000,-13,0,1,1)); 
     332                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1100, 210, -5, 3000, 10000, -13, 0, 1, 1)); 
    331333                        } 
    332334                        else if (event.equalsIgnoreCase("1112")) 
    333335                        { 
    334336                                startQuestTimer("1113", 4500, npc, null); 
    335                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1300,200,-8,3000,10000,0,15,1,1)); 
     337                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1300, 200, -8, 3000, 10000, 0, 15, 1, 1)); 
    336338                        } 
    337339                        else if (event.equalsIgnoreCase("1113")) 
    338340                        { 
    339341                                startQuestTimer("1114", 500, npc, null); 
    340                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1000,190,0,3000,10000,0,10,1,1)); 
     342                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1000, 190, 0, 3000, 10000, 0, 10, 1, 1)); 
    341343                        } 
    342344                        else if (event.equalsIgnoreCase("1114")) 
    343345                        { 
    344346                                startQuestTimer("1115", 4600, npc, null); 
    345                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,120,0,2500,10000,12,40,1,1)); 
     347                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 120, 0, 2500, 10000, 12, 40, 1, 1)); 
    346348                        } 
    347349                        else if (event.equalsIgnoreCase("1115")) 
    348350                        { 
    349351                                startQuestTimer("1116", 750, npc, null); 
    350                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,20,0,3000,10000,10,10,1,1)); 
     352                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 20, 0, 3000, 10000, 10, 10, 1, 1)); 
    351353                        } 
    352354                        else if (event.equalsIgnoreCase("1116")) 
    353355                        { 
    354356                                startQuestTimer("1117", 2500, npc, null); 
    355                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,10,0,3000,10000,20,70,1,1)); 
     357                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 10000, 20, 70, 1, 1)); 
    356358                        } 
    357359                        else if (event.equalsIgnoreCase("1117")) 
    358360                        { 
    359                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,10,0,3000,250,20,-20,1,1)); 
     361                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 10, 0, 3000, 250, 20, -20, 1, 1)); 
    360362                                addSpawn(31759, 212852, -114842, -1632, 0, false, 900000); 
    361363                                int radius = 1500; 
    362364                                for (int i = 0; i < 20; i++) 
    363365                                { 
    364                                         int x = (int) (radius * Math.cos(i * .331)); //.331~2pi/19 
     366                                        int x = (int) (radius * Math.cos(i * .331)); // .331~2pi/19 
    365367                                        int y = (int) (radius * Math.sin(i * .331)); 
    366368                                        addSpawn(31759, 212852 + x, -114842 + y, -1632, 0, false, 900000); 
     
    385387                return super.onAdvEvent(event, npc, player); 
    386388        } 
    387  
     389         
    388390        @Override 
    389391        public String onSpawn(L2Npc npc) 
     
    392394                return super.onSpawn(npc); 
    393395        } 
    394  
     396         
    395397        @Override 
    396398        public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, L2Skill skill) 
     
    975977        { 
    976978                startQuestTimer("1111", 500, npc, null); 
    977                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),1700,2000,130,-1,0,10000,-20,1,1)); 
     979                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 2000, 130, -1, 0, 10000, -20, 1, 1)); 
    978980                npc.broadcastPacket(new PlaySound(1, "B03_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ())); 
    979                 GrandBossManager.getInstance().setBossStatus(VALAKAS,DEAD); 
     981                GrandBossManager.getInstance().setBossStatus(VALAKAS, DEAD); 
    980982                long respawnTime = (long) Config.Interval_Of_Valakas_Spawn + Rnd.get(Config.Random_Of_Valakas_Spawn); 
    981983                startQuestTimer("valakas_unlock", respawnTime, null, null); 
     
    13051307        public void broadcastSpawn(L2Npc npc) 
    13061308        { 
    1307                 Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values(); 
    1308                 { 
    1309                         for (L2Object obj : objs) 
    1310                         { 
    1311                                 if (obj instanceof L2PcInstance) 
    1312                                 { 
    1313                                         if (Util.checkIfInRange(10000, npc, obj, true)) 
    1314                                         { 
    1315                                                 ((L2Character) obj).sendPacket(new PlaySound(1, "B03_A", 1, npc.getObjectId(), 212852, -114842, -1632)); 
    1316                                                 ((L2Character) obj).sendPacket(new SocialAction(npc, 3)); 
    1317                                         } 
     1309                Collection<L2PcInstance> players = npc.getKnownList().getKnownPlayers().values(); 
     1310                { 
     1311                        for (L2PcInstance player : players) 
     1312                        { 
     1313                                if (Util.checkIfInRange(10000, npc, player, true)) 
     1314                                { 
     1315                                        player.sendPacket(new PlaySound(1, "B03_A", 1, npc.getObjectId(), 212852, -114842, -1632)); 
     1316                                        player.sendPacket(new SocialAction(npc.getObjectId(), 3)); 
    13181317                                } 
    13191318                        } 
     
    13251324        { 
    13261325                FastList<L2Character> result = new FastList<L2Character>(); 
    1327                 Collection<L2Object> objs = npc.getKnownList().getKnownObjects().values(); 
    1328                 { 
    1329                         for (L2Object obj : objs) 
    1330                         { 
    1331                                 if (obj instanceof L2PcInstance || obj instanceof L2Summon || obj instanceof L2DecoyInstance) 
    1332                                 { 
    1333                                         if (Util.checkIfInRange(5000, npc, obj, true) && !((L2Character) obj).isDead() && !((L2Character) obj).isGM()) 
    1334                                                 result.add((L2Character) obj); 
     1326                Collection<L2Character> objs = npc.getKnownList().getKnownCharacters(); 
     1327                { 
     1328                        for (L2Character cha : objs) 
     1329                        { 
     1330                                if (cha instanceof L2PcInstance || cha instanceof L2Summon || cha instanceof L2DecoyInstance) 
     1331                                { 
     1332                                        if (Util.checkIfInRange(5000, npc, cha, true) && !cha.isDead() && !cha.isGM()) 
     1333                                                result.add(cha); 
    13351334                                } 
    13361335                        } 
Note: See TracChangeset for help on using the changeset viewer.