Re: Ranged Weapons

From: AxL (axl@mindwarp.plymouth.edu)
Date: 01/06/97


>> 
>> The ranged weapon patch is great, but my question is, has anyone added exp
>> gain to it, and may i ask how did you go about it?
> 
> Not having looked at the patch....
> 
> try instead of a GET_HIT(victim) -= xxx
> (which is what I suspect that particular patch uses to cause damage)
> 
> to a damage() call...
> 

	Ok, I have done this, it compiles without complaining, and
when a char fires an arrow at the target, it hits fine, and gives
a little exp for the hit.  But on the hit that would be the death
blow, it crashes.  More than likely, I am just using the damage()
func incorrectly, but I cannot puzzle out how.  The strike_missile
code is below....the commented out part is the original GET_HIT
part...What I added is the dam and damage lines below it.


void strike_missile(struct char_data *ch, struct char_data *tch, int dir)
{
   int dam;
/*
   GET_HIT(tch) -= dice(GET_EQ(ch, WEAR_HOLD)->obj_flags.value[1],
                        GET_EQ(ch, WEAR_HOLD)->obj_flags.value[2]); 
*/
   dam = 0;   /* init */
   dam += dice(GET_EQ(ch, WEAR_HOLD)->obj_flags.value[1],
               GET_EQ(ch, WEAR_HOLD)->obj_flags.value[2]); 
   damage(ch, tch, dam, TYPE_UNDEFINED);

   send_to_char("You hit!\r\n", ch);
   sprintf(buf,"$O flies in from the %s and strikes %s.", dirs[rev_dir[dir]],
                   GET_NAME(tch));
   act(buf,FALSE, tch, 0, GET_EQ(ch, WEAR_HOLD),TO_ROOM);
   sprintf(buf, "$O flies in from the %s and hits YOU!",
                                   dirs[rev_dir[dir]]);
   act(buf, FALSE, tch, 0, GET_EQ(ch, WEAR_HOLD), TO_CHAR);
   return;
} 

--
-axl @)-->---   "Beneath the stain of time, the feeling disappears.
 axl@mindwarp    You are someone else.  I am still right here." - NIN

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST