Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/model/actor/Player.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/Player.java (revision 3)
- +++ java/net/sf/l2j/gameserver/model/actor/Player.java (working copy)
- import net.sf.l2j.gameserver.data.xml.RecipeData;
- import net.sf.l2j.gameserver.data.xml.ScriptData;
- +import net.sf.l2j.gameserver.data.xml.SpreeKillsData;
- +import net.sf.l2j.gameserver.data.xml.SpreeKillsData.SpreeKills;
- import net.sf.l2j.gameserver.enums.AiEventType;
- import net.sf.l2j.gameserver.enums.CabalType;
- import net.sf.l2j.gameserver.enums.GaugeColor;
- @@ -313,6 +334,7 @@
- private byte _pvpFlag;
- private byte _siegeState;
- private int _curWeightPenalty;
- + private int _spreeKills;
- private int _lastCompassZone; // the last compass zone update send to the client
- @@ -3724,7 +3760,29 @@
- {
- // Add PvP point to attacker.
- setPvpKills(getPvpKills() + 1);
- +
- + if (Config.ENABLE_SPREEKILLS)
- + {
- + _spreeKills += 1;
- +
- + for (SpreeKills kills : SpreeKillsData.getInstance().getSpreeKills())
- + {
- + if (kills.getKills() == _spreeKills)
- + {
- + World.announceToOnlinePlayers(getName() + " marcou " + kills.getMsg(), true);
- +
- + if (!kills.getSound().isEmpty())
- + sendPacket(new PlaySound(2, kills.getSound()));
- +
- + if (kills.getItemId() > 0)
- + addItem("Reward", kills.getItemId(), kills.getItemCount(), null, true);
- + }
- + }
- + }
- +
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/data/xml/SpreeKillsData.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/data/xml/SpreeKillsData.java (revision 0)
- +++ java/net/sf/l2j/gameserver/data/xml/SpreeKillsData.java (working copy)
- @@ -0,0 +1,106 @@
- +package net.sf.l2j.gameserver.data.xml;
- +
- +import java.nio.file.Path;
- +import java.util.ArrayList;
- +import java.util.List;
- +import net.sf.l2j.commons.data.xml.IXmlReader;
- +import net.sf.l2j.commons.util.StatsSet;
- +
- +import org.w3c.dom.Document;
- +
- +/**
- + * @author Williams
- + *
- + */
- +public class SpreeKillsData implements IXmlReader
- +{
- + private final List<SpreeKills> _spree = new ArrayList<>();
- +
- + public SpreeKillsData()
- + {
- + load();
- + }
- +
- + public void reload()
- + {
- + _spree.clear();
- + load();
- + }
- +
- + @Override
- + public void load()
- + {
- + parseFile("./data/xml/spreeKills.xml");
- + LOGGER.info("Loaded {} spreeKills data.", _spree.size());
- + }
- +
- + @Override
- + public void parseDocument(Document doc, Path path)
- + {
- + forEach(doc, "list", listNode -> forEach(listNode, "pvp", node ->
- + {
- + final StatsSet set = parseAttributes(node);
- + forEach(node, "SpreeKills", setNode -> set.putAll(parseAttributes(setNode)));
- + _spree.add(new SpreeKills(set));
- + }));
- +
- + }
- +
- + public List<SpreeKills> getSpreeKills()
- + {
- + return _spree;
- + }
- +
- + public class SpreeKills
- + {
- + private final int _kill;
- + private final String _msg;
- + private final String _sound;
- + private final int _itemId;
- + private final int _itemCount;
- +
- + public SpreeKills(StatsSet set)
- + {
- + _kill = set.getInteger("kills");
- + _msg = set.getString("msg");
- + _sound = set.getString("sound");
- + _itemId = set.getInteger("itemId");
- + _itemCount = set.getInteger("itemCount");
- + }
- +
- + public int getKills()
- + {
- + return _kill;
- + }
- +
- + public String getMsg()
- + {
- + return _msg;
- + }
- +
- + public String getSound()
- + {
- + return _sound;
- + }
- +
- + public int getItemId()
- + {
- + return _itemId;
- + }
- +
- + public int getItemCount()
- + {
- + return _itemCount;
- + }
- + }
- +
- + public static SpreeKillsData getInstance()
- + {
- + return SingletonHolder.INSTANCE;
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final SpreeKillsData INSTANCE = new SpreeKillsData();
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/GameServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/GameServer.java (revision 3)
- +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
- @@ -69,6 +74,7 @@
- import net.sf.l2j.gameserver.data.xml.SkillTreeData;
- import net.sf.l2j.gameserver.data.xml.SoulCrystalData;
- import net.sf.l2j.gameserver.data.xml.SpellbookData;
- +import net.sf.l2j.gameserver.data.xml.SpreeKillsData;
- import net.sf.l2j.gameserver.data.xml.StaticObjectData;
- import net.sf.l2j.gameserver.data.xml.SummonItemData;
- import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
- @@ -187,6 +194,11 @@
- PartyMatchWaitingList.getInstance();
- PartyMatchRoomList.getInstance();
- RaidPointManager.getInstance();
- + SpreeKillsData.getInstance();
- +
- StringUtil.printSection("Community server");
- if (Config.ENABLE_COMMUNITY_BOARD) // Forums has to be loaded before clan data
- Index: java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (revision 3)
- +++ java/net/sf/l2j/gameserver/handler/admincommandhandlers/AdminAdmin.java (working copy)
- @@ -15,6 +15,8 @@
- import net.sf.l2j.gameserver.data.xml.AnnouncementData;
- import net.sf.l2j.gameserver.data.xml.DoorData;
- import net.sf.l2j.gameserver.data.xml.PolymorphData;
- +import net.sf.l2j.gameserver.data.xml.PvPData;
- +import net.sf.l2j.gameserver.data.xml.SpreeKillsData;
- import net.sf.l2j.gameserver.data.xml.MultisellData;
- import net.sf.l2j.gameserver.data.xml.NpcData;
- import net.sf.l2j.gameserver.data.xml.TeleportLocationData;
- @@ -233,6 +235,16 @@
- TeleportLocationData.getInstance().reload();
- activeChar.sendMessage("Teleport locations have been reloaded.");
- }
- + else if (type.startsWith("spreekills"))
- + {
- + SpreeKillsData.getInstance().reload();
- + activeChar.sendMessage("SpreeKills have been reloaded.");
- + }
- else if (type.startsWith("zone"))
- {
- ZoneManager.getInstance().reload();
- @@ -242,7 +254,7 @@
- {
- activeChar.sendMessage("Usage : //reload <admin|announcement|config|crest|cw>");
- activeChar.sendMessage("Usage : //reload <door|htm|item|multisell|npc>");
- - activeChar.sendMessage("Usage : //reload <npcwalker|skill|teleport|zone>");
- + activeChar.sendMessage("Usage : //reload <npcwalker|skill|spreekills|teleport|zone>");
- }
- }
- while (st.hasMoreTokens());
- @@ -251,7 +263,7 @@
- {
- activeChar.sendMessage("Usage : //reload <admin|announcement|config|crest|cw>");
- activeChar.sendMessage("Usage : //reload <door|htm|item|multisell|npc>");
- - activeChar.sendMessage("Usage : //reload <npcwalker|skill|teleport|zone>");
- + activeChar.sendMessage("Usage : //reload <npcwalker|skill|spreekills|teleport|zone>");
- }
- }
- return true;
- ### Eclipse Workspace Patch 1.0
- #P aCis_datapack
- Index: data/xml/spreeKills.xml
- ===================================================================
- --- data/xml/spreeKills.xml (revision 0)
- +++ data/xml/spreeKills.xml (working copy)
- @@ -0,0 +1,21 @@
- +<?xml version="1.0" encoding="UTF-8"?>
- +<list>
- + <pvp>
- + <SpreeKills kills="2" msg="Double Kill" sound="doublekill" itemId="0" itemCount="0"/>
- + </pvp>
- + <pvp>
- + <SpreeKills kills="3" msg="Triple Kill" sound="triplekill" itemId="0" itemCount="0"/>
- + </pvp>
- + <pvp>
- + <SpreeKills kills="5" msg="Mega Kill" sound="megakill" itemId="0" itemCount="0"/>
- + </pvp>
- + <pvp>
- + <SpreeKills kills="8" msg="Ultra Kill" sound="ultrakill" itemId="0" itemCount="0"/>
- + </pvp>
- + <pvp>
- + <SpreeKills kills="10" msg="Monster Kill" sound="monsterkill" itemId="0" itemCount="0"/>
- + </pvp>
- + <pvp>
- + <SpreeKills kills="12" msg="Unstoppable Kill" sound="Unstoppable" itemId="9217" itemCount="1"/>
- + </pvp>
- +</list>
- \ No newline at end of file
Add Comment
Please, Sign In to add comment