version 1.68 | | version 1.69 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.68 2002/11/13 00:26:13 garbled Exp $"; | | * "$Id: apply.c,v 1.69 2002/11/26 08:48:20 garbled Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
CLEAR_FLAG (op->container, FLAG_WALK_OFF); | | CLEAR_FLAG (op->container, FLAG_WALK_OFF); |
CLEAR_FLAG (op->container, FLAG_FLY_OFF); | | CLEAR_FLAG (op->container, FLAG_FLY_OFF); |
} | | } |
#ifdef PLUGINS | | |
/* GROS: Handle for plugin close event */ | | /* GROS: Handle for plugin close event */ |
if(tmp->event_hook[EVENT_CLOSE] != NULL) | | if(tmp->event_hook[EVENT_CLOSE] != NULL) |
{ | | { |
| | |
if (rtn_script!=0) return 1; | | if (rtn_script!=0) return 1; |
} | | } |
} | | } |
#endif | | |
new_draw_info_format(NDI_UNIQUE, 0, op, "You close %s.", | | new_draw_info_format(NDI_UNIQUE, 0, op, "You close %s.", |
query_name(op->container)); | | query_name(op->container)); |
CLEAR_FLAG(op->container, FLAG_APPLIED); | | CLEAR_FLAG(op->container, FLAG_APPLIED); |
| | |
} | | } |
recursion_depth++; | | recursion_depth++; |
if (trap->head) trap=trap->head; | | if (trap->head) trap=trap->head; |
#ifdef PLUGINS | | |
/* GROS: Handle for plugin close event */ | | /* GROS: Handle for plugin close event */ |
if(trap->event_hook[EVENT_TRIGGER] != NULL) | | if(trap->event_hook[EVENT_TRIGGER] != NULL) |
{ | | { |
| | |
if (rtn_script!=0) return; | | if (rtn_script!=0) return; |
} | | } |
} | | } |
#endif | | |
switch (trap->type) | | switch (trap->type) |
{ | | { |
case PLAYERMOVER: | | case PLAYERMOVER: |
| | |
| | |
new_draw_info_format (NDI_UNIQUE, 0, op, | | new_draw_info_format (NDI_UNIQUE, 0, op, |
"You open the %s and start reading.", tmp->name); | | "You open the %s and start reading.", tmp->name); |
#ifdef PLUGINS | | |
/* GROS: Handle for plugin trigger event */ | | /* GROS: Handle for plugin trigger event */ |
if(tmp->event_hook[EVENT_APPLY] != NULL) | | if(tmp->event_hook[EVENT_APPLY] != NULL) |
{ | | { |
| | |
((PlugList[findPlugin(tmp->event_plugin[k])].eventfunc) (&CFP)); | | ((PlugList[findPlugin(tmp->event_plugin[k])].eventfunc) (&CFP)); |
} | | } |
else | | else |
#endif | | |
new_draw_info(NDI_UNIQUE | NDI_NAVY, 0, op, tmp->msg); | | new_draw_info(NDI_UNIQUE | NDI_NAVY, 0, op, tmp->msg); |
| | |
/* gain xp from reading */ | | /* gain xp from reading */ |
| | |
if (op->type != PLAYER && tmp->type == TREASURE) | | if (op->type != PLAYER && tmp->type == TREASURE) |
return 0; | | return 0; |
| | |
#ifdef PLUGINS | | |
/* GROS: Handle for plugin trigger event */ | | /* GROS: Handle for plugin trigger event */ |
if(tmp->event_hook[EVENT_APPLY] != NULL) | | if(tmp->event_hook[EVENT_APPLY] != NULL) |
{ | | { |
| | |
if (rtn_script!=0) return 1; | | if (rtn_script!=0) return 1; |
} | | } |
} | | } |
#endif | | |
switch (tmp->type) | | switch (tmp->type) |
{ | | { |
case CF_HANDLE: | | case CF_HANDLE: |
| | |
new_draw_info_format(NDI_UNIQUE, 0, who, "You wield %s.",query_name(op)); | | new_draw_info_format(NDI_UNIQUE, 0, who, "You wield %s.",query_name(op)); |
| | |
(void) change_abil (who,op); | | (void) change_abil (who,op); |
#ifdef PLUGINS | | |
/* GROS: update the current_weapon_script field (used with EVENT_ATTACK for weapons) */ | | /* GROS: update the current_weapon_script field (used with EVENT_ATTACK for weapons) */ |
if (op->event_hook[EVENT_ATTACK] != NULL) { | | if (op->event_hook[EVENT_ATTACK] != NULL) { |
LOG(llevDebug, "Scripting Weapon wielded\n"); | | LOG(llevDebug, "Scripting Weapon wielded\n"); |
if (who->current_weapon_script) free_string(who->current_weapon_script); | | if (who->current_weapon_script) free_string(who->current_weapon_script); |
who->current_weapon_script=add_string(query_name(op)); | | who->current_weapon_script=add_string(query_name(op)); |
} | | } |
#endif | | |
who->current_weapon = op; | | who->current_weapon = op; |
break; | | break; |
| | |