Jump to content
  • 0

Trying to use "SC_ITEMBOOST" and keep getting error


exyoupjkbrxd

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  10/08/20
  • Last Seen:  

Hello everyone, I'm trying to make a script for a NPC to change the player's rates with SC_EXPBOOST and SC_ITEMBOOST. I'm new to scripting and there might be a better way to make what I want but it works and I'm happy that I was able to make it work.

 

I've got a menu working

 

	mes "[Rate Professor]";
	mes "You can change the rate you are using.";
	mes "Your current rate is ^777777"+rate$+"/"+rate$+"/"+drop$+"^000000";
	mes "Please select the rate you want:";

// --------------------------------------------------
//	Main Menu:
// --------------------------------------------------

menu	"Change Exp Rates",EXPMenu,
    	"Change Drop Rate",DROPMenu,
		"Cancel",Cancel;

// --------------------------------------------------
	EXPMenu:
// --------------------------------------------------

menu	" 1x/1x EXP",e1x,
    	" 2x/2x EXP",e2x;

// --------------------------------------------------
	DROPMenu:
// --------------------------------------------------

menu	" 1x DROP",d1x,
    	" 2x DROP",d2x;

The Change Exp Rates works with those lines :

e1x: sc_end SC_EXPBOOST; set rate$ , "1x";end;
e2x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,100; set rate$ , "2x";end;

If the player select 1x, the script will remove the SC_EXPBOOST and set the variable rate$ to x1, which is shown in the NPC's message. I've got it working till 20x and I don't have any problem changing rates, removing the buff, login out/login in.

But whenever I try to change the drop rate with :

d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
d2x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,100; set drop$ , "2x";end;

I get an error:

[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/Rate Changer.txt', line '101'. Stopping...
 * w1=d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
 * w2=
 * w3=
 * w4=

 

When the "d1x" line (or any other line like those) are included in the script, the NPC is not spawn in the world. When I comment them out, the NPC spawn without any issue. I try to find a way to make it work but I couldn't and I don't really understand the error message. Never got that error when I was writing the EXP part. Something else that I try was to put the effect from the bubble gum item (ID:12210 = sc_start SC_ITEMBOOST,1800000,200;) in the script but I still got the same error but with the bubble gum script.

If someone could tell me where the error is or what I'm doing wrong it would be greatly appreciated.

Thank you

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  148
  • Reputation:   21
  • Joined:  11/12/18
  • Last Seen:  

On 9/13/2021 at 6:23 PM, exyoupjkbrxd said:

Hello everyone, I'm trying to make a script for a NPC to change the player's rates with SC_EXPBOOST and SC_ITEMBOOST. I'm new to scripting and there might be a better way to make what I want but it works and I'm happy that I was able to make it work.

 

I've got a menu working

 

	mes "[Rate Professor]";
	mes "You can change the rate you are using.";
	mes "Your current rate is ^777777"+rate$+"/"+rate$+"/"+drop$+"^000000";
	mes "Please select the rate you want:";

// --------------------------------------------------
//	Main Menu:
// --------------------------------------------------

menu	"Change Exp Rates",EXPMenu,
    	"Change Drop Rate",DROPMenu,
		"Cancel",Cancel;

// --------------------------------------------------
	EXPMenu:
// --------------------------------------------------

menu	" 1x/1x EXP",e1x,
    	" 2x/2x EXP",e2x;

// --------------------------------------------------
	DROPMenu:
// --------------------------------------------------

menu	" 1x DROP",d1x,
    	" 2x DROP",d2x;

The Change Exp Rates works with those lines :

e1x: sc_end SC_EXPBOOST; set rate$ , "1x";end;
e2x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,100; set rate$ , "2x";end;

If the player select 1x, the script will remove the SC_EXPBOOST and set the variable rate$ to x1, which is shown in the NPC's message. I've got it working till 20x and I don't have any problem changing rates, removing the buff, login out/login in.

But whenever I try to change the drop rate with :

d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
d2x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,100; set drop$ , "2x";end;

I get an error:

[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/custom/Rate Changer.txt', line '101'. Stopping...
 * w1=d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
 * w2=
 * w3=
 * w4=

 

When the "d1x" line (or any other line like those) are included in the script, the NPC is not spawn in the world. When I comment them out, the NPC spawn without any issue. I try to find a way to make it work but I couldn't and I don't really understand the error message. Never got that error when I was writing the EXP part. Something else that I try was to put the effect from the bubble gum item (ID:12210 = sc_start SC_ITEMBOOST,1800000,200;) in the script but I still got the same error but with the bubble gum script.

If someone could tell me where the error is or what I'm doing wrong it would be greatly appreciated.

Thank you

can you paste your whole script here

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  13
  • Reputation:   0
  • Joined:  10/08/20
  • Last Seen:  

On 9/26/2021 at 2:58 AM, Forshaken said:

can you paste your whole script here

//===== rAthena Script =======================================
//= Rate Changer
//===== By: ==================================================
//= exyou
//===== Current Version: =====================================
//= 0.3
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= Change Player's rate with a permanent Buff that stays when the player dies or logout/login.
//===== Additional Comments: =================================
//= 0.1 Initial script. Up to 20x
//= 0.2 Added the text box with the current rate.
//= 0.3 Added the Drop Rate changer and Rate menu selector.
//============================================================

-	script	Rate Changer	-1,{
	
	mes "[Rate Professor]";
	mes "You can change the rate you are using.";
	mes "Your current rate is ^777777"+rate$+"/"+rate$+"/"+drop$+"^000000";
	mes "Please select the rate you want:";

// --------------------------------------------------
//	Main Menu:
// --------------------------------------------------

menu	"Change Exp Rates",EXPMenu,
//    	"Change Drop Rate",DROPMenu,
		"Cancel",Cancel;

// --------------------------------------------------
	EXPMenu:
// --------------------------------------------------

menu	" 1x/1x EXP",e1x,
    	" 2x/2x EXP",e2x,
    	" 3x/3x EXP",e3x,
    	" 4x/4x EXP",e4x,
    	" 5x/5x EXP",e5x,
		" 6x/6x EXP",e6x,
		" 7x/7x EXP",e7x,
		" 8x/8x EXP",e8x,
		" 9x/9x EXP",e9x,
		" 10x/10x EXP",e10x,
		" 11x/11x EXP",e11x,
		" 12x/12x EXP",e12x,
		" 13x/13x EXP",e13x,
		" 14x/14x EXP",e14x,
		" 15x/15x EXP",e15x,
		" 16x/16x EXP",e16x,
		" 17x/17x EXP",e17x,
		" 18x/18x EXP",e18x,
		" 19x/19x EXP",e19x,
		" 20x/20x EXP",e20x;

// --------------------------------------------------
	DROPMenu:
// --------------------------------------------------

menu	" 1x DROP",d1x,
    	" 2x DROP",d2x,
		" 3x DROP",d3x,
		" 4x DROP",d4x,
		" 5x DROP",d5x;

// --------------------------------------------------
	Cancel:
// --------------------------------------------------
end;
// --------------------------------------------------
//	CHANGE EXP:
// --------------------------------------------------

e1x: sc_end SC_EXPBOOST; set rate$ , "1x";end;
e2x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,100; set rate$ , "2x";end;
e3x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,200; set rate$ , "3x";end;
e4x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,300; set rate$ , "4x";end;
e5x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,400; set rate$ , "5x";end;
e6x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,500; set rate$ , "6x";end;
e7x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,600; set rate$ , "7x";end;
e8x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,700; set rate$ , "8x";end;
e9x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,800; set rate$ , "9x";end;
e10x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,900; set rate$ , "10x";end;
e11x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1000; set rate$ , "11x";end;
e12x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1100; set rate$ , "12x";end;
e13x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1200; set rate$ , "13x";end;
e14x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1300; set rate$ , "14x";end;
e15x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1400; set rate$ , "15x";end;
e16x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1500; set rate$ , "16x";end;
e17x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1600; set rate$ , "17x";end;
e18x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1700; set rate$ , "18x";end;
e19x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1800; set rate$ , "19x";end;
e20x: sc_end SC_EXPBOOST; sc_start SC_EXPBOOST,-1,1900; set rate$ , "20x";end;
}

// --------------------------------------------------
//	CHANGE DROP:
// --------------------------------------------------

d1x: sc_end SC_ITEMBOOST; set drop$ , "1x";end;
d2x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,100; set drop$ , "2x";end;
//d3x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,200; set drop$ , "3x";end;
//d4x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,300; set drop$ , "4x";end;
//d5x: sc_end SC_ITEMBOOST; sc_start SC_ITEMBOOST,-1,400; set drop$ , "5x";end;

// --------------------------------------------------
//	Duplicates:
// --------------------------------------------------
prontera,158,181,4	duplicate(Rate Changer)	Rate Changer#Pront	627

 

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