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

    r8406 r8630  
    3434import com.l2jserver.gameserver.model.L2Object; 
    3535import com.l2jserver.gameserver.model.L2Skill; 
     36import com.l2jserver.gameserver.model.Location; 
     37import com.l2jserver.gameserver.model.StatsSet; 
    3638import com.l2jserver.gameserver.model.actor.L2Character; 
    3739import com.l2jserver.gameserver.model.actor.L2Npc; 
     
    4547import com.l2jserver.gameserver.network.serverpackets.MoveToPawn; 
    4648import com.l2jserver.gameserver.network.serverpackets.PlaySound; 
    47 import com.l2jserver.gameserver.network.serverpackets.SocialAction; 
    48 import com.l2jserver.gameserver.templates.StatsSet; 
    4949import com.l2jserver.gameserver.util.Util; 
    5050import com.l2jserver.util.Rnd; 
    5151 
    52  
    5352/** 
    54  * Baium AI 
    55  *  
    56  * Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but 
    57  *   players also lose their ability to wake baium up.  However, should another person 
    58  *   enter the room and wake him up, the players who had stayed inside may join the raid. 
    59  *   This can be helpful for players who became victims of a reboot (they only need 1 new player to 
    60  *   enter and wake up baium) and is not too exploitable since any player wishing to exploit it 
    61  *   would have to suffer 5 days of being parked in an empty room. 
    62  * Note2: Neither version of Baium should be a permanent spawn.  This script is fully capable of 
    63  *   spawning the statue-version when the lock expires and switching it to the mob version promptly. 
    64  * 
    65  * Additional notes ( source http://aleenaresron.blogspot.com/2006_08_01_archive.html ): 
    66  *   * Baium only first respawns five days after his last death. And from those five days he will 
    67  *       respawn within 1-8 hours of his last death. So, you have to know his last time of death. 
    68  *   * If by some freak chance you are the only one in Baium's chamber and NO ONE comes in 
    69  *       [ha, ha] you or someone else will have to wake Baium. There is a good chance that Baium 
    70  *       will automatically kill whoever wakes him. There are some people that have been able to 
    71  *       wake him and not die, however if you've already gone through the trouble of getting the 
    72  *       bloody fabric and camped him out and researched his spawn time, are you willing to take that 
    73  *       chance that you'll wake him and not be able to finish your quest? Doubtful. 
    74  *       [ this powerful attack vs the player who wakes him up is NOT yet implemented here] 
    75  *   * once someone starts attacking Baium no one else can port into the chamber where he is. 
    76  *       Unlike with the other raid bosses, you can just show up at any time as long as you are there 
    77  *       when they die. Not true with Baium. Once he gets attacked, the port to Baium closes. byebye, 
    78  *       see you in 5 days.  If nobody attacks baium for 30 minutes, he auto-despawns and unlocks the 
    79  *       vortex 
    80  *  
     53 * Baium AI Note1: if the server gets rebooted while players are still fighting Baium, there is no lock, but players also lose their ability to wake baium up. However, should another person enter the room and wake him up, the players who had stayed inside may join the raid. This can be helpful for 
     54 * players who became victims of a reboot (they only need 1 new player to enter and wake up baium) and is not too exploitable since any player wishing to exploit it would have to suffer 5 days of being parked in an empty room. Note2: Neither version of Baium should be a permanent spawn. This script 
     55 * is fully capable of spawning the statue-version when the lock expires and switching it to the mob version promptly. Additional notes ( source http://aleenaresron.blogspot.com/2006_08_01_archive.html ): * Baium only first respawns five days after his last death. And from those five days he will 
     56 * respawn within 1-8 hours of his last death. So, you have to know his last time of death. * If by some freak chance you are the only one in Baium's chamber and NO ONE comes in [ha, ha] you or someone else will have to wake Baium. There is a good chance that Baium will automatically kill whoever 
     57 * wakes him. There are some people that have been able to wake him and not die, however if you've already gone through the trouble of getting the bloody fabric and camped him out and researched his spawn time, are you willing to take that chance that you'll wake him and not be able to finish your 
     58 * quest? Doubtful. [ this powerful attack vs the player who wakes him up is NOT yet implemented here] * once someone starts attacking Baium no one else can port into the chamber where he is. Unlike with the other raid bosses, you can just show up at any time as long as you are there when they die. 
     59 * Not true with Baium. Once he gets attacked, the port to Baium closes. byebye, see you in 5 days. If nobody attacks baium for 30 minutes, he auto-despawns and unlocks the vortex 
    8160 * @author Fulminus version 0.1 
    8261 */ 
     
    9069        private static final int ARCHANGEL = 29021; 
    9170         
    92         //Baium status tracking 
    93         private static final byte ASLEEP = 0;  // baium is in the stone version, waiting to be woken up. Entry is unlocked 
    94         private static final byte AWAKE = 1;   // baium is awake and fighting. Entry is locked. 
    95         private static final byte DEAD = 2;    // baium has been killed and has not yet spawned. Entry is locked 
     71        // Baium status tracking 
     72        private static final byte ASLEEP = 0; // baium is in the stone version, waiting to be woken up. Entry is unlocked 
     73        private static final byte AWAKE = 1; // baium is awake and fighting. Entry is locked. 
     74        private static final byte DEAD = 2; // baium has been killed and has not yet spawned. Entry is locked 
    9675         
    9776        // fixed archangel spawnloc 
    98         private final static int ANGEL_LOCATION[][] = 
    99         { 
    100                 { 114239, 17168, 10080, 63544 }, 
    101                 { 115780, 15564, 10080, 13620 }, 
    102                 { 114880, 16236, 10080, 5400 }, 
    103                 { 115168, 17200, 10080, 0 }, 
    104                 { 115792, 16608, 10080, 0 }, 
     77        private final static Location[] ANGEL_LOCATION = 
     78        { 
     79                new Location(114239, 17168, 10080, 63544), 
     80                new Location(115780, 15564, 10080, 13620), 
     81                new Location(114880, 16236, 10080, 5400), 
     82                new Location(115168, 17200, 10080, 0), 
     83                new Location(115792, 16608, 10080, 0) 
    10584        }; 
    10685         
     
    10988        private L2BossZone _Zone; 
    11089         
    111         public Baium (int questId, String name, String descr) 
     90        public Baium(int questId, String name, String descr) 
    11291        { 
    11392                super(questId, name, descr); 
    11493                 
    115                 int[] mob = {LIVE_BAIUM}; 
    116                 this.registerMobs(mob); 
     94                int[] mob = 
     95                { 
     96                        LIVE_BAIUM 
     97                }; 
     98                registerMobs(mob); 
    11799                 
    118100                // Quest NPC starter initialization 
     
    120102                addTalkId(STONE_BAIUM, ANGELIC_VORTEX); 
    121103                 
    122                 _Zone = GrandBossManager.getInstance().getZone(113100,14500,10077); 
     104                _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); 
    123105                StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM); 
    124106                int status = GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM); 
     
    129111                        if (temp > 0) 
    130112                        { 
    131                                 // the unlock time has not yet expired.  Mark Baium as currently locked (dead). Setup a timer 
     113                                // the unlock time has not yet expired. Mark Baium as currently locked (dead). Setup a timer 
    132114                                // to fire at the correct time (calculate the time between now and the unlock time, 
    133115                                // setup a timer to fire after that many msec) 
     
    136118                        else 
    137119                        { 
    138                                 // the time has already expired while the server was offline.  Delete the saved time and 
    139                                 // immediately spawn the stone-baium.  Also the state need not be changed from ASLEEP 
    140                                 addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0); 
    141                                 GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,ASLEEP); 
     120                                // the time has already expired while the server was offline. Delete the saved time and 
     121                                // immediately spawn the stone-baium. Also the state need not be changed from ASLEEP 
     122                                addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); 
     123                                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); 
    142124                        } 
    143125                } 
     
    150132                        final int hp = info.getInteger("currentHP"); 
    151133                        final int mp = info.getInteger("currentMP"); 
    152                         L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM,loc_x,loc_y,loc_z,heading,false,0); 
     134                        L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, loc_x, loc_y, loc_z, heading, false, 0); 
    153135                        GrandBossManager.getInstance().addBoss(baium); 
    154136                        final L2Npc _baium = baium; 
    155                         ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { 
     137                        ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() 
     138                        { 
    156139                                @Override 
    157140                                public void run() 
     
    159142                                        try 
    160143                                        { 
    161                                                 _baium.setCurrentHpMp(hp,mp); 
     144                                                _baium.setCurrentHpMp(hp, mp); 
    162145                                                _baium.setIsInvul(true); 
    163146                                                _baium.setIsImmobilized(true); 
    164147                                                _baium.setRunning(); 
    165                                                 _baium.broadcastPacket(new SocialAction(_baium,2)); 
    166                                                 startQuestTimer("baium_wakeup",15000, _baium, null); 
     148                                                _baium.broadcastSocialAction(2); 
     149                                                startQuestTimer("baium_wakeup", 15000, _baium, null); 
    167150                                        } 
    168151                                        catch (Exception e) 
     
    171154                                        } 
    172155                                } 
    173                         },100L); 
     156                        }, 100L); 
    174157                } 
    175158                else 
    176                         addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0); 
     159                        addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); 
    177160        } 
    178161         
    179162        @Override 
    180         public String onAdvEvent (String event, L2Npc npc, L2PcInstance player) 
     163        public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) 
    181164        { 
    182165                if (event.equalsIgnoreCase("baium_unlock")) 
    183166                { 
    184                         GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,ASLEEP); 
    185                         addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0); 
     167                        GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); 
     168                        addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); 
    186169                } 
    187170                else if (event.equalsIgnoreCase("skill_range") && npc != null) 
     
    197180                        if (npc.getNpcId() == LIVE_BAIUM) 
    198181                        { 
    199                                 npc.broadcastPacket(new SocialAction(npc,1)); 
    200                                 npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(),40,5)); 
     182                                npc.broadcastSocialAction(1); 
     183                                npc.broadcastPacket(new Earthquake(npc.getX(), npc.getY(), npc.getZ(), 40, 5)); 
    201184                                // start monitoring baium's inactivity 
    202185                                _LastAttackVsBaiumTime = System.currentTimeMillis(); 
     
    204187                                startQuestTimer("skill_range", 500, npc, null, true); 
    205188                                final L2Npc baium = npc; 
    206                                 ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { 
     189                                ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() 
     190                                { 
    207191                                        @Override 
    208192                                        public void run() 
     
    220204                                                } 
    221205                                        } 
    222                                 },11100L); 
     206                                }, 11100L); 
    223207                                // TODO: the person who woke baium up should be knocked across the room, onto a wall, and 
    224208                                // lose massive amounts of HP. 
    225209                                for (int i = 0; i < ANGEL_LOCATION.length; i++) 
    226210                                { 
    227                                         L2Npc angel = addSpawn(ARCHANGEL, ANGEL_LOCATION[i][0], ANGEL_LOCATION[i][1], ANGEL_LOCATION[i][2], ANGEL_LOCATION[i][3], false, 0, true); 
     211                                        L2Npc angel = addSpawn(ARCHANGEL, ANGEL_LOCATION[i], false, 0, true); 
    228212                                        angel.setIsInvul(true); 
    229213                                        _Minions.add(angel); 
     
    239223                                // just in case the zone reference has been lost (somehow...), restore the reference 
    240224                                if (_Zone == null) 
    241                                         _Zone = GrandBossManager.getInstance().getZone(113100,14500,10077); 
     225                                        _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); 
    242226                                if (_LastAttackVsBaiumTime + 1800000 < System.currentTimeMillis()) 
    243227                                { 
     
    250234                                                } 
    251235                                        _Minions.clear(); 
    252                                         addSpawn(STONE_BAIUM,116033,17447,10104,40188,false,0); // spawn stone-baium 
    253                                         GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,ASLEEP);    // mark that Baium is not awake any more 
     236                                        addSpawn(STONE_BAIUM, 116033, 17447, 10104, 40188, false, 0); // spawn stone-baium 
     237                                        GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, ASLEEP); // mark that Baium is not awake any more 
    254238                                        _Zone.oustAllPlayers(); 
    255239                                        cancelQuestTimer("baium_despawn", npc, null); 
    256240                                } 
    257                                 else if ((_LastAttackVsBaiumTime + 300000 < System.currentTimeMillis()) && npc.getCurrentHp() < ( ( npc.getMaxHp() * 3 ) / 4.0 )) 
    258                                 { 
    259                                         npc.setIsCastingNow(false); //just in case 
     241                                else if ((_LastAttackVsBaiumTime + 300000 < System.currentTimeMillis()) && npc.getCurrentHp() < ((npc.getMaxHp() * 3) / 4.0)) 
     242                                { 
     243                                        npc.setIsCastingNow(false); // just in case 
    260244                                        npc.setTarget(npc); 
    261245                                        L2Skill skill = SkillTable.getInstance().getInfo(4135, 1); 
     
    274258                                } 
    275259                                else if (!_Zone.isInsideZone(npc)) 
    276                                         npc.teleToLocation(116033,17447,10104); 
     260                                        npc.teleToLocation(116033, 17447, 10104); 
    277261                        } 
    278262                } 
     
    281265         
    282266        @Override 
    283         public String onTalk(L2Npc npc,L2PcInstance player) 
     267        public String onTalk(L2Npc npc, L2PcInstance player) 
    284268        { 
    285269                int npcId = npc.getNpcId(); 
    286270                String htmltext = ""; 
    287271                if (_Zone == null) 
    288                         _Zone = GrandBossManager.getInstance().getZone(113100,14500,10077); 
     272                        _Zone = GrandBossManager.getInstance().getZone(113100, 14500, 10077); 
    289273                if (_Zone == null) 
    290274                        return "<html><body>Angelic Vortex:<br>You may not enter while admin disabled this zone</body></html>"; 
     
    295279                                // once Baium is awaken, no more people may enter until he dies, the server reboots, or 
    296280                                // 30 minutes pass with no attacks made against Baium. 
    297                                 GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,AWAKE); 
     281                                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, AWAKE); 
    298282                                npc.deleteMe(); 
    299283                                L2GrandBossInstance baium = (L2GrandBossInstance) addSpawn(LIVE_BAIUM, npc, true); 
    300284                                GrandBossManager.getInstance().addBoss(baium); 
    301285                                final L2Npc _baium = baium; 
    302                                 ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() { 
     286                                ThreadPoolManager.getInstance().scheduleGeneral(new Runnable() 
     287                                { 
    303288                                        @Override 
    304289                                        public void run() 
     
    308293                                                        _baium.setIsInvul(true); 
    309294                                                        _baium.setRunning(); 
    310                                                         _baium.broadcastPacket(new SocialAction(_baium,2)); 
    311                                                         startQuestTimer("baium_wakeup",15000, _baium, null); 
     295                                                        _baium.broadcastSocialAction(2); 
     296                                                        startQuestTimer("baium_wakeup", 15000, _baium, null); 
    312297                                                        _baium.setShowSummonAnimation(false); 
    313298                                                } 
     
    317302                                                } 
    318303                                        } 
    319                                 },100L); 
     304                                }, 100L); 
    320305                        } 
    321306                        else 
     
    326311                        if (player.isFlying()) 
    327312                        { 
    328                                 //print "Player "+player.getName()+" attempted to enter Baium's lair while flying!"; 
     313                                // print "Player "+player.getName()+" attempted to enter Baium's lair while flying!"; 
    329314                                return "<html><body>Angelic Vortex:<br>You may not enter while flying a wyvern</body></html>"; 
    330315                        } 
    331316                         
    332                         if (GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP 
    333                                         && player.getQuestState("baium").getQuestItemsCount(4295) > 0) // bloody fabric 
    334                         { 
    335                                 player.getQuestState("baium").takeItems(4295,1); 
     317                        if (GrandBossManager.getInstance().getBossStatus(LIVE_BAIUM) == ASLEEP && player.getQuestState("baium").hasQuestItems(4295)) // bloody fabric 
     318                        { 
     319                                player.getQuestState("baium").takeItems(4295, 1); 
    336320                                // allow entry for the player for the next 30 secs (more than enough time for the TP to happen) 
    337321                                // Note: this just means 30secs to get in, no limits on how long it takes before we get out. 
    338                                 _Zone.allowPlayerEntry(player,30); 
    339                                 player.teleToLocation(113100,14500,10077); 
     322                                _Zone.allowPlayerEntry(player, 30); 
     323                                player.teleToLocation(113100, 14500, 10077); 
    340324                        } 
    341325                        else 
     
    359343                return super.onSpellFinished(npc, player, skill); 
    360344        } 
    361  
     345         
    362346        @Override 
    363347        public String onSpawn(L2Npc npc) 
     
    366350                return super.onSpawn(npc); 
    367351        } 
    368  
     352         
    369353        @Override 
    370         public String onAttack (L2Npc npc, L2PcInstance attacker, int damage, boolean isPet) 
     354        public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isPet) 
    371355        { 
    372356                if (!_Zone.isInsideZone(attacker)) 
    373357                { 
    374                         attacker.reduceCurrentHp(attacker.getCurrentHp(),attacker,false,false, null); 
     358                        attacker.reduceCurrentHp(attacker.getCurrentHp(), attacker, false, false, null); 
    375359                        return super.onAttack(npc, attacker, damage, isPet); 
    376360                } 
     
    397381                                { 
    398382                                        npc.setTarget(attacker); 
    399                                         L2Skill skill = SkillTable.getInstance().getInfo(4258,1); 
     383                                        L2Skill skill = SkillTable.getInstance().getInfo(4258, 1); 
    400384                                        if (skill.isMagic()) 
    401385                                        { 
     
    419403         
    420404        @Override 
    421         public String onKill (L2Npc npc, L2PcInstance killer, boolean isPet) 
     405        public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) 
    422406        { 
    423407                cancelQuestTimer("baium_despawn", npc, null); 
    424408                npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ())); 
    425409                // spawn the "Teleportation Cubic" for 15 minutes (to allow players to exit the lair) 
    426                 addSpawn(29055,115203,16620,10078,0,false,900000); ////should we teleport everyone out if the cubic despawns?? 
    427                 // "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 +  1*3,600,000 + random-less-than(8*3,600,000) millisecs] 
    428                 long respawnTime = (long)Config.Interval_Of_Baium_Spawn + Rnd.get(Config.Random_Of_Baium_Spawn); 
    429                 GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM,DEAD); 
     410                addSpawn(29055, 115203, 16620, 10078, 0, false, 900000); // //should we teleport everyone out if the cubic despawns?? 
     411                // "lock" baium for 5 days and 1 to 8 hours [i.e. 432,000,000 + 1*3,600,000 + random-less-than(8*3,600,000) millisecs] 
     412                long respawnTime = (long) Config.Interval_Of_Baium_Spawn + Rnd.get(Config.Random_Of_Baium_Spawn); 
     413                GrandBossManager.getInstance().setBossStatus(LIVE_BAIUM, DEAD); 
    430414                startQuestTimer("baium_unlock", respawnTime, null, null); 
    431415                // also save the respawn time so that the info is maintained past reboots 
    432416                StatsSet info = GrandBossManager.getInstance().getStatsSet(LIVE_BAIUM); 
    433                 info.set("respawn_time",(System.currentTimeMillis()) + respawnTime); 
    434                 GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM,info); 
     417                info.set("respawn_time", (System.currentTimeMillis()) + respawnTime); 
     418                GrandBossManager.getInstance().setStatsSet(LIVE_BAIUM, info); 
    435419                for (L2Npc minion : _Minions) 
    436420                        if (minion != null) 
     
    442426                if (getQuestTimer("skill_range", npc, null) != null) 
    443427                        getQuestTimer("skill_range", npc, null).cancel(); 
    444                 return super.onKill(npc,killer,isPet); 
     428                return super.onKill(npc, killer, isPet); 
    445429        } 
    446430         
     
    460444                                        } 
    461445                                         
    462                                         if (((L2Character) obj).getZ() < ( npc.getZ() - 100 ) && ((L2Character) obj).getZ() > ( npc.getZ() + 100 ) 
    463                                                         || !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ()))) 
     446                                        if (((L2Character) obj).getZ() < (npc.getZ() - 100) && ((L2Character) obj).getZ() > (npc.getZ() + 100) || !(GeoData.getInstance().canSeeTarget(((L2Character) obj).getX(), ((L2Character) obj).getY(), ((L2Character) obj).getZ(), npc.getX(), npc.getY(), npc.getZ()))) 
    464447                                                continue; 
    465448                                } 
     
    504487                        _target = getRandomTarget(npc); 
    505488                        if (_target != null) 
    506                                 _skill = SkillTable.getInstance().getInfo(getRandomSkill(npc),1); 
     489                                _skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1); 
    507490                } 
    508491                 
     
    510493                L2Skill skill = _skill; 
    511494                if (skill == null) 
    512                         skill = SkillTable.getInstance().getInfo(getRandomSkill(npc),1); 
     495                        skill = SkillTable.getInstance().getInfo(getRandomSkill(npc), 1); 
    513496                 
    514497                if (skill.isMagic()) 
     
    537520                        _skill = null; 
    538521                        if (getDist(skill.getCastRange()) > 0) 
    539                                 npc.broadcastPacket(new MoveToPawn(npc,target,getDist(skill.getCastRange()))); 
     522                                npc.broadcastPacket(new MoveToPawn(npc, target, getDist(skill.getCastRange()))); 
    540523                        try 
    541524                        { 
     
    545528                        } 
    546529                        catch (Exception e) 
    547                         {e.printStackTrace();} 
     530                        { 
     531                                e.printStackTrace(); 
     532                        } 
    548533                } 
    549534                else 
     
    557542        { 
    558543                int skill; 
    559                 if( npc.getCurrentHp() > ( ( npc.getMaxHp() * 3 ) / 4.0 ) ) 
    560                 { 
    561                         if( Rnd.get(100) < 10 ) 
     544                if (npc.getCurrentHp() > ((npc.getMaxHp() * 3) / 4.0)) 
     545                { 
     546                        if (Rnd.get(100) < 10) 
    562547                                skill = 4128; 
    563                         else if( Rnd.get(100) < 10 ) 
     548                        else if (Rnd.get(100) < 10) 
    564549                                skill = 4129; 
    565550                        else 
    566551                                skill = 4127; 
    567552                } 
    568                 else if( npc.getCurrentHp() > ( ( npc.getMaxHp() * 2 ) / 4.0) ) 
    569                 { 
    570                         if( Rnd.get(100) < 10 ) 
     553                else if (npc.getCurrentHp() > ((npc.getMaxHp() * 2) / 4.0)) 
     554                { 
     555                        if (Rnd.get(100) < 10) 
    571556                                skill = 4131; 
    572                         else if( Rnd.get(100) < 10 ) 
     557                        else if (Rnd.get(100) < 10) 
    573558                                skill = 4128; 
    574                         else if( Rnd.get(100) < 10 ) 
     559                        else if (Rnd.get(100) < 10) 
    575560                                skill = 4129; 
    576561                        else 
    577562                                skill = 4127; 
    578563                } 
    579                 else if( npc.getCurrentHp() > ( ( npc.getMaxHp() * 1 ) / 4.0 ) ) 
    580                 { 
    581                         if( Rnd.get(100) < 10 ) 
     564                else if (npc.getCurrentHp() > ((npc.getMaxHp() * 1) / 4.0)) 
     565                { 
     566                        if (Rnd.get(100) < 10) 
    582567                                skill = 4130; 
    583                         else if( Rnd.get(100) < 10 ) 
     568                        else if (Rnd.get(100) < 10) 
    584569                                skill = 4131; 
    585                         else if( Rnd.get(100) < 10 ) 
     570                        else if (Rnd.get(100) < 10) 
    586571                                skill = 4128; 
    587                         else if( Rnd.get(100) < 10 ) 
     572                        else if (Rnd.get(100) < 10) 
    588573                                skill = 4129; 
    589574                        else 
    590575                                skill = 4127; 
    591576                } 
    592                 else if( Rnd.get(100) < 10 ) 
     577                else if (Rnd.get(100) < 10) 
    593578                        skill = 4130; 
    594                 else if( Rnd.get(100) < 10 ) 
     579                else if (Rnd.get(100) < 10) 
    595580                        skill = 4131; 
    596                 else if( Rnd.get(100) < 10 ) 
     581                else if (Rnd.get(100) < 10) 
    597582                        skill = 4128; 
    598                 else if( Rnd.get(100) < 10 ) 
     583                else if (Rnd.get(100) < 10) 
    599584                        skill = 4129; 
    600585                else 
     
    604589         
    605590        @Override 
    606         public String onSkillSee (L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) 
     591        public String onSkillSee(L2Npc npc, L2PcInstance caster, L2Skill skill, L2Object[] targets, boolean isPet) 
    607592        { 
    608593                if (npc.isInvul()) 
     
    618603        { 
    619604                int dist = 0; 
    620                 switch(range) 
     605                switch (range) 
    621606                { 
    622607                        case -1: 
     
    626611                                break; 
    627612                        default: 
    628                                 dist = range-85; 
     613                                dist = range - 85; 
    629614                                break; 
    630615                } 
Note: See TracChangeset for help on using the changeset viewer.