Jump to content

[Patch] Creature LoS Aggro Cooldown


Guest Patman128

Recommended Posts

As most players of an official server will tell you, when you have low health and a monster spawns right next to you, just run like hell and you'll be fine. On retail servers, there is a universal delay between the time a creature spawns and when it will aggro with LoS. Unfortunately, there is no delay on mangos right now and creatures will attack you the instant they spawn.

This patch adds this functionality into mangos. It isn't the biggest improvement, but it is annoying when you die because you have 5 HP and Hogger decided to respawn at that exact moment.

Patch: http://paste2.org/p/895248

Have fun. :D

Link to comment
Share on other sites

Well, my experiance on the official servers is that it's damn random. Sometimes they wait for some seconds, sometimes they don't. I think it'äs related whether the mob is suspected to be killed very often (like daily quest mobs) or a more seldom killed mob (like a lone wolf). The daily quest mob will ignore the CD.

Link to comment
Share on other sites

I bet that before daily quests came out they didn't have an entry for this CD in the database. Then, when daily's came out they were like "Oh crap, we need these guys to attack right away!", added the field in, and set all older mobs to a certain timer.

Sounds like a dev thing to do :).

Link to comment
Share on other sites

Also you might want to fix another related bug sometimes when mob respawns he has a leveling effect. As if it just leveled.

1st: that's not related to this patch

2nd: that's probably caused by the "minlevel" and "maxlevel" entries in the database, if a mob respawns he might get checked through that spawn system again and given a random level between min and max (not sure though)

Link to comment
Share on other sites

Maybe there should be some kind of exception for summoned creatures.

if (checkcooldown && m_aggroDelay > 0 && !getPetType() == SUMMON_PET)
   return false;

dunno if the pet has already been defined in the file targetted by the patch, otherwise it will need one ( Pet *pet = GetPet(); )

not only summoned creatures need to be excepted, all pets should be (right?)

if (checkcooldown && m_aggroDelay > 0 && !pet)
   return false;

Link to comment
Share on other sites

if (checkcooldown && m_aggroDelay > 0 && !getPetType() == SUMMON_PET)
   return false;

dunno if the pet has already been defined in the file targetted by the patch, otherwise it will need one ( Pet *pet = GetPet(); )

not only summoned creatures need to be excepted, all pets should be (right?)

if (checkcooldown && m_aggroDelay > 0 && !pet)
   return false;

1. I have already added a method for ignoring the check, which you can use simply by setting the boolean param (checkcooldown) to false (it is by default true) in the CanInitiateAttack() call.

2. This function is never used by PetAI, it is only called in AggressorAI and CreatureEventAI.

So no exception for pets is needed.

Link to comment
Share on other sites

I tested some randomly chosen mob in a start area, and the little bugger attacked me right as he respawned (entry 1718 for the record). If i add some goodwill to it, it may have been a small delay of 0.5 seconds, but nothing i would really mention as a "feature".

As conclusion, I agree with the several who point out that they doesn't do this always. It should be very simple for others to verify it. Further research and adjustments are needed before this can be accepted in my opinion.

Link to comment
Share on other sites

  • 1 month later...

I think we not need additional field.

We have currently Creature::m_needNotify that set to true if grids updates detect for example player move in visibility range

This flag let call Creature reaction not from deep call stack place but from main server loop, from Creature::Update

Sometime ago has been discussed replacing this bool variable by time_t variable

this let for example proccess reactions not at next tick but for example one in 2-3-... ticks for CPU less load, without visible changes for players

In this case field set to now + reaction_delay (possible from config) if not set to time > now currently,

and Creature::Update call reaction proccessing only when time expired.

It easy can be reuse also for aggro delay at respawn: just at respawn set timer = now + 5 secs

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use