Jump to content
  • 0

Stalker NPC


Unknown

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   1
  • Joined:  09/07/12
  • Last Seen:  

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;
    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;
}

Is it possible to choose the lvl of the skill you want to copy (like: Please, select the skill you want to copy. next; Please, select its level)? Since that NPC only teaches you lvl 10 skills. Also... Once I log out the copied skill doesn't disappear x__x can someone help me? Thanks in advance!

Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   1
  • Joined:  09/07/12
  • Last Seen:  

bump...

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  


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;

}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  109
  • Reputation:   1
  • Joined:  09/07/12
  • Last Seen:  

Thanks!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  23
  • Reputation:   0
  • Joined:  01/03/13
  • Last Seen:  

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;
}

 

Possible to add last skill menu, Last skill the player has copied?

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Yes it's possible, you just need to save the index of the menu and the skill level for example in a variable.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  113
  • Topics Per Day:  0.03
  • Content Count:  457
  • Reputation:   11
  • Joined:  02/17/13
  • Last Seen:  

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;
}

 

 

Wow this is nice Mr. Capuche.

 

But can you debugg this for me because I get an error when I run it using 3ceam.

script error on npc/extras/stalker.txt line 15
    parse_line: expect command, missing function name or calling undeclared func
tion
    10 :        }
    11 :        mes "are you sure you want to copy "+ .skill$[.@menu * 3] +"?";
    12 :        mes "you'll need to relogin again";
    13 :        next;
    14 :        if ( select ( "Yes", "No" ) == 2 ) close;
*   15 :        '.'@text$ = atoi( .skill$[.@menu * 3 +2] ) > 1 ? "-" + .skill$[.
@menu * 3 +2] : "" ;
    16 :        mes "choose a level (1" + .@text$ + ")";
    17 :        if ( input( .@input, 1, ( atoi( .skill$[.@menu * 3 +2] ) > 1 ? a
toi( .skill$[.@menu * 3 +2] ) : 1 )) != 0 ) {
    18 :                mes "wrong level";
    19 :                close;
    20 :        }

Thank you sir.

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Please read

http://rathena.org/board/topic/78263-scripting-faqtipstricks/?p=267219

It's better if you learn to solve this common issue

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