Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game/AI: Implement option to move a creature back to Homeposition on Evade. #24492

Merged
merged 8 commits into from
Sep 11, 2020

Conversation

Rushor
Copy link
Contributor

@Rushor Rushor commented Apr 23, 2020

…Evade.

Changes proposed:

Target branch(es): 3.3.5/master

  • 3.3.5

Issues addressed: Closes # (insert issue tracker number)

#24226
Tests performed: (Does it build, tested in-game, etc.)
yes

Known issues and TODO list: (add/remove lines as needed)

  • nothing
  • [ ]

…Evade.

* If ToHomePosition (action param 1) is 1 > Move to last stored position
* If ToHomePosition (action param 1) is 0 > Move to homeposition
* Ref: TrinityCore#24226
@Killyana
Copy link
Contributor

Can you add an other param walk/run ?

@Rushor
Copy link
Contributor Author

Rushor commented Apr 23, 2020

Why not adding it with the existing Action setwalk/run?

Should it run by default?

@Killyana
Copy link
Contributor

Yes it must run by default, but as we will update existing SAI it's easier to just update the current line than adding an extra one for walk.

@Rushor
Copy link
Contributor Author

Rushor commented Apr 23, 2020

okay cool, i will see if it is possible

@Rushor
Copy link
Contributor Author

Rushor commented Apr 23, 2020

@Killyana added, if param walkmode 0 run by default

@Killyana
Copy link
Contributor

Killyana commented Apr 23, 2020

I tested this issue #23917
The taunkas around Roanauk must evade to home position walking when the event ends.
But they just stay there:
image

UPDATE `smart_scripts` SET action_param1=0, action_param2=1 WHERE `entryorguid` IN( -102327,-102329,-102326,-102330,-102328,-102341,-102333) AND action_type=24;

…osition and store point from GetRespawnPosition.
@Rushor
Copy link
Contributor Author

Rushor commented Apr 23, 2020

@Killyana okay i think the homeposition was not stored here - and name was wrong.

what we want: if paramter is 0 > move creature to the spawnposition.

what i changed:

if action_param1 (ToRespawnPosition) = 0, store new homeposition from respawnposition and move to it.

@Killyana
Copy link
Contributor

It works fine now, thanks.
I need to some tests for other situations to be sure nothing get broken.

@Killyana
Copy link
Contributor

Npcs always run on evade whatever the value of action_param2

@Rushor
Copy link
Contributor Author

Rushor commented Apr 27, 2020

hm i cannot see the reason why they always run

@jackpoz
Copy link
Contributor

jackpoz commented Apr 29, 2020

hm i cannot see the reason why they always run

@jackpoz
Copy link
Contributor

jackpoz commented May 10, 2020

should the walk/run bit be ignored and merge the PR the way it is now ?

@ghost
Copy link

ghost commented May 10, 2020

Could be a useful incentive to fix the mentioned walk/run issue if the current functionality becomes available to all. From what we have seen too often, testing does not take place until the code is published.


edit: I meant "committed/merged", remembering that "available to all" and "published" usually means "present on GitHub in any form" to most experienced coders.

@Rushor
Copy link
Contributor Author

Rushor commented May 10, 2020

hm yeah then let's merge that "remove to home" fix first. i will remove the option with walk/run again.

or i must copy the function of GetMotionMaster()->MoveTargetedHome(); and define the

what would you suggest?

@Killyana
Copy link
Contributor

In thins case make the npc return to home pos if there's no escort, and evades to the last point if it evades after a combat, no need to add an extra param

@jackpoz
Copy link
Contributor

jackpoz commented Jun 6, 2020

what's the status of this PR ?

@jackpoz
Copy link
Contributor

jackpoz commented Jul 29, 2020

jackpoz commented on Jun 6
what's the status of this PR ?

2nd try: what's the status of this PR ?

@ghost
Copy link

ghost commented Jul 29, 2020

Hello, @Rushor . Thanks for the code to the "Force of Neltharaku" PR which is merged now.
I see you have been active about 2 days ago.
Everything OK, I hope?

@jackpoz
Copy link
Contributor

jackpoz commented Aug 29, 2020

Setting the status of this PR back to Draft as there are still some things left to do. Please mark it as ready for review once they have been handled.

@jackpoz jackpoz marked this pull request as draft August 29, 2020 11:05
@jackpoz jackpoz marked this pull request as ready for review September 11, 2020 19:06
@jackpoz jackpoz merged commit 02fca03 into TrinityCore:3.3.5 Sep 11, 2020
@jackpoz
Copy link
Contributor

jackpoz commented Sep 11, 2020

Thanks for the PR :)

Shauren pushed a commit that referenced this pull request Feb 6, 2022
… Evade. (#24492)

* Game/AI: Implement option to move a creature back to Homeposition on Evade.

* If ToHomePosition (action param 1) is 1 > Move to last stored position
* If ToHomePosition (action param 1) is 0 > Move to homeposition
* Ref: #24226

* Add parameter for walkmode

* Game/AI: SAI SMART_ACTION_EVADE - Rename ToHomePosition to ToRespawnPosition and store point from GetRespawnPosition.

* Game/AI: SAI SMART_ACTION_EVADE - Rename ToHomePosition to ToRespawnPosition

* Remove broken bits, simplify the code

* Update comments

* Code cleanup

Co-authored-by: jackpoz <giacomopoz@gmail.com>
(cherry picked from commit 02fca03)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants