Jump to content

Support for bosses which do not move


Recommended Posts

this was my suggestion about this problem some time ago:

http://getmangos.eu/community/post/123998/#p123998

However after more researching, such selecting policy seems to be applied to any npc that doesn't move.

So likely a generic solution like

bool selectOnlyMeleeRangedTargets = GetMotionMaster()->GetMotionType() != CHASE_MOTION_TYPE || <IsRooted()>;

and the returned value is also not needed, as the needed scripts can very simple just use if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim()) to decide whether to use range-ability or normal melee

Link to comment
Share on other sites

  • 41 years later...

Ok, hi^^

The problem i have is, that bosses like lurker mussn´t move. So caster, or better, units auf of melee range can´t getting aggro from this boss.

I did some research for this problem, an i found some ugly methods to do this. Modify thread list and something else, nothing rly fine code.

So I did something else.

I put a bool in Unit class which checks if you can target a non melee target or not. The second thing I did, is to check this bool in "SelectHostileTarget", and lookup threadlist for a melee target if bool is false.

The question is, is this a good idea for you, or just another ugly method?

Or you have a better idea to realize that?

Here is the code for the modifications i did:

http://paste2.org/p/1384540

Link to comment
Share on other sites

Hm, maybe there needs to be a new function SelectHostileTargetInRange() that returns highest threat target in melee range else NULL. This hacking of SelectHostileTarget() is wrong; Ragnaros and The Lurker Below should target people in melee range and out of melee range, only they should prefer targets in melee range.

Current Ragnaros coding is wrong, Ragnaros should only aggro outside of melee range when no one is within melee wrong, not when the highest threat is outside of melee range.

Link to comment
Share on other sites

ok, that looks like, if you didn´t get some response for your patch :P

In my lurker script I had an issue with this patch, because, everytime when I want to turn him around (while casting spoute), and the melees are going away from him, he targets the another target, and so the "turn" was interupted (he turns, but the model still looks to his victim). So I thought, that a methode to deactivate this bool is needed. Of course, thats a speciel problem, but howewer, I wrote the patch for this boss :P

So, I think, there is core support needed. My way or another, thats your part to decide.

Link to comment
Share on other sites

You all talk about not-moving creatures. So it is not about generic behaviour (for all creatures i guess) of attacking highest threat target in melee range? I mean, if the tank with aggro on some creature is kiting it (is out of creature's melee range) then the tank is not getting hit by it. But when i come into this creature's melee range, then it will attack me, since the tank is out of melee range. Is this the same thing You are talking about? ;p

Link to comment
Share on other sites

I hope I finally got around the target selection correctly..

This patch I think is quite good at the actual needed changes to support prefering melee-targets, however this patch is extremely week regarding _which_ mobs should do so.

This needs more ideas and more work to get it done nicely

Edit: Fresh version

http://paste2.org/p/1400454

Notes about this patch:

* IsCombatStationary() equals "should prefer melee targets"

-- IsCombatStationary is just a basic check, but should be alright for nearly all cases I think

-- There are serious problems with such a simple function, currently I don't know how to handle this best.

* Unit::SelectHostileTarget

-- Remove special handling for first taunter, but perhaps I didn't understand the reason for it, in this case this part needs to reverted, and the first taunter needs the additional check ... caster->isAlive() && !IsCombatStationary() || CanReachWithMeleeAttack(caster) )

-- Add range check in case the mob needs it

* ThreatContainer::selectNextVictim

-- Fix a bug that in case the previous target is second-choice target and last in threat list - in this case it was not removed from threat comparision

-- Fix a bug preventing to select valid targets due to the 1.3 and 1.1 threat rules but previous target is now invalid

-- Fix a bug discarding valid targets due to threat rules, but previous target is invalid (and has lower threat)

-- Hopefully improve code readability (especially the ifs with many || or &&

-- If we need to prefer melee Targets, every ranged target is a second-choice target in the selection, this way - if possible any melee target will be preferred;

Remark that there is no order of second-choice target, so a ranged target is equally second choice for a stationary mob as an ie immune target, I think this is good enough for all real cases

Edit:

You all talk about not-moving creatures. So it is not about generic behaviour (for all creatures i guess) of attacking highest threat target in melee range? I mean, if the tank with aggro on some creature is kiting it (is out of creature's melee range) then the tank is not getting hit by it. But when i come into this creature's melee range, then it will attack me, since the tank is out of melee range. Is this the same thing You are talking about? ;p

Hmm, you are saying that:

normal moving mobs _should_ attack enemies in melee range, without switching whom they are chasing?

Link to comment
Share on other sites

yes, then I think I probably did understand you wrong, and you actually suggested, what I already put some thoughts to :)

Though there are very serious problems how to handle hunter or caster mobs (likely they just ignore being rooted) - and this is a problem for many many mobs, and yet no good idea for this.. :(

Link to comment
Share on other sites

one more thing, maybe related to this. on offi, when you enable "show target of target" when boss casts spell you can clearly see that it is always changing current target. For example KelThuzad use his frostbolts on random raid member so for spellcast time he switch target from main agroo to current target.

Link to comment
Share on other sites

  • 3 weeks later...

partly related.

I guess we simply must extend DoCastSpellIfCan to set caster's targetGuid to be the spell-target (in case of successfull casting without triggered)

and then prevent to call AttackStart while mobs are casting (this is at least also here in SelectHostileTarget)

Main problem I atm see are AoE spells which have self as target, what happens for them? (target self, or target empty)?

Also there might comeup problems with getVictim which is afaik the one in targetGuid

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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