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

    r8487 r8630  
    2525import com.l2jserver.gameserver.instancemanager.GrandBossManager; 
    2626import com.l2jserver.gameserver.model.L2Skill; 
     27import com.l2jserver.gameserver.model.StatsSet; 
    2728import com.l2jserver.gameserver.model.actor.L2Attackable; 
    2829import com.l2jserver.gameserver.model.actor.L2Npc; 
     
    3435import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; 
    3536import com.l2jserver.gameserver.network.serverpackets.PlaySound; 
    36 import com.l2jserver.gameserver.network.serverpackets.SocialAction; 
    3737import com.l2jserver.gameserver.skills.SkillHolder; 
    38 import com.l2jserver.gameserver.templates.StatsSet; 
    3938import com.l2jserver.util.Rnd; 
    4039 
    4140/** 
    4241 * Queen Ant AI 
    43  *  
    4442 * @author Emperorc 
    45  *  
    4643 */ 
    4744public class QueenAnt extends L2AttackableAIScript 
     
    5451        private static final int ROYAL = 29005; 
    5552         
    56         private static final int[] MOBS = { QUEEN, LARVA, NURSE, GUARD, ROYAL }; 
    57  
     53        private static final int[] MOBS = 
     54        { 
     55                QUEEN, LARVA, NURSE, GUARD, ROYAL 
     56        }; 
     57         
    5858        private static final int QUEEN_X = -21610; 
    5959        private static final int QUEEN_Y = 181594; 
    6060        private static final int QUEEN_Z = -5734; 
    61  
    62         //QUEEN Status Tracking : 
    63         private static final byte ALIVE = 0; //Queen Ant is spawned. 
    64         private static final byte DEAD = 1; //Queen Ant has been killed. 
     61         
     62        // QUEEN Status Tracking : 
     63        private static final byte ALIVE = 0; // Queen Ant is spawned. 
     64        private static final byte DEAD = 1; // Queen Ant has been killed. 
    6565         
    6666        private static L2BossZone _zone; 
    67  
     67         
    6868        private static SkillHolder HEAL1 = new SkillHolder(4020, 1); 
    6969        private static SkillHolder HEAL2 = new SkillHolder(4024, 1); 
    70  
     70         
    7171        private L2MonsterInstance _queen = null; 
    7272        private L2MonsterInstance _larva = null; 
    73         private List<L2MonsterInstance> _nurses = new FastList<L2MonsterInstance>(5); 
    74  
     73        private final List<L2MonsterInstance> _nurses = new FastList<L2MonsterInstance>(5); 
     74         
    7575        public QueenAnt(int questId, String name, String descr) 
    7676        { 
    7777                super(questId, name, descr); 
    78  
     78                 
    7979                registerMobs(MOBS, QuestEventType.ON_SPAWN, QuestEventType.ON_KILL, QuestEventType.ON_AGGRO_RANGE_ENTER); 
    8080                addFactionCallId(NURSE); 
    81  
     81                 
    8282                _zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z); 
    8383                 
     
    134134                npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ())); 
    135135                _queen = npc; 
    136                 _larva = (L2MonsterInstance)addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0); 
     136                _larva = (L2MonsterInstance) addSpawn(LARVA, -21600, 179482, -5846, Rnd.get(360), false, 0); 
    137137        } 
    138138         
     
    149149                                if (nurse == null || nurse.isDead() || nurse.isCastingNow()) 
    150150                                        continue; 
    151  
     151                                 
    152152                                notCasting = nurse.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST; 
    153153                                if (larvaNeedHeal) 
     
    164164                                        if (nurse.getLeader() == _larva) // skip larva's minions 
    165165                                                continue; 
    166  
     166                                         
    167167                                        if (nurse.getTarget() != _queen || notCasting) 
    168168                                        { 
    169169                                                nurse.setTarget(_queen); 
    170                                                 nurse.useMagic(HEAL1.getSkill());                                                
     170                                                nurse.useMagic(HEAL1.getSkill()); 
    171171                                        } 
    172172                                        continue; 
     
    183183                                if (Rnd.get(2) == 0) 
    184184                                { 
    185                                         npc.broadcastPacket(new SocialAction(npc, 3)); 
     185                                        npc.broadcastSocialAction(3); 
    186186                                } 
    187187                                else 
    188188                                { 
    189                                         npc.broadcastPacket(new SocialAction(npc, 4)); 
     189                                        npc.broadcastSocialAction(4); 
    190190                                } 
    191191                        } 
     
    199199                return super.onAdvEvent(event, npc, player); 
    200200        } 
    201  
     201         
    202202        @Override 
    203203        public String onSpawn(L2Npc npc) 
    204204        { 
    205                 final L2MonsterInstance mob = (L2MonsterInstance)npc; 
     205                final L2MonsterInstance mob = (L2MonsterInstance) npc; 
    206206                switch (npc.getNpcId()) 
    207207                { 
     
    221221                                break; 
    222222                } 
    223  
     223                 
    224224                return super.onSpawn(npc); 
    225225        } 
    226  
     226         
    227227        @Override 
    228228        public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet) 
     
    230230                if (caller == null || npc == null) 
    231231                        return super.onFactionCall(npc, caller, attacker, isPet); 
    232  
     232                 
    233233                if (!npc.isCastingNow() && npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST) 
    234234                { 
     
    236236                        { 
    237237                                npc.setTarget(caller); 
    238                                 ((L2Attackable)npc).useMagic(HEAL1.getSkill()); 
     238                                ((L2Attackable) npc).useMagic(HEAL1.getSkill()); 
    239239                        } 
    240240                } 
    241241                return null; 
    242242        } 
    243  
     243         
    244244        @Override 
    245245        public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet) 
     
    247247                if (npc == null) 
    248248                        return null; 
    249  
     249                 
    250250                final boolean isMage; 
    251251                final L2Playable character; 
     
    260260                        character = player; 
    261261                } 
    262  
     262                 
    263263                if (character == null) 
    264264                        return null; 
    265  
     265                 
    266266                if (!Config.RAID_DISABLE_CURSE && character.getLevel() - npc.getLevel() > 8) 
    267267                { 
     
    277277                                        curse = SkillTable.FrequentSkill.RAID_CURSE2.getSkill(); 
    278278                        } 
    279  
     279                         
    280280                        if (curse != null) 
    281281                        { 
     
    283283                                curse.getEffects(npc, character); 
    284284                        } 
    285  
     285                         
    286286                        ((L2Attackable) npc).stopHating(character); // for calling again 
    287287                        return null; 
    288288                } 
    289  
     289                 
    290290                return super.onAggroRangeEnter(npc, player, isPet); 
    291291        } 
    292  
     292         
    293293        @Override 
    294294        public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) 
     
    299299                        npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ())); 
    300300                        GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD); 
    301                         //time is 36hour        +/- 17hour 
     301                        // time is 36hour +/- 17hour 
    302302                        long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + Rnd.get(Config.Random_Of_QueenAnt_Spawn); 
    303303                        startQuestTimer("queen_unlock", respawnTime, null, null); 
     
    317317                        if (npcId == ROYAL) 
    318318                        { 
    319                                 L2MonsterInstance mob = (L2MonsterInstance)npc; 
     319                                L2MonsterInstance mob = (L2MonsterInstance) npc; 
    320320                                if (mob.getLeader() != null) 
    321321                                        mob.getLeader().getMinionList().onMinionDie(mob, (280 + Rnd.get(40)) * 1000); 
     
    323323                        else if (npcId == NURSE) 
    324324                        { 
    325                                 L2MonsterInstance mob = (L2MonsterInstance)npc; 
     325                                L2MonsterInstance mob = (L2MonsterInstance) npc; 
    326326                                _nurses.remove(mob); 
    327327                                if (mob.getLeader() != null) 
Note: See TracChangeset for help on using the changeset viewer.