version 1.76 | | version 1.77 |
---|
| | |
/* | | /* |
* static char *rcsid_time_c = | | * static char *rcsid_time_c = |
* "$Id: time.c,v 1.76 2005/10/07 19:38:50 akirschbaum Exp $"; | | * "$Id: time.c,v 1.77 2005/10/18 16:54:31 gros Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
static void stop_arrow (object *op) | | static void stop_arrow (object *op) |
{ | | { |
event *evt; | | /* Lauwenmark: Handle for plugin stop event */ |
/* GROS: Handle for plugin stop event */ | | execute_event(op, EVENT_STOP,NULL,NULL,NULL,SCRIPT_FIX_NOTHING); |
if ((evt = find_event(op, EVENT_STOP)) != NULL) | | |
{ | | |
CFParm CFP; | | |
int k, l, m; | | |
uint32 n; | | |
k = EVENT_STOP; | | |
l = SCRIPT_FIX_NOTHING; | | |
m = 0; | | |
n = 0; | | |
CFP.Value[0] = &k; | | |
CFP.Value[1] = NULL; | | |
CFP.Value[2] = op; | | |
CFP.Value[3] = NULL; | | |
CFP.Value[4] = NULL; | | |
CFP.Value[5] = &n; | | |
CFP.Value[6] = &m; | | |
CFP.Value[7] = &m; | | |
CFP.Value[8] = &l; | | |
CFP.Value[9] = (void*)evt->hook; | | |
CFP.Value[10]= (void*)evt->options; | | |
if (findPlugin(evt->plugin)>=0) | | |
((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); | | |
} | | |
if (op->inv) { | | if (op->inv) { |
object *payload = op->inv; | | object *payload = op->inv; |
remove_ob (payload); | | remove_ob (payload); |
| | |
| | |
void move_teleporter(object *op) { | | void move_teleporter(object *op) { |
object *tmp, *head=op; | | object *tmp, *head=op; |
event *evt; | | |
| | |
/* if this is a multipart teleporter, handle the other parts | | /* if this is a multipart teleporter, handle the other parts |
* The check for speed isn't strictly needed - basically, if | | * The check for speed isn't strictly needed - basically, if |
| | |
| | |
if(EXIT_PATH(head)) { | | if(EXIT_PATH(head)) { |
if(op->above->type==PLAYER) { | | if(op->above->type==PLAYER) { |
/* GROS: Handle for plugin TRIGGER event */ | | /* Lauwenmark: Handle for plugin TRIGGER event */ |
if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) { | | if (execute_event(op, EVENT_TRIGGER,op->above,NULL,NULL,SCRIPT_FIX_ALL) != 0) |
CFParm CFP; | | return; |
CFParm* CFR; | | |
int k, l, m; | | |
uint32 n; | | |
int rtn_script = 0; | | |
m = 0; | | |
n = 0; | | |
k = EVENT_TRIGGER; | | |
l = SCRIPT_FIX_ALL; | | |
CFP.Value[0] = &k; | | |
CFP.Value[1] = op; | | |
CFP.Value[2] = op->above; | | |
CFP.Value[3] = NULL; | | |
CFP.Value[4] = NULL; | | |
CFP.Value[5] = &n; | | |
CFP.Value[6] = &m; | | |
CFP.Value[7] = &m; | | |
CFP.Value[8] = &l; | | |
CFP.Value[9] = (void*)evt->hook; | | |
CFP.Value[10]= (void*)evt->options; | | |
if (findPlugin(evt->plugin)>=0) { | | |
CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); | | |
rtn_script = *(int *)(CFR->Value[0]); | | |
} | | |
if (rtn_script!=0) return; | | |
} | | |
enter_exit(op->above, head); | | enter_exit(op->above, head); |
} | | } |
else | | else |
| | |
free_object(head); | | free_object(head); |
return; | | return; |
} | | } |
/* GROS: Handle for plugin TRIGGER event */ | | /* Lauwenmark: Handle for plugin TRIGGER event */ |
if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) | | if (execute_event(op, EVENT_TRIGGER,op->above,NULL,NULL,SCRIPT_FIX_ALL)!= 0) |
{ | | return; |
CFParm CFP; | | |
CFParm* CFR; | | |
int k, l, m; | | |
uint32 n; | | |
int rtn_script = 0; | | |
m = 0; | | |
n = 0; | | |
k = EVENT_TRIGGER; | | |
l = SCRIPT_FIX_ALL; | | |
CFP.Value[0] = &k; | | |
CFP.Value[1] = op; | | |
CFP.Value[2] = op->above; | | |
CFP.Value[3] = NULL; | | |
CFP.Value[4] = NULL; | | |
CFP.Value[5] = &n; | | |
CFP.Value[6] = &m; | | |
CFP.Value[7] = &m; | | |
CFP.Value[8] = &l; | | |
CFP.Value[9] = (void*)evt->hook; | | |
CFP.Value[10]= (void*)evt->options; | | |
if (findPlugin(evt->plugin)>=0) | | |
{ | | |
CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); | | |
rtn_script = *(int *)(CFR->Value[0]); | | |
} | | |
if (rtn_script!=0) return; | | |
} | | |
transfer_ob(tmp,EXIT_X(head),EXIT_Y(head),0,head); | | transfer_ob(tmp,EXIT_X(head),EXIT_Y(head),0,head); |
} | | } |
else { | | else { |
/* Random teleporter */ | | /* Random teleporter */ |
/* GROS: Handle for plugin TRIGGER event */ | | /* Lauwenmark: Handle for plugin TRIGGER event */ |
if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) { | | if (execute_event(op, EVENT_TRIGGER,op->above,NULL,NULL,SCRIPT_FIX_ALL)!= 0) |
CFParm CFP; | | return; |
CFParm* CFR; | | |
int k, l, m; | | |
uint32 n; | | |
int rtn_script = 0; | | |
m = 0; | | |
n = 0; | | |
k = EVENT_TRIGGER; | | |
l = SCRIPT_FIX_ALL; | | |
CFP.Value[0] = &k; | | |
CFP.Value[1] = op; | | |
CFP.Value[2] = op->above; | | |
CFP.Value[3] = NULL; | | |
CFP.Value[4] = NULL; | | |
CFP.Value[5] = &n; | | |
CFP.Value[6] = &m; | | |
CFP.Value[7] = &m; | | |
CFP.Value[8] = &l; | | |
CFP.Value[9] = (void*)evt->hook; | | |
CFP.Value[10]= (void*)evt->options; | | |
if (findPlugin(evt->plugin)>=0) { | | |
CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); | | |
rtn_script = *(int *)(CFR->Value[0]); | | |
} | | |
if (rtn_script!=0) return; | | |
} | | |
teleport(head, TELEPORTER, tmp); | | teleport(head, TELEPORTER, tmp); |
} | | } |
} | | } |
| | |
void move_player_changer(object *op) { | | void move_player_changer(object *op) { |
object *player; | | object *player; |
object *walk; | | object *walk; |
event *evt; | | |
char c; | | char c; |
| | |
if (!op->above || !EXIT_PATH(op)) return; | | if (!op->above || !EXIT_PATH(op)) return; |
| | |
* needs to be on top. | | * needs to be on top. |
*/ | | */ |
if(op->above->type==PLAYER) { | | if(op->above->type==PLAYER) { |
/* GROS: Handle for plugin TRIGGER event */ | | /* Lauwenmark: Handle for plugin TRIGGER event */ |
if ((evt = find_event(op, EVENT_TRIGGER)) != NULL) { | | if (execute_event(op, EVENT_TRIGGER,op->above,NULL,NULL,SCRIPT_FIX_NOTHING)!=0) |
CFParm CFP; | | return; |
CFParm* CFR; | | |
int k, l, m; | | |
uint32 n; | | |
int rtn_script = 0; | | |
| | |
m = 0; | | |
n = 0; | | |
k = EVENT_TRIGGER; | | |
l = SCRIPT_FIX_NOTHING; | | |
CFP.Value[0] = &k; | | |
CFP.Value[1] = op; | | |
CFP.Value[2] = op->above; | | |
CFP.Value[3] = NULL; | | |
CFP.Value[4] = NULL; | | |
CFP.Value[5] = &n; | | |
CFP.Value[6] = &m; | | |
CFP.Value[7] = &m; | | |
CFP.Value[8] = &l; | | |
CFP.Value[9] = (void*)evt->hook; | | |
CFP.Value[10]= (void*)evt->options; | | |
if (findPlugin(evt->plugin)>=0) { | | |
CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP); | | |
rtn_script = *(int *)(CFR->Value[0]); | | |
} | | |
if (rtn_script!=0) return; | | |
} /* if event tied to this */ | | |
| | |
player=op->above; | | player=op->above; |
for(walk=op->inv;walk!=NULL;walk=walk->below) | | for(walk=op->inv;walk!=NULL;walk=walk->below) |
apply_changes_to_player(player,walk); | | apply_changes_to_player(player,walk); |
| | |
player->contr->bed_y = EXIT_Y(op); | | player->contr->bed_y = EXIT_Y(op); |
} | | } |
else | | else |
LOG(llevDebug, "WARNING: destination '%s' in player_changer must be an absolute path!\n", | | LOG(llevDebug, |
| | "WARNING: destination '%s' in player_changer must be an absolute path!\n", |
EXIT_PATH(op)); | | EXIT_PATH(op)); |
| | |
enter_exit(op->above,op); | | enter_exit(op->above,op); |
| | |
} | | } |
| | |
int process_object(object *op) { | | int process_object(object *op) { |
event *evt; | | |
| | |
if(QUERY_FLAG(op, FLAG_MONSTER)) | | if(QUERY_FLAG(op, FLAG_MONSTER)) |
if(move_monster(op) || QUERY_FLAG(op, FLAG_FREED)) | | if(move_monster(op) || QUERY_FLAG(op, FLAG_FREED)) |
| | |
} | | } |
return 1; | | return 1; |
} | | } |
/* GROS: Handle for plugin time event */ | | /* Lauwenmark: Handle for plugin time event */ |
if ((evt = find_event(op, EVENT_TIME)) != NULL) | | execute_event(op, EVENT_TIME,NULL,NULL,NULL,SCRIPT_FIX_NOTHING); |
{ | | |
CFParm CFP; | | |
int k, l, m; | | |
uint32 n; | | |
k = EVENT_TIME; | | |
l = SCRIPT_FIX_NOTHING; | | |
m = 0; | | |
n = 0; | | |
CFP.Value[0] = &k; | | |
CFP.Value[1] = NULL; | | |
CFP.Value[2] = op; | | |
CFP.Value[3] = NULL; | | |
CFP.Value[4] = NULL; | | |
CFP.Value[5] = &n; | | |
CFP.Value[6] = &m; | | |
CFP.Value[7] = &m; | | |
CFP.Value[8] = &l; | | |
CFP.Value[9] = (void*)evt->hook; | | |
CFP.Value[10]= (void*)evt->options; | | |
if (findPlugin(evt->plugin)>=0) | | |
((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); | | |
} | | |
switch(op->type) { | | switch(op->type) { |
case SPELL_EFFECT: | | case SPELL_EFFECT: |
move_spell_effect(op); | | move_spell_effect(op); |