Since I really didn't like the stock version of group exp distribution, I
wrote this. It works quite well and distributes about 99% of the mob's
normal exp to the group.
One note to this however, I have mobs set up to give players the entirety
of their exp (ie, you kill a mob, you gain GET_EXP(mob)). If you don't
have this, you need to change the line marked to reflect the way you have
exp set up.
anyhow, what it does is this:
1. Add up total number of group members present
2. Add up all the member's levels for a total group level
3. Each member receives ((their level * (mobs normal exp given))/ total
group level)
void group_gain(struct char_data * ch, struct char_data * victim)
{
int tot_members, base;
struct char_data *k;
struct follow_type *f;
int total_levels;
if (!(k = ch->master))
k = ch;
tot_members = 1;
for (f = k->followers; f; f = f->next)
if (IS_AFFECTED(f->follower, AFF_GROUP) && f->follower->in_room ==
ch->in_room)
tot_members++;
total_levels = GET_LEVEL(ch);
for (f = k->followers; f; f = f->next) {
if(f->follower->in_room == ch->in_room)
total_levels += GET_LEVEL(f->follower);
}
if(IS_AFFECTED(k, AFF_GROUP)) {
/* Change this to reflect your exp system
VVVVVVVVVVVVV */
base = (GET_LEVEL(k) * GET_EXP(victim))/total_levels;
perform_group_gain(k, base, victim);
}
for (f = k->followers; f; f = f->next)
if(f->follower->in_room == ch->in_room) {
/* Change this to reflect your exp system
VVVVVVVVVVVVVV */
base = (GET_LEVEL(f->follower) * GET_EXP(victim))/total_levels;
perform_group_gain(f->follower, base, victim);
}
}
+------------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
| http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
+------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST