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/instances/CrystalCaverns/CrystalCaverns.java

    r8406 r8630  
    2828import com.l2jserver.gameserver.instancemanager.InstanceManager.InstanceWorld; 
    2929import com.l2jserver.gameserver.model.L2CharPosition; 
    30 import com.l2jserver.gameserver.model.L2ItemInstance; 
    3130import com.l2jserver.gameserver.model.L2Object; 
    3231import com.l2jserver.gameserver.model.L2Party; 
    3332import com.l2jserver.gameserver.model.L2Skill; 
    34 import com.l2jserver.gameserver.model.L2Skill.SkillTargetType; 
    3533import com.l2jserver.gameserver.model.L2World; 
    3634import com.l2jserver.gameserver.model.Location; 
     
    4442import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 
    4543import com.l2jserver.gameserver.model.entity.Instance; 
     44import com.l2jserver.gameserver.model.item.instance.L2ItemInstance; 
    4645import com.l2jserver.gameserver.model.quest.Quest; 
    4746import com.l2jserver.gameserver.model.quest.QuestState; 
    48 import com.l2jserver.gameserver.model.quest.State; 
    4947import com.l2jserver.gameserver.model.zone.L2ZoneType; 
    5048import com.l2jserver.gameserver.network.NpcStringId; 
     
    5654import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; 
    5755import com.l2jserver.gameserver.network.serverpackets.PlaySound; 
    58 import com.l2jserver.gameserver.network.serverpackets.SocialAction; 
    5956import com.l2jserver.gameserver.network.serverpackets.SpecialCamera; 
    6057import com.l2jserver.gameserver.network.serverpackets.SystemMessage; 
    6158import com.l2jserver.gameserver.network.serverpackets.ValidateLocation; 
     59import com.l2jserver.gameserver.templates.skills.L2TargetType; 
    6260import com.l2jserver.gameserver.util.Util; 
    6361import com.l2jserver.util.Rnd; 
     
    106104                public           List<L2Npc> oracle                               = new FastList<L2Npc>(); 
    107105                // baylor variables 
    108                 private List<L2PcInstance> _raiders = new FastList<L2PcInstance>(); 
     106                private final List<L2PcInstance> _raiders = new FastList<L2PcInstance>(); 
    109107                private int _raidStatus = 0; 
    110108                private long _dragonClawStart = 0; 
    111109                private int _dragonClawNeed = 0; 
    112                 private List<L2Npc> _animationMobs = new FastList<L2Npc>(); 
     110                private final List<L2Npc> _animationMobs = new FastList<L2Npc>(); 
    113111                private L2Npc _camera = null; 
    114112                private L2Npc _baylor = null; 
     
    328326        private static final int DRAGONCLAWTIME = 3000; 
    329327         
    330         private static class teleCoord {int instanceId; int x; int y; int z;} 
    331          
    332         protected void openDoor(int doorId,int instanceId) 
     328        private static class teleCoord 
     329        { 
     330                int instanceId; 
     331                int x; 
     332                int y; 
     333                int z; 
     334        } 
     335         
     336        protected void openDoor(int doorId, int instanceId) 
    333337        { 
    334338                for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors()) 
     
    337341        } 
    338342         
    339         protected void closeDoor(int doorId,int instanceId) 
     343        protected void closeDoor(int doorId, int instanceId) 
    340344        { 
    341345                for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors()) 
     
    352356                if (party == null) 
    353357                { 
    354                         player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER)); 
     358                        player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER); 
    355359                        return false; 
    356360                } 
    357361                if (party.getLeader() != player) 
    358362                { 
    359                         player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER)); 
     363                        player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER); 
    360364                        return false; 
    361365                } 
     
    403407                if (party == null) 
    404408                { 
    405                         player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER)); 
     409                        player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER); 
    406410                        return false; 
    407411                } 
    408412                if (party.getLeader() != player) 
    409413                { 
    410                         player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER)); 
     414                        player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER); 
    411415                        return false; 
    412416                } 
     
    437441                if (party == null) 
    438442                { 
    439                         player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER)); 
     443                        player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER); 
    440444                        return false; 
    441445                } 
    442446                if (party.getLeader() != player) 
    443447                { 
    444                         player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER)); 
     448                        player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER); 
    445449                        return false; 
    446450                } 
     
    526530        protected int enterInstance(L2PcInstance player, String template, teleCoord teleto) 
    527531        { 
    528                 //check for existing instances for this player 
     532                // check for existing instances for this player 
    529533                InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); 
    530                 //existing instance 
     534                // existing instance 
    531535                if (world != null) 
    532536                { 
    533537                        if (!(world instanceof CCWorld)) 
    534538                        { 
    535                                 player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER)); 
     539                                player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER); 
    536540                                return 0; 
    537541                        } 
    538542                        teleto.instanceId = world.instanceId; 
    539                         teleportplayer(player,teleto); 
     543                        teleportplayer(player, teleto); 
    540544                        return world.instanceId; 
    541545                } 
    542                 //New instance 
     546                 
     547                // New instance 
     548                if (!checkConditions(player)) 
     549                        return 0; 
     550                L2Party party = player.getParty(); 
     551                int instanceId = InstanceManager.getInstance().createDynamicInstance(template); 
     552                world = new CCWorld(System.currentTimeMillis() + 5400000); 
     553                world.instanceId = instanceId; 
     554                world.templateId = INSTANCEID; 
     555                InstanceManager.getInstance().addWorld(world); 
     556                _log.info("Crystal Caverns started " + template + " Instance: " + instanceId + " created by player: " + player.getName()); 
     557                runOracle((CCWorld) world); 
     558                // teleport players 
     559                teleto.instanceId = instanceId; 
     560                if (player.getParty() == null) 
     561                { 
     562                        // this can happen only if debug is true 
     563                        player.sendMessage("Welcome to Crystal Caverns."); 
     564                        InstanceManager.getInstance().setInstanceTime(player.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + INSTANCEPENALTY))); 
     565                        teleportplayer(player, teleto); 
     566                        world.allowed.add(player.getObjectId()); 
     567                } 
    543568                else 
    544569                { 
    545                         if (!checkConditions(player)) 
    546                                 return 0; 
    547                         L2Party party = player.getParty(); 
    548                         int instanceId = InstanceManager.getInstance().createDynamicInstance(template); 
    549                         world = new CCWorld(System.currentTimeMillis() + 5400000); 
    550                         world.instanceId = instanceId; 
    551                         world.templateId = INSTANCEID; 
    552                         InstanceManager.getInstance().addWorld(world); 
    553                         _log.info("Crystal Caverns started " + template + " Instance: " + instanceId + " created by player: " + player.getName()); 
    554                         runOracle((CCWorld)world); 
    555                         // teleport players 
    556                         teleto.instanceId = instanceId; 
    557                         if (player.getParty() == null) 
    558                         { 
    559                                 // this can happen only if debug is true 
    560                                 player.sendMessage("Welcome to Crystal Caverns."); 
    561                                 InstanceManager.getInstance().setInstanceTime(player.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + INSTANCEPENALTY))); 
    562                                 teleportplayer(player,teleto); 
    563                                 world.allowed.add(player.getObjectId()); 
    564                         } 
    565                         else 
    566                         { 
    567                                 for (L2PcInstance partyMember : party.getPartyMembers()) 
    568                                 { 
    569                                         partyMember.sendMessage("Welcome to Crystal Caverns."); 
    570                                         InstanceManager.getInstance().setInstanceTime(partyMember.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + INSTANCEPENALTY))); 
    571                                         teleportplayer(partyMember,teleto); 
    572                                         world.allowed.add(partyMember.getObjectId()); 
    573                                 } 
    574                         } 
    575                         return instanceId; 
    576                 } 
     570                        for (L2PcInstance partyMember : party.getPartyMembers()) 
     571                        { 
     572                                partyMember.sendMessage("Welcome to Crystal Caverns."); 
     573                                InstanceManager.getInstance().setInstanceTime(partyMember.getObjectId(), INSTANCEID, ((System.currentTimeMillis() + INSTANCEPENALTY))); 
     574                                teleportplayer(partyMember, teleto); 
     575                                world.allowed.add(partyMember.getObjectId()); 
     576                        } 
     577                } 
     578                return instanceId; 
    577579        } 
    578580         
     
    608610                world.status = 0; 
    609611                 
    610                 world.oracle.add(addSpawn(ORACLE_GUIDE_1, 143172, 148894, -11975, 0, false,0,false,world.instanceId)); 
     612                world.oracle.add(addSpawn(ORACLE_GUIDE_1, 143172, 148894, -11975, 0, false, 0, false, world.instanceId)); 
    611613        } 
    612614         
     
    632634                for (int[] spawn : SPAWNS) 
    633635                { 
    634                         L2Npc mob = addSpawn(CGMOBS[Rnd.get(CGMOBS.length)], spawn[0], spawn[1], spawn[2], spawn[3], false,0,false,world.instanceId); 
     636                        L2Npc mob = addSpawn(CGMOBS[Rnd.get(CGMOBS.length)], spawn[0], spawn[1], spawn[2], spawn[3], false, 0, false, world.instanceId); 
    635637                        world.npcList1.put(mob, false); 
    636638                } 
     
    641643                world.status = 2; 
    642644                 
    643                 world.keyKeepers.add(addSpawn(GK1, 148206, 149486, -12140, 32308, false,0,false,world.instanceId)); 
    644                 world.keyKeepers.add(addSpawn(GK2, 148203, 151093, -12140, 31100, false,0,false,world.instanceId)); 
     645                world.keyKeepers.add(addSpawn(GK1, 148206, 149486, -12140, 32308, false, 0, false, world.instanceId)); 
     646                world.keyKeepers.add(addSpawn(GK2, 148203, 151093, -12140, 31100, false, 0, false, world.instanceId)); 
    645647                 
    646648                for (int[] spawn : FIRST_SPAWNS) 
    647649                { 
    648                         addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false,0,false,world.instanceId); 
     650                        addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.instanceId); 
    649651                } 
    650652        } 
     
    654656                world.status = 3; 
    655657                 
    656                 Map<L2Npc,Boolean> spawnList = new FastMap<L2Npc, Boolean>(); 
     658                Map<L2Npc, Boolean> spawnList = new FastMap<L2Npc, Boolean>(); 
    657659                for (int[] spawn : EMERALD_SPAWNS) 
    658660                { 
    659                         L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false,0,false,world.instanceId); 
     661                        L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.instanceId); 
    660662                        spawnList.put(mob, false); 
    661663                } 
     
    665667        protected void runEmeraldRooms(CCWorld world, int[][] spawnList, int room) 
    666668        { 
    667                 Map<L2Npc,Boolean> spawned = new FastMap<L2Npc, Boolean>(); 
     669                Map<L2Npc, Boolean> spawned = new FastMap<L2Npc, Boolean>(); 
    668670                for (int[] spawn : spawnList) 
    669671                { 
    670                         L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false,0,false,world.instanceId); 
     672                        L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.instanceId); 
    671673                        spawned.put(mob, false); 
    672674                } 
    673675                if (room == 1) // spawn Lahm 
    674                         addSpawn(32359, 142110, 139896, -11888, 8033, false,0,false,world.instanceId); 
     676                        addSpawn(32359, 142110, 139896, -11888, 8033, false, 0, false, world.instanceId); 
    675677                world.npcList2.put(room, spawned); 
    676                 world.roomsStatus[room-1] = 1; 
     678                world.roomsStatus[room - 1] = 1; 
    677679        } 
    678680         
     
    681683                world.status = 9; 
    682684                 
    683                 addSpawn(DARNEL, 152759, 145949, -12588, 21592, false,0,false,world.instanceId); 
     685                addSpawn(DARNEL, 152759, 145949, -12588, 21592, false, 0, false, world.instanceId); 
    684686                // TODO: missing traps 
    685                 openDoor(24220005,world.instanceId); 
    686                 openDoor(24220006,world.instanceId); 
     687                openDoor(24220005, world.instanceId); 
     688                openDoor(24220006, world.instanceId); 
    687689        } 
    688690         
     
    691693                world.status = status; 
    692694                 
    693                 Map<L2Npc,Boolean> spawned = new FastMap<L2Npc, Boolean>(); 
     695                Map<L2Npc, Boolean> spawned = new FastMap<L2Npc, Boolean>(); 
    694696                for (int[] spawn : spawnList) 
    695697                { 
    696                         L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false,0,false,world.instanceId); 
     698                        L2Npc mob = addSpawn(spawn[0], spawn[1], spawn[2], spawn[3], spawn[4], false, 0, false, world.instanceId); 
    697699                        spawned.put(mob, false); 
    698700                } 
     
    703705        { 
    704706                world.oracles.clear(); 
    705                 for(int[] oracle : oracleOrder) 
    706                 { 
    707                         world.oracles.put(addSpawn(oracle[0], oracle[1], oracle[2], oracle[3], oracle[4], false,0,false,world.instanceId), null); 
     707                for (int[] oracle : oracleOrder) 
     708                { 
     709                        world.oracles.put(addSpawn(oracle[0], oracle[1], oracle[2], oracle[3], oracle[4], false, 0, false, world.instanceId), null); 
    708710                } 
    709711        } 
     
    713715                if (world.npcList2.get(room).containsKey(mob)) 
    714716                        world.npcList2.get(room).put(mob, true); 
    715                 for(boolean isDead: world.npcList2.get(room).values()) 
     717                for (boolean isDead : world.npcList2.get(room).values()) 
    716718                        if (!isDead) 
    717719                                return false; 
     
    719721        } 
    720722         
    721         /*      protected void runBaylorRoom(CCWorld world) 
    722         { 
    723                 world.status = 30; 
    724  
    725                 addSpawn(29101,152758,143479,-12706,52961,false,0,false,world.instanceId,0);//up power 
    726                 addSpawn(29101,151951,142078,-12706,65203,false,0,false,world.instanceId,0);//up power 
    727                 addSpawn(29101,154396,140667,-12706,22197,false,0,false,world.instanceId,0);//up power 
    728                 addSpawn(29102,152162,141249,-12706,5511,false,0,false,world.instanceId,0);//down power 
    729                 addSpawn(29102,153571,140458,-12706,16699,false,0,false,world.instanceId,0);//down power 
    730                 addSpawn(29102,154976,141265,-12706,26908,false,0,false,world.instanceId,0);//down power 
    731                 addSpawn(29102,155203,142071,-12706,31560,false,0,false,world.instanceId,0);//down power 
    732                 addSpawn(29102,154380,143468,-12708,43943,false,0,false,world.instanceId,0);//down power 
    733                 addSpawn(32271,153573,142069,-9722,11175,false,0,false,world.instanceId); 
    734                 world.Baylor = addSpawn(BAYLOR,153557,142089,-12735,11175,false,0,false,world.instanceId,0); 
    735  
    736         }*/ 
    737          
     723        /* 
     724         * protected void runBaylorRoom(CCWorld world) { world.status = 30; addSpawn(29101,152758,143479,-12706,52961,false,0,false,world.instanceId,0);//up power addSpawn(29101,151951,142078,-12706,65203,false,0,false,world.instanceId,0);//up power 
     725         * addSpawn(29101,154396,140667,-12706,22197,false,0,false,world.instanceId,0);//up power addSpawn(29102,152162,141249,-12706,5511,false,0,false,world.instanceId,0);//down power addSpawn(29102,153571,140458,-12706,16699,false,0,false,world.instanceId,0);//down power 
     726         * addSpawn(29102,154976,141265,-12706,26908,false,0,false,world.instanceId,0);//down power addSpawn(29102,155203,142071,-12706,31560,false,0,false,world.instanceId,0);//down power addSpawn(29102,154380,143468,-12708,43943,false,0,false,world.instanceId,0);//down power 
     727         * addSpawn(32271,153573,142069,-9722,11175,false,0,false,world.instanceId); world.Baylor = addSpawn(BAYLOR,153557,142089,-12735,11175,false,0,false,world.instanceId,0); } 
     728         */ 
    738729         
    739730        @Override 
     
    783774                        QuestState st = player.getQuestState("131_BirdInACage"); 
    784775                        String htmltext = "32279.htm"; 
    785                         if (st != null && st.getState() != State.COMPLETED) 
     776                        if (st != null && !st.isCompleted()) 
    786777                                htmltext = "32279-01.htm"; 
    787778                        return htmltext; 
     
    789780                else if (npc.getNpcId() == CRYSTAL_GOLEM) 
    790781                        player.sendPacket(ActionFailed.STATIC_PACKET); 
    791                 return""; 
     782                return ""; 
    792783        } 
    793784         
    794785        @Override 
    795         public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) 
     786        public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) 
    796787        { 
    797788                 
    798789                boolean doReturn = true; 
    799                 for(L2Object obj: targets) 
     790                for (L2Object obj : targets) 
    800791                        if (obj == npc) 
    801792                                doReturn = false; 
     
    803794                        return super.onSkillSee(npc, caster, skill, targets, isPet); 
    804795                 
    805                 switch(skill.getId()) 
     796                switch (skill.getId()) 
    806797                { 
    807798                        case 1011: 
     
    826817                        if (tmpworld instanceof CCWorld && Rnd.get(100) < 15) 
    827818                        { 
    828                                 for(L2Npc oracle : ((CCWorld) tmpworld).oracles.keySet()) 
     819                                for (L2Npc oracle : ((CCWorld) tmpworld).oracles.keySet()) 
    829820                                        if (oracle != npc) 
    830821                                                oracle.decayMe(); 
     
    888879         
    889880        @Override 
    890         public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, L2Skill skill) 
     881        public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet, L2Skill skill) 
    891882        { 
    892883                if (npc.getNpcId() == TEARS) 
     
    903894                                        tele.y = 172327; 
    904895                                        tele.z = -945; 
    905                                         exitInstance(attacker,tele); 
     896                                        exitInstance(attacker, tele); 
    906897                                        world.allowed.remove(world.allowed.indexOf(attacker.getObjectId())); 
    907898                                } 
     
    911902                                { 
    912903                                        boolean notAOE = true; 
    913                                         if (skill != null && (skill.getTargetType() == SkillTargetType.TARGET_AREA 
    914                                                         || skill.getTargetType() == SkillTargetType.TARGET_FRONT_AREA 
    915                                                         || skill.getTargetType() == SkillTargetType.TARGET_BEHIND_AREA 
    916                                                         || skill.getTargetType() == SkillTargetType.TARGET_AURA 
    917                                                         || skill.getTargetType() == SkillTargetType.TARGET_FRONT_AURA 
    918                                                         || skill.getTargetType() == SkillTargetType.TARGET_BEHIND_AURA)) 
     904                                        if (skill != null && (skill.getTargetType() == L2TargetType.TARGET_AREA || skill.getTargetType() == L2TargetType.TARGET_FRONT_AREA || skill.getTargetType() == L2TargetType.TARGET_BEHIND_AREA || skill.getTargetType() == L2TargetType.TARGET_AURA || skill.getTargetType() == L2TargetType.TARGET_FRONT_AURA || skill.getTargetType() == L2TargetType.TARGET_BEHIND_AURA)) 
    919905                                                notAOE = false; 
    920906                                        if (notAOE) 
     
    942928                                        for (int i = 0; i < 10; i++) 
    943929                                        { 
    944                                                 L2Npc copy = addSpawn(TEARS_COPY,npc.getX(),npc.getY(),npc.getZ(),0,false,0,false,attacker.getInstanceId()); 
     930                                                L2Npc copy = addSpawn(TEARS_COPY, npc.getX(), npc.getY(), npc.getZ(), 0, false, 0, false, attacker.getInstanceId()); 
    945931                                                copy.setRunning(); 
    946932                                                ((L2Attackable) copy).addDamageHate(target, 0, 99999); 
     
    976962         
    977963        @Override 
    978         public String onAdvEvent (String event, L2Npc npc, L2PcInstance player) 
     964        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) 
    979965        { 
    980966                InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId()); 
     
    990976                                tele.y = 173078; 
    991977                                tele.z = -5014; 
    992                                 exitInstance(player,tele); 
     978                                exitInstance(player, tele); 
    993979                        } 
    994980                        else if (event.equalsIgnoreCase("TeleportParme")) 
     
    999985                                tele.z = -9750; 
    1000986                                tele.instanceId = world.instanceId; 
    1001                                 teleportplayer(player,tele); 
    1002                         } 
    1003                         else if (event.equalsIgnoreCase("Timer2")||event.equalsIgnoreCase("Timer3")||event.equalsIgnoreCase("Timer4")||event.equalsIgnoreCase("Timer5")) 
     987                                teleportplayer(player, tele); 
     988                        } 
     989                        else if (event.equalsIgnoreCase("Timer2") || event.equalsIgnoreCase("Timer3") || event.equalsIgnoreCase("Timer4") || event.equalsIgnoreCase("Timer5")) 
    1004990                        { 
    1005991                                teleto.x = 144653; 
     
    1008994                                if (player.getInstanceId() == world.instanceId) 
    1009995                                { 
    1010                                         teleportplayer(player,teleto); 
     996                                        teleportplayer(player, teleto); 
    1011997                                        player.stopSkillEffects(5239); 
    1012998                                        SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player); 
    1013                                         startQuestTimer("Timer2",300000,npc,player); 
    1014                                 } 
    1015                         } 
    1016                         else if (event.equalsIgnoreCase("Timer21")||event.equalsIgnoreCase("Timer31")||event.equalsIgnoreCase("Timer41")||event.equalsIgnoreCase("Timer51")) 
     999                                        startQuestTimer("Timer2", 300000, npc, player); 
     1000                                } 
     1001                        } 
     1002                        else if (event.equalsIgnoreCase("Timer21") || event.equalsIgnoreCase("Timer31") || event.equalsIgnoreCase("Timer41") || event.equalsIgnoreCase("Timer51")) 
    10171003                        { 
    10181004                                InstanceManager.getInstance().getInstance(world.instanceId).removeNpcs(); 
    10191005                                world.npcList2.clear(); 
    10201006                                runSteamRooms(world, STEAM1_SPAWNS, 22); 
    1021                                 startQuestTimer("Timer21",300000,npc,null); 
     1007                                startQuestTimer("Timer21", 300000, npc, null); 
    10221008                        } 
    10231009                         
     
    10281014                                        startQuestTimer("spawnGuards", SPAWN[0], npc, null); 
    10291015                                        cancelQuestTimers("checkKechiAttack"); 
    1030                                         closeDoor(DOOR4,npc.getInstanceId()); 
    1031                                         closeDoor(DOOR3,npc.getInstanceId()); 
     1016                                        closeDoor(DOOR4, npc.getInstanceId()); 
     1017                                        closeDoor(DOOR3, npc.getInstanceId()); 
    10321018                                } 
    10331019                                else 
     
    10371023                        { 
    10381024                                world.kechisHenchmanSpawn++; 
    1039                                 world.guards.add(addSpawn(KECHIGUARD,153622,149699,-12131,56890,false,0,false,world.instanceId)); 
    1040                                 world.guards.add(addSpawn(KECHIGUARD,153609,149622,-12131,64023,false,0,false,world.instanceId)); 
    1041                                 world.guards.add(addSpawn(KECHIGUARD,153606,149428,-12131,64541,false,0,false,world.instanceId)); 
    1042                                 world.guards.add(addSpawn(KECHIGUARD,153601,149534,-12131,64901,false,0,false,world.instanceId)); 
    1043                                 world.guards.add(addSpawn(KECHIGUARD,153620,149354,-12131,1164,false,0,false,world.instanceId)); 
    1044                                 world.guards.add(addSpawn(KECHIGUARD,153637,149776,-12131,61733,false,0,false,world.instanceId)); 
    1045                                 world.guards.add(addSpawn(KECHIGUARD,153638,149292,-12131,64071,false,0,false,world.instanceId)); 
    1046                                 world.guards.add(addSpawn(KECHIGUARD,153647,149857,-12131,59402,false,0,false,world.instanceId)); 
    1047                                 world.guards.add(addSpawn(KECHIGUARD,153661,149227,-12131,65275,false,0,false,world.instanceId)); 
     1025                                world.guards.add(addSpawn(KECHIGUARD, 153622, 149699, -12131, 56890, false, 0, false, world.instanceId)); 
     1026                                world.guards.add(addSpawn(KECHIGUARD, 153609, 149622, -12131, 64023, false, 0, false, world.instanceId)); 
     1027                                world.guards.add(addSpawn(KECHIGUARD, 153606, 149428, -12131, 64541, false, 0, false, world.instanceId)); 
     1028                                world.guards.add(addSpawn(KECHIGUARD, 153601, 149534, -12131, 64901, false, 0, false, world.instanceId)); 
     1029                                world.guards.add(addSpawn(KECHIGUARD, 153620, 149354, -12131, 1164, false, 0, false, world.instanceId)); 
     1030                                world.guards.add(addSpawn(KECHIGUARD, 153637, 149776, -12131, 61733, false, 0, false, world.instanceId)); 
     1031                                world.guards.add(addSpawn(KECHIGUARD, 153638, 149292, -12131, 64071, false, 0, false, world.instanceId)); 
     1032                                world.guards.add(addSpawn(KECHIGUARD, 153647, 149857, -12131, 59402, false, 0, false, world.instanceId)); 
     1033                                world.guards.add(addSpawn(KECHIGUARD, 153661, 149227, -12131, 65275, false, 0, false, world.instanceId)); 
    10481034                                if (world.kechisHenchmanSpawn <= 5) 
    10491035                                        startQuestTimer("spawnGuards", SPAWN[world.kechisHenchmanSpawn], npc, null); 
     
    10541040                        { 
    10551041                                runEmerald(world); 
    1056                                 for(L2Npc oracle: world.oracle) 
     1042                                for (L2Npc oracle : world.oracle) 
    10571043                                        oracle.decayMe(); 
    10581044                        } 
     
    10601046                        { 
    10611047                                runCoral(world); 
    1062                                 for(L2Npc oracle: world.oracle) 
     1048                                for (L2Npc oracle : world.oracle) 
    10631049                                        oracle.decayMe(); 
    10641050                        } 
    10651051                        else if (event.equalsIgnoreCase("spawn_oracle")) 
    10661052                        { 
    1067                                 addSpawn(32271,153572,142075,-9728,10800,false,0,false,world.instanceId); 
    1068                                 addSpawn((Rnd.get(10) < 5 ? 29116:29117),npc.getX(),npc.getY(),npc.getZ(),npc.getHeading(),false,0,false,world.instanceId); // Baylor's Chest 
    1069                                 addSpawn(ORACLE_GUIDE_4,153572,142075,-12738,10800,false,0,false,world.instanceId); 
     1053                                addSpawn(32271, 153572, 142075, -9728, 10800, false, 0, false, world.instanceId); 
     1054                                addSpawn((Rnd.get(10) < 5 ? 29116 : 29117), npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, false, world.instanceId); // Baylor's Chest 
     1055                                addSpawn(ORACLE_GUIDE_4, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId); 
    10701056                                this.cancelQuestTimer("baylor_despawn", npc, null); 
    10711057                                this.cancelQuestTimers("baylor_skill"); 
     
    10741060                        { 
    10751061                                npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); 
    1076                                 npc.broadcastPacket(new SocialAction(npc,1)); 
    1077                                 startQuestTimer("baylorCamera0",11000, npc, null); 
    1078                                 startQuestTimer("baylorEffect1",19000, npc, null); 
     1062                                npc.broadcastSocialAction(1); 
     1063                                startQuestTimer("baylorCamera0", 11000, npc, null); 
     1064                                startQuestTimer("baylorEffect1", 19000, npc, null); 
    10791065                        } 
    10801066                        else if (event.equalsIgnoreCase("baylorCamera0")) 
    10811067                        { 
    1082                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),500,-45,170,5000,9000,0,0,1,0)); 
     1068                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 500, -45, 170, 5000, 9000, 0, 0, 1, 0)); 
    10831069                        } 
    10841070                        else if (event.equalsIgnoreCase("baylorEffect1")) 
    10851071                        { 
    1086                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),300,0,120,2000,5000,0,0,1,0)); 
    1087                                 npc.broadcastPacket(new SocialAction(npc,3)); 
    1088                                 startQuestTimer("baylorEffect2",4000, npc, null); 
     1072                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300, 0, 120, 2000, 5000, 0, 0, 1, 0)); 
     1073                                npc.broadcastSocialAction(3); 
     1074                                startQuestTimer("baylorEffect2", 4000, npc, null); 
    10891075                        } 
    10901076                        else if (event.equalsIgnoreCase("baylorEffect2")) 
    10911077                        { 
    1092                                 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(),747,0,160,2000,3000,0,0,1,0)); 
     1078                                npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 747, 0, 160, 2000, 3000, 0, 0, 1, 0)); 
    10931079                                npc.broadcastPacket(new MagicSkillUse(npc, npc, 5402, 1, 2000, 0)); 
    1094                                 startQuestTimer("RaidStart",2000, npc, null); 
     1080                                startQuestTimer("RaidStart", 2000, npc, null); 
    10951081                        } 
    10961082                        else if (event.equalsIgnoreCase("BaylorMinions")) 
    10971083                        { 
    1098                                 for(int i = 0; i < 10; i++) 
     1084                                for (int i = 0; i < 10; i++) 
    10991085                                { 
    11001086                                        int radius = 300; 
    11011087                                        int x = (int) (radius * Math.cos(i * 0.618)); 
    11021088                                        int y = (int) (radius * Math.sin(i * 0.618)); 
    1103                                         L2Npc mob = addSpawn(29104,153571 + x,142075 + y, -12737,0,false, 0, false, world.instanceId); 
     1089                                        L2Npc mob = addSpawn(29104, 153571 + x, 142075 + y, -12737, 0, false, 0, false, world.instanceId); 
    11041090                                        mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); 
    11051091                                        world._animationMobs.add(mob); 
    11061092                                } 
    1107                                 startQuestTimer("baylorEffect0",200, npc, null); 
     1093                                startQuestTimer("baylorEffect0", 200, npc, null); 
    11081094                        } 
    11091095                        else if (event.equalsIgnoreCase("RaidStart")) 
     
    11121098                                world._camera = null; 
    11131099                                npc.setIsParalyzed(false); 
    1114                                 for(L2PcInstance p : world._raiders) 
     1100                                for (L2PcInstance p : world._raiders) 
    11151101                                { 
    11161102                                        p.setIsParalyzed(false); 
     
    11201106                                } 
    11211107                                world._raidStatus = 0; 
    1122                                 for(L2Npc mob : world._animationMobs) 
     1108                                for (L2Npc mob : world._animationMobs) 
    11231109                                { 
    11241110                                        mob.doDie(mob); 
    11251111                                } 
    11261112                                world._animationMobs.clear(); 
    1127                                 startQuestTimer("baylor_despawn",60000, npc, null, true); 
     1113                                startQuestTimer("baylor_despawn", 60000, npc, null, true); 
    11281114                                startQuestTimer("checkBaylorAttack", 1000, npc, null); 
    11291115                        } 
     
    11331119                                { 
    11341120                                        cancelQuestTimers("checkBaylorAttack"); 
    1135                                         startQuestTimer("baylor_alarm",40000, npc, null); 
    1136                                         startQuestTimer("baylor_skill",5000, npc, null, true); 
     1121                                        startQuestTimer("baylor_alarm", 40000, npc, null); 
     1122                                        startQuestTimer("baylor_skill", 5000, npc, null, true); 
    11371123                                        world._raidStatus++; 
    11381124                                } 
     
    11471133                                        npc.addSkill(SkillTable.getInstance().getInfo(5244, 1)); 
    11481134                                        npc.addSkill(SkillTable.getInstance().getInfo(5245, 1)); 
    1149                                         world._alarm = addSpawn(ALARMID,spawnLoc[0],spawnLoc[1],spawnLoc[2],10800,false,0,false,world.instanceId); 
     1135                                        world._alarm = addSpawn(ALARMID, spawnLoc[0], spawnLoc[1], spawnLoc[2], 10800, false, 0, false, world.instanceId); 
    11501136                                        world._alarm.disableCoreAI(true); 
    11511137                                        world._alarm.setIsImmobilized(true); 
    1152                                         world._alarm.broadcastPacket(new CreatureSay(world._alarm.getObjectId(),1,world._alarm.getName(),NpcStringId.AN_ALARM_HAS_BEEN_SET_OFF_EVERYBODY_WILL_BE_IN_DANGER_IF_THEY_ARE_NOT_TAKEN_CARE_OF_IMMEDIATELY)); 
     1138                                        world._alarm.broadcastPacket(new CreatureSay(world._alarm.getObjectId(), 1, world._alarm.getName(), NpcStringId.AN_ALARM_HAS_BEEN_SET_OFF_EVERYBODY_WILL_BE_IN_DANGER_IF_THEY_ARE_NOT_TAKEN_CARE_OF_IMMEDIATELY)); 
    11531139                                } 
    11541140                        } 
     
    11701156                                                { 
    11711157                                                        npc.doCast(SkillTable.getInstance().getInfo(5225, 1)); 
    1172                                                         npc.broadcastPacket(new CreatureSay(npc.getObjectId(),1,npc.getName(),NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH)); 
     1158                                                        npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH)); 
    11731159                                                } 
    11741160                                                else if (rand < 10 || nowHp < maxHp * 0.15) 
    11751161                                                { 
    11761162                                                        npc.doCast(SkillTable.getInstance().getInfo(5225, 1)); 
    1177                                                         npc.broadcastPacket(new CreatureSay(npc.getObjectId(),1,npc.getName(),NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH)); 
    1178                                                         startQuestTimer("baylor_remove_invul",30000, world._baylor, null); 
     1163                                                        npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.DEMON_KING_BELETH_GIVE_ME_THE_POWER_AAAHH)); 
     1164                                                        startQuestTimer("baylor_remove_invul", 30000, world._baylor, null); 
    11791165                                                } 
    11801166                                        } 
     
    11961182                        else if (event.equalsIgnoreCase("Baylor")) 
    11971183                        { 
    1198                                 world._baylor = addSpawn(29099,153572,142075,-12738,10800,false,0,false,world.instanceId); 
     1184                                world._baylor = addSpawn(29099, 153572, 142075, -12738, 10800, false, 0, false, world.instanceId); 
    11991185                                world._baylor.setIsParalyzed(true); 
    1200                                 world._camera = addSpawn(29120,153273,141400,-12738,10800,false,0,false,world.instanceId); 
    1201                                 world._camera.broadcastPacket(new SpecialCamera(world._camera.getObjectId(),700,-45,160,500,15200,0,0,1,0)); 
    1202                                 startQuestTimer("baylorMinions",2000, world._baylor, null); 
     1186                                world._camera = addSpawn(29120, 153273, 141400, -12738, 10800, false, 0, false, world.instanceId); 
     1187                                world._camera.broadcastPacket(new SpecialCamera(world._camera.getObjectId(), 700, -45, 160, 500, 15200, 0, 0, 1, 0)); 
     1188                                startQuestTimer("baylorMinions", 2000, world._baylor, null); 
    12031189                        } 
    12041190                        else if (!event.endsWith("Food")) 
     
    12081194                                if (!world.crystalGolems.containsKey(npc)) 
    12091195                                        world.crystalGolems.put(npc, new CrystalGolem()); 
    1210                                 if (world.status != 3  || !world.crystalGolems.containsKey(npc) 
    1211                                                 || world.crystalGolems.get(npc).foodItem != null || world.crystalGolems.get(npc).isAtDestination) 
     1196                                if (world.status != 3 || !world.crystalGolems.containsKey(npc) || world.crystalGolems.get(npc).foodItem != null || world.crystalGolems.get(npc).isAtDestination) 
    12121197                                        return ""; 
    12131198                                CrystalGolem cryGolem = world.crystalGolems.get(npc); 
     
    12151200                                for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300)) 
    12161201                                { 
    1217                                         if (object instanceof L2ItemInstance && ((L2ItemInstance)object).getItemId()== CRYSTALFOOD) 
     1202                                        if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId() == CRYSTALFOOD) 
    12181203                                                crystals.add(object); 
    12191204                                } 
     
    12271212                                        { 
    12281213                                                minDist = d; 
    1229                                                 cryGolem.foodItem = (L2ItemInstance)crystal; 
     1214                                                cryGolem.foodItem = (L2ItemInstance) crystal; 
    12301215                                        } 
    12311216                                } 
    12321217                                if (minDist != 300000) 
    1233                                         startQuestTimer("getFood",2000,npc,null); 
     1218                                        startQuestTimer("getFood", 2000, npc, null); 
    12341219                                else 
    12351220                                { 
    12361221                                        if (Rnd.get(100) < 5) 
    1237                                                 npc.broadcastPacket(new CreatureSay(npc.getObjectId(),1,npc.getName(),NpcStringId.AH_IM_HUNGRY)); 
    1238                                         startQuestTimer("autoFood",2000,npc,null); 
     1222                                                npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 1, npc.getName(), NpcStringId.AH_IM_HUNGRY)); 
     1223                                        startQuestTimer("autoFood", 2000, npc, null); 
    12391224                                } 
    12401225                                return ""; 
     
    12491234                                        npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null); 
    12501235                                        world.crystalGolems.get(npc).foodItem = null; 
    1251                                         startQuestTimer("autoFood",2000,npc,null); 
     1236                                        startQuestTimer("autoFood", 2000, npc, null); 
    12521237                                } 
    12531238                        } 
     
    12831268                                                if (world.correctGolems >= 2) 
    12841269                                                { 
    1285                                                         openDoor(24220026,world.instanceId); 
     1270                                                        openDoor(24220026, world.instanceId); 
    12861271                                                        world.status = 4; 
    12871272                                                } 
    12881273                                        } 
    12891274                                        else 
    1290                                                 startQuestTimer("autoFood",2000,npc,null); 
     1275                                                startQuestTimer("autoFood", 2000, npc, null); 
    12911276                                        cancelQuestTimers("reachFood"); 
    12921277                                } 
     
    13081293        private void giveRewards(L2PcInstance player, int instanceId, int bossCry, boolean isBaylor) 
    13091294        { 
    1310                 final int num = Math.max((int)Config.RATE_DROP_ITEMS_BY_RAID, 1); 
     1295                final int num = Math.max((int) Config.RATE_DROP_ITEMS_BY_RAID, 1); 
    13111296                 
    13121297                L2Party party = player.getParty(); 
     
    13191304                                        if (st == null) 
    13201305                                                st = newQuestState(partyMember); 
    1321                                         if (!isBaylor && st.getQuestItemsCount(CONT_CRYSTAL) > 0) 
     1306                                        if (!isBaylor && st.hasQuestItems(CONT_CRYSTAL)) 
    13221307                                        { 
    13231308                                                st.takeItems(CONT_CRYSTAL, 1); 
     
    13351320                        if (st == null) 
    13361321                                st = newQuestState(player); 
    1337                         if (!isBaylor && st.getQuestItemsCount(CONT_CRYSTAL) > 0) 
     1322                        if (!isBaylor && st.hasQuestItems(CONT_CRYSTAL)) 
    13381323                        { 
    13391324                                st.takeItems(CONT_CRYSTAL, 1); 
     
    13491334         
    13501335        @Override 
    1351         public String onKill( L2Npc npc, L2PcInstance player, boolean isPet) 
     1336        public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) 
    13521337        { 
    13531338                InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId()); 
     
    13621347                                                return ""; 
    13631348                                world.status = 3; 
    1364                                 world.tears = addSpawn(TEARS,144298,154420,-11854,32767,false,0,false,world.instanceId); // Tears 
     1349                                world.tears = addSpawn(TEARS, 144298, 154420, -11854, 32767, false, 0, false, world.instanceId); // Tears 
    13651350                                CrystalGolem crygolem1 = new CrystalGolem(); 
    13661351                                CrystalGolem crygolem2 = new CrystalGolem(); 
    1367                                 world.crystalGolems.put(addSpawn(CRYSTAL_GOLEM,140547,151670,-11813,32767,false,0,false,world.instanceId),crygolem1); 
    1368                                 world.crystalGolems.put(addSpawn(CRYSTAL_GOLEM,141941,151684,-11813,63371,false,0,false,world.instanceId),crygolem2); 
     1352                                world.crystalGolems.put(addSpawn(CRYSTAL_GOLEM, 140547, 151670, -11813, 32767, false, 0, false, world.instanceId), crygolem1); 
     1353                                world.crystalGolems.put(addSpawn(CRYSTAL_GOLEM, 141941, 151684, -11813, 63371, false, 0, false, world.instanceId), crygolem2); 
    13691354                                for (L2Npc crygolem : world.crystalGolems.keySet()) 
    1370                                         startQuestTimer("autoFood",2000,crygolem,null); 
     1355                                        startQuestTimer("autoFood", 2000, crygolem, null); 
    13711356                        } 
    13721357                        else if (world.status == 4 && npc.getNpcId() == TEARS) 
    13731358                        { 
    13741359                                InstanceManager.getInstance().getInstance(world.instanceId).setDuration(300000); 
    1375                                 addSpawn(32280,144312,154420,-11855,0,false,0,false,world.instanceId); 
     1360                                addSpawn(32280, 144312, 154420, -11855, 0, false, 0, false, world.instanceId); 
    13761361                                giveRewards(player, npc.getInstanceId(), BOSS_CRYSTAL_3, false); 
    13771362                        } 
     
    13801365                                if (npc.getNpcId() == GK1) 
    13811366                                { 
    1382                                         ((L2MonsterInstance)npc).dropItem(player, 9698, 1); 
     1367                                        ((L2MonsterInstance) npc).dropItem(player, 9698, 1); 
    13831368                                        runEmeraldSquare(world); 
    13841369                                } 
    13851370                                else if (npc.getNpcId() == GK2) 
    13861371                                { 
    1387                                         ((L2MonsterInstance)npc).dropItem(player, 9699, 1); 
     1372                                        ((L2MonsterInstance) npc).dropItem(player, 9699, 1); 
    13881373                                        runSteamRooms(world, STEAM1_SPAWNS, 22); 
    13891374                                        L2Party party = player.getParty(); 
    13901375                                        if (party != null) 
    1391                                                 for(L2PcInstance partyMember : party.getPartyMembers()) 
     1376                                                for (L2PcInstance partyMember : party.getPartyMembers()) 
    13921377                                                { 
    13931378                                                        if (partyMember.getInstanceId() == world.instanceId) 
    13941379                                                        { 
    13951380                                                                SkillTable.getInstance().getInfo(5239, 1).getEffects(partyMember, partyMember); 
    1396                                                                 startQuestTimer("Timer2",300000,npc,partyMember); 
     1381                                                                startQuestTimer("Timer2", 300000, npc, partyMember); 
    13971382                                                        } 
    13981383                                                } 
     
    14001385                                        { 
    14011386                                                SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player); 
    1402                                                 startQuestTimer("Timer2",300000,npc,player); 
     1387                                                startQuestTimer("Timer2", 300000, npc, player); 
    14031388                                        } 
    1404                                         startQuestTimer("Timer21",300000,npc,null); 
     1389                                        startQuestTimer("Timer21", 300000, npc, null); 
    14051390                                } 
    14061391                                for (L2Npc gk : world.keyKeepers) 
     
    14101395                        else if (world.status == 3) 
    14111396                        { 
    1412                                 if (checkKillProgress(0,npc,world)) 
     1397                                if (checkKillProgress(0, npc, world)) 
    14131398                                { 
    14141399                                        world.status = 4; 
    1415                                         addSpawn(TOURMALINE, 148202, 144791, -12235, 0, false,0,false,world.instanceId); 
     1400                                        addSpawn(TOURMALINE, 148202, 144791, -12235, 0, false, 0, false, world.instanceId); 
    14161401                                } 
    14171402                                else 
     
    14231408                                { 
    14241409                                        world.status = 5; 
    1425                                         addSpawn(TEROD, 147777, 146780, -12281, 0, false,0,false,world.instanceId); 
     1410                                        addSpawn(TEROD, 147777, 146780, -12281, 0, false, 0, false, world.instanceId); 
    14261411                                } 
    14271412                        } 
     
    14311416                                { 
    14321417                                        world.status = 6; 
    1433                                         addSpawn(TOURMALINE, 143694, 142659, -11882, 0, false,0,false,world.instanceId); 
     1418                                        addSpawn(TOURMALINE, 143694, 142659, -11882, 0, false, 0, false, world.instanceId); 
    14341419                                } 
    14351420                        } 
     
    14391424                                { 
    14401425                                        world.status = 7; 
    1441                                         addSpawn(DOLPH, 142054,143288, -11825, 0, false,0,false,world.instanceId); 
     1426                                        addSpawn(DOLPH, 142054, 143288, -11825, 0, false, 0, false, world.instanceId); 
    14421427                                } 
    14431428                        } 
     
    14531438                        else if (world.status == 8) 
    14541439                        { 
    1455                                 for(int i = 0; i < 4;i++) 
    1456                                 { 
    1457                                         if (world.roomsStatus[i] == 1 && checkKillProgress(i+1, npc, world)) 
     1440                                for (int i = 0; i < 4; i++) 
     1441                                { 
     1442                                        if (world.roomsStatus[i] == 1 && checkKillProgress(i + 1, npc, world)) 
    14581443                                        { 
    14591444                                                world.roomsStatus[i] = 2; 
     
    14711456                                if (npc.getNpcId() == 22416) 
    14721457                                { 
    1473                                         for(L2Npc oracle:world.oracles.keySet()) 
     1458                                        for (L2Npc oracle : world.oracles.keySet()) 
    14741459                                                if (world.oracles.get(oracle) == npc) 
    14751460                                                        world.oracles.put(oracle, null); 
     
    14791464                                        world.npcList2.clear(); 
    14801465                                        int[][] oracleOrder; 
    1481                                         switch(world.status) 
     1466                                        switch (world.status) 
    14821467                                        { 
    14831468                                                case 22: 
    1484                                                         closeDoor(DOOR6,npc.getInstanceId()); 
     1469                                                        closeDoor(DOOR6, npc.getInstanceId()); 
    14851470                                                        oracleOrder = ordreOracle1; 
    14861471                                                        break; 
     
    14951480                                                        L2Party party = player.getParty(); 
    14961481                                                        if (party != null) 
    1497                                                                 for(L2PcInstance partyMember : party.getPartyMembers()) 
     1482                                                                for (L2PcInstance partyMember : party.getPartyMembers()) 
    14981483                                                                        partyMember.stopSkillEffects(5239); 
    14991484                                                        cancelQuestTimers("Timer5"); 
    15001485                                                        cancelQuestTimers("Timer51"); 
    1501                                                         openDoor(DOOR3,npc.getInstanceId()); 
    1502                                                         openDoor(DOOR4,npc.getInstanceId()); 
    1503                                                         L2Npc kechi = addSpawn(KECHI, 154069, 149525, -12158, 51165, false,0,false,world.instanceId); 
     1486                                                        openDoor(DOOR3, npc.getInstanceId()); 
     1487                                                        openDoor(DOOR4, npc.getInstanceId()); 
     1488                                                        L2Npc kechi = addSpawn(KECHI, 154069, 149525, -12158, 51165, false, 0, false, world.instanceId); 
    15041489                                                        startQuestTimer("checkKechiAttack", 1000, kechi, null); 
    15051490                                                        return ""; 
     
    15191504                                        bossCry = BOSS_CRYSTAL_2; 
    15201505                                        cancelQuestTimers("spawnGuards"); 
    1521                                         addSpawn(32280,154077,149527,-12159,0,false,0,false,world.instanceId); 
     1506                                        addSpawn(32280, 154077, 149527, -12159, 0, false, 0, false, world.instanceId); 
    15221507                                } 
    15231508                                else if (npc.getNpcId() == DARNEL) 
    15241509                                { 
    15251510                                        bossCry = BOSS_CRYSTAL_1; 
    1526                                         addSpawn(32280,152761,145950,-12588,0,false,0,false,world.instanceId); 
     1511                                        addSpawn(32280, 152761, 145950, -12588, 0, false, 0, false, world.instanceId); 
    15271512                                } 
    15281513                                else 
     
    15391524                                world._alarm = null; 
    15401525                                if (world._baylor.getMaxHp() * 0.3 < world._baylor.getStatus().getCurrentHp()) 
    1541                                         startQuestTimer("baylor_alarm",40000, world._baylor, null); 
     1526                                        startQuestTimer("baylor_alarm", 40000, world._baylor, null); 
    15421527                        } 
    15431528                        else if (npc.getNpcId() == BAYLOR) 
     
    15561541         
    15571542        @Override 
    1558         public String onTalk (L2Npc npc, L2PcInstance player) 
     1543        public String onTalk(L2Npc npc, L2PcInstance player) 
    15591544        { 
    15601545                int npcId = npc.getNpcId(); 
     
    15851570                                L2Party party = player.getParty(); 
    15861571                                doTeleport = true; 
    1587                                 switch(npc.getNpcId()) 
     1572                                switch (npc.getNpcId()) 
    15881573                                { 
    15891574                                        case 32275: 
     
    15961581                                                cancelQuestTimers("Timer21"); 
    15971582                                                if (party != null) 
    1598                                                         for(L2PcInstance partyMember : party.getPartyMembers()) 
     1583                                                        for (L2PcInstance partyMember : party.getPartyMembers()) 
    15991584                                                        { 
    16001585                                                                if (partyMember.getInstanceId() == world.instanceId) 
     
    16021587                                                                        partyMember.stopSkillEffects(5239); 
    16031588                                                                        SkillTable.getInstance().getInfo(5239, 2).getEffects(partyMember, partyMember); 
    1604                                                                         startQuestTimer("Timer3",600000,npc,partyMember); 
     1589                                                                        startQuestTimer("Timer3", 600000, npc, partyMember); 
    16051590                                                                } 
    16061591                                                        } 
     
    16091594                                                        player.stopSkillEffects(5239); 
    16101595                                                        SkillTable.getInstance().getInfo(5239, 2).getEffects(player, player); 
    1611                                                         startQuestTimer("Timer3",600000,npc,player); 
     1596                                                        startQuestTimer("Timer3", 600000, npc, player); 
    16121597                                                } 
    1613                                                 startQuestTimer("Timer31",600000,npc,null); 
     1598                                                startQuestTimer("Timer31", 600000, npc, null); 
    16141599                                                break; 
    16151600                                        case 32276: 
     
    16221607                                                cancelQuestTimers("Timer31"); 
    16231608                                                if (party != null) 
    1624                                                         for(L2PcInstance partyMember : party.getPartyMembers()) 
     1609                                                        for (L2PcInstance partyMember : party.getPartyMembers()) 
    16251610                                                        { 
    16261611                                                                if (partyMember.getInstanceId() == world.instanceId) 
     
    16281613                                                                        partyMember.stopSkillEffects(5239); 
    16291614                                                                        SkillTable.getInstance().getInfo(5239, 4).getEffects(partyMember, partyMember); 
    1630                                                                         startQuestTimer("Timer4",1200000,npc,partyMember); 
     1615                                                                        startQuestTimer("Timer4", 1200000, npc, partyMember); 
    16311616                                                                } 
    16321617                                                        } 
     
    16351620                                                        player.stopSkillEffects(5239); 
    16361621                                                        SkillTable.getInstance().getInfo(5239, 4).getEffects(player, player); 
    1637                                                         startQuestTimer("Timer4",1200000,npc,player); 
     1622                                                        startQuestTimer("Timer4", 1200000, npc, player); 
    16381623                                                } 
    1639                                                 startQuestTimer("Timer41",1200000,npc,null); 
     1624                                                startQuestTimer("Timer41", 1200000, npc, null); 
    16401625                                                break; 
    16411626                                        case 32277: 
     
    16481633                                                cancelQuestTimers("Timer41"); 
    16491634                                                if (party != null) 
    1650                                                         for(L2PcInstance partyMember : party.getPartyMembers()) 
     1635                                                        for (L2PcInstance partyMember : party.getPartyMembers()) 
    16511636                                                        { 
    16521637                                                                if (partyMember.getInstanceId() == world.instanceId) 
     
    16541639                                                                        partyMember.stopSkillEffects(5239); 
    16551640                                                                        SkillTable.getInstance().getInfo(5239, 3).getEffects(partyMember, partyMember); 
    1656                                                                         startQuestTimer("Timer5",900000,npc,partyMember); 
     1641                                                                        startQuestTimer("Timer5", 900000, npc, partyMember); 
    16571642                                                                } 
    16581643                                                        } 
     
    16611646                                                        player.stopSkillEffects(5239); 
    16621647                                                        SkillTable.getInstance().getInfo(5239, 3).getEffects(player, player); 
    1663                                                         startQuestTimer("Timer5",900000,npc,player); 
     1648                                                        startQuestTimer("Timer5", 900000, npc, player); 
    16641649                                                } 
    1665                                                 startQuestTimer("Timer51",900000,npc,null); 
     1650                                                startQuestTimer("Timer51", 900000, npc, null); 
    16661651                                                break; 
    16671652                                        default: 
     
    16741659                                                return ""; 
    16751660                                        else if (player.getParty() != null) 
    1676                                                 for(L2PcInstance partyMember : party.getPartyMembers()) 
     1661                                                for (L2PcInstance partyMember : party.getPartyMembers()) 
    16771662                                                { 
    16781663                                                        partyMember.destroyItemByItemId("Quest", RED_CORAL, 1, player, true); 
    1679                                                         teleportplayer(partyMember,teleto); 
     1664                                                        teleportplayer(partyMember, teleto); 
    16801665                                                } 
    16811666                                        else 
    16821667                                        { 
    1683                                                 teleportplayer(player,teleto); 
     1668                                                teleportplayer(player, teleto); 
    16841669                                        } 
    16851670                                } 
     
    16971682                                                for (L2PcInstance partyMember : party.getPartyMembers()) 
    16981683                                                { 
    1699                                                         //int rnd = Rnd.get(100); 
    1700                                                         //partyMember.destroyItemByItemId("Quest", (rnd < 33 ? BOSS_CRYSTAL_1:(rnd < 67 ? BOSS_CRYSTAL_2:BOSS_CRYSTAL_3)), 1, partyMember, true); Crystals are no longer beign cunsumed while entering to Baylor Lair. 
     1684                                                        // int rnd = Rnd.get(100); 
     1685                                                        // partyMember.destroyItemByItemId("Quest", (rnd < 33 ? BOSS_CRYSTAL_1:(rnd < 67 ? BOSS_CRYSTAL_2:BOSS_CRYSTAL_3)), 1, partyMember, true); Crystals are no longer beign cunsumed while entering to Baylor Lair. 
    17011686                                                        world._raiders.add(partyMember); 
    17021687                                                } 
     
    17131698                                int i = 0; 
    17141699                                int members = world._raiders.size(); 
    1715                                 for(L2PcInstance p : world._raiders) 
     1700                                for (L2PcInstance p : world._raiders) 
    17161701                                { 
    17171702                                        int x = (int) (radius * Math.cos(i * 2 * Math.PI / members)); 
     
    17361721                                teleto.y = 144212; 
    17371722                                teleto.z = -9747; 
    1738                                 teleportplayer(player,teleto); 
     1723                                teleportplayer(player, teleto); 
    17391724                        } 
    17401725                } 
     
    17491734                { 
    17501735                        CCWorld world = (CCWorld) tmpworld; 
    1751                         switch(action) 
     1736                        switch (action) 
    17521737                        { 
    17531738                                case TRAP_DISARMED: 
     
    17761761                                        int room; 
    17771762                                        int[][] spawns; 
    1778                                         switch(zone.getId()) 
     1763                                        switch (zone.getId()) 
    17791764                                        { 
    17801765                                                case 20105: 
     
    17911776                                                        break; 
    17921777                                                default: 
    1793                                                         return super.onEnterZone(character,zone); 
     1778                                                        return super.onEnterZone(character, zone); 
    17941779                                        } 
    17951780                                        for (L2DoorInstance door : InstanceManager.getInstance().getInstance(world.instanceId).getDoors()) 
     
    17971782                                                { 
    17981783                                                        if (door.getOpen()) 
     1784                                                        { 
    17991785                                                                return ""; 
    1800                                                         else 
    1801                                                         { 
    1802                                                                 QuestState st = ((L2PcInstance)character).getQuestState(qn); 
    1803                                                                 if (st == null) 
    1804                                                                         st = newQuestState((L2PcInstance)character); 
    1805                                                                 if (st.getQuestItemsCount(RACE_KEY) == 0) 
    1806                                                                         return ""; 
    1807                                                                 if (world.roomsStatus[zone.getId() - 20104] == 0) 
    1808                                                                         runEmeraldRooms(world, spawns, room); 
    1809                                                                 door.openMe(); 
    1810                                                                 st.takeItems(RACE_KEY, 1); 
    1811                                                                 world.openedDoors.put(door, (L2PcInstance)character); 
    18121786                                                        } 
     1787                                                        QuestState st = ((L2PcInstance) character).getQuestState(qn); 
     1788                                                        if (st == null) 
     1789                                                                st = newQuestState((L2PcInstance) character); 
     1790                                                        if (!st.hasQuestItems(RACE_KEY)) 
     1791                                                                return ""; 
     1792                                                        if (world.roomsStatus[zone.getId() - 20104] == 0) 
     1793                                                                runEmeraldRooms(world, spawns, room); 
     1794                                                        door.openMe(); 
     1795                                                        st.takeItems(RACE_KEY, 1); 
     1796                                                        world.openedDoors.put(door, (L2PcInstance) character); 
    18131797                                                        break; 
    18141798                                                } 
     
    18161800                        } 
    18171801                } 
    1818                 return super.onEnterZone(character,zone); 
     1802                return super.onEnterZone(character, zone); 
    18191803        } 
    18201804         
     
    18311815                                { 
    18321816                                        int doorId; 
    1833                                         switch(zone.getId()) 
     1817                                        switch (zone.getId()) 
    18341818                                        { 
    18351819                                                case 20105: 
     
    18431827                                                        break; 
    18441828                                                default: 
    1845                                                         return super.onExitZone(character,zone); 
     1829                                                        return super.onExitZone(character, zone); 
    18461830                                        } 
    18471831                                        for (L2DoorInstance door : InstanceManager.getInstance().getInstance(world.instanceId).getDoors()) 
     
    18591843                        } 
    18601844                } 
    1861                 return super.onExitZone(character,zone); 
     1845                return super.onExitZone(character, zone); 
    18621846        } 
    18631847         
     
    18891873                addSpellFinishedId(BAYLOR); 
    18901874                addKillId(ALARMID); 
    1891                 int[] Talk = {32275,32276,32277}; 
    1892                 for(int npc : Talk) 
     1875                int[] Talk = 
     1876                { 
     1877                        32275, 32276, 32277 
     1878                }; 
     1879                for (int npc : Talk) 
    18931880                        addTalkId(npc); 
    1894                 int[] firstTalk = {32274,32275,32276,32277,ORACLE_GUIDE_1,ORACLE_GUIDE_2}; 
    1895                 for(int npc : firstTalk) 
     1881                int[] firstTalk = 
     1882                { 
     1883                        32274, 32275, 32276, 32277, ORACLE_GUIDE_1, ORACLE_GUIDE_2 
     1884                }; 
     1885                for (int npc : firstTalk) 
    18961886                        addFirstTalkId(npc); 
    1897                 int[] skillSee = {25534,32275,32276,32277,BAYLOR}; 
    1898                 for(int npc : skillSee) 
     1887                int[] skillSee = 
     1888                { 
     1889                        25534, 32275, 32276, 32277, BAYLOR 
     1890                }; 
     1891                for (int npc : skillSee) 
    18991892                        addSkillSeeId(npc); 
    1900                 for(int mob : MOBLIST) 
     1893                for (int mob : MOBLIST) 
    19011894                        addKillId(mob); 
    19021895                for (int mob : CGMOBS) 
     
    19121905        { 
    19131906                // now call the constructor (starts up the) 
    1914                 new CrystalCaverns(-1,qn,"instances"); 
     1907                new CrystalCaverns(-1, qn, "instances"); 
    19151908        } 
    19161909} 
Note: See TracChangeset for help on using the changeset viewer.