darkstar
darkstar copied to clipboard
Mob HP refilled erroneously, fills to fast when idle.
I have:
- [x] searched existing issues (http://github.com/darkstarproject/darkstar/issues/) to see if the issue I am posting has already been addressed or opened by another contributor
- [x] checked the commit log to see if my issue has been resolved since my server was last updated
Client Version (type /ver
in game) :
n/a
Source Branch (master/stable) : master
Additional Information (Steps to reproduce/Expected behavior) :
Ignore all of this, see new post below..
~~canRest() or EFFECTFLAG_NO_REST is basically broken for mobs, I am not sure which and I am to tired and frustrated to dig into this further.~~
The statsus effect disease has the following flags on it:
EFFECTFLAG_DEATH = 32, // исчезает при смерти
EFFECTFLAG_NO_REST = 4096, // prevents resting, curse II, plague, disease
EFFECTFLAG_WALTZABLE = 16384, // for healing waltzable spells
EFFECTFLAG_NO_CANCEL = 8388608, // CAN NOT CLICK IT OFF IN CLIENT
~~If you add it to a mob in onMobSpawn, that mob will still regenerate when idle~~ even though this code in BattleEntity:
bool CBattleEntity::CanRest()
{
return !getMod(Mod::REGEN_DOWN) && !StatusEffectContainer->HasStatusEffectByFlag(EFFECTFLAG_NO_REST);
}
which is checked by THIS CODE in the mob controller:
// can't rest with poison or disease
if (PMob->CanRest())
{
// recover 10% health
if (PMob->Rest(0.1f))
{
// health updated
PMob->updatemask |= UPDATE_HP;
}
if (PMob->GetHPP() == 100)
{
// at max health undirty exp
PMob->m_giveExp = true;
}
}
says it should not.
SO SOME KNUCKLEHEAD MADE IT SO IF THE ZONE GOES EMPTY, EVERY ENTITY STILL IN IT GETS FULL HIT POINTS WHEN SOMEONE ENTERS AGAIN. OBVIOUSLY NOT WHAT HAPPENS ON RETAIL. EVER.
Some NMs on retail I was only able to solo by zoning them and the resuming the battle before they recovered. Can't do that as it stands on Darkstar.
Separate, unconfirmed: sure as F feels like idle mobs heal quicker here than they do on retail also. Tested by putting a mule in zone so it would not trip the above "empty zone refill" bug.
I think the only way to handle that is by not suspending the zone timers for unoccupied zones, which obviously has some performance implications. Maybe we could consider only suspending it if every mob is already full hp, or making a config option to not suspend them
we should just be restoring the HP the mob previously had on resume, rather than totally resetting it.
Now I wonder - does an empty zone wipe local vars off entities that were in it, like if an NPC uses a localvar for something and the zone goes empty is that lost?