diff options
| author | Meji <alvaromegias_46@hotmail.com> | 2022-02-08 23:23:05 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-08 23:23:05 +0100 |
| commit | 27cba3f52309dad5be964fec11d80cd8cad128cf (patch) | |
| tree | 8ce682a72a850b37dba9cc4756e4b91fe532b142 /src/server/scripts | |
| parent | 8e2d1e328ebec60c76d65651b268ec3ad2ce26fc (diff) | |
Core/Scripts: Added script hook to execute actions after completing an achievement (#27718)
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/World/achievement_scripts.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 62a7621db79..30364ac5fe6 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -18,8 +18,10 @@ #include "ScriptMgr.h" #include "BattlegroundSA.h" #include "BattlegroundIC.h" +#include "BattlePetMgr.h" #include "Creature.h" #include "Player.h" +#include "WorldSession.h" class achievement_resilient_victory : public AchievementCriteriaScript { @@ -289,6 +291,31 @@ class achievement_killed_exp_or_honor_target : public AchievementCriteriaScript } }; +// 7433 - Newbie +class achievement_newbie : public AchievementScript +{ +public: + achievement_newbie() : AchievementScript("achievement_newbie") { } + + void OnCompleted(Player* player, AchievementEntry const* /*achievement*/) override + { + player->GetSession()->GetBattlePetMgr()->UnlockSlot(BattlePets::BattlePetSlot::Slot1); + // TODO: Unlock trap + } +}; + +// 6566 - Just a Pup +class achievement_just_a_pup : public AchievementScript +{ +public: + achievement_just_a_pup() : AchievementScript("achievement_just_a_pup") { } + + void OnCompleted(Player* player, AchievementEntry const* /*achievement*/) override + { + player->GetSession()->GetBattlePetMgr()->UnlockSlot(BattlePets::BattlePetSlot::Slot2); + } +}; + void AddSC_achievement_scripts() { new achievement_resilient_victory(); @@ -309,4 +336,6 @@ void AddSC_achievement_scripts() new achievement_not_even_a_scratch(); new achievement_flirt_with_disaster_perf_check(); new achievement_killed_exp_or_honor_target(); + new achievement_newbie(); + new achievement_just_a_pup(); } |
