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

Core/UnitAI: Rework creature-controlled player behavior. #16644

Merged
merged 1 commit into from
Feb 24, 2016

Conversation

Treeston
Copy link
Contributor

Core/UnitAI: Rework creature-controlled player behavior.

  • Removed hacked control mechanism, use proper PlayerAI instead
  • Port old hacky code to new SimpleCharmedPlayerAI class
  • Make adjustments to aforementioned code to fix bugs:
    • Properly clean up movement after charm ends
    • Only try to attack a target if charmer is engaged in combat
  • Allow CreatureAI to override the AI applied to players charmed by its creature on a case by case basis

Fixes #4723.

@P-Kito
Copy link
Contributor

P-Kito commented Feb 19, 2016

This is for creatures that charm players right?

Charmed players blow their cooldowns, this should also be implemented in this commit.

@Treeston
Copy link
Contributor Author

For now I want to merge a basic generic player AI that works. After that, we can iterate easily on this to create smarter charmed player behavior.

@Keader
Copy link
Contributor

Keader commented Feb 19, 2016

This will be fix on future? #15379

--Edit

Treeston you are my hero !

@Treeston
Copy link
Contributor Author

Yes, that's what I'm referring to for future iterations.

@@ -1022,6 +1023,8 @@ class Player : public Unit, public GridObject<Player>
explicit Player(WorldSession* session);
~Player();

PlayerAI* AI() const { return (PlayerAI*)i_AI; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Treeston Treeston force-pushed the 3.3.5-customcharmai branch 2 times, most recently from bbd9581 to 16ddde4 Compare February 20, 2016 18:47
@Treeston
Copy link
Contributor Author

Change summary:

  • Moved all player AI related classes from UnitAI code to its own PlayerAI.cpp/PlayerAI.h.
  • Ranged classes now use ranged attacks instead of closing to melee range. This excludes healers (anecdotally blizzlike).

@P-Kito
Copy link
Contributor

P-Kito commented Feb 20, 2016

Looks good, well done

@Treeston Treeston force-pushed the 3.3.5-customcharmai branch 3 times, most recently from 125e7f5 to 2f14664 Compare February 23, 2016 12:40
- Removed hacked control mechanism, use proper PlayerAI instead
- Port old hacky code to new SimpleCharmedPlayerAI class
- Make adjustments to aforementioned code to fix bugs:
    - Properly clean up movement after charm ends
    - Only try to attack a target if charmer is engaged in combat
Treeston added a commit that referenced this pull request Feb 24, 2016
Core/UnitAI: Rework creature-controlled player behavior.
@Treeston Treeston merged commit 4e4b2b9 into TrinityCore:3.3.5 Feb 24, 2016
@Treeston Treeston deleted the 3.3.5-customcharmai branch February 24, 2016 12:39
@P-Kito
Copy link
Contributor

P-Kito commented Feb 26, 2016

Spells! We need Spells! 🎯

@Treeston
Copy link
Contributor Author

Sure, once we figure out #16687 so it looks less stupid when I make them cast.

}
}

std::cout << "Selected " << rangedAttackSpell << std::endl;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already fixed in 1fbe797

Shauren pushed a commit that referenced this pull request Apr 8, 2016
Core/UnitAI: Rework creature-controlled player behavior.
(cherry picked from commit 4e4b2b9)
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.

4 participants