summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-22 16:08:24 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-02-22 16:08:24 +0000
commitf65bf4bd28cd9240c889bfd2a1f4650d91760a2d (patch)
tree6730a4d5ca802cc2c4cdb128dca07f1e95cac0fb /src/map/atcommand.c
parent6b0b62a5b2a9d85f60afe4fe048403101bd8f39d (diff)
downloadhercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.tar.gz
hercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.tar.bz2
hercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.tar.xz
hercules-f65bf4bd28cd9240c889bfd2a1f4650d91760a2d.zip
* Corrected Spiral Pierce's hits in the skill_db
* Moved /common/*.o into a obj folder when compiling * Updated core and map server to jA 1094~1115 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1162 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 12e6c2306..3169c75ab 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -9,6 +9,7 @@
#include "../common/timer.h"
#include "../common/nullpo.h"
#include "../common/mmo.h"
+#include "../common/db.h"
#include "log.h"
#include "clif.h"
@@ -210,6 +211,8 @@ ACMD_FUNC(gmotd); // Added by MC Cameri, created by davidsiaw
ACMD_FUNC(misceffect); // by MC Cameri
ACMD_FUNC(mobsearch);
ACMD_FUNC(cleanmap);
+ACMD_FUNC(npctalk);
+ACMD_FUNC(pettalk);
ACMD_FUNC(autoloot); // by Upa-Kun
#ifndef TXT_ONLY
@@ -484,6 +487,8 @@ static AtCommandInfo atcommand_info[] = {
{ AtCommand_MiscEffect, "@misceffect", 50, atcommand_misceffect }, // by MC Cameri
{ AtCommand_MobSearch, "@mobsearch", 0, atcommand_mobsearch },
{ AtCommand_CleanMap, "@cleanmap", 0, atcommand_cleanmap },
+ { AtCommand_NpcTalk, "@npctalk", 0, atcommand_npctalk },
+ { AtCommand_PetTalk, "@pettalk", 0, atcommand_pettalk },
#ifndef TXT_ONLY // sql-only commands
{ AtCommand_CheckMail, "@checkmail", 1, atcommand_listmail }, // [Valaris]
@@ -1743,8 +1748,8 @@ int atcommand_whozeny(
clif_displaymessage(fd, output);
}
- free(zeny);
- free(counted);
+ aFree(zeny);
+ aFree(counted);
return 0;
}
@@ -7790,6 +7795,49 @@ atcommand_cleanmap(
}
/*==========================================
+ * NPC/PETに話させる
+ *------------------------------------------
+ */
+int
+atcommand_npctalk(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ char name[100],mes[100];
+ struct npc_data *nd;
+
+ if (sscanf(message, "%s %99[^\n]", name, mes) < 2)
+ return -1;
+
+ if (!(nd = npc_name2id(name)))
+ return -1;
+
+ clif_message(&nd->bl, mes);
+ return 0;
+}
+int
+atcommand_pettalk(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ char mes[100],temp[100];
+ struct pet_data *pd;
+
+ nullpo_retr(-1, sd);
+
+ if(!sd->status.pet_id || !(pd=sd->pd))
+ return -1;
+
+ if (sscanf(message, "%99[^\n]", mes) < 1)
+ return -1;
+
+ snprintf(temp, sizeof temp ,"%s : %s",sd->pet.name,mes);
+ clif_message(&pd->bl, temp);
+
+ return 0;
+}
+
+/*==========================================
*
*------------------------------------------
*/