version 1.39 | | version 1.40 |
---|
| | |
/* | | /* |
* static char *rcsid_skills_c = | | * static char *rcsid_skills_c = |
* "$Id: skills.c,v 1.39 2003/03/07 07:33:14 mwedel Exp $"; | | * "$Id: skills.c,v 1.40 2003/06/26 11:27:43 gros Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
int write_note(object *pl, object *item, char *msg) { | | int write_note(object *pl, object *item, char *msg) { |
char buf[BOOK_BUF]; | | char buf[BOOK_BUF]; |
object *newBook = NULL; | | object *newBook = NULL; |
| | event *evt; |
| | |
/* a pair of sanity checks */ | | /* a pair of sanity checks */ |
if(!item||item->type!=BOOK) return 0; | | if(!item||item->type!=BOOK) return 0; |
| | |
return 0; | | return 0; |
} | | } |
/* GROS: Handle for plugin book writing (trigger) event */ | | /* GROS: Handle for plugin book writing (trigger) event */ |
if(item->event_hook[EVENT_TRIGGER] != NULL) | | if ((evt = find_event(item, EVENT_TRIGGER)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
int k, l, m; | | int k, l, m; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = item->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= item->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(item->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
{ | | { |
((PlugList[findPlugin(item->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); |
return strlen(msg); | | return strlen(msg); |
} | | } |
} | | } |
| | |
tag_t left_tag; | | tag_t left_tag; |
int eff_str = 0,maxc,str=op->stats.Str,dam=0; | | int eff_str = 0,maxc,str=op->stats.Str,dam=0; |
int pause_f,weight_f=0; | | int pause_f,weight_f=0; |
| | event *evt; |
float str_factor=1.0,load_factor=1.0,item_factor=1.0; | | float str_factor=1.0,load_factor=1.0,item_factor=1.0; |
| | |
if(throw_ob==NULL) { | | if(throw_ob==NULL) { |
| | |
play_sound_map(op->map, op->x, op->y, SOUND_THROW_OBJ); | | play_sound_map(op->map, op->x, op->y, SOUND_THROW_OBJ); |
#endif | | #endif |
/* GROS - Now we can call the associated script_throw event (if any) */ | | /* GROS - Now we can call the associated script_throw event (if any) */ |
if(throw_ob->event_hook[EVENT_THROW] != NULL) | | if ((evt = find_event(throw_ob, EVENT_THROW)) != NULL) |
{ | | { |
CFParm CFP; | | CFParm CFP; |
int k, l, m; | | int k, l, m; |
| | |
CFP.Value[6] = &m; | | CFP.Value[6] = &m; |
CFP.Value[7] = &m; | | CFP.Value[7] = &m; |
CFP.Value[8] = &l; | | CFP.Value[8] = &l; |
CFP.Value[9] = throw_ob->event_hook[k]; | | CFP.Value[9] = evt->hook; |
CFP.Value[10]= throw_ob->event_options[k]; | | CFP.Value[10]= evt->options; |
if (findPlugin(throw_ob->event_plugin[k])>=0) | | if (findPlugin(evt->plugin)>=0) |
((PlugList[findPlugin(throw_ob->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP)); |
} | | } |
#ifdef DEBUG_THROW | | #ifdef DEBUG_THROW |
LOG(llevDebug," pause_f=%d \n",pause_f); | | LOG(llevDebug," pause_f=%d \n",pause_f); |