summaryrefslogtreecommitdiff
path: root/src/map/mail.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-30 11:44:12 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-30 11:44:12 +0000
commitc883ca205971275e576d34b54304c3c5c30f3580 (patch)
tree4d0a218a184099c61a311d65b50e93973c4c773a /src/map/mail.c
parent230ba4e3dd84a19f7dee67fdc97532e5869bef63 (diff)
downloadhercules-c883ca205971275e576d34b54304c3c5c30f3580.tar.gz
hercules-c883ca205971275e576d34b54304c3c5c30f3580.tar.bz2
hercules-c883ca205971275e576d34b54304c3c5c30f3580.tar.xz
hercules-c883ca205971275e576d34b54304c3c5c30f3580.zip
* updated map server to jA1137~1159
* Some tidying up in mob.c and skill.c git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1342 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mail.c')
-rw-r--r--src/map/mail.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index c7939cca1..46e80be9f 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -15,6 +15,7 @@
#include "clif.h"
#include "chrif.h"
#include "intif.h"
+#include "atcommand.h"
#include "pc.h"
#include "mail.h"
@@ -22,7 +23,7 @@ char mail_db[32] = "mail";
int MAIL_CHECK_TIME = 120000;
int mail_timer;
-extern char msg_table[1000][256]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
+//extern char *msg_table[1000]; // Server messages (0-499 reserved for GM commands, 500-999 reserved for others)
#ifdef MEMWATCH
#include "memwatch.h"
@@ -47,7 +48,7 @@ int mail_check(struct map_session_data *sd,int type)
if(mail_res) {
if (mysql_num_rows(mail_res) == 0) {
//clif_displaymessage(sd->fd,"You have no messages.");
- clif_displaymessage(sd->fd,msg_table[516]);
+ clif_displaymessage(sd->fd, msg_txt(516));
mysql_free_result(mail_res);
return 0;
@@ -69,18 +70,18 @@ int mail_check(struct map_session_data *sd,int type)
if(type==2 || type==3) {
if(atoi(mail_row[4])) {
//sprintf(message, "%d - From : %s (New - Priority)", i, mail_row[2]);
- sprintf(message, msg_table[511], i, mail_row[2]);
+ sprintf(message, msg_txt(511), i, mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
} else {
//sprintf(message, "%d - From : %s (New)", i, mail_row[2]);
- sprintf(message, msg_table[512], i, mail_row[2]);
+ sprintf(message, msg_txt(512), i, mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
}
}
} else if(type==2){
//sprintf(message, "%d - From : %s", i, mail_row[2]);
- sprintf(message, msg_table[513], i, mail_row[2]);
+ sprintf(message, msg_txt(513), i, mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
}
}
@@ -93,18 +94,18 @@ int mail_check(struct map_session_data *sd,int type)
if(i>0 && new_>0 && type==1) {
//sprintf(message, "You have %d new messages.", new_);
- sprintf(message, msg_table[514], new_);
+ sprintf(message, msg_txt(514), new_);
clif_displaymessage(sd->fd, jstrescape(message));
}
if(i>0 && new_>0 && priority>0 && type==1) {
//sprintf(message, "You have %d unread priority messages.", priority);
- sprintf(message, msg_table[515], priority);
+ sprintf(message, msg_txt(515), priority);
clif_displaymessage(sd->fd, jstrescape(message));
}
if(!new_) {
//clif_displaymessage(sd->fd, "You have no new messages.");
- clif_displaymessage(sd->fd, msg_table[516]);
+ clif_displaymessage(sd->fd, msg_txt(516));
}
return 0;
@@ -129,7 +130,7 @@ int mail_read(struct map_session_data *sd, int message_id)
if (mysql_num_rows(mail_res) == 0) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd, "Message not found.");
- clif_displaymessage(sd->fd, msg_table[517]);
+ clif_displaymessage(sd->fd, msg_txt(517));
return 0;
}
@@ -142,7 +143,7 @@ int mail_read(struct map_session_data *sd, int message_id)
}
//sprintf(message, "Reading message from %s", mail_row[2]);
- sprintf(message, msg_table[518], mail_row[2]);
+ sprintf(message, msg_txt(518), mail_row[2]);
clif_displaymessage(sd->fd, jstrescape(message));
sprintf(message, "%s", mail_row[3]);
@@ -179,7 +180,7 @@ int mail_delete(struct map_session_data *sd, int message_id)
if (mysql_num_rows(mail_res) == 0) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd, "Message not found.");
- clif_displaymessage(sd->fd, msg_table[517]);
+ clif_displaymessage(sd->fd, msg_txt(517));
return 0;
}
@@ -187,14 +188,14 @@ int mail_delete(struct map_session_data *sd, int message_id)
if(!atoi(mail_row[2]) && atoi(mail_row[3])) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd,"Cannot delete unread priority mail.");
- clif_displaymessage(sd->fd,msg_table[519]);
+ clif_displaymessage(sd->fd,msg_txt(519));
return 0;
}
if(!atoi(mail_row[4])) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd,"You have recieved new mail, use @listmail before deleting.");
- clif_displaymessage(sd->fd,msg_table[520]);
+ clif_displaymessage(sd->fd,msg_txt(520));
return 0;
}
sprintf(tmp_msql,"DELETE FROM `%s` WHERE `message_id` = \"%d\"", mail_db, atoi(mail_row[0]));
@@ -204,7 +205,7 @@ int mail_delete(struct map_session_data *sd, int message_id)
return 0;
}
//else clif_displaymessage(sd->fd,"Message deleted.");
- else clif_displaymessage(sd->fd,msg_table[521]);
+ else clif_displaymessage(sd->fd,msg_txt(521));
}
mysql_free_result(mail_res);
@@ -222,14 +223,14 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
if(pc_isGM(sd) < 80 && sd->mail_counter > 0) {
//clif_displaymessage(sd->fd,"You must wait 10 minutes before sending another message");
- clif_displaymessage(sd->fd,msg_table[522]);
+ clif_displaymessage(sd->fd,msg_txt(522));
return 0;
}
if(strcmp(name,"*")==0) {
if(pc_isGM(sd) < 80) {
//clif_displaymessage(sd->fd, "Access Denied.");
- clif_displaymessage(sd->fd, msg_table[523]);
+ clif_displaymessage(sd->fd, msg_txt(523));
return 0;
}
else
@@ -248,7 +249,7 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
if (mysql_num_rows(mail_res) == 0) {
mysql_free_result(mail_res);
//clif_displaymessage(sd->fd,"Character does not exist.");
- clif_displaymessage(sd->fd,msg_table[524]);
+ clif_displaymessage(sd->fd,msg_txt(524));
return 0;
}
@@ -273,7 +274,7 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag)
}
//clif_displaymessage(sd->fd,"Mail has been sent.");
- clif_displaymessage(sd->fd,msg_table[525]);
+ clif_displaymessage(sd->fd,msg_txt(525));
return 0;
}
@@ -310,7 +311,7 @@ int mail_check_timer(int tid,unsigned int tick,int id,int data)
sd->mail_counter--;
if(sd->status.account_id==atoi(mail_row[0]))
//clif_displaymessage(sd->fd, "You have new mail.");
- clif_displaymessage(sd->fd, msg_table[526]);
+ clif_displaymessage(sd->fd, msg_txt(526));
}
}
}