Jump to content
  • 0

Stalker NPC.


trizzy

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

i'm getting this error after using this script.

[Error]: pc_checkskill: Invalid skill id 0 (char_id=15001).

 

Can someone explain this? thanks

prontera,155,180,5    script    Stalker    100,{
    mes "select which skill you want to be copy, your existing one will be overwrite";
    next;
    set .@menu, select(.menu$) -1;
    if ( getskilllv(.skill$[.@menu * 3 +1]) ) {
        mes "you already copied that skill";
        close;
    }
    mes "are you sure you want to copy "+ .skill$[.@menu * 3] +"?";
    mes "you'll need to relogin again";
    next;
    if ( select ( "Yes", "No" ) == 2 ) close;
    set CLONE_SKILL, .skill$[.@menu * 3 +1];
    set CLONE_SKILL_LV, .skill$[.@menu * 3 +2];
    atcommand "@kick "+ strcharinfo(0);
    end;
OnInit:
    setarray .skill$, 
        "< Remove >", 0, 0,
        "Fire Bolt", 19, 10,
        "Cold Bolt", 14, 10,
        "Lightning Bolt", 20, 10;
    set .@skillsize, getarraysize(.skill$);
    for ( set .@i,0; .@i < .@skillsize; set .@i, .@i +3 )
        set .menu$, .menu$ + .skill$[.@i] +":";
    end;
}
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • -1

  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

.

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

.

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

still the same error

 

 

I think it was caused by fault in your script, it tries to do getskilllv(0);

Try this:

setarray .skill$,
"Fire Bolt", 19, 10,
"Cold Bolt", 14, 10,
"Lightning Bolt", 20, 10;
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

prontera,155,180,5	script	Stalker	100,{
	mes "select which skill you want to be copy, your existing one will be overwrite";
	next;
	set .@menu, select(.menu$) -1;
	if ( getskilllv(.skill$[.@menu * 3 +1]) && .skill$[.@menu * 3 +1] ) {
		mes "you already copied that skill";
		close;
	}
	else if ( .skill$[.@menu * 3 +1] ) {
		mes "are you sure you want to copy "+ .skill$[.@menu * 3] +"?";
	}
	mes "you'll need to relogin again";
	next;
	if ( select ( "Yes", "No" ) == 2 ) close;
	set CLONE_SKILL, .skill$[.@menu * 3 +1];
	set CLONE_SKILL_LV, .skill$[.@menu * 3 +2];
	atcommand "@kick "+ strcharinfo(0);
	end;
OnInit:
	setarray .skill$, 
		"< Remove >", 0, 0,
		"Fire Bolt", 19, 10,
		"Cold Bolt", 14, 10,
		"Lightning Bolt", 20, 10;
	set .@skillsize, getarraysize(.skill$);
	for ( set .@i,0; .@i < .@skillsize; set .@i, .@i +3 )
		set .menu$, .menu$ + .skill$[.@i] +":";
	end;
}

it's because you assigned a skill id with 0 in order to remove the skill that the char copied....   skill id with 0 doesnt exist.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

prontera,155,180,5	script	Stalker	100,{
	mes "select which skill you want to be copy, your existing one will be overwrite";
	next;
	set .@menu, select(.menu$) -1;
	if ( getskilllv(.skill$[.@menu * 3 +1]) && .skill$[.@menu * 3 +1] ) {
		mes "you already copied that skill";
		close;
	}
	else if ( .skill$[.@menu * 3 +1] ) {
		mes "are you sure you want to copy "+ .skill$[.@menu * 3] +"?";
	}
	mes "you'll need to relogin again";
	next;
	if ( select ( "Yes", "No" ) == 2 ) close;
	set CLONE_SKILL, .skill$[.@menu * 3 +1];
	set CLONE_SKILL_LV, .skill$[.@menu * 3 +2];
	atcommand "@kick "+ strcharinfo(0);
	end;
OnInit:
	setarray .skill$, 
		"< Remove >", 0, 0,
		"Fire Bolt", 19, 10,
		"Cold Bolt", 14, 10,
		"Lightning Bolt", 20, 10;
	set .@skillsize, getarraysize(.skill$);
	for ( set .@i,0; .@i < .@skillsize; set .@i, .@i +3 )
		set .menu$, .menu$ + .skill$[.@i] +":";
	end;
}

