Difference for server/spell_effect.c from version 1.86 to 1.87


version 1.86 version 1.87
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_spell_effect_c =   * static char *rcsid_spell_effect_c =
  *   "$Id: spell_effect.c,v 1.86 2002/12/18 16:52:12 garbled Exp $";   *   "$Id: spell_effect.c,v 1.87 2002/12/21 08:02:34 mwedel Exp $";
  */   */
   
   
Line 1753
 
Line 1753
   
 int summon_pet(object *op, int dir, SpellTypeFrom item) {  int summon_pet(object *op, int dir, SpellTypeFrom item) {
     int level, number, i;      int level, number, i;
     char *monster;  
     treasurelist *trlist = NULL;      treasurelist *trlist = NULL;
     treasure *tr, *prevtr = NULL;      treasure *tr, *prevtr = NULL;
   
Line 2078
 
Line 2077
 {  {
  int value=query_cost(obj, NULL, F_TRUE);   int value=query_cost(obj, NULL, F_TRUE);
   
  /* Give half price when we alchemy money (This should hopefully      /* Give third price when we alchemy money (This should hopefully
  * make it so that it isn't worth it to alchemy money, sell   * make it so that it isn't worth it to alchemy money, sell
  * the nuggets, alchemy the gold from that, etc.   * the nuggets, alchemy the gold from that, etc.
  * Otherwise, give 9 silver on the gold for other objects,   * Otherwise, give 9 silver on the gold for other objects,
  * so that it would still be more affordable to haul   * so that it would still be more affordable to haul
  * the stuff back to town.   * the stuff back to town.
  */   */
   
     if (QUERY_FLAG(obj, FLAG_UNPAID))      if (QUERY_FLAG(obj, FLAG_UNPAID))
  value=0;   value=0;
     else if (obj->type==MONEY || obj->type==GEM)      else if (obj->type==MONEY || obj->type==GEM)
  value /=3;   value /=3;
     else if (QUERY_FLAG(obj, FLAG_UNPAID))  
  value=0;  
     else      else
  value *= 0.9;   value *= 0.9;
   
     if ((obj->value>0) && rndm(0, 29)) {      if ((obj->value>0) && rndm(0, 29)) {
  static int value_store;   static int value_store;
  int count;   int count;
   
  value_store += value;   value_store += value;
  count = value_store / large->value;   count = value_store / large->value;
  *large_nuggets += count;   *large_nuggets += count;
Line 2126
 
Line 2125
  int x, int y)   int x, int y)
 {  {
  object *tmp;   object *tmp;
       int flag=0;
   
       /* Put any nuggets below the player, but we can only pass this
        * flag if we are on the same space as the player
        */
       if (x == op->x && y == op->y) flag = INS_BELOW_ORIGINATOR;
   
  if (small_nuggets) {   if (small_nuggets) {
  tmp = get_object();   tmp = get_object();
Line 2133
 
Line 2138
  tmp-> nrof = small_nuggets;   tmp-> nrof = small_nuggets;
  tmp->x = x;   tmp->x = x;
  tmp->y = y;   tmp->y = y;
  insert_ob_in_map(tmp, op->map, op,0);   insert_ob_in_map(tmp, op->map, op, flag);
  }   }
  if (large_nuggets) {   if (large_nuggets) {
  tmp = get_object();   tmp = get_object();
Line 2141
 
Line 2146
  tmp-> nrof = large_nuggets;   tmp-> nrof = large_nuggets;
  tmp->x = x;   tmp->x = x;
  tmp->y = y;   tmp->y = y;
  insert_ob_in_map(tmp, op->map, op,0);   insert_ob_in_map(tmp, op->map, op, flag);
  }   }
 }  }
   
Line 2152
 
Line 2157
   
   if(op->type!=PLAYER)    if(op->type!=PLAYER)
     return 0;      return 0;
   
   /* Put a maximum weight of items that can be alchemied.  Limits the power    /* Put a maximum weight of items that can be alchemied.  Limits the power
    * some, and also prevents people from alcheming every table/chair/clock     * some, and also prevents people from alcheming every table/chair/clock
    * in sight     * in sight
    */     */
   /* weight_max = 100000 + 50000*op->level; */  
   weight_max = 100000 + 50000*SK_level(op);    weight_max = 100000 + 50000*SK_level(op);
   small=get_archetype("smallnugget"),    small=get_archetype("smallnugget"),
   large=get_archetype("largenugget");    large=get_archetype("largenugget");
Line 2175
 
Line 2180
    if (tmp->weight>0 && !QUERY_FLAG(tmp, FLAG_NO_PICK) &&     if (tmp->weight>0 && !QUERY_FLAG(tmp, FLAG_NO_PICK) &&
        !QUERY_FLAG(tmp, FLAG_ALIVE) &&         !QUERY_FLAG(tmp, FLAG_ALIVE) &&
        !QUERY_FLAG(tmp, FLAG_IS_CAULDRON)) {         !QUERY_FLAG(tmp, FLAG_IS_CAULDRON)) {
   
      if (tmp->inv) {       if (tmp->inv) {
  object *next1, *tmp1;   object *next1, *tmp1;
  for (tmp1 = tmp->inv; tmp1!=NULL; tmp1=next1) {   for (tmp1 = tmp->inv; tmp1!=NULL; tmp1=next1) {
Line 2206
 
Line 2212
   }    }
   free_object(large);    free_object(large);
   free_object(small);    free_object(small);
       /* reset this so that if player standing on a big pile of stuff,
        * it is redrawn properly.
        */
       op->contr->socket.look_position = 0;
   return 1;    return 1;
 }  }
   
Line 2398
 
Line 2408
      case SP_SHOW_INVIS:       case SP_SHOW_INVIS:
      /* Might there be other objects that we can make visibile? */       /* Might there be other objects that we can make visibile? */
      if (tmp->invisible && (QUERY_FLAG(tmp, FLAG_MONSTER) ||        if (tmp->invisible && (QUERY_FLAG(tmp, FLAG_MONSTER) ||
  tmp->type==PLAYER && !QUERY_FLAG(tmp, FLAG_WIZ) ||   (tmp->type==PLAYER && !QUERY_FLAG(tmp, FLAG_WIZ)) ||
  tmp->type==CF_HANDLE ||    tmp->type==CF_HANDLE ||
  tmp->type==TRAPDOOR || tmp->type==EXIT || tmp->type==HOLE ||   tmp->type==TRAPDOOR || tmp->type==EXIT || tmp->type==HOLE ||
  tmp->type==BUTTON || tmp->type==TELEPORTER ||   tmp->type==BUTTON || tmp->type==TELEPORTER ||


Legend:
line(s) removed in v.1.86 
line(s) changed
 line(s) added in v.1.87

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