summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-22 10:26:39 +0000
committermc_cameri <mc_cameri@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-22 10:26:39 +0000
commit0113082fd5a64bb8787f52b293f0018b557b8452 (patch)
tree0ed3c8c117767a0e1f7ac0c493bf848e8e710549 /src
parent1741d214fc89dbe02a704474740d92cd7e8618a2 (diff)
downloadhercules-0113082fd5a64bb8787f52b293f0018b557b8452.tar.gz
hercules-0113082fd5a64bb8787f52b293f0018b557b8452.tar.bz2
hercules-0113082fd5a64bb8787f52b293f0018b557b8452.tar.xz
hercules-0113082fd5a64bb8787f52b293f0018b557b8452.zip
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/athena@311 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/atcommand.c6
-rw-r--r--src/map/charcommand.c45
-rw-r--r--src/map/clif.c11
3 files changed, 42 insertions, 20 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index 286f5837f..b8368db1d 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -1974,6 +1974,7 @@ int atcommand_die(
const int fd, struct map_session_data* sd,
const char* command, const char* message)
{
+ clif_specialeffect(&sd->bl,450,1);
pc_damage(NULL, sd, sd->status.hp + 1);
clif_displaymessage(fd, msg_table[13]); // A pity! You've died.
@@ -4571,7 +4572,7 @@ int atcommand_doom(
{
struct map_session_data *pl_sd;
int i;
-
+ clif_specialeffect(&sd->bl,450,2);
for(i = 0; i < fd_max; i++) {
if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && i != fd &&
pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
@@ -4594,11 +4595,12 @@ int atcommand_doommap(
{
struct map_session_data *pl_sd;
int i;
-
+ clif_specialeffect(&sd->bl,450,3);
for (i = 0; i < fd_max; i++) {
if (session[i] && (pl_sd = session[i]->session_data) && pl_sd->state.auth && i != fd && sd->bl.m == pl_sd->bl.m &&
pc_isGM(sd) >= pc_isGM(pl_sd)) { // you can doom only lower or same gm level
pc_damage(NULL, pl_sd, pl_sd->status.hp + 1);
+// clif_specialeffect(&pl_sd->bl,450,1);
clif_displaymessage(pl_sd->fd, msg_table[61]); // The holy messenger has given judgement.
}
}
diff --git a/src/map/charcommand.c b/src/map/charcommand.c
index b510cf9f9..6a8b0cbeb 100644
--- a/src/map/charcommand.c
+++ b/src/map/charcommand.c
@@ -391,41 +391,50 @@ int charcommand_petfriendly(
{
int friendly = 0;
int t = 0;
+ char character[100];
+ struct map_session_data *pl_sd;
- if (!message || !*message || (friendly = atoi(message)) < 0) {
+ memset(character, '\0', sizeof(character));
+ if (!message || !*message || sscanf(message,"%d %s",&friendly,character) < 2) {
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);
+ if (((pl_sd = map_nick2sd(character)) != NULL) && pc_isGM(sd)>pc_isGM(pl_sd)) {
+ if (pl_sd->status.pet_id > 0 && pl_sd->pd) {
+ if (friendly >= 0 && friendly <= 1000) {
+ if (friendly != pl_sd->pet.intimate) {
+ t = pl_sd->pet.intimate;
+ pl_sd->pet.intimate = friendly;
+ clif_send_petstatus(pl_sd);
+ if (battle_config.pet_status_support) {
+ if ((pl_sd->pet.intimate > 0 && t <= 0) ||
+ (pl_sd->pet.intimate <= 0 && t > 0)) {
+ if (pl_sd->bl.prev != NULL)
+ pc_calcstatus(pl_sd, 0);
+ else
+ pc_calcstatus(pl_sd, 2);
+ }
}
+ clif_displaymessage(pl_sd->fd, msg_table[182]); // Pet friendly value changed!
+ clif_displaymessage(sd->fd, msg_table[182]); // Pet friendly value changed!
+ } else {
+ clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
+ return -1;
}
- clif_displaymessage(fd, msg_table[182]); // Pet friendly value changed!
} else {
- clif_displaymessage(fd, msg_table[183]); // Pet friendly is already the good value.
+ clif_displaymessage(fd, msg_table[37]); // An invalid number was specified.
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.
+ clif_displaymessage(fd, msg_table[3]); // Character not found.
return -1;
}
return 0;
}
+
diff --git a/src/map/clif.c b/src/map/clif.c
index 9b5b16236..41cc4c13c 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7051,6 +7051,17 @@ int clif_specialeffect(struct block_list *bl, int type, int flag) {
WBUFL(buf,2) = bl->id;
WBUFL(buf,6) = type;
+ if (flag == 3) {
+// struct map_session_data *sd;
+ struct map_session_data *pl_sd;
+ int i;
+ for(i = 0; i < fd_max; i++) {
+ if (session[i] && (pl_sd = session[i]->session_data) != NULL &&
+ pl_sd->state.auth &&
+ (pc_isGM((struct map_session_data *)&bl) > pc_isGM((struct map_session_data *)&pl_sd->bl)))
+ clif_specialeffect(&pl_sd->bl, type, 1);
+ }
+ }
if (flag == 2) {
struct map_session_data *sd;
int i;