Class Roundtime, By Xrakisis
Whats this is gonna let you have is...
each class will have their own roundtime :)
here is my violence_upate, in fight.c
/* start */
/*
* Control the fights going on.
* Called periodically by update_handler.
*/
void violence_update (void)
{
CHAR_DATA *ch;
CHAR_DATA *ch_next;
CHAR_DATA *victim;
for (ch = char_list; ch != NULL; ch = ch_next)
{
ch_next = ch->next;
if ( ch->action[0] == ACTION_CASTING )
update_casting(ch);
if ((victim = ch->fighting) == NULL || ch->in_room == NULL)
continue;
if (IS_AWAKE (ch) && ch->in_room == victim->in_room)
{
if (--ch->init <= 0)
{
multi_hit (ch, victim, TYPE_UNDEFINED);
ch->init = get_speed(ch);
}
else continue;
}
else
stop_fighting (ch, FALSE);
if ((victim = ch->fighting) == NULL)
continue;
/*
* Fun for the whole family!
*/
check_assist (ch, victim);
if (IS_NPC (ch))
{
if (HAS_TRIGGER (ch, TRIG_FIGHT))
mp_percent_trigger (ch, victim, NULL, NULL, TRIG_FIGHT);
if (HAS_TRIGGER (ch, TRIG_HPCNT))
mp_hprct_trigger (ch, victim);
}
}
return;
}
/* end */
if i remember right the ch->init part is all i did to the update..
if (--ch->init <= 0)
{
multi_hit (ch, victim, TYPE_UNDEFINED);
ch->init = get_speed(ch);
}
/* Update.c */
-put this top line somewhere at the top
int get_speed args( ( CHAR_DATA *ch ) );
-then put this below
int get_speed (CHAR_DATA * ch)
{
int count = 20;
if (ch->class == 0) count -= 5; // sorcerer
if (ch->class == 1) count -= 10; // bishop
if (ch->class == 2) count -= 12; // ninja
if (ch->class == 3) count -= 15; // hoplite
if (ch->class == 4) count -= 13; // templar
if (ch->class == 5) count -= 13; // avenger
if (ch->class == 6) count -= 5; // lich
if (ch->class == 7) count -= 10; // shaman
if (ch->class == 8) count -= 10; // druid
if (ch->class == 9) count -= 13; // assassin
if (count < 2) count = 2;
if (count > 20) count = 20;
return count;
}
// find out which class coresponds to which ch->class number then set the
// roundtime you'd like them to have..
/* merc.h */
in this file change PULSE_VIOLENCE to...
#define PULSE_VIOLENCE ( 1 )
put this under ch struct
sh_int init;
i dont think you'll need to put anything in save.c for it.