Not sure if it work, but it should do it.
int nbcharmies = 0;
....
for ( gch = char_list; gch != NULL; gch = gch->next )
{
if ( is_same_group( gch, ch )
&& (gch->master == ch)
&& (IS_AFFECTED(gch,AFF_CHARM))
)
nbcharmies++;
}
Jerome Despret
Fallen Angels Mud & FAERIE area editor
http://fangels.wolfpaw.net
The Sims Online.
Oracle DB Architect - Software Engineer.
-----Original Message-----
From: Nitrocitrus [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 06, 2002 10:07 AM
To: [email protected]
Subject: Charm limit question
A while ago I put in a limit for how many mobs that
players can charm, and I also did the same for animate
corpses for necromancers.
The way I did it was I'd check who was in the room,
check if they're in the same group as the charmer, and
do some calculations there to see they're able to add
more charmies to the group. The problem I found is
that charmers would just push their charmies out of
the room to avoid the limitations. So I'd like to
make the check be a little more global.
Here's what I've done now (in the spell functions for
animate corpse and charm person):
for (d = descriptor_list; d; d = d->next)
{
xch = ( d->original != NULL ) ? d->original :
d->character;
if (is_same_group (ch, xch))
{
if (IS_NPC(xch))
{
members++;
total_levels += xch->level;
}
}
}
Then what I do is compare to see if the group members
are too high to allow more charmies, or if the
combined levels of all the grouped mobs are too high
to allow more, etc.. Like this:
if (members >= 5)
{
send_to_char("You already have a large enough
following.\n\r", ch);
return;
}
When I test it, I can charm as many people I want with
no limit. Does anyone have any idea why it isn't
working? Thanks.
__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom