summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-05 20:51:58 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-05 20:51:58 +0000
commitce9b9e74f648f3dd52e4161d3183612ecd002f80 (patch)
treeb6069d2b4687cd979685c6d803ec93a5e54d0590 /src/map/npc.c
parentd9a43b19b761c9d1726fc971044634cd3fa917b8 (diff)
downloadhercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.tar.gz
hercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.tar.bz2
hercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.tar.xz
hercules-ce9b9e74f648f3dd52e4161d3183612ecd002f80.zip
Merging RREmu into rAthena -- quite a few stuff yet to be renamed, but we'll get it sorted.
Some of the stuff included in RREmu that is now part of rAthena: - RE Drop Rate Modifier - RE Experience Rate Modifier - RE Weapon MATK - RE Shield ASPD job-specific penalty - RE Cast Time - Renewal-specific item DEF - 3.1 classes. - All-New Mounts - Official Magical Reflection - And other perks, such as fully-functional @mapflag also merged eAthena 15006 into rAthena. For Bugs, Comments and Suggestions: http://rathena.org/board/tracker/ git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15009 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index dae395876..1762bc73b 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -199,7 +199,33 @@ struct npc_data* npc_name2id(const char* name)
{
return (struct npc_data *) strdb_get(npcname_db, name);
}
-
+/**
+ * For the Secure NPC Timeout option (check RRConfig/Secure.h) [RR]
+ **/
+#if SECURE_NPCTIMEOUT
+/**
+ * Timer to check for idle time and timeout the dialog if necessary
+ **/
+int npc_rr_secure_timeout_timer(int tid, unsigned int tick, int id, intptr_t data) {
+ struct map_session_data* sd = NULL;
+ if( (sd = map_id2sd(id)) == NULL || !sd->npc_id )
+ return 0;//Not logged in anymore OR no longer attached to a npc
+
+ if( DIFF_TICK(tick,sd->npc_idle_tick) > (SECURE_NPCTIMEOUT*1000) ) {
+ /**
+ * If we still have the NPC script attached, tell it to stop.
+ **/
+ if( sd->st )
+ sd->st->state = END;
+ /**
+ * This guy's been idle for longer than allowed, close him.
+ **/
+ clif_scriptclose(sd,sd->npc_id);
+ } else //Create a new instance of ourselves to continue
+ sd->npc_idle_timer = add_timer(gettick() + (SECURE_NPCTIMEOUT_INTERVAL*1000),npc_rr_secure_timeout_timer,sd->bl.id,0);
+ return 0;
+}
+#endif
/*==========================================
* イベントキューのイベント処理
*------------------------------------------*/
@@ -1114,6 +1140,15 @@ int npc_scriptcont(struct map_session_data* sd, int id)
return 1;
}
}
+ /**
+ * For the Secure NPC Timeout option (check RRConfig/Secure.h) [RR]
+ **/
+#if SECURE_NPCTIMEOUT
+ /**
+ * Update the last NPC iteration
+ **/
+ sd->npc_idle_tick = gettick();
+#endif
run_script_main(sd->st);
return 0;
@@ -3058,8 +3093,11 @@ static const char* npc_parse_mapflag(char* w1, char* w2, char* w3, char* w4, con
map[m].flag.sakura=state;
else if (!strcmpi(w3,"leaves"))
map[m].flag.leaves=state;
- else if (!strcmpi(w3,"rain"))
- map[m].flag.rain=state;
+ /**
+ * No longer available, keeping here just in case it's back someday. [Ind]
+ **/
+ //else if (!strcmpi(w3,"rain"))
+ // map[m].flag.rain=state;
else if (!strcmpi(w3,"nightenabled"))
map[m].flag.nightenabled=state;
else if (!strcmpi(w3,"nogo"))