Jump to content
  • 0

Exp Item


milosvamp

Question

What's the code for adding exp ? for sp it's GIVE_SP, but for exp idk i tried many things nothing worked, i want to make a custom item that gives exp to player when he clicks it... just like i did for SP....pls help, thanks.

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

player.addExpAndSp(long exp, long sp);

 

try this:

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package l2f.gameserver.handler.items.impl;

import l2f.gameserver.handler.items.IItemHandler;
import l2f.gameserver.model.Playable;
import l2f.gameserver.model.Player;
import l2f.gameserver.model.items.ItemInstance;
import l2f.gameserver.utils.Location;
import l2f.gameserver.utils.Log;

/**
 * @author Alex
 *
 */
public class ExpItem implements IItemHandler
{

	private static final int[] _itemIds =
	{
		111, 1111
	};
	
	private static long _xp1 = 500;
	private static long _xp2 = 2000;
	private static long _sp1 = 500;
	private static long _sp2 = 2000;
	
	@Override
	public boolean useItem(Playable playable, ItemInstance item, boolean ctrl)
	{
		if ((playable == null) || !playable.isPlayer())
			return false;
		
		final Player player = (Player) playable;
		final int itemId = item.getItemId();
		switch (itemId)
		{
			case 111:
				player.addExpAndSp(_xp1, _sp1);
				player.sendMessage("The gods gave you " + _xp1 + " xp and " + _sp1 + " sp.");
				break;
			case 1111:
				player.addExpAndSp(_xp2, _sp2);
				player.sendMessage("The gods gave you " + _xp2 + " xp and " + _sp2 + " sp.");
				break;
			default:
				return false;
		}
		return true;
	}
	
	@Override
	public final int[] getItemIds()
	{
		return _itemIds;
	}
	
	@Override
	public boolean pickupItem(Playable playable, ItemInstance item)
	{
		return true;
	}

	@Override
	public void dropItem(Player player, ItemInstance item, long count, Location loc)
	{
		if (item.isEquipped())
		{
			player.getInventory().unEquipItem(item);
			player.sendUserInfo(true);
		}
		
		item = player.getInventory().removeItemByObjectId(item.getObjectId(), count);
		if (item == null)
		{
			player.sendActionFailed();
			return;
		}
		
		Log.LogItem(player, Log.Drop, item);
		
		item.dropToTheGround(player, loc);
		player.disableDrop(1000);
		
		player.sendChanges();
	}
	
}

the pack that i used ot write it is stormdc

Edited by ganjaradio
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


  • Posts

    • ☎-+256759162994☎ Instant Death Spells Caster   @Revenge Spells Black Magic Voodoo instant revenge death spell caster Azerbaijan, Monte +256759162994.??….Dr. drmamaanani African Famous Voodoo instant revenge death spell caster well known identity as Mama demons Voodoo spell caster, @ CALL / WHATSAPP +256759162994. Results is 100% sure and guaranteed, spell casting specialist, drmamaanani  black magic death spells that work overnight or by accident or by making him / her polarized for his entire life OR to die in a sleep? Cast these strongest black magic revenge death spells that work fast has witchcraft spells to help you with any situation or problems. My witchcraft spells Death CAST overnight Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex lover , Revenge instant death spells on uncle +256759162994….CONTACT ME BY WHATSAPP: +256759162994-can help you if you are feeling HOW TO o kill ex lover, husband, wife girlfriend Enemies without delay. It doesn’t matter whether he or she is in another Country or State. I guarantee you to have your results you are looking for immediately. Just make sure before you contact me you are committed and you want what you are looking for (Victim Death) because my death spell work fast overnight after casting the spells. Immediately working black magic death spells that work fast will be cast on the person and result is 24hours. Mama Sanyu is a Voodoo -witchcraft spell caster who A LOVE SPELLS THAT WORK IMMEDIETLY How To Cast A Death Spell On Someone, Death Spells That Work Overnight to kill wicked Step-dad/ Step mom /@Effective True Love Spells Caster, Bring Back Lost Love Spells, Voodoo Spells Caster To Stop Cheating, Black Magic Spell Caster, Death & Revenge Spells In Australia, USA, UK, Canada, Mauritius. Bring Back Lost Love Spell Caster in Tasmania Victoria West Norway Hull London Powerful Spiritual Traditional Herbalist Healer experienced in Ancestral healing and spell casting, Astrologers, African Medicines, Ritualism, Herbalist healers, Spiritual healers, Native healer, Philosophy, Traditional healers, Herbal remedies, holistic healing .drmamaanani@gmail.com
    • @$+256759162994!!)SPIRITUAL QUICKEST DEATH SPELL / REVENGE SPELL CASTER IN AUSTRALIA, NORWAY, ITALY, *$$ DEATH SPELLS/ MARRIAGE SPELL CASTER+256759162994.??….Dr. drmamaanani African Famous Voodoo instant revenge death spell caster well known identity as Mama demons Voodoo spell caster, @ CALL / WHATSAPP +256759162994. Results is 100% sure and guaranteed, spell casting specialist, drmamaanani  black magic death spells that work overnight or by accident or by making him / her polarized for his entire life OR to die in a sleep? Cast these strongest black magic revenge death spells that work fast has witchcraft spells to help you with any situation or problems. My witchcraft spells Death CAST overnight Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex lover , Revenge instant death spells on uncle +256759162994….CONTACT ME BY WHATSAPP: +256759162994-can help you if you are feeling HOW TO o kill ex lover, husband, wife girlfriend Enemies without delay. It doesn’t matter whether he or she is in another Country or State. I guarantee you to have your results you are looking for immediately. Just make sure before you contact me you are committed and you want what you are looking for (Victim Death) because my death spell work fast overnight after casting the spells. Immediately working black magic death spells that work fast will be cast on the person and result is 24hours. Mama Sanyu is a Voodoo -witchcraft spell caster who A LOVE SPELLS THAT WORK IMMEDIETLY How To Cast A Death Spell On Someone, Death Spells That Work Overnight to kill wicked Step-dad/ Step mom /@Effective True Love Spells Caster, Bring Back Lost Love Spells, Voodoo Spells Caster To Stop Cheating, Black Magic Spell Caster, Death & Revenge Spells In Australia, USA, UK, Canada, Mauritius. Bring Back Lost Love Spell Caster in Tasmania Victoria West Norway Hull London Powerful Spiritual Traditional Herbalist Healer experienced in Ancestral healing and spell casting, Astrologers, African Medicines, Ritualism, Herbalist healers, Spiritual healers, Native healer, Philosophy, Traditional healers, Herbal remedies, holistic healing .drmamaanani@gmail.com
    • NAMIBIA@+256759162994- DEATH SPELL CASTER REVENGE DEATH SPELLS WITH GUARANTEE RESULTS IN BOSTON CANADA FRANCE Enemy kill revenge spells in Essen, Germany.+256759162994.??….Dr. drmamaanani African Famous Voodoo instant revenge death spell caster well known identity as Mama demons Voodoo spell caster, @ CALL / WHATSAPP +256759162994. Results is 100% sure and guaranteed, spell casting specialist, drmamaanani  black magic death spells that work overnight or by accident or by making him / her polarized for his entire life OR to die in a sleep? Cast these strongest black magic revenge death spells that work fast has witchcraft spells to help you with any situation or problems. My witchcraft spells Death CAST overnight Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex lover , Revenge instant death spells on uncle +256759162994….CONTACT ME BY WHATSAPP: +256759162994-can help you if you are feeling HOW TO o kill ex lover, husband, wife girlfriend Enemies without delay. It doesn’t matter whether he or she is in another Country or State. I guarantee you to have your results you are looking for immediately. Just make sure before you contact me you are committed and you want what you are looking for (Victim Death) because my death spell work fast overnight after casting the spells. Immediately working black magic death spells that work fast will be cast on the person and result is 24hours. Mama Sanyu is a Voodoo -witchcraft spell caster who A LOVE SPELLS THAT WORK IMMEDIETLY How To Cast A Death Spell On Someone, Death Spells That Work Overnight to kill wicked Step-dad/ Step mom /@Effective True Love Spells Caster, Bring Back Lost Love Spells, Voodoo Spells Caster To Stop Cheating, Black Magic Spell Caster, Death & Revenge Spells In Australia, USA, UK, Canada, Mauritius. Bring Back Lost Love Spell Caster in Tasmania Victoria West Norway Hull London Powerful Spiritual Traditional Herbalist Healer experienced in Ancestral healing and spell casting, Astrologers, African Medicines, Ritualism, Herbalist healers, Spiritual healers, Native healer, Philosophy, Traditional healers, Herbal remedies, holistic healing .drmamaanani@gmail.com
    • @@$+256759162994- BLACK MAGIC INSTANT DEATH SPELL CASTER IN UGANDA, NETHERLANDS,+256759162994.??….Dr. drmamaanani African Famous Voodoo instant revenge death spell caster well known identity as Mama demons Voodoo spell caster, @ CALL / WHATSAPP +256759162994. Results is 100% sure and guaranteed, spell casting specialist, drmamaanani  black magic death spells that work overnight or by accident or by making him / her polarized for his entire life OR to die in a sleep? Cast these strongest black magic revenge death spells that work fast has witchcraft spells to help you with any situation or problems. My witchcraft spells Death CAST overnight Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex lover , Revenge instant death spells on uncle +256759162994….CONTACT ME BY WHATSAPP: +256759162994-can help you if you are feeling HOW TO o kill ex lover, husband, wife girlfriend Enemies without delay. It doesn’t matter whether he or she is in another Country or State. I guarantee you to have your results you are looking for immediately. Just make sure before you contact me you are committed and you want what you are looking for (Victim Death) because my death spell work fast overnight after casting the spells. Immediately working black magic death spells that work fast will be cast on the person and result is 24hours. Mama Sanyu is a Voodoo -witchcraft spell caster who A LOVE SPELLS THAT WORK IMMEDIETLY How To Cast A Death Spell On Someone, Death Spells That Work Overnight to kill wicked Step-dad/ Step mom /@Effective True Love Spells Caster, Bring Back Lost Love Spells, Voodoo Spells Caster To Stop Cheating, Black Magic Spell Caster, Death & Revenge Spells In Australia, USA, UK, Canada, Mauritius. Bring Back Lost Love Spell Caster in Tasmania Victoria West Norway Hull London Powerful Spiritual Traditional Herbalist Healer experienced in Ancestral healing and spell casting, Astrologers, African Medicines, Ritualism, Herbalist healers, Spiritual healers, Native healer, Philosophy, Traditional healers, Herbal remedies, holistic healing .drmamaanani@gmail.com  
    • +256759162994= Most Trusted Death Spells Caster in SOUTH AFRICA,Namibia,USA,UK,Austria,Australia,Sweden,Switzerland,Italy,Spain,Canada,Brazil,Norway,New Zealand,Belgium,Zambia,Zimbabwe,Botswana,Lesotho,U.A.E,Egypt,Kuwait,Turkey,Qatar,Pakistan +256759162994.??….Dr. drmamaanani African Famous Voodoo instant revenge death spell caster well known identity as Mama demons Voodoo spell caster, @ CALL / WHATSAPP +256759162994. Results is 100% sure and guaranteed, spell casting specialist, drmamaanani  black magic death spells that work overnight or by accident or by making him / her polarized for his entire life OR to die in a sleep? Cast these strongest black magic revenge death spells that work fast has witchcraft spells to help you with any situation or problems. My witchcraft spells Death CAST overnight Revenge Spell on wicked friends, Voodoo Death Spells to kill Enemies Black Magic Spells To Harm Someone, Black magic death spells on ex lover , Revenge instant death spells on uncle +256759162994….CONTACT ME BY WHATSAPP: +256759162994-can help you if you are feeling HOW TO o kill ex lover, husband, wife girlfriend Enemies without delay. It doesn’t matter whether he or she is in another Country or State. I guarantee you to have your results you are looking for immediately. Just make sure before you contact me you are committed and you want what you are looking for (Victim Death) because my death spell work fast overnight after casting the spells. Immediately working black magic death spells that work fast will be cast on the person and result is 24hours. Mama Sanyu is a Voodoo -witchcraft spell caster who A LOVE SPELLS THAT WORK IMMEDIETLY How To Cast A Death Spell On Someone, Death Spells That Work Overnight to kill wicked Step-dad/ Step mom /@Effective True Love Spells Caster, Bring Back Lost Love Spells, Voodoo Spells Caster To Stop Cheating, Black Magic Spell Caster, Death & Revenge Spells In Australia, USA, UK, Canada, Mauritius. Bring Back Lost Love Spell Caster in Tasmania Victoria West Norway Hull London Powerful Spiritual Traditional Herbalist Healer experienced in Ancestral healing and spell casting, Astrologers, African Medicines, Ritualism, Herbalist healers, Spiritual healers, Native healer, Philosophy, Traditional healers, Herbal remedies, holistic healing .drmamaanani@gmail.com
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock