L2JMobius

Information => Useful Stuff (Free) => Topic started by: Mobius on November 19, 2019, 02:32:41 AM

Title: How to create custom drops by min-max level or monster ids
Post by: Mobius on November 19, 2019, 02:32:41 AM
Here you can see how to create custom drops by min-max level or monster ids.
This is an example of the improved LongTimeEvent system.
Code: [Select]
Index: dist/game/data/scripts/events/CustomDropEvent/CustomDropEvent.java
===================================================================
--- dist/game/data/scripts/events/CustomDropEvent/CustomDropEvent.java (nonexistent)
+++ dist/game/data/scripts/events/CustomDropEvent/CustomDropEvent.java (working copy)
@@ -0,0 +1,30 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * 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 events.CustomDropEvent;
+
+import org.l2jmobius.gameserver.model.quest.LongTimeEvent;
+
+/**
+ * @author Mobius
+ */
+public class CustomDropEvent extends LongTimeEvent
+{
+ public static void main(String[] args)
+ {
+ new CustomDropEvent();
+ }
+}
Index: dist/game/data/scripts/events/CustomDropEvent/config.xml
===================================================================
--- dist/game/data/scripts/events/CustomDropEvent/config.xml (nonexistent)
+++ dist/game/data/scripts/events/CustomDropEvent/config.xml (working copy)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<event name="Custom Drop Event" active="19 11 2019-19 11 2020" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../xsd/eventConfig.xsd">
+ <droplist>
+ <add item="6392" min="1" max="1" chance="5%" minLevel="85" /> <!-- Event - Medal -->
+ <add item="6392" min="2" max="3" chance="50%" minLevel="100" maxLevel="120" /> <!-- Event - Medal -->
+ <add item="6393" min="3" max="5" chance="100%" monsterIds="10001,10002,10003,10004" /> <!-- Event - Glittering Medal -->
+ </droplist>
+</event>
\ No newline at end of file