<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[HopZones Community - [Share]An item to become hero untill restart]]></title>
	<link rel="self" href="http://www.hopzones.net/forum/feed/atom/topic/173/"/>
	<updated>2010-09-05T16:07:21Z</updated>
	<generator>PunBB</generator>
	<id>http://hopzones.net/forum/topic/173/</id>
		<entry>
			<title type="html"><![CDATA[Re: [Share]An item to become hero untill restart]]></title>
			<link rel="alternate" href="http://hopzones.net/forum/post/544/#p544"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[hanwik]]></name>
				<uri>http://hopzones.net/forum/user/1221/</uri>
			</author>
			<updated>2010-09-05T16:07:21Z</updated>
			<id>http://hopzones.net/forum/post/544/#p544</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[[Share]An item to become hero untill restart]]></title>
			<link rel="alternate" href="http://hopzones.net/forum/post/260/#p260"/>
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Admin-Hz]]></name>
				<uri>http://hopzones.net/forum/user/5/</uri>
			</author>
			<updated>2010-05-06T19:32:10Z</updated>
			<id>http://hopzones.net/forum/post/260/#p260</id>
		</entry>
</feed>

