Browse Source

- Changed 'specialeffect' when <send_target> is SELF, it will display the effect to the attached RID (if there is one) instead of the npc. (topic:243842)
- Changed 'movenpc' to accept an optional argument for direction. (topic:206973)

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

brianluau 14 years ago
parent
commit
c775425157
2 changed files with 19 additions and 7 deletions
  1. 7 5
      doc/script_commands.txt
  2. 12 2
      src/map/script.c

+ 7 - 5
doc/script_commands.txt

@@ -6049,17 +6049,19 @@ sprite based sprite id in 'db/mob-avail.txt' with this.
 
 
 ---------------------------------------
 ---------------------------------------
 
 
-*movenpc <NPC name>,x,y;
+*movenpc "<NPC name>",<x>,<y>{,<dir>};
 
 
 This command looks like the NPCWalkToxy function,but is a little different.
 This command looks like the NPCWalkToxy function,but is a little different.
 
 
-While NPCWalkToXY just makes the NPC 'walk' to the coordinates given 
-(which sometimes gives problems if the path isn't a straight line without objects),
-this command just moves the NPC. It basically warps out and in on the current and given spot.
+While NPCWalkToXY just makes the NPC 'walk' to the coordinates given (which 
+sometimes gives problems if the path isn't a straight line without objects), 
+this command just moves the NPC. It basically warps out and in on the current 
+and given spot. Direction can be used to change the NPC's facing direction.
 
 
 Example(s):
 Example(s):
 
 
-//This will move Bugga from it's current position to the coordinates 100,20 (if those coordinates are walkable (legit)).
+// This will move Bugga from it's current position to the coordinates 100,20 
+// (if those coordinates are walkable (legit)).
 	moveNPC "Bugga",100,20;
 	moveNPC "Bugga",100,20;
 	
 	
 ---------------------------------------
 ---------------------------------------

+ 12 - 2
src/map/script.c

@@ -11438,7 +11438,15 @@ BUILDIN_FUNC(specialeffect)
 			clif_specialeffect(&nd->bl, type, target);
 			clif_specialeffect(&nd->bl, type, target);
 	}
 	}
 	else
 	else
-		clif_specialeffect(bl, type, target);
+	{
+		if (target == SELF) {
+			TBL_PC *sd=script_rid2sd(st);
+			if (sd)
+				clif_specialeffect_single(bl,type,sd->fd);
+		} else {
+			clif_specialeffect(bl, type, target);
+		}
+	}
 
 
 	return 0;
 	return 0;
 }
 }
@@ -11771,6 +11779,8 @@ BUILDIN_FUNC(movenpc)
 	if ((nd = npc_name2id(npc)) == NULL)
 	if ((nd = npc_name2id(npc)) == NULL)
 		return -1;
 		return -1;
 
 
+	if (script_hasdata(st,5))
+		nd->ud.dir = script_getnum(st,5);
 	npc_movenpc(nd, x, y);
 	npc_movenpc(nd, x, y);
 	return 0;
 	return 0;
 }
 }
@@ -15081,7 +15091,7 @@ struct script_function buildin_func[] = {
 	BUILDIN_DEF(mapwarp,"ssii??"),		// Added by RoVeRT
 	BUILDIN_DEF(mapwarp,"ssii??"),		// Added by RoVeRT
 	BUILDIN_DEF(atcommand,"s"), // [MouseJstr]
 	BUILDIN_DEF(atcommand,"s"), // [MouseJstr]
 	BUILDIN_DEF(charcommand,"s"), // [MouseJstr]
 	BUILDIN_DEF(charcommand,"s"), // [MouseJstr]
-	BUILDIN_DEF(movenpc,"sii"), // [MouseJstr]
+	BUILDIN_DEF(movenpc,"sii?"), // [MouseJstr]
 	BUILDIN_DEF(message,"ss"), // [MouseJstr]
 	BUILDIN_DEF(message,"ss"), // [MouseJstr]
 	BUILDIN_DEF(npctalk,"s"), // [Valaris]
 	BUILDIN_DEF(npctalk,"s"), // [Valaris]
 	BUILDIN_DEF(mobcount,"ss"),
 	BUILDIN_DEF(mobcount,"ss"),