Advertisement
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/Config.java
- ===================================================================
- --- java/net/sf/l2j/Config.java (revision 7)
- +++ java/net/sf/l2j/Config.java (working copy)
- @@ -52,6 +52,7 @@
- public static final String SERVER_FILE = "./config/server.properties";
- public static final String SIEGE_FILE = "./config/siege.properties";
- public static final String EVENTS_FILE_CUSTOM = "./config/customevents.properties";
- + public static final String CLANMANAGER_FILE = "./config/clanmanager.properties";
- // --------------------------------------------------
- // Clans settings
- // --------------------------------------------------
- @@ -250,6 +251,21 @@
- public static int ALT_FISH_CHAMPIONSHIP_REWARD_5;
- // --------------------------------------------------
- + // Clan Manager
- + // --------------------------------------------------
- +
- + public static int STAGE1_CLAN_MEMBERS;
- + public static int STAGE1_CLAN_LEVEL;
- + public static int STAGE1_CLAN_REP;
- + public static int STAGE2_CLAN_MEMBERS_MIN;
- + public static int STAGE2_CLAN_MEMBERS_MAX;
- + public static int STAGE2_CLAN_LEVEL;
- + public static int STAGE2_CLAN_REP;
- + public static int STAGE3_CLAN_MEMBERS_MIN;
- + public static int STAGE3_CLAN_MEMBERS_MAX;
- + public static int STAGE3_CLAN_LEVEL;
- + public static int STAGE3_CLAN_REP;
- + // --------------------------------------------------
- // GeoEngine
- // --------------------------------------------------
- @@ -976,8 +992,25 @@
- ALT_FISH_CHAMPIONSHIP_REWARD_4 = events.getProperty("AltFishChampionshipReward4", 200000);
- ALT_FISH_CHAMPIONSHIP_REWARD_5 = events.getProperty("AltFishChampionshipReward5", 100000);
- }
- -
- /**
- + * Loads Clan Manager settings.
- + */
- + private static final void loadclanmanager()
- + {
- + final ExProperties clanmanager = initProperties(CLANMANAGER_FILE);
- + STAGE1_CLAN_MEMBERS = clanmanager.getProperty("Stage1Members", 1);
- + STAGE1_CLAN_LEVEL = clanmanager.getProperty("Stage1ClanLevel", 1);
- + STAGE1_CLAN_REP = clanmanager.getProperty("Stage1Rep", 1);
- + STAGE2_CLAN_MEMBERS_MIN = clanmanager.getProperty("Stage2MinMembers", 1);
- + STAGE2_CLAN_MEMBERS_MAX = clanmanager.getProperty("Stage2MaxMembers", 1);
- + STAGE2_CLAN_LEVEL = clanmanager.getProperty("Stage2ClanLevel", 1);
- + STAGE2_CLAN_REP = clanmanager.getProperty("Stage2Rep", 1);
- + STAGE3_CLAN_MEMBERS_MIN = clanmanager.getProperty("Stage2MinMembers", 1);
- + STAGE3_CLAN_MEMBERS_MAX = clanmanager.getProperty("Stage2MaxMembers", 1);
- + STAGE3_CLAN_LEVEL = clanmanager.getProperty("Stage3ClanLevel", 1);
- + STAGE3_CLAN_REP = clanmanager.getProperty("Stage3Rep", 1);
- + }
- + /**
- * Loads geoengine settings.
- */
- private static final void loadGeoengine()
- @@ -1489,6 +1522,10 @@
- loadEvents();
- // events custom settings
- loadCustomEvents();
- +
- + // Clan Manager Settings
- + loadclanmanager();
- +
- // geoengine settings
- loadGeoengine();
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2ClanManagerInstance.java (working copy)
- @@ -0,0 +1,160 @@
- +/*
- + * 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 net.sf.l2j.gameserver.model.actor.instance;
- +
- +import java.util.StringTokenizer;
- +
- +import net.sf.l2j.Config;
- +import net.sf.l2j.gameserver.ai.CtrlIntention;
- +import net.sf.l2j.gameserver.cache.HtmCache;
- +import net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
- +import net.sf.l2j.gameserver.network.SystemMessageId;
- +import net.sf.l2j.gameserver.network.clientpackets.Say2;
- +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- +import net.sf.l2j.gameserver.network.serverpackets.CreatureSay;
- +import net.sf.l2j.gameserver.network.serverpackets.EtcStatusUpdate;
- +import net.sf.l2j.gameserver.network.serverpackets.MyTargetSelected;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
- +
- +/**
- + * @author Reborn12
- + */
- +public class L2ClanManagerInstance extends L2NpcInstance
- +{
- + public L2ClanManagerInstance(int objectId, NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- + StringTokenizer st = new StringTokenizer(command, " ");
- + String actualCommand = st.nextToken();
- +
- + if (actualCommand.startsWith("mainHtml"))
- + {
- + showMainHtml(player, "data/html/mods/ClanManager/main.htm");
- + }
- + else if (actualCommand.startsWith("stage1"))
- + {
- + showMainHtml(player, "data/html/mods/ClanManager/stage1.htm");
- + }
- + else if (actualCommand.startsWith("stage2"))
- + {
- + showMainHtml(player, "data/html/mods/ClanManager/stage2.htm");
- + }
- + else if (actualCommand.startsWith("stage3"))
- + {
- + showMainHtml(player, "data/html/mods/ClanManager/stage3.htm");
- + }
- + else if (actualCommand.startsWith("getStage1"))
- + {
- + if (!player.isClanLeader())
- + {
- + player.sendPacket(SystemMessageId.S1_IS_NOT_A_CLAN_LEADER);
- + return;
- + }
- + else if (player.isClanLeader() && player.getClan().getMembersCount() >= Config.STAGE1_CLAN_MEMBERS)
- + {
- + player.getClan().changeLevel(Config.STAGE1_CLAN_LEVEL);
- + player.getClan().addReputationScore(Config.STAGE1_CLAN_REP);
- + for (int i = 370; i <= 391; ++i)
- + {
- + player.getClan().addNewSkill(SkillTable.getInstance().getInfo(i, SkillTable.getInstance().getMaxLevel(i)));
- + }
- + player.sendPacket(new EtcStatusUpdate(player));
- + player.sendMessage("Congrats Stage 1 Completed.Enjoy Your Game");
- + }
- + else
- + player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "Clan Manager", "You Need Min " + Config.STAGE1_CLAN_MEMBERS + " Members."));
- + }
- + else if (actualCommand.equals("getStage2"))
- + {
- + if (!player.isClanLeader())
- + {
- + player.sendPacket(SystemMessageId.S1_IS_NOT_A_CLAN_LEADER);
- + return;
- + }
- + if (player.isClanLeader() && player.getClan().getMembersCount() >= Config.STAGE2_CLAN_MEMBERS_MIN && player.getClan().getMembersCount() == Config.STAGE2_CLAN_MEMBERS_MIN)
- + {
- + player.getClan().changeLevel(Config.STAGE2_CLAN_LEVEL);
- + player.getClan().addReputationScore(Config.STAGE2_CLAN_REP);
- + player.sendPacket(new EtcStatusUpdate(player));
- + player.sendMessage("Congrats Stage 2 Completed.Enjoy Your Game");
- + }
- + else
- + player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "Clan Manager", "You Need Min " + Config.STAGE2_CLAN_MEMBERS_MIN + " And Max " + Config.STAGE2_CLAN_MEMBERS_MAX + " Members."));
- + }
- + else if (actualCommand.equals("getStage3"))
- + {
- + if (!player.isClanLeader())
- + {
- + player.sendPacket(SystemMessageId.S1_IS_NOT_A_CLAN_LEADER);
- + return;
- + }
- + if (player.isClanLeader() && player.getClan().getMembersCount() >= Config.STAGE3_CLAN_MEMBERS_MIN && player.getClan().getMembersCount() == Config.STAGE3_CLAN_MEMBERS_MAX)
- + {
- + player.getClan().changeLevel(Config.STAGE3_CLAN_LEVEL);
- + player.getClan().addReputationScore(Config.STAGE3_CLAN_REP);
- + player.sendPacket(new EtcStatusUpdate(player));
- + player.sendMessage("Congrats Stage 3 Completed.Enjoy Your Game");
- + }
- + else
- + player.sendPacket(new CreatureSay(0, Say2.PARTYROOM_COMMANDER, "Clan Manager", "You Need Min " + Config.STAGE3_CLAN_MEMBERS_MIN + " And Max " + Config.STAGE3_CLAN_MEMBERS_MAX + " Members."));
- + }
- + else
- + super.onBypassFeedback(player, command);
- + }
- +
- + @Override
- + public void onAction(L2PcInstance player)
- + {
- + if (this != player.getTarget())
- + {
- + player.setTarget(this);
- + player.sendPacket(new MyTargetSelected(getObjectId(), player.getLevel() - getLevel()));
- + player.sendPacket(new ValidateLocation(this));
- + }
- + else if (isInsideRadius(player, 100, false, false))
- + {
- + player.setCurrentFolkNPC(this);
- + showMainHtml(player, "data/html/mods/ClanManager/main.htm");
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- + else
- + {
- + player.getAI().setIntention(CtrlIntention.INTERACT, this);
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + }
- + }
- +
- + private void showMainHtml(L2PcInstance player, String file)
- + {
- + String filename = HtmCache.getInstance().getHtm(file);
- + if (filename != null)
- + {
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setHtml(filename);
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + html.replace("%charname%", player.getName());
- + player.sendPacket(html);
- + filename = null;
- + html = null;
- + }
- + }
- +}
- \ No newline at end of file
- Index: config/clanmanager.properties
- ===================================================================
- --- config/clanmanager.properties (revision 0)
- +++ config/clanmanager.properties (working copy)
- @@ -0,0 +1,30 @@
- +#=============================================================
- +# Clans Manager Settings
- +#=============================================================
- +#Stage 1 Settings
- +#Mambers To Get Reward
- +Stage1Members = 15
- +#Clan Level Reward
- +Stage1ClanLevel = 8
- +#Clan Reputation Points Reward
- +Stage1Rep = 30000
- +
- +#Stage 2 Settings
- +#Minimum Members to get Reward
- +Stage2MinMembers = 10
- +#Maximum Members to get Reward
- +Stage2MaxMembers = 15
- +#Clan Level Reward
- +Stage2ClanLevel = 8
- +#Clan Reputation Points Reward
- +Stage2Rep = 20000
- +
- +#Stage 3 Settings
- +#Minimum Members to get Reward
- +Stage3MinMembers = 5
- +#Maximum Members to get Reward
- +Stage3MaxMembers = 10
- +#Clan Level Reward
- +Stage3ClanLevel = 8
- +#Clan Reputation Points Reward
- +Stage3Rep = 15000
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement