azerothcore-wotlk icon indicating copy to clipboard operation
azerothcore-wotlk copied to clipboard

fix(Scripts/Karazhan) Nightbane take off phase handling

Open sogladev opened this issue 1 year ago • 3 comments

Changes Proposed:

This PR proposes changes to:

  • [ ] Core (units, players, creatures, game systems).
  • [x] Scripts (bosses, spell scripts, creature scripts).
  • [ ] Database (SAI, creatures, etc).
  1. simplify invincibility until 3 flight phases are completed done
  2. If a new hp threshold has been hit while flying, skip ground phase and fly up again to do the next fly phase

Issues Addressed:

  • https://github.com/chromiecraft/chromiecraft/issues/6919

SOURCE:

The changes have been validated through:

  • [ ] Live research (checked on live servers, e.g Classic WotLK, Retail, etc.)
  • [ ] Sniffs (remember to share them with the open source community!)
  • [x] Video evidence, knowledge databases or other public sources (e.g forums, Wowhead, etc.)
  • [ ] The changes promoted by this pull request come partially or entirely from another project (cherry-pick). Cherry-picks must be committed using the proper --author tag in order to be accepted, thus crediting the original authors, unless otherwise unable to be found

WCL https://classic.warcraftlogs.com/reports/7nrz98TtXqRkdAj1#view=replay&fight=21, mentioned in https://github.com/chromiecraft/chromiecraft/issues/6919#issuecomment-2026213200

Tests Performed:

This PR has been:

  • [x] Tested in-game by the author.
  • [ ] Tested in-game by other community members/someone else other than the author/has been live on production servers.
  • [ ] This pull request requires further testing and may have edge cases to be tested.

How to Test the Changes:

  • [x] This pull request can be tested by following the reproduction steps provided in the linked issue
  • [ ] This pull request requires further testing. Provide steps to test your changes. If it requires any specific setup e.g multiple players please specify it as well.
  1. Go to Nightbane's Urn
  2. Trigger his fly by triggering hp tresholds at 75%, 50% and 25% a. .damage 1000000000 one shot on pull, see if 3 flight phases happen back to back b. dmg5 dmg7 gm spells to reduce damage to 75% to trigger phase, deal more damage past 50% and/or 25% to skip next ground phase c. deal damage to 75% to trigger phase. do not reduce past 50% and observe Nightbane starts ground phase
Go Nightbane urn
.go ga id 194092

1b damage
.damage 1000000000

 AoE to kill skeleton
.cast 71122

immunity, Nef's barrier
.cast 22663

reset the instance
.tele stormwind
.instance unbind all

Known Issues and TODO List:

  • [ ] could use a refactor. phase 1 = ground phase, phase 2 = once in the air and casting spells, _flying = transitioning from p1 to p2
  • [ ]

How to Test AzerothCore PRs

When a PR is ready to be tested, it will be marked as [WAITING TO BE TESTED].

You can help by testing PRs and writing your feedback here on the PR's page on GitHub. Follow the instructions here:

http://www.azerothcore.org/wiki/How-to-test-a-PR

REMEMBER: when testing a PR that changes something generic (i.e. a part of code that handles more than one specific thing), the tester should not only check that the PR does its job (e.g. fixing spell XXX) but especially check that the PR does not cause any regression (i.e. introducing new bugs).

For example: if a PR fixes spell X by changing a part of code that handles spells X, Y, and Z, we should not only test X, but we should test Y and Z as well.

sogladev avatar May 20 '24 17:05 sogladev

Not sure how it's implemented in this PR, but looking at the log commented in the linked issue, it does appear that the flight phases get queued when the HP thresholds are hit. Reading the issue implies the current flight phase should be interrupted and a new one started, which (again, to my perspective) contradicts the log.

heyitsbench avatar May 20 '24 17:05 heyitsbench

https://github.com/azerothcore/azerothcore-wotlk/pull/18935 Language is hard to express my thoughts, so I've created a PR that I'll close later. Can you take a look at it? @heyitsbench @sogladev

PkllonG avatar May 20 '24 19:05 PkllonG

From my understanding Nightbane cannot be killed until he completed 3 flight phases. Every 25% a flight phase is queue'd.

From the log, for the first <50% Nightbane does not land. I'm not sure why this one skips the landing and the second <25% makes him land.

I think the proper struct should be: once in the air there's a flight queue, once it's empty we do a landing. When an air phase is triggered while in the air, it gets queued. I suspect to do it like this requires more refactoring. Phase are awkward. It uses some bools _flying,_intro and hardcoded phase 1,2 and these are changed by scheduler, waypoints and updateAI

Phases/Groups like in TC make more sense but I wanted to get the logic right first

Struct from TC https://github.com/TrinityCore/TrinityCore/blob/ad97b442938b41d5ae0f61adbf41e57b3723ca84/src/server/scripts/EasternKingdoms/Karazhan/boss_nightbane.cpp#L94

CMangos https://github.com/cmangos/mangos-wotlk/blob/bd63be95ae8e084c748eb5129366a7533edc02c4/src/game/AI/ScriptDevAI/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp#L54

sogladev avatar May 20 '24 20:05 sogladev

Tested, seems to work as expected. 👍

heyitsbench avatar Jun 26 '24 21:06 heyitsbench

People complaining it doesnt land anymore/doesnt fly image

Nyeriah avatar Jun 29 '24 23:06 Nyeriah

People complaining it doesnt land anymore/doesnt fly

Is this after a wipe? I don't recognize his position as being stuck on a waypoint during intro or flight. More like he reset, got stuck and did not reach home which triggers despawn

sogladev avatar Jun 30 '24 08:06 sogladev

if the issue results when resetting, forcing the despawn after 10 seconds instead of JustReachedHome could prevent this solution

https://github.com/sogladev/azerothcore-wotlk/commit/4b23bb14a4512c436606235eeb5478fb45345d9d

sogladev avatar Jun 30 '24 09:06 sogladev

His despawn when reaching home was sniffed, why was this changed? I notice the position was changed, too

Nyeriah avatar Jun 30 '24 09:06 Nyeriah

His despawn when reaching home was sniffed, why was this changed? I notice the position was changed, too

Position const homePos = {-11003.7f, -1760.19f, 140.253f}; comes directly from the DB.

I found that loading a waypoint path changes Nightbane's home position to the start of the waypoint path. So on evade, it is reset to homePos

With https://github.com/sogladev/azerothcore-wotlk/commit/4b23bb14a4512c436606235eeb5478fb45345d9d he still goes to home position and despawns there, it just forces in case he doesn't make it there for some unknown reason, based on the pic above

sogladev avatar Jun 30 '24 09:06 sogladev

You can disregard the above, it's working as intended, I am sorry We had conflicts with another module

Nyeriah avatar Jun 30 '24 20:06 Nyeriah