summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-18 11:40:36 +0000
committerLance <Lance@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-18 11:40:36 +0000
commita899340d9059d43fd850d161136582998e8bc07e (patch)
tree16614b89f4e156153de58761e6bf0bcb0beaae15 /src/map/script.c
parentff21eb94130750acfe899b97b06a1fbe9e6790ef (diff)
downloadhercules-a899340d9059d43fd850d161136582998e8bc07e.tar.gz
hercules-a899340d9059d43fd850d161136582998e8bc07e.tar.bz2
hercules-a899340d9059d43fd850d161136582998e8bc07e.tar.xz
hercules-a899340d9059d43fd850d161136582998e8bc07e.zip
* Shinomori's method (kinda) of remote script execution with interaction.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6151 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/map/script.c b/src/map/script.c
index 56a644f0c..8d5d66087 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -10856,6 +10856,7 @@ int run_func(struct script_state *st)
int run_script_main(struct script_state *st)
{
int c/*,rerun_pos*/;
+ struct block_list *bl;
int cmdcount=script_config.check_cmdcount;
int gotocount=script_config.check_gotocount;
struct script_stack *stack=st->stack;
@@ -10868,6 +10869,15 @@ int run_script_main(struct script_state *st)
}
} else {
st->state = RUN;
+ if(st->oid && st->rid && (bl = map_id2bl(st->oid))){
+ if(bl->type == BL_PC){
+ clif_sendfakenpc(((TBL_PC *)bl),dummy_npc_id);
+ st->oid = dummy_npc_id;
+ } else if(bl->type == BL_NPC){
+ if(npc_checknear(((TBL_PC *)bl), bl->id))
+ clif_sendfakenpc(((struct map_session_data *)bl),st->oid);
+ }
+ }
}
while( st->state == RUN) {
c= get_com((unsigned char *) st->script,&st->pos);
@@ -10965,8 +10975,13 @@ int run_script_main(struct script_state *st)
{
struct map_session_data *sd=map_id2sd(st->rid);
st->pos=-1;
- if(sd && sd->npc_id==st->oid)
+ if(sd && sd->npc_id==st->oid){
+ if(sd->state.using_fake_npc){
+ clif_clearchar_id(sd->npc_id, 0, sd->fd);
+ sd->state.using_fake_npc = 0;
+ }
npc_event_dequeue(sd);
+ }
}
break;
case RERUNLINE: