PDA

View Full Version : Haste/Slow not working on NPCs


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;

Rhodan
11-03-2006, 10:11 AM
Was this noticed? I'm playing with 878 and none of my shaman's slows appear to work. I set up a level 50 shammy and cast the level 36(?) spell on a newbie mob - no change in attack speed.

KLS
11-03-2006, 12:44 PM
This should be fixed, though I changed how haste was calculated the other day, I'll have a look at it tonight to make sure I didn't mess anything up.

jeffpuff
11-03-2006, 01:21 PM
I can verify slow was fixed for a while, but stopped working as of .878 I have not tested .882 yet, the 11/02 post.

KLS
11-03-2006, 05:00 PM
Doesn't work as of the latest source, looking for the cause atm. Haste works but slow doesn't.. never saw anything like this when I was first testing haste changes, obviously something was fubared in the process.

Rhodan
11-03-2006, 06:40 PM
Gremlins, they sneak up on ya.

KLS
11-03-2006, 07:38 PM
I found what was wrong, really it was the entire implementation, should get a fixed version in as soon as I get an OK from a dev.

Rogean
11-04-2006, 06:20 AM
Should be fixed now with the source/binaries posted tonight.

Rhodan
11-04-2006, 11:00 AM
Cool. I just tried 898 and figured out that the mobs were being hasted by slows 8)

Aramid
11-04-2006, 03:29 PM
Cool. I just tried 898 and figured out that the mobs were being hasted by slows 8)

In 898 or the previous version???

Rhodan
11-04-2006, 03:42 PM
In 898 - the one I downloaded this morning

KLS
11-04-2006, 04:47 PM
Yeah the problem was 2 fold really, mostly inexperience with how haste was handled with bonuses by me, and no one really caught it when I submitted it to review. Essentially every haste was being calculated at (hasted%+100%) so a -30% slow was really a 70% haste cause of my screw up. And my code didn't totally overlooked slows when comparing it to the base value of 0(lol).

Rhodan
11-04-2006, 06:48 PM
Yeah but the real screw up was that you found it right away. You're supposed to be so caffinated that you work feverishly to find the problem for 28 hours straight - until you collapse from exhaustion and caffine overdose - then when you wake up and sit down in front of the computer again, you see the mistake in the first line of code.

At least, thats the way its supposed to work!

Rogean
11-04-2006, 08:56 PM
Yea, I fixed it up so that its calculated correctly, and there were a few other things that I fixed as well like V3 Haste does not have the +100 on its effect value, and bard skills should not affect the haste %, and haste should not be applied at all if slowed.

Rhodan
11-05-2006, 08:03 AM
Grabbed it this morning and it appears to be working. However, and this is just a first impression, it appears that the haste wears off faster than the 3:30 listed (perhaps that's 3:30 at level 50?). Also, the first time I slow a mob it seems to go slower than a re-slow. So a gnoll that hit me about every 3 seconds went to 7 seconds with the first slow and five seconds in the subsequent re-slow. I'll have to try this a few more times to make sure its not just me and my inconsistant 1 steamboat 2 steamboat counting ;)

KLS
11-05-2006, 12:51 PM
Noticed we no longer have hundred hands effects in there any more either, don't remember if you took that out or if I did when I redid it at first. Not like it was correctly implemented anyway in the old code. It's supposed to modify the base delay before haste by a percentage, it was just adding to the haste overcap percentage.. making it less effective than it should be in some cases.

ex:
A 40 delay weapon with 115% haste would lower the attack delay to 18.60 delay
A 40 delay weapon with 15% hundred hands would lower the base delay to 34 which then lowered by 100% haste would lower the attack delay to 17.00 delay

A 40 delay weapon with 65% haste would lower the attack delay to 24.24 delay
a 40 delay weapon with 15% hundred hands would lower the base delay to 34 which then lowered by 50% haste would lower the attack delay to 22.66 delay

Or something like that.

I don't really see why it would be slowing less and less each time unless perhaps it's your head. It's not really how the bonuses work, they don't check how many times the spell has been on a target just that it is on currently and they calc the value from that.

Edit: Actually I don't think I was thinking correctly on HH. It does lower delay before haste but I think it's by value and not by a percentage, meh now I gotta go look up exactly how it works. See what happens when you don't play eqlive consistantly for a while.

Rogean
11-05-2006, 02:48 PM
It lowers by like 4 delay or something. Yes I took it out for now because it wasn't being calculated properly.