Jump to content
  • 0

Forgotten Scroll skill


InFocus

Question

In another order of things, i want to say something. How it is possible to felt buff when i open a fotgotten scroll to get skil? It is not possible to get Skill, without felt buff when i open the book to learn skill?

What i must edit for work property this thing?

Link to comment
Share on other sites

Recommended Posts

  • 0

And if i copy this,

/*
 * Copyright (C) 2004-2015 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack 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.
 * 
 * L2J DataPack 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 handlers.itemhandlers;

import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;

/**
 * Item skills not allowed on Olympiad.
 */
public class ItemSkills extends ItemSkillsTemplate
{
	@Override
	public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
	{
		final L2PcInstance activeChar = playable.getActingPlayer();
		if ((activeChar != null) && activeChar.isInOlympiadMode())
		{
			activeChar.sendPacket(SystemMessageId.THIS_ITEM_IS_NOT_AVAILABLE_FOR_THE_OLYMPIAD_EVENT);
			return false;
		}
		return super.useItem(playable, item, forceUse);
	}
}

i can paste in new package? and if yes, i must add something new?

Link to comment
Share on other sites

  • 0

Leave that ItemSkills ffs.

 

All you need it that useItem method.

Take a look here https://bitbucket.org/l2jserver/l2j_datapack/src/eb8beefdf2cff2fe99e006bf4dcf20997a007104/dist/game/data/scripts/handlers/itemhandlers/BeastSoulShot.java?at=develop&amp;fileviewer=file-view-default

 

See, you have ready code. Just remove useless stuff from there and add your one line code.

 

Good luck. 

Link to comment
Share on other sites

  • 0

And this is code, tell me if it's correct

/*
 * Copyright (C) 2004-2018 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack 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.
 * 
 * L2J DataPack 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 handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;

/**
 * Beast SoulShot Handler
 * @author Tempy
 */
public class MasterSkillsForgotten implements IItemHandler
{
	@Override
	public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
	{
		if (!playable.isPlayer())
		{
			playable.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
			return false;
		}
		
		final L2PcInstance activeOwner = playable.getActingPlayer();
		if (!activeOwner.hasSummon())
		{
			
			return false;
		}
		
		if (activeOwner.getSummon().isDead())
		{
			
			return false;
		}
		
		final int itemId = item.getId();
		final short shotConsumption = activeOwner.getSummon().getSoulShotsPerHit();
		final long shotCount = item.getCount();
		final SkillHolder[] skills = item.getItem().getSkills();
		
		if (skills == null)
		{
			
			return false;
		}
		
		if (shotCount < shotConsumption)
		{
			// Not enough Soulshots to use.
			if (!activeOwner.disableAutoShot(itemId))
			{
				
			}
			return false;
		}
		
		{
			// SoulShots are already active.
			return false;
		}
		
	}
}

 

Link to comment
Share on other sites

  • 0

First register the godamn handler. Where? Search.

 

And you was SUPPOSED TO edit the code. And wtf is this, new kind of coding? Brackets without an if?

 

13 hours ago, InFocus said:

{ // SoulShots are already active. return false; }

 

Even if you register it, it won't work as it's returning false on first lines.

 

JUST THINK. You have all the tools and solutions. Dig, try, learn.

  • Upvote 1
Link to comment
Share on other sites

  • 0

Then it's even worse. You can't think logically. Can you read? Yes, you can, so read this line 

 

17 hours ago, InFocus said:

if (!activeOwner.hasSummon())

   return false;

Read this and guess why it's not working.

 

As there is no message why the code breaks, let's add the message.

if(!activeOwner.hasSummon())

{

   activeOwner.sendMessage("The code is about facking summon which is not summoned! So do facking nothing, terminate the code. ");

   return false;

 

Again, REMOVE CODE YOU DON'T WANT. Die trying or leave it. 

Link to comment
Share on other sites

  • 0

Okay, This is code, i think it is as you say. Check it please.

/*
 * Copyright (C) 2004-2018 L2J DataPack
 * 
 * This file is part of L2J DataPack.
 * 
 * L2J DataPack 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.
 * 
 * L2J DataPack 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 handlers.itemhandlers;

import com.l2jserver.gameserver.handler.IItemHandler;
import com.l2jserver.gameserver.model.actor.L2Playable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.model.holders.SkillHolder;
import com.l2jserver.gameserver.model.items.instance.L2ItemInstance;
import com.l2jserver.gameserver.network.SystemMessageId;

/**
 * Beast SoulShot Handler
 * @author Tempy
 */
public class MasterSkillsForgotten implements IItemHandler
{
	@Override
	public boolean useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
	{
		if (!playable.isPlayer())
		{
			playable.sendPacket(SystemMessageId.ITEM_NOT_FOR_PETS);
			return false;
		}
		
		final L2PcInstance activeOwner = playable.getActingPlayer();
		if (!activeOwner.hasSummon())
		{
			
			return false;
		}
		if(!activeOwner.hasSummon())

		{

		   activeOwner.sendMessage("Test");

		   return false;

		} 
		
		item.getId();
		item.getCount();
		final SkillHolder[] skills = item.getItem().getSkills();
		
		if (skills == null)
		{
			
			return true;
		}
		return forceUse;
		
		
		}
		
	}

 

Link to comment
Share on other sites

  • 0

God no. You don't even know what you're doing. 

 

You don't want, don't need, ANY summon code. So just facking delete it, remove, erase. Kurwa usuń.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




×
×
  • 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