Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

~ Please Help ~

Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
So recently I have been trying to remake the method "teachSkill" (in v83) because it seems it's broken. What I have been trying to do is make an NPC that will allow you to learn a skill and be placed into your beginner tab.

in AbstractPlayerHandler
Code:
public void teachSkill(int skillid, byte level, byte masterLevel, long expiration) {
  getPlayer().changeSkillLevel(SkillFactory.getSkill(skillid), level, masterLevel, expiration);
 }
This is the original method and it didn't work what so ever. So I tried this
Code:
 public final void teachSkill(final int id, final int level, final byte masterlevel) {
        getPlayer().changeSkillLevel(SkillFactory.getSkill(id), level, masterlevel);
    }


    public final void teachSkill(final int id, int level) {
        final Skill skil = SkillFactory.getSkill(id);
        if (getPlayer().getSkillLevel(skil) > level) {
            level = getPlayer().getSkillLevel(skil);
        }
        getPlayer().changeSkillLevel(skil, level, (byte) skil.getMaxLevel());
    }
Also had no luck, I realized if its still giving me an error it has to do with NPCConversationManager
so I added the same methods into that java file had still had no luck and come up with this error.



Obviously I see NPCScriptManager but this should have nothing to do with that java file. Could anyone please help me! I would greatly appreciate it xD

EDIT: I am missing a method in MapleCharacter and I created one with no luck. Also my goal is to basically have players buy a skill from a NPC that can allow them to learn a skill into their beginners tab. Can anyone send me some methods to get this!
 
Last edited:
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
Put here your script that you are using for analysis.

Okay. Its basic but I think I need to rewrite a Method for MapleCharacter, AbstractPlayerInteraction, NPCConversationHandler.

Code:
function start() { 
    cm.sendYesNo("Do you want sharp eyes (test)?"); 
 cm.teachSkill(3121002, 1, 30); 
    cm.dispose(); 
}

I have also tried changing the level and maximum level a thousand times, also adding an extra number after the maximum level just to test that and had no luck. This is just a basic script
 
Upvote 0
Joined
Apr 25, 2010
Messages
479
Reaction score
49
Okay. Its basic but I think I need to rewrite a Method for MapleCharacter, AbstractPlayerInteraction, NPCConversationHandler.

Code:
function start() { 
    cm.sendYesNo("Do you want sharp eyes (test)?"); 
 cm.teachSkill(3121002, 1, 30); 
    cm.dispose(); 
}

I have also tried changing the level and maximum level a thousand times, also adding an extra number after the maximum level just to test that and had no luck. This is just a basic script

In fact the problem is not with its teachSkill function, but with the beginning of your script, try to use something like this:
Code:
importPackage(Packages.client);

var status = 0;
var job;

function start() {
	status = -1;
	action(1, 0, 0);
}

function action(mode, type, selection) {
	if (mode == -1) {
		cm.dispose();
	} else {
		if (mode == 0 && status == 1) {
			cm.sendOk("Make up your mind and visit me again.");
			cm.dispose();
			return;
		}
		if (mode == 1)
			status++;
		else
			status--;
		if (status == 0) {
            cm.teachSkill(3221002,0,10); //sharp eyes
		    cm.sendOk("Do you want sharp eyes (test)?");
            cm.dispose(); 
		} 
	}
}
 
Upvote 0
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
In fact the problem is not with its teachSkill function, but with the beginning of your script, try to use something like this:
Code:
importPackage(Packages.client);

var status = 0;
var job;

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (mode == 0 && status == 1) {
            cm.sendOk("Make up your mind and visit me again.");
            cm.dispose();
            return;
        }
        if (mode == 1)
            status++;
        else
            status--;
        if (status == 0) {
            cm.teachSkill(3221002,0,10); //sharp eyes
            cm.sendOk("Do you want sharp eyes (test)?");
            cm.dispose(); 
        } 
    }
}

This still didn't work, mind posting all your methods in to see if mine match up?
 
Upvote 0
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
What is the error that it returns in .bat now?
The same error.

Someone told me cm.changeSkillLevel(3121002, 1, 30); should work but I tried and it didn't seem to work. I need a complete new method for all the three java files.

EDIT: I am not trying to "MaxSkills" I am trying to get it where I can be a bishop with learning the skill "SharpEyes" in my beginner tab.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
Search in source : "UnsupportedOperationException("Not supported yet.");" show results.

Okay I don't have any UnsupportedOperations and I am currently using
Code:
public void teachSkill(int skillid, byte level, byte masterLevel, long expiration) {
  getPlayer().changeSkillLevel(SkillFactory.getSkill(skillid), level, masterLevel, expiration);
 }

For NPCConvo,Abstract,MC.

I then use your NPC script and get no errors. I also tried adding an expiration to the script and still got no errors in the bat and didn't receive the skill.
 
Upvote 0
Joined
Apr 25, 2010
Messages
479
Reaction score
49
Okay I don't have any UnsupportedOperations and I am currently using
Code:
public void teachSkill(int skillid, byte level, byte masterLevel, long expiration) {
  getPlayer().changeSkillLevel(SkillFactory.getSkill(skillid), level, masterLevel, expiration);
 }

For NPCConvo,Abstract,MC.

I then use your NPC script and get no errors. I also tried adding an expiration to the script and still got no errors in the bat and didn't receive the skill.

Did you get a message from the NPC when using my script? Are you level and with a correct skill and job?
 
Upvote 0
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
Did you get a message from the NPC when using my script? Are you level and with a correct skill and job?
Yes the script displays what its suppose to and I am a Paladin trying to get the skill SharpEyes. Also yes its the correct skill ID.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
You can not give a skill in another class, you can just give a buff.

That's what I've been trying to say this whole time lol. I mean I've seen it in a server before where you can buy a skill to be placed in your beginner tab. (From any job and any skill) I know through the source I can make beginners etc have any skill in the tab but I want it to make the skill for a price.
 
Upvote 0
Joined
Apr 25, 2010
Messages
479
Reaction score
49
That's what I've been trying to say this whole time lol. I mean I've seen it in a server before where you can buy a skill to be placed in your beginner tab. (From any job and any skill) I know through the source I can make beginners etc have any skill in the tab but I want it to make the skill for a price.

Well, this should be related to a bit with .wz edit and localhost, but I'm not sure. Wait for someone to respond.
 
Upvote 0
Newbie Spellweaver
Joined
Jul 21, 2017
Messages
17
Reaction score
0
Well, this should be related to a bit with .wz edit and localhost, but I'm not sure. Wait for someone to respond.

Well could I maybe make a check for something in this? Like maybe has x amount of RB's then receives x skill?

EDIT: Also I just noticed isn't their a quest or w/e that gives you like the "Dragon Rider" skill which allows you to ride on the Lv.200 Dragon. It places a skill inside your Beginner Tab.
 
Upvote 0
Joined
Apr 25, 2010
Messages
479
Reaction score
49
Well could I maybe make a check for something in this? Like maybe has x amount of RB's then receives x skill?

EDIT: Also I just noticed isn't their a quest or w/e that gives you like the "Dragon Rider" skill which allows you to ride on the Lv.200 Dragon. It places a skill inside your Beginner Tab.

Try looking for Skill.wz, maybe adding a skill to you can do what-method.
 
Upvote 0
Back
Top