Jump to content
  • 0

Trying to learn clan skills


Question

13 answers to this question

Recommended Posts

  • 0
Posted (edited)
2 minutes ago, 0flee said:

@melronofc. Just tell me what class and i will upload to pastebin

The files that are responsible for your trainer manager probably

Edited by melron
  • 0
Posted

This it's edited: 
 

public L2SkillLearn getClassSkill(int id, int lvl, ClassId classId, L2PcInstance player)
	{
		L2SkillLearn skillLearn = null;
		if (player.isPremium())
		{
			for (ClassId classx : ClassId.values())
			{
				L2SkillLearn s = getCompleteClassSkillTree(classx).get(SkillData.getSkillHashCode(id, lvl));
				if (s != null)
				{
					skillLearn = s;
					break;
				}
			}
		}
		else
		{
			skillLearn = getCompleteClassSkillTree(classId).get(SkillData.getSkillHashCode(id, lvl));
		}
		return skillLearn;


And this retail

 

public L2SkillLearn getClassSkill(int id, int lvl, ClassId classId)
     {
   return getCompleteClassSkillTree(classId).get(SkillData.getSkillHashCode(id, lvl));
    }


But nothing here to say something about pledgeSkillTree.

It's L2ServiceManagerInstance.java
The method to display skilllist it's this
 

else if (actualCommand.equalsIgnoreCase("learnclanskills"))
		{
			if (!checkLeaderConditions(player))
			{
				return;
			}
			L2VillageMasterInstance.showPledgeSkillList(player);
		}

 

  • 0
Posted
public static final void showPledgeSkillList(L2PcInstance player)
	{
		if (!player.isClanLeader())
		{
			final NpcHtmlMessage html = new NpcHtmlMessage();
			html.setFile(player, player.getHtmlPrefix(), "data/html/villagemaster/NotClanLeader.htm");
			player.sendPacket(html);
			player.sendPacket(ActionFailed.STATIC_PACKET);
			return;
		}
		
		final List<L2SkillLearn> skills = SkillTreesData.getInstance().getAvailablePledgeSkills(player.getClan());
		final AcquireSkillList asl = new AcquireSkillList(AcquireSkillType.PLEDGE);
		int counts = 0;
		
		for (L2SkillLearn s : skills)
		{
			asl.addSkill(s.getSkillId(), s.getSkillLevel(), s.getSkillLevel(), s.getLevelUpSp(), s.getSocialClass().ordinal());
			counts++;
		}
		
		if (counts == 0)
		{
			if (player.getClan().getLevel() < 8)
			{
				SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.DO_NOT_HAVE_FURTHER_SKILLS_TO_LEARN_S1);
				if (player.getClan().getLevel() < 5)
				{
					sm.addInt(5);
				}
				else
				{
					sm.addInt(player.getClan().getLevel() + 1);
				}
				player.sendPacket(sm);
			}
			else
			{
				final NpcHtmlMessage html = new NpcHtmlMessage();
				html.setFile(player, player.getHtmlPrefix(), "data/html/villagemaster/NoMoreSkills.htm");
				player.sendPacket(html);
			}
		}
		else
		{
			player.sendPacket(asl);
		}
		player.sendPacket(ActionFailed.STATIC_PACKET);
	}
  • 0
Posted
/*
 * Copyright (C) 2004-2015 L2J Server
 * 
 * This file is part of L2J Server.
 * 
 * L2J Server 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 Server 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 l2r.gameserver.network.serverpackets;

import java.util.ArrayList;
import java.util.List;

import l2r.gameserver.model.base.AcquireSkillType;

/**
 * Acquire Skill List server packet implementation.
 */
public final class AcquireSkillList extends L2GameServerPacket
{
	private final List<Skill> _skills;
	private final AcquireSkillType _skillType;
	
	/**
	 * Private class containing learning skill information.
	 */
	private static class Skill
	{
		public int id;
		public int nextLevel;
		public int maxLevel;
		public int spCost;
		public int requirements;
		
		public Skill(int pId, int pNextLevel, int pMaxLevel, int pSpCost, int pRequirements)
		{
			id = pId;
			nextLevel = pNextLevel;
			maxLevel = pMaxLevel;
			spCost = pSpCost;
			requirements = pRequirements;
		}
	}
	
	public AcquireSkillList(AcquireSkillType type)
	{
		_skillType = type;
		_skills = new ArrayList<>();
	}
	
	public void addSkill(int id, int nextLevel, int maxLevel, int spCost, int requirements)
	{
		_skills.add(new Skill(id, nextLevel, maxLevel, spCost, requirements));
	}
	
	@Override
	protected void writeImpl()
	{
		if (_skills.isEmpty())
		{
			return;
		}
		
		writeC(0x90);
		writeD(_skillType.ordinal());
		writeD(_skills.size());
		
		for (Skill temp : _skills)
		{
			writeD(temp.id);
			writeD(temp.nextLevel);
			writeD(temp.maxLevel);
			writeD(temp.spCost);
			writeD(temp.requirements);
			if (_skillType == AcquireSkillType.SUBPLEDGE)
			{
				writeD(0); // TODO: ?
			}
		}
	}
}

 

Fixed.  ( thank's to @Psygrammator ) Close topic !

Guest
This topic is now closed to further replies.


×
×
  • Create New...