-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Feature: OnGiveReputation override for Reputation Modification #21156
Comments
In ScriptMgr in line 314 is already a method Is this good enough? |
Thank you for pointing that out! While If this could be added to |
Describe your feature request or suggestion in detail
I propose the implementation of a hook system similar to the existing
OnGiveXP
, but specifically for reputation gain. This new hook, tentatively calledOnGiveReputation
, would allow developers to intercept and modify the amount of reputation a player gains in various scenarios.The main use cases for this feature include:
Describe a possible solution to your feature or suggestion in detail
A potential way to implement this feature is to insert hooks in the following functions:
Player::RewardReputation(Unit* victim)
Player::RewardReputation(Quest const* quest)
In both cases, right before the
GetReputationMgr().ModifyReputation()
call, we could introduce a hook that allows scripts to modify the reputation value.This hook could look like this:
void OnGiveReputation(Player* player, int32 factionId, float& amount, ReputationSource source);
Call Examples:
ModifyReputation()
.That should be close to how OnGiveXP works I believe.
Additional context
Here is an example of how OnGiveReputation could be used:
Yes very creative :)
The text was updated successfully, but these errors were encountered: