Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P L2J_DataPack_BETA
- Index: data/scripts/custom/RBinstance/instance.htm
- ===================================================================
- --- data/scripts/custom/RBinstance/instance.htm (revision 0)
- +++ data/scripts/custom/RBinstance/instance.htm (revision 0)
- @@ -0,0 +1,10 @@
- +<html>
- +<body>
- +<center>
- +<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center">
- +<br>
- +<font color=ff3333>Some craps here</font><br>
- +<button value="Enter" action="bypass -h Quest RBinstance enter" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
- +</center>
- +</body>
- +</html>
- \ No newline at end of file
- Index: data/scripts/custom/RBinstance/RBinstance.java
- ===================================================================
- --- data/scripts/custom/RBinstance/RBinstance.java (revision 0)
- +++ data/scripts/custom/RBinstance/RBinstance.java (revision 0)
- @@ -0,0 +1,159 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package custom.RBinstance;
- +
- +import java.util.Map;
- +
- +import javolution.util.FastMap;
- +
- +import com.l2jserver.gameserver.instancemanager.InstanceManager;
- +import com.l2jserver.gameserver.model.actor.L2Npc;
- +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jserver.gameserver.model.quest.Quest;
- +import com.l2jserver.util.Rnd;
- +
- +public class RBinstance extends Quest
- +{
- + private static final int NpcId = 152035;
- + private static final int[] RbId = {
- + 25001,25004,25007,25010,25013,25016,25019,25020,25023,25026,25029,25032,25035,25038,
- + 25041,25044,25047,25050,25051,25054,25057,25060,25063,25064,25067,25070,25073,25076,
- + 25079,25082,25085,25088,25089,25092,25095,25098,25099,25102,25103,25106,25109,25112,
- + 25115,25118,25119,25122,25125,25126,25127,25128,25131,25134,25137,25140,25143,25146,
- + 25149,25152,25155,25158,25159,25162,25163,25166,25169,25170,25173,25176,25179,25182,
- + 25185,25188,25189,25192,25198,25199,25202,25205,25208,25211,25214,25217,25220,25223,
- + 25226,25229,25230,25233,25234,25235,25238,25241,25244,25245,25248,25249,25252,25255,
- + 25256,25259,25260,25263,25266,25269,25272,25273,25276,25277,25280,25281,25282,25283,
- + 25286,25290,25293,25296,25299,25302,25305,25306,25309,25312,25315,25316,25319,25322,
- + 25325,25328,25352,25354,25357,25360,25362,25365,25366,25369,25372,25373,25375,25378,
- + 25380,25383,25385,25388,25391,25392,25394,25395,25398,25401,25404,25407,25410,25412,
- + 25415,25418,25420,25423,25426,25429,25431,25434,25437,25438,25441,25444,25447,25450,
- + 25453,25456,25460,25463,25467,25470,25473,25475,25478,25481,25484,25487,25490,25493,
- + 25496,25498,25501,25504,25506,25509,25512,25514,25523,25524,25527,25528,25531,25532,
- + 25534,25536,25539,25540,25542,25544,25546,25549,25552,25553,25554,25557,25560,25563,
- + 25566,25569,25572,25575,25578,25579,25582,25585,25588,25589,25592,25593,25603,25609,
- + 25610,25611,25612,25616,25617,25618,25619,25620,25621,25622,25643,25644,25645,25646,
- + 25647,25648,25649,25650,25651,25652,25653,25654,25655,25659,25660,25661,25665,25666,
- + 25667,25668,25669,25670,25671,25674,25677,25680,25681,25684,25687,25690,25691,25692,
- + 25693,25694,25695,25696,25697,25698,25699,25700,25701,25703,25709,25710,25713,25714,
- + 25716,29030,29033,29036,29037,29040,29054,29056,29060,29062,29065,29095,29096,29129,
- + 29132,29135,29138,29141,29144,29147
- + };
- + private static final int[][] TELEPORTS =
- + {
- + { -88429, -220629, -7903 },
- + { -82464, -219532, -7899 },
- + { -10700, -174882, -10936 }, // -76280, -185540, -10936
- + { -89683, -213573, -8106 },
- + { -81413, -213568, -8104 },
- + { -10700, -174882, -10936 }, // -76280, -174905, -10936
- + { -89759, -206143, -8120 },
- + { -81415, -206078, -8107 },
- + { -10700, -174882, -10936 },
- + { -56999, -219856, -8117 },
- + { -48794, -220261, -8075 },
- + { -10700, -174882, -10936 },
- + { -56940, -212939, -8072 },
- + { -55566, -206139, -8120 },
- + { -10700, -174882, -10936 },
- + { -49805, -206139, -8117 },
- + { -10700, -174882, -10936 },
- + { -10700, -174882, -10936 },
- + { 22010, -174867, -10904 }
- + };
- + private static final Map<L2PcInstance,Integer> instances = new FastMap<L2PcInstance, Integer>();
- +
- + public RBinstance(int questId, String name, String descr)
- + {
- + super(questId, name, descr);
- + addFirstTalkId(NpcId);
- + addTalkId(NpcId);
- + addStartNpc(NpcId);
- + for(int id : RbId)
- + addKillId(id);
- + }
- +
- + @Override
- + public String onTalk(L2Npc npc, L2PcInstance player)
- + {
- + return "instance.htm";
- + }
- +
- + @Override
- + public String onFirstTalk(L2Npc npc, L2PcInstance player)
- + {
- + return "instance.htm";
- + }
- +
- + @Override
- + public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- + {
- + if (event.equals("enter"))
- + {
- + if (checkEntryPersmision(player))
- + {
- + enter(player);
- + }
- + else
- + player.sendMessage("You can enter only 5 times per day");
- + }
- + return "";
- + }
- +
- + private void enter(L2PcInstance player)
- + {
- + instances.put(player, InstanceManager.getInstance().createDynamicInstance("coliseum.xml"));
- + InstanceManager.getInstance().getInstance(instances.get(player)).setEmptyDestroyTime(30000);
- + player.setInstanceId(instances.get(player));
- + int teleport = Rnd.get(TELEPORTS.length - 1);
- + player.teleToLocation(TELEPORTS[teleport][0], TELEPORTS[teleport][1], TELEPORTS[teleport][2]);
- + addSpawn(RbId[Rnd.get(RbId.length - 1)], TELEPORTS[teleport][0], TELEPORTS[teleport][1], TELEPORTS[teleport][2], 0, false, 0).setInstanceId(instances.get(player));
- + }
- +
- + private boolean checkEntryPersmision(L2PcInstance player)
- + {
- + return InstanceManager.getInstance().getInstanceTime(player.getObjectId(), 5004) == -1;
- + }
- +
- + @Override
- + public String onKill(L2Npc npc, L2PcInstance killer, boolean isPet)
- + {
- + InstanceManager.getInstance().setInstanceTime(killer.getObjectId(), getInstanceId(killer), System.currentTimeMillis() + (24 * 60 * 60 * 1000));
- + InstanceManager.getInstance().getInstance(instances.get(killer)).setDuration(5*60*1000);
- + return super.onKill(npc, killer, isPet);
- + }
- +
- + private int getInstanceId(L2PcInstance killer)
- + {
- + if (InstanceManager.getInstance().getInstanceTime(killer.getObjectId(), 5000) > -1)
- + if (InstanceManager.getInstance().getInstanceTime(killer.getObjectId(), 5001) > -1)
- + if (InstanceManager.getInstance().getInstanceTime(killer.getObjectId(), 5002) > -1)
- + if (InstanceManager.getInstance().getInstanceTime(killer.getObjectId(), 5003) > -1)
- + return 5004;
- + else
- + return 5003;
- + else
- + return 5002;
- + else
- + return 5001;
- + else
- + return 5000;
- + }
- +
- + public static void main(String[] args)
- + {
- + new RBinstance(-1, "RBinstance", "custom");
- + }
- +}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement