- Timestamp:
- Jan 16, 2012 7:56:19 AM (4 months ago)
- Location:
- trunk/L2J_DataPack
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
dist/game/data/scripts/ai/individual/QueenAnt.java (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/L2J_DataPack
- Property svn:mergeinfo changed
/branches/unstable/L2J_DataPack_BETA merged: 8407-8426,8428-8480,8482-8491,8493-8588,8590-8629
- Property svn:mergeinfo changed
-
trunk/L2J_DataPack/dist/game/data/scripts/ai/individual/QueenAnt.java
r8487 r8630 25 25 import com.l2jserver.gameserver.instancemanager.GrandBossManager; 26 26 import com.l2jserver.gameserver.model.L2Skill; 27 import com.l2jserver.gameserver.model.StatsSet; 27 28 import com.l2jserver.gameserver.model.actor.L2Attackable; 28 29 import com.l2jserver.gameserver.model.actor.L2Npc; … … 34 35 import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; 35 36 import com.l2jserver.gameserver.network.serverpackets.PlaySound; 36 import com.l2jserver.gameserver.network.serverpackets.SocialAction;37 37 import com.l2jserver.gameserver.skills.SkillHolder; 38 import com.l2jserver.gameserver.templates.StatsSet;39 38 import com.l2jserver.util.Rnd; 40 39 41 40 /** 42 41 * Queen Ant AI 43 *44 42 * @author Emperorc 45 *46 43 */ 47 44 public class QueenAnt extends L2AttackableAIScript … … 54 51 private static final int ROYAL = 29005; 55 52 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 58 58 private static final int QUEEN_X = -21610; 59 59 private static final int QUEEN_Y = 181594; 60 60 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. 65 65 66 66 private static L2BossZone _zone; 67 67 68 68 private static SkillHolder HEAL1 = new SkillHolder(4020, 1); 69 69 private static SkillHolder HEAL2 = new SkillHolder(4024, 1); 70 70 71 71 private L2MonsterInstance _queen = null; 72 72 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 75 75 public QueenAnt(int questId, String name, String descr) 76 76 { 77 77 super(questId, name, descr); 78 78 79 79 registerMobs(MOBS, QuestEventType.ON_SPAWN, QuestEventType.ON_KILL, QuestEventType.ON_AGGRO_RANGE_ENTER); 80 80 addFactionCallId(NURSE); 81 81 82 82 _zone = GrandBossManager.getInstance().getZone(QUEEN_X, QUEEN_Y, QUEEN_Z); 83 83 … … 134 134 npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ())); 135 135 _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); 137 137 } 138 138 … … 149 149 if (nurse == null || nurse.isDead() || nurse.isCastingNow()) 150 150 continue; 151 151 152 152 notCasting = nurse.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST; 153 153 if (larvaNeedHeal) … … 164 164 if (nurse.getLeader() == _larva) // skip larva's minions 165 165 continue; 166 166 167 167 if (nurse.getTarget() != _queen || notCasting) 168 168 { 169 169 nurse.setTarget(_queen); 170 nurse.useMagic(HEAL1.getSkill()); 170 nurse.useMagic(HEAL1.getSkill()); 171 171 } 172 172 continue; … … 183 183 if (Rnd.get(2) == 0) 184 184 { 185 npc.broadcast Packet(new SocialAction(npc, 3));185 npc.broadcastSocialAction(3); 186 186 } 187 187 else 188 188 { 189 npc.broadcast Packet(new SocialAction(npc, 4));189 npc.broadcastSocialAction(4); 190 190 } 191 191 } … … 199 199 return super.onAdvEvent(event, npc, player); 200 200 } 201 201 202 202 @Override 203 203 public String onSpawn(L2Npc npc) 204 204 { 205 final L2MonsterInstance mob = (L2MonsterInstance) npc;205 final L2MonsterInstance mob = (L2MonsterInstance) npc; 206 206 switch (npc.getNpcId()) 207 207 { … … 221 221 break; 222 222 } 223 223 224 224 return super.onSpawn(npc); 225 225 } 226 226 227 227 @Override 228 228 public String onFactionCall(L2Npc npc, L2Npc caller, L2PcInstance attacker, boolean isPet) … … 230 230 if (caller == null || npc == null) 231 231 return super.onFactionCall(npc, caller, attacker, isPet); 232 232 233 233 if (!npc.isCastingNow() && npc.getAI().getIntention() != CtrlIntention.AI_INTENTION_CAST) 234 234 { … … 236 236 { 237 237 npc.setTarget(caller); 238 ((L2Attackable) npc).useMagic(HEAL1.getSkill());238 ((L2Attackable) npc).useMagic(HEAL1.getSkill()); 239 239 } 240 240 } 241 241 return null; 242 242 } 243 243 244 244 @Override 245 245 public String onAggroRangeEnter(L2Npc npc, L2PcInstance player, boolean isPet) … … 247 247 if (npc == null) 248 248 return null; 249 249 250 250 final boolean isMage; 251 251 final L2Playable character; … … 260 260 character = player; 261 261 } 262 262 263 263 if (character == null) 264 264 return null; 265 265 266 266 if (!Config.RAID_DISABLE_CURSE && character.getLevel() - npc.getLevel() > 8) 267 267 { … … 277 277 curse = SkillTable.FrequentSkill.RAID_CURSE2.getSkill(); 278 278 } 279 279 280 280 if (curse != null) 281 281 { … … 283 283 curse.getEffects(npc, character); 284 284 } 285 285 286 286 ((L2Attackable) npc).stopHating(character); // for calling again 287 287 return null; 288 288 } 289 289 290 290 return super.onAggroRangeEnter(npc, player, isPet); 291 291 } 292 292 293 293 @Override 294 294 public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet) … … 299 299 npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ())); 300 300 GrandBossManager.getInstance().setBossStatus(QUEEN, DEAD); 301 // time is 36hour+/- 17hour301 // time is 36hour +/- 17hour 302 302 long respawnTime = (long) Config.Interval_Of_QueenAnt_Spawn + Rnd.get(Config.Random_Of_QueenAnt_Spawn); 303 303 startQuestTimer("queen_unlock", respawnTime, null, null); … … 317 317 if (npcId == ROYAL) 318 318 { 319 L2MonsterInstance mob = (L2MonsterInstance) npc;319 L2MonsterInstance mob = (L2MonsterInstance) npc; 320 320 if (mob.getLeader() != null) 321 321 mob.getLeader().getMinionList().onMinionDie(mob, (280 + Rnd.get(40)) * 1000); … … 323 323 else if (npcId == NURSE) 324 324 { 325 L2MonsterInstance mob = (L2MonsterInstance) npc;325 L2MonsterInstance mob = (L2MonsterInstance) npc; 326 326 _nurses.remove(mob); 327 327 if (mob.getLeader() != null)
Note: See TracChangeset
for help on using the changeset viewer.
