summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-24 15:31:28 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-24 15:31:28 +0000
commit85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7 (patch)
tree3954f54f4adce21db6566710b1b02555b4d241a3 /src/map/map.c
parent0e67259ca839671dac06dd804d6867ebe33df74a (diff)
downloadhercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.gz
hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.bz2
hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.tar.xz
hercules-85fdcfa5c7831dc87a2b6810b3e2ebd5e3ec49c7.zip
* Added 'map_charid2id'
* Changed monster damage logging to save char ID's * Implemented 'event_script_type' * Set Emsolute Develop as a learnable skill * Updated 'require_glory_guild' * Allow monsters to cast skills near themselves even when monster_nofootset is set to 'yes' * Print number of online users in online.txt/.html even if there's only 1 user git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1282 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 9dcf541c1..205c21cd2 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1446,10 +1446,16 @@ int map_quit(struct map_session_data *sd) {
if(!sd->state.waitingdisconnect) {
if (sd->state.event_disconnect) {
- struct npc_data *npc;
- if ((npc = npc_name2id(script_config.logout_event_name))) {
- run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCLogoutNPC
- sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.logout_event_name);
+ if (script_config.event_script_type == 0) {
+ struct npc_data *npc;
+ if ((npc = npc_name2id(script_config.logout_event_name))) {
+ run_script(npc->u.scr.script,0,sd->bl.id,npc->bl.id); // PCLogoutNPC
+ sprintf (tmp_output, "Event '"CL_WHITE"%s"CL_RESET"' executed.\n", script_config.logout_event_name);
+ ShowStatus(tmp_output);
+ }
+ } else {
+ sprintf (tmp_output, "%d '"CL_WHITE"%s"CL_RESET"' events executed.\n",
+ npc_event_doall_id(script_config.logout_event_name, sd->bl.id), script_config.logout_event_name);
ShowStatus(tmp_output);
}
}
@@ -1601,6 +1607,18 @@ char * map_charid2nick(int id) {
return p->nick;
}
+struct map_session_data * map_charid2sd(int id) {
+ int i;
+ struct map_session_data *sd;
+
+ if (id <= 0) return 0;
+
+ for(i = 0; i < fd_max; i++)
+ if (session[i] && (sd = (struct map_session_data*)session[i]->session_data) && sd->status.char_id == id)
+ return sd;
+
+ return NULL;
+}
/*==========================================
* Search session data from a nick name