Skip to content

feat(Core/SmartAI): introduce new SMART_EVENT_IS_IN_MELEE_RANGE - #20575

Merged
Nyeriah merged 13 commits into
azerothcore:masterfrom
sogladev:feat(Scripts/SmartAI)implement-SMARTCAST_NO_CAST_IN_MELEE
Nov 20, 2024
Merged

feat(Core/SmartAI): introduce new SMART_EVENT_IS_IN_MELEE_RANGE#20575
Nyeriah merged 13 commits into
azerothcore:masterfrom
sogladev:feat(Scripts/SmartAI)implement-SMARTCAST_NO_CAST_IN_MELEE

Conversation

@sogladev

@sogladev sogladev commented Nov 15, 2024

Copy link
Copy Markdown
Member

Changes Proposed:

This PR proposes changes to:

  • Core (units, players, creatures, game systems).
  • Scripts (bosses, spell scripts, creature scripts).
  • Database (SAI, creatures, etc).

Issues Addressed:

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!)
  • 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

Tests Performed:

This PR has been:

  • 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:

  • 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.

.go c id 24999

  1. pull from max range, after ~1.5sec, fireball cast
  2. pull and move into melee range, no fireball cast

Known Issues and TODO List:

  • [ ]
  • [ ]

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.

Prevents non-instant spell casting if victim is in melee
@github-actions github-actions Bot added DB related to the SQL database CORE Related to the core file-cpp Used to trigger the matrix build labels Nov 15, 2024
@avarishd

Copy link
Copy Markdown
Contributor

We can just use SMART_EVENT_RANGE instead of SMART_EVENT_UPDATE_IC.

@sogladev

Copy link
Copy Markdown
Member Author

We can just use SMART_EVENT_RANGE instead of SMART_EVENT_UPDATE_IC.

There's no way to input melee range in the RangeMax though. It depends on the target

Ofcourse, you can just put in 5 or 8 and call it good enough 😆

@avarishd

Copy link
Copy Markdown
Contributor

There has to be a better way to do this, perhaps a 7th param for event_range that does that range calculation, or a specific number for both distances that does that calculation (e.g 9999 on both)?

@TheSCREWEDSoftware

Copy link
Copy Markdown
Contributor

In keira take a look at npc Sunfury Archer see if that it has something than what youre trying to implement but with the current tools

@avarishd

Copy link
Copy Markdown
Contributor

19707 is an abomination.

@TheSCREWEDSoftware

Copy link
Copy Markdown
Contributor

It is but this may be enough to have an example for a melee

image

@Rorschach91

Rorschach91 commented Nov 15, 2024

Copy link
Copy Markdown
Member

It is but this may be enough to have an example for a melee

image

We can certainly learn something, but this type of smartai were probably created 1 or 2 years ago.
The smartscript was updated the last summer, so many of these events are probably no longer necessary.

@TheSCREWEDSoftware

Copy link
Copy Markdown
Contributor

It is but this may be enough to have an example for a melee
image

We can certainly learn something, but this type of smartai were probably created 1 or 2 years ago. The smartscript was updated the last summer, so many of these events are probably no longer necessary.

Do you have any newer Smart AI entries that could be used an a better example?

@Rorschach91

Copy link
Copy Markdown
Member

@sogladev What's the state of this PR?

@sogladev

Copy link
Copy Markdown
Member Author

@sogladev What's the state of this PR?

This can be reviewed. I did not find another approach than to introduce a cast flag

@Rorschach91

Rorschach91 commented Nov 16, 2024

Copy link
Copy Markdown
Member

@sogladev What's the state of this PR?

This can be reviewed. I did not find another approach than to introduce a cast flag

Ok, tested.

Currently the irespeaker go too near to the player when taunted (It should not come close to the player).

Curse of Weakness should be used by the npc only when the player is in melee range (this is what I've noted in cata classic ptr).
When the player is in melee range, irespeaker shouldn't use Fel Fireball spell.
As I noted in Cata PTR, Fel Fireball doesn't consume irespeaker's mana.

Naturally my informations come from Cata Classic PTR, so I could be wrong, but unfortunally I've not other sources.

@sogladev

Copy link
Copy Markdown
Member Author

I think this might just need a new event similar to SMART_EVENT_IS_BEHIND_TARGET.
SMART_EVENT_IS_IN_MELEE_RANGE with a simple invert to state to be outside melee range.

I do wonder if this creature is using the correct spellIds? Usually spell ranges and cost are set in the spell info. Setting trigger flags to make it cost with 0 mana

does Irespeaker (24999) cast 35913 'Fel Fireball' and 'Fel Consumption' 45023 ?

@sogladev sogladev changed the title feat(Core/SmartAI): implement CastFlag SMARTCAST_NO_CAST_IN_MELEE feat(Core/SmartAI): introduce new SMART_EVENT_IS_IN_MELEE_RANGE Nov 17, 2024
@sogladev

sogladev commented Nov 17, 2024

Copy link
Copy Markdown
Member Author

Instead of using cast flags, added a new SMART_EVENT_IS_IN_MELEE_RANGE. This should work similar to SMART_EVENT_IS_BEHIND_TARGET

Also made the casts triggered to not cast mana

@Rorschach91

Rorschach91 commented Nov 17, 2024

Copy link
Copy Markdown
Member

does Irespeaker (24999) cast 35913 'Fel Fireball' and 'Fel Consumption' 45023 ?

I think that they use Fel Consumption only on the crystals near them.
They use Curse of Weakness when the player is in melee range and Fel Fireball from the distance.

@github-actions github-actions Bot added the Script Refers to C++ Scripts for the Core label Nov 17, 2024
@github-actions github-actions Bot removed Script Refers to C++ Scripts for the Core Documentation labels Nov 17, 2024
@sogladev

sogladev commented Nov 17, 2024

Copy link
Copy Markdown
Member Author

Woops, never doing squash merge again. Extra labels

@Rorschach91

Copy link
Copy Markdown
Member

Irespeaker use Fel Fireball only one time, then she goes near the player.
https://github.com/user-attachments/assets/79044352-f3e6-44fd-9805-cc075d2b0c85

@sogladev

Copy link
Copy Markdown
Member Author

lowered the time between fireball events or the mob idles too long, does it look okay?

irespeaker_castflag_trigger_nocombatmov.mp4

@Rorschach91 Rorschach91 added Tested This PR has been tested and is working. and removed Waiting to be Tested labels Nov 20, 2024
@Rorschach91

Copy link
Copy Markdown
Member

It works now. It can be merged for me.

@Nyeriah Nyeriah added the Requires WIKI Update Wiki sources will need to be updated after merging this PR. label Nov 20, 2024
@Nyeriah
Nyeriah merged commit 640f84e into azerothcore:master Nov 20, 2024
jorge990125 pushed a commit to jorge990125/azerothcore-wotlk that referenced this pull request Nov 22, 2024
@sogladev sogladev removed the Requires WIKI Update Wiki sources will need to be updated after merging this PR. label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CORE Related to the core DB related to the SQL database file-cpp Used to trigger the matrix build Ready to be Reviewed Tested This PR has been tested and is working.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Quel'Danas Isle] Irespeakers don't fight as they should.

5 participants