summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authormc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-21 15:11:59 +0000
committermc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-21 15:11:59 +0000
commitaf7fa927b91742598448033726aea70cff614c15 (patch)
tree09b3a6d71d2197840e908a1b9bd048a872feee0a /src/map
parent06904006aa1c0960067b6c04ae4980ee36006f32 (diff)
downloadhercules-af7fa927b91742598448033726aea70cff614c15.tar.gz
hercules-af7fa927b91742598448033726aea70cff614c15.tar.bz2
hercules-af7fa927b91742598448033726aea70cff614c15.tar.xz
hercules-af7fa927b91742598448033726aea70cff614c15.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@295 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.c2
-rw-r--r--src/map/charcommand.c50
-rw-r--r--src/map/charcommand.h1
3 files changed, 52 insertions, 1 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 9343b5bed..996f8be9a 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1103,7 +1103,7 @@ int atcommand_jumpto(
char character[100];
char output[200];
struct map_session_data *pl_sd = NULL;
-
+
nullpo_retr(-1, sd);
if (!message || !*message || sscanf(message, "%99[^\n]", character) < 1) {
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index e26c339d2..b510cf9f9 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -379,3 +379,53 @@ int charcommand_petrename(
return 0;
}
+
+
+/*==========================================
+ *
+ *------------------------------------------
+ */
+int charcommand_petfriendly(
+ const int fd, struct map_session_data* sd,
+ const char* command, const char* message)
+{
+ int friendly = 0;
+ int t = 0;
+
+ if (!message || !*message || (friendly = atoi(message)) < 0) {
+ clif_displaymessage(fd, "Please, enter a valid value (usage: "
+ "#petfriendly <0-1000> <player>).");
+ return 0;
+ }
+
+ if (sd->status.pet_id > 0 && sd->pd) {
+ if (friendly >= 0 && friendly <= 1000) {
+ if (friendly != sd->pet.intimate) {
+ t = sd->pet.intimate;
+ sd->pet.intimate = friendly;
+ clif_send_petstatus(sd);
+ if (battle_config.pet_status_support) {
+ if ((sd->pet.intimate > 0 && t <= 0) ||
+ (sd->pet.intimate <= 0 && t > 0)) {
+ if (sd->bl.prev != NULL)
+ pc_calcstatus(sd, 0);
+ else
+ pc_calcstatus(sd, 2);
+ }
+ }
+ clif_displaymessage(fd, msg_table[182]); // Pet friendly value changed!
+ } else {
+ clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
+ return -1;
+ }
+ } else {
+ clif_displaymessage(fd, msg_table[37]); // An invalid number was specified.
+ return -1;
+ }
+ } else {
+ clif_displaymessage(fd, msg_table[184]); // Sorry, but you have no pet.
+ return -1;
+ }
+
+ return 0;
+}
diff --git a/src/map/charcommand.h b/src/map/charcommand.h
index ed191aa8f..9a89f001e 100644
--- a/src/map/charcommand.h
+++ b/src/map/charcommand.h
@@ -5,6 +5,7 @@ enum CharCommandType {
CharCommand_None = -1,
CharCommandJobChange,
CharCommandPetRename,
+ CharCommandPetFriendly,
#ifdef TXT_ONLY
/* TXT_ONLY */