Re: GUILD related layout

From: Web Remedies Network (webremedies@home.com)
Date: 03/28/01


Thanks welcor for the information you supplied, I am writing again
to pose another series of questions.. and apologize for the tedious
word wrapping that may be involved as I have not fully customized
my mailing client.

Objectives: Include medit related section where mobs can be designated
any of the SKILLS/SPELLS that exist in the game, as abilities for
training.  For example:

L) NPC Flags : SENTINEL ISNPC AWARE !CHARM !SUMMN !SLEEP !BASH !BLIND
M) AFF Flags : SENSE-LIFE SANCT !TRACK
T) Teaches   : BASH KICK FIREBALL MAGIC-MISSILE SLEEP CREATE-FOOD
               CURE_CRITIC HEAL DISARM BANDAGE
S) Script    : Not set.
Q) Quit
Enter choice :

- Or in similiar form.

Here's what I have so far.

struct trainer_data {
 int spell_num;
 int percent;
 int cost;
 struct trainer_data *next;
};

 struct trainer_data trn_skills[MAX_SKILLS + 1]

1-> MAX_SPELLS = (all spells found in game)
MAX_SPELLS + 1 -> MAX_SKILLS = (all skills found in game)

Now for running through the structure in terms of *next, I was
thinking of something along the lines of:

 struct trainer_data *trainer_pointer = &trn_skills[MAX_SKILLS+1] - OR
 should this be: struct trainer_data *trainer_pointer = &trn_skills[1]


Ok, now is initialization of the structures elements necessarily
needed.  What I mean is do I have to refer each *next related value,
to the next and must I initialize each element to 0.  I believe welcor
referred to initializing one the ones needed, and then cyclying through
but how does one properly link the next pointer for the next values when
some trainers may have 2 spells and 1 skill to teach while others may
have 30.   The reason I ask, is I want to know if the below is either
a waste of time, and or memory.

 I was thinking something along the lines of:

for(i=1; i < (MAX_SKILLS + 1); i++)
 trn_skills[i].next = &trn_skills[i + 1];

And for the medit related aspect of assigning and or viewing a mobs,
designated abilities I was thinking:

 for(i = 1; i < (MAX_SKILLS + 1); i++) {
  if(trainer_pointer != 0) {
   if(trainer_pointer->spell_num != 0)
    if(trainer_pointer->spell_num >= 1 && trainer_pointer->spell_num
     <= (MAX_SPELLS + 1))
     sprintf(buf, "[SPELL] %s ",
spell_info[trainer_pointer->spell_num].name);
/*
or would it be easier to set up something like affected_bits, throw a
dump
to a buf, before displaying in medit type deal, anyways the principle is
there the method is still a bit vague to me.
*/
  else if(trainer_pointer->spell_num >= (MAX_SPELLS + 2) &&
  trainer_pointer->spell_num <= (MAX_SKILLS + 1))
   sprintf(buf, "[SKILL] %s ",
spell_info[trainer_pointer->spell_num].name);
  else
   sprintf(buf, "[ERROR] Invalid numeric assignment to
SKILL/SPELL!\r\n");
  }
 trainer_pointer = trainer_pointer->next;
}

Just some thoughts.... not quite sure, if I'm dead on with these
little writings, again.. any criticism and or pointers would be
greatly appreciated.

Thanks,

Bill
webremedies@home.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST