Jump to content
  • 0

[Help] Check players for non-allowed skills


StarSCreams

Question

Hi!!

 

I need check player for non allowed skill but only skill in this list.

 

227,231,232,233,234,235,236,251,252,253,258 (Heavy, Light and Robe)

 

Example:

if characters class id=55(Bounty Hunter) get the skillid=227(LightArmor) is correct, but character change class to 36(Abyss Walker) get the skillid=233(LightArmor) and check this skill and delete non allowed skill in this case 227(LightArmor) is remove. how to do this?

 

 

sorry for my english.

 

i have this for learn normal skill

 

public boolean isSkillPossible(Player player, Skill skill, AcquireType type)
    {
        Clan clan = null;
        List<SkillLearn> skills;
        switch(type)
        {
            case NORMAL:
                skills = _normalSkillTree.get(player.getActiveClassId());
                break;
            case COLLECTION:
                skills = _collectionSkillTree;
                break;
            case TRANSFORMATION:
                skills = _transformationSkillTree.get(player.getRace().ordinal());
                break;
            case FISHING:
                skills = _fishingSkillTree.get(player.getRace().ordinal());
                break;
            case TRANSFER_CARDINAL:
            case TRANSFER_EVA_SAINTS:
            case TRANSFER_SHILLIEN_SAINTS:
                int transferId = type.transferClassId();
                if(player.getActiveClassId() != transferId)
                    return false;

                skills = _transferSkillTree.get(transferId);
                break;
            case CLAN:
                clan = player.getClan();
                if(clan == null)
                    return false;
                skills = _pledgeSkillTree;
                break;
            case SUB_UNIT:
                clan = player.getClan();
                if(clan == null)
                    return false;

                skills = _subUnitSkillTree;
                break;
            case CERTIFICATION:
                skills = _certificationSkillTree;
                break;
            default:
                return false;
        }

        return isSkillPossible(skills, skill);
    }

    private boolean isSkillPossible(Collection<SkillLearn> skills, Skill skill)
    {
        for(SkillLearn learn : skills)
            if(learn.getId() == skill.getId() && learn.getLevel() <= skill.getLevel())
                return true;
        return false;
    }

    public boolean isSkillPossible(Player player, Skill skill)
    {
        for(AcquireType aq : AcquireType.VALUES)
            if(isSkillPossible(player, skill, aq))
                return true;

        return false;
    }

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I dont think that this is a simple request or that some1 could forward you to a similar code that its shared.

 

I think it needs a bit effort for that and probly you wont get any help for this soon.

 

Btw why i class should have or get a skilled that they arent allowed to?

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.
Note: Your post will require moderator approval before it will be visible.

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...