<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[HopZones Community - [Share]An item to become hero untill restart]]></title>
		<link>http://hopzones.net/forum/topic/173/</link>
		<description><![CDATA[The most recent posts in [Share]An item to become hero untill restart.]]></description>
		<lastBuildDate>Sun, 05 Sep 2010 16:07:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [Share]An item to become hero untill restart]]></title>
			<link>http://hopzones.net/forum/post/544/#p544</link>
			<description><![CDATA[<p>lol, that&#039;s me&nbsp; <img src="http://hopzones.net/forum/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (hanwik)]]></author>
			<pubDate>Sun, 05 Sep 2010 16:07:21 +0000</pubDate>
			<guid>http://hopzones.net/forum/post/544/#p544</guid>
		</item>
		<item>
			<title><![CDATA[[Share]An item to become hero untill restart]]></title>
			<link>http://hopzones.net/forum/post/260/#p260</link>
			<description><![CDATA[<p>Credits to HanWik from L2jfree forums.</p><p>Go to <strong>net.sf.l2j.gameserver.handler.itemhandlers</strong> and create new file called <strong>HeroItem.java</strong></p><div class="quotebox"><blockquote><p>/*<br /> * This program is free software: you can redistribute it and/or modify it under<br /> * the terms of the GNU General Public License as published by the Free Software<br /> * Foundation, either version 3 of the License, or (at your option) any later<br /> * version.<br /> *<br /> * This program is distributed in the hope that it will be useful, but WITHOUT<br /> * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS<br /> * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more<br /> * details.<br /> *<br /> * You should have received a copy of the GNU General Public License along with<br /> * this program. If not, see &lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.<br /> */<br />package net.sf.l2j.gameserver.handler.itemhandlers;</p><p>import net.sf.l2j.gameserver.handler.IItemHandler;<br />import net.sf.l2j.gameserver.model.L2ItemInstance;<br />import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;<br />import net.sf.l2j.gameserver.model.actor.instance.L2PlayableInstance;</p><br /><p>/**<br /> *<br /> * @author&nbsp; HanWik<br /> */<br />public class HeroItem implements IItemHandler<br />{<br />&nbsp; &nbsp;private static final int[] ITEM_IDS = { <strong>YOUR ITEM ID - replace here</strong> };</p><p>&nbsp; &nbsp;public void useItem(L2PlayableInstance playable, L2ItemInstance item)<br />&nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; if (!(playable instanceof L2PcInstance))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return;<br />&nbsp; &nbsp; &nbsp; L2PcInstance activeChar = (L2PcInstance)playable;<br />&nbsp; &nbsp; &nbsp; &nbsp;int itemId = item.getItemId();<br />&nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp;if (itemId == <strong>YOUR ITEM ID - replace here</strong>) // Item to become hero<br />&nbsp; &nbsp; &nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; activeChar.setHero(true);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; activeChar.broadcastUserInfo();<br />&nbsp; &nbsp; &nbsp; &nbsp;}<br />&nbsp; &nbsp;}<br />&nbsp; &nbsp;<br />&nbsp; &nbsp;/**<br />&nbsp; &nbsp; * @see net.sf.l2j.gameserver.handler.IItemHandler#getItemIds()<br />&nbsp; &nbsp; */<br />&nbsp; &nbsp;public int[] getItemIds()<br />&nbsp; &nbsp;{<br />&nbsp; &nbsp; &nbsp; return ITEM_IDS;<br />&nbsp; &nbsp;}<br />}</p></blockquote></div><p>go to GameServer.java and add these...</p><div class="quotebox"><blockquote><p>import net.sf.l2j.gameserver.handler.itemhandlers.Harvester;<br /><strong>import net.sf.l2j.gameserver.handler.itemhandlers.HeroItem;</strong><br />import net.sf.l2j.gameserver.handler.itemhandlers.Maps;</p></blockquote></div><p> </p><div class="quotebox"><blockquote><p>_itemHandler.registerItemHandler(new BeastSpice());<br />&nbsp; &nbsp; &nbsp; <strong>_itemHandler.registerItemHandler(new HeroItem());</strong></p></blockquote></div><p>This is all... <img src="http://hopzones.net/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Admin-Hz)]]></author>
			<pubDate>Thu, 06 May 2010 19:32:10 +0000</pubDate>
			<guid>http://hopzones.net/forum/post/260/#p260</guid>
		</item>
	</channel>
</rss>

