Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_datapack
- Index: data/html/mods/clanManager.htm
- ===================================================================
- --- data/html/mods/clanManager.htm (revision 0)
- +++ data/html/mods/clanManager.htm (working copy)
- @@ -0,0 +1,19 @@
- +<html><head><title>Clan Manager</title></head><body>
- +<center>
- +<img src="L2Font-e.replay_logo-e" width=256 height=80>
- +<br>
- +<img src="l2ui_ch3.herotower_deco" width=256 height=32 align=center>
- +<br>
- +</center>
- +<center>
- +<a action="bypass -h npc_%objectId%_clanLevelUp">Increase Clan's Level</a>
- +<a action="bypass -h npc_%objectId%_clanReputationPoints">Increase Clan's Points</a>
- +<a action="bypass -h npc_%objectId%_clanSkills">Learn All Clan Skills</a>
- +<br>
- +</center>
- +<center>
- +<img src="l2ui_ch3.herotower_deco" width=256 height=32 align=center>
- +<br>
- +<font color="FFAA00">by Devlin</font>
- +</center>
- +</body></html>
- \ No newline at end of file
- #P aCis_gameserver
- 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,163 @@
- +/*
- + * 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 net.sf.l2j.gameserver.datatables.SkillTable;
- +import net.sf.l2j.gameserver.model.L2Skill;
- +import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
- +import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
- +import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
- +
- +/**
- + * @author Devlin
- + *
- + */
- +public class L2ClanManagerInstance extends L2NpcInstance
- +{
- + public L2ClanManagerInstance(int objectId, L2NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void showChatWindow(L2PcInstance player, int val)
- + {
- + player.sendPacket(ActionFailed.STATIC_PACKET);
- + String filename = "data/html/mods/clanManager.htm";
- + NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
- + html.setFile(filename);
- + html.replace("%objectId%", String.valueOf(getObjectId()));
- + player.sendPacket(html);
- + }
- +
- + public int itemId = 57;
- + public int itemCountLevelUp = 10000;
- + public int itemCountReputationPoints = 100000;
- + public int itemCountClanSkills = 100000000;
- + public int clanLevel = 1;
- + public int clanReputationScore = 1000;
- +
- + public int[] clanSkills =
- + {
- + 370,
- + 371,
- + 372,
- + 373,
- + 374,
- + 375,
- + 376,
- + 377,
- + 378,
- + 379,
- + 380,
- + 381,
- + 382,
- + 383,
- + 384,
- + 385,
- + 386,
- + 387,
- + 388,
- + 389,
- + 390,
- + 391
- + };
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- + if (command.equals("clanLevelUp"))
- + {
- + if (player.getClan() != null)
- + {
- + player.sendMessage("You don't have a clan.");
- + return;
- + }
- +
- + if (!player.isClanLeader())
- + {
- + player.sendMessage("You aren't the leader of your clan.");
- + return;
- + }
- +
- + if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountLevelUp)
- + {
- + player.sendMessage("You don't have enough items.");
- + return;
- + }
- +
- + player.getClan().changeLevel(player.getClan().getLevel() + clanLevel);
- + player.getClan().broadcastClanStatus();
- + player.getInventory().destroyItemByItemId("Init.", itemId, itemCountLevelUp, player, player);
- + player.sendMessage("Your clan's level has been changed to "+player.getClan().getLevel());
- + }
- +
- + else if (command.equals("clanReputationPoints"))
- + {
- + if (player.getClan() != null)
- + {
- + player.sendMessage("You don't have a clan.");
- + return;
- + }
- +
- + if (!player.isClanLeader())
- + {
- + player.sendMessage("You aren't the leader of your clan.");
- + return;
- + }
- +
- + if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountReputationPoints)
- + {
- + player.sendMessage("You don't have enough items.");
- + return;
- + }
- +
- + player.getClan().addReputationScore(clanReputationScore);
- + player.getClan().broadcastClanStatus();
- + player.getInventory().destroyItemByItemId("Init.", itemId, itemCountReputationPoints, player, player);
- + player.sendMessage("Your clan's reputation score has been changed to "+player.getClan().getReputationScore());
- + }
- +
- + else if (command.equals("clanSkills"))
- + {
- + if (player.getClan() != null)
- + {
- + player.sendMessage("You don't have a clan.");
- + return;
- + }
- +
- + if (!player.isClanLeader())
- + {
- + player.sendMessage("You aren't the leader of your clan.");
- + return;
- + }
- +
- + if (player.getInventory().getItemByItemId(itemId).getCount() > itemCountClanSkills)
- + {
- + player.sendMessage("You don't have enough items.");
- + return;
- + }
- +
- + for (int s : clanSkills)
- + {
- + L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
- + player.getClan().addNewSkill(clanSkill);
- + player.getClan().broadcastClanStatus();
- + player.getInventory().destroyItemByItemId("Init.", itemId, itemCountClanSkills, player, player);
- + player.sendMessage("Your clan has learned all clan skills.");
- + }
- + }
- + }
- +}
- \ No newline at end of file
Advertisement
Add Comment
Please, Sign In to add comment