Browse Source

- Updated strnpcinfo documentation, following r14929.
- Fixed some script typos. (bugreport:5047, bugreport:5049, bugreport:5056)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14960 54d463be-8e91-2dee-dedb-b68131a5f0ec

brianluau 13 years ago
parent
commit
558b08bfe7

+ 21 - 9
doc/script_commands.txt

@@ -577,7 +577,9 @@ Variables
 ---------
 ---------
 
 
 The meat of every programming language is variables - places where you store 
 The meat of every programming language is variables - places where you store 
-data. 
+data.
+
+In the eAthena scripting language, variable names are not case sensitive.
 
 
 Variables are divided into and uniquely identified by the combination of:
 Variables are divided into and uniquely identified by the combination of:
 prefix  - determines the scope and extent (or lifetime) of the variable
 prefix  - determines the scope and extent (or lifetime) of the variable
@@ -614,7 +616,9 @@ nothing  - A permanent variable attached to the character, the default variable
 "."      - A NPC variable.
 "."      - A NPC variable.
            They exist in the NPC and disappear when the server restarts or the 
            They exist in the NPC and disappear when the server restarts or the 
            NPC is reloaded. Can be accessed from inside the NPC or by calling 
            NPC is reloaded. Can be accessed from inside the NPC or by calling 
-           'getvariableofnpc'.
+           'getvariableofnpc'. Function objects can also have .variables which 
+           are accessible from inside the function, however 'getvariableofnpc' 
+           does NOT work on function objects.
 ".@"     - A scope variable.
 ".@"     - A scope variable.
            They are unique to the instance and scope. Each instance has it's 
            They are unique to the instance and scope. Each instance has it's 
            own scope that ends when the script ends. Calling a function with 
            own scope that ends when the script ends. Calling a function with 
@@ -1304,6 +1308,9 @@ Example(s):
 //This will set the .var variable of TargetNPC to 1.
 //This will set the .var variable of TargetNPC to 1.
 	set getvariableofnpc(.var,"TargetNPC"),1;
 	set getvariableofnpc(.var,"TargetNPC"),1;
 
 
+Note: even though function objects can have .variables, 
+getvariableofnpc will not work on them.
+
 ---------------------------------------
 ---------------------------------------
 
 
 *goto <label>;
 *goto <label>;
@@ -2167,6 +2174,7 @@ Whatever it returns is determined by type.
  1 - The visible part of the NPC's display name
  1 - The visible part of the NPC's display name
  2 - The hidden part of the NPC's display name
  2 - The hidden part of the NPC's display name
  3 - The NPC's unique name (::name)
  3 - The NPC's unique name (::name)
+ 4 - The name of the map the NPC is in.
 
 
 ---------------------------------------
 ---------------------------------------
 
 
@@ -2195,11 +2203,14 @@ This will make @arraysize == 6. But if you try this:
 This command retrieves the value of the element of given array at given index.
 This command retrieves the value of the element of given array at given index.
 This is equivalent to using:
 This is equivalent to using:
 
 
-    array[index]
+    <array name>[<index>]
 
 
 The reason for this is, that this short form is internally converted into a call
 The reason for this is, that this short form is internally converted into a call
 to getelementofarray, when the script is loaded.
 to getelementofarray, when the script is loaded.
 
 
+Also useful when passing arrays to functions.
+getelementofarray(getarg(0),<index>) will work, but getarg(0)[<index>] will not.
+
 ---------------------------------------
 ---------------------------------------
 
 
 *readparam(<parameter number>)
 *readparam(<parameter number>)
@@ -3690,7 +3701,7 @@ is executing this script, unless it's some kind of "chosen" script.
  
  
 Example:
 Example:
  
  
-warpchar "prontera",150,100,20000001;
+warpchar "prontera",150,100,150001;
  
  
 ---------------------------------------
 ---------------------------------------
  
  
@@ -6128,13 +6139,14 @@ the NPC with the said name.
 
 
 *rand(<number>{,<number>});
 *rand(<number>{,<number>});
 
 
-This function returns a number, randomly positioned between 0 and the number you 
-specify (if you only specify one) and the two numbers you specify if you give it 
-two.
+This function returns a number ...
+(if you specify one) ... randomly positioned between 0 and the number you specify -1.
+(if you specify two) ... randomly positioned between the two numbers you specify.
 
 
-rand(10) would result in 0,1,2,3,4,5,6,7,8 or 9
+rand(10)  would result in 0,1,2,3,4,5,6,7,8 or 9
+rand(0,9) would result in 0,1,2,3,4,5,6,7,8 or 9
 
 
-rand(2,10) would result in 2,3,4,5,6,7,8,9 or 10
+rand(2,5) would result in 2,3,4 or 5
 
 
 ---------------------------------------
 ---------------------------------------
 
 

+ 2 - 1
npc/jobs/2-2/sage.txt

@@ -2680,7 +2680,8 @@ OnInit:
 
 
 OnEnable:
 OnEnable:
 	enablenpc "Arena#2";
 	enablenpc "Arena#2";
-	disablenpc "Arena#1::OnReset";
+	donpcevent "Arena#1::OnReset";
+	disablenpc "Arena#1";
 	set .MyMobs,24;
 	set .MyMobs,24;
 	monster "job_sage",111,102,"Numerical Value",1063,1,"Arena#2::OnMyMobDead";
 	monster "job_sage",111,102,"Numerical Value",1063,1,"Arena#2::OnMyMobDead";
 	monster "job_sage",111,102,"Physics",1063,1,"Arena#2::OnMyMobDead";
 	monster "job_sage",111,102,"Physics",1063,1,"Arena#2::OnMyMobDead";

+ 1 - 1
npc/quests/first_class/tu_archer.txt

@@ -1904,7 +1904,7 @@ prt_castle,76,165,6	script	Minister#tu	55,{
 //=================================================Range NPC====================================================
 //=================================================Range NPC====================================================
 prt_castle,94,150,4	script	#sound_tu	139,10,10,{
 prt_castle,94,150,4	script	#sound_tu	139,10,10,{
 OnTouch_:
 OnTouch_:
-	if(tu_archer02 != 6) {
+	if(tu_archer02 == 6) {
 		mes "[Minister]";
 		mes "[Minister]";
 		mes "Contact the";
 		mes "Contact the";
 		mes "Prontera Church.";
 		mes "Prontera Church.";

+ 9 - 9
npc/quests/quests_hugel.txt

@@ -3806,7 +3806,7 @@ hu_fild06,168,359,3	script	Moks Mushrooms#Mush1	111,{
 
 
 	if(hg_tre > 9 && hg_tre < 15)
 	if(hg_tre > 9 && hg_tre < 15)
 	{
 	{
-		mes "- You found mushrooms that is as big as your palm. -";
+		mes "- You found mushrooms that are as big as your palm. -";
 		next;
 		next;
 		switch( select( "Gather them.","Pass." ) )
 		switch( select( "Gather them.","Pass." ) )
 		{
 		{
@@ -3843,7 +3843,7 @@ hu_fild06,168,359,3	script	Moks Mushrooms#Mush1	111,{
 			else if(hg_tre == 15)
 			else if(hg_tre == 15)
 				mes "Collected Moks Mushroom Solution: 5ea ";
 				mes "Collected Moks Mushroom Solution: 5ea ";
 			initnpctimer;
 			initnpctimer;
-			disablenpc "Moks Mushroom#Mush1";
+			disablenpc "Moks Mushrooms#Mush1";
 			close;
 			close;
 		break;
 		break;
 		case 2:
 		case 2:
@@ -3860,7 +3860,7 @@ hu_fild06,168,359,3	script	Moks Mushrooms#Mush1	111,{
 	}
 	}
 
 
 OnTimer20000:
 OnTimer20000:
-	enablenpc "Moks Mushroom#Mush1";
+	enablenpc "Moks Mushrooms#Mush1";
 	stopnpctimer;
 	stopnpctimer;
 	end;
 	end;
 
 
@@ -3870,7 +3870,7 @@ hu_fild06,194,341,3	script	Moks Mushrooms#Mush2	111,{
 
 
 	if(hg_tre > 9 && hg_tre < 15)
 	if(hg_tre > 9 && hg_tre < 15)
 	{
 	{
-		mes "- You found mushrooms that is as big as your palm. -";
+		mes "- You found mushrooms that are as big as your palm. -";
 		next;
 		next;
 		switch( select( "Gather them.","Pass." ) )
 		switch( select( "Gather them.","Pass." ) )
 		{
 		{
@@ -3907,7 +3907,7 @@ hu_fild06,194,341,3	script	Moks Mushrooms#Mush2	111,{
 			else if(hg_tre == 15)
 			else if(hg_tre == 15)
 				mes "Collected Moks Mushroom Solution: 5ea ";
 				mes "Collected Moks Mushroom Solution: 5ea ";
 			initnpctimer;
 			initnpctimer;
-			disablenpc "Moks Mushroom#Mush2";
+			disablenpc "Moks Mushrooms#Mush2";
 			close;
 			close;
 		break;
 		break;
 		case 2:
 		case 2:
@@ -3924,7 +3924,7 @@ hu_fild06,194,341,3	script	Moks Mushrooms#Mush2	111,{
 	}
 	}
 
 
 OnTimer20000:
 OnTimer20000:
-	enablenpc "Moks Mushroom#Mush2";
+	enablenpc "Moks Mushrooms#Mush2";
 	stopnpctimer;
 	stopnpctimer;
 	end;
 	end;
 
 
@@ -3934,7 +3934,7 @@ hu_fild06,198,339,3	script	Moks Mushrooms#Mush3	111,{
 
 
 	if(hg_tre > 9 && hg_tre < 15)
 	if(hg_tre > 9 && hg_tre < 15)
 	{
 	{
-		mes "- You found mushrooms that is as big as your palm. -";
+		mes "- You found mushrooms that are as big as your palm. -";
 		next;
 		next;
 		switch( select( "Gather them.","Pass." ) )
 		switch( select( "Gather them.","Pass." ) )
 		{
 		{
@@ -3971,7 +3971,7 @@ hu_fild06,198,339,3	script	Moks Mushrooms#Mush3	111,{
 			else if(hg_tre == 15)
 			else if(hg_tre == 15)
 				mes "Collected Moks Mushroom Solution: 5ea ";
 				mes "Collected Moks Mushroom Solution: 5ea ";
 			initnpctimer;
 			initnpctimer;
-			disablenpc "Moks Mushroom#Mush3";
+			disablenpc "Moks Mushrooms#Mush3";
 			close;
 			close;
 		break;
 		break;
 		case 2:
 		case 2:
@@ -3988,7 +3988,7 @@ hu_fild06,198,339,3	script	Moks Mushrooms#Mush3	111,{
 	}
 	}
 
 
 OnTimer20000:
 OnTimer20000:
-	enablenpc "Moks Mushroom#Mush3";
+	enablenpc "Moks Mushrooms#Mush3";
 	stopnpctimer;
 	stopnpctimer;
 	end;
 	end;