Ver Fonte

- 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 há 13 anos atrás
pai
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 
-data. 
+data.
+
+In the eAthena scripting language, variable names are not case sensitive.
 
 Variables are divided into and uniquely identified by the combination of:
 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.
            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 
-           '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.
            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 
@@ -1304,6 +1308,9 @@ Example(s):
 //This will set the .var variable of TargetNPC to 1.
 	set getvariableofnpc(.var,"TargetNPC"),1;
 
+Note: even though function objects can have .variables, 
+getvariableofnpc will not work on them.
+
 ---------------------------------------
 
 *goto <label>;
@@ -2167,6 +2174,7 @@ Whatever it returns is determined by type.
  1 - The visible part of the NPC's display name
  2 - The hidden part of the NPC's display 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 is equivalent to using:
 
-    array[index]
+    <array name>[<index>]
 
 The reason for this is, that this short form is internally converted into a call
 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>)
@@ -3690,7 +3701,7 @@ is executing this script, unless it's some kind of "chosen" script.
  
 Example:
  
-warpchar "prontera",150,100,20000001;
+warpchar "prontera",150,100,150001;
  
 ---------------------------------------
  
@@ -6128,13 +6139,14 @@ the NPC with the said name.
 
 *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:
 	enablenpc "Arena#2";
-	disablenpc "Arena#1::OnReset";
+	donpcevent "Arena#1::OnReset";
+	disablenpc "Arena#1";
 	set .MyMobs,24;
 	monster "job_sage",111,102,"Numerical Value",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====================================================
 prt_castle,94,150,4	script	#sound_tu	139,10,10,{
 OnTouch_:
-	if(tu_archer02 != 6) {
+	if(tu_archer02 == 6) {
 		mes "[Minister]";
 		mes "Contact the";
 		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)
 	{
-		mes "- You found mushrooms that is as big as your palm. -";
+		mes "- You found mushrooms that are as big as your palm. -";
 		next;
 		switch( select( "Gather them.","Pass." ) )
 		{
@@ -3843,7 +3843,7 @@ hu_fild06,168,359,3	script	Moks Mushrooms#Mush1	111,{
 			else if(hg_tre == 15)
 				mes "Collected Moks Mushroom Solution: 5ea ";
 			initnpctimer;
-			disablenpc "Moks Mushroom#Mush1";
+			disablenpc "Moks Mushrooms#Mush1";
 			close;
 		break;
 		case 2:
@@ -3860,7 +3860,7 @@ hu_fild06,168,359,3	script	Moks Mushrooms#Mush1	111,{
 	}
 
 OnTimer20000:
-	enablenpc "Moks Mushroom#Mush1";
+	enablenpc "Moks Mushrooms#Mush1";
 	stopnpctimer;
 	end;
 
@@ -3870,7 +3870,7 @@ hu_fild06,194,341,3	script	Moks Mushrooms#Mush2	111,{
 
 	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;
 		switch( select( "Gather them.","Pass." ) )
 		{
@@ -3907,7 +3907,7 @@ hu_fild06,194,341,3	script	Moks Mushrooms#Mush2	111,{
 			else if(hg_tre == 15)
 				mes "Collected Moks Mushroom Solution: 5ea ";
 			initnpctimer;
-			disablenpc "Moks Mushroom#Mush2";
+			disablenpc "Moks Mushrooms#Mush2";
 			close;
 		break;
 		case 2:
@@ -3924,7 +3924,7 @@ hu_fild06,194,341,3	script	Moks Mushrooms#Mush2	111,{
 	}
 
 OnTimer20000:
-	enablenpc "Moks Mushroom#Mush2";
+	enablenpc "Moks Mushrooms#Mush2";
 	stopnpctimer;
 	end;
 
@@ -3934,7 +3934,7 @@ hu_fild06,198,339,3	script	Moks Mushrooms#Mush3	111,{
 
 	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;
 		switch( select( "Gather them.","Pass." ) )
 		{
@@ -3971,7 +3971,7 @@ hu_fild06,198,339,3	script	Moks Mushrooms#Mush3	111,{
 			else if(hg_tre == 15)
 				mes "Collected Moks Mushroom Solution: 5ea ";
 			initnpctimer;
-			disablenpc "Moks Mushroom#Mush3";
+			disablenpc "Moks Mushrooms#Mush3";
 			close;
 		break;
 		case 2:
@@ -3988,7 +3988,7 @@ hu_fild06,198,339,3	script	Moks Mushrooms#Mush3	111,{
 	}
 
 OnTimer20000:
-	enablenpc "Moks Mushroom#Mush3";
+	enablenpc "Moks Mushrooms#Mush3";
 	stopnpctimer;
 	end;