Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re:Create Missile



Hello,

   I've got _a_ fix for the create missile problem; it's short so I'll 
included here.

spell_effect.c :

int cast_create_missile(object *op, int dir, char *stringarg)
{
  int missile_plus=0, missile_nrof;
  char *missile_name = NULL;
  archetype *at=NULL;
  object *tmp, *missile=NULL, *weap=NULL;

  for (tmp=op->inv; tmp != NULL; tmp=tmp->below)
    if (tmp->type == BOW && QUERY_FLAG(tmp, FLAG_APPLIED))
      weap= tmp;

  if (weap==NULL) missile_name = "arrow";
  else missile_name = weap->race;

  if (!stringarg || ((1 + SP_level_strength_adjust(op, SP_CREATE_MISSILE)) -
                     (3 * missile_plus)) < 0)
    missile_plus = SP_PARAMETERS[SP_CREATE_MISSILE].bdam +
                   SP_level_dam_adjust(op, SP_CREATE_MISSILE);
  else
    missile_plus = atoi(stringarg);
  if (missile_plus > 4)
    missile_plus = 4;
  else if (missile_plus < -4)
    missile_plus = -4;
  missile_nrof = SP_PARAMETERS[SP_CREATE_MISSILE].bdur *
                 ((1 + SP_level_strength_adjust(op, SP_CREATE_MISSILE)) -
                  (3 * missile_plus));
  if (missile_nrof<0) {
    draw_info(op,"Unable to create missile: bonus too high.");
    return 0;
  }
  missile = get_object();
  copy_object(&at->clone,missile);
  missile->nrof = missile_nrof;
  missile->magic = missile_plus;
  SET_FLAG(missile, FLAG_IDENTIFIED);
  if (!cast_create_obj(op,missile,dir))
    pick_up(op, missile);
  return 1;
}




Regards,

 __  __/  /   /   __  /    |   /    Tuan T. Doan
    /    /   /   /   /   / |  /     IEC Layer Testing and Advance Technology
   /    /   /   __  /   /  | /      2201 Lakeside Blvd.  P.O. Box 833871
__/  ______/ __/ __/ __/  __/       Richardson, TX 75083-3871
"It's a kind of magic" -Highlander  Phone: 6-444-4575/214-684-4575
Internet:  tdoan@bnr.ca             Fax:   6-444-3716/214-684-3716