Re: Charisma

From: Daniel [Trice] Koepke (dkoepke@global.california.com)
Date: 07/17/95


On Mon, 17 Jul 1995, David E. Berthiaume Jr. wrote:

> What I want is whenever a player meets a m,ob is for a charisma check
> like:
> if (number(1,20) <= GET_CHA(ch))
>   send_to_char("the mob looks at you with an indeferrence."); e
> else
>   (attack player cause check failed)
> 
> my problems are as follows
> a) how do I do this
> b) where in the code do I put it?


	This probably isn't a good idea.  But, let me see if I can figure 
it out for you.  Assuming number is the equivalent of number_range, and 
there's a GET_CHA macro :)  BTW: is circle's in_room an int?  why isn't 
it a room_data (or whatever) structure?


for( mob=world[ch->in_room].people; mob != NULL; mob=mob->next_in_room ) {
 /*
  * The following 'if' conditional checks if the mobile is aggressive,
  * and if the ch's charisma is under a random number from 3 to 10,
  * then the mobile will attack.  It is meant to replace the aggressive
  * code, you could remove ACT_AGGRESSIVE, and the other aggressive
  * checks, but, are you really sure you want EVERY mobile attacking at
  * random?
  *
  * -dak
  */
 if( IS_SET(mob->act, ACT_AGGRESSIVE) && GET_CHA(ch) <= number(3, 10) ) {
  /*
   * I haven't the slightest idea of what Circle's code to initiate
   * a fight is, so I'll leave that up to you.
   *
   * -dak
   */
 }
}



BTW: Jeremy, if you're reading, why not use typedef's?

typedef struct  char_data	* CHAR_DATA;

That should allow you to simply use:

CHAR_DATA * ch; /* or would you still need the pointer? */

Instead of:

struct char_data * ch;

A save of space, IMHO.



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