Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: net.sf.l2j.gameserver.handler.itemhandlers;ClanItem.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler.itemhandlers;ClanItem.java (revision 84)
- +++ net.sf.l2j.gameserver.handler.itemhandlers;ClanItem.java (working copy)
- package net.sf.l2j.gameserver.handler.itemhandlers;
- import net.sf.l2j.Config;
- import net.sf.l2j.gameserver.data.SkillTable;
- import net.sf.l2j.gameserver.handler.IItemHandler;
- import net.sf.l2j.gameserver.skills.L2Skill;
- import net.sf.l2j.gameserver.model.actor.Playable;
- import net.sf.l2j.gameserver.model.actor.Player;
- import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
- public class ClanItem implements IItemHandler
- {
- private final int reputation = 150000;
- private final byte level = 8;
- // id skills
- private final 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 useItem(Playable playable, ItemInstance item, boolean forceUse)
- {
- if (Config.ENABLE_CLAN_ITEM)
- {
- if (!(playable instanceof Player))
- return;
- Player player = (Player) playable;
- if (player.isClanLeader())
- {
- if (player.getClan().getLevel() == 8)
- {
- player.sendMessage("Your clan is already maximum level!");
- return;
- }
- player.getClan().changeLevel(level);
- player.getClan().addReputationScore(reputation);
- for (int s : clanSkills)
- {
- L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
- player.getClan().addClanSkill(clanSkill, forceUse);
- }
- player.sendSkillList();
- player.getClan().updateClanInDB();
- player.sendMessage("Your clan Level/Skills/Reputation has been updated!");
- playable.destroyItem("Consume", Config.CLAN_ITEM_ID, 1, null, false);
- player.broadcastUserInfo();
- }
- else
- player.sendMessage("You are not the clan leader.");
- return;
- }
- }
- }
- Index: net.sf.l2j;Config.java
- ===================================================================
- --- net.sf.l2j;Config.java (revision 84)
- +++ net.sf.l2j;Config.java (working copy)
- + /** Clan full skills item */
- + public static boolean ENABLE_CLAN_ITEM;
- + public static int CLAN_ITEM_ID;
- + ENABLE_CLAN_ITEM = Special.getProperty("EnableClanItem", false);
- + CLAN_ITEM_ID = Special.getProperty("ClanItem", 1831);
- Index: net.sf.l2j.gameserver.handler;ItemHandler.java
- ===================================================================
- --- net.sf.l2j.gameserver.handler;ItemHandler.java (revision 84)
- +++ net.sf.l2j.gameserver.handler;ItemHandler.java (working copy)
- + import net.sf.l2j.gameserver.handler.itemhandlers.ClanItem;
- + registerItemHandler(new ClanItem());
- Index: data/xml/ItemClan.xml
- ===================================================================
- --- data/xml/ItemClan.xml (revision 84)
- +++ data/xml/ItemClan.xml (working copy)
- + <?xml version="1.0" encoding="UTF-8"?>
- + <list>
- + <item id="1831" type="EtcItem" name="Clan Full">
- + <set name="material" val="STEEL" />
- + <set name="is_destroyable" val="false" />
- + <set name="is_dropable" val="false" />
- + <set name="is_sellable" val="false" />
- + <set name="is_stackable" val="true" />
- + <set name="handler" val="ClanItem" />
- + </item>
- + </list>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement