Changeset 8630 for trunk/L2J_DataPack/dist/game/data/scripts/instances/CrystalCaverns/CrystalCaverns.java
- 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/instances/CrystalCaverns/CrystalCaverns.java (modified) (90 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/instances/CrystalCaverns/CrystalCaverns.java
r8406 r8630 28 28 import com.l2jserver.gameserver.instancemanager.InstanceManager.InstanceWorld; 29 29 import com.l2jserver.gameserver.model.L2CharPosition; 30 import com.l2jserver.gameserver.model.L2ItemInstance;31 30 import com.l2jserver.gameserver.model.L2Object; 32 31 import com.l2jserver.gameserver.model.L2Party; 33 32 import com.l2jserver.gameserver.model.L2Skill; 34 import com.l2jserver.gameserver.model.L2Skill.SkillTargetType;35 33 import com.l2jserver.gameserver.model.L2World; 36 34 import com.l2jserver.gameserver.model.Location; … … 44 42 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; 45 43 import com.l2jserver.gameserver.model.entity.Instance; 44 import com.l2jserver.gameserver.model.item.instance.L2ItemInstance; 46 45 import com.l2jserver.gameserver.model.quest.Quest; 47 46 import com.l2jserver.gameserver.model.quest.QuestState; 48 import com.l2jserver.gameserver.model.quest.State;49 47 import com.l2jserver.gameserver.model.zone.L2ZoneType; 50 48 import com.l2jserver.gameserver.network.NpcStringId; … … 56 54 import com.l2jserver.gameserver.network.serverpackets.MagicSkillUse; 57 55 import com.l2jserver.gameserver.network.serverpackets.PlaySound; 58 import com.l2jserver.gameserver.network.serverpackets.SocialAction;59 56 import com.l2jserver.gameserver.network.serverpackets.SpecialCamera; 60 57 import com.l2jserver.gameserver.network.serverpackets.SystemMessage; 61 58 import com.l2jserver.gameserver.network.serverpackets.ValidateLocation; 59 import com.l2jserver.gameserver.templates.skills.L2TargetType; 62 60 import com.l2jserver.gameserver.util.Util; 63 61 import com.l2jserver.util.Rnd; … … 106 104 public List<L2Npc> oracle = new FastList<L2Npc>(); 107 105 // baylor variables 108 private List<L2PcInstance> _raiders = new FastList<L2PcInstance>();106 private final List<L2PcInstance> _raiders = new FastList<L2PcInstance>(); 109 107 private int _raidStatus = 0; 110 108 private long _dragonClawStart = 0; 111 109 private int _dragonClawNeed = 0; 112 private List<L2Npc> _animationMobs = new FastList<L2Npc>();110 private final List<L2Npc> _animationMobs = new FastList<L2Npc>(); 113 111 private L2Npc _camera = null; 114 112 private L2Npc _baylor = null; … … 328 326 private static final int DRAGONCLAWTIME = 3000; 329 327 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) 333 337 { 334 338 for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors()) … … 337 341 } 338 342 339 protected void closeDoor(int doorId, int instanceId)343 protected void closeDoor(int doorId, int instanceId) 340 344 { 341 345 for (L2DoorInstance door : InstanceManager.getInstance().getInstance(instanceId).getDoors()) … … 352 356 if (party == null) 353 357 { 354 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER));358 player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER); 355 359 return false; 356 360 } 357 361 if (party.getLeader() != player) 358 362 { 359 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER));363 player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER); 360 364 return false; 361 365 } … … 403 407 if (party == null) 404 408 { 405 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER));409 player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER); 406 410 return false; 407 411 } 408 412 if (party.getLeader() != player) 409 413 { 410 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER));414 player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER); 411 415 return false; 412 416 } … … 437 441 if (party == null) 438 442 { 439 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.NOT_IN_PARTY_CANT_ENTER));443 player.sendPacket(SystemMessageId.NOT_IN_PARTY_CANT_ENTER); 440 444 return false; 441 445 } 442 446 if (party.getLeader() != player) 443 447 { 444 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER));448 player.sendPacket(SystemMessageId.ONLY_PARTY_LEADER_CAN_ENTER); 445 449 return false; 446 450 } … … 526 530 protected int enterInstance(L2PcInstance player, String template, teleCoord teleto) 527 531 { 528 // check for existing instances for this player532 // check for existing instances for this player 529 533 InstanceWorld world = InstanceManager.getInstance().getPlayerWorld(player); 530 // existing instance534 // existing instance 531 535 if (world != null) 532 536 { 533 537 if (!(world instanceof CCWorld)) 534 538 { 535 player.sendPacket(SystemMessage .getSystemMessage(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER));539 player.sendPacket(SystemMessageId.ALREADY_ENTERED_ANOTHER_INSTANCE_CANT_ENTER); 536 540 return 0; 537 541 } 538 542 teleto.instanceId = world.instanceId; 539 teleportplayer(player, teleto);543 teleportplayer(player, teleto); 540 544 return world.instanceId; 541 545 } 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 } 543 568 else 544 569 { 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; 577 579 } 578 580 … … 608 610 world.status = 0; 609 611 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)); 611 613 } 612 614 … … 632 634 for (int[] spawn : SPAWNS) 633 635 { 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); 635 637 world.npcList1.put(mob, false); 636 638 } … … 641 643 world.status = 2; 642 644 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)); 645 647 646 648 for (int[] spawn : FIRST_SPAWNS) 647 649 { 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); 649 651 } 650 652 } … … 654 656 world.status = 3; 655 657 656 Map<L2Npc, Boolean> spawnList = new FastMap<L2Npc, Boolean>();658 Map<L2Npc, Boolean> spawnList = new FastMap<L2Npc, Boolean>(); 657 659 for (int[] spawn : EMERALD_SPAWNS) 658 660 { 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); 660 662 spawnList.put(mob, false); 661 663 } … … 665 667 protected void runEmeraldRooms(CCWorld world, int[][] spawnList, int room) 666 668 { 667 Map<L2Npc, Boolean> spawned = new FastMap<L2Npc, Boolean>();669 Map<L2Npc, Boolean> spawned = new FastMap<L2Npc, Boolean>(); 668 670 for (int[] spawn : spawnList) 669 671 { 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); 671 673 spawned.put(mob, false); 672 674 } 673 675 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); 675 677 world.npcList2.put(room, spawned); 676 world.roomsStatus[room -1] = 1;678 world.roomsStatus[room - 1] = 1; 677 679 } 678 680 … … 681 683 world.status = 9; 682 684 683 addSpawn(DARNEL, 152759, 145949, -12588, 21592, false, 0,false,world.instanceId);685 addSpawn(DARNEL, 152759, 145949, -12588, 21592, false, 0, false, world.instanceId); 684 686 // TODO: missing traps 685 openDoor(24220005, world.instanceId);686 openDoor(24220006, world.instanceId);687 openDoor(24220005, world.instanceId); 688 openDoor(24220006, world.instanceId); 687 689 } 688 690 … … 691 693 world.status = status; 692 694 693 Map<L2Npc, Boolean> spawned = new FastMap<L2Npc, Boolean>();695 Map<L2Npc, Boolean> spawned = new FastMap<L2Npc, Boolean>(); 694 696 for (int[] spawn : spawnList) 695 697 { 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); 697 699 spawned.put(mob, false); 698 700 } … … 703 705 { 704 706 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); 708 710 } 709 711 } … … 713 715 if (world.npcList2.get(room).containsKey(mob)) 714 716 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()) 716 718 if (!isDead) 717 719 return false; … … 719 721 } 720 722 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 */ 738 729 739 730 @Override … … 783 774 QuestState st = player.getQuestState("131_BirdInACage"); 784 775 String htmltext = "32279.htm"; 785 if (st != null && st.getState() != State.COMPLETED)776 if (st != null && !st.isCompleted()) 786 777 htmltext = "32279-01.htm"; 787 778 return htmltext; … … 789 780 else if (npc.getNpcId() == CRYSTAL_GOLEM) 790 781 player.sendPacket(ActionFailed.STATIC_PACKET); 791 return "";782 return ""; 792 783 } 793 784 794 785 @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) 796 787 { 797 788 798 789 boolean doReturn = true; 799 for (L2Object obj: targets)790 for (L2Object obj : targets) 800 791 if (obj == npc) 801 792 doReturn = false; … … 803 794 return super.onSkillSee(npc, caster, skill, targets, isPet); 804 795 805 switch (skill.getId())796 switch (skill.getId()) 806 797 { 807 798 case 1011: … … 826 817 if (tmpworld instanceof CCWorld && Rnd.get(100) < 15) 827 818 { 828 for (L2Npc oracle : ((CCWorld) tmpworld).oracles.keySet())819 for (L2Npc oracle : ((CCWorld) tmpworld).oracles.keySet()) 829 820 if (oracle != npc) 830 821 oracle.decayMe(); … … 888 879 889 880 @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) 891 882 { 892 883 if (npc.getNpcId() == TEARS) … … 903 894 tele.y = 172327; 904 895 tele.z = -945; 905 exitInstance(attacker, tele);896 exitInstance(attacker, tele); 906 897 world.allowed.remove(world.allowed.indexOf(attacker.getObjectId())); 907 898 } … … 911 902 { 912 903 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)) 919 905 notAOE = false; 920 906 if (notAOE) … … 942 928 for (int i = 0; i < 10; i++) 943 929 { 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()); 945 931 copy.setRunning(); 946 932 ((L2Attackable) copy).addDamageHate(target, 0, 99999); … … 976 962 977 963 @Override 978 public String onAdvEvent (String event, L2Npc npc, L2PcInstance player)964 public String onAdvEvent(String event, L2Npc npc, L2PcInstance player) 979 965 { 980 966 InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId()); … … 990 976 tele.y = 173078; 991 977 tele.z = -5014; 992 exitInstance(player, tele);978 exitInstance(player, tele); 993 979 } 994 980 else if (event.equalsIgnoreCase("TeleportParme")) … … 999 985 tele.z = -9750; 1000 986 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")) 1004 990 { 1005 991 teleto.x = 144653; … … 1008 994 if (player.getInstanceId() == world.instanceId) 1009 995 { 1010 teleportplayer(player, teleto);996 teleportplayer(player, teleto); 1011 997 player.stopSkillEffects(5239); 1012 998 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")) 1017 1003 { 1018 1004 InstanceManager.getInstance().getInstance(world.instanceId).removeNpcs(); 1019 1005 world.npcList2.clear(); 1020 1006 runSteamRooms(world, STEAM1_SPAWNS, 22); 1021 startQuestTimer("Timer21", 300000,npc,null);1007 startQuestTimer("Timer21", 300000, npc, null); 1022 1008 } 1023 1009 … … 1028 1014 startQuestTimer("spawnGuards", SPAWN[0], npc, null); 1029 1015 cancelQuestTimers("checkKechiAttack"); 1030 closeDoor(DOOR4, npc.getInstanceId());1031 closeDoor(DOOR3, npc.getInstanceId());1016 closeDoor(DOOR4, npc.getInstanceId()); 1017 closeDoor(DOOR3, npc.getInstanceId()); 1032 1018 } 1033 1019 else … … 1037 1023 { 1038 1024 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)); 1048 1034 if (world.kechisHenchmanSpawn <= 5) 1049 1035 startQuestTimer("spawnGuards", SPAWN[world.kechisHenchmanSpawn], npc, null); … … 1054 1040 { 1055 1041 runEmerald(world); 1056 for (L2Npc oracle: world.oracle)1042 for (L2Npc oracle : world.oracle) 1057 1043 oracle.decayMe(); 1058 1044 } … … 1060 1046 { 1061 1047 runCoral(world); 1062 for (L2Npc oracle: world.oracle)1048 for (L2Npc oracle : world.oracle) 1063 1049 oracle.decayMe(); 1064 1050 } 1065 1051 else if (event.equalsIgnoreCase("spawn_oracle")) 1066 1052 { 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 Chest1069 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); 1070 1056 this.cancelQuestTimer("baylor_despawn", npc, null); 1071 1057 this.cancelQuestTimers("baylor_skill"); … … 1074 1060 { 1075 1061 npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); 1076 npc.broadcast Packet(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); 1079 1065 } 1080 1066 else if (event.equalsIgnoreCase("baylorCamera0")) 1081 1067 { 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)); 1083 1069 } 1084 1070 else if (event.equalsIgnoreCase("baylorEffect1")) 1085 1071 { 1086 npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 300,0,120,2000,5000,0,0,1,0));1087 npc.broadcast Packet(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); 1089 1075 } 1090 1076 else if (event.equalsIgnoreCase("baylorEffect2")) 1091 1077 { 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)); 1093 1079 npc.broadcastPacket(new MagicSkillUse(npc, npc, 5402, 1, 2000, 0)); 1094 startQuestTimer("RaidStart", 2000, npc, null);1080 startQuestTimer("RaidStart", 2000, npc, null); 1095 1081 } 1096 1082 else if (event.equalsIgnoreCase("BaylorMinions")) 1097 1083 { 1098 for (int i = 0; i < 10; i++)1084 for (int i = 0; i < 10; i++) 1099 1085 { 1100 1086 int radius = 300; 1101 1087 int x = (int) (radius * Math.cos(i * 0.618)); 1102 1088 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); 1104 1090 mob.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE); 1105 1091 world._animationMobs.add(mob); 1106 1092 } 1107 startQuestTimer("baylorEffect0", 200, npc, null);1093 startQuestTimer("baylorEffect0", 200, npc, null); 1108 1094 } 1109 1095 else if (event.equalsIgnoreCase("RaidStart")) … … 1112 1098 world._camera = null; 1113 1099 npc.setIsParalyzed(false); 1114 for (L2PcInstance p : world._raiders)1100 for (L2PcInstance p : world._raiders) 1115 1101 { 1116 1102 p.setIsParalyzed(false); … … 1120 1106 } 1121 1107 world._raidStatus = 0; 1122 for (L2Npc mob : world._animationMobs)1108 for (L2Npc mob : world._animationMobs) 1123 1109 { 1124 1110 mob.doDie(mob); 1125 1111 } 1126 1112 world._animationMobs.clear(); 1127 startQuestTimer("baylor_despawn", 60000, npc, null, true);1113 startQuestTimer("baylor_despawn", 60000, npc, null, true); 1128 1114 startQuestTimer("checkBaylorAttack", 1000, npc, null); 1129 1115 } … … 1133 1119 { 1134 1120 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); 1137 1123 world._raidStatus++; 1138 1124 } … … 1147 1133 npc.addSkill(SkillTable.getInstance().getInfo(5244, 1)); 1148 1134 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); 1150 1136 world._alarm.disableCoreAI(true); 1151 1137 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)); 1153 1139 } 1154 1140 } … … 1170 1156 { 1171 1157 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)); 1173 1159 } 1174 1160 else if (rand < 10 || nowHp < maxHp * 0.15) 1175 1161 { 1176 1162 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); 1179 1165 } 1180 1166 } … … 1196 1182 else if (event.equalsIgnoreCase("Baylor")) 1197 1183 { 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); 1199 1185 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); 1203 1189 } 1204 1190 else if (!event.endsWith("Food")) … … 1208 1194 if (!world.crystalGolems.containsKey(npc)) 1209 1195 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) 1212 1197 return ""; 1213 1198 CrystalGolem cryGolem = world.crystalGolems.get(npc); … … 1215 1200 for (L2Object object : L2World.getInstance().getVisibleObjects(npc, 300)) 1216 1201 { 1217 if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId()== CRYSTALFOOD)1202 if (object instanceof L2ItemInstance && ((L2ItemInstance) object).getItemId() == CRYSTALFOOD) 1218 1203 crystals.add(object); 1219 1204 } … … 1227 1212 { 1228 1213 minDist = d; 1229 cryGolem.foodItem = (L2ItemInstance) crystal;1214 cryGolem.foodItem = (L2ItemInstance) crystal; 1230 1215 } 1231 1216 } 1232 1217 if (minDist != 300000) 1233 startQuestTimer("getFood", 2000,npc,null);1218 startQuestTimer("getFood", 2000, npc, null); 1234 1219 else 1235 1220 { 1236 1221 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); 1239 1224 } 1240 1225 return ""; … … 1249 1234 npc.getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE, null); 1250 1235 world.crystalGolems.get(npc).foodItem = null; 1251 startQuestTimer("autoFood", 2000,npc,null);1236 startQuestTimer("autoFood", 2000, npc, null); 1252 1237 } 1253 1238 } … … 1283 1268 if (world.correctGolems >= 2) 1284 1269 { 1285 openDoor(24220026, world.instanceId);1270 openDoor(24220026, world.instanceId); 1286 1271 world.status = 4; 1287 1272 } 1288 1273 } 1289 1274 else 1290 startQuestTimer("autoFood", 2000,npc,null);1275 startQuestTimer("autoFood", 2000, npc, null); 1291 1276 cancelQuestTimers("reachFood"); 1292 1277 } … … 1308 1293 private void giveRewards(L2PcInstance player, int instanceId, int bossCry, boolean isBaylor) 1309 1294 { 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); 1311 1296 1312 1297 L2Party party = player.getParty(); … … 1319 1304 if (st == null) 1320 1305 st = newQuestState(partyMember); 1321 if (!isBaylor && st. getQuestItemsCount(CONT_CRYSTAL) > 0)1306 if (!isBaylor && st.hasQuestItems(CONT_CRYSTAL)) 1322 1307 { 1323 1308 st.takeItems(CONT_CRYSTAL, 1); … … 1335 1320 if (st == null) 1336 1321 st = newQuestState(player); 1337 if (!isBaylor && st. getQuestItemsCount(CONT_CRYSTAL) > 0)1322 if (!isBaylor && st.hasQuestItems(CONT_CRYSTAL)) 1338 1323 { 1339 1324 st.takeItems(CONT_CRYSTAL, 1); … … 1349 1334 1350 1335 @Override 1351 public String onKill( L2Npc npc, L2PcInstance player, boolean isPet)1336 public String onKill(L2Npc npc, L2PcInstance player, boolean isPet) 1352 1337 { 1353 1338 InstanceWorld tmpworld = InstanceManager.getInstance().getWorld(npc.getInstanceId()); … … 1362 1347 return ""; 1363 1348 world.status = 3; 1364 world.tears = addSpawn(TEARS, 144298,154420,-11854,32767,false,0,false,world.instanceId); // Tears1349 world.tears = addSpawn(TEARS, 144298, 154420, -11854, 32767, false, 0, false, world.instanceId); // Tears 1365 1350 CrystalGolem crygolem1 = new CrystalGolem(); 1366 1351 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); 1369 1354 for (L2Npc crygolem : world.crystalGolems.keySet()) 1370 startQuestTimer("autoFood", 2000,crygolem,null);1355 startQuestTimer("autoFood", 2000, crygolem, null); 1371 1356 } 1372 1357 else if (world.status == 4 && npc.getNpcId() == TEARS) 1373 1358 { 1374 1359 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); 1376 1361 giveRewards(player, npc.getInstanceId(), BOSS_CRYSTAL_3, false); 1377 1362 } … … 1380 1365 if (npc.getNpcId() == GK1) 1381 1366 { 1382 ((L2MonsterInstance) npc).dropItem(player, 9698, 1);1367 ((L2MonsterInstance) npc).dropItem(player, 9698, 1); 1383 1368 runEmeraldSquare(world); 1384 1369 } 1385 1370 else if (npc.getNpcId() == GK2) 1386 1371 { 1387 ((L2MonsterInstance) npc).dropItem(player, 9699, 1);1372 ((L2MonsterInstance) npc).dropItem(player, 9699, 1); 1388 1373 runSteamRooms(world, STEAM1_SPAWNS, 22); 1389 1374 L2Party party = player.getParty(); 1390 1375 if (party != null) 1391 for (L2PcInstance partyMember : party.getPartyMembers())1376 for (L2PcInstance partyMember : party.getPartyMembers()) 1392 1377 { 1393 1378 if (partyMember.getInstanceId() == world.instanceId) 1394 1379 { 1395 1380 SkillTable.getInstance().getInfo(5239, 1).getEffects(partyMember, partyMember); 1396 startQuestTimer("Timer2", 300000,npc,partyMember);1381 startQuestTimer("Timer2", 300000, npc, partyMember); 1397 1382 } 1398 1383 } … … 1400 1385 { 1401 1386 SkillTable.getInstance().getInfo(5239, 1).getEffects(player, player); 1402 startQuestTimer("Timer2", 300000,npc,player);1387 startQuestTimer("Timer2", 300000, npc, player); 1403 1388 } 1404 startQuestTimer("Timer21", 300000,npc,null);1389 startQuestTimer("Timer21", 300000, npc, null); 1405 1390 } 1406 1391 for (L2Npc gk : world.keyKeepers) … … 1410 1395 else if (world.status == 3) 1411 1396 { 1412 if (checkKillProgress(0, npc,world))1397 if (checkKillProgress(0, npc, world)) 1413 1398 { 1414 1399 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); 1416 1401 } 1417 1402 else … … 1423 1408 { 1424 1409 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); 1426 1411 } 1427 1412 } … … 1431 1416 { 1432 1417 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); 1434 1419 } 1435 1420 } … … 1439 1424 { 1440 1425 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); 1442 1427 } 1443 1428 } … … 1453 1438 else if (world.status == 8) 1454 1439 { 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)) 1458 1443 { 1459 1444 world.roomsStatus[i] = 2; … … 1471 1456 if (npc.getNpcId() == 22416) 1472 1457 { 1473 for (L2Npc oracle:world.oracles.keySet())1458 for (L2Npc oracle : world.oracles.keySet()) 1474 1459 if (world.oracles.get(oracle) == npc) 1475 1460 world.oracles.put(oracle, null); … … 1479 1464 world.npcList2.clear(); 1480 1465 int[][] oracleOrder; 1481 switch (world.status)1466 switch (world.status) 1482 1467 { 1483 1468 case 22: 1484 closeDoor(DOOR6, npc.getInstanceId());1469 closeDoor(DOOR6, npc.getInstanceId()); 1485 1470 oracleOrder = ordreOracle1; 1486 1471 break; … … 1495 1480 L2Party party = player.getParty(); 1496 1481 if (party != null) 1497 for (L2PcInstance partyMember : party.getPartyMembers())1482 for (L2PcInstance partyMember : party.getPartyMembers()) 1498 1483 partyMember.stopSkillEffects(5239); 1499 1484 cancelQuestTimers("Timer5"); 1500 1485 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); 1504 1489 startQuestTimer("checkKechiAttack", 1000, kechi, null); 1505 1490 return ""; … … 1519 1504 bossCry = BOSS_CRYSTAL_2; 1520 1505 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); 1522 1507 } 1523 1508 else if (npc.getNpcId() == DARNEL) 1524 1509 { 1525 1510 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); 1527 1512 } 1528 1513 else … … 1539 1524 world._alarm = null; 1540 1525 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); 1542 1527 } 1543 1528 else if (npc.getNpcId() == BAYLOR) … … 1556 1541 1557 1542 @Override 1558 public String onTalk (L2Npc npc, L2PcInstance player)1543 public String onTalk(L2Npc npc, L2PcInstance player) 1559 1544 { 1560 1545 int npcId = npc.getNpcId(); … … 1585 1570 L2Party party = player.getParty(); 1586 1571 doTeleport = true; 1587 switch (npc.getNpcId())1572 switch (npc.getNpcId()) 1588 1573 { 1589 1574 case 32275: … … 1596 1581 cancelQuestTimers("Timer21"); 1597 1582 if (party != null) 1598 for (L2PcInstance partyMember : party.getPartyMembers())1583 for (L2PcInstance partyMember : party.getPartyMembers()) 1599 1584 { 1600 1585 if (partyMember.getInstanceId() == world.instanceId) … … 1602 1587 partyMember.stopSkillEffects(5239); 1603 1588 SkillTable.getInstance().getInfo(5239, 2).getEffects(partyMember, partyMember); 1604 startQuestTimer("Timer3", 600000,npc,partyMember);1589 startQuestTimer("Timer3", 600000, npc, partyMember); 1605 1590 } 1606 1591 } … … 1609 1594 player.stopSkillEffects(5239); 1610 1595 SkillTable.getInstance().getInfo(5239, 2).getEffects(player, player); 1611 startQuestTimer("Timer3", 600000,npc,player);1596 startQuestTimer("Timer3", 600000, npc, player); 1612 1597 } 1613 startQuestTimer("Timer31", 600000,npc,null);1598 startQuestTimer("Timer31", 600000, npc, null); 1614 1599 break; 1615 1600 case 32276: … … 1622 1607 cancelQuestTimers("Timer31"); 1623 1608 if (party != null) 1624 for (L2PcInstance partyMember : party.getPartyMembers())1609 for (L2PcInstance partyMember : party.getPartyMembers()) 1625 1610 { 1626 1611 if (partyMember.getInstanceId() == world.instanceId) … … 1628 1613 partyMember.stopSkillEffects(5239); 1629 1614 SkillTable.getInstance().getInfo(5239, 4).getEffects(partyMember, partyMember); 1630 startQuestTimer("Timer4", 1200000,npc,partyMember);1615 startQuestTimer("Timer4", 1200000, npc, partyMember); 1631 1616 } 1632 1617 } … … 1635 1620 player.stopSkillEffects(5239); 1636 1621 SkillTable.getInstance().getInfo(5239, 4).getEffects(player, player); 1637 startQuestTimer("Timer4", 1200000,npc,player);1622 startQuestTimer("Timer4", 1200000, npc, player); 1638 1623 } 1639 startQuestTimer("Timer41", 1200000,npc,null);1624 startQuestTimer("Timer41", 1200000, npc, null); 1640 1625 break; 1641 1626 case 32277: … … 1648 1633 cancelQuestTimers("Timer41"); 1649 1634 if (party != null) 1650 for (L2PcInstance partyMember : party.getPartyMembers())1635 for (L2PcInstance partyMember : party.getPartyMembers()) 1651 1636 { 1652 1637 if (partyMember.getInstanceId() == world.instanceId) … … 1654 1639 partyMember.stopSkillEffects(5239); 1655 1640 SkillTable.getInstance().getInfo(5239, 3).getEffects(partyMember, partyMember); 1656 startQuestTimer("Timer5", 900000,npc,partyMember);1641 startQuestTimer("Timer5", 900000, npc, partyMember); 1657 1642 } 1658 1643 } … … 1661 1646 player.stopSkillEffects(5239); 1662 1647 SkillTable.getInstance().getInfo(5239, 3).getEffects(player, player); 1663 startQuestTimer("Timer5", 900000,npc,player);1648 startQuestTimer("Timer5", 900000, npc, player); 1664 1649 } 1665 startQuestTimer("Timer51", 900000,npc,null);1650 startQuestTimer("Timer51", 900000, npc, null); 1666 1651 break; 1667 1652 default: … … 1674 1659 return ""; 1675 1660 else if (player.getParty() != null) 1676 for (L2PcInstance partyMember : party.getPartyMembers())1661 for (L2PcInstance partyMember : party.getPartyMembers()) 1677 1662 { 1678 1663 partyMember.destroyItemByItemId("Quest", RED_CORAL, 1, player, true); 1679 teleportplayer(partyMember, teleto);1664 teleportplayer(partyMember, teleto); 1680 1665 } 1681 1666 else 1682 1667 { 1683 teleportplayer(player, teleto);1668 teleportplayer(player, teleto); 1684 1669 } 1685 1670 } … … 1697 1682 for (L2PcInstance partyMember : party.getPartyMembers()) 1698 1683 { 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. 1701 1686 world._raiders.add(partyMember); 1702 1687 } … … 1713 1698 int i = 0; 1714 1699 int members = world._raiders.size(); 1715 for (L2PcInstance p : world._raiders)1700 for (L2PcInstance p : world._raiders) 1716 1701 { 1717 1702 int x = (int) (radius * Math.cos(i * 2 * Math.PI / members)); … … 1736 1721 teleto.y = 144212; 1737 1722 teleto.z = -9747; 1738 teleportplayer(player, teleto);1723 teleportplayer(player, teleto); 1739 1724 } 1740 1725 } … … 1749 1734 { 1750 1735 CCWorld world = (CCWorld) tmpworld; 1751 switch (action)1736 switch (action) 1752 1737 { 1753 1738 case TRAP_DISARMED: … … 1776 1761 int room; 1777 1762 int[][] spawns; 1778 switch (zone.getId())1763 switch (zone.getId()) 1779 1764 { 1780 1765 case 20105: … … 1791 1776 break; 1792 1777 default: 1793 return super.onEnterZone(character, zone);1778 return super.onEnterZone(character, zone); 1794 1779 } 1795 1780 for (L2DoorInstance door : InstanceManager.getInstance().getInstance(world.instanceId).getDoors()) … … 1797 1782 { 1798 1783 if (door.getOpen()) 1784 { 1799 1785 return ""; 1800 else1801 {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);1812 1786 } 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); 1813 1797 break; 1814 1798 } … … 1816 1800 } 1817 1801 } 1818 return super.onEnterZone(character, zone);1802 return super.onEnterZone(character, zone); 1819 1803 } 1820 1804 … … 1831 1815 { 1832 1816 int doorId; 1833 switch (zone.getId())1817 switch (zone.getId()) 1834 1818 { 1835 1819 case 20105: … … 1843 1827 break; 1844 1828 default: 1845 return super.onExitZone(character, zone);1829 return super.onExitZone(character, zone); 1846 1830 } 1847 1831 for (L2DoorInstance door : InstanceManager.getInstance().getInstance(world.instanceId).getDoors()) … … 1859 1843 } 1860 1844 } 1861 return super.onExitZone(character, zone);1845 return super.onExitZone(character, zone); 1862 1846 } 1863 1847 … … 1889 1873 addSpellFinishedId(BAYLOR); 1890 1874 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) 1893 1880 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) 1896 1886 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) 1899 1892 addSkillSeeId(npc); 1900 for (int mob : MOBLIST)1893 for (int mob : MOBLIST) 1901 1894 addKillId(mob); 1902 1895 for (int mob : CGMOBS) … … 1912 1905 { 1913 1906 // now call the constructor (starts up the) 1914 new CrystalCaverns(-1, qn,"instances");1907 new CrystalCaverns(-1, qn, "instances"); 1915 1908 } 1916 1909 }
Note: See TracChangeset
for help on using the changeset viewer.
