version 1.64 | | version 1.65 |
---|
| | |
/* | | /* |
* static char *rcsid_monster_c = | | * static char *rcsid_monster_c = |
* "$Id: monster.c,v 1.64 2003/06/19 06:52:49 mwedel Exp $"; | | * "$Id: monster.c,v 1.65 2003/06/26 11:27:43 gros Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
CFParm CFP; | | CFParm CFP; |
int k, l, m; | | int k, l, m; |
char *cp, buf[MAX_BUF]; | | char *cp, buf[MAX_BUF]; |
| | event *evt; |
| | |
/* Move this commone area up here - shouldn't cost much extra cpu | | /* Move this commone area up here - shouldn't cost much extra cpu |
* time, and makes the function more readable */ | | * time, and makes the function more readable */ |
| | |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
| | |
/* GROS: Handle for plugin say event */ | | /* GROS: Handle for plugin say event */ |
if(npc->event_hook[EVENT_SAY] != NULL) | | if ((evt = find_event(npc, EVENT_SAY))!=NULL) |
{ | | { |
CFP.Value[2] = npc; | | CFP.Value[2] = npc; |
CFP.Value[3] = NULL; | | CFP.Value[3] = NULL; |
CFP.Value[9] = npc->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= npc->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(npc->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
((PlugList[findPlugin(npc->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); |
return 0; | | return 0; |
} | | } |
} | | } |
| | |
/* This allows the existence of "intelligent" weapons you can discuss with */ | | /* This allows the existence of "intelligent" weapons you can discuss with */ |
for(cobj=npc->inv;cobj!=NULL; cobj = cobj->below) | | for(cobj=npc->inv;cobj!=NULL; cobj = cobj->below) |
{ | | { |
if(cobj->event_hook[EVENT_SAY] != NULL) | | if ((evt = find_event(cobj, EVENT_SAY)) != NULL) |
{ | | { |
CFP.Value[2] = cobj; | | CFP.Value[2] = cobj; |
CFP.Value[3] = npc; | | CFP.Value[3] = npc; |
CFP.Value[9] = cobj->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= cobj->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(cobj->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
((PlugList[findPlugin(cobj->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); |
return 0; | | return 0; |
} | | } |
} | | } |