it's because you assigned a skill id with 0 in order to remove the skill that the char copied....   skill id with 0 doesnt exist.

 

Sorry for late reply, i almost forgot this topic, @emi so what should id should i put?

i tried the script on 2012 client that i posted on top of the topic and i don't get any error. but in my 2013 client it gives me error.

 

here's what i get on your script

[Error] script:op_2: invalid data for operator C_LAND
[Debug]: Data: number value=0
[Debug]: Data: string value="14"
[Debug]: Source (NPC): Stalker at prontera (155,180)

You need to use atoi.

yeah im using also the script of Capuche

prontera,155,180,5	script	dksfsdfkb	100,{
	mes "select which skill you want to be copy, your existing one will be overwrite";
	next;
	set .@menu, select(.menu$) -1;
	if ( getskilllv(.skill$[.@menu * 3 +1]) ) {
		mes "you already copied that skill";
		close;
	}
	mes "are you sure you want to copy "+ .skill$[.@menu * 3] +"?";
	mes "you'll need to relogin again";
	next;
	if ( select ( "Yes", "No" ) == 2 ) close;
	.@text$ = atoi( .skill$[.@menu * 3 +2] ) > 1 ? "-" + .skill$[.@menu * 3 +2] : "" ;
	mes "choose a level (1" + .@text$ + ")";
	if ( input( .@input, 1, ( atoi( .skill$[.@menu * 3 +2] ) > 1 ? atoi( .skill$[.@menu * 3 +2] ) : 1 )) != 0 ) {
		mes "wrong level";
		close;
	}
	set CLONE_SKILL, atoi( .skill$[.@menu * 3 +1] );
	set CLONE_SKILL_LV, .@input;
	atcommand "@kick "+ strcharinfo(0);
	end;
OnInit:
	setarray .skill$, 
		// "< Remove >", 0, 0,
		"Fire Bolt", 19, 10,
		"Cold Bolt", 14, 10,
		"Lightning Bolt", 20, 10;
	set .@skillsize, getarraysize(.skill$);
	for ( set .@i,0; .@i < .@skillsize; set .@i, .@i +3 )
		set .menu$, .menu$ + .skill$[.@i] +":";
	end;
}

this script it works well for me. but i don't know how to add more skill to copy sorry!

	mes "Which skill you need me to cast on you ?";
	set .@SkillID, select( implode( .SkillName$, ":" ) ) - 1;
	mes "Selected "+ .Skillname$[ .@SkillID ];
	close2;
	npcskill .SkillID[ .@SkillID ], .SkillLv[ .@SkillID ], 50, 99;
	if( .SkillID[ .@SkillID ] == 421 ) {
		getmapxy .@map$, .@x, .@y, 0;
		movenpc strnpcinfo(0), .@x, .@y;
		sleep 3000;
		movenpc strnpcinfo(0),241,87;
	}
	end;

OnInit:
	setarray .SkillID,14,19,20,421;
	setarray .SkillLv,3,5,10,5;
	setarray .SkillName$,"Cold Bolt","Fire Bolt","Lightning Bolt","Fly Kick";
	end;
}

this is much much better for me, the only problem is when i try to copy Fly Kick the Npc will Fly Kick on and then suddenly disappear.

Edited by trizzy
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

To add more skill:

setarray .skill$,
        // "< Remove >", 0, 0,
        "Fire Bolt", 19, 10,
        "Cold Bolt", 14, 10,
        "Lightning Bolt", 20, 10;

Format = Skill name, skill ID, max level.

i tried but is not working, nevermind i will the capuche script. Thanks alot. Closed Topic.

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