void update_handler (void)
{
static int pulse_area;
static int pulse_mobile;
static int pulse_violence;
static int pulse_point;
CHAR_DATA *ch;
float get_speed( CHAR_DATA *ch, int slot )
{
float value = 4.00;
int i;
OBJ_DATA *wield;
if( !IS_NPC(ch) )
{
switch(slot) {
case SPEED_LH: wield = get_eq_char(ch,WEAR_HOLD_HAND_L); break;
case SPEED_RH: wield = get_eq_char(ch,WEAR_HOLD_HAND_R); break;
case SPEED_TAIL: wield = NULL; break;
default: wield = NULL; break;
}
if( wield != NULL && wield->item_type == ITEM_WEAPON )
value = wield->speed;
else
{
if( slot == SPEED_TAIL )
value = number_range(30,60);
for( i = ch->level; i > 0; i– )
value -= 0.01;
}
}
else
{
for( i = ch->level; i > 0 && value > 0.99; i -= 13 )
value -= 0.14;
}
value += stance_app[ch->stance].speed_mod;
if( (IS_NPC(ch) && IS_SET(ch->npcdata->skills,MOB_REFLEXES) && number_percent() < 80) || (!IS_NPC(ch) && number_percent() < ch->pcdata->learned[gsn_enhanced_reflexes]) )
value -= 0.02;
if( (IS_NPC(ch) && IS_SET(ch->npcdata->skills,MOB_SLEIGHT) && number_percent() < 80) || (!IS_NPC(ch) && number_percent() < ch->pcdata->learned[gsn_sleight_of_hand]) )
value -= 0.04;
if( (IS_NPC(ch) && IS_SET(ch->npcdata->skills,MOB_QUICKSTRIKE) && number_percent() < 80) || (!IS_NPC(ch) && number_percent() < ch->pcdata->learned[gsn_quickstrike]) )
value -= 0.06;
if( value < 1 )
value = 1;
return value;
}
void combat_update( void )
{
FIGHT_DATA *fight;
CHAR_DATA *ch;
CHAR_DATA *victim;
for( fight = first_fight; fight != NULL; fight = fight->next )
{
if( fight->ch == NULL )
{
//monitor_chan("Removing a null fight->ch from queue.",MONITOR_DEBUG);
UNLINK(fight,first_fight,last_fight,next,prev);
delete fight;
return;
}
if( fight->ch->fighting == NULL )
{
//monitor_chan("Removing a null fight->ch->fighting from queue.",MONITOR_DEBUG);
UNLINK(fight,first_fight,last_fight,next,prev);
delete fight;
return;
}
ch = fight->ch;
victim = ch->fighting;
/*
* Speed based combat. Arms attack independantly of each other,
* as do special racials such as fangs or tails. –Kline
*/
if( ch->position == POS_FIGHTING && victim != NULL )
{
/* Left hand attack (primary) */
ch->speed[SPEED_LH] -= 0.01;
if( ch->speed[SPEED_LH] <= 0 )
{
one_hit(ch, victim, TYPE_UNDEFINED);
ch->speed[SPEED_LH] = get_speed(ch,SPEED_LH);
}
/* Right hand attack (if we dualwield) */
if( (IS_NPC(ch) && IS_SET(ch->npcdata->skills,MOB_DUALWIELD)) || (!IS_NPC(ch) && ch->pcdata->learned[gsn_dualwield] > 10) )
{
ch->speed[SPEED_RH] -= 0.01;
if( ch->speed[SPEED_RH] <= 0 )
{
one_hit(ch, victim, TYPE_UNDEFINED);
ch->speed[SPEED_RH] = get_speed(ch,SPEED_RH);
}
}
/* Tail attack (if we have one) */
if( IS_SET(race_table[ch->race].race_flags,RACE_MOD_TAIL) )
{
ch->speed[SPEED_TAIL] -= 0.01;
if( ch->speed[SPEED_TAIL] <= 0 )
{
one_hit(ch,victim,(TYPE_HIT + 13));
ch->speed[SPEED_TAIL] = get_speed(ch,SPEED_TAIL);
}
}
}
}
}
for ( ch = first_fight; ch != NULL; ch = ch_next )
{
ch_next = ch->next_fight;
update.c
int get_pulse (CHAR_DATA * ch)
{
static int pulse_violence;
if (ch->class == 0) pulse_violence = 2; // sor
if (ch->class == 1) pulse_violence = 2; // bishop
if (ch->class == 2) pulse_violence = 2; // ninja
if (ch->class == 3) pulse_violence = 20; // hoplite
if (ch->class == 4) pulse_violence = 2; // templar
if (ch->class == 5) pulse_violence = 2; // avenger
if (ch->class == 6) pulse_violence = 2; // lich
if (ch->class == 7) pulse_violence = 2; // shaman
if (ch->class == 8) pulse_violence = 2; // druid
if (ch->class == 9) pulse_violence = 2; // assassin
if (IS_NPC(ch)) pulse_violence = 20;
return pulse_violence;
}
the numbers are strange cause im testing it.. my alt is a Hoplite, but his roundtime is still only 2 or at least it seems like it because rounds come in rapid succession…
update handler
if (–pulse_violence <= 0)
{
pulse_violence = get_pulse(ch);
violence_update ();
}
am i doing something wrong, where my hoplite char, isnt getting the pulse_violence 20 for roundtime while fighting?