Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: head-src/com/l2jfrozen/gameserver/network/serverpackets/SystemMessage.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/network/serverpackets/SystemMessage.java (revision 32)
- +++ head-src/com/l2jfrozen/gameserver/network/serverpackets/SystemMessage.java (working copy)
- @@ -18,6 +18,7 @@
- import com.l2jfrozen.Config;
- import com.l2jfrozen.gameserver.model.L2Skill;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
- import com.l2jfrozen.gameserver.network.SystemMessageId;
- public final class SystemMessage extends L2GameServerPacket
- @@ -79,6 +80,10 @@
- return this;
- }
- + public final SystemMessage addItemName(final L2ItemInstance item)
- + {
- + return addItemName(item.getItem().getItemId());
- + }
- public SystemMessage addItemName(int id)
- {
- _types.add(new Integer(TYPE_ITEM_NAME));
- Index: head-src/com/l2jfrozen/Config.java
- ===================================================================
- --- head-src/com/l2jfrozen/Config.java (revision 33)
- +++ head-src/com/l2jfrozen/Config.java (working copy)
- @@ -256,6 +256,18 @@
- public static int AIO_TCOLOR;
- public static boolean ALLOW_AIO_USE_GK;
- public static boolean ALLOW_AIO_USE_CM;
- + /** Clan Item **/
- + public static boolean CLAN_TITLE;
- + public static String ADD_CLAN_TITLE;
- + public static boolean ENABLE_CLAN_ITEM;
- + public static Map<Integer, Integer> CLAN_ITEM_SKILLS;
- + public static int CLAN_ITEM_ID;
- + public static boolean ALLOW_ITEM_SET_LEVEL;
- + public static byte CLAN_ITEM_LEVEL;
- + public static boolean ALLOW_REPUTATION_ITEM;
- + public static int REPUTATION_ITEM_QUANTITY;
- + public static boolean ALLOW_CLAN_TCOLOR;
- + public static int CLAN_ITEM_TCOLOR;
- public static boolean ANNOUNCE_CASTLE_LORDS;
- public static boolean ALLOW_VIP_NCOLOR;
- public static int VIP_NCOLOR;
- @@ -1953,6 +1965,46 @@
- AIO_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("AioTitleColor", "88AA88"));
- ALLOW_AIO_USE_GK = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseGk", "False"));
- ALLOW_AIO_USE_CM = Boolean.parseBoolean(otherSettings.getProperty("AllowAioUseClassMaster", "False"));
- + /** Clan Item **/
- + ENABLE_CLAN_ITEM = Boolean.parseBoolean(otherSettings.getProperty("EnableClanItem", "True"));
- + if(ENABLE_CLAN_ITEM)
- + {
- + String ItemSkillsSplit[] = otherSettings.getProperty("ClanItemSkills", "").split(";");
- + CLAN_ITEM_SKILLS = new FastMap<Integer, Integer>(ItemSkillsSplit.length);
- + String arr[] = ItemSkillsSplit;
- + int len = arr.length;
- + for(int i = 0; i < len; i++)
- + {
- + String skill = arr[i];
- + String skillSplit[] = skill.split(",");
- + if(skillSplit.length != 2)
- + {
- + System.out.println((new StringBuilder()).append("[Clan Item]: invalid config property in custom.properties -> ClanItemSkills \"").append(skill).append("\"").toString());
- + continue;
- + }
- + try
- + {
- + CLAN_ITEM_SKILLS.put(Integer.valueOf(Integer.parseInt(skillSplit[0])), Integer.valueOf(Integer.parseInt(skillSplit[1])));
- + continue;
- + }
- + catch(NumberFormatException nfe)
- + {
- + //
- + }
- + if(!skill.equals(""))
- + System.out.println((new StringBuilder()).append("[Clan Item]: invalid config property in custom.properties -> ClanItemSkills \"").append(skillSplit[0]).append("\"").append(skillSplit[1]).toString());
- + }
- + }
- + CLAN_ITEM_ID = Integer.parseInt(otherSettings.getProperty("ClanItemID", "666"));
- + ALLOW_ITEM_SET_LEVEL = TypeFormat.parseBoolean(otherSettings.getProperty("AllowClanItemLevel", "True"));
- + CLAN_ITEM_LEVEL = Byte.parseByte(otherSettings.getProperty("ClanItemSetLevel", "8"));
- + ALLOW_REPUTATION_ITEM = TypeFormat.parseBoolean(otherSettings.getProperty("AllowClanItemRep", "False"));
- + REPUTATION_ITEM_QUANTITY = Integer.parseInt(otherSettings.getProperty("ReputationItemScore", "10000"));
- + CLAN_TITLE = TypeFormat.parseBoolean(otherSettings.getProperty("ClanItemTitle", "False"));
- + ADD_CLAN_TITLE = otherSettings.getProperty("ClanItemAddTitle", "L2JDream");
- + ALLOW_CLAN_TCOLOR = TypeFormat.parseBoolean(otherSettings.getProperty("AllowClanItemTitle", "False"));
- + CLAN_ITEM_TCOLOR = Integer.decode("0x" + otherSettings.getProperty("ClanTitleColor", "88AA88"));
- +
- ALLOW_VIP_NCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipNameColor", "True"));
- VIP_NCOLOR = Integer.decode("0x" + otherSettings.getProperty("VipNameColor", "0088FF"));
- ALLOW_VIP_TCOLOR = Boolean.parseBoolean(otherSettings.getProperty("AllowVipTitleColor", "True"));
- Index: head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ClanItem.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ClanItem.java (revision 0)
- +++ head-src/com/l2jfrozen/gameserver/handler/itemhandlers/ClanItem.java (working copy)
- @@ -0,0 +1,65 @@
- +package com.l2jfrozen.gameserver.handler.itemhandlers;
- +
- +import com.l2jfrozen.Config;
- +import com.l2jfrozen.gameserver.handler.IItemHandler;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
- +import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
- +import com.l2jfrozen.gameserver.network.SystemMessageId;
- +import com.l2jfrozen.gameserver.network.serverpackets.SystemMessage;
- +
- +/**
- + * @author Bian
- + **/
- +public class ClanItem implements IItemHandler
- +{
- + private static final int ITEM_IDS[] = { Config.CLAN_ITEM_ID };
- +
- + @Override
- + public void useItem(L2PlayableInstance playable, L2ItemInstance item)
- + {
- + if(!(playable instanceof L2PcInstance))
- + return;
- +
- + if (item == null)
- + {
- + return;
- + }
- +
- + L2PcInstance player = (L2PcInstance)playable;
- + if (!player.isClanLeader())
- + {
- + player.sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item));
- + return;
- + }
- + else if (player.isInOlympiadMode())
- + {
- + player.sendPacket(new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED).addItemName(item));
- + return;
- + }
- + else
- + {
- + if(player.destroyItem("Consume", item.getObjectId(), 1, null, false))
- + {
- + if (Config.ALLOW_ITEM_SET_LEVEL)
- + {
- + player.getClan().changeLevel(Config.CLAN_ITEM_LEVEL);
- + player.sendMessage((new StringBuilder()).append("Congratulations you now have your clan level ").append(Config.CLAN_ITEM_LEVEL).append(".").toString());
- + }
- +
- + if (Config.CLAN_TITLE)
- + {
- + player.setTitle(Config.ADD_CLAN_TITLE);
- + }
- +
- + player.ClanItem();
- + }
- + }
- + }
- +
- + @Override
- + public int[] getItemIds()
- + {
- + return ITEM_IDS;
- + }
- +}
- Index: config/others/other.properties
- ===================================================================
- --- config/others/other.properties (revision 32)
- +++ config/others/other.properties (working copy)
- @@ -31,6 +31,44 @@
- # Aio Buffers can speak to Class Master?
- AllowAioUseClassMaster = False
- +#========================================
- +# Clan Item
- +#========================================
- +
- +# Enable and Disable Item
- +EnableClanItem = True
- +
- +# ItemID for Clan Item
- +ClanItemID = 666
- +
- +# List of Skills reward for clan
- +# Format : skillid,skilllvl;skillid2,skilllvl2;....skillidn,skilllvln
- +ClanItemSkills = 370,3;371,3;372,3;373,3;374,3;375,3;376,3;377,3;378,3;379,3;380,3;381,3;382,3;383,3;384,3;385,3;386,3;387,3;388,3;389,3;390,3;391,3;
- +
- +# Allow Clan Item Set Level
- +AllowClanItemLevel = True
- +
- +# LvL Clan Reward
- +ClanItemSetLevel = 8
- +
- +# Allow Clan Item Set Reputation
- +AllowClanItemRep = False
- +
- +# Quantity Reputation Points
- +ReputationItemScore = 10000
- +
- +# Allow Clan Item Title ADD
- +ClanItemTitle = False
- +
- +# Clan Title ADD
- +ClanItemAddTitle = L2JDream
- +
- +# Allow Clan Item Title Colow
- +AllowClanItemTitleColor = False
- +
- +# Clan Title Color in HEX
- +ClanTitleColor = 88AA88
- +
- Index: head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (revision 36)
- +++ head-src/com/l2jfrozen/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -20125,7 +20132,34 @@
- }
- sendSkillList();
- }
- -
- + public void ClanItem()
- + {
- + for(Iterator<Integer> i = Config.CLAN_ITEM_SKILLS.keySet().iterator(); i.hasNext(); broadcastUserInfo())
- + {
- + Integer skillid = (Integer)i.next();
- + int skilllvl = ((Integer)Config.CLAN_ITEM_SKILLS.get(skillid)).intValue();
- + L2Skill skill = SkillTable.getInstance().getInfo(skillid.intValue(), skilllvl);
- + if(skill != null)
- + addSkill(skill, true);
- + getClan().addNewSkill(skill);
- + sendSkillList();
- + }
- +
- + if (Config.ALLOW_REPUTATION_ITEM)
- + {
- + L2Clan clan = getClan();
- + clan.setReputationScore(clan.getReputationScore() + Config.REPUTATION_ITEM_QUANTITY, true);
- + sendMessage((new StringBuilder()).append("You received ").append(Config.REPUTATION_ITEM_QUANTITY).append(" Reputation Points.").toString());
- + }
- +
- + if (Config.ALLOW_CLAN_TCOLOR)
- + {
- + getAppearance().setTitleColor(Config.CLAN_ITEM_TCOLOR);
- + }
- +
- + sendSkillList();
- + broadcastUserInfo();
- + }
- /**
- * Get the current pet skill in use or return null.<br><br>
- * @return
- Index: head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java
- ===================================================================
- --- head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java (revision 32)
- +++ head-src/com/l2jfrozen/gameserver/handler/ItemHandler.java (working copy)
- @@ -32,6 +32,7 @@
- import com.l2jfrozen.gameserver.handler.itemhandlers.CharChangePotions;
- import com.l2jfrozen.gameserver.handler.itemhandlers.ChestKey;
- import com.l2jfrozen.gameserver.handler.itemhandlers.ChristmasTree;
- +import com.l2jfrozen.gameserver.handler.itemhandlers.ClanItem;
- import com.l2jfrozen.gameserver.handler.itemhandlers.CrystalCarol;
- import com.l2jfrozen.gameserver.handler.itemhandlers.Crystals;
- import com.l2jfrozen.gameserver.handler.itemhandlers.CustomPotions;
- @@ -152,6 +153,7 @@
- registerItemHandler(new BreakingArrow());
- registerItemHandler(new ChristmasTree());
- registerItemHandler(new Crystals());
- + registerItemHandler(new ClanItem());
- _log.config("ItemHandler: Loaded " + _datatable.size() + " handlers.");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement