-
-
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
feat(Core/SAI): implement SMART_ACTION_DISABLE_REWARD #21105
base: master
Are you sure you want to change the base?
The head ref may contain hidden characters: "some-sai-s\u00F6tuff"
Conversation
Kitzunu so i was trying to test this. So you have add a new SAI ACTION (238) Which allows to choose disabling or enabling reputation gain or loot (or both). I was able to test by having action_param 2 set to 1 (true) to disable the loot. But I'm unable to do the same for the reputation. (param_1) Using the following settings to test: -- Adds Hydraxian Rep Gain (40) from to Hogger upon being killed.
DELETE FROM `creature_onkill_reputation` WHERE (`creature_id` = 448);
INSERT INTO `creature_onkill_reputation` (`creature_id`, `RewOnKillRepFaction1`, `RewOnKillRepFaction2`, `MaxStanding1`, `IsTeamAward1`, `RewOnKillRepValue1`, `MaxStanding2`, `IsTeamAward2`, `RewOnKillRepValue2`, `TeamDependent`) VALUES
(448, 749, 0, 5, 0, 40, 0, 0, 0, 0);
-- Upon death disables "loot" for Hogger
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(448, 0, 4, 0, 6, 0, 100, 0, 0, 0, 0, 0, 0, 0, 238, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'When Hogger Dies Can\'t be Looted');
|
I will look. But I am pretty sure rep is handed out on kill, which means you have to disable it prior. So for example on spawn |
I can test this on the unit init via sai for the rep one. And give you my result in a bit |
I am working on it, wait |
Understood, ping me when I can test it again |
Yeah this is fucked. Unit::Kill() is called before the unit actually dies, which then calls RewardPlayerAndGroupAtKill() and goes into a rabbit hole of functions calling functions until it gives rep. So rep gain is actually awarded before the unit is dead, hence why the action doesn't work |
Changing the event to OnAggro (4) makes it work |
So for me, this is good to go. The fact the core calculates and rewards before the kill is outside the scope of the pr to fix |
Let me test it with on aggro and initiate tests to see the results so give me a moment |
Using ai_init (37) or aggro works fine. Whenever the entry gets make for the wiki it's keep intention that rep disabling has be perfomered before the unit is not dead. -- Upon death disables rep gain and "loot" for Hogger
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(448, 0, 4, 0, 37, 0, 100, 0, 0, 0, 0, 0, 0, 0, 238, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Hogger - On Initialize - Disable Hogger Rep gain and Loot drop'); (for anyone else who wants to test the sql above). But it's working as intended. |
this will fix it #21210 |
Want to me test the other PR when this one gets merged? |
Do what you want, it works |
Changes Proposed:
This PR proposes changes to:
Issues Addressed:
SOURCE:
The changes have been validated through:
Tests Performed:
This PR has been:
How to Test the Changes:
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.