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.gameserver.data.SkillTable;
- + import net.sf.l2j.gameserver.handler.IItemHandler;
- + import net.sf.l2j.gameserver.model.L2Skill;
- + import net.sf.l2j.gameserver.model.actor.Playable;
- + import net.sf.l2j.gameserver.model.actor.instance.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 (!(playable instanceof Player))
- + return;
- +
- + Player activeChar = (Player) playable;
- +
- + if (activeChar.isClanLeader())
- + {
- + if (activeChar.getClan().getLevel() == 8)
- + {
- + activeChar.sendMessage("Your clan is already maximum level!");
- + return;
- + }
- +
- + activeChar.getClan().changeLevel(level);
- + activeChar.getClan().addReputationScore(reputation);
- +
- + for (int s : clanSkills)
- + {
- + L2Skill clanSkill = SkillTable.getInstance().getInfo(s, SkillTable.getInstance().getMaxLevel(s));
- + activeChar.getClan().addNewSkill(clanSkill);
- + }
- +
- + activeChar.sendSkillList();
- + activeChar.getClan().updateClanInDB();
- + activeChar.sendMessage("Your clan Level/Skills/Reputation has been updated!");
- + playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
- + activeChar.broadcastUserInfo();
- + }
- + else
- + activeChar.sendMessage("You are not the clan leader.");
- +
- + return;
- + }
- + }
- +
- 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="9505" 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