浏览代码

BETA: Custom events fixes and changes:
* Minor changes/fixes at `AdminEvents`.
* Moved all "eventMods" to custom.events.
* Renamed and reorganized.
* Rewritten "Rabbits" event.
* Fixed issues.
* Reported by: inetwiz, Pandragon, JOJO, thorl2, u3games, TeddyZero, Konstantinos

Zoey76 11 年之前
父节点
当前提交
b9d1940d01
共有 29 个文件被更改,包括 422 次插入414 次删除
  1. 5 5
      L2J_DataPack_BETA/dist/game/data/scripts.cfg
  2. 7 6
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Elpies/Elpies.java
  3. 8 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/900101-1.htm
  4. 6 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/900101.htm
  5. 1 1
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/900102.htm
  6. 277 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/Rabbits.java
  7. 8 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-0.htm
  8. 8 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-1.htm
  9. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-onlist.htm
  10. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-quit.htm
  11. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-signup.htm
  12. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-started-0.htm
  13. 11 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-started-1.htm
  14. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-0.htm
  15. 1 1
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-1.htm
  16. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-notrans.htm
  17. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-winner.htm
  18. 0 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104.htm
  19. 7 6
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/Race.java
  20. 62 0
      L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/admin_menu.htm
  21. 20 20
      L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminEvents.java
  22. 0 7
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/900101-1.htm
  23. 0 6
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/900101.htm
  24. 0 301
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/eventmodRabbits.java
  25. 0 8
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-0.htm
  26. 0 8
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-1.htm
  27. 0 11
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-started-1.htm
  28. 0 33
      L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/admin_menu.htm
  29. 1 1
      L2J_DataPack_BETA/dist/game/data/stats/npcs/custom/custom.xml

+ 5 - 5
L2J_DataPack_BETA/dist/game/data/scripts.cfg

@@ -321,6 +321,11 @@ custom/NpcLocationInfo/NpcLocationInfo.java
 custom/Validators/SkillTransferValidator.java
 custom/Validators/SubClassSkills.java
 
+# Custom Events
+custom/events/Elpies/Elpies.java
+custom/events/Rabbits/Rabbits.java
+custom/events/Race/Race.java
+
 # Vehicles
 vehicles/BoatTalkingGludin.java
 vehicles/BoatGiranTalking.java
@@ -344,11 +349,6 @@ conquerablehalls/FortressOfResistance/FortressOfResistance.java
 conquerablehalls/FortressOfTheDead/FortressOfTheDead.java
 #conquerablehalls/RainbowSpringsChateau/RainbowSpringsChateau.java
 
-# Event Engine
-mods/eventmodElpies/eventmodElpies.java
-mods/eventmodRabbits/eventmodRabbits.java
-mods/eventmodRace/eventmodRace.java
-
 # Events
 events/CharacterBirthday/CharacterBirthday.java
 

+ 7 - 6
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodElpies/eventmodElpies.java → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Elpies/Elpies.java

@@ -16,7 +16,7 @@
  * 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 mods.eventmodElpies;
+package custom.events.Elpies;
 
 import java.util.concurrent.ScheduledFuture;
 
@@ -30,7 +30,7 @@ import com.l2jserver.gameserver.model.actor.instance.L2EventMonsterInstance;
 import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
 import com.l2jserver.gameserver.model.quest.Event;
 
-public final class eventmodElpies extends Event
+public final class Elpies extends Event
 {
 	// NPC
 	private static final int ELPY = 900100;
@@ -67,9 +67,9 @@ public final class eventmodElpies extends Event
 	private static int CURRENT_ELPY_COUNT = 0;
 	private ScheduledFuture<?> _eventTask = null;
 	
-	private eventmodElpies()
+	private Elpies()
 	{
-		super(-1, eventmodElpies.class.getSimpleName(), "mods");
+		super(Elpies.class.getSimpleName(), "custom/events");
 		addSpawnId(ELPY);
 		addKillId(ELPY);
 	}
@@ -81,7 +81,7 @@ public final class eventmodElpies extends Event
 	}
 	
 	@Override
-	public boolean eventStart()
+	public boolean eventStart(L2PcInstance eventMaker)
 	{
 		if (EVENT_ACTIVE)
 		{
@@ -92,6 +92,7 @@ public final class eventmodElpies extends Event
 		if (!Config.CUSTOM_NPC_DATA)
 		{
 			_log.info(getName() + ": Event can't be started because custom NPC table is disabled!");
+			eventMaker.sendMessage("Event " + getName() + " can't be started because custom NPC table is disabled!");
 			return false;
 		}
 		
@@ -245,6 +246,6 @@ public final class eventmodElpies extends Event
 	
 	public static void main(String[] args)
 	{
-		new eventmodElpies();
+		new Elpies();
 	}
 }

+ 8 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/900101-1.htm

@@ -0,0 +1,8 @@
+<html><body>Snowden:<br>
+<br>
+Event Chest's are spawned at Fantasy Isle main square.<br>
+But they are not 'normal' chests. They are invisible...<br>
+So... you must use magic to see that chests!<br>
+While you are transformed into Rabbit use <font color="LEVEL">Magic Eye</font> skill to see if near you are some chests.<br>
+If you see one, target it and use <font color="LEVEL">Rabbit Tornado</font> skill to get reward!
+</body></html>

+ 6 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/900101.htm

@@ -0,0 +1,6 @@
+<html><body>Snowden:<br><br>
+Greetings, brave adventurer of Aden!<br>
+My name is Snow. I can transform you into a Rabbit. That form can be useful for you to get rewards from magic chests...<br>
+<a action="bypass -h Quest Rabbits transform">Transform me into a Rabbit!</a><br><br>
+<a action="bypass -h Quest Rabbits 900101-1.htm">Listen explanations about Event.</a>
+</body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/900102.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/900102.htm

@@ -1,4 +1,4 @@
 <html><body><br><br>
-Only <font color="LEVEL">Rabbit Tornado</font> skill can open chest.<br>
+Only <font color="LEVEL">Rabbit Tornado</font> skill can open a chest.<br>
 Talk with event manager to get transformation into rabbit...
 </body></html>

+ 277 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Rabbits/Rabbits.java

@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2004-2014 L2J DataPack
+ * 
+ * This file is part of L2J DataPack.
+ * 
+ * L2J DataPack 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.
+ * 
+ * L2J DataPack 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.events.Rabbits;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+
+import com.l2jserver.Config;
+import com.l2jserver.gameserver.Announcements;
+import com.l2jserver.gameserver.model.L2Object;
+import com.l2jserver.gameserver.model.actor.L2Npc;
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.holders.SkillHolder;
+import com.l2jserver.gameserver.model.quest.Event;
+import com.l2jserver.gameserver.model.skills.Skill;
+import com.l2jserver.gameserver.util.Util;
+
+/**
+ * Rabbits event.<br>
+ * Chests are hidden at Fantasy Isle and players must use the Rabbit transformation's skills to find and open them.
+ * @author Gnacik, Zoey76
+ */
+public final class Rabbits extends Event
+{
+	// NPCs
+	private static final int NPC_MANAGER = 900101;
+	private static final int CHEST = 900102;
+	// Skills
+	private static final SkillHolder RABBIT_MAGIC_EYE = new SkillHolder(629, 1);
+	private static final SkillHolder RABBIT_TORNADO = new SkillHolder(630, 1);
+	private static final SkillHolder RABBIT_TRANSFORMATION = new SkillHolder(2428, 1);
+	private static final SkillHolder RAID_CURSE = new SkillHolder(4515, 1);
+	// Misc
+	private static final int EVENT_TIME = 10;
+	private static final int TOTAL_CHEST_COUNT = 75;
+	private static final int TRANSFORMATION_ID = 105;
+	private final List<L2Npc> _npcs = new CopyOnWriteArrayList<>();
+	private final List<L2PcInstance> _players = new ArrayList<>();
+	private boolean _isActive = false;
+	
+	/**
+	 * Drop data:<br>
+	 * Higher the chance harder the item.<br>
+	 * ItemId, chance in percent, min amount, max amount
+	 */
+	// @formatter:off
+	private static final int[][] DROPLIST =
+	{
+		{  1540,  80, 10, 15 },	// Quick Healing Potion
+		{  1538,  60,  5, 10 },	// Blessed Scroll of Escape
+		{  3936,  40,  5, 10 },	// Blessed Scroll of Ressurection
+		{  6387,  25,  5, 10 },	// Blessed Scroll of Ressurection Pets
+		{ 22025,  15,  5, 10 },	// Powerful Healing Potion
+		{  6622,  10,  1, 1 },	// Giant's Codex
+		{ 20034,   5,  1, 1 },	// Revita Pop
+		{ 20004,   1,  1, 1 },	// Energy Ginseng
+		{ 20004,   0,  1, 1 }	// Energy Ginseng
+	};
+	// @formatter:on
+	
+	private Rabbits()
+	{
+		super(Rabbits.class.getSimpleName(), "custom/events");
+		addFirstTalkId(NPC_MANAGER, CHEST);
+		addTalkId(NPC_MANAGER);
+		addSkillSeeId(CHEST);
+		addAttackId(CHEST);
+	}
+	
+	@Override
+	public boolean eventStart(L2PcInstance eventMaker)
+	{
+		// Don't start event if its active
+		if (_isActive)
+		{
+			eventMaker.sendMessage("Event " + getName() + " is already started!");
+			return false;
+		}
+		
+		// Check starting conditions
+		if (!Config.CUSTOM_NPC_DATA)
+		{
+			_log.info(getName() + ": Event can't be started, because custom NPCs are disabled!");
+			eventMaker.sendMessage("Event " + getName() + " can't be started because custom NPCs are disabled!");
+			return false;
+		}
+		
+		// Set Event active
+		_isActive = true;
+		
+		// Spawn Manager
+		recordSpawn(_npcs, NPC_MANAGER, -59227, -56939, -2039, 64106, false, 0);
+		// Spawn Chests
+		for (int i = 0; i <= TOTAL_CHEST_COUNT; i++)
+		{
+			recordSpawn(_npcs, CHEST, getRandom(-60653, -58772), getRandom(-55830, -58146), -2030, 0, false, EVENT_TIME * 60000);
+		}
+		
+		// Announce event start
+		Announcements.getInstance().announceToAll("Rabbits Event: Chests spawned!");
+		Announcements.getInstance().announceToAll("Rabbits Event: Go to Fantasy Isle and grab some rewards!");
+		Announcements.getInstance().announceToAll("Rabbits Event: You have " + EVENT_TIME + " minuntes!");
+		Announcements.getInstance().announceToAll("Rabbits Event: After that time all chests will disappear...");
+		// Schedule event end
+		startQuestTimer("END_RABBITS_EVENT", EVENT_TIME * 60000, null, eventMaker);
+		return true;
+	}
+	
+	@Override
+	public boolean eventStop()
+	{
+		// Don't stop inactive event
+		if (!_isActive)
+		{
+			return false;
+		}
+		
+		// Set inactive
+		_isActive = false;
+		
+		// Cancel timer
+		cancelQuestTimers("END_RABBITS_EVENT");
+		
+		// Despawn NPCs
+		for (L2Npc npc : _npcs)
+		{
+			if (npc != null)
+			{
+				npc.deleteMe();
+			}
+		}
+		_npcs.clear();
+		
+		for (L2PcInstance player : _players)
+		{
+			if ((player != null) && (player.getTransformationId() == TRANSFORMATION_ID))
+			{
+				player.untransform();
+			}
+		}
+		_players.clear();
+		
+		// Announce event end
+		Announcements.getInstance().announceToAll("Rabbits Event: Event has finished.");
+		
+		return true;
+	}
+	
+	@Override
+	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
+	{
+		String htmltext = null;
+		switch (event)
+		{
+			case "900101-1.htm":
+			{
+				htmltext = "900101-1.htm";
+				break;
+			}
+			case "transform":
+			{
+				if (player.isTransformed() || player.isInStance())
+				{
+					player.untransform();
+				}
+				
+				RABBIT_TRANSFORMATION.getSkill().applyEffects(npc, player);
+				_players.add(player);
+				break;
+			}
+			case "END_RABBITS_EVENT":
+			{
+				Announcements.getInstance().announceToAll("Rabbits Event: Time up!");
+				eventStop();
+				break;
+			}
+		}
+		return htmltext;
+	}
+	
+	@Override
+	public String onFirstTalk(L2Npc npc, L2PcInstance player)
+	{
+		return npc.getId() + ".htm";
+	}
+	
+	@Override
+	public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
+	{
+		if (skill.getId() == RABBIT_TORNADO.getSkillId())
+		{
+			if (!npc.isInvisible() && Util.contains(targets, npc))
+			{
+				dropItem(npc, caster, DROPLIST);
+				npc.deleteMe();
+				_npcs.remove(npc);
+				
+				if (_npcs.size() <= 1)
+				{
+					Announcements.getInstance().announceToAll("Rabbits Event: No more chests...");
+					eventStop();
+				}
+			}
+		}
+		else if (skill.getId() == RABBIT_MAGIC_EYE.getSkillId())
+		{
+			if (npc.isInvisible() && npc.isInsideRadius(caster, skill.getAffectRange(), false, false))
+			{
+				npc.setInvisible(false);
+			}
+		}
+		return super.onSkillSee(npc, caster, skill, targets, isSummon);
+	}
+	
+	@Override
+	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
+	{
+		if (_isActive && ((skill == null) || (skill.getId() != RABBIT_TORNADO.getSkillId())))
+		{
+			RAID_CURSE.getSkill().applyEffects(npc, attacker);
+		}
+		return super.onAttack(npc, attacker, damage, isSummon);
+	}
+	
+	private static void dropItem(L2Npc npc, L2PcInstance player, int[][] droplist)
+	{
+		final int chance = getRandom(100);
+		for (int[] drop : droplist)
+		{
+			if (chance > drop[1])
+			{
+				npc.dropItem(player, drop[0], getRandom(drop[2], drop[3]));
+				return;
+			}
+		}
+	}
+	
+	private static void recordSpawn(List<L2Npc> npcs, int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
+	{
+		final L2Npc npc = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);
+		if (npc.getId() == CHEST)
+		{
+			npc.setIsImmobilized(true);
+			npc.disableCoreAI(true);
+			npc.setInvisible(true);
+		}
+		npcs.add(npc);
+	}
+	
+	@Override
+	public boolean eventBypass(L2PcInstance activeChar, String bypass)
+	{
+		return false;
+	}
+	
+	public static void main(String[] args)
+	{
+		new Rabbits();
+	}
+}

+ 8 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-0.htm

@@ -0,0 +1,8 @@
+<html><body>
+<center>
+<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
+<font color="ff3333">Race Start NPC</font><br>
+You can signup for race here:<br>
+<button value="Participate in Race" action="bypass -h Quest Race signup" width="180" height="25" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+</center>
+</body></html>

+ 8 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-1.htm

@@ -0,0 +1,8 @@
+<html><body>
+<center>
+<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
+<font color="ff3333">Race Start NPC</font><br>
+You are on list right now..
+<button value="Quit from Race" action="bypass -h Quest Race quit" width="180" height="25" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+</center>
+</body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-onlist.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-onlist.htm


+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-quit.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-quit.htm


+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-signup.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-signup.htm


+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-started-0.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-started-0.htm


+ 11 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900103-started-1.htm

@@ -0,0 +1,11 @@
+<html><body>
+<center>
+<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
+<font color=ff3333>Race Start NPC</font><br>
+Race is started already.. So Hurry up!<br>
+<button value="Transform" action="bypass -h Quest Race transform" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
+<button value="Untransform" action="bypass -h Quest Race untransform" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
+<button value="Show Finish Point" action="bypass -h Quest Race showfinish" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
+<button value="Quit from Race" action="bypass -h Quest eventmodRace quit" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+</center>
+</body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900104-0.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-0.htm


+ 1 - 1
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900104-1.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-1.htm

@@ -3,6 +3,6 @@
 <img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
 <font color=ff3333>Race Finish NPC</font><br>
 Congratz! You are first on Finish line!<br>
-<button value="Finish Race" action="bypass -h Quest eventmodRace finish" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+<button value="Finish Race" action="bypass -h Quest Race finish" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
 </center>
 </body></html>

+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900104-notrans.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-notrans.htm


+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900104-winner.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104-winner.htm


+ 0 - 0
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900104.htm → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/900104.htm


+ 7 - 6
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/eventmodRace.java → L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/Race.java

@@ -16,7 +16,7 @@
  * 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 mods.eventmodRace;
+package custom.events.Race;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -39,7 +39,7 @@ import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage;
 /**
  * @author Gnacik
  */
-public final class eventmodRace extends Event
+public final class Race extends Event
 {
 	// Event NPC's list
 	private List<L2Npc> _npclist;
@@ -101,9 +101,9 @@ public final class eventmodRace extends Event
 	};
 	// @formatter:on
 	
-	private eventmodRace()
+	private Race()
 	{
-		super(-1, eventmodRace.class.getSimpleName(), "mods");
+		super(Race.class.getSimpleName(), "custom/events");
 		addStartNpc(_start_npc);
 		addFirstTalkId(_start_npc);
 		addTalkId(_start_npc);
@@ -113,7 +113,7 @@ public final class eventmodRace extends Event
 	}
 	
 	@Override
-	public boolean eventStart()
+	public boolean eventStart(L2PcInstance eventMaker)
 	{
 		// Don't start event if its active
 		if (_isactive)
@@ -124,6 +124,7 @@ public final class eventmodRace extends Event
 		if (!Config.CUSTOM_NPC_DATA)
 		{
 			_log.info(getName() + ": Event can't be started, because custom npc table is disabled!");
+			eventMaker.sendMessage("Event " + getName() + " can't be started because custom NPC table is disabled!");
 			return false;
 		}
 		// Initialize list
@@ -424,6 +425,6 @@ public final class eventmodRace extends Event
 	
 	public static void main(String[] args)
 	{
-		new eventmodRace();
+		new Race();
 	}
 }

+ 62 - 0
L2J_DataPack_BETA/dist/game/data/scripts/custom/events/Race/admin_menu.htm

@@ -0,0 +1,62 @@
+<html>
+	<title>Event Race Menu</title>
+	<body>
+		<center>
+		<table width="270" border="0" bgcolor="444444">
+			<tr>
+				<td>
+					<button value="Main" action="bypass -h admin_admin" width="65" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+				</td>
+				<td>
+					<button value="Char" action="bypass -h admin_admin6" width="65" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+				</td>
+				<td>
+					<button value="Game" action="bypass -h admin_admin2" width="65" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+				</td>
+				<td>
+					<button value="GM" action="bypass -h admin_admin7" width="65" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+				</td>
+			</tr>
+		</table>
+		<br>
+		<button value="Back" action="bypass -h admin_event_menu" width="60" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+		<font color="LEVEL">Set Transform:</font>
+		<table width="270">
+		<tr>
+			<td>
+				<button value="Frog" action="bypass -h admin_event_bypass Race skill6201" width="80" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+			<td>
+				<button value="Child" action="bypass -h admin_event_bypass Race skill6202" width="80" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+			<td>
+				<button value="Native" action="bypass -h admin_event_bypass Race skill6203" width="80" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+		</tr>
+		<tr>
+			<td>
+				<button value="Horse" action="bypass -h admin_event_bypass Race skill8247" width="80" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+			<td>
+				<button value="Lion" action="bypass -h admin_event_bypass Race skill8262" width="80" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+			<td>
+				<button value="Bike" action="bypass -h admin_event_bypass Race skill21171" width="80" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+		</tr>
+		</table>
+		<br>
+		<font color="LEVEL">Teleports:</font>
+		<table width="270">
+		<tr>
+			<td>
+				<button value="Start Point" action="bypass -h admin_event_bypass Race tele0" width="120" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+			<td>
+				<button value="Finish Point" action="bypass -h admin_event_bypass Race tele1" width="120" height="21" back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
+			</td>
+		</tr>
+		</table>
+		</center>
+	</body>
+</html>

+ 20 - 20
L2J_DataPack_BETA/dist/game/data/scripts/handlers/admincommandhandlers/AdminEvents.java

@@ -54,13 +54,13 @@ public class AdminEvents implements IAdminCommandHandler
 			return false;
 		}
 		
-		String _event_name = "";
+		String event_name = "";
 		String _event_bypass = "";
 		StringTokenizer st = new StringTokenizer(command, " ");
 		st.nextToken();
 		if (st.hasMoreTokens())
 		{
-			_event_name = st.nextToken();
+			event_name = st.nextToken();
 		}
 		if (st.hasMoreTokens())
 		{
@@ -76,18 +76,18 @@ public class AdminEvents implements IAdminCommandHandler
 		{
 			try
 			{
-				if (_event_name != null)
+				if (event_name != null)
 				{
-					Event _event = (Event) QuestManager.getInstance().getQuest(_event_name);
-					if (_event != null)
+					Event event = (Event) QuestManager.getInstance().getQuest(event_name);
+					if (event != null)
 					{
-						if (_event.eventStart())
+						if (event.eventStart(activeChar))
 						{
-							activeChar.sendMessage("Event '" + _event_name + "' started.");
+							activeChar.sendMessage("Event " + event_name + " started.");
 							return true;
 						}
 						
-						activeChar.sendMessage("There is problem with starting '" + _event_name + "' event.");
+						activeChar.sendMessage("There is problem starting " + event_name + " event.");
 						return true;
 					}
 				}
@@ -103,18 +103,18 @@ public class AdminEvents implements IAdminCommandHandler
 		{
 			try
 			{
-				if (_event_name != null)
+				if (event_name != null)
 				{
-					Event _event = (Event) QuestManager.getInstance().getQuest(_event_name);
-					if (_event != null)
+					Event event = (Event) QuestManager.getInstance().getQuest(event_name);
+					if (event != null)
 					{
-						if (_event.eventStop())
+						if (event.eventStop())
 						{
-							activeChar.sendMessage("Event '" + _event_name + "' stopped.");
+							activeChar.sendMessage("Event " + event_name + " stopped.");
 							return true;
 						}
 						
-						activeChar.sendMessage("There is problem with stoping '" + _event_name + "' event.");
+						activeChar.sendMessage("There is problem with stoping " + event_name + " event.");
 						return true;
 					}
 				}
@@ -130,12 +130,12 @@ public class AdminEvents implements IAdminCommandHandler
 		{
 			try
 			{
-				if (_event_name != null)
+				if (event_name != null)
 				{
-					Event _event = (Event) QuestManager.getInstance().getQuest(_event_name);
-					if (_event != null)
+					Event event = (Event) QuestManager.getInstance().getQuest(event_name);
+					if (event != null)
 					{
-						_event.eventBypass(activeChar, _event_bypass);
+						event.eventBypass(activeChar, _event_bypass);
 					}
 				}
 			}
@@ -154,9 +154,9 @@ public class AdminEvents implements IAdminCommandHandler
 		final NpcHtmlMessage html = new NpcHtmlMessage();
 		html.setFile(activeChar.getHtmlPrefix(), "data/html/admin/gm_events.htm");
 		final StringBuilder cList = new StringBuilder(500);
-		for (Quest event : QuestManager.getInstance().getAllManagedScripts())
+		for (Quest event : QuestManager.getInstance().getScripts().values())
 		{
-			if ((event instanceof Event) && event.getName().startsWith("eventmod"))
+			if (event instanceof Event)
 			{
 				StringUtil.append(cList, "<font color=\"LEVEL\">" + event.getName() + ":</font><br1>", "<table width=270><tr>", "<td><button value=\"Start\" action=\"bypass -h admin_event_start_menu " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>", "<td><button value=\"Stop\" action=\"bypass -h admin_event_stop_menu " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>", "<td><button value=\"Menu\" action=\"bypass -h admin_event_bypass " + event.getName() + "\" width=80 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td>", "</tr></table><br>");
 			}

+ 0 - 7
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/900101-1.htm

@@ -1,7 +0,0 @@
-<html><body>Snow:<br><br>
-Event Chest's are spawned at Fantasy Isle main square<br>
-But they are not 'normal' chests. They are invisible...<br>
-So... you must use magic to see that chests<br>
-While you are transformed into Rabbit use <font color="LEVEL">Magic Eye</font> skill to see if near you are some chests.<br>
-If you see it, target it and use <font color="LEVEL">Rabbit Tornado</font> skill to get reward.
-</body></html>

+ 0 - 6
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/900101.htm

@@ -1,6 +0,0 @@
-<html><body>Snow:<br><br>
-Greetings, brave adventurer of Aden!<br>
-My name is Snow. I can transform you into Rabbit. That form can be useful for you to get rewards from magic chests...<br>
-<a action="bypass -h Quest eventmodRabbits transform">Transform into Rabbit</a><br><br>
-<a action="bypass -h Quest eventmodRabbits 900101-1.htm">Listen explanation about Event</a>
-</body></html>

+ 0 - 301
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRabbits/eventmodRabbits.java

@@ -1,301 +0,0 @@
-/*
- * Copyright (C) 2004-2014 L2J DataPack
- * 
- * This file is part of L2J DataPack.
- * 
- * L2J DataPack 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.
- * 
- * L2J DataPack 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 mods.eventmodRabbits;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.ScheduledFuture;
-
-import com.l2jserver.Config;
-import com.l2jserver.gameserver.Announcements;
-import com.l2jserver.gameserver.ThreadPoolManager;
-import com.l2jserver.gameserver.datatables.SkillData;
-import com.l2jserver.gameserver.model.L2Object;
-import com.l2jserver.gameserver.model.actor.L2Npc;
-import com.l2jserver.gameserver.model.actor.instance.L2EventChestInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2EventMonsterInstance;
-import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jserver.gameserver.model.quest.Event;
-import com.l2jserver.gameserver.model.quest.QuestState;
-import com.l2jserver.gameserver.model.skills.Skill;
-import com.l2jserver.gameserver.util.Util;
-
-public final class eventmodRabbits extends Event
-{
-	// Event NPC's list
-	private List<L2Npc> _npclist;
-	// Event Task
-	ScheduledFuture<?> _eventTask = null;
-	// Event time
-	public static final int _event_time = 10;
-	// Event state
-	private static boolean _isactive = false;
-	// Current Chest count
-	private static int _chest_count = 0;
-	// How much Chests
-	private static final int _option_howmuch = 100;
-	// NPc's
-	public static final int _npc_snow = 900101;
-	public static final int _npc_chest = 900102;
-	// Skills
-	public static final int _skill_tornado = 630;
-	public static final int _skill_magic_eye = 629;
-	
-	/**
-	 * Drop data:<br>
-	 * Higher the chance harder the item.<br>
-	 * ItemId, chance in percent, min amount, max amount
-	 */
-	// @formatter:off
-	private static final int[][] DROPLIST =
-	{
-		{  1540,  80, 10, 15 },	// Quick Healing Potion
-		{  1538,  60,  5, 10 },	// Blessed Scroll of Escape
-		{  3936,  40,  5, 10 },	// Blessed Scroll of Ressurection
-		{  6387,  25,  5, 10 },	// Blessed Scroll of Ressurection Pets
-		{ 22025,  15,  5, 10 },	// Powerful Healing Potion
-		{  6622,  10,  1, 1 },	// Giant's Codex
-		{ 20034,   5,  1, 1 },	// Revita Pop
-		{ 20004,   1,  1, 1 },	// Energy Ginseng
-		{ 20004,   0,  1, 1 }	// Energy Ginseng
-	};
-	// @formatter:on
-	
-	private eventmodRabbits()
-	{
-		super(-1, eventmodRabbits.class.getSimpleName(), "mods");
-		addStartNpc(_npc_snow);
-		addFirstTalkId(_npc_snow);
-		addTalkId(_npc_snow);
-		addFirstTalkId(_npc_chest);
-		addSkillSeeId(_npc_chest);
-		addSpawnId(_npc_chest);
-		addAttackId(_npc_chest);
-	}
-	
-	@Override
-	public String onSpawn(L2Npc npc)
-	{
-		((L2EventMonsterInstance) npc).eventSetDropOnGround(true);
-		((L2EventMonsterInstance) npc).eventSetBlockOffensiveSkills(true);
-		
-		npc.setIsImmobilized(true);
-		npc.disableCoreAI(true);
-		
-		return super.onSpawn(npc);
-	}
-	
-	@Override
-	public boolean eventStart()
-	{
-		// Don't start event if its active
-		if (_isactive)
-		{
-			return false;
-		}
-		
-		// Check Custom Table - we use custom NPC's
-		if (!Config.CUSTOM_NPC_DATA)
-		{
-			_log.info(getName() + ": Event can't be started, because custom npc table is disabled!");
-			return false;
-		}
-		
-		// Initialize list
-		_npclist = new ArrayList<>();
-		
-		// Set Event active
-		_isactive = true;
-		
-		// Spawn Manager
-		recordSpawn(_npc_snow, -59227, -56939, -2039, 64106, false, 0);
-		
-		// Spawn Chests
-		for (int i = 0; i < _option_howmuch; i++)
-		{
-			int x = getRandom(-60653, -58772);
-			int y = getRandom(-55830, -57718);
-			recordSpawn(_npc_chest, x, y, -2030, 0, true, _event_time * 60 * 1000);
-			_chest_count++;
-		}
-		
-		// Announce event start
-		Announcements.getInstance().announceToAll("Rabbit Event : Chests spawned!");
-		Announcements.getInstance().announceToAll("Go to Fantasy Isle and grab some rewards!");
-		Announcements.getInstance().announceToAll("You have " + _event_time + " min - after that time all chests will disappear...");
-		
-		// Schedule Event end
-		_eventTask = ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
-		{
-			@Override
-			public void run()
-			{
-				timeUp();
-			}
-		}, _event_time * 60 * 1000);
-		
-		return true;
-	}
-	
-	protected void timeUp()
-	{
-		Announcements.getInstance().announceToAll("Time up !");
-		eventStop();
-	}
-	
-	@Override
-	public boolean eventStop()
-	{
-		// Don't stop inactive event
-		if (!_isactive)
-		{
-			return false;
-		}
-		
-		// Set inactive
-		_isactive = false;
-		
-		// Cancel task if any
-		if (_eventTask != null)
-		{
-			_eventTask.cancel(true);
-			_eventTask = null;
-		}
-		// Despawn NPCs
-		for (L2Npc _npc : _npclist)
-		{
-			if (_npc != null)
-			{
-				_npc.deleteMe();
-			}
-		}
-		_npclist.clear();
-		
-		// Announce event end
-		Announcements.getInstance().announceToAll("Rabbit Event finished");
-		
-		return true;
-	}
-	
-	@Override
-	public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
-	{
-		String htmltext = event;
-		
-		if (event.equalsIgnoreCase("transform"))
-		{
-			if (player.isTransformed() || player.isInStance())
-			{
-				player.untransform();
-			}
-			
-			SkillData.getInstance().getSkill(2428, 1).applyEffects(npc, player);
-			
-			return null;
-		}
-		return htmltext;
-	}
-	
-	@Override
-	public String onFirstTalk(L2Npc npc, L2PcInstance player)
-	{
-		QuestState st = player.getQuestState(getName());
-		if (st == null)
-		{
-			st = newQuestState(player);
-		}
-		return npc.getId() + ".htm";
-	}
-	
-	@Override
-	public String onSkillSee(L2Npc npc, L2PcInstance caster, Skill skill, L2Object[] targets, boolean isSummon)
-	{
-		if (Util.contains(targets, npc))
-		{
-			if (skill.getId() == _skill_tornado)
-			{
-				dropItem(npc, caster, DROPLIST);
-				npc.deleteMe();
-				_chest_count--;
-				
-				if (_chest_count <= 0)
-				{
-					Announcements.getInstance().announceToAll("No more chests...");
-					eventStop();
-				}
-			}
-			else if (skill.getId() == _skill_magic_eye)
-			{
-				if (npc instanceof L2EventChestInstance)
-				{
-					((L2EventChestInstance) npc).trigger();
-				}
-			}
-		}
-		return super.onSkillSee(npc, caster, skill, targets, isSummon);
-	}
-	
-	@Override
-	public String onAttack(L2Npc npc, L2PcInstance attacker, int damage, boolean isSummon, Skill skill)
-	{
-		// Some retards go to event and disturb it by breaking chests
-		// So... Apply raid curse if player don't use skill on chest but attack it
-		if (_isactive && (npc.getId() == _npc_chest))
-		{
-			SkillData.getInstance().getSkill(4515, 1).applyEffects(npc, attacker);
-		}
-		
-		return super.onAttack(npc, attacker, damage, isSummon);
-	}
-	
-	private static final void dropItem(L2Npc mob, L2PcInstance player, int[][] droplist)
-	{
-		final int chance = getRandom(100);
-		
-		for (int[] drop : droplist)
-		{
-			if (chance > drop[1])
-			{
-				mob.dropItem(player, drop[0], getRandom(drop[2], drop[3]));
-				return;
-			}
-		}
-	}
-	
-	private L2Npc recordSpawn(int npcId, int x, int y, int z, int heading, boolean randomOffSet, long despawnDelay)
-	{
-		L2Npc _tmp = addSpawn(npcId, x, y, z, heading, randomOffSet, despawnDelay);
-		if (_tmp != null)
-		{
-			_npclist.add(_tmp);
-		}
-		return _tmp;
-	}
-	
-	@Override
-	public boolean eventBypass(L2PcInstance activeChar, String bypass)
-	{
-		return false;
-	}
-	
-	public static void main(String[] args)
-	{
-		new eventmodRabbits();
-	}
-}

+ 0 - 8
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-0.htm

@@ -1,8 +0,0 @@
-<html><body>
-<center>
-<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
-<font color=ff3333>Race Start NPC</font><br>
-You can signup for race here<br>
-<button value="Participate in Race" action="bypass -h Quest eventmodRace signup" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
-</center>
-</body></html>

+ 0 - 8
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-1.htm

@@ -1,8 +0,0 @@
-<html><body>
-<center>
-<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
-<font color=ff3333>Race Start NPC</font><br>
-You are on list right now..
-<button value="Quit from Race" action="bypass -h Quest eventmodRace quit" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
-</center>
-</body></html>

+ 0 - 11
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/900103-started-1.htm

@@ -1,11 +0,0 @@
-<html><body>
-<center>
-<img src="L2UI_CH3.herotower_deco" height="32" width="256" align="center"><br>
-<font color=ff3333>Race Start NPC</font><br>
-Race is started already.. So Hurry up!<br>
-<button value="Transform" action="bypass -h Quest eventmodRace transform" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
-<button value="unTransform" action="bypass -h Quest eventmodRace untransform" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
-<button value="Show Finish Point" action="bypass -h Quest eventmodRace showfinish" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"><br>
-<button value="Quit from Race" action="bypass -h Quest eventmodRace quit" width=180 height=25 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
-</center>
-</body></html>

+ 0 - 33
L2J_DataPack_BETA/dist/game/data/scripts/mods/eventmodRace/admin_menu.htm

@@ -1,33 +0,0 @@
-<html><title>mod Race Menu</title><body>
-<center>
-<table width=270 border=0 bgcolor="444444">
-<tr>
-<td><button value="Main" action="bypass -h admin_admin" width=65 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Char" action="bypass -h admin_admin6" width=65 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Game" action="bypass -h admin_admin2" width=65 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="GM" action="bypass -h admin_admin7" width=65 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-</tr>
-</table><br>
-<button value="Back" action="bypass -h admin_event_menu" width=60 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df">
-<font color="LEVEL">Set Transform:</font>
-<table width=270>
-<tr>
-<td><button value="Frog" action="bypass -h admin_event_bypass eventmodRace skill6201" width=80 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Child" action="bypass -h admin_event_bypass eventmodRace skill6202" width=80 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Native" action="bypass -h admin_event_bypass eventmodRace skill6203" width=80 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-</tr>
-<tr>
-<td><button value="Horse" action="bypass -h admin_event_bypass eventmodRace skill8247" width=80 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Lion" action="bypass -h admin_event_bypass eventmodRace skill8262" width=80 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Bike" action="bypass -h admin_event_bypass eventmodRace skill21171" width=80 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-</tr>
-</table><br>
-<font color="LEVEL">Teleports:</font>
-<table width=270>
-<tr>
-<td><button value="Start Point" action="bypass -h admin_event_bypass eventmodRace tele0" width=120 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-<td><button value="Finish Point" action="bypass -h admin_event_bypass eventmodRace tele1" width=120 height=21 back="L2UI_ct1.button_df" fore="L2UI_ct1.button_df"></td>
-</tr>
-</table>
-</center>
-</body></html>

+ 1 - 1
L2J_DataPack_BETA/dist/game/data/stats/npcs/custom/custom.xml

@@ -24,7 +24,7 @@
 			<height normal="4.5" />
 		</collision>
 	</npc>
-	<npc id="900101" displayId="32365" name="Snow" title="Event Manager">
+	<npc id="900101" displayId="32365" name="Snowden" title="Event Manager">
 		<collision>
 			<radius normal="5" />
 			<height normal="12.5" />