Difference for server/attack.c from version 1.88 to 1.89


version 1.88 version 1.89
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_attack_c =   * static char *rcsid_attack_c =
  *   "$Id: attack.c,v 1.88 2003/06/16 05:15:35 mwedel Exp $";   *   "$Id: attack.c,v 1.89 2003/06/26 11:27:43 gros Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 583
 
Line 583
     uint32 type;      uint32 type;
     char *op_name = NULL;      char *op_name = NULL;
     tag_t op_tag, hitter_tag;      tag_t op_tag, hitter_tag;
       event *evt;
   
     if (get_attack_mode (&op, &hitter, &simple_attack))      if (get_attack_mode (&op, &hitter, &simple_attack))
         goto error;          goto error;
   
     /* GROS: Handle for plugin attack event */      /* GROS: Handle for plugin attack event */
     if(op->event_hook[EVENT_ATTACK] != NULL)      if ((evt = find_event(op, EVENT_ATTACK)) != NULL)
     {      {
         CFParm CFP;          CFParm CFP;
         int k, l, m;          int k, l, m;
Line 604
 
Line 605
         CFP.Value[6] = &base_dam;          CFP.Value[6] = &base_dam;
         CFP.Value[7] = &base_wc;          CFP.Value[7] = &base_wc;
         CFP.Value[8] = &l;          CFP.Value[8] = &l;
         CFP.Value[9] = op->event_hook[k];          CFP.Value[9] = evt->hook;
         CFP.Value[10]= op->event_options[k];          CFP.Value[10]= evt->options;
         if (findPlugin(op->event_plugin[k])>=0)          if (findPlugin(evt->plugin)>=0)
             ((PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP));              ((PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP));
     }      }
     /* GROS: This is used to handle script_weapons with weapons. Only used for players */      /* GROS: This is used to handle script_weapons with weapons. Only used for players */
     if (hitter->type==PLAYER)      if (hitter->type==PLAYER)
Line 615
 
Line 616
         if (hitter->current_weapon != NULL)          if (hitter->current_weapon != NULL)
         {          {
             /* GROS: Handle for plugin attack event */              /* GROS: Handle for plugin attack event */
             if(hitter->current_weapon->event_hook[EVENT_ATTACK] != NULL)              if ((evt = find_event(hitter->current_weapon, EVENT_ATTACK)) != NULL)
             {              {
                 CFParm CFP;                  CFParm CFP;
                 int k, l, n;                  int k, l, n;
Line 631
 
Line 632
                 CFP.Value[6] = &base_dam;                  CFP.Value[6] = &base_dam;
                 CFP.Value[7] = &base_wc;                  CFP.Value[7] = &base_wc;
                 CFP.Value[8] = &l;                  CFP.Value[8] = &l;
                 CFP.Value[9] = hitter->current_weapon->event_hook[k];                  CFP.Value[9] = evt->hook;
                 CFP.Value[10]= hitter->current_weapon->event_options[k];                  CFP.Value[10]= evt->options;
  if (findPlugin(hitter->current_weapon->event_plugin[k])>=0)   if (findPlugin(evt->plugin)>=0)
      (PlugList[findPlugin(hitter->current_weapon->event_plugin[k])].eventfunc) (&CFP);       (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
             }              }
         };          };
     };      };
Line 817
 
Line 818
     int sretval = 0; /* GROS - Needed for script return value */      int sretval = 0; /* GROS - Needed for script return value */
     tag_t victim_tag, hitter_tag;      tag_t victim_tag, hitter_tag;
     sint16 victim_x, victim_y;      sint16 victim_x, victim_y;
       event *evt;
   
     /* Disassemble missile */      /* Disassemble missile */
     if (op->inv) {      if (op->inv) {
Line 839
 
Line 841
     victim_tag = victim->count;      victim_tag = victim->count;
     hitter_tag = hitter->count;      hitter_tag = hitter->count;
     /* GROS: Handling plugin attack event for thrown items */      /* GROS: Handling plugin attack event for thrown items */
     if(op->event_hook[EVENT_ATTACK] != NULL)      if ((evt = find_event(op, EVENT_ATTACK)) != NULL)
     {      {
         CFParm CFP;          CFParm CFP;
         CFParm* CFR;          CFParm* CFR;
Line 856
 
Line 858
         CFP.Value[6] = &(op->stats.dam);          CFP.Value[6] = &(op->stats.dam);
         CFP.Value[7] = &(op->stats.wc);          CFP.Value[7] = &(op->stats.wc);
         CFP.Value[8] = &l;          CFP.Value[8] = &l;
         CFP.Value[9] = op->event_hook[k];          CFP.Value[9] = evt->hook;
         CFP.Value[10]= op->event_options[k];          CFP.Value[10]= evt->options;
         if (findPlugin(op->event_plugin[k])>=0)          if (findPlugin(evt->plugin)>=0)
         {          {
             CFR = (PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP);              CFR = (PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
             sretval = *(int *)(CFR->Value[0]);              sretval = *(int *)(CFR->Value[0]);
         }          }
     }      }
Line 1310
 
Line 1312
     object *owner=NULL, *old_skill;      object *owner=NULL, *old_skill;
     int evtid;      int evtid;
     CFParm CFP;      CFParm CFP;
       event *evt;
   
     if (op->stats.hp>=0)      if (op->stats.hp>=0)
  return -1;   return -1;
   
     /* GROS: Handle for plugin death event */      /* GROS: Handle for plugin death event */
     if(op->event_hook[EVENT_DEATH] != NULL)      if ((evt = find_event(op, EVENT_DEATH)) != NULL)
     {      {
         CFParm* CFR;          CFParm* CFR;
         int k, l, m;          int k, l, m;
Line 1331
 
Line 1334
         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] = op->event_hook[k];          CFP.Value[9] = evt->hook;
         CFP.Value[10]= op->event_options[k];          CFP.Value[10]= evt->options;
         if (findPlugin(op->event_plugin[k])>=0)          if (findPlugin(evt->plugin)>=0)
         {          {
             CFR =(PlugList[findPlugin(op->event_plugin[k])].eventfunc) (&CFP);              CFR =(PlugList[findPlugin(evt->plugin)].eventfunc) (&CFP);
             killed_script_rtn = *(int *)(CFR->Value[0]);              killed_script_rtn = *(int *)(CFR->Value[0]);
             if (killed_script_rtn)              if (killed_script_rtn)
                 return 0;                  return 0;


Legend:
line(s) removed in v.1.88 
line(s) changed
 line(s) added in v.1.89

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:24