- Updated @rura/@warp. Now you can use both "@warp mapname x y" and "@warp mapname,x,y".

- Added command @tonpc (warp to NPC).
- Fixed @where at-command.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5602 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
LuzZza 2006-03-14 20:28:10 +00:00
parent c22cfd5ae8
commit 40753b24b1
3 changed files with 46 additions and 4 deletions

View File

@ -5,6 +5,10 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/03/14
* Updated @rura/@warp. Now you can use both "@warp mapname x y" and
"@warp mapname,x,y". [LuzZza]
* Added at-command @tonpc <NPC_name> (warp to NPC). [LuzZza]
* Fixed @where at-command. [LuzZza]
* Fixed WZ_WATERBALL + HW_MAGICPOWER [Skotlex]
* Fixed incorrect range check in autospell-when-hit triggers. [Skotlex]
* Modified Wedding recall skills to behave as in official [Skotlex]

View File

@ -290,6 +290,7 @@ ACMD_FUNC(away); // LuzZza
ACMD_FUNC(main); // LuzZza
ACMD_FUNC(clone); // [Valaris]
ACMD_FUNC(tonpc); // LuzZza
/*==========================================
*AtCommandInfo atcommand_info[]<EFBFBD>\¢ÌÌè`
@ -603,6 +604,7 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_Clone, "@clone", 50, atcommand_clone },
{ AtCommand_Clone, "@slaveclone", 50, atcommand_clone },
{ AtCommand_Clone, "@evilclone", 50, atcommand_clone }, // [Valaris]
{ AtCommand_ToNPC, "@tonpc", 40, atcommand_tonpc }, // LuzZza
// add new commands before this line
{ AtCommand_Unknown, NULL, 1, NULL }
@ -1224,9 +1226,12 @@ int atcommand_rura(
memset(map_name, '\0', sizeof(map_name));
if (!message || !*message || sscanf(message, "%15s %d %d", map_name, &x, &y) < 1) {
clif_displaymessage(fd, "Please, enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).");
return -1;
if (!message || !*message ||
(sscanf(message, "%15s %d %d", map_name, &x, &y) < 3 &&
sscanf(message, "%15[^,],%d,%d", map_name, &x, &y) < 1)) {
clif_displaymessage(fd, "Please, enter a map (usage: @warp/@rura/@mapmove <mapname> <x> <y>).");
return -1;
}
if (x <= 0)
@ -1292,7 +1297,7 @@ int atcommand_where(
if (pl_sd == NULL)
return -1;
if(strncmp(sd->status.name,atcmd_player_name,NAME_LENGTH)==0)
if(strncmp(sd->status.name,atcmd_player_name,NAME_LENGTH)!=0)
return -1;
GM_level = pc_isGM(sd);//also hide gms depending on settings in battle_athena.conf, show if they are aid [Kevin]
@ -5982,6 +5987,38 @@ int atcommand_nuke(
return 0;
}
/*==========================================
* @tonpc
*------------------------------------------
*/
int atcommand_tonpc(const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
char npcname[NAME_LENGTH];
struct npc_data *nd;
nullpo_retr(-1, sd);
memset(npcname, 0, sizeof(npcname));
if (!message || !*message || sscanf(message, "%23[^\n]", npcname) < 1) {
clif_displaymessage(fd, "Please, enter a NPC name (usage: @tonpc <NPC_name>).");
return -1;
}
if ((nd = npc_name2id(npcname)) != NULL) {
if (pc_setpos(sd, map[nd->bl.m].index, nd->bl.x, nd->bl.y, 3) == 0)
clif_displaymessage(fd, msg_table[0]); // Warped.
else
return -1;
} else {
clif_displaymessage(fd, msg_table[111]); // This NPC doesn't exist.
return -1;
}
return 0;
}
/*==========================================
*

View File

@ -267,6 +267,7 @@ enum AtCommandType {
AtCommand_Main, // LuzZza
AtCommand_Clone, // [Valaris]
AtCommand_ToNPC, // LuzZza
// end <- Ahem, guys, don't place AtCommands after AtCommand_Unknown! [Skotlex]
AtCommand_Unknown,