KLS
10-08-2006, 06:06 PM
I think I've found the issue with this, slow / haste will not apply until the NPC changes targets.
void NPC::SetTarget(Mob* mob) {
if(mob == target) //dont bother if they are allready our target
return;
if (mob) {
SetAttackTimer();
} else {
ranged_timer.Disable();
attack_timer.Disable();
attack_dw_timer.Disable();
}
target = mob;
}
the attack timer is only set when a NPC changes targets but a player's attack timer is set to change when he/she recalculates their item bonuses which happens whenever their calcbonuses goes off, which is why haste and slows seem to affect them perfectly but have hit and miss results with mobs.
Change Mob::CalcBonuses() to
void Mob::CalcBonuses()
{
CalcSpellBonuses(&spellbonuses);
CalcMaxHP();
CalcMaxMana();
SetAttackTimer();
rooted = FindType(SE_Root);
}
This issue isn't directly related to the first but I found it while testing the first out so.. if you snare something for more than 100% it will blink to you, this isn't an issue for anyone but a bard with a decent instrument mod(which was the character I was testing with). Using a 18 mod from singing short sword and Largo's Absonant Binding I'm able to get something like a -117% move speed, which then makes them run faster than the speed of light.
in Mob::_GetMovementSpeed()
find:
int movemod = spellbonuses.movementspeed + itembonuses.movementspeed + mod;
if (movemod != 0)
speed_mod += float(movemod) / 100.0f;
and change it to
int movemod = spellbonuses.movementspeed + itembonuses.movementspeed + mod;
if(movemod < -85) //cap it at moving very very slow
movemod = -85;
if (movemod != 0)
speed_mod += float(movemod) / 100.0f;
void NPC::SetTarget(Mob* mob) {
if(mob == target) //dont bother if they are allready our target
return;
if (mob) {
SetAttackTimer();
} else {
ranged_timer.Disable();
attack_timer.Disable();
attack_dw_timer.Disable();
}
target = mob;
}
the attack timer is only set when a NPC changes targets but a player's attack timer is set to change when he/she recalculates their item bonuses which happens whenever their calcbonuses goes off, which is why haste and slows seem to affect them perfectly but have hit and miss results with mobs.
Change Mob::CalcBonuses() to
void Mob::CalcBonuses()
{
CalcSpellBonuses(&spellbonuses);
CalcMaxHP();
CalcMaxMana();
SetAttackTimer();
rooted = FindType(SE_Root);
}
This issue isn't directly related to the first but I found it while testing the first out so.. if you snare something for more than 100% it will blink to you, this isn't an issue for anyone but a bard with a decent instrument mod(which was the character I was testing with). Using a 18 mod from singing short sword and Largo's Absonant Binding I'm able to get something like a -117% move speed, which then makes them run faster than the speed of light.
in Mob::_GetMovementSpeed()
find:
int movemod = spellbonuses.movementspeed + itembonuses.movementspeed + mod;
if (movemod != 0)
speed_mod += float(movemod) / 100.0f;
and change it to
int movemod = spellbonuses.movementspeed + itembonuses.movementspeed + mod;
if(movemod < -85) //cap it at moving very very slow
movemod = -85;
if (movemod != 0)
speed_mod += float(movemod) / 100.0f